diff --git a/Makefile b/Makefile index effa4d34..b7d1c904 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ generate: $(GOEXE) generate ./... .PHONY: generate +test: + $(GOEXE) test ./... +.PHONY: test + clobber: $(GOEXE) run ./generate/tools/clobbergen.go ./macos .PHONY: clobber diff --git a/generate/class.go b/generate/class.go index f474ba39..7753921b 100644 --- a/generate/class.go +++ b/generate/class.go @@ -51,6 +51,10 @@ func (db *Generator) ToClassGen(sym Symbol) *codegen.Class { } } if st.Interface.SuperName != "" { + // MPSGraphObject not documented, but we should assume its at least similar to NSObject + if st.Interface.SuperName == "MPSGraphObject" { + st.Interface.SuperName = "NSObject" + } if st.Interface.SuperName == "NSObject" { classGen.Super = &codegen.Class{ Type: typing.Object, diff --git a/generate/codegen/aliasinfo.go b/generate/codegen/aliasinfo.go index 784694fd..f1f34931 100644 --- a/generate/codegen/aliasinfo.go +++ b/generate/codegen/aliasinfo.go @@ -15,7 +15,15 @@ type AliasInfo struct { // IsString return if is a string type Enum func (e *AliasInfo) IsString() bool { - _, ok := e.Type.(*typing.StringType) + t := e.Type + for { + at, ok := t.(*typing.AliasType) + if !ok { + break + } + t = at.Type + } + _, ok := t.(*typing.StringType) return ok } diff --git a/generate/codegen/gen_method.go b/generate/codegen/gen_method.go index 25c96102..d1735463 100644 --- a/generate/codegen/gen_method.go +++ b/generate/codegen/gen_method.go @@ -36,8 +36,8 @@ func (m *Method) needRelease() bool { case *typing.PrimitiveType, *typing.StringType: return false } - return strings.HasPrefix(m.Name, "new") || !strings.HasPrefix(m.Name, "init") && strings.HasPrefix(m.Name, "Initial") || - strings.HasPrefix(m.Name, "copy") || strings.HasPrefix(m.Name, "mutableCopy") + //!strings.HasPrefix(m.Name, "init") && strings.HasPrefix(m.Name, "Initial") + return m.Name == "new" || m.Name == "copy" || m.Name == "mutableCopy" } // Selector return full Objc function name diff --git a/generate/codegen/gen_property.go b/generate/codegen/gen_property.go index 209ce84b..1006efb3 100644 --- a/generate/codegen/gen_property.go +++ b/generate/codegen/gen_property.go @@ -1,6 +1,8 @@ package codegen import ( + "strings" + "github.com/progrium/macdriver/generate/typing" "github.com/progrium/macdriver/internal/stringx" ) @@ -49,11 +51,11 @@ func (p *Property) getter() *Method { func (p *Property) setter() *Method { name := "set" + stringx.Capitalize(p.Name) if p.SetterName != "" { - name = p.SetterName + name = strings.TrimSuffix(p.SetterName, ":") } goName := "set" + stringx.Capitalize(p.GoName) if p.SetterName != "" { - goName = p.SetterName + goName = strings.TrimSuffix(p.SetterName, ":") } return &Method{ Name: name, diff --git a/generate/codegen/gen_protocol.go b/generate/codegen/gen_protocol.go index 970c69e2..1b6bac0c 100644 --- a/generate/codegen/gen_protocol.go +++ b/generate/codegen/gen_protocol.go @@ -140,6 +140,10 @@ func (p *Protocol) writeProtocolInterface(w *CodeWriter) { } } for _, m := range p.allMethods() { + // don't support class methods on protocols yet + if m.ClassMethod { + continue + } if !m.Required { w.WriteLine("// optional") } else { @@ -176,6 +180,10 @@ func (p *Protocol) writeDelegateStruct(w *CodeWriter) { receiver := "di" for _, m := range p.allMethods() { + // don't support class methods on protocols yet + if m.ClassMethod { + continue + } if !m.Required { w.WriteLine(fmt.Sprintf("func (%s *%s) Has%s() bool {", receiver, implStructName, m.ProtocolGoFuncName())) w.WriteLine(fmt.Sprintf("\t return %s._%s != nil", receiver, m.ProtocolGoFuncName())) @@ -235,6 +243,10 @@ func (p *Protocol) writeProtocolWrapperStruct(w *CodeWriter) { w.WriteLine("}") for _, m := range p.allMethods() { + // don't support class methods on protocols yet + if m.ClassMethod { + continue + } w.WriteLine("") if !m.Required { receiver := strings.ToLower(typeName[0:1] + "_") diff --git a/generate/codegen/modulewriter.go b/generate/codegen/modulewriter.go index aaa40bef..63630cb4 100644 --- a/generate/codegen/modulewriter.go +++ b/generate/codegen/modulewriter.go @@ -34,6 +34,14 @@ func (m *ModuleWriter) WriteCode() { // get "cannot find protocol declaration" with protocol imports return } + if m.Module.Package == "coremediaio" { + // get "cannot find protocol declaration" with protocol imports + return + } + if m.Module.Package == "fileprovider" { + // get "cannot find protocol declaration" with protocol imports + return + } m.WriteProtocolsImportCode() } diff --git a/generate/declparse/declparse_test.go b/generate/declparse/declparse_test.go index f64ad3b6..ced442bb 100644 --- a/generate/declparse/declparse_test.go +++ b/generate/declparse/declparse_test.go @@ -15,6 +15,20 @@ var tests = []struct { }, }, + { + ParseOnly: true, + s: `typedef enum SCPreferencesNotification : uint32_t SCPreferencesNotification;`, + n: &Statement{ + Enum: &EnumDecl{ + Name: "SCPreferencesNotification", + Type: TypeInfo{ + Name: "uint32_t", + }, + }, + Typedef: "SCPreferencesNotification", + }, + }, + { ParseOnly: true, // notice eNum is "enum" diff --git a/generate/declparse/parser_enum.go b/generate/declparse/parser_enum.go index 4300e243..9af89384 100644 --- a/generate/declparse/parser_enum.go +++ b/generate/declparse/parser_enum.go @@ -30,7 +30,8 @@ func parseEnum(p *Parser) (next stateFn, node Node, err error) { } if err := p.expectToken(lexer.LCURLY); err != nil { - return nil, nil, err + p.tb.Unscan() + return nil, decl, nil } if err = p.expectToken(lexer.VARARG); err != nil { diff --git a/generate/generator.go b/generate/generator.go index 32a63800..98d7ad4b 100644 --- a/generate/generator.go +++ b/generate/generator.go @@ -156,7 +156,7 @@ func (db *Generator) ResolveTypeAlias(typeName string) (declparse.TypeInfo, bool func (db *Generator) TypeFromSymbolName(name string) typing.Type { // hardcoded for now - if db.Platform == "macos" && strings.HasPrefix(name, "UI") { + if db.Platform == "macos" && strings.HasPrefix(name, "UI") && !strings.HasPrefix(name, "UInt") { name = "NS" + strings.TrimPrefix(name, "UI") } s := db.FindTypeSymbol(name) diff --git a/generate/modules/enums/macos/mediaplayer b/generate/modules/enums/macos/mediaplayer new file mode 100644 index 00000000..58d1ca59 --- /dev/null +++ b/generate/modules/enums/macos/mediaplayer @@ -0,0 +1,124 @@ +MPChangeLanguageOptionSettingNone 0 +MPChangeLanguageOptionSettingNowPlayingItemOnly 1 +MPChangeLanguageOptionSettingPermanent 2 +MPErrorCancelled 6 +MPErrorCloudServiceCapabilityMissing 2 +MPErrorNetworkConnectionFailed 3 +MPErrorNotFound 4 +MPErrorNotSupported 5 +MPErrorPermissionDenied 1 +MPErrorRequestTimedOut 7 +MPErrorUnknown 0 +MPMediaTypeAny -1 +MPMediaTypeAnyAudio 255 +MPMediaTypeAnyVideo 65280 +MPMediaTypeAudioBook 4 +MPMediaTypeAudioITunesU 8 +MPMediaTypeHomeVideo 8192 +MPMediaTypeMovie 256 +MPMediaTypeMusic 1 +MPMediaTypeMusicVideo 2048 +MPMediaTypePodcast 2 +MPMediaTypeTVShow 512 +MPMediaTypeVideoITunesU 4096 +MPMediaTypeVideoPodcast 1024 +MPNowPlayingInfoLanguageOptionTypeAudible 0 +MPNowPlayingInfoLanguageOptionTypeLegible 1 +MPNowPlayingInfoMediaTypeAudio 1 +MPNowPlayingInfoMediaTypeNone 0 +MPNowPlayingInfoMediaTypeVideo 2 +MPNowPlayingPlaybackStateInterrupted 4 +MPNowPlayingPlaybackStatePaused 2 +MPNowPlayingPlaybackStatePlaying 1 +MPNowPlayingPlaybackStateStopped 3 +MPNowPlayingPlaybackStateUnknown 0 +MPRemoteCommandHandlerStatusCommandFailed 200 +MPRemoteCommandHandlerStatusDeviceNotFound 120 +MPRemoteCommandHandlerStatusNoActionableNowPlayingItem 110 +MPRemoteCommandHandlerStatusNoSuchContent 100 +MPRemoteCommandHandlerStatusSuccess 0 +MPRepeatTypeAll 2 +MPRepeatTypeOff 0 +MPRepeatTypeOne 1 +MPSeekCommandEventTypeBeginSeeking 0 +MPSeekCommandEventTypeEndSeeking 1 +MPShuffleTypeCollections 2 +MPShuffleTypeItems 1 +MPShuffleTypeOff 0 +MPErrorDomain MPErrorDomain +MPLanguageOptionCharacteristicContainsOnlyForcedSubtitles public.subtitles.forced-only +MPLanguageOptionCharacteristicDescribesMusicAndSound public.accessibility.describes-music-and-sound +MPLanguageOptionCharacteristicDescribesVideo public.accessibility.describes-video +MPLanguageOptionCharacteristicDubbedTranslation public.translation.dubbed +MPLanguageOptionCharacteristicEasyToRead public.easy-to-read +MPLanguageOptionCharacteristicIsAuxiliaryContent public.auxiliary-content +MPLanguageOptionCharacteristicIsMainProgramContent public.main-program-content +MPLanguageOptionCharacteristicLanguageTranslation public.translation +MPLanguageOptionCharacteristicTranscribesSpokenDialog public.accessibility.transcribes-spoken-dialog +MPLanguageOptionCharacteristicVoiceOverTranslation public.translation.voice-over +MPMediaEntityPropertyPersistentID persistentID +MPMediaItemPropertyAlbumArtist albumArtist +MPMediaItemPropertyAlbumArtistPersistentID albumArtistPID +MPMediaItemPropertyAlbumPersistentID albumPID +MPMediaItemPropertyAlbumTitle albumTitle +MPMediaItemPropertyAlbumTrackCount albumTrackCount +MPMediaItemPropertyAlbumTrackNumber albumTrackNumber +MPMediaItemPropertyArtist artist +MPMediaItemPropertyArtistPersistentID artistPID +MPMediaItemPropertyArtwork artwork +MPMediaItemPropertyAssetURL assetURL +MPMediaItemPropertyBeatsPerMinute beatsPerMinute +MPMediaItemPropertyBookmarkTime bookmarkTime +MPMediaItemPropertyComments comments +MPMediaItemPropertyComposer composer +MPMediaItemPropertyComposerPersistentID composerPID +MPMediaItemPropertyDateAdded dateAdded +MPMediaItemPropertyDiscCount discCount +MPMediaItemPropertyDiscNumber discNumber +MPMediaItemPropertyGenre genre +MPMediaItemPropertyGenrePersistentID genrePID +MPMediaItemPropertyHasProtectedAsset hasProtectedAsset +MPMediaItemPropertyIsCloudItem isCloudItem +MPMediaItemPropertyIsCompilation isCompilation +MPMediaItemPropertyIsExplicit isExplicit +MPMediaItemPropertyIsPreorder isPreorder +MPMediaItemPropertyLastPlayedDate lastPlayedDate +MPMediaItemPropertyLyrics lyrics +MPMediaItemPropertyMediaType mediaType +MPMediaItemPropertyPersistentID persistentID +MPMediaItemPropertyPlayCount playCount +MPMediaItemPropertyPlaybackDuration playbackDuration +MPMediaItemPropertyPlaybackStoreID playbackStoreID +MPMediaItemPropertyPodcastPersistentID podcastPID +MPMediaItemPropertyPodcastTitle podcastTitle +MPMediaItemPropertyRating rating +MPMediaItemPropertyReleaseDate releaseDate +MPMediaItemPropertySkipCount skipCount +MPMediaItemPropertyTitle title +MPMediaItemPropertyUserGrouping userGrouping +MPMediaPlaybackIsPreparedToPlayDidChangeNotification MPMediaPlaybackIsPreparedToPlayDidChangeNotification +MPMediaPlaylistPropertyAuthorDisplayName externalVendorDisplayName +MPMediaPlaylistPropertyCloudGlobalID cloudGlobalID +MPMediaPlaylistPropertyDescriptionText descriptionInfo +MPMediaPlaylistPropertyName name +MPMediaPlaylistPropertyPersistentID playlistPersistentID +MPMediaPlaylistPropertyPlaylistAttributes playlistAttributes +MPMediaPlaylistPropertySeedItems seedItems +MPNowPlayingInfoCollectionIdentifier MPNowPlayingInfoCollectionIdentifier +MPNowPlayingInfoPropertyAssetURL MPNowPlayingInfoPropertyAssetURL +MPNowPlayingInfoPropertyAvailableLanguageOptions MPNowPlayingInfoPropertyAvailableLanguageOptions +MPNowPlayingInfoPropertyChapterCount MPNowPlayingInfoPropertyChapterCount +MPNowPlayingInfoPropertyChapterNumber MPNowPlayingInfoPropertyChapterNumber +MPNowPlayingInfoPropertyCurrentLanguageOptions MPNowPlayingInfoPropertyCurrentLanguageOption +MPNowPlayingInfoPropertyCurrentPlaybackDate MPNowPlayingInfoPropertyCurrentPlaybackDate +MPNowPlayingInfoPropertyDefaultPlaybackRate MPNowPlayingInfoPropertyDefaultPlaybackRate +MPNowPlayingInfoPropertyElapsedPlaybackTime MPNowPlayingInfoPropertyElapsedPlaybackTime +MPNowPlayingInfoPropertyExternalContentIdentifier MPNowPlayingInfoPropertyExternalContentIdentifier +MPNowPlayingInfoPropertyExternalUserProfileIdentifier MPNowPlayingInfoPropertyExternalUserProfileIdentifier +MPNowPlayingInfoPropertyIsLiveStream MPNowPlayingInfoPropertyIsLiveStream +MPNowPlayingInfoPropertyMediaType MPNowPlayingInfoPropertyMediaType +MPNowPlayingInfoPropertyPlaybackProgress MPNowPlayingInfoPropertyPlaybackProgress +MPNowPlayingInfoPropertyPlaybackQueueCount MPNowPlayingInfoPropertyPlaybackQueueCount +MPNowPlayingInfoPropertyPlaybackQueueIndex MPNowPlayingInfoPropertyPlaybackQueueIndex +MPNowPlayingInfoPropertyPlaybackRate MPNowPlayingInfoPropertyPlaybackRate +MPNowPlayingInfoPropertyServiceIdentifier MPNowPlayingInfoPropertyServiceIdentifier diff --git a/generate/modules/enums/macos/sysconfig b/generate/modules/enums/macos/sysconfig new file mode 100644 index 00000000..ad1b2e8e --- /dev/null +++ b/generate/modules/enums/macos/sysconfig @@ -0,0 +1,348 @@ +kSCBondStatusLinkInvalid 1 +kSCBondStatusNoPartner 2 +kSCBondStatusNotInActiveGroup 3 +kSCBondStatusOK 0 +kSCBondStatusUnknown 999 +kSCNetworkConnectionConnected 2 +kSCNetworkConnectionConnecting 1 +kSCNetworkConnectionDisconnected 0 +kSCNetworkConnectionDisconnecting 3 +kSCNetworkConnectionInvalid -1 +kSCNetworkConnectionPPPAuthenticating 5 +kSCNetworkConnectionPPPConnected 8 +kSCNetworkConnectionPPPConnectingLink 2 +kSCNetworkConnectionPPPDialOnTraffic 3 +kSCNetworkConnectionPPPDisconnected 0 +kSCNetworkConnectionPPPDisconnectingLink 10 +kSCNetworkConnectionPPPHoldingLinkOff 11 +kSCNetworkConnectionPPPInitializing 1 +kSCNetworkConnectionPPPNegotiatingLink 4 +kSCNetworkConnectionPPPNegotiatingNetwork 7 +kSCNetworkConnectionPPPSuspended 12 +kSCNetworkConnectionPPPTerminating 9 +kSCNetworkConnectionPPPWaitingForCallBack 6 +kSCNetworkConnectionPPPWaitingForRedial 13 +kSCNetworkReachabilityFlagsConnectionAutomatic 8 +kSCNetworkReachabilityFlagsConnectionOnDemand 32 +kSCNetworkReachabilityFlagsConnectionOnTraffic 8 +kSCNetworkReachabilityFlagsConnectionRequired 4 +kSCNetworkReachabilityFlagsInterventionRequired 16 +kSCNetworkReachabilityFlagsIsDirect 131072 +kSCNetworkReachabilityFlagsIsLocalAddress 65536 +kSCNetworkReachabilityFlagsReachable 2 +kSCNetworkReachabilityFlagsTransientConnection 1 +kSCPreferencesNotificationApply 2 +kSCPreferencesNotificationCommit 1 +kSCStatusAccessError 1003 +kSCStatusConnectionIgnore 5002 +kSCStatusConnectionNoService 5001 +kSCStatusFailed 1001 +kSCStatusInvalidArgument 1002 +kSCStatusKeyExists 1005 +kSCStatusLocked 1006 +kSCStatusMaxLink 3006 +kSCStatusNeedLock 1007 +kSCStatusNoConfigFile 3003 +kSCStatusNoKey 1004 +kSCStatusNoLink 3004 +kSCStatusNoPrefsSession 3001 +kSCStatusNoStoreServer 2002 +kSCStatusNoStoreSession 2001 +kSCStatusNotifierActive 2003 +kSCStatusOK 0 +kSCStatusPrefsBusy 3002 +kSCStatusReachabilityUnknown 4001 +kSCStatusStale 3005 +kCFErrorDomainSystemConfiguration com.apple.SystemConfiguration +kSCBondStatusDeviceAggregationStatus AggregationStatus +kSCBondStatusDeviceCollecting Collecting +kSCBondStatusDeviceDistributing Distributing +kSCCompAnyRegex [^/]+ +kSCCompGlobal Global +kSCCompHostNames HostNames +kSCCompInterface Interface +kSCCompNetwork Network +kSCCompService Service +kSCCompSystem System +kSCCompUsers Users +kSCDynamicStoreDomainFile File: +kSCDynamicStoreDomainPlugin Plugin: +kSCDynamicStoreDomainPrefs Prefs: +kSCDynamicStoreDomainSetup Setup: +kSCDynamicStoreDomainState State: +kSCDynamicStorePropNetInterfaces Interfaces +kSCDynamicStorePropNetPrimaryInterface PrimaryInterface +kSCDynamicStorePropNetPrimaryService PrimaryService +kSCDynamicStorePropNetServiceIDs ServiceIDs +kSCDynamicStorePropSetupCurrentSet CurrentSet +kSCDynamicStorePropSetupLastUpdated LastUpdated +kSCDynamicStoreUseSessionKeys UseSessionKeys +kSCEntNet6to4 6to4 +kSCEntNetAirPort AirPort +kSCEntNetDHCP DHCP +kSCEntNetDNS DNS +kSCEntNetEthernet Ethernet +kSCEntNetFireWire FireWire +kSCEntNetIPSec IPSec +kSCEntNetIPv4 IPv4 +kSCEntNetIPv6 IPv6 +kSCEntNetInterface Interface +kSCEntNetL2TP L2TP +kSCEntNetLink Link +kSCEntNetModem Modem +kSCEntNetPPP PPP +kSCEntNetPPPSerial PPPSerial +kSCEntNetPPPoE PPPoE +kSCEntNetPPTP PPTP +kSCEntNetProxies Proxies +kSCEntNetSMB SMB +kSCEntUsersConsoleUser ConsoleUser +kSCNetworkInterfaceType6to4 6to4 +kSCNetworkInterfaceTypeBluetooth Bluetooth +kSCNetworkInterfaceTypeBond Bond +kSCNetworkInterfaceTypeEthernet Ethernet +kSCNetworkInterfaceTypeFireWire FireWire +kSCNetworkInterfaceTypeIEEE80211 IEEE80211 +kSCNetworkInterfaceTypeIPSec IPSec +kSCNetworkInterfaceTypeIPv4 IPv4 +kSCNetworkInterfaceTypeIrDA IrDA +kSCNetworkInterfaceTypeL2TP L2TP +kSCNetworkInterfaceTypeModem Modem +kSCNetworkInterfaceTypePPP PPP +kSCNetworkInterfaceTypePPTP PPTP +kSCNetworkInterfaceTypeSerial Serial +kSCNetworkInterfaceTypeVLAN VLAN +kSCNetworkInterfaceTypeWWAN WWAN +kSCNetworkProtocolTypeDNS DNS +kSCNetworkProtocolTypeIPv4 IPv4 +kSCNetworkProtocolTypeIPv6 IPv6 +kSCNetworkProtocolTypeProxies Proxies +kSCNetworkProtocolTypeSMB SMB +kSCPrefCurrentSet CurrentSet +kSCPrefNetworkServices NetworkServices +kSCPrefSets Sets +kSCPrefSystem System +kSCPropInterfaceName InterfaceName +kSCPropMACAddress MACAddress +kSCPropNet6to4Relay Relay +kSCPropNetAirPortAllowNetCreation AllowNetCreation +kSCPropNetAirPortAuthPassword AuthPassword +kSCPropNetAirPortAuthPasswordEncryption AuthPasswordEncryption +kSCPropNetAirPortJoinMode JoinMode +kSCPropNetAirPortPowerEnabled PowerEnabled +kSCPropNetAirPortPreferredNetwork PreferredNetwork +kSCPropNetAirPortSavePasswords SavePasswords +kSCPropNetDNSDomainName DomainName +kSCPropNetDNSOptions Options +kSCPropNetDNSSearchDomains SearchDomains +kSCPropNetDNSSearchOrder SearchOrder +kSCPropNetDNSServerAddresses ServerAddresses +kSCPropNetDNSServerPort ServerPort +kSCPropNetDNSServerTimeout ServerTimeout +kSCPropNetDNSSortList SortList +kSCPropNetDNSSupplementalMatchDomains SupplementalMatchDomains +kSCPropNetDNSSupplementalMatchOrders SupplementalMatchOrders +kSCPropNetEthernetMTU MTU +kSCPropNetEthernetMediaOptions MediaOptions +kSCPropNetEthernetMediaSubType MediaSubType +kSCPropNetIPSecAuthenticationMethod AuthenticationMethod +kSCPropNetIPSecConnectTime ConnectTime +kSCPropNetIPSecLocalCertificate LocalCertificate +kSCPropNetIPSecLocalIdentifier LocalIdentifier +kSCPropNetIPSecLocalIdentifierType LocalIdentifierType +kSCPropNetIPSecRemoteAddress RemoteAddress +kSCPropNetIPSecSharedSecret SharedSecret +kSCPropNetIPSecSharedSecretEncryption SharedSecretEncryption +kSCPropNetIPSecStatus Status +kSCPropNetIPSecXAuthEnabled XAuthEnabled +kSCPropNetIPSecXAuthName XAuthName +kSCPropNetIPSecXAuthPassword XAuthPassword +kSCPropNetIPSecXAuthPasswordEncryption XAuthPasswordEncryption +kSCPropNetIPv4Addresses Addresses +kSCPropNetIPv4BroadcastAddresses BroadcastAddresses +kSCPropNetIPv4ConfigMethod ConfigMethod +kSCPropNetIPv4DHCPClientID DHCPClientID +kSCPropNetIPv4DestAddresses DestAddresses +kSCPropNetIPv4Router Router +kSCPropNetIPv4SubnetMasks SubnetMasks +kSCPropNetIPv6Addresses Addresses +kSCPropNetIPv6ConfigMethod ConfigMethod +kSCPropNetIPv6DestAddresses DestAddresses +kSCPropNetIPv6Flags Flags +kSCPropNetIPv6PrefixLength PrefixLength +kSCPropNetIPv6Router Router +kSCPropNetInterfaceDeviceName DeviceName +kSCPropNetInterfaceHardware Hardware +kSCPropNetInterfaceSubType SubType +kSCPropNetInterfaceSupportsModemOnHold SupportsModemOnHold +kSCPropNetInterfaceType Type +kSCPropNetInterfaces Interfaces +kSCPropNetL2TPIPSecSharedSecret IPSecSharedSecret +kSCPropNetL2TPIPSecSharedSecretEncryption IPSecSharedSecretEncryption +kSCPropNetL2TPTransport Transport +kSCPropNetLinkActive Active +kSCPropNetLinkDetaching Detaching +kSCPropNetLocalHostName LocalHostName +kSCPropNetModemAccessPointName AccessPointName +kSCPropNetModemConnectSpeed ConnectSpeed +kSCPropNetModemConnectionPersonality ConnectionPersonality +kSCPropNetModemConnectionScript ConnectionScript +kSCPropNetModemDataCompression DataCompression +kSCPropNetModemDeviceContextID DeviceContextID +kSCPropNetModemDeviceModel DeviceModel +kSCPropNetModemDeviceVendor DeviceVendor +kSCPropNetModemDialMode DialMode +kSCPropNetModemErrorCorrection ErrorCorrection +kSCPropNetModemHoldCallWaitingAudibleAlert HoldCallWaitingAudibleAlert +kSCPropNetModemHoldDisconnectOnAnswer HoldDisconnectOnAnswer +kSCPropNetModemHoldEnabled HoldEnabled +kSCPropNetModemHoldReminder HoldReminder +kSCPropNetModemHoldReminderTime HoldReminderTime +kSCPropNetModemNote Note +kSCPropNetModemPulseDial PulseDial +kSCPropNetModemSpeaker Speaker +kSCPropNetModemSpeed Speed +kSCPropNetOverridePrimary OverridePrimary +kSCPropNetPPPACSPEnabled ACSPEnabled +kSCPropNetPPPAuthEAPPlugins AuthEAPPlugins +kSCPropNetPPPAuthName AuthName +kSCPropNetPPPAuthPassword AuthPassword +kSCPropNetPPPAuthPasswordEncryption AuthPasswordEncryption +kSCPropNetPPPAuthPrompt AuthPrompt +kSCPropNetPPPAuthProtocol AuthProtocol +kSCPropNetPPPCCPEnabled CCPEnabled +kSCPropNetPPPCCPMPPE128Enabled CCPMPPE128Enabled +kSCPropNetPPPCCPMPPE40Enabled CCPMPPE40Enabled +kSCPropNetPPPCommAlternateRemoteAddress CommAlternateRemoteAddress +kSCPropNetPPPCommConnectDelay CommConnectDelay +kSCPropNetPPPCommDisplayTerminalWindow CommDisplayTerminalWindow +kSCPropNetPPPCommRedialCount CommRedialCount +kSCPropNetPPPCommRedialEnabled CommRedialEnabled +kSCPropNetPPPCommRedialInterval CommRedialInterval +kSCPropNetPPPCommRemoteAddress CommRemoteAddress +kSCPropNetPPPCommTerminalScript CommTerminalScript +kSCPropNetPPPCommUseTerminalScript CommUseTerminalScript +kSCPropNetPPPConnectTime ConnectTime +kSCPropNetPPPDeviceLastCause DeviceLastCause +kSCPropNetPPPDialOnDemand DialOnDemand +kSCPropNetPPPDisconnectOnFastUserSwitch DisconnectOnFastUserSwitch +kSCPropNetPPPDisconnectOnIdle DisconnectOnIdle +kSCPropNetPPPDisconnectOnIdleTimer DisconnectOnIdleTimer +kSCPropNetPPPDisconnectOnLogout DisconnectOnLogout +kSCPropNetPPPDisconnectOnSleep DisconnectOnSleep +kSCPropNetPPPDisconnectTime DisconnectTime +kSCPropNetPPPIPCPCompressionVJ IPCPCompressionVJ +kSCPropNetPPPIPCPUsePeerDNS IPCPUsePeerDNS +kSCPropNetPPPIdleReminder IdleReminder +kSCPropNetPPPIdleReminderTimer IdleReminderTimer +kSCPropNetPPPLCPCompressionACField LCPCompressionACField +kSCPropNetPPPLCPCompressionPField LCPCompressionPField +kSCPropNetPPPLCPEchoEnabled LCPEchoEnabled +kSCPropNetPPPLCPEchoFailure LCPEchoFailure +kSCPropNetPPPLCPEchoInterval LCPEchoInterval +kSCPropNetPPPLCPMRU LCPMRU +kSCPropNetPPPLCPMTU LCPMTU +kSCPropNetPPPLCPReceiveACCM LCPReceiveACCM +kSCPropNetPPPLCPTransmitACCM LCPTransmitACCM +kSCPropNetPPPLastCause LastCause +kSCPropNetPPPLogfile Logfile +kSCPropNetPPPOverridePrimary PPPOverridePrimary +kSCPropNetPPPPlugins Plugins +kSCPropNetPPPRetryConnectTime RetryConnectTime +kSCPropNetPPPSessionTimer SessionTimer +kSCPropNetPPPStatus Status +kSCPropNetPPPUseSessionTimer UseSessionTimer +kSCPropNetPPPVerboseLogging VerboseLogging +kSCPropNetProxiesExceptionsList ExceptionsList +kSCPropNetProxiesExcludeSimpleHostnames ExcludeSimpleHostnames +kSCPropNetProxiesFTPEnable FTPEnable +kSCPropNetProxiesFTPPassive FTPPassive +kSCPropNetProxiesFTPPort FTPPort +kSCPropNetProxiesFTPProxy FTPProxy +kSCPropNetProxiesGopherEnable GopherEnable +kSCPropNetProxiesGopherPort GopherPort +kSCPropNetProxiesGopherProxy GopherProxy +kSCPropNetProxiesHTTPEnable HTTPEnable +kSCPropNetProxiesHTTPPort HTTPPort +kSCPropNetProxiesHTTPProxy HTTPProxy +kSCPropNetProxiesHTTPSEnable HTTPSEnable +kSCPropNetProxiesHTTPSPort HTTPSPort +kSCPropNetProxiesHTTPSProxy HTTPSProxy +kSCPropNetProxiesProxyAutoConfigEnable ProxyAutoConfigEnable +kSCPropNetProxiesProxyAutoConfigJavaScript ProxyAutoConfigJavaScript +kSCPropNetProxiesProxyAutoConfigURLString ProxyAutoConfigURLString +kSCPropNetProxiesProxyAutoDiscoveryEnable ProxyAutoDiscoveryEnable +kSCPropNetProxiesRTSPEnable RTSPEnable +kSCPropNetProxiesRTSPPort RTSPPort +kSCPropNetProxiesRTSPProxy RTSPProxy +kSCPropNetProxiesSOCKSEnable SOCKSEnable +kSCPropNetProxiesSOCKSPort SOCKSPort +kSCPropNetProxiesSOCKSProxy SOCKSProxy +kSCPropNetSMBNetBIOSName NetBIOSName +kSCPropNetSMBNetBIOSNodeType NetBIOSNodeType +kSCPropNetSMBNetBIOSScope NetBIOSScope +kSCPropNetSMBWINSAddresses WINSAddresses +kSCPropNetSMBWorkgroup Workgroup +kSCPropNetServiceOrder ServiceOrder +kSCPropSystemComputerName ComputerName +kSCPropSystemComputerNameEncoding ComputerNameEncoding +kSCPropUserDefinedName UserDefinedName +kSCPropUsersConsoleUserGID GID +kSCPropUsersConsoleUserName Name +kSCPropUsersConsoleUserUID UID +kSCPropVersion Version +kSCResvInactive __INACTIVE__ +kSCResvLink __LINK__ +kSCValNetAirPortAuthPasswordEncryptionKeychain Keychain +kSCValNetAirPortJoinModeAutomatic Automatic +kSCValNetAirPortJoinModePreferred Preferred +kSCValNetAirPortJoinModeRanked Ranked +kSCValNetAirPortJoinModeRecent Recent +kSCValNetAirPortJoinModeStrongest Strongest +kSCValNetIPSecAuthenticationMethodCertificate Certificate +kSCValNetIPSecAuthenticationMethodHybrid Hybrid +kSCValNetIPSecAuthenticationMethodSharedSecret SharedSecret +kSCValNetIPSecLocalIdentifierTypeKeyID KeyID +kSCValNetIPSecSharedSecretEncryptionKeychain Keychain +kSCValNetIPSecXAuthPasswordEncryptionKeychain Keychain +kSCValNetIPSecXAuthPasswordEncryptionPrompt Prompt +kSCValNetIPv4ConfigMethodAutomatic Automatic +kSCValNetIPv4ConfigMethodBOOTP BOOTP +kSCValNetIPv4ConfigMethodDHCP DHCP +kSCValNetIPv4ConfigMethodINFORM INFORM +kSCValNetIPv4ConfigMethodLinkLocal LinkLocal +kSCValNetIPv4ConfigMethodManual Manual +kSCValNetIPv4ConfigMethodPPP PPP +kSCValNetIPv6ConfigMethod6to4 6to4 +kSCValNetIPv6ConfigMethodAutomatic Automatic +kSCValNetIPv6ConfigMethodLinkLocal LinkLocal +kSCValNetIPv6ConfigMethodManual Manual +kSCValNetIPv6ConfigMethodRouterAdvertisement RouterAdvertisement +kSCValNetInterfaceSubTypeL2TP L2TP +kSCValNetInterfaceSubTypePPPSerial PPPSerial +kSCValNetInterfaceSubTypePPPoE PPPoE +kSCValNetInterfaceSubTypePPTP PPTP +kSCValNetInterfaceType6to4 6to4 +kSCValNetInterfaceTypeEthernet Ethernet +kSCValNetInterfaceTypeFireWire FireWire +kSCValNetInterfaceTypeIPSec IPSec +kSCValNetInterfaceTypePPP PPP +kSCValNetL2TPIPSecSharedSecretEncryptionKeychain Keychain +kSCValNetL2TPTransportIP IP +kSCValNetL2TPTransportIPSec IPSec +kSCValNetModemDialModeIgnoreDialTone IgnoreDialTone +kSCValNetModemDialModeManual Manual +kSCValNetModemDialModeWaitForDialTone WaitForDialTone +kSCValNetPPPAuthPasswordEncryptionKeychain Keychain +kSCValNetPPPAuthPasswordEncryptionToken Token +kSCValNetPPPAuthPromptAfter After +kSCValNetPPPAuthPromptBefore Before +kSCValNetPPPAuthProtocolCHAP CHAP +kSCValNetPPPAuthProtocolEAP EAP +kSCValNetPPPAuthProtocolMSCHAP1 MSCHAP1 +kSCValNetPPPAuthProtocolMSCHAP2 MSCHAP2 +kSCValNetPPPAuthProtocolPAP PAP +kSCValNetSMBNetBIOSNodeTypeBroadcast Broadcast +kSCValNetSMBNetBIOSNodeTypeHybrid Hybrid +kSCValNetSMBNetBIOSNodeTypeMixed Mixed +kSCValNetSMBNetBIOSNodeTypePeer Peer diff --git a/generate/modules/modules.go b/generate/modules/modules.go index 0df8b333..487d5a83 100644 --- a/generate/modules/modules.go +++ b/generate/modules/modules.go @@ -52,8 +52,10 @@ func TrimPrefix(symbolName string) string { func CanAbstractModuleCoupling(in string, mod string) bool { mods, ok := map[string][]string{ "foundation": []string{"appkit", "coreimage", "corespotlight", "fileprovider", "gameplaykit", "iobluetooth", "uti"}, - "appkit": []string{"spritekit"}, + "appkit": []string{"spritekit", "cloudkit"}, "coreimage": []string{"appkit"}, + "coredata": []string{"corespotlight"}, + "cloudkit": []string{"corelocation"}, }[in] if !ok { return false @@ -88,7 +90,6 @@ func CanSkipModuleCoupling(in string, mod string) bool { func CanIgnoreNotFound(p any) bool { mod := strings.TrimPrefix(p.(string), "module not found: ") for _, m := range []string{ - "Media Player", "Security", "JavaScriptCore", "ImageCaptureCore", @@ -118,6 +119,7 @@ var All = []Module{ {"UIKit", "UIKit", "uikit", "UIKit/UIKit.h", []string{"NS"}}, {"UniformTypeIdentifiers", "Uniform Type Identifiers", "uti", "UniformTypeIdentifiers/UniformTypeIdentifiers.h", []string{"UT"}}, {"WebKit", "WebKit", "webkit", "WebKit/WebKit.h", []string{"WK"}}, + {"MediaPlayer", "Media Player", "mediaplayer", "MediaPlayer/MediaPlayer.h", []string{"MP"}}, {"FileProvider", "File Provider", "fileprovider", "FileProvider/FileProvider.h", []string{"NS"}}, {"Quartz", "Quartz", "quartz", "Quartz/Quartz.h", []string{"IK", "kQC", "kQuartz", "QC", "IK_"}}, {"SecurityInterface", "Security Interface", "securityinterface", "SecurityInterface/SecurityInterface.h", []string{"SF"}}, @@ -130,7 +132,7 @@ var All = []Module{ {"CoreAudioKit", "Core Audio Kit", "coreaudiokit", "CoreAudioKit/CoreAudioKit.h", []string{"CA", "AU"}}, {"CoreML", "Core ML", "coreml", "CoreML/CoreML.h", []string{"ML"}}, {"CoreData", "Core Data", "coredata", "CoreData/CoreData.h", []string{"NS"}}, - {"CoreMediaIO", "Core Media I/O", "coremediaio", "CoreMediaIO/CoreMediaIO.h", []string{"CMIO"}}, + {"CoreMediaIO", "Core Media I/O", "coremediaio", "CoreMediaIO/CMIOHardware.h", []string{"CMIO"}}, {"CoreMedia", "Core Media", "coremedia", "CoreMedia/CoreMedia.h", []string{"CM"}}, {"CoreImage", "Core Image", "coreimage", "CoreImage/CoreImage.h", []string{"CI"}}, {"CoreMIDI", "Core MIDI", "coremidi", "CoreMIDI/CoreMIDI.h", []string{"MIDI", "kMIDI"}}, @@ -155,4 +157,5 @@ var All = []Module{ {"MetalKit", "Metal Kit", "metalkit", "MetalKit/MetalKit.h", []string{"MTK"}}, {"MetalPerformanceShadersGraph", "Metal Performance Shaders Graph", "mpsgraph", "MetalPerformanceShadersGraph/MetalPerformanceShadersGraph.h", []string{"MPSGraph"}}, {"MetalPerformanceShaders", "Metal Performance Shaders", "mps", "MetalPerformanceShaders/MetalPerformanceShaders.h", []string{"MPS"}}, + {"SystemConfiguration", "System Configuration", "sysconfig", "SystemConfiguration/SystemConfiguration.h", []string{"SC", "kSC"}}, } diff --git a/generate/symbols.go b/generate/symbols.go index 2ea4f8dc..a3c598b9 100644 --- a/generate/symbols.go +++ b/generate/symbols.go @@ -72,7 +72,9 @@ func (s Symbol) DocURL() string { } func (s Symbol) HasFramework(name string) bool { + name = strings.ReplaceAll(name, " ", "") for _, m := range s.Modules { + m = strings.ReplaceAll(m, " ", "") if strings.EqualFold(m, name) { return true } @@ -113,8 +115,8 @@ func (s Symbol) HasPlatform(name string, version int, deprecated bool) bool { } ver := strings.Split(p.IntroducedAt, ".") major, _ := strconv.Atoi(ver[0]) - minor, _ := strconv.Atoi(ver[1]) - if version > major || (version == major && minor == 0) { + //minor, _ := strconv.Atoi(ver[1]) + if version >= major { return true } return false diff --git a/generate/tools/stats.sh b/generate/tools/stats.sh index 7190a068..3ec39ad8 100755 --- a/generate/tools/stats.sh +++ b/generate/tools/stats.sh @@ -6,5 +6,8 @@ echo echo "Classes/protocols:" find ./macos -type f ! -name "*_test.go" ! -name "*_structs.go" ! -name "aliastypes.gen.go" ! -name "enumtypes.gen.go" ! -name "doc.gen.go" ! -name "protocols.gen.m" -name "*.gen.go" | wc -l echo +echo "Methods:" +awk '/type [a-zA-Z0-9_]+ interface {/,/}/' ./macos/*/*.gen.go | grep ')' | wc -l +echo echo "Enums/constants:" cat ./macos/*/enumtypes.gen.go | grep -v '^\s*//' | grep -v '^\s*$' | grep -v '[\(\)]' | wc -l \ No newline at end of file diff --git a/generate/types.go b/generate/types.go index 5bb1bb1f..66e967a9 100644 --- a/generate/types.go +++ b/generate/types.go @@ -2,6 +2,7 @@ package generate import ( "fmt" + "log" "strings" "github.com/progrium/macdriver/generate/declparse" @@ -19,6 +20,12 @@ func (db *Generator) TypeFromSymbol(sym Symbol) typing.Type { if db.Platform == "macos" && module == "UIKit" { module = "AppKit" } + // cases where symbol lives in two places, + // we want it local if it belongs to the + // framework we're generating + if sym.HasFramework(db.Framework) { + module = db.Framework + } switch sym.Kind { case "Class": return &typing.ClassType{ @@ -36,7 +43,7 @@ func (db *Generator) TypeFromSymbol(sym Symbol) typing.Type { st, err := sym.Parse() if err != nil || st.Enum == nil { fmt.Printf("TypeFromSymbol: name=%s declaration=%s\n", sym.Name, sym.Declaration) - panic("invalid enum decl") + log.Panicf("invalid enum decl. %s", err) } return &typing.AliasType{ @@ -173,7 +180,7 @@ func (db *Generator) ParseType(ti declparse.TypeInfo) (typ typing.Type) { at.Type = typing.Object } ref = true - case "NSZone", "ipc_port_t": + case "NSZone", "ipc_port_t", "io_object_t": typ = &typing.RefType{Name: ti.Name} ref = true case "NSDictionary": diff --git a/generate/typing/kernel_type.go b/generate/typing/kernel_type.go index aa918dcd..23ce4f95 100644 --- a/generate/typing/kernel_type.go +++ b/generate/typing/kernel_type.go @@ -22,6 +22,7 @@ func GetKernelType(typeName string) (Type, bool) { "matrix_float4x4", "matrix_float4x3", "matrix_double4x4", + "vector_uchar16", } { if typeName == name { return &KernelType{ObjcName_: typeName}, true diff --git a/generate/typing/primitive_type.go b/generate/typing/primitive_type.go index 97054202..b94b0231 100644 --- a/generate/typing/primitive_type.go +++ b/generate/typing/primitive_type.go @@ -43,9 +43,11 @@ func init() { primitiveMap["uintptr_t"] = UInt primitiveMap["Boolean"] = Bool + primitiveMap["SInt8"] = Int8 primitiveMap["SInt16"] = Int16 primitiveMap["SInt32"] = Int32 primitiveMap["SInt64"] = Int64 + primitiveMap["UInt8"] = UInt8 primitiveMap["UInt16"] = UInt16 primitiveMap["UInt32"] = UInt32 primitiveMap["UInt64"] = UInt64 diff --git a/kernel/types.go b/kernel/types.go index afde0075..e1dd4cc7 100644 --- a/kernel/types.go +++ b/kernel/types.go @@ -13,6 +13,8 @@ type Vector_double2 = [2]float64 type Vector_double3 = [3]float64 type Vector_double4 = [4]float64 +type Vector_uchar16 = [16]uint8 + // not sure these will work, placeholder for now type Matrix_float2x2 unsafe.Pointer type Matrix_float3x3 unsafe.Pointer diff --git a/macos/_examples/subclass/main.go b/macos/_examples/subclass/main.go index 478dbc44..6ea0dba0 100644 --- a/macos/_examples/subclass/main.go +++ b/macos/_examples/subclass/main.go @@ -45,8 +45,8 @@ func main() { win.SetTitle("Hello world") win.SetLevel(appkit.MainMenuWindowLevel + 2) - view := c.CreateInstance(0) - objc.Call[objc.Void](win, objc.Sel("setContentView:"), view) + view := appkit.ViewFrom(c.CreateInstance(0).Ptr()).InitWithFrame(frame) + win.SetContentView(view) win.MakeKeyAndOrderFront(nil) log.Println("App started.") diff --git a/macos/audiotoolbox/audiotoolbox.go b/macos/_wip/audiotoolbox/audiotoolbox.go similarity index 100% rename from macos/audiotoolbox/audiotoolbox.go rename to macos/_wip/audiotoolbox/audiotoolbox.go diff --git a/macos/_wip/audiotoolbox/audiotoolbox_custom.go b/macos/_wip/audiotoolbox/audiotoolbox_custom.go new file mode 100644 index 00000000..1f113b0e --- /dev/null +++ b/macos/_wip/audiotoolbox/audiotoolbox_custom.go @@ -0,0 +1,5 @@ +// WIP +// +// TODO: +// * import cycle dependency on avfaudio and coreaudiokit +package audiotoolbox diff --git a/macos/audiotoolbox/audiotoolbox_test.go b/macos/_wip/audiotoolbox/audiotoolbox_test.go similarity index 100% rename from macos/audiotoolbox/audiotoolbox_test.go rename to macos/_wip/audiotoolbox/audiotoolbox_test.go diff --git a/macos/avfaudio/avfaudio.go b/macos/_wip/avfaudio/avfaudio.go similarity index 100% rename from macos/avfaudio/avfaudio.go rename to macos/_wip/avfaudio/avfaudio.go diff --git a/macos/_wip/avfaudio/avfaudio_custom.go b/macos/_wip/avfaudio/avfaudio_custom.go new file mode 100644 index 00000000..67feec2c --- /dev/null +++ b/macos/_wip/avfaudio/avfaudio_custom.go @@ -0,0 +1,5 @@ +// WIP +// +// TODO: +// * circular dependency on audiotoolbox +package avfaudio diff --git a/macos/avfaudio/avfaudio_test.go b/macos/_wip/avfaudio/avfaudio_test.go similarity index 100% rename from macos/avfaudio/avfaudio_test.go rename to macos/_wip/avfaudio/avfaudio_test.go diff --git a/macos/coreaudiokit/coreaudiokit.go b/macos/_wip/coreaudiokit/coreaudiokit.go similarity index 100% rename from macos/coreaudiokit/coreaudiokit.go rename to macos/_wip/coreaudiokit/coreaudiokit.go diff --git a/macos/_wip/coreaudiokit/coreaudiokit_custom.go b/macos/_wip/coreaudiokit/coreaudiokit_custom.go new file mode 100644 index 00000000..efe36321 --- /dev/null +++ b/macos/_wip/coreaudiokit/coreaudiokit_custom.go @@ -0,0 +1,5 @@ +// WIP +// +// TODO: +// * circular dependency on audiotoolbox +package coreaudiokit diff --git a/macos/coreaudiokit/coreaudiokit_test.go b/macos/_wip/coreaudiokit/coreaudiokit_test.go similarity index 100% rename from macos/coreaudiokit/coreaudiokit_test.go rename to macos/_wip/coreaudiokit/coreaudiokit_test.go diff --git a/macos/gameplaykit/gameplaykit.go b/macos/_wip/gameplaykit/gameplaykit.go similarity index 100% rename from macos/gameplaykit/gameplaykit.go rename to macos/_wip/gameplaykit/gameplaykit.go diff --git a/macos/_wip/gameplaykit/gameplaykit_custom.go b/macos/_wip/gameplaykit/gameplaykit_custom.go new file mode 100644 index 00000000..84001736 --- /dev/null +++ b/macos/_wip/gameplaykit/gameplaykit_custom.go @@ -0,0 +1,5 @@ +// WIP +// +// TODO: +// * circular dependency on scenekit AND spritekit +package gameplaykit diff --git a/macos/gameplaykit/gameplaykit_test.go b/macos/_wip/gameplaykit/gameplaykit_test.go similarity index 100% rename from macos/gameplaykit/gameplaykit_test.go rename to macos/_wip/gameplaykit/gameplaykit_test.go diff --git a/macos/iobluetooth/iobluetooth.go b/macos/_wip/iobluetooth/iobluetooth.go similarity index 100% rename from macos/iobluetooth/iobluetooth.go rename to macos/_wip/iobluetooth/iobluetooth.go diff --git a/macos/_wip/iobluetooth/iobluetooth_custom.go b/macos/_wip/iobluetooth/iobluetooth_custom.go new file mode 100644 index 00000000..3355762a --- /dev/null +++ b/macos/_wip/iobluetooth/iobluetooth_custom.go @@ -0,0 +1,17 @@ +// WIP +// +// TODO: +// * Issue where there is both OBEXSession and IOBluetoothOBEXSession, which inherits from OBEXSession, except the prefix is trimmed so both cannot exist +package iobluetooth + +import "github.com/progrium/macdriver/objc" + +// this guy was generated with Autorelease on OBEXError (an int) because of starting with Copy... todo: fix? + +// Copy a remote file to a local path [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/iobluetooth/obexfiletransferservices/1434277-copyremotefile?language=objc +func (o_ OBEXFileTransferServices) CopyRemoteFileToLocalPath(inRemoteFileName string, inLocalPathAndName string) OBEXError { + rv := objc.Call[OBEXError](o_, objc.Sel("copyRemoteFile:toLocalPath:"), inRemoteFileName, inLocalPathAndName) + return rv +} diff --git a/macos/iobluetooth/iobluetooth_test.go b/macos/_wip/iobluetooth/iobluetooth_test.go similarity index 100% rename from macos/iobluetooth/iobluetooth_test.go rename to macos/_wip/iobluetooth/iobluetooth_test.go diff --git a/macos/metalkit/metalkit.go b/macos/_wip/metalkit/metalkit.go similarity index 100% rename from macos/metalkit/metalkit.go rename to macos/_wip/metalkit/metalkit.go diff --git a/macos/_wip/metalkit/metalkit_custom.go b/macos/_wip/metalkit/metalkit_custom.go new file mode 100644 index 00000000..200a4d52 --- /dev/null +++ b/macos/_wip/metalkit/metalkit_custom.go @@ -0,0 +1,5 @@ +// WIP +// +// TODO: +// * significant dependency on modelio which has import cycle with scenekit +package metalkit diff --git a/macos/metalkit/metalkit_test.go b/macos/_wip/metalkit/metalkit_test.go similarity index 100% rename from macos/metalkit/metalkit_test.go rename to macos/_wip/metalkit/metalkit_test.go diff --git a/macos/modelio/modelio.go b/macos/_wip/modelio/modelio.go similarity index 100% rename from macos/modelio/modelio.go rename to macos/_wip/modelio/modelio.go diff --git a/macos/_wip/modelio/modelio_custom.go b/macos/_wip/modelio/modelio_custom.go new file mode 100644 index 00000000..297c8732 --- /dev/null +++ b/macos/_wip/modelio/modelio_custom.go @@ -0,0 +1,5 @@ +// WIP +// +// TODO: +// * circular dependency on scenekit +package modelio diff --git a/macos/modelio/modelio_test.go b/macos/_wip/modelio/modelio_test.go similarity index 100% rename from macos/modelio/modelio_test.go rename to macos/_wip/modelio/modelio_test.go diff --git a/macos/scenekit/scenekit.go b/macos/_wip/scenekit/scenekit.go similarity index 100% rename from macos/scenekit/scenekit.go rename to macos/_wip/scenekit/scenekit.go diff --git a/macos/_wip/scenekit/scenekit_custom.go b/macos/_wip/scenekit/scenekit_custom.go new file mode 100644 index 00000000..0b159b89 --- /dev/null +++ b/macos/_wip/scenekit/scenekit_custom.go @@ -0,0 +1,5 @@ +// WIP +// +// TODO: +// * circular dependency on gameplaykit AND modelio +package scenekit diff --git a/macos/scenekit/scenekit_test.go b/macos/_wip/scenekit/scenekit_test.go similarity index 100% rename from macos/scenekit/scenekit_test.go rename to macos/_wip/scenekit/scenekit_test.go diff --git a/macos/spritekit/spritekit.go b/macos/_wip/spritekit/spritekit.go similarity index 100% rename from macos/spritekit/spritekit.go rename to macos/_wip/spritekit/spritekit.go diff --git a/macos/_wip/spritekit/spritekit_custom.go b/macos/_wip/spritekit/spritekit_custom.go new file mode 100644 index 00000000..e3eaeebf --- /dev/null +++ b/macos/_wip/spritekit/spritekit_custom.go @@ -0,0 +1,6 @@ +// WIP +// +// TODO: +// * depends on wip avfaudio +// * circular dependency on gameplaykit +package spritekit diff --git a/macos/spritekit/spritekit_test.go b/macos/_wip/spritekit/spritekit_test.go similarity index 100% rename from macos/spritekit/spritekit_test.go rename to macos/_wip/spritekit/spritekit_test.go diff --git a/macos/appkit/cloud_sharing_service_delegate.gen.go b/macos/appkit/cloud_sharing_service_delegate.gen.go index 015bae46..5f65d53c 100644 --- a/macos/appkit/cloud_sharing_service_delegate.gen.go +++ b/macos/appkit/cloud_sharing_service_delegate.gen.go @@ -3,7 +3,6 @@ package appkit import ( - "github.com/progrium/macdriver/macos/cloudkit" "github.com/progrium/macdriver/macos/foundation" "github.com/progrium/macdriver/objc" ) @@ -13,7 +12,7 @@ import ( // [Full Topic]: https://developer.apple.com/documentation/appkit/nscloudsharingservicedelegate?language=objc type PCloudSharingServiceDelegate interface { // optional - SharingServiceDidSaveShare(sharingService SharingService, share cloudkit.Share) + SharingServiceDidSaveShare(sharingService SharingService, share objc.Object) HasSharingServiceDidSaveShare() bool // optional @@ -23,7 +22,7 @@ type PCloudSharingServiceDelegate interface { // A delegate implementation builder for the [PCloudSharingServiceDelegate] protocol. type CloudSharingServiceDelegate struct { - _SharingServiceDidSaveShare func(sharingService SharingService, share cloudkit.Share) + _SharingServiceDidSaveShare func(sharingService SharingService, share objc.Object) _OptionsForSharingServiceShareProvider func(cloudKitSharingService SharingService, provider foundation.ItemProvider) CloudKitSharingServiceOptions } @@ -34,14 +33,14 @@ func (di *CloudSharingServiceDelegate) HasSharingServiceDidSaveShare() bool { // Tells the delegate when the cloud-sharing service saves the CloudKit share. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/appkit/nscloudsharingservicedelegate/1644712-sharingservice?language=objc -func (di *CloudSharingServiceDelegate) SetSharingServiceDidSaveShare(f func(sharingService SharingService, share cloudkit.Share)) { +func (di *CloudSharingServiceDelegate) SetSharingServiceDidSaveShare(f func(sharingService SharingService, share objc.Object)) { di._SharingServiceDidSaveShare = f } // Tells the delegate when the cloud-sharing service saves the CloudKit share. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/appkit/nscloudsharingservicedelegate/1644712-sharingservice?language=objc -func (di *CloudSharingServiceDelegate) SharingServiceDidSaveShare(sharingService SharingService, share cloudkit.Share) { +func (di *CloudSharingServiceDelegate) SharingServiceDidSaveShare(sharingService SharingService, share objc.Object) { di._SharingServiceDidSaveShare(sharingService, share) } func (di *CloudSharingServiceDelegate) HasOptionsForSharingServiceShareProvider() bool { @@ -74,7 +73,7 @@ func (c_ CloudSharingServiceDelegateWrapper) HasSharingServiceDidSaveShare() boo // Tells the delegate when the cloud-sharing service saves the CloudKit share. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/appkit/nscloudsharingservicedelegate/1644712-sharingservice?language=objc -func (c_ CloudSharingServiceDelegateWrapper) SharingServiceDidSaveShare(sharingService ISharingService, share cloudkit.IShare) { +func (c_ CloudSharingServiceDelegateWrapper) SharingServiceDidSaveShare(sharingService ISharingService, share objc.IObject) { objc.Call[objc.Void](c_, objc.Sel("sharingService:didSaveShare:"), objc.Ptr(sharingService), objc.Ptr(share)) } diff --git a/macos/appkit/cloud_sharing_validation.gen.go b/macos/appkit/cloud_sharing_validation.gen.go index 4e4b4cd4..4d4bc92a 100644 --- a/macos/appkit/cloud_sharing_validation.gen.go +++ b/macos/appkit/cloud_sharing_validation.gen.go @@ -3,7 +3,6 @@ package appkit import ( - "github.com/progrium/macdriver/macos/cloudkit" "github.com/progrium/macdriver/objc" ) @@ -12,7 +11,7 @@ import ( // [Full Topic]: https://developer.apple.com/documentation/appkit/nscloudsharingvalidation?language=objc type PCloudSharingValidation interface { // optional - CloudShareForUserInterfaceItem(item ValidatedUserInterfaceItemWrapper) cloudkit.IShare + CloudShareForUserInterfaceItem(item ValidatedUserInterfaceItemWrapper) objc.IObject HasCloudShareForUserInterfaceItem() bool } @@ -28,8 +27,8 @@ func (c_ CloudSharingValidationWrapper) HasCloudShareForUserInterfaceItem() bool // Returns the Cloud share object that corresponds to the specified item, if one exists. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/appkit/nscloudsharingvalidation/2315049-cloudshareforuserinterfaceitem?language=objc -func (c_ CloudSharingValidationWrapper) CloudShareForUserInterfaceItem(item PValidatedUserInterfaceItem) cloudkit.Share { +func (c_ CloudSharingValidationWrapper) CloudShareForUserInterfaceItem(item PValidatedUserInterfaceItem) objc.Object { po0 := objc.WrapAsProtocol("NSValidatedUserInterfaceItem", item) - rv := objc.Call[cloudkit.Share](c_, objc.Sel("cloudShareForUserInterfaceItem:"), po0) + rv := objc.Call[objc.Object](c_, objc.Sel("cloudShareForUserInterfaceItem:"), po0) return rv } diff --git a/macos/avfoundation/aggregate_asset_download_task.gen.go b/macos/avfoundation/aggregate_asset_download_task.gen.go new file mode 100644 index 00000000..61e0817b --- /dev/null +++ b/macos/avfoundation/aggregate_asset_download_task.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AggregateAssetDownloadTask] class. +var AggregateAssetDownloadTaskClass = _AggregateAssetDownloadTaskClass{objc.GetClass("AVAggregateAssetDownloadTask")} + +type _AggregateAssetDownloadTaskClass struct { + objc.Class +} + +// An interface definition for the [AggregateAssetDownloadTask] class. +type IAggregateAssetDownloadTask interface { + foundation.IURLSessionTask + URLAsset() URLAsset +} + +// A task that downloads multiple media selections for an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaggregateassetdownloadtask?language=objc +type AggregateAssetDownloadTask struct { + foundation.URLSessionTask +} + +func AggregateAssetDownloadTaskFrom(ptr unsafe.Pointer) AggregateAssetDownloadTask { + return AggregateAssetDownloadTask{ + URLSessionTask: foundation.URLSessionTaskFrom(ptr), + } +} + +func (ac _AggregateAssetDownloadTaskClass) Alloc() AggregateAssetDownloadTask { + rv := objc.Call[AggregateAssetDownloadTask](ac, objc.Sel("alloc")) + return rv +} + +func AggregateAssetDownloadTask_Alloc() AggregateAssetDownloadTask { + return AggregateAssetDownloadTaskClass.Alloc() +} + +func (ac _AggregateAssetDownloadTaskClass) New() AggregateAssetDownloadTask { + rv := objc.Call[AggregateAssetDownloadTask](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAggregateAssetDownloadTask() AggregateAssetDownloadTask { + return AggregateAssetDownloadTaskClass.New() +} + +func (a_ AggregateAssetDownloadTask) Init() AggregateAssetDownloadTask { + rv := objc.Call[AggregateAssetDownloadTask](a_, objc.Sel("init")) + return rv +} + +// The asset the parent task downloads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaggregateassetdownloadtask/2897238-urlasset?language=objc +func (a_ AggregateAssetDownloadTask) URLAsset() URLAsset { + rv := objc.Call[URLAsset](a_, objc.Sel("URLAsset")) + return rv +} diff --git a/macos/avfoundation/aliastypes.gen.go b/macos/avfoundation/aliastypes.gen.go new file mode 100644 index 00000000..755a6bec --- /dev/null +++ b/macos/avfoundation/aliastypes.gen.go @@ -0,0 +1,14 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" +) + +// A type alias for a closure that provides the result of an image generation request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegeneratorcompletionhandler?language=objc +type AssetImageGeneratorCompletionHandler = func(requestedTime coremedia.Time, image coregraphics.ImageRef, actualTime coremedia.Time, result AssetImageGeneratorResult, error foundation.Error) diff --git a/macos/avfoundation/asset.gen.go b/macos/avfoundation/asset.gen.go new file mode 100644 index 00000000..18bf8936 --- /dev/null +++ b/macos/avfoundation/asset.gen.go @@ -0,0 +1,388 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Asset] class. +var AssetClass = _AssetClass{objc.GetClass("AVAsset")} + +type _AssetClass struct { + objc.Class +} + +// An interface definition for the [Asset] class. +type IAsset interface { + objc.IObject + FindUnusedTrackIDWithCompletionHandler(completionHandler func(arg0 objc.Object, arg1 foundation.Error)) + CancelLoading() + LoadTracksWithMediaCharacteristicCompletionHandler(mediaCharacteristic MediaCharacteristic, completionHandler func(arg0 []AssetTrack, arg1 foundation.Error)) + LoadMetadataForFormatCompletionHandler(format MetadataFormat, completionHandler func(arg0 []MetadataItem, arg1 foundation.Error)) + LoadTrackWithTrackIDCompletionHandler(trackID objc.IObject, completionHandler func(arg0 AssetTrack, arg1 foundation.Error)) + LoadTracksWithMediaTypeCompletionHandler(mediaType MediaType, completionHandler func(arg0 []AssetTrack, arg1 foundation.Error)) + LoadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler(preferredLanguages []string, completionHandler func(arg0 []TimedMetadataGroup, arg1 foundation.Error)) + LoadMediaSelectionGroupForMediaCharacteristicCompletionHandler(mediaCharacteristic MediaCharacteristic, completionHandler func(arg0 MediaSelectionGroup, arg1 foundation.Error)) + LoadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeysCompletionHandler(locale foundation.ILocale, commonKeys []MetadataKey, completionHandler func(arg0 []TimedMetadataGroup, arg1 foundation.Error)) + MinimumTimeOffsetFromLive() coremedia.Time + Lyrics() string + Tracks() []AssetTrack + IsReadable() bool + AvailableMediaCharacteristicsWithMediaSelectionOptions() []MediaCharacteristic + PreferredVolume() float64 + CanContainFragments() bool + AvailableChapterLocales() []foundation.Locale + IsComposable() bool + ProvidesPreciseDurationAndTiming() bool + Metadata() []MetadataItem + PreferredRate() float64 + AvailableMetadataFormats() []MetadataFormat + OverallDurationHint() coremedia.Time + CreationDate() MetadataItem + TrackGroups() []AssetTrackGroup + ReferenceRestrictions() AssetReferenceRestrictions + AllMediaSelections() []MediaSelection + HasProtectedContent() bool + Duration() coremedia.Time + PreferredMediaSelection() MediaSelection + IsCompatibleWithAirPlayVideo() bool + IsExportable() bool + ContainsFragments() bool + PreferredTransform() coregraphics.AffineTransform + IsPlayable() bool + CommonMetadata() []MetadataItem +} + +// An object that models timed audiovisual media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset?language=objc +type Asset struct { + objc.Object +} + +func AssetFrom(ptr unsafe.Pointer) Asset { + return Asset{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetClass) AssetWithURL(URL foundation.IURL) Asset { + rv := objc.Call[Asset](ac, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func Asset_AssetWithURL(URL foundation.IURL) Asset { + return AssetClass.AssetWithURL(URL) +} + +func (ac _AssetClass) Alloc() Asset { + rv := objc.Call[Asset](ac, objc.Sel("alloc")) + return rv +} + +func Asset_Alloc() Asset { + return AssetClass.Alloc() +} + +func (ac _AssetClass) New() Asset { + rv := objc.Call[Asset](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAsset() Asset { + return AssetClass.New() +} + +func (a_ Asset) Init() Asset { + rv := objc.Call[Asset](a_, objc.Sel("init")) + return rv +} + +// Loads an identifier that no other track in the asset uses. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746590-findunusedtrackidwithcompletionh?language=objc +func (a_ Asset) FindUnusedTrackIDWithCompletionHandler(completionHandler func(arg0 objc.Object, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("findUnusedTrackIDWithCompletionHandler:"), completionHandler) +} + +// Cancels all pending requests to asynchronously load property values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1388722-cancelloading?language=objc +func (a_ Asset) CancelLoading() { + objc.Call[objc.Void](a_, objc.Sel("cancelLoading")) +} + +// Loads tracks that contain media of a specified characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746530-loadtrackswithmediacharacteristi?language=objc +func (a_ Asset) LoadTracksWithMediaCharacteristicCompletionHandler(mediaCharacteristic MediaCharacteristic, completionHandler func(arg0 []AssetTrack, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadTracksWithMediaCharacteristic:completionHandler:"), mediaCharacteristic, completionHandler) +} + +// Loads an array of metadata items that the asset contains for the specified format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746528-loadmetadataforformat?language=objc +func (a_ Asset) LoadMetadataForFormatCompletionHandler(format MetadataFormat, completionHandler func(arg0 []MetadataItem, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadMetadataForFormat:completionHandler:"), format, completionHandler) +} + +// Loads a track that contains the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746529-loadtrackwithtrackid?language=objc +func (a_ Asset) LoadTrackWithTrackIDCompletionHandler(trackID objc.IObject, completionHandler func(arg0 AssetTrack, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadTrackWithTrackID:completionHandler:"), objc.Ptr(trackID), completionHandler) +} + +// Loads tracks that contain media of a specified type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746531-loadtrackswithmediatype?language=objc +func (a_ Asset) LoadTracksWithMediaTypeCompletionHandler(mediaType MediaType, completionHandler func(arg0 []AssetTrack, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadTracksWithMediaType:completionHandler:"), mediaType, completionHandler) +} + +// Loads chapter metadata with a locale that best matches the list of preferred languages. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746525-loadchaptermetadatagroupsbestmat?language=objc +func (a_ Asset) LoadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler(preferredLanguages []string, completionHandler func(arg0 []TimedMetadataGroup, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadChapterMetadataGroupsBestMatchingPreferredLanguages:completionHandler:"), preferredLanguages, completionHandler) +} + +// Loads a media selection group that contains one or more options with the specified media characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746527-loadmediaselectiongroupformediac?language=objc +func (a_ Asset) LoadMediaSelectionGroupForMediaCharacteristicCompletionHandler(mediaCharacteristic MediaCharacteristic, completionHandler func(arg0 MediaSelectionGroup, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadMediaSelectionGroupForMediaCharacteristic:completionHandler:"), mediaCharacteristic, completionHandler) +} + +// Loads chapter metadata that contains the specified title locale and common keys. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3746526-loadchaptermetadatagroupswithtit?language=objc +func (a_ Asset) LoadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeysCompletionHandler(locale foundation.ILocale, commonKeys []MetadataKey, completionHandler func(arg0 []TimedMetadataGroup, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadChapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:completionHandler:"), objc.Ptr(locale), commonKeys, completionHandler) +} + +// A time value that indicates how closely playback follows the latest live stream content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/3197641-minimumtimeoffsetfromlive?language=objc +func (a_ Asset) MinimumTimeOffsetFromLive() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("minimumTimeOffsetFromLive")) + return rv +} + +// The lyrics of the asset in a language suitable for the current locale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1388104-lyrics?language=objc +func (a_ Asset) Lyrics() string { + rv := objc.Call[string](a_, objc.Sel("lyrics")) + return rv +} + +// The tracks an asset contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1387953-tracks?language=objc +func (a_ Asset) Tracks() []AssetTrack { + rv := objc.Call[[]AssetTrack](a_, objc.Sel("tracks")) + return rv +} + +// A Boolean value that indicates whether you can extract the asset’s media data using an asset reader. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1390475-readable?language=objc +func (a_ Asset) IsReadable() bool { + rv := objc.Call[bool](a_, objc.Sel("isReadable")) + return rv +} + +// An array of media characteristics for which a media selection option is available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389433-availablemediacharacteristicswit?language=objc +func (a_ Asset) AvailableMediaCharacteristicsWithMediaSelectionOptions() []MediaCharacteristic { + rv := objc.Call[[]MediaCharacteristic](a_, objc.Sel("availableMediaCharacteristicsWithMediaSelectionOptions")) + return rv +} + +// The asset’s volume preference for playing its audible media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1390457-preferredvolume?language=objc +func (a_ Asset) PreferredVolume() float64 { + rv := objc.Call[float64](a_, objc.Sel("preferredVolume")) + return rv +} + +// A Boolean value that indicates whether you can extend the asset by fragments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389520-cancontainfragments?language=objc +func (a_ Asset) CanContainFragments() bool { + rv := objc.Call[bool](a_, objc.Sel("canContainFragments")) + return rv +} + +// The locales of the asset’s chapter metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1388228-availablechapterlocales?language=objc +func (a_ Asset) AvailableChapterLocales() []foundation.Locale { + rv := objc.Call[[]foundation.Locale](a_, objc.Sel("availableChapterLocales")) + return rv +} + +// A Boolean value that indicates whether you can use the asset as a segment of a composition track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1386129-composable?language=objc +func (a_ Asset) IsComposable() bool { + rv := objc.Call[bool](a_, objc.Sel("isComposable")) + return rv +} + +// A Boolean value that indicates whether the asset provides precise duration and timing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1390850-providesprecisedurationandtiming?language=objc +func (a_ Asset) ProvidesPreciseDurationAndTiming() bool { + rv := objc.Call[bool](a_, objc.Sel("providesPreciseDurationAndTiming")) + return rv +} + +// An array of metadata items for all metadata identifiers for which a value is available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1386884-metadata?language=objc +func (a_ Asset) Metadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](a_, objc.Sel("metadata")) + return rv +} + +// The asset’s rate preference for playing its media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389912-preferredrate?language=objc +func (a_ Asset) PreferredRate() float64 { + rv := objc.Call[float64](a_, objc.Sel("preferredRate")) + return rv +} + +// The metadata formats this asset contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1385823-availablemetadataformats?language=objc +func (a_ Asset) AvailableMetadataFormats() []MetadataFormat { + rv := objc.Call[[]MetadataFormat](a_, objc.Sel("availableMetadataFormats")) + return rv +} + +// The total duration of fragments that currently exist, or may exist in the future. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/2715834-overalldurationhint?language=objc +func (a_ Asset) OverallDurationHint() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("overallDurationHint")) + return rv +} + +// A metadata item that indicates the asset’s creation date. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1386342-creationdate?language=objc +func (a_ Asset) CreationDate() MetadataItem { + rv := objc.Call[MetadataItem](a_, objc.Sel("creationDate")) + return rv +} + +// The track groups an asset contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1390697-trackgroups?language=objc +func (a_ Asset) TrackGroups() []AssetTrackGroup { + rv := objc.Call[[]AssetTrackGroup](a_, objc.Sel("trackGroups")) + return rv +} + +// The restrictions that an asset places on how it resolves references to external media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1390489-referencerestrictions?language=objc +func (a_ Asset) ReferenceRestrictions() AssetReferenceRestrictions { + rv := objc.Call[AssetReferenceRestrictions](a_, objc.Sel("referenceRestrictions")) + return rv +} + +// The array of available media selections for this asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/2890796-allmediaselections?language=objc +func (a_ Asset) AllMediaSelections() []MediaSelection { + rv := objc.Call[[]MediaSelection](a_, objc.Sel("allMediaSelections")) + return rv +} + +// A Boolean value that indicates whether the asset contains protected content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389223-hasprotectedcontent?language=objc +func (a_ Asset) HasProtectedContent() bool { + rv := objc.Call[bool](a_, objc.Sel("hasProtectedContent")) + return rv +} + +// A time value that indicates the asset’s duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389400-duration?language=objc +func (a_ Asset) Duration() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("duration")) + return rv +} + +// The default media selections for this asset’s media selection groups. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1386122-preferredmediaselection?language=objc +func (a_ Asset) PreferredMediaSelection() MediaSelection { + rv := objc.Call[MediaSelection](a_, objc.Sel("preferredMediaSelection")) + return rv +} + +// A Boolean value that indicates whether the asset is compatible with AirPlay Video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1390333-compatiblewithairplayvideo?language=objc +func (a_ Asset) IsCompatibleWithAirPlayVideo() bool { + rv := objc.Call[bool](a_, objc.Sel("isCompatibleWithAirPlayVideo")) + return rv +} + +// A Boolean value that indicates whether you can export this asset using an export session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389245-exportable?language=objc +func (a_ Asset) IsExportable() bool { + rv := objc.Call[bool](a_, objc.Sel("isExportable")) + return rv +} + +// A Boolean value that indicates whether at least one movie fragment extends the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1385589-containsfragments?language=objc +func (a_ Asset) ContainsFragments() bool { + rv := objc.Call[bool](a_, objc.Sel("containsFragments")) + return rv +} + +// The asset’s transform preference to apply to its visual content during presentation or processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1385906-preferredtransform?language=objc +func (a_ Asset) PreferredTransform() coregraphics.AffineTransform { + rv := objc.Call[coregraphics.AffineTransform](a_, objc.Sel("preferredTransform")) + return rv +} + +// A Boolean value that indicates whether the asset has playable content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1385974-playable?language=objc +func (a_ Asset) IsPlayable() bool { + rv := objc.Call[bool](a_, objc.Sel("isPlayable")) + return rv +} + +// The metadata items an asset contains for common metadata identifiers that provide a value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1390498-commonmetadata?language=objc +func (a_ Asset) CommonMetadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](a_, objc.Sel("commonMetadata")) + return rv +} diff --git a/macos/avfoundation/asset_cache.gen.go b/macos/avfoundation/asset_cache.gen.go new file mode 100644 index 00000000..6b7802a5 --- /dev/null +++ b/macos/avfoundation/asset_cache.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetCache] class. +var AssetCacheClass = _AssetCacheClass{objc.GetClass("AVAssetCache")} + +type _AssetCacheClass struct { + objc.Class +} + +// An interface definition for the [AssetCache] class. +type IAssetCache interface { + objc.IObject + MediaSelectionOptionsInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) []MediaSelectionOption + IsPlayableOffline() bool +} + +// An object that you use to inspect locally cached media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetcache?language=objc +type AssetCache struct { + objc.Object +} + +func AssetCacheFrom(ptr unsafe.Pointer) AssetCache { + return AssetCache{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetCacheClass) Alloc() AssetCache { + rv := objc.Call[AssetCache](ac, objc.Sel("alloc")) + return rv +} + +func AssetCache_Alloc() AssetCache { + return AssetCacheClass.Alloc() +} + +func (ac _AssetCacheClass) New() AssetCache { + rv := objc.Call[AssetCache](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetCache() AssetCache { + return AssetCacheClass.New() +} + +func (a_ AssetCache) Init() AssetCache { + rv := objc.Call[AssetCache](a_, objc.Sel("init")) + return rv +} + +// Returns an array of locally cached media selection options that are available for offline use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetcache/1823715-mediaselectionoptionsinmediasele?language=objc +func (a_ AssetCache) MediaSelectionOptionsInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) []MediaSelectionOption { + rv := objc.Call[[]MediaSelectionOption](a_, objc.Sel("mediaSelectionOptionsInMediaSelectionGroup:"), objc.Ptr(mediaSelectionGroup)) + return rv +} + +// A Boolean value that indicates whether the asset is playable without an internet connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetcache/1823708-playableoffline?language=objc +func (a_ AssetCache) IsPlayableOffline() bool { + rv := objc.Call[bool](a_, objc.Sel("isPlayableOffline")) + return rv +} diff --git a/macos/avfoundation/asset_download_configuration.gen.go b/macos/avfoundation/asset_download_configuration.gen.go new file mode 100644 index 00000000..954279dc --- /dev/null +++ b/macos/avfoundation/asset_download_configuration.gen.go @@ -0,0 +1,130 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetDownloadConfiguration] class. +var AssetDownloadConfigurationClass = _AssetDownloadConfigurationClass{objc.GetClass("AVAssetDownloadConfiguration")} + +type _AssetDownloadConfigurationClass struct { + objc.Class +} + +// An interface definition for the [AssetDownloadConfiguration] class. +type IAssetDownloadConfiguration interface { + objc.IObject + OptimizesAuxiliaryContentConfigurations() bool + SetOptimizesAuxiliaryContentConfigurations(value bool) + AuxiliaryContentConfigurations() []AssetDownloadContentConfiguration + SetAuxiliaryContentConfigurations(value []IAssetDownloadContentConfiguration) + ArtworkData() []byte + SetArtworkData(value []byte) + PrimaryContentConfiguration() AssetDownloadContentConfiguration +} + +// An object that provides the configuration for a download task. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration?language=objc +type AssetDownloadConfiguration struct { + objc.Object +} + +func AssetDownloadConfigurationFrom(ptr unsafe.Pointer) AssetDownloadConfiguration { + return AssetDownloadConfiguration{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetDownloadConfigurationClass) DownloadConfigurationWithAssetTitle(asset IURLAsset, title string) AssetDownloadConfiguration { + rv := objc.Call[AssetDownloadConfiguration](ac, objc.Sel("downloadConfigurationWithAsset:title:"), objc.Ptr(asset), title) + return rv +} + +// Creates a download configuration for a media asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750220-downloadconfigurationwithasset?language=objc +func AssetDownloadConfiguration_DownloadConfigurationWithAssetTitle(asset IURLAsset, title string) AssetDownloadConfiguration { + return AssetDownloadConfigurationClass.DownloadConfigurationWithAssetTitle(asset, title) +} + +func (ac _AssetDownloadConfigurationClass) Alloc() AssetDownloadConfiguration { + rv := objc.Call[AssetDownloadConfiguration](ac, objc.Sel("alloc")) + return rv +} + +func AssetDownloadConfiguration_Alloc() AssetDownloadConfiguration { + return AssetDownloadConfigurationClass.Alloc() +} + +func (ac _AssetDownloadConfigurationClass) New() AssetDownloadConfiguration { + rv := objc.Call[AssetDownloadConfiguration](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetDownloadConfiguration() AssetDownloadConfiguration { + return AssetDownloadConfigurationClass.New() +} + +func (a_ AssetDownloadConfiguration) Init() AssetDownloadConfiguration { + rv := objc.Call[AssetDownloadConfiguration](a_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the task optimizes auxiliary content selection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750221-optimizesauxiliarycontentconfigu?language=objc +func (a_ AssetDownloadConfiguration) OptimizesAuxiliaryContentConfigurations() bool { + rv := objc.Call[bool](a_, objc.Sel("optimizesAuxiliaryContentConfigurations")) + return rv +} + +// A Boolean value that indicates whether the task optimizes auxiliary content selection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750221-optimizesauxiliarycontentconfigu?language=objc +func (a_ AssetDownloadConfiguration) SetOptimizesAuxiliaryContentConfigurations(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setOptimizesAuxiliaryContentConfigurations:"), value) +} + +// The configuration for the auxiliary content that the task downloads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750219-auxiliarycontentconfigurations?language=objc +func (a_ AssetDownloadConfiguration) AuxiliaryContentConfigurations() []AssetDownloadContentConfiguration { + rv := objc.Call[[]AssetDownloadContentConfiguration](a_, objc.Sel("auxiliaryContentConfigurations")) + return rv +} + +// The configuration for the auxiliary content that the task downloads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750219-auxiliarycontentconfigurations?language=objc +func (a_ AssetDownloadConfiguration) SetAuxiliaryContentConfigurations(value []IAssetDownloadContentConfiguration) { + objc.Call[objc.Void](a_, objc.Sel("setAuxiliaryContentConfigurations:"), value) +} + +// A data value that represents the asset’s artwork. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750218-artworkdata?language=objc +func (a_ AssetDownloadConfiguration) ArtworkData() []byte { + rv := objc.Call[[]byte](a_, objc.Sel("artworkData")) + return rv +} + +// A data value that represents the asset’s artwork. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750218-artworkdata?language=objc +func (a_ AssetDownloadConfiguration) SetArtworkData(value []byte) { + objc.Call[objc.Void](a_, objc.Sel("setArtworkData:"), value) +} + +// The configuration for the primary content that the task downloads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadconfiguration/3750222-primarycontentconfiguration?language=objc +func (a_ AssetDownloadConfiguration) PrimaryContentConfiguration() AssetDownloadContentConfiguration { + rv := objc.Call[AssetDownloadContentConfiguration](a_, objc.Sel("primaryContentConfiguration")) + return rv +} diff --git a/macos/avfoundation/asset_download_content_configuration.gen.go b/macos/avfoundation/asset_download_content_configuration.gen.go new file mode 100644 index 00000000..00bc0f21 --- /dev/null +++ b/macos/avfoundation/asset_download_content_configuration.gen.go @@ -0,0 +1,92 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetDownloadContentConfiguration] class. +var AssetDownloadContentConfigurationClass = _AssetDownloadContentConfigurationClass{objc.GetClass("AVAssetDownloadContentConfiguration")} + +type _AssetDownloadContentConfigurationClass struct { + objc.Class +} + +// An interface definition for the [AssetDownloadContentConfiguration] class. +type IAssetDownloadContentConfiguration interface { + objc.IObject + MediaSelections() []MediaSelection + SetMediaSelections(value []IMediaSelection) + VariantQualifiers() []AssetVariantQualifier + SetVariantQualifiers(value []IAssetVariantQualifier) +} + +// A configuration object that contains variant qualifiers and media options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadcontentconfiguration?language=objc +type AssetDownloadContentConfiguration struct { + objc.Object +} + +func AssetDownloadContentConfigurationFrom(ptr unsafe.Pointer) AssetDownloadContentConfiguration { + return AssetDownloadContentConfiguration{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetDownloadContentConfigurationClass) Alloc() AssetDownloadContentConfiguration { + rv := objc.Call[AssetDownloadContentConfiguration](ac, objc.Sel("alloc")) + return rv +} + +func AssetDownloadContentConfiguration_Alloc() AssetDownloadContentConfiguration { + return AssetDownloadContentConfigurationClass.Alloc() +} + +func (ac _AssetDownloadContentConfigurationClass) New() AssetDownloadContentConfiguration { + rv := objc.Call[AssetDownloadContentConfiguration](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetDownloadContentConfiguration() AssetDownloadContentConfiguration { + return AssetDownloadContentConfigurationClass.New() +} + +func (a_ AssetDownloadContentConfiguration) Init() AssetDownloadContentConfiguration { + rv := objc.Call[AssetDownloadContentConfiguration](a_, objc.Sel("init")) + return rv +} + +// The media selections of an asset that a task downloads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadcontentconfiguration/3750224-mediaselections?language=objc +func (a_ AssetDownloadContentConfiguration) MediaSelections() []MediaSelection { + rv := objc.Call[[]MediaSelection](a_, objc.Sel("mediaSelections")) + return rv +} + +// The media selections of an asset that a task downloads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadcontentconfiguration/3750224-mediaselections?language=objc +func (a_ AssetDownloadContentConfiguration) SetMediaSelections(value []IMediaSelection) { + objc.Call[objc.Void](a_, objc.Sel("setMediaSelections:"), value) +} + +// The variant qualifiers for this configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadcontentconfiguration/3750225-variantqualifiers?language=objc +func (a_ AssetDownloadContentConfiguration) VariantQualifiers() []AssetVariantQualifier { + rv := objc.Call[[]AssetVariantQualifier](a_, objc.Sel("variantQualifiers")) + return rv +} + +// The variant qualifiers for this configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadcontentconfiguration/3750225-variantqualifiers?language=objc +func (a_ AssetDownloadContentConfiguration) SetVariantQualifiers(value []IAssetVariantQualifier) { + objc.Call[objc.Void](a_, objc.Sel("setVariantQualifiers:"), value) +} diff --git a/macos/avfoundation/asset_download_delegate.gen.go b/macos/avfoundation/asset_download_delegate.gen.go new file mode 100644 index 00000000..37db861f --- /dev/null +++ b/macos/avfoundation/asset_download_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods to implement to respond to asset-download events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloaddelegate?language=objc +type PAssetDownloadDelegate interface { + // optional + URLSessionAggregateAssetDownloadTaskWillDownloadToURL(session foundation.URLSession, aggregateAssetDownloadTask AggregateAssetDownloadTask, location foundation.URL) + HasURLSessionAggregateAssetDownloadTaskWillDownloadToURL() bool +} + +// A delegate implementation builder for the [PAssetDownloadDelegate] protocol. +type AssetDownloadDelegate struct { + _URLSessionAggregateAssetDownloadTaskWillDownloadToURL func(session foundation.URLSession, aggregateAssetDownloadTask AggregateAssetDownloadTask, location foundation.URL) +} + +func (di *AssetDownloadDelegate) HasURLSessionAggregateAssetDownloadTaskWillDownloadToURL() bool { + return di._URLSessionAggregateAssetDownloadTaskWillDownloadToURL != nil +} + +// Tells the delegate the final location of the asset when the download completes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloaddelegate/2897241-urlsession?language=objc +func (di *AssetDownloadDelegate) SetURLSessionAggregateAssetDownloadTaskWillDownloadToURL(f func(session foundation.URLSession, aggregateAssetDownloadTask AggregateAssetDownloadTask, location foundation.URL)) { + di._URLSessionAggregateAssetDownloadTaskWillDownloadToURL = f +} + +// Tells the delegate the final location of the asset when the download completes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloaddelegate/2897241-urlsession?language=objc +func (di *AssetDownloadDelegate) URLSessionAggregateAssetDownloadTaskWillDownloadToURL(session foundation.URLSession, aggregateAssetDownloadTask AggregateAssetDownloadTask, location foundation.URL) { + di._URLSessionAggregateAssetDownloadTaskWillDownloadToURL(session, aggregateAssetDownloadTask, location) +} + +// A concrete type wrapper for the [PAssetDownloadDelegate] protocol. +type AssetDownloadDelegateWrapper struct { + objc.Object +} + +func (a_ AssetDownloadDelegateWrapper) HasURLSessionAggregateAssetDownloadTaskWillDownloadToURL() bool { + return a_.RespondsToSelector(objc.Sel("URLSession:aggregateAssetDownloadTask:willDownloadToURL:")) +} + +// Tells the delegate the final location of the asset when the download completes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloaddelegate/2897241-urlsession?language=objc +func (a_ AssetDownloadDelegateWrapper) URLSessionAggregateAssetDownloadTaskWillDownloadToURL(session foundation.IURLSession, aggregateAssetDownloadTask IAggregateAssetDownloadTask, location foundation.IURL) { + objc.Call[objc.Void](a_, objc.Sel("URLSession:aggregateAssetDownloadTask:willDownloadToURL:"), objc.Ptr(session), objc.Ptr(aggregateAssetDownloadTask), objc.Ptr(location)) +} diff --git a/macos/avfoundation/asset_download_storage_management_policy.gen.go b/macos/avfoundation/asset_download_storage_management_policy.gen.go new file mode 100644 index 00000000..647c8008 --- /dev/null +++ b/macos/avfoundation/asset_download_storage_management_policy.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetDownloadStorageManagementPolicy] class. +var AssetDownloadStorageManagementPolicyClass = _AssetDownloadStorageManagementPolicyClass{objc.GetClass("AVAssetDownloadStorageManagementPolicy")} + +type _AssetDownloadStorageManagementPolicyClass struct { + objc.Class +} + +// An interface definition for the [AssetDownloadStorageManagementPolicy] class. +type IAssetDownloadStorageManagementPolicy interface { + objc.IObject + Priority() AssetDownloadedAssetEvictionPriority + ExpirationDate() foundation.Date +} + +// An object that defines a policy to automatically manage the storage of downloaded assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanagementpolicy?language=objc +type AssetDownloadStorageManagementPolicy struct { + objc.Object +} + +func AssetDownloadStorageManagementPolicyFrom(ptr unsafe.Pointer) AssetDownloadStorageManagementPolicy { + return AssetDownloadStorageManagementPolicy{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetDownloadStorageManagementPolicyClass) Alloc() AssetDownloadStorageManagementPolicy { + rv := objc.Call[AssetDownloadStorageManagementPolicy](ac, objc.Sel("alloc")) + return rv +} + +func AssetDownloadStorageManagementPolicy_Alloc() AssetDownloadStorageManagementPolicy { + return AssetDownloadStorageManagementPolicyClass.Alloc() +} + +func (ac _AssetDownloadStorageManagementPolicyClass) New() AssetDownloadStorageManagementPolicy { + rv := objc.Call[AssetDownloadStorageManagementPolicy](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetDownloadStorageManagementPolicy() AssetDownloadStorageManagementPolicy { + return AssetDownloadStorageManagementPolicyClass.New() +} + +func (a_ AssetDownloadStorageManagementPolicy) Init() AssetDownloadStorageManagementPolicy { + rv := objc.Call[AssetDownloadStorageManagementPolicy](a_, objc.Sel("init")) + return rv +} + +// The eviction priority for an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanagementpolicy/2865565-priority?language=objc +func (a_ AssetDownloadStorageManagementPolicy) Priority() AssetDownloadedAssetEvictionPriority { + rv := objc.Call[AssetDownloadedAssetEvictionPriority](a_, objc.Sel("priority")) + return rv +} + +// The expiration date for an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanagementpolicy/2865559-expirationdate?language=objc +func (a_ AssetDownloadStorageManagementPolicy) ExpirationDate() foundation.Date { + rv := objc.Call[foundation.Date](a_, objc.Sel("expirationDate")) + return rv +} diff --git a/macos/avfoundation/asset_download_storage_manager.gen.go b/macos/avfoundation/asset_download_storage_manager.gen.go new file mode 100644 index 00000000..21ca5ed5 --- /dev/null +++ b/macos/avfoundation/asset_download_storage_manager.gen.go @@ -0,0 +1,91 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetDownloadStorageManager] class. +var AssetDownloadStorageManagerClass = _AssetDownloadStorageManagerClass{objc.GetClass("AVAssetDownloadStorageManager")} + +type _AssetDownloadStorageManagerClass struct { + objc.Class +} + +// An interface definition for the [AssetDownloadStorageManager] class. +type IAssetDownloadStorageManager interface { + objc.IObject + StorageManagementPolicyForURL(downloadStorageURL foundation.IURL) AssetDownloadStorageManagementPolicy + SetStorageManagementPolicyForURL(storageManagementPolicy IAssetDownloadStorageManagementPolicy, downloadStorageURL foundation.IURL) +} + +// An object that manages policies to automatically purge downloaded assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanager?language=objc +type AssetDownloadStorageManager struct { + objc.Object +} + +func AssetDownloadStorageManagerFrom(ptr unsafe.Pointer) AssetDownloadStorageManager { + return AssetDownloadStorageManager{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetDownloadStorageManagerClass) Alloc() AssetDownloadStorageManager { + rv := objc.Call[AssetDownloadStorageManager](ac, objc.Sel("alloc")) + return rv +} + +func AssetDownloadStorageManager_Alloc() AssetDownloadStorageManager { + return AssetDownloadStorageManagerClass.Alloc() +} + +func (ac _AssetDownloadStorageManagerClass) New() AssetDownloadStorageManager { + rv := objc.Call[AssetDownloadStorageManager](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetDownloadStorageManager() AssetDownloadStorageManager { + return AssetDownloadStorageManagerClass.New() +} + +func (a_ AssetDownloadStorageManager) Init() AssetDownloadStorageManager { + rv := objc.Call[AssetDownloadStorageManager](a_, objc.Sel("init")) + return rv +} + +// Returns the shared storage manager instance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanager/2865563-shareddownloadstoragemanager?language=objc +func (ac _AssetDownloadStorageManagerClass) SharedDownloadStorageManager() AssetDownloadStorageManager { + rv := objc.Call[AssetDownloadStorageManager](ac, objc.Sel("sharedDownloadStorageManager")) + return rv +} + +// Returns the shared storage manager instance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanager/2865563-shareddownloadstoragemanager?language=objc +func AssetDownloadStorageManager_SharedDownloadStorageManager() AssetDownloadStorageManager { + return AssetDownloadStorageManagerClass.SharedDownloadStorageManager() +} + +// Returns the storage management policy for a downloaded asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanager/2865562-storagemanagementpolicyforurl?language=objc +func (a_ AssetDownloadStorageManager) StorageManagementPolicyForURL(downloadStorageURL foundation.IURL) AssetDownloadStorageManagementPolicy { + rv := objc.Call[AssetDownloadStorageManagementPolicy](a_, objc.Sel("storageManagementPolicyForURL:"), objc.Ptr(downloadStorageURL)) + return rv +} + +// Sets a storage policy for the downloaded asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadstoragemanager/2865557-setstoragemanagementpolicy?language=objc +func (a_ AssetDownloadStorageManager) SetStorageManagementPolicyForURL(storageManagementPolicy IAssetDownloadStorageManagementPolicy, downloadStorageURL foundation.IURL) { + objc.Call[objc.Void](a_, objc.Sel("setStorageManagementPolicy:forURL:"), objc.Ptr(storageManagementPolicy), objc.Ptr(downloadStorageURL)) +} diff --git a/macos/avfoundation/asset_download_task.gen.go b/macos/avfoundation/asset_download_task.gen.go new file mode 100644 index 00000000..4825324f --- /dev/null +++ b/macos/avfoundation/asset_download_task.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetDownloadTask] class. +var AssetDownloadTaskClass = _AssetDownloadTaskClass{objc.GetClass("AVAssetDownloadTask")} + +type _AssetDownloadTaskClass struct { + objc.Class +} + +// An interface definition for the [AssetDownloadTask] class. +type IAssetDownloadTask interface { + foundation.IURLSessionTask + Options() map[string]objc.Object + LoadedTimeRanges() []foundation.Value + URLAsset() URLAsset +} + +// A session used to download HTTP Live Streaming assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadtask?language=objc +type AssetDownloadTask struct { + foundation.URLSessionTask +} + +func AssetDownloadTaskFrom(ptr unsafe.Pointer) AssetDownloadTask { + return AssetDownloadTask{ + URLSessionTask: foundation.URLSessionTaskFrom(ptr), + } +} + +func (ac _AssetDownloadTaskClass) Alloc() AssetDownloadTask { + rv := objc.Call[AssetDownloadTask](ac, objc.Sel("alloc")) + return rv +} + +func AssetDownloadTask_Alloc() AssetDownloadTask { + return AssetDownloadTaskClass.Alloc() +} + +func (ac _AssetDownloadTaskClass) New() AssetDownloadTask { + rv := objc.Call[AssetDownloadTask](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetDownloadTask() AssetDownloadTask { + return AssetDownloadTaskClass.New() +} + +func (a_ AssetDownloadTask) Init() AssetDownloadTask { + rv := objc.Call[AssetDownloadTask](a_, objc.Sel("init")) + return rv +} + +// The configuration options for the task. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadtask/1621014-options?language=objc +func (a_ AssetDownloadTask) Options() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](a_, objc.Sel("options")) + return rv +} + +// The time ranges of the downloaded media that are ready for playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadtask/1621026-loadedtimeranges?language=objc +func (a_ AssetDownloadTask) LoadedTimeRanges() []foundation.Value { + rv := objc.Call[[]foundation.Value](a_, objc.Sel("loadedTimeRanges")) + return rv +} + +// The asset that this task downloads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadtask/1621024-urlasset?language=objc +func (a_ AssetDownloadTask) URLAsset() URLAsset { + rv := objc.Call[URLAsset](a_, objc.Sel("URLAsset")) + return rv +} diff --git a/macos/avfoundation/asset_download_url_session.gen.go b/macos/avfoundation/asset_download_url_session.gen.go new file mode 100644 index 00000000..500b3fe2 --- /dev/null +++ b/macos/avfoundation/asset_download_url_session.gen.go @@ -0,0 +1,108 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetDownloadURLSession] class. +var AssetDownloadURLSessionClass = _AssetDownloadURLSessionClass{objc.GetClass("AVAssetDownloadURLSession")} + +type _AssetDownloadURLSessionClass struct { + objc.Class +} + +// An interface definition for the [AssetDownloadURLSession] class. +type IAssetDownloadURLSession interface { + foundation.IURLSession + AggregateAssetDownloadTaskWithURLAssetMediaSelectionsAssetTitleAssetArtworkDataOptions(URLAsset IURLAsset, mediaSelections []IMediaSelection, title string, artworkData []byte, options map[string]objc.IObject) AggregateAssetDownloadTask + AssetDownloadTaskWithConfiguration(downloadConfiguration IAssetDownloadConfiguration) AssetDownloadTask +} + +// A URL session that creates and executes asset download tasks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession?language=objc +type AssetDownloadURLSession struct { + foundation.URLSession +} + +func AssetDownloadURLSessionFrom(ptr unsafe.Pointer) AssetDownloadURLSession { + return AssetDownloadURLSession{ + URLSession: foundation.URLSessionFrom(ptr), + } +} + +func (ac _AssetDownloadURLSessionClass) Alloc() AssetDownloadURLSession { + rv := objc.Call[AssetDownloadURLSession](ac, objc.Sel("alloc")) + return rv +} + +func AssetDownloadURLSession_Alloc() AssetDownloadURLSession { + return AssetDownloadURLSessionClass.Alloc() +} + +func (ac _AssetDownloadURLSessionClass) New() AssetDownloadURLSession { + rv := objc.Call[AssetDownloadURLSession](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetDownloadURLSession() AssetDownloadURLSession { + return AssetDownloadURLSessionClass.New() +} + +func (a_ AssetDownloadURLSession) Init() AssetDownloadURLSession { + rv := objc.Call[AssetDownloadURLSession](a_, objc.Sel("init")) + return rv +} + +// Creates a URL session to download assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession/1621015-sessionwithconfiguration?language=objc +func (ac _AssetDownloadURLSessionClass) SessionWithConfigurationAssetDownloadDelegateDelegateQueue(configuration foundation.IURLSessionConfiguration, delegate PAssetDownloadDelegate, delegateQueue foundation.IOperationQueue) AssetDownloadURLSession { + po1 := objc.WrapAsProtocol("AVAssetDownloadDelegate", delegate) + rv := objc.Call[AssetDownloadURLSession](ac, objc.Sel("sessionWithConfiguration:assetDownloadDelegate:delegateQueue:"), objc.Ptr(configuration), po1, objc.Ptr(delegateQueue)) + return rv +} + +// Creates a URL session to download assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession/1621015-sessionwithconfiguration?language=objc +func AssetDownloadURLSession_SessionWithConfigurationAssetDownloadDelegateDelegateQueue(configuration foundation.IURLSessionConfiguration, delegate PAssetDownloadDelegate, delegateQueue foundation.IOperationQueue) AssetDownloadURLSession { + return AssetDownloadURLSessionClass.SessionWithConfigurationAssetDownloadDelegateDelegateQueue(configuration, delegate, delegateQueue) +} + +// Creates a URL session to download assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession/1621015-sessionwithconfiguration?language=objc +func (ac _AssetDownloadURLSessionClass) SessionWithConfigurationAssetDownloadDelegateObjectDelegateQueue(configuration foundation.IURLSessionConfiguration, delegateObject objc.IObject, delegateQueue foundation.IOperationQueue) AssetDownloadURLSession { + rv := objc.Call[AssetDownloadURLSession](ac, objc.Sel("sessionWithConfiguration:assetDownloadDelegate:delegateQueue:"), objc.Ptr(configuration), objc.Ptr(delegateObject), objc.Ptr(delegateQueue)) + return rv +} + +// Creates a URL session to download assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession/1621015-sessionwithconfiguration?language=objc +func AssetDownloadURLSession_SessionWithConfigurationAssetDownloadDelegateObjectDelegateQueue(configuration foundation.IURLSessionConfiguration, delegateObject objc.IObject, delegateQueue foundation.IOperationQueue) AssetDownloadURLSession { + return AssetDownloadURLSessionClass.SessionWithConfigurationAssetDownloadDelegateObjectDelegateQueue(configuration, delegateObject, delegateQueue) +} + +// Creates a download task to download the asset and media selections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession/2897242-aggregateassetdownloadtaskwithur?language=objc +func (a_ AssetDownloadURLSession) AggregateAssetDownloadTaskWithURLAssetMediaSelectionsAssetTitleAssetArtworkDataOptions(URLAsset IURLAsset, mediaSelections []IMediaSelection, title string, artworkData []byte, options map[string]objc.IObject) AggregateAssetDownloadTask { + rv := objc.Call[AggregateAssetDownloadTask](a_, objc.Sel("aggregateAssetDownloadTaskWithURLAsset:mediaSelections:assetTitle:assetArtworkData:options:"), objc.Ptr(URLAsset), mediaSelections, title, artworkData, options) + return rv +} + +// Creates a download task that uses the specified configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession/3751761-assetdownloadtaskwithconfigurati?language=objc +func (a_ AssetDownloadURLSession) AssetDownloadTaskWithConfiguration(downloadConfiguration IAssetDownloadConfiguration) AssetDownloadTask { + rv := objc.Call[AssetDownloadTask](a_, objc.Sel("assetDownloadTaskWithConfiguration:"), objc.Ptr(downloadConfiguration)) + return rv +} diff --git a/macos/avfoundation/asset_export_session.gen.go b/macos/avfoundation/asset_export_session.gen.go new file mode 100644 index 00000000..c0156556 --- /dev/null +++ b/macos/avfoundation/asset_export_session.gen.go @@ -0,0 +1,422 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetExportSession] class. +var AssetExportSessionClass = _AssetExportSessionClass{objc.GetClass("AVAssetExportSession")} + +type _AssetExportSessionClass struct { + objc.Class +} + +// An interface definition for the [AssetExportSession] class. +type IAssetExportSession interface { + objc.IObject + ExportAsynchronouslyWithCompletionHandler(handler func()) + DetermineCompatibleFileTypesWithCompletionHandler(handler func(compatibleFileTypes []FileType)) + EstimateOutputFileLengthWithCompletionHandler(handler func(estimatedOutputFileLength int64, error foundation.Error)) + CancelExport() + EstimateMaximumDurationWithCompletionHandler(handler func(estimatedMaximumDuration coremedia.Time, error foundation.Error)) + Error() foundation.Error + MetadataItemFilter() MetadataItemFilter + SetMetadataItemFilter(value IMetadataItemFilter) + VideoComposition() VideoComposition + SetVideoComposition(value IVideoComposition) + FileLengthLimit() int64 + SetFileLengthLimit(value int64) + AudioTimePitchAlgorithm() AudioTimePitchAlgorithm + SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) + SupportedFileTypes() []FileType + Metadata() []MetadataItem + SetMetadata(value []IMetadataItem) + PresetName() string + CanPerformMultiplePassesOverSourceMediaData() bool + SetCanPerformMultiplePassesOverSourceMediaData(value bool) + CustomVideoCompositor() VideoCompositingWrapper + OutputFileType() FileType + SetOutputFileType(value FileType) + ShouldOptimizeForNetworkUse() bool + SetShouldOptimizeForNetworkUse(value bool) + DirectoryForTemporaryFiles() foundation.URL + SetDirectoryForTemporaryFiles(value foundation.IURL) + TimeRange() coremedia.TimeRange + SetTimeRange(value coremedia.TimeRange) + AudioMix() AudioMix + SetAudioMix(value IAudioMix) + Progress() float64 + Status() AssetExportSessionStatus + Asset() Asset + OutputURL() foundation.URL + SetOutputURL(value foundation.IURL) +} + +// An object that exports assets in a format that you specify using an export preset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession?language=objc +type AssetExportSession struct { + objc.Object +} + +func AssetExportSessionFrom(ptr unsafe.Pointer) AssetExportSession { + return AssetExportSession{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetExportSessionClass) ExportSessionWithAssetPresetName(asset IAsset, presetName string) AssetExportSession { + rv := objc.Call[AssetExportSession](ac, objc.Sel("exportSessionWithAsset:presetName:"), objc.Ptr(asset), presetName) + return rv +} + +// Returns a new asset export session that uses the specified preset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1564246-exportsessionwithasset?language=objc +func AssetExportSession_ExportSessionWithAssetPresetName(asset IAsset, presetName string) AssetExportSession { + return AssetExportSessionClass.ExportSessionWithAssetPresetName(asset, presetName) +} + +func (a_ AssetExportSession) InitWithAssetPresetName(asset IAsset, presetName string) AssetExportSession { + rv := objc.Call[AssetExportSession](a_, objc.Sel("initWithAsset:presetName:"), objc.Ptr(asset), presetName) + return rv +} + +// Creates an export session with a preset configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1389367-initwithasset?language=objc +func NewAssetExportSessionWithAssetPresetName(asset IAsset, presetName string) AssetExportSession { + instance := AssetExportSessionClass.Alloc().InitWithAssetPresetName(asset, presetName) + instance.Autorelease() + return instance +} + +func (ac _AssetExportSessionClass) Alloc() AssetExportSession { + rv := objc.Call[AssetExportSession](ac, objc.Sel("alloc")) + return rv +} + +func AssetExportSession_Alloc() AssetExportSession { + return AssetExportSessionClass.Alloc() +} + +func (ac _AssetExportSessionClass) New() AssetExportSession { + rv := objc.Call[AssetExportSession](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetExportSession() AssetExportSession { + return AssetExportSessionClass.New() +} + +func (a_ AssetExportSession) Init() AssetExportSession { + rv := objc.Call[AssetExportSession](a_, objc.Sel("init")) + return rv +} + +// Starts the asynchronous execution of an export session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388005-exportasynchronouslywithcompleti?language=objc +func (a_ AssetExportSession) ExportAsynchronouslyWithCompletionHandler(handler func()) { + objc.Call[objc.Void](a_, objc.Sel("exportAsynchronouslyWithCompletionHandler:"), handler) +} + +// Determines the output file types an asset export session supports writing in its current configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1387907-determinecompatiblefiletypeswith?language=objc +func (a_ AssetExportSession) DetermineCompatibleFileTypesWithCompletionHandler(handler func(compatibleFileTypes []FileType)) { + objc.Call[objc.Void](a_, objc.Sel("determineCompatibleFileTypesWithCompletionHandler:"), handler) +} + +// Starts estimating the output file length of the export while considering the asset, preset, and time range configuration of the export session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/3042921-estimateoutputfilelengthwithcomp?language=objc +func (a_ AssetExportSession) EstimateOutputFileLengthWithCompletionHandler(handler func(estimatedOutputFileLength int64, error foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("estimateOutputFileLengthWithCompletionHandler:"), handler) +} + +// Determines an export preset’s compatibility to export the asset in a container of the output file type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1385821-determinecompatibilityofexportpr?language=objc +func (ac _AssetExportSessionClass) DetermineCompatibilityOfExportPresetWithAssetOutputFileTypeCompletionHandler(presetName string, asset IAsset, outputFileType FileType, handler func(compatible bool)) { + objc.Call[objc.Void](ac, objc.Sel("determineCompatibilityOfExportPreset:withAsset:outputFileType:completionHandler:"), presetName, objc.Ptr(asset), outputFileType, handler) +} + +// Determines an export preset’s compatibility to export the asset in a container of the output file type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1385821-determinecompatibilityofexportpr?language=objc +func AssetExportSession_DetermineCompatibilityOfExportPresetWithAssetOutputFileTypeCompletionHandler(presetName string, asset IAsset, outputFileType FileType, handler func(compatible bool)) { + AssetExportSessionClass.DetermineCompatibilityOfExportPresetWithAssetOutputFileTypeCompletionHandler(presetName, asset, outputFileType, handler) +} + +// Returns all available export preset names. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1387150-allexportpresets?language=objc +func (ac _AssetExportSessionClass) AllExportPresets() []string { + rv := objc.Call[[]string](ac, objc.Sel("allExportPresets")) + return rv +} + +// Returns all available export preset names. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1387150-allexportpresets?language=objc +func AssetExportSession_AllExportPresets() []string { + return AssetExportSessionClass.AllExportPresets() +} + +// Cancels the execution of an export session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1387794-cancelexport?language=objc +func (a_ AssetExportSession) CancelExport() { + objc.Call[objc.Void](a_, objc.Sel("cancelExport")) +} + +// Starts estimating the maximum duration of the export while considering the asset, preset, and time range configuration of the export session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/3042920-estimatemaximumdurationwithcompl?language=objc +func (a_ AssetExportSession) EstimateMaximumDurationWithCompletionHandler(handler func(estimatedMaximumDuration coremedia.Time, error foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("estimateMaximumDurationWithCompletionHandler:"), handler) +} + +// An optional error object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1385936-error?language=objc +func (a_ AssetExportSession) Error() foundation.Error { + rv := objc.Call[foundation.Error](a_, objc.Sel("error")) + return rv +} + +// An object the export session uses to filter the metadata items it transfers to the output asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390226-metadataitemfilter?language=objc +func (a_ AssetExportSession) MetadataItemFilter() MetadataItemFilter { + rv := objc.Call[MetadataItemFilter](a_, objc.Sel("metadataItemFilter")) + return rv +} + +// An object the export session uses to filter the metadata items it transfers to the output asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390226-metadataitemfilter?language=objc +func (a_ AssetExportSession) SetMetadataItemFilter(value IMetadataItemFilter) { + objc.Call[objc.Void](a_, objc.Sel("setMetadataItemFilter:"), objc.Ptr(value)) +} + +// An optional object that provides instructions for how to composite frames of video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1389477-videocomposition?language=objc +func (a_ AssetExportSession) VideoComposition() VideoComposition { + rv := objc.Call[VideoComposition](a_, objc.Sel("videoComposition")) + return rv +} + +// An optional object that provides instructions for how to composite frames of video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1389477-videocomposition?language=objc +func (a_ AssetExportSession) SetVideoComposition(value IVideoComposition) { + objc.Call[objc.Void](a_, objc.Sel("setVideoComposition:"), objc.Ptr(value)) +} + +// The file length that the output of the session must not exceed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1622333-filelengthlimit?language=objc +func (a_ AssetExportSession) FileLengthLimit() int64 { + rv := objc.Call[int64](a_, objc.Sel("fileLengthLimit")) + return rv +} + +// The file length that the output of the session must not exceed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1622333-filelengthlimit?language=objc +func (a_ AssetExportSession) SetFileLengthLimit(value int64) { + objc.Call[objc.Void](a_, objc.Sel("setFileLengthLimit:"), value) +} + +// A processing algorithm for managing audio pitch for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1385835-audiotimepitchalgorithm?language=objc +func (a_ AssetExportSession) AudioTimePitchAlgorithm() AudioTimePitchAlgorithm { + rv := objc.Call[AudioTimePitchAlgorithm](a_, objc.Sel("audioTimePitchAlgorithm")) + return rv +} + +// A processing algorithm for managing audio pitch for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1385835-audiotimepitchalgorithm?language=objc +func (a_ AssetExportSession) SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) { + objc.Call[objc.Void](a_, objc.Sel("setAudioTimePitchAlgorithm:"), value) +} + +// An array containing the types of files the session can write. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388762-supportedfiletypes?language=objc +func (a_ AssetExportSession) SupportedFileTypes() []FileType { + rv := objc.Call[[]FileType](a_, objc.Sel("supportedFileTypes")) + return rv +} + +// The metadata an export session writes to the output container file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390453-metadata?language=objc +func (a_ AssetExportSession) Metadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](a_, objc.Sel("metadata")) + return rv +} + +// The metadata an export session writes to the output container file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390453-metadata?language=objc +func (a_ AssetExportSession) SetMetadata(value []IMetadataItem) { + objc.Call[objc.Void](a_, objc.Sel("setMetadata:"), value) +} + +// The name of the preset that the asset export session uses. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390467-presetname?language=objc +func (a_ AssetExportSession) PresetName() string { + rv := objc.Call[string](a_, objc.Sel("presetName")) + return rv +} + +// A Boolean value that indicates whether the export session can perform multiple passes over the source media to achieve better results. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388797-canperformmultiplepassesoversour?language=objc +func (a_ AssetExportSession) CanPerformMultiplePassesOverSourceMediaData() bool { + rv := objc.Call[bool](a_, objc.Sel("canPerformMultiplePassesOverSourceMediaData")) + return rv +} + +// A Boolean value that indicates whether the export session can perform multiple passes over the source media to achieve better results. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388797-canperformmultiplepassesoversour?language=objc +func (a_ AssetExportSession) SetCanPerformMultiplePassesOverSourceMediaData(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setCanPerformMultiplePassesOverSourceMediaData:"), value) +} + +// An optional custom object to use when compositing video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388288-customvideocompositor?language=objc +func (a_ AssetExportSession) CustomVideoCompositor() VideoCompositingWrapper { + rv := objc.Call[VideoCompositingWrapper](a_, objc.Sel("customVideoCompositor")) + return rv +} + +// The file type of the output an asset export session writes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1387110-outputfiletype?language=objc +func (a_ AssetExportSession) OutputFileType() FileType { + rv := objc.Call[FileType](a_, objc.Sel("outputFileType")) + return rv +} + +// The file type of the output an asset export session writes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1387110-outputfiletype?language=objc +func (a_ AssetExportSession) SetOutputFileType(value FileType) { + objc.Call[objc.Void](a_, objc.Sel("setOutputFileType:"), value) +} + +// A Boolean value that indicates whether to optimize the movie for network use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390593-shouldoptimizefornetworkuse?language=objc +func (a_ AssetExportSession) ShouldOptimizeForNetworkUse() bool { + rv := objc.Call[bool](a_, objc.Sel("shouldOptimizeForNetworkUse")) + return rv +} + +// A Boolean value that indicates whether to optimize the movie for network use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390593-shouldoptimizefornetworkuse?language=objc +func (a_ AssetExportSession) SetShouldOptimizeForNetworkUse(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setShouldOptimizeForNetworkUse:"), value) +} + +// A directory suitable to store temporary files that the export process generates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388699-directoryfortemporaryfiles?language=objc +func (a_ AssetExportSession) DirectoryForTemporaryFiles() foundation.URL { + rv := objc.Call[foundation.URL](a_, objc.Sel("directoryForTemporaryFiles")) + return rv +} + +// A directory suitable to store temporary files that the export process generates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388699-directoryfortemporaryfiles?language=objc +func (a_ AssetExportSession) SetDirectoryForTemporaryFiles(value foundation.IURL) { + objc.Call[objc.Void](a_, objc.Sel("setDirectoryForTemporaryFiles:"), objc.Ptr(value)) +} + +// The time range of the source asset to export. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388728-timerange?language=objc +func (a_ AssetExportSession) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](a_, objc.Sel("timeRange")) + return rv +} + +// The time range of the source asset to export. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388728-timerange?language=objc +func (a_ AssetExportSession) SetTimeRange(value coremedia.TimeRange) { + objc.Call[objc.Void](a_, objc.Sel("setTimeRange:"), value) +} + +// The parameters for audio mixing and an indication of whether to enable nondefault audio mixing for export. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388155-audiomix?language=objc +func (a_ AssetExportSession) AudioMix() AudioMix { + rv := objc.Call[AudioMix](a_, objc.Sel("audioMix")) + return rv +} + +// The parameters for audio mixing and an indication of whether to enable nondefault audio mixing for export. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1388155-audiomix?language=objc +func (a_ AssetExportSession) SetAudioMix(value IAudioMix) { + objc.Call[objc.Void](a_, objc.Sel("setAudioMix:"), objc.Ptr(value)) +} + +// A value that indicates the progress of the export. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1387530-progress?language=objc +func (a_ AssetExportSession) Progress() float64 { + rv := objc.Call[float64](a_, objc.Sel("progress")) + return rv +} + +// The status of the export session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390528-status?language=objc +func (a_ AssetExportSession) Status() AssetExportSessionStatus { + rv := objc.Call[AssetExportSessionStatus](a_, objc.Sel("status")) + return rv +} + +// An asset that a session exports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1385690-asset?language=objc +func (a_ AssetExportSession) Asset() Asset { + rv := objc.Call[Asset](a_, objc.Sel("asset")) + return rv +} + +// A URL where an asset export session writes its output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1389970-outputurl?language=objc +func (a_ AssetExportSession) OutputURL() foundation.URL { + rv := objc.Call[foundation.URL](a_, objc.Sel("outputURL")) + return rv +} + +// A URL where an asset export session writes its output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsession/1389970-outputurl?language=objc +func (a_ AssetExportSession) SetOutputURL(value foundation.IURL) { + objc.Call[objc.Void](a_, objc.Sel("setOutputURL:"), objc.Ptr(value)) +} diff --git a/macos/avfoundation/asset_image_generator.gen.go b/macos/avfoundation/asset_image_generator.gen.go new file mode 100644 index 00000000..5f35db84 --- /dev/null +++ b/macos/avfoundation/asset_image_generator.gen.go @@ -0,0 +1,223 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetImageGenerator] class. +var AssetImageGeneratorClass = _AssetImageGeneratorClass{objc.GetClass("AVAssetImageGenerator")} + +type _AssetImageGeneratorClass struct { + objc.Class +} + +// An interface definition for the [AssetImageGenerator] class. +type IAssetImageGenerator interface { + objc.IObject + GenerateCGImagesAsynchronouslyForTimesCompletionHandler(requestedTimes []foundation.IValue, handler AssetImageGeneratorCompletionHandler) + CancelAllCGImageGeneration() + MaximumSize() coregraphics.Size + SetMaximumSize(value coregraphics.Size) + VideoComposition() VideoComposition + SetVideoComposition(value IVideoComposition) + ApertureMode() AssetImageGeneratorApertureMode + SetApertureMode(value AssetImageGeneratorApertureMode) + AppliesPreferredTrackTransform() bool + SetAppliesPreferredTrackTransform(value bool) + RequestedTimeToleranceAfter() coremedia.Time + SetRequestedTimeToleranceAfter(value coremedia.Time) + CustomVideoCompositor() VideoCompositingWrapper + RequestedTimeToleranceBefore() coremedia.Time + SetRequestedTimeToleranceBefore(value coremedia.Time) + Asset() Asset +} + +// An object that generates images from a video asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator?language=objc +type AssetImageGenerator struct { + objc.Object +} + +func AssetImageGeneratorFrom(ptr unsafe.Pointer) AssetImageGenerator { + return AssetImageGenerator{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetImageGeneratorClass) AssetImageGeneratorWithAsset(asset IAsset) AssetImageGenerator { + rv := objc.Call[AssetImageGenerator](ac, objc.Sel("assetImageGeneratorWithAsset:"), objc.Ptr(asset)) + return rv +} + +// Returns a new object that generates images for times within a video asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1426634-assetimagegeneratorwithasset?language=objc +func AssetImageGenerator_AssetImageGeneratorWithAsset(asset IAsset) AssetImageGenerator { + return AssetImageGeneratorClass.AssetImageGeneratorWithAsset(asset) +} + +func (a_ AssetImageGenerator) InitWithAsset(asset IAsset) AssetImageGenerator { + rv := objc.Call[AssetImageGenerator](a_, objc.Sel("initWithAsset:"), objc.Ptr(asset)) + return rv +} + +// Creates an object that generates images for times within a video asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1387855-initwithasset?language=objc +func NewAssetImageGeneratorWithAsset(asset IAsset) AssetImageGenerator { + instance := AssetImageGeneratorClass.Alloc().InitWithAsset(asset) + instance.Autorelease() + return instance +} + +func (ac _AssetImageGeneratorClass) Alloc() AssetImageGenerator { + rv := objc.Call[AssetImageGenerator](ac, objc.Sel("alloc")) + return rv +} + +func AssetImageGenerator_Alloc() AssetImageGenerator { + return AssetImageGeneratorClass.Alloc() +} + +func (ac _AssetImageGeneratorClass) New() AssetImageGenerator { + rv := objc.Call[AssetImageGenerator](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetImageGenerator() AssetImageGenerator { + return AssetImageGeneratorClass.New() +} + +func (a_ AssetImageGenerator) Init() AssetImageGenerator { + rv := objc.Call[AssetImageGenerator](a_, objc.Sel("init")) + return rv +} + +// Generates images asynchronously for an array of requested times, and returns the results in a callback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1388100-generatecgimagesasynchronouslyfo?language=objc +func (a_ AssetImageGenerator) GenerateCGImagesAsynchronouslyForTimesCompletionHandler(requestedTimes []foundation.IValue, handler AssetImageGeneratorCompletionHandler) { + objc.Call[objc.Void](a_, objc.Sel("generateCGImagesAsynchronouslyForTimes:completionHandler:"), requestedTimes, handler) +} + +// Cancels all pending image generation requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1385859-cancelallcgimagegeneration?language=objc +func (a_ AssetImageGenerator) CancelAllCGImageGeneration() { + objc.Call[objc.Void](a_, objc.Sel("cancelAllCGImageGeneration")) +} + +// The maximum size of images to generate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1387560-maximumsize?language=objc +func (a_ AssetImageGenerator) MaximumSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](a_, objc.Sel("maximumSize")) + return rv +} + +// The maximum size of images to generate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1387560-maximumsize?language=objc +func (a_ AssetImageGenerator) SetMaximumSize(value coregraphics.Size) { + objc.Call[objc.Void](a_, objc.Sel("setMaximumSize:"), value) +} + +// A video composition to use when extracting images from assets with multiple video tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390189-videocomposition?language=objc +func (a_ AssetImageGenerator) VideoComposition() VideoComposition { + rv := objc.Call[VideoComposition](a_, objc.Sel("videoComposition")) + return rv +} + +// A video composition to use when extracting images from assets with multiple video tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390189-videocomposition?language=objc +func (a_ AssetImageGenerator) SetVideoComposition(value IVideoComposition) { + objc.Call[objc.Void](a_, objc.Sel("setVideoComposition:"), objc.Ptr(value)) +} + +// Specifies the aperture mode for the generated image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1389314-aperturemode?language=objc +func (a_ AssetImageGenerator) ApertureMode() AssetImageGeneratorApertureMode { + rv := objc.Call[AssetImageGeneratorApertureMode](a_, objc.Sel("apertureMode")) + return rv +} + +// Specifies the aperture mode for the generated image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1389314-aperturemode?language=objc +func (a_ AssetImageGenerator) SetApertureMode(value AssetImageGeneratorApertureMode) { + objc.Call[objc.Void](a_, objc.Sel("setApertureMode:"), value) +} + +// A Boolean value that specifies whether to apply the track matrix or matrices when generating an image from the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390616-appliespreferredtracktransform?language=objc +func (a_ AssetImageGenerator) AppliesPreferredTrackTransform() bool { + rv := objc.Call[bool](a_, objc.Sel("appliesPreferredTrackTransform")) + return rv +} + +// A Boolean value that specifies whether to apply the track matrix or matrices when generating an image from the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390616-appliespreferredtracktransform?language=objc +func (a_ AssetImageGenerator) SetAppliesPreferredTrackTransform(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setAppliesPreferredTrackTransform:"), value) +} + +// A maximum length of time after the requested time to allow image generation to occur. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1387751-requestedtimetoleranceafter?language=objc +func (a_ AssetImageGenerator) RequestedTimeToleranceAfter() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("requestedTimeToleranceAfter")) + return rv +} + +// A maximum length of time after the requested time to allow image generation to occur. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1387751-requestedtimetoleranceafter?language=objc +func (a_ AssetImageGenerator) SetRequestedTimeToleranceAfter(value coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("setRequestedTimeToleranceAfter:"), value) +} + +// A custom video compositor to use when extracting images from assets with multiple video tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1386469-customvideocompositor?language=objc +func (a_ AssetImageGenerator) CustomVideoCompositor() VideoCompositingWrapper { + rv := objc.Call[VideoCompositingWrapper](a_, objc.Sel("customVideoCompositor")) + return rv +} + +// A maximum length of time before the requested time to allow image generation to occur. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390571-requestedtimetolerancebefore?language=objc +func (a_ AssetImageGenerator) RequestedTimeToleranceBefore() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("requestedTimeToleranceBefore")) + return rv +} + +// A maximum length of time before the requested time to allow image generation to occur. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390571-requestedtimetolerancebefore?language=objc +func (a_ AssetImageGenerator) SetRequestedTimeToleranceBefore(value coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("setRequestedTimeToleranceBefore:"), value) +} + +// The asset that initialized the image generator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390689-asset?language=objc +func (a_ AssetImageGenerator) Asset() Asset { + rv := objc.Call[Asset](a_, objc.Sel("asset")) + return rv +} diff --git a/macos/avfoundation/asset_reader.gen.go b/macos/avfoundation/asset_reader.gen.go new file mode 100644 index 00000000..01e87746 --- /dev/null +++ b/macos/avfoundation/asset_reader.gen.go @@ -0,0 +1,173 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReader] class. +var AssetReaderClass = _AssetReaderClass{objc.GetClass("AVAssetReader")} + +type _AssetReaderClass struct { + objc.Class +} + +// An interface definition for the [AssetReader] class. +type IAssetReader interface { + objc.IObject + StartReading() bool + CancelReading() + AddOutput(output IAssetReaderOutput) + CanAddOutput(output IAssetReaderOutput) bool + Error() foundation.Error + Outputs() []AssetReaderOutput + TimeRange() coremedia.TimeRange + SetTimeRange(value coremedia.TimeRange) + Status() AssetReaderStatus + Asset() Asset +} + +// An object that reads media data from an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader?language=objc +type AssetReader struct { + objc.Object +} + +func AssetReaderFrom(ptr unsafe.Pointer) AssetReader { + return AssetReader{ + Object: objc.ObjectFrom(ptr), + } +} + +func (a_ AssetReader) InitWithAssetError(asset IAsset, outError foundation.IError) AssetReader { + rv := objc.Call[AssetReader](a_, objc.Sel("initWithAsset:error:"), objc.Ptr(asset), objc.Ptr(outError)) + return rv +} + +// Creates an object to read media data from an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1385593-initwithasset?language=objc +func NewAssetReaderWithAssetError(asset IAsset, outError foundation.IError) AssetReader { + instance := AssetReaderClass.Alloc().InitWithAssetError(asset, outError) + instance.Autorelease() + return instance +} + +func (ac _AssetReaderClass) AssetReaderWithAssetError(asset IAsset, outError foundation.IError) AssetReader { + rv := objc.Call[AssetReader](ac, objc.Sel("assetReaderWithAsset:error:"), objc.Ptr(asset), objc.Ptr(outError)) + return rv +} + +// Returns a new object to read media data from an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1420148-assetreaderwithasset?language=objc +func AssetReader_AssetReaderWithAssetError(asset IAsset, outError foundation.IError) AssetReader { + return AssetReaderClass.AssetReaderWithAssetError(asset, outError) +} + +func (ac _AssetReaderClass) Alloc() AssetReader { + rv := objc.Call[AssetReader](ac, objc.Sel("alloc")) + return rv +} + +func AssetReader_Alloc() AssetReader { + return AssetReaderClass.Alloc() +} + +func (ac _AssetReaderClass) New() AssetReader { + rv := objc.Call[AssetReader](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReader() AssetReader { + return AssetReaderClass.New() +} + +func (a_ AssetReader) Init() AssetReader { + rv := objc.Call[AssetReader](a_, objc.Sel("init")) + return rv +} + +// Prepares the asset reader to start reading sample buffers from the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1390286-startreading?language=objc +func (a_ AssetReader) StartReading() bool { + rv := objc.Call[bool](a_, objc.Sel("startReading")) + return rv +} + +// Cancels any background work and stops the reader’s outputs from reading more samples. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1390258-cancelreading?language=objc +func (a_ AssetReader) CancelReading() { + objc.Call[objc.Void](a_, objc.Sel("cancelReading")) +} + +// Adds an output to the reader. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1390110-addoutput?language=objc +func (a_ AssetReader) AddOutput(output IAssetReaderOutput) { + objc.Call[objc.Void](a_, objc.Sel("addOutput:"), objc.Ptr(output)) +} + +// Determines whether you can add the output to the asset reader. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1387485-canaddoutput?language=objc +func (a_ AssetReader) CanAddOutput(output IAssetReaderOutput) bool { + rv := objc.Call[bool](a_, objc.Sel("canAddOutput:"), objc.Ptr(output)) + return rv +} + +// An error that describes the reason for a failure. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1388114-error?language=objc +func (a_ AssetReader) Error() foundation.Error { + rv := objc.Call[foundation.Error](a_, objc.Sel("error")) + return rv +} + +// The outputs from which you read media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1387132-outputs?language=objc +func (a_ AssetReader) Outputs() []AssetReaderOutput { + rv := objc.Call[[]AssetReaderOutput](a_, objc.Sel("outputs")) + return rv +} + +// The time range within the asset to read. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1386400-timerange?language=objc +func (a_ AssetReader) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](a_, objc.Sel("timeRange")) + return rv +} + +// The time range within the asset to read. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1386400-timerange?language=objc +func (a_ AssetReader) SetTimeRange(value coremedia.TimeRange) { + objc.Call[objc.Void](a_, objc.Sel("setTimeRange:"), value) +} + +// The status of reading sample buffers from the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1390211-status?language=objc +func (a_ AssetReader) Status() AssetReaderStatus { + rv := objc.Call[AssetReaderStatus](a_, objc.Sel("status")) + return rv +} + +// The asset from which to read media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreader/1389128-asset?language=objc +func (a_ AssetReader) Asset() Asset { + rv := objc.Call[Asset](a_, objc.Sel("asset")) + return rv +} diff --git a/macos/avfoundation/asset_reader_audio_mix_output.gen.go b/macos/avfoundation/asset_reader_audio_mix_output.gen.go new file mode 100644 index 00000000..b221ed8c --- /dev/null +++ b/macos/avfoundation/asset_reader_audio_mix_output.gen.go @@ -0,0 +1,136 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReaderAudioMixOutput] class. +var AssetReaderAudioMixOutputClass = _AssetReaderAudioMixOutputClass{objc.GetClass("AVAssetReaderAudioMixOutput")} + +type _AssetReaderAudioMixOutputClass struct { + objc.Class +} + +// An interface definition for the [AssetReaderAudioMixOutput] class. +type IAssetReaderAudioMixOutput interface { + IAssetReaderOutput + AudioTimePitchAlgorithm() AudioTimePitchAlgorithm + SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) + AudioSettings() map[string]objc.Object + AudioMix() AudioMix + SetAudioMix(value IAudioMix) + AudioTracks() []AssetTrack +} + +// An object that reads audio samples that result from mixing audio from one or more tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput?language=objc +type AssetReaderAudioMixOutput struct { + AssetReaderOutput +} + +func AssetReaderAudioMixOutputFrom(ptr unsafe.Pointer) AssetReaderAudioMixOutput { + return AssetReaderAudioMixOutput{ + AssetReaderOutput: AssetReaderOutputFrom(ptr), + } +} + +func (ac _AssetReaderAudioMixOutputClass) AssetReaderAudioMixOutputWithAudioTracksAudioSettings(audioTracks []IAssetTrack, audioSettings map[string]objc.IObject) AssetReaderAudioMixOutput { + rv := objc.Call[AssetReaderAudioMixOutput](ac, objc.Sel("assetReaderAudioMixOutputWithAudioTracks:audioSettings:"), audioTracks, audioSettings) + return rv +} + +// Creates an object that reads mixed audio from the specified audio tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1490328-assetreaderaudiomixoutputwithaud?language=objc +func AssetReaderAudioMixOutput_AssetReaderAudioMixOutputWithAudioTracksAudioSettings(audioTracks []IAssetTrack, audioSettings map[string]objc.IObject) AssetReaderAudioMixOutput { + return AssetReaderAudioMixOutputClass.AssetReaderAudioMixOutputWithAudioTracksAudioSettings(audioTracks, audioSettings) +} + +func (a_ AssetReaderAudioMixOutput) InitWithAudioTracksAudioSettings(audioTracks []IAssetTrack, audioSettings map[string]objc.IObject) AssetReaderAudioMixOutput { + rv := objc.Call[AssetReaderAudioMixOutput](a_, objc.Sel("initWithAudioTracks:audioSettings:"), audioTracks, audioSettings) + return rv +} + +// Creates an object that reads mixed audio from the specified audio tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1388883-initwithaudiotracks?language=objc +func NewAssetReaderAudioMixOutputWithAudioTracksAudioSettings(audioTracks []IAssetTrack, audioSettings map[string]objc.IObject) AssetReaderAudioMixOutput { + instance := AssetReaderAudioMixOutputClass.Alloc().InitWithAudioTracksAudioSettings(audioTracks, audioSettings) + instance.Autorelease() + return instance +} + +func (ac _AssetReaderAudioMixOutputClass) Alloc() AssetReaderAudioMixOutput { + rv := objc.Call[AssetReaderAudioMixOutput](ac, objc.Sel("alloc")) + return rv +} + +func AssetReaderAudioMixOutput_Alloc() AssetReaderAudioMixOutput { + return AssetReaderAudioMixOutputClass.Alloc() +} + +func (ac _AssetReaderAudioMixOutputClass) New() AssetReaderAudioMixOutput { + rv := objc.Call[AssetReaderAudioMixOutput](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReaderAudioMixOutput() AssetReaderAudioMixOutput { + return AssetReaderAudioMixOutputClass.New() +} + +func (a_ AssetReaderAudioMixOutput) Init() AssetReaderAudioMixOutput { + rv := objc.Call[AssetReaderAudioMixOutput](a_, objc.Sel("init")) + return rv +} + +// The processing algorithm to use for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1388713-audiotimepitchalgorithm?language=objc +func (a_ AssetReaderAudioMixOutput) AudioTimePitchAlgorithm() AudioTimePitchAlgorithm { + rv := objc.Call[AudioTimePitchAlgorithm](a_, objc.Sel("audioTimePitchAlgorithm")) + return rv +} + +// The processing algorithm to use for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1388713-audiotimepitchalgorithm?language=objc +func (a_ AssetReaderAudioMixOutput) SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) { + objc.Call[objc.Void](a_, objc.Sel("setAudioTimePitchAlgorithm:"), value) +} + +// The audio settings that the output uses. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1388860-audiosettings?language=objc +func (a_ AssetReaderAudioMixOutput) AudioSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](a_, objc.Sel("audioSettings")) + return rv +} + +// The audio mix to use with this output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1387074-audiomix?language=objc +func (a_ AssetReaderAudioMixOutput) AudioMix() AudioMix { + rv := objc.Call[AudioMix](a_, objc.Sel("audioMix")) + return rv +} + +// The audio mix to use with this output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1387074-audiomix?language=objc +func (a_ AssetReaderAudioMixOutput) SetAudioMix(value IAudioMix) { + objc.Call[objc.Void](a_, objc.Sel("setAudioMix:"), objc.Ptr(value)) +} + +// The tracks from which the output reads audio. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderaudiomixoutput/1385635-audiotracks?language=objc +func (a_ AssetReaderAudioMixOutput) AudioTracks() []AssetTrack { + rv := objc.Call[[]AssetTrack](a_, objc.Sel("audioTracks")) + return rv +} diff --git a/macos/avfoundation/asset_reader_caption_validation_handling.gen.go b/macos/avfoundation/asset_reader_caption_validation_handling.gen.go new file mode 100644 index 00000000..76bfb7bf --- /dev/null +++ b/macos/avfoundation/asset_reader_caption_validation_handling.gen.go @@ -0,0 +1,32 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods for caption validation events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadercaptionvalidationhandling?language=objc +type PAssetReaderCaptionValidationHandling interface { + // optional + CaptionAdaptorDidVendCaptionSkippingUnsupportedSourceSyntaxElements(adaptor AssetReaderOutputCaptionAdaptor, caption Caption, syntaxElements []string) + HasCaptionAdaptorDidVendCaptionSkippingUnsupportedSourceSyntaxElements() bool +} + +// A concrete type wrapper for the [PAssetReaderCaptionValidationHandling] protocol. +type AssetReaderCaptionValidationHandlingWrapper struct { + objc.Object +} + +func (a_ AssetReaderCaptionValidationHandlingWrapper) HasCaptionAdaptorDidVendCaptionSkippingUnsupportedSourceSyntaxElements() bool { + return a_.RespondsToSelector(objc.Sel("captionAdaptor:didVendCaption:skippingUnsupportedSourceSyntaxElements:")) +} + +// Tells the delegate that the adaptor ignored one or more syntax elements when it created the caption object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadercaptionvalidationhandling/3752792-captionadaptor?language=objc +func (a_ AssetReaderCaptionValidationHandlingWrapper) CaptionAdaptorDidVendCaptionSkippingUnsupportedSourceSyntaxElements(adaptor IAssetReaderOutputCaptionAdaptor, caption ICaption, syntaxElements []string) { + objc.Call[objc.Void](a_, objc.Sel("captionAdaptor:didVendCaption:skippingUnsupportedSourceSyntaxElements:"), objc.Ptr(adaptor), objc.Ptr(caption), syntaxElements) +} diff --git a/macos/avfoundation/asset_reader_output.gen.go b/macos/avfoundation/asset_reader_output.gen.go new file mode 100644 index 00000000..533fd0e4 --- /dev/null +++ b/macos/avfoundation/asset_reader_output.gen.go @@ -0,0 +1,128 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReaderOutput] class. +var AssetReaderOutputClass = _AssetReaderOutputClass{objc.GetClass("AVAssetReaderOutput")} + +type _AssetReaderOutputClass struct { + objc.Class +} + +// An interface definition for the [AssetReaderOutput] class. +type IAssetReaderOutput interface { + objc.IObject + ResetForReadingTimeRanges(timeRanges []foundation.IValue) + CopyNextSampleBuffer() coremedia.SampleBufferRef + MarkConfigurationAsFinal() + MediaType() MediaType + SupportsRandomAccess() bool + SetSupportsRandomAccess(value bool) + AlwaysCopiesSampleData() bool + SetAlwaysCopiesSampleData(value bool) +} + +// An abstract class that defines the interface to read media samples from an asset reader. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput?language=objc +type AssetReaderOutput struct { + objc.Object +} + +func AssetReaderOutputFrom(ptr unsafe.Pointer) AssetReaderOutput { + return AssetReaderOutput{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetReaderOutputClass) Alloc() AssetReaderOutput { + rv := objc.Call[AssetReaderOutput](ac, objc.Sel("alloc")) + return rv +} + +func AssetReaderOutput_Alloc() AssetReaderOutput { + return AssetReaderOutputClass.Alloc() +} + +func (ac _AssetReaderOutputClass) New() AssetReaderOutput { + rv := objc.Call[AssetReaderOutput](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReaderOutput() AssetReaderOutput { + return AssetReaderOutputClass.New() +} + +func (a_ AssetReaderOutput) Init() AssetReaderOutput { + rv := objc.Call[AssetReaderOutput](a_, objc.Sel("init")) + return rv +} + +// Restarts reading with a new set of time ranges. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1388890-resetforreadingtimeranges?language=objc +func (a_ AssetReaderOutput) ResetForReadingTimeRanges(timeRanges []foundation.IValue) { + objc.Call[objc.Void](a_, objc.Sel("resetForReadingTimeRanges:"), timeRanges) +} + +// Copies the next sample buffer from the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1385732-copynextsamplebuffer?language=objc +func (a_ AssetReaderOutput) CopyNextSampleBuffer() coremedia.SampleBufferRef { + rv := objc.Call[coremedia.SampleBufferRef](a_, objc.Sel("copyNextSampleBuffer")) + return rv +} + +// Tells the output that it’s finished reconfiguring time ranges, and allows the asset reader to advance to a completed state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1386974-markconfigurationasfinal?language=objc +func (a_ AssetReaderOutput) MarkConfigurationAsFinal() { + objc.Call[objc.Void](a_, objc.Sel("markConfigurationAsFinal")) +} + +// The media type of samples that the output reads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1390880-mediatype?language=objc +func (a_ AssetReaderOutput) MediaType() MediaType { + rv := objc.Call[MediaType](a_, objc.Sel("mediaType")) + return rv +} + +// A Boolean value that indicates whether the output supports reconfiguring the time ranges it reads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1387927-supportsrandomaccess?language=objc +func (a_ AssetReaderOutput) SupportsRandomAccess() bool { + rv := objc.Call[bool](a_, objc.Sel("supportsRandomAccess")) + return rv +} + +// A Boolean value that indicates whether the output supports reconfiguring the time ranges it reads. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1387927-supportsrandomaccess?language=objc +func (a_ AssetReaderOutput) SetSupportsRandomAccess(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setSupportsRandomAccess:"), value) +} + +// A Boolean value that indicates whether the output vends copied sample data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1389189-alwayscopiessampledata?language=objc +func (a_ AssetReaderOutput) AlwaysCopiesSampleData() bool { + rv := objc.Call[bool](a_, objc.Sel("alwaysCopiesSampleData")) + return rv +} + +// A Boolean value that indicates whether the output vends copied sample data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutput/1389189-alwayscopiessampledata?language=objc +func (a_ AssetReaderOutput) SetAlwaysCopiesSampleData(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setAlwaysCopiesSampleData:"), value) +} diff --git a/macos/avfoundation/asset_reader_output_caption_adaptor.gen.go b/macos/avfoundation/asset_reader_output_caption_adaptor.gen.go new file mode 100644 index 00000000..fa84207e --- /dev/null +++ b/macos/avfoundation/asset_reader_output_caption_adaptor.gen.go @@ -0,0 +1,138 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReaderOutputCaptionAdaptor] class. +var AssetReaderOutputCaptionAdaptorClass = _AssetReaderOutputCaptionAdaptorClass{objc.GetClass("AVAssetReaderOutputCaptionAdaptor")} + +type _AssetReaderOutputCaptionAdaptorClass struct { + objc.Class +} + +// An interface definition for the [AssetReaderOutputCaptionAdaptor] class. +type IAssetReaderOutputCaptionAdaptor interface { + objc.IObject + CaptionsNotPresentInPreviousGroupsInCaptionGroup(captionGroup ICaptionGroup) []Caption + NextCaptionGroup() CaptionGroup + AssetReaderTrackOutput() AssetReaderTrackOutput + ValidationDelegate() AssetReaderCaptionValidationHandlingWrapper + SetValidationDelegate(value PAssetReaderCaptionValidationHandling) + SetValidationDelegateObject(valueObject objc.IObject) +} + +// An object that reads caption group objects from an asset track that contains timed text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor?language=objc +type AssetReaderOutputCaptionAdaptor struct { + objc.Object +} + +func AssetReaderOutputCaptionAdaptorFrom(ptr unsafe.Pointer) AssetReaderOutputCaptionAdaptor { + return AssetReaderOutputCaptionAdaptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (a_ AssetReaderOutputCaptionAdaptor) InitWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputCaptionAdaptor { + rv := objc.Call[AssetReaderOutputCaptionAdaptor](a_, objc.Sel("initWithAssetReaderTrackOutput:"), objc.Ptr(trackOutput)) + return rv +} + +// Creates a caption adaptor that reads from a track output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752797-initwithassetreadertrackoutput?language=objc +func NewAssetReaderOutputCaptionAdaptorWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputCaptionAdaptor { + instance := AssetReaderOutputCaptionAdaptorClass.Alloc().InitWithAssetReaderTrackOutput(trackOutput) + instance.Autorelease() + return instance +} + +func (ac _AssetReaderOutputCaptionAdaptorClass) AssetReaderOutputCaptionAdaptorWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputCaptionAdaptor { + rv := objc.Call[AssetReaderOutputCaptionAdaptor](ac, objc.Sel("assetReaderOutputCaptionAdaptorWithAssetReaderTrackOutput:"), objc.Ptr(trackOutput)) + return rv +} + +// A class method that creates a caption adaptor that reads from a track output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752794-assetreaderoutputcaptionadaptorw?language=objc +func AssetReaderOutputCaptionAdaptor_AssetReaderOutputCaptionAdaptorWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputCaptionAdaptor { + return AssetReaderOutputCaptionAdaptorClass.AssetReaderOutputCaptionAdaptorWithAssetReaderTrackOutput(trackOutput) +} + +func (ac _AssetReaderOutputCaptionAdaptorClass) Alloc() AssetReaderOutputCaptionAdaptor { + rv := objc.Call[AssetReaderOutputCaptionAdaptor](ac, objc.Sel("alloc")) + return rv +} + +func AssetReaderOutputCaptionAdaptor_Alloc() AssetReaderOutputCaptionAdaptor { + return AssetReaderOutputCaptionAdaptorClass.Alloc() +} + +func (ac _AssetReaderOutputCaptionAdaptorClass) New() AssetReaderOutputCaptionAdaptor { + rv := objc.Call[AssetReaderOutputCaptionAdaptor](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReaderOutputCaptionAdaptor() AssetReaderOutputCaptionAdaptor { + return AssetReaderOutputCaptionAdaptorClass.New() +} + +func (a_ AssetReaderOutputCaptionAdaptor) Init() AssetReaderOutputCaptionAdaptor { + rv := objc.Call[AssetReaderOutputCaptionAdaptor](a_, objc.Sel("init")) + return rv +} + +// Returns the set of captions in the caption group that weren’t vended by the adaptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752796-captionsnotpresentinpreviousgrou?language=objc +func (a_ AssetReaderOutputCaptionAdaptor) CaptionsNotPresentInPreviousGroupsInCaptionGroup(captionGroup ICaptionGroup) []Caption { + rv := objc.Call[[]Caption](a_, objc.Sel("captionsNotPresentInPreviousGroupsInCaptionGroup:"), objc.Ptr(captionGroup)) + return rv +} + +// Returns the next caption group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752798-nextcaptiongroup?language=objc +func (a_ AssetReaderOutputCaptionAdaptor) NextCaptionGroup() CaptionGroup { + rv := objc.Call[CaptionGroup](a_, objc.Sel("nextCaptionGroup")) + return rv +} + +// The associated asset reader track output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752795-assetreadertrackoutput?language=objc +func (a_ AssetReaderOutputCaptionAdaptor) AssetReaderTrackOutput() AssetReaderTrackOutput { + rv := objc.Call[AssetReaderTrackOutput](a_, objc.Sel("assetReaderTrackOutput")) + return rv +} + +// A delegate object that handles callbacks to the caption adaptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752799-validationdelegate?language=objc +func (a_ AssetReaderOutputCaptionAdaptor) ValidationDelegate() AssetReaderCaptionValidationHandlingWrapper { + rv := objc.Call[AssetReaderCaptionValidationHandlingWrapper](a_, objc.Sel("validationDelegate")) + return rv +} + +// A delegate object that handles callbacks to the caption adaptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752799-validationdelegate?language=objc +func (a_ AssetReaderOutputCaptionAdaptor) SetValidationDelegate(value PAssetReaderCaptionValidationHandling) { + po0 := objc.WrapAsProtocol("AVAssetReaderCaptionValidationHandling", value) + objc.SetAssociatedObject(a_, objc.AssociationKey("setValidationDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](a_, objc.Sel("setValidationDelegate:"), po0) +} + +// A delegate object that handles callbacks to the caption adaptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputcaptionadaptor/3752799-validationdelegate?language=objc +func (a_ AssetReaderOutputCaptionAdaptor) SetValidationDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](a_, objc.Sel("setValidationDelegate:"), objc.Ptr(valueObject)) +} diff --git a/macos/avfoundation/asset_reader_output_metadata_adaptor.gen.go b/macos/avfoundation/asset_reader_output_metadata_adaptor.gen.go new file mode 100644 index 00000000..bc522dd2 --- /dev/null +++ b/macos/avfoundation/asset_reader_output_metadata_adaptor.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReaderOutputMetadataAdaptor] class. +var AssetReaderOutputMetadataAdaptorClass = _AssetReaderOutputMetadataAdaptorClass{objc.GetClass("AVAssetReaderOutputMetadataAdaptor")} + +type _AssetReaderOutputMetadataAdaptorClass struct { + objc.Class +} + +// An interface definition for the [AssetReaderOutputMetadataAdaptor] class. +type IAssetReaderOutputMetadataAdaptor interface { + objc.IObject + NextTimedMetadataGroup() TimedMetadataGroup + AssetReaderTrackOutput() AssetReaderTrackOutput +} + +// An object that creates timed metadata group objects for an asset track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputmetadataadaptor?language=objc +type AssetReaderOutputMetadataAdaptor struct { + objc.Object +} + +func AssetReaderOutputMetadataAdaptorFrom(ptr unsafe.Pointer) AssetReaderOutputMetadataAdaptor { + return AssetReaderOutputMetadataAdaptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (a_ AssetReaderOutputMetadataAdaptor) InitWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputMetadataAdaptor { + rv := objc.Call[AssetReaderOutputMetadataAdaptor](a_, objc.Sel("initWithAssetReaderTrackOutput:"), objc.Ptr(trackOutput)) + return rv +} + +// Creates an object that reads timed metadata groups from an asset reader output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputmetadataadaptor/1388009-initwithassetreadertrackoutput?language=objc +func NewAssetReaderOutputMetadataAdaptorWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputMetadataAdaptor { + instance := AssetReaderOutputMetadataAdaptorClass.Alloc().InitWithAssetReaderTrackOutput(trackOutput) + instance.Autorelease() + return instance +} + +func (ac _AssetReaderOutputMetadataAdaptorClass) AssetReaderOutputMetadataAdaptorWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputMetadataAdaptor { + rv := objc.Call[AssetReaderOutputMetadataAdaptor](ac, objc.Sel("assetReaderOutputMetadataAdaptorWithAssetReaderTrackOutput:"), objc.Ptr(trackOutput)) + return rv +} + +// Returns a new object that reads timed metadata groups from an asset reader output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputmetadataadaptor/1490330-assetreaderoutputmetadataadaptor?language=objc +func AssetReaderOutputMetadataAdaptor_AssetReaderOutputMetadataAdaptorWithAssetReaderTrackOutput(trackOutput IAssetReaderTrackOutput) AssetReaderOutputMetadataAdaptor { + return AssetReaderOutputMetadataAdaptorClass.AssetReaderOutputMetadataAdaptorWithAssetReaderTrackOutput(trackOutput) +} + +func (ac _AssetReaderOutputMetadataAdaptorClass) Alloc() AssetReaderOutputMetadataAdaptor { + rv := objc.Call[AssetReaderOutputMetadataAdaptor](ac, objc.Sel("alloc")) + return rv +} + +func AssetReaderOutputMetadataAdaptor_Alloc() AssetReaderOutputMetadataAdaptor { + return AssetReaderOutputMetadataAdaptorClass.Alloc() +} + +func (ac _AssetReaderOutputMetadataAdaptorClass) New() AssetReaderOutputMetadataAdaptor { + rv := objc.Call[AssetReaderOutputMetadataAdaptor](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReaderOutputMetadataAdaptor() AssetReaderOutputMetadataAdaptor { + return AssetReaderOutputMetadataAdaptorClass.New() +} + +func (a_ AssetReaderOutputMetadataAdaptor) Init() AssetReaderOutputMetadataAdaptor { + rv := objc.Call[AssetReaderOutputMetadataAdaptor](a_, objc.Sel("init")) + return rv +} + +// Returns the next timed metadata group for the asset reader output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputmetadataadaptor/1390008-nexttimedmetadatagroup?language=objc +func (a_ AssetReaderOutputMetadataAdaptor) NextTimedMetadataGroup() TimedMetadataGroup { + rv := objc.Call[TimedMetadataGroup](a_, objc.Sel("nextTimedMetadataGroup")) + return rv +} + +// The asset reader track output that provides the timed metadata groups. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderoutputmetadataadaptor/1388330-assetreadertrackoutput?language=objc +func (a_ AssetReaderOutputMetadataAdaptor) AssetReaderTrackOutput() AssetReaderTrackOutput { + rv := objc.Call[AssetReaderTrackOutput](a_, objc.Sel("assetReaderTrackOutput")) + return rv +} diff --git a/macos/avfoundation/asset_reader_sample_reference_output.gen.go b/macos/avfoundation/asset_reader_sample_reference_output.gen.go new file mode 100644 index 00000000..f6b76381 --- /dev/null +++ b/macos/avfoundation/asset_reader_sample_reference_output.gen.go @@ -0,0 +1,93 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReaderSampleReferenceOutput] class. +var AssetReaderSampleReferenceOutputClass = _AssetReaderSampleReferenceOutputClass{objc.GetClass("AVAssetReaderSampleReferenceOutput")} + +type _AssetReaderSampleReferenceOutputClass struct { + objc.Class +} + +// An interface definition for the [AssetReaderSampleReferenceOutput] class. +type IAssetReaderSampleReferenceOutput interface { + IAssetReaderOutput + Track() AssetTrack +} + +// An object that reads sample references from an asset track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadersamplereferenceoutput?language=objc +type AssetReaderSampleReferenceOutput struct { + AssetReaderOutput +} + +func AssetReaderSampleReferenceOutputFrom(ptr unsafe.Pointer) AssetReaderSampleReferenceOutput { + return AssetReaderSampleReferenceOutput{ + AssetReaderOutput: AssetReaderOutputFrom(ptr), + } +} + +func (ac _AssetReaderSampleReferenceOutputClass) AssetReaderSampleReferenceOutputWithTrack(track IAssetTrack) AssetReaderSampleReferenceOutput { + rv := objc.Call[AssetReaderSampleReferenceOutput](ac, objc.Sel("assetReaderSampleReferenceOutputWithTrack:"), objc.Ptr(track)) + return rv +} + +// Returns a new object that supplies sample references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadersamplereferenceoutput/1490320-assetreadersamplereferenceoutput?language=objc +func AssetReaderSampleReferenceOutput_AssetReaderSampleReferenceOutputWithTrack(track IAssetTrack) AssetReaderSampleReferenceOutput { + return AssetReaderSampleReferenceOutputClass.AssetReaderSampleReferenceOutputWithTrack(track) +} + +func (a_ AssetReaderSampleReferenceOutput) InitWithTrack(track IAssetTrack) AssetReaderSampleReferenceOutput { + rv := objc.Call[AssetReaderSampleReferenceOutput](a_, objc.Sel("initWithTrack:"), objc.Ptr(track)) + return rv +} + +// Creates an object that supplies sample references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadersamplereferenceoutput/1387339-initwithtrack?language=objc +func NewAssetReaderSampleReferenceOutputWithTrack(track IAssetTrack) AssetReaderSampleReferenceOutput { + instance := AssetReaderSampleReferenceOutputClass.Alloc().InitWithTrack(track) + instance.Autorelease() + return instance +} + +func (ac _AssetReaderSampleReferenceOutputClass) Alloc() AssetReaderSampleReferenceOutput { + rv := objc.Call[AssetReaderSampleReferenceOutput](ac, objc.Sel("alloc")) + return rv +} + +func AssetReaderSampleReferenceOutput_Alloc() AssetReaderSampleReferenceOutput { + return AssetReaderSampleReferenceOutputClass.Alloc() +} + +func (ac _AssetReaderSampleReferenceOutputClass) New() AssetReaderSampleReferenceOutput { + rv := objc.Call[AssetReaderSampleReferenceOutput](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReaderSampleReferenceOutput() AssetReaderSampleReferenceOutput { + return AssetReaderSampleReferenceOutputClass.New() +} + +func (a_ AssetReaderSampleReferenceOutput) Init() AssetReaderSampleReferenceOutput { + rv := objc.Call[AssetReaderSampleReferenceOutput](a_, objc.Sel("init")) + return rv +} + +// The track from which the output reads sample references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadersamplereferenceoutput/1390057-track?language=objc +func (a_ AssetReaderSampleReferenceOutput) Track() AssetTrack { + rv := objc.Call[AssetTrack](a_, objc.Sel("track")) + return rv +} diff --git a/macos/avfoundation/asset_reader_track_output.gen.go b/macos/avfoundation/asset_reader_track_output.gen.go new file mode 100644 index 00000000..79745970 --- /dev/null +++ b/macos/avfoundation/asset_reader_track_output.gen.go @@ -0,0 +1,119 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReaderTrackOutput] class. +var AssetReaderTrackOutputClass = _AssetReaderTrackOutputClass{objc.GetClass("AVAssetReaderTrackOutput")} + +type _AssetReaderTrackOutputClass struct { + objc.Class +} + +// An interface definition for the [AssetReaderTrackOutput] class. +type IAssetReaderTrackOutput interface { + IAssetReaderOutput + AudioTimePitchAlgorithm() AudioTimePitchAlgorithm + SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) + OutputSettings() map[string]objc.Object + Track() AssetTrack +} + +// An object that reads media data from a single track of an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadertrackoutput?language=objc +type AssetReaderTrackOutput struct { + AssetReaderOutput +} + +func AssetReaderTrackOutputFrom(ptr unsafe.Pointer) AssetReaderTrackOutput { + return AssetReaderTrackOutput{ + AssetReaderOutput: AssetReaderOutputFrom(ptr), + } +} + +func (ac _AssetReaderTrackOutputClass) AssetReaderTrackOutputWithTrackOutputSettings(track IAssetTrack, outputSettings map[string]objc.IObject) AssetReaderTrackOutput { + rv := objc.Call[AssetReaderTrackOutput](ac, objc.Sel("assetReaderTrackOutputWithTrack:outputSettings:"), objc.Ptr(track), outputSettings) + return rv +} + +// Returns a new object that reads media data from an asset track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadertrackoutput/1490322-assetreadertrackoutputwithtrack?language=objc +func AssetReaderTrackOutput_AssetReaderTrackOutputWithTrackOutputSettings(track IAssetTrack, outputSettings map[string]objc.IObject) AssetReaderTrackOutput { + return AssetReaderTrackOutputClass.AssetReaderTrackOutputWithTrackOutputSettings(track, outputSettings) +} + +func (a_ AssetReaderTrackOutput) InitWithTrackOutputSettings(track IAssetTrack, outputSettings map[string]objc.IObject) AssetReaderTrackOutput { + rv := objc.Call[AssetReaderTrackOutput](a_, objc.Sel("initWithTrack:outputSettings:"), objc.Ptr(track), outputSettings) + return rv +} + +// Creates an object that reads media data from an asset track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadertrackoutput/1385807-initwithtrack?language=objc +func NewAssetReaderTrackOutputWithTrackOutputSettings(track IAssetTrack, outputSettings map[string]objc.IObject) AssetReaderTrackOutput { + instance := AssetReaderTrackOutputClass.Alloc().InitWithTrackOutputSettings(track, outputSettings) + instance.Autorelease() + return instance +} + +func (ac _AssetReaderTrackOutputClass) Alloc() AssetReaderTrackOutput { + rv := objc.Call[AssetReaderTrackOutput](ac, objc.Sel("alloc")) + return rv +} + +func AssetReaderTrackOutput_Alloc() AssetReaderTrackOutput { + return AssetReaderTrackOutputClass.Alloc() +} + +func (ac _AssetReaderTrackOutputClass) New() AssetReaderTrackOutput { + rv := objc.Call[AssetReaderTrackOutput](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReaderTrackOutput() AssetReaderTrackOutput { + return AssetReaderTrackOutputClass.New() +} + +func (a_ AssetReaderTrackOutput) Init() AssetReaderTrackOutput { + rv := objc.Call[AssetReaderTrackOutput](a_, objc.Sel("init")) + return rv +} + +// The processing algorithm to use for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadertrackoutput/1387851-audiotimepitchalgorithm?language=objc +func (a_ AssetReaderTrackOutput) AudioTimePitchAlgorithm() AudioTimePitchAlgorithm { + rv := objc.Call[AudioTimePitchAlgorithm](a_, objc.Sel("audioTimePitchAlgorithm")) + return rv +} + +// The processing algorithm to use for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadertrackoutput/1387851-audiotimepitchalgorithm?language=objc +func (a_ AssetReaderTrackOutput) SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) { + objc.Call[objc.Void](a_, objc.Sel("setAudioTimePitchAlgorithm:"), value) +} + +// The output settings for this track output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadertrackoutput/1387163-outputsettings?language=objc +func (a_ AssetReaderTrackOutput) OutputSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](a_, objc.Sel("outputSettings")) + return rv +} + +// The track from which the output reads sample buffers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadertrackoutput/1386921-track?language=objc +func (a_ AssetReaderTrackOutput) Track() AssetTrack { + rv := objc.Call[AssetTrack](a_, objc.Sel("track")) + return rv +} diff --git a/macos/avfoundation/asset_reader_video_composition_output.gen.go b/macos/avfoundation/asset_reader_video_composition_output.gen.go new file mode 100644 index 00000000..daf9ae17 --- /dev/null +++ b/macos/avfoundation/asset_reader_video_composition_output.gen.go @@ -0,0 +1,128 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetReaderVideoCompositionOutput] class. +var AssetReaderVideoCompositionOutputClass = _AssetReaderVideoCompositionOutputClass{objc.GetClass("AVAssetReaderVideoCompositionOutput")} + +type _AssetReaderVideoCompositionOutputClass struct { + objc.Class +} + +// An interface definition for the [AssetReaderVideoCompositionOutput] class. +type IAssetReaderVideoCompositionOutput interface { + IAssetReaderOutput + VideoComposition() VideoComposition + SetVideoComposition(value IVideoComposition) + VideoSettings() map[string]objc.Object + CustomVideoCompositor() VideoCompositingWrapper + VideoTracks() []AssetTrack +} + +// An object that reads composited video frames from one or more tracks of an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput?language=objc +type AssetReaderVideoCompositionOutput struct { + AssetReaderOutput +} + +func AssetReaderVideoCompositionOutputFrom(ptr unsafe.Pointer) AssetReaderVideoCompositionOutput { + return AssetReaderVideoCompositionOutput{ + AssetReaderOutput: AssetReaderOutputFrom(ptr), + } +} + +func (a_ AssetReaderVideoCompositionOutput) InitWithVideoTracksVideoSettings(videoTracks []IAssetTrack, videoSettings map[string]objc.IObject) AssetReaderVideoCompositionOutput { + rv := objc.Call[AssetReaderVideoCompositionOutput](a_, objc.Sel("initWithVideoTracks:videoSettings:"), videoTracks, videoSettings) + return rv +} + +// Creates an object that reads composited video frames from the specified video tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput/1386676-initwithvideotracks?language=objc +func NewAssetReaderVideoCompositionOutputWithVideoTracksVideoSettings(videoTracks []IAssetTrack, videoSettings map[string]objc.IObject) AssetReaderVideoCompositionOutput { + instance := AssetReaderVideoCompositionOutputClass.Alloc().InitWithVideoTracksVideoSettings(videoTracks, videoSettings) + instance.Autorelease() + return instance +} + +func (ac _AssetReaderVideoCompositionOutputClass) AssetReaderVideoCompositionOutputWithVideoTracksVideoSettings(videoTracks []IAssetTrack, videoSettings map[string]objc.IObject) AssetReaderVideoCompositionOutput { + rv := objc.Call[AssetReaderVideoCompositionOutput](ac, objc.Sel("assetReaderVideoCompositionOutputWithVideoTracks:videoSettings:"), videoTracks, videoSettings) + return rv +} + +// Returns a new object that reads composited video from the specified video tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput/1490331-assetreadervideocompositionoutpu?language=objc +func AssetReaderVideoCompositionOutput_AssetReaderVideoCompositionOutputWithVideoTracksVideoSettings(videoTracks []IAssetTrack, videoSettings map[string]objc.IObject) AssetReaderVideoCompositionOutput { + return AssetReaderVideoCompositionOutputClass.AssetReaderVideoCompositionOutputWithVideoTracksVideoSettings(videoTracks, videoSettings) +} + +func (ac _AssetReaderVideoCompositionOutputClass) Alloc() AssetReaderVideoCompositionOutput { + rv := objc.Call[AssetReaderVideoCompositionOutput](ac, objc.Sel("alloc")) + return rv +} + +func AssetReaderVideoCompositionOutput_Alloc() AssetReaderVideoCompositionOutput { + return AssetReaderVideoCompositionOutputClass.Alloc() +} + +func (ac _AssetReaderVideoCompositionOutputClass) New() AssetReaderVideoCompositionOutput { + rv := objc.Call[AssetReaderVideoCompositionOutput](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetReaderVideoCompositionOutput() AssetReaderVideoCompositionOutput { + return AssetReaderVideoCompositionOutputClass.New() +} + +func (a_ AssetReaderVideoCompositionOutput) Init() AssetReaderVideoCompositionOutput { + rv := objc.Call[AssetReaderVideoCompositionOutput](a_, objc.Sel("init")) + return rv +} + +// The video composition to use for the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput/1388927-videocomposition?language=objc +func (a_ AssetReaderVideoCompositionOutput) VideoComposition() VideoComposition { + rv := objc.Call[VideoComposition](a_, objc.Sel("videoComposition")) + return rv +} + +// The video composition to use for the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput/1388927-videocomposition?language=objc +func (a_ AssetReaderVideoCompositionOutput) SetVideoComposition(value IVideoComposition) { + objc.Call[objc.Void](a_, objc.Sel("setVideoComposition:"), objc.Ptr(value)) +} + +// The video settings that the output uses. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput/1389247-videosettings?language=objc +func (a_ AssetReaderVideoCompositionOutput) VideoSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](a_, objc.Sel("videoSettings")) + return rv +} + +// A custom video compositor for the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput/1388310-customvideocompositor?language=objc +func (a_ AssetReaderVideoCompositionOutput) CustomVideoCompositor() VideoCompositingWrapper { + rv := objc.Call[VideoCompositingWrapper](a_, objc.Sel("customVideoCompositor")) + return rv +} + +// The tracks from which the output reads the composited video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreadervideocompositionoutput/1389000-videotracks?language=objc +func (a_ AssetReaderVideoCompositionOutput) VideoTracks() []AssetTrack { + rv := objc.Call[[]AssetTrack](a_, objc.Sel("videoTracks")) + return rv +} diff --git a/macos/avfoundation/asset_resource_loader.gen.go b/macos/avfoundation/asset_resource_loader.gen.go new file mode 100644 index 00000000..435d1519 --- /dev/null +++ b/macos/avfoundation/asset_resource_loader.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetResourceLoader] class. +var AssetResourceLoaderClass = _AssetResourceLoaderClass{objc.GetClass("AVAssetResourceLoader")} + +type _AssetResourceLoaderClass struct { + objc.Class +} + +// An interface definition for the [AssetResourceLoader] class. +type IAssetResourceLoader interface { + objc.IObject + SetDelegateQueue(delegate PAssetResourceLoaderDelegate, delegateQueue dispatch.Queue) + SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) + PreloadsEligibleContentKeys() bool + SetPreloadsEligibleContentKeys(value bool) + Delegate() AssetResourceLoaderDelegateWrapper + DelegateQueue() dispatch.Queue +} + +// An object that mediates resource requests from a URL asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloader?language=objc +type AssetResourceLoader struct { + objc.Object +} + +func AssetResourceLoaderFrom(ptr unsafe.Pointer) AssetResourceLoader { + return AssetResourceLoader{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetResourceLoaderClass) Alloc() AssetResourceLoader { + rv := objc.Call[AssetResourceLoader](ac, objc.Sel("alloc")) + return rv +} + +func AssetResourceLoader_Alloc() AssetResourceLoader { + return AssetResourceLoaderClass.Alloc() +} + +func (ac _AssetResourceLoaderClass) New() AssetResourceLoader { + rv := objc.Call[AssetResourceLoader](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetResourceLoader() AssetResourceLoader { + return AssetResourceLoaderClass.New() +} + +func (a_ AssetResourceLoader) Init() AssetResourceLoader { + rv := objc.Call[AssetResourceLoader](a_, objc.Sel("init")) + return rv +} + +// Sets the delegate and dispatch queue to use with the resource loader. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloader/1388314-setdelegate?language=objc +func (a_ AssetResourceLoader) SetDelegateQueue(delegate PAssetResourceLoaderDelegate, delegateQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVAssetResourceLoaderDelegate", delegate) + objc.Call[objc.Void](a_, objc.Sel("setDelegate:queue:"), po0, delegateQueue) +} + +// Sets the delegate and dispatch queue to use with the resource loader. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloader/1388314-setdelegate?language=objc +func (a_ AssetResourceLoader) SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) { + objc.Call[objc.Void](a_, objc.Sel("setDelegate:queue:"), objc.Ptr(delegateObject), delegateQueue) +} + +// A Boolean value that indicates whether content keys will be loaded as quickly as possible. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloader/1386939-preloadseligiblecontentkeys?language=objc +func (a_ AssetResourceLoader) PreloadsEligibleContentKeys() bool { + rv := objc.Call[bool](a_, objc.Sel("preloadsEligibleContentKeys")) + return rv +} + +// A Boolean value that indicates whether content keys will be loaded as quickly as possible. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloader/1386939-preloadseligiblecontentkeys?language=objc +func (a_ AssetResourceLoader) SetPreloadsEligibleContentKeys(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setPreloadsEligibleContentKeys:"), value) +} + +// The delegate object to use when handling resource requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloader/1387913-delegate?language=objc +func (a_ AssetResourceLoader) Delegate() AssetResourceLoaderDelegateWrapper { + rv := objc.Call[AssetResourceLoaderDelegateWrapper](a_, objc.Sel("delegate")) + return rv +} + +// The dispatch queue to use when handling resource requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloader/1387678-delegatequeue?language=objc +func (a_ AssetResourceLoader) DelegateQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](a_, objc.Sel("delegateQueue")) + return rv +} diff --git a/macos/avfoundation/asset_resource_loader_delegate.gen.go b/macos/avfoundation/asset_resource_loader_delegate.gen.go new file mode 100644 index 00000000..f3d2bbce --- /dev/null +++ b/macos/avfoundation/asset_resource_loader_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Methods you can implement to handle resource-loading requests coming from a URL asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloaderdelegate?language=objc +type PAssetResourceLoaderDelegate interface { + // optional + ResourceLoaderDidCancelAuthenticationChallenge(resourceLoader AssetResourceLoader, authenticationChallenge foundation.URLAuthenticationChallenge) + HasResourceLoaderDidCancelAuthenticationChallenge() bool +} + +// A delegate implementation builder for the [PAssetResourceLoaderDelegate] protocol. +type AssetResourceLoaderDelegate struct { + _ResourceLoaderDidCancelAuthenticationChallenge func(resourceLoader AssetResourceLoader, authenticationChallenge foundation.URLAuthenticationChallenge) +} + +func (di *AssetResourceLoaderDelegate) HasResourceLoaderDidCancelAuthenticationChallenge() bool { + return di._ResourceLoaderDidCancelAuthenticationChallenge != nil +} + +// Informs the delegate that a prior authentication challenge has been cancelled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloaderdelegate/1387929-resourceloader?language=objc +func (di *AssetResourceLoaderDelegate) SetResourceLoaderDidCancelAuthenticationChallenge(f func(resourceLoader AssetResourceLoader, authenticationChallenge foundation.URLAuthenticationChallenge)) { + di._ResourceLoaderDidCancelAuthenticationChallenge = f +} + +// Informs the delegate that a prior authentication challenge has been cancelled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloaderdelegate/1387929-resourceloader?language=objc +func (di *AssetResourceLoaderDelegate) ResourceLoaderDidCancelAuthenticationChallenge(resourceLoader AssetResourceLoader, authenticationChallenge foundation.URLAuthenticationChallenge) { + di._ResourceLoaderDidCancelAuthenticationChallenge(resourceLoader, authenticationChallenge) +} + +// A concrete type wrapper for the [PAssetResourceLoaderDelegate] protocol. +type AssetResourceLoaderDelegateWrapper struct { + objc.Object +} + +func (a_ AssetResourceLoaderDelegateWrapper) HasResourceLoaderDidCancelAuthenticationChallenge() bool { + return a_.RespondsToSelector(objc.Sel("resourceLoader:didCancelAuthenticationChallenge:")) +} + +// Informs the delegate that a prior authentication challenge has been cancelled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloaderdelegate/1387929-resourceloader?language=objc +func (a_ AssetResourceLoaderDelegateWrapper) ResourceLoaderDidCancelAuthenticationChallenge(resourceLoader IAssetResourceLoader, authenticationChallenge foundation.IURLAuthenticationChallenge) { + objc.Call[objc.Void](a_, objc.Sel("resourceLoader:didCancelAuthenticationChallenge:"), objc.Ptr(resourceLoader), objc.Ptr(authenticationChallenge)) +} diff --git a/macos/avfoundation/asset_resource_loading_content_information_request.gen.go b/macos/avfoundation/asset_resource_loading_content_information_request.gen.go new file mode 100644 index 00000000..844c97a1 --- /dev/null +++ b/macos/avfoundation/asset_resource_loading_content_information_request.gen.go @@ -0,0 +1,136 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetResourceLoadingContentInformationRequest] class. +var AssetResourceLoadingContentInformationRequestClass = _AssetResourceLoadingContentInformationRequestClass{objc.GetClass("AVAssetResourceLoadingContentInformationRequest")} + +type _AssetResourceLoadingContentInformationRequestClass struct { + objc.Class +} + +// An interface definition for the [AssetResourceLoadingContentInformationRequest] class. +type IAssetResourceLoadingContentInformationRequest interface { + objc.IObject + RenewalDate() foundation.Date + SetRenewalDate(value foundation.IDate) + ContentLength() int64 + SetContentLength(value int64) + IsByteRangeAccessSupported() bool + SetByteRangeAccessSupported(value bool) + ContentType() string + SetContentType(value string) + AllowedContentTypes() []string +} + +// A query for retrieving essential information about a resource that an asset resource-loading request references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest?language=objc +type AssetResourceLoadingContentInformationRequest struct { + objc.Object +} + +func AssetResourceLoadingContentInformationRequestFrom(ptr unsafe.Pointer) AssetResourceLoadingContentInformationRequest { + return AssetResourceLoadingContentInformationRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetResourceLoadingContentInformationRequestClass) Alloc() AssetResourceLoadingContentInformationRequest { + rv := objc.Call[AssetResourceLoadingContentInformationRequest](ac, objc.Sel("alloc")) + return rv +} + +func AssetResourceLoadingContentInformationRequest_Alloc() AssetResourceLoadingContentInformationRequest { + return AssetResourceLoadingContentInformationRequestClass.Alloc() +} + +func (ac _AssetResourceLoadingContentInformationRequestClass) New() AssetResourceLoadingContentInformationRequest { + rv := objc.Call[AssetResourceLoadingContentInformationRequest](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetResourceLoadingContentInformationRequest() AssetResourceLoadingContentInformationRequest { + return AssetResourceLoadingContentInformationRequestClass.New() +} + +func (a_ AssetResourceLoadingContentInformationRequest) Init() AssetResourceLoadingContentInformationRequest { + rv := objc.Call[AssetResourceLoadingContentInformationRequest](a_, objc.Sel("init")) + return rv +} + +// The date at which a new resource loading request will be issued for resources that expire, if the media system still requires it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1390683-renewaldate?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) RenewalDate() foundation.Date { + rv := objc.Call[foundation.Date](a_, objc.Sel("renewalDate")) + return rv +} + +// The date at which a new resource loading request will be issued for resources that expire, if the media system still requires it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1390683-renewaldate?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) SetRenewalDate(value foundation.IDate) { + objc.Call[objc.Void](a_, objc.Sel("setRenewalDate:"), objc.Ptr(value)) +} + +// The length, in bytes, of the requested resource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1389390-contentlength?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) ContentLength() int64 { + rv := objc.Call[int64](a_, objc.Sel("contentLength")) + return rv +} + +// The length, in bytes, of the requested resource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1389390-contentlength?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) SetContentLength(value int64) { + objc.Call[objc.Void](a_, objc.Sel("setContentLength:"), value) +} + +// A Boolean value that indicates whether random access to arbitrary ranges of bytes of the resource is supported. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1386054-byterangeaccesssupported?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) IsByteRangeAccessSupported() bool { + rv := objc.Call[bool](a_, objc.Sel("isByteRangeAccessSupported")) + return rv +} + +// A Boolean value that indicates whether random access to arbitrary ranges of bytes of the resource is supported. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1386054-byterangeaccesssupported?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) SetByteRangeAccessSupported(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setByteRangeAccessSupported:"), value) +} + +// The UTI that specifies the type of data contained by the requested resource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1388529-contenttype?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) ContentType() string { + rv := objc.Call[string](a_, objc.Sel("contentType")) + return rv +} + +// The UTI that specifies the type of data contained by the requested resource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/1388529-contenttype?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) SetContentType(value string) { + objc.Call[objc.Void](a_, objc.Sel("setContentType:"), value) +} + +// The types of data that are accepted as a valid response for the requested resource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingcontentinformationrequest/2936886-allowedcontenttypes?language=objc +func (a_ AssetResourceLoadingContentInformationRequest) AllowedContentTypes() []string { + rv := objc.Call[[]string](a_, objc.Sel("allowedContentTypes")) + return rv +} diff --git a/macos/avfoundation/asset_resource_loading_data_request.gen.go b/macos/avfoundation/asset_resource_loading_data_request.gen.go new file mode 100644 index 00000000..d913bb2b --- /dev/null +++ b/macos/avfoundation/asset_resource_loading_data_request.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetResourceLoadingDataRequest] class. +var AssetResourceLoadingDataRequestClass = _AssetResourceLoadingDataRequestClass{objc.GetClass("AVAssetResourceLoadingDataRequest")} + +type _AssetResourceLoadingDataRequestClass struct { + objc.Class +} + +// An interface definition for the [AssetResourceLoadingDataRequest] class. +type IAssetResourceLoadingDataRequest interface { + objc.IObject + RespondWithData(data []byte) + RequestedLength() int + RequestsAllDataToEndOfResource() bool + RequestedOffset() int64 + CurrentOffset() int64 +} + +// An object for requesting data from a resource that an asset resource-loading request references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingdatarequest?language=objc +type AssetResourceLoadingDataRequest struct { + objc.Object +} + +func AssetResourceLoadingDataRequestFrom(ptr unsafe.Pointer) AssetResourceLoadingDataRequest { + return AssetResourceLoadingDataRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetResourceLoadingDataRequestClass) Alloc() AssetResourceLoadingDataRequest { + rv := objc.Call[AssetResourceLoadingDataRequest](ac, objc.Sel("alloc")) + return rv +} + +func AssetResourceLoadingDataRequest_Alloc() AssetResourceLoadingDataRequest { + return AssetResourceLoadingDataRequestClass.Alloc() +} + +func (ac _AssetResourceLoadingDataRequestClass) New() AssetResourceLoadingDataRequest { + rv := objc.Call[AssetResourceLoadingDataRequest](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetResourceLoadingDataRequest() AssetResourceLoadingDataRequest { + return AssetResourceLoadingDataRequestClass.New() +} + +func (a_ AssetResourceLoadingDataRequest) Init() AssetResourceLoadingDataRequest { + rv := objc.Call[AssetResourceLoadingDataRequest](a_, objc.Sel("init")) + return rv +} + +// Provides data to the loading request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingdatarequest/1390581-respondwithdata?language=objc +func (a_ AssetResourceLoadingDataRequest) RespondWithData(data []byte) { + objc.Call[objc.Void](a_, objc.Sel("respondWithData:"), data) +} + +// The length, in bytes, of the data requested. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingdatarequest/1387720-requestedlength?language=objc +func (a_ AssetResourceLoadingDataRequest) RequestedLength() int { + rv := objc.Call[int](a_, objc.Sel("requestedLength")) + return rv +} + +// A Boolean value that indicates the entire remaining length of the resource from the offest to the end of the resource is being requested. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingdatarequest/1386864-requestsalldatatoendofresource?language=objc +func (a_ AssetResourceLoadingDataRequest) RequestsAllDataToEndOfResource() bool { + rv := objc.Call[bool](a_, objc.Sel("requestsAllDataToEndOfResource")) + return rv +} + +// The position within the resource of the first byte requested. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingdatarequest/1388428-requestedoffset?language=objc +func (a_ AssetResourceLoadingDataRequest) RequestedOffset() int64 { + rv := objc.Call[int64](a_, objc.Sel("requestedOffset")) + return rv +} + +// The position within the resource of the next byte. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingdatarequest/1385945-currentoffset?language=objc +func (a_ AssetResourceLoadingDataRequest) CurrentOffset() int64 { + rv := objc.Call[int64](a_, objc.Sel("currentOffset")) + return rv +} diff --git a/macos/avfoundation/asset_resource_loading_request.gen.go b/macos/avfoundation/asset_resource_loading_request.gen.go new file mode 100644 index 00000000..a5e4cf87 --- /dev/null +++ b/macos/avfoundation/asset_resource_loading_request.gen.go @@ -0,0 +1,163 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetResourceLoadingRequest] class. +var AssetResourceLoadingRequestClass = _AssetResourceLoadingRequestClass{objc.GetClass("AVAssetResourceLoadingRequest")} + +type _AssetResourceLoadingRequestClass struct { + objc.Class +} + +// An interface definition for the [AssetResourceLoadingRequest] class. +type IAssetResourceLoadingRequest interface { + objc.IObject + FinishLoading() + FinishLoadingWithError(error foundation.IError) + IsCancelled() bool + Request() foundation.URLRequest + Requestor() AssetResourceLoadingRequestor + ContentInformationRequest() AssetResourceLoadingContentInformationRequest + DataRequest() AssetResourceLoadingDataRequest + Response() foundation.URLResponse + SetResponse(value foundation.IURLResponse) + IsFinished() bool + Redirect() foundation.URLRequest + SetRedirect(value foundation.IURLRequest) +} + +// An object that encapsulates information about a resource request from a resource loader object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest?language=objc +type AssetResourceLoadingRequest struct { + objc.Object +} + +func AssetResourceLoadingRequestFrom(ptr unsafe.Pointer) AssetResourceLoadingRequest { + return AssetResourceLoadingRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetResourceLoadingRequestClass) Alloc() AssetResourceLoadingRequest { + rv := objc.Call[AssetResourceLoadingRequest](ac, objc.Sel("alloc")) + return rv +} + +func AssetResourceLoadingRequest_Alloc() AssetResourceLoadingRequest { + return AssetResourceLoadingRequestClass.Alloc() +} + +func (ac _AssetResourceLoadingRequestClass) New() AssetResourceLoadingRequest { + rv := objc.Call[AssetResourceLoadingRequest](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetResourceLoadingRequest() AssetResourceLoadingRequest { + return AssetResourceLoadingRequestClass.New() +} + +func (a_ AssetResourceLoadingRequest) Init() AssetResourceLoadingRequest { + rv := objc.Call[AssetResourceLoadingRequest](a_, objc.Sel("init")) + return rv +} + +// Causes the receiver to treat the processing of the request as complete. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1388359-finishloading?language=objc +func (a_ AssetResourceLoadingRequest) FinishLoading() { + objc.Call[objc.Void](a_, objc.Sel("finishLoading")) +} + +// Causes the receiver to handle the failure to load a resource for which a resource loader’s delegate took responsibility. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1390491-finishloadingwitherror?language=objc +func (a_ AssetResourceLoadingRequest) FinishLoadingWithError(error foundation.IError) { + objc.Call[objc.Void](a_, objc.Sel("finishLoadingWithError:"), objc.Ptr(error)) +} + +// A Boolean value that indicates whether the request has been cancelled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1389518-cancelled?language=objc +func (a_ AssetResourceLoadingRequest) IsCancelled() bool { + rv := objc.Call[bool](a_, objc.Sel("isCancelled")) + return rv +} + +// The URL request object for the resource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1386220-request?language=objc +func (a_ AssetResourceLoadingRequest) Request() foundation.URLRequest { + rv := objc.Call[foundation.URLRequest](a_, objc.Sel("request")) + return rv +} + +// The asset resource requestor that made the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/2966509-requestor?language=objc +func (a_ AssetResourceLoadingRequest) Requestor() AssetResourceLoadingRequestor { + rv := objc.Call[AssetResourceLoadingRequestor](a_, objc.Sel("requestor")) + return rv +} + +// The information for a requested resource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1390340-contentinformationrequest?language=objc +func (a_ AssetResourceLoadingRequest) ContentInformationRequest() AssetResourceLoadingContentInformationRequest { + rv := objc.Call[AssetResourceLoadingContentInformationRequest](a_, objc.Sel("contentInformationRequest")) + return rv +} + +// The range of requested resource data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1388779-datarequest?language=objc +func (a_ AssetResourceLoadingRequest) DataRequest() AssetResourceLoadingDataRequest { + rv := objc.Call[AssetResourceLoadingDataRequest](a_, objc.Sel("dataRequest")) + return rv +} + +// The URL response for the loading request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1389034-response?language=objc +func (a_ AssetResourceLoadingRequest) Response() foundation.URLResponse { + rv := objc.Call[foundation.URLResponse](a_, objc.Sel("response")) + return rv +} + +// The URL response for the loading request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1389034-response?language=objc +func (a_ AssetResourceLoadingRequest) SetResponse(value foundation.IURLResponse) { + objc.Call[objc.Void](a_, objc.Sel("setResponse:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether loading of the resource has finished. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1389270-finished?language=objc +func (a_ AssetResourceLoadingRequest) IsFinished() bool { + rv := objc.Call[bool](a_, objc.Sel("isFinished")) + return rv +} + +// An URL request instance if the loading request was redirected. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1390854-redirect?language=objc +func (a_ AssetResourceLoadingRequest) Redirect() foundation.URLRequest { + rv := objc.Call[foundation.URLRequest](a_, objc.Sel("redirect")) + return rv +} + +// An URL request instance if the loading request was redirected. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequest/1390854-redirect?language=objc +func (a_ AssetResourceLoadingRequest) SetRedirect(value foundation.IURLRequest) { + objc.Call[objc.Void](a_, objc.Sel("setRedirect:"), objc.Ptr(value)) +} diff --git a/macos/avfoundation/asset_resource_loading_requestor.gen.go b/macos/avfoundation/asset_resource_loading_requestor.gen.go new file mode 100644 index 00000000..af0ff692 --- /dev/null +++ b/macos/avfoundation/asset_resource_loading_requestor.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetResourceLoadingRequestor] class. +var AssetResourceLoadingRequestorClass = _AssetResourceLoadingRequestorClass{objc.GetClass("AVAssetResourceLoadingRequestor")} + +type _AssetResourceLoadingRequestorClass struct { + objc.Class +} + +// An interface definition for the [AssetResourceLoadingRequestor] class. +type IAssetResourceLoadingRequestor interface { + objc.IObject + ProvidesExpiredSessionReports() bool +} + +// An object that contains information about the originator of a resource-loading request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequestor?language=objc +type AssetResourceLoadingRequestor struct { + objc.Object +} + +func AssetResourceLoadingRequestorFrom(ptr unsafe.Pointer) AssetResourceLoadingRequestor { + return AssetResourceLoadingRequestor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetResourceLoadingRequestorClass) Alloc() AssetResourceLoadingRequestor { + rv := objc.Call[AssetResourceLoadingRequestor](ac, objc.Sel("alloc")) + return rv +} + +func AssetResourceLoadingRequestor_Alloc() AssetResourceLoadingRequestor { + return AssetResourceLoadingRequestorClass.Alloc() +} + +func (ac _AssetResourceLoadingRequestorClass) New() AssetResourceLoadingRequestor { + rv := objc.Call[AssetResourceLoadingRequestor](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetResourceLoadingRequestor() AssetResourceLoadingRequestor { + return AssetResourceLoadingRequestorClass.New() +} + +func (a_ AssetResourceLoadingRequestor) Init() AssetResourceLoadingRequestor { + rv := objc.Call[AssetResourceLoadingRequestor](a_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the requestor provides expired session reports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourceloadingrequestor/2966511-providesexpiredsessionreports?language=objc +func (a_ AssetResourceLoadingRequestor) ProvidesExpiredSessionReports() bool { + rv := objc.Call[bool](a_, objc.Sel("providesExpiredSessionReports")) + return rv +} diff --git a/macos/avfoundation/asset_resource_renewal_request.gen.go b/macos/avfoundation/asset_resource_renewal_request.gen.go new file mode 100644 index 00000000..915b6b31 --- /dev/null +++ b/macos/avfoundation/asset_resource_renewal_request.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetResourceRenewalRequest] class. +var AssetResourceRenewalRequestClass = _AssetResourceRenewalRequestClass{objc.GetClass("AVAssetResourceRenewalRequest")} + +type _AssetResourceRenewalRequestClass struct { + objc.Class +} + +// An interface definition for the [AssetResourceRenewalRequest] class. +type IAssetResourceRenewalRequest interface { + IAssetResourceLoadingRequest +} + +// An object that encapsulates information about a resource request from a resource loader to renew a previously issued request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetresourcerenewalrequest?language=objc +type AssetResourceRenewalRequest struct { + AssetResourceLoadingRequest +} + +func AssetResourceRenewalRequestFrom(ptr unsafe.Pointer) AssetResourceRenewalRequest { + return AssetResourceRenewalRequest{ + AssetResourceLoadingRequest: AssetResourceLoadingRequestFrom(ptr), + } +} + +func (ac _AssetResourceRenewalRequestClass) Alloc() AssetResourceRenewalRequest { + rv := objc.Call[AssetResourceRenewalRequest](ac, objc.Sel("alloc")) + return rv +} + +func AssetResourceRenewalRequest_Alloc() AssetResourceRenewalRequest { + return AssetResourceRenewalRequestClass.Alloc() +} + +func (ac _AssetResourceRenewalRequestClass) New() AssetResourceRenewalRequest { + rv := objc.Call[AssetResourceRenewalRequest](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetResourceRenewalRequest() AssetResourceRenewalRequest { + return AssetResourceRenewalRequestClass.New() +} + +func (a_ AssetResourceRenewalRequest) Init() AssetResourceRenewalRequest { + rv := objc.Call[AssetResourceRenewalRequest](a_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/asset_segment_report.gen.go b/macos/avfoundation/asset_segment_report.gen.go new file mode 100644 index 00000000..fe8b840f --- /dev/null +++ b/macos/avfoundation/asset_segment_report.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetSegmentReport] class. +var AssetSegmentReportClass = _AssetSegmentReportClass{objc.GetClass("AVAssetSegmentReport")} + +type _AssetSegmentReportClass struct { + objc.Class +} + +// An interface definition for the [AssetSegmentReport] class. +type IAssetSegmentReport interface { + objc.IObject + SegmentType() AssetSegmentType + TrackReports() []AssetSegmentTrackReport +} + +// An object that provides information about segment data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreport?language=objc +type AssetSegmentReport struct { + objc.Object +} + +func AssetSegmentReportFrom(ptr unsafe.Pointer) AssetSegmentReport { + return AssetSegmentReport{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetSegmentReportClass) Alloc() AssetSegmentReport { + rv := objc.Call[AssetSegmentReport](ac, objc.Sel("alloc")) + return rv +} + +func AssetSegmentReport_Alloc() AssetSegmentReport { + return AssetSegmentReportClass.Alloc() +} + +func (ac _AssetSegmentReportClass) New() AssetSegmentReport { + rv := objc.Call[AssetSegmentReport](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetSegmentReport() AssetSegmentReport { + return AssetSegmentReportClass.New() +} + +func (a_ AssetSegmentReport) Init() AssetSegmentReport { + rv := objc.Call[AssetSegmentReport](a_, objc.Sel("init")) + return rv +} + +// The type of segment data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreport/3546570-segmenttype?language=objc +func (a_ AssetSegmentReport) SegmentType() AssetSegmentType { + rv := objc.Call[AssetSegmentType](a_, objc.Sel("segmentType")) + return rv +} + +// The reports for the segment’s track data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreport/3546571-trackreports?language=objc +func (a_ AssetSegmentReport) TrackReports() []AssetSegmentTrackReport { + rv := objc.Call[[]AssetSegmentTrackReport](a_, objc.Sel("trackReports")) + return rv +} diff --git a/macos/avfoundation/asset_segment_report_sample_information.gen.go b/macos/avfoundation/asset_segment_report_sample_information.gen.go new file mode 100644 index 00000000..317c288b --- /dev/null +++ b/macos/avfoundation/asset_segment_report_sample_information.gen.go @@ -0,0 +1,95 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetSegmentReportSampleInformation] class. +var AssetSegmentReportSampleInformationClass = _AssetSegmentReportSampleInformationClass{objc.GetClass("AVAssetSegmentReportSampleInformation")} + +type _AssetSegmentReportSampleInformationClass struct { + objc.Class +} + +// An interface definition for the [AssetSegmentReportSampleInformation] class. +type IAssetSegmentReportSampleInformation interface { + objc.IObject + Length() int + IsSyncSample() bool + Offset() int + PresentationTimeStamp() coremedia.Time +} + +// An object that provides information about sample data in a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreportsampleinformation?language=objc +type AssetSegmentReportSampleInformation struct { + objc.Object +} + +func AssetSegmentReportSampleInformationFrom(ptr unsafe.Pointer) AssetSegmentReportSampleInformation { + return AssetSegmentReportSampleInformation{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetSegmentReportSampleInformationClass) Alloc() AssetSegmentReportSampleInformation { + rv := objc.Call[AssetSegmentReportSampleInformation](ac, objc.Sel("alloc")) + return rv +} + +func AssetSegmentReportSampleInformation_Alloc() AssetSegmentReportSampleInformation { + return AssetSegmentReportSampleInformationClass.Alloc() +} + +func (ac _AssetSegmentReportSampleInformationClass) New() AssetSegmentReportSampleInformation { + rv := objc.Call[AssetSegmentReportSampleInformation](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetSegmentReportSampleInformation() AssetSegmentReportSampleInformation { + return AssetSegmentReportSampleInformationClass.New() +} + +func (a_ AssetSegmentReportSampleInformation) Init() AssetSegmentReportSampleInformation { + rv := objc.Call[AssetSegmentReportSampleInformation](a_, objc.Sel("init")) + return rv +} + +// The length of the sample data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreportsampleinformation/3546573-length?language=objc +func (a_ AssetSegmentReportSampleInformation) Length() int { + rv := objc.Call[int](a_, objc.Sel("length")) + return rv +} + +// A Boolean value that indicates whether the sample is a key frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreportsampleinformation/3563932-issyncsample?language=objc +func (a_ AssetSegmentReportSampleInformation) IsSyncSample() bool { + rv := objc.Call[bool](a_, objc.Sel("isSyncSample")) + return rv +} + +// The offset of a sample in the segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreportsampleinformation/3546574-offset?language=objc +func (a_ AssetSegmentReportSampleInformation) Offset() int { + rv := objc.Call[int](a_, objc.Sel("offset")) + return rv +} + +// The presentation timestamp (PTS) of a sample. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmentreportsampleinformation/3546575-presentationtimestamp?language=objc +func (a_ AssetSegmentReportSampleInformation) PresentationTimeStamp() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("presentationTimeStamp")) + return rv +} diff --git a/macos/avfoundation/asset_segment_track_report.gen.go b/macos/avfoundation/asset_segment_track_report.gen.go new file mode 100644 index 00000000..51da638f --- /dev/null +++ b/macos/avfoundation/asset_segment_track_report.gen.go @@ -0,0 +1,104 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetSegmentTrackReport] class. +var AssetSegmentTrackReportClass = _AssetSegmentTrackReportClass{objc.GetClass("AVAssetSegmentTrackReport")} + +type _AssetSegmentTrackReportClass struct { + objc.Class +} + +// An interface definition for the [AssetSegmentTrackReport] class. +type IAssetSegmentTrackReport interface { + objc.IObject + EarliestPresentationTimeStamp() coremedia.Time + TrackID() objc.Object + MediaType() MediaType + FirstVideoSampleInformation() AssetSegmentReportSampleInformation + Duration() coremedia.Time +} + +// An object that provides information on a track in segment data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport?language=objc +type AssetSegmentTrackReport struct { + objc.Object +} + +func AssetSegmentTrackReportFrom(ptr unsafe.Pointer) AssetSegmentTrackReport { + return AssetSegmentTrackReport{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetSegmentTrackReportClass) Alloc() AssetSegmentTrackReport { + rv := objc.Call[AssetSegmentTrackReport](ac, objc.Sel("alloc")) + return rv +} + +func AssetSegmentTrackReport_Alloc() AssetSegmentTrackReport { + return AssetSegmentTrackReportClass.Alloc() +} + +func (ac _AssetSegmentTrackReportClass) New() AssetSegmentTrackReport { + rv := objc.Call[AssetSegmentTrackReport](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetSegmentTrackReport() AssetSegmentTrackReport { + return AssetSegmentTrackReportClass.New() +} + +func (a_ AssetSegmentTrackReport) Init() AssetSegmentTrackReport { + rv := objc.Call[AssetSegmentTrackReport](a_, objc.Sel("init")) + return rv +} + +// The earliest presentation timestamp (PTS) for this track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport/3600083-earliestpresentationtimestamp?language=objc +func (a_ AssetSegmentTrackReport) EarliestPresentationTimeStamp() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("earliestPresentationTimeStamp")) + return rv +} + +// A persistent unique identifier for a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport/3546581-trackid?language=objc +func (a_ AssetSegmentTrackReport) TrackID() objc.Object { + rv := objc.Call[objc.Object](a_, objc.Sel("trackID")) + return rv +} + +// The type of media a track contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport/3546580-mediatype?language=objc +func (a_ AssetSegmentTrackReport) MediaType() MediaType { + rv := objc.Call[MediaType](a_, objc.Sel("mediaType")) + return rv +} + +// Information about the first video sample in a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport/3546579-firstvideosampleinformation?language=objc +func (a_ AssetSegmentTrackReport) FirstVideoSampleInformation() AssetSegmentReportSampleInformation { + rv := objc.Call[AssetSegmentReportSampleInformation](a_, objc.Sel("firstVideoSampleInformation")) + return rv +} + +// The duration of a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport/3546578-duration?language=objc +func (a_ AssetSegmentTrackReport) Duration() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("duration")) + return rv +} diff --git a/macos/avfoundation/asset_track.gen.go b/macos/avfoundation/asset_track.gen.go new file mode 100644 index 00000000..fc1365b5 --- /dev/null +++ b/macos/avfoundation/asset_track.gen.go @@ -0,0 +1,372 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetTrack] class. +var AssetTrackClass = _AssetTrackClass{objc.GetClass("AVAssetTrack")} + +type _AssetTrackClass struct { + objc.Class +} + +// An interface definition for the [AssetTrack] class. +type IAssetTrack interface { + objc.IObject + MakeSampleCursorWithPresentationTimeStamp(presentationTimeStamp coremedia.Time) SampleCursor + LoadSamplePresentationTimeForTrackTimeCompletionHandler(trackTime coremedia.Time, completionHandler func(arg0 coremedia.Time, arg1 foundation.Error)) + LoadMetadataForFormatCompletionHandler(format MetadataFormat, completionHandler func(arg0 []MetadataItem, arg1 foundation.Error)) + HasMediaCharacteristic(mediaCharacteristic MediaCharacteristic) bool + MakeSampleCursorAtFirstSampleInDecodeOrder() SampleCursor + LoadAssociatedTracksOfTypeCompletionHandler(trackAssociationType TrackAssociationType, completionHandler func(arg0 []AssetTrack, arg1 foundation.Error)) + MakeSampleCursorAtLastSampleInDecodeOrder() SampleCursor + LoadSegmentForTrackTimeCompletionHandler(trackTime coremedia.Time, completionHandler func(arg0 AssetTrackSegment, arg1 foundation.Error)) + ExtendedLanguageTag() string + FormatDescriptions() []objc.Object + TrackID() objc.Object + PreferredVolume() float64 + HasAudioSampleDependencies() bool + Metadata() []MetadataItem + MediaType() MediaType + RequiresFrameReordering() bool + TotalSampleDataLength() int64 + Segments() []AssetTrackSegment + IsDecodable() bool + MinFrameDuration() coremedia.Time + NaturalSize() coregraphics.Size + AvailableMetadataFormats() []MetadataFormat + EstimatedDataRate() float64 + TimeRange() coremedia.TimeRange + NominalFrameRate() float64 + CanProvideSampleCursors() bool + IsSelfContained() bool + LanguageCode() string + IsEnabled() bool + NaturalTimeScale() coremedia.TimeScale + AvailableTrackAssociationTypes() []TrackAssociationType + Asset() Asset + PreferredTransform() coregraphics.AffineTransform + IsPlayable() bool + CommonMetadata() []MetadataItem +} + +// An object that models a track of media that an asset contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack?language=objc +type AssetTrack struct { + objc.Object +} + +func AssetTrackFrom(ptr unsafe.Pointer) AssetTrack { + return AssetTrack{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetTrackClass) Alloc() AssetTrack { + rv := objc.Call[AssetTrack](ac, objc.Sel("alloc")) + return rv +} + +func AssetTrack_Alloc() AssetTrack { + return AssetTrackClass.Alloc() +} + +func (ac _AssetTrackClass) New() AssetTrack { + rv := objc.Call[AssetTrack](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetTrack() AssetTrack { + return AssetTrackClass.New() +} + +func (a_ AssetTrack) Init() AssetTrack { + rv := objc.Call[AssetTrack](a_, objc.Sel("init")) + return rv +} + +// Creates a sample cursor and positions it at or near the specified presentation timestamp. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1390248-makesamplecursorwithpresentation?language=objc +func (a_ AssetTrack) MakeSampleCursorWithPresentationTimeStamp(presentationTimeStamp coremedia.Time) SampleCursor { + rv := objc.Call[SampleCursor](a_, objc.Sel("makeSampleCursorWithPresentationTimeStamp:"), presentationTimeStamp) + return rv +} + +// Loads a sample presentation time that maps to the specified track time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/3746540-loadsamplepresentationtimefortra?language=objc +func (a_ AssetTrack) LoadSamplePresentationTimeForTrackTimeCompletionHandler(trackTime coremedia.Time, completionHandler func(arg0 coremedia.Time, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadSamplePresentationTimeForTrackTime:completionHandler:"), trackTime, completionHandler) +} + +// Loads metadata items that a track contains for the specified format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/3746539-loadmetadataforformat?language=objc +func (a_ AssetTrack) LoadMetadataForFormatCompletionHandler(format MetadataFormat, completionHandler func(arg0 []MetadataItem, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadMetadataForFormat:completionHandler:"), format, completionHandler) +} + +// Returns a Boolean value that indicates whether the track references media with the specified media characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1385847-hasmediacharacteristic?language=objc +func (a_ AssetTrack) HasMediaCharacteristic(mediaCharacteristic MediaCharacteristic) bool { + rv := objc.Call[bool](a_, objc.Sel("hasMediaCharacteristic:"), mediaCharacteristic) + return rv +} + +// Creates a sample cursor and positions it at the track’s first media sample in decode order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1387226-makesamplecursoratfirstsampleind?language=objc +func (a_ AssetTrack) MakeSampleCursorAtFirstSampleInDecodeOrder() SampleCursor { + rv := objc.Call[SampleCursor](a_, objc.Sel("makeSampleCursorAtFirstSampleInDecodeOrder")) + return rv +} + +// Loads associated tracks that have the specified association type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/3746538-loadassociatedtracksoftype?language=objc +func (a_ AssetTrack) LoadAssociatedTracksOfTypeCompletionHandler(trackAssociationType TrackAssociationType, completionHandler func(arg0 []AssetTrack, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadAssociatedTracksOfType:completionHandler:"), trackAssociationType, completionHandler) +} + +// Creates a sample cursor and positions it at the track’s last media sample in decode order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1386014-makesamplecursoratlastsampleinde?language=objc +func (a_ AssetTrack) MakeSampleCursorAtLastSampleInDecodeOrder() SampleCursor { + rv := objc.Call[SampleCursor](a_, objc.Sel("makeSampleCursorAtLastSampleInDecodeOrder")) + return rv +} + +// Loads a segment with a target time range that contains, or is closest to, the specified track time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/3746541-loadsegmentfortracktime?language=objc +func (a_ AssetTrack) LoadSegmentForTrackTimeCompletionHandler(trackTime coremedia.Time, completionHandler func(arg0 AssetTrackSegment, arg1 foundation.Error)) { + objc.Call[objc.Void](a_, objc.Sel("loadSegmentForTrackTime:completionHandler:"), trackTime, completionHandler) +} + +// The language tag of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1389105-extendedlanguagetag?language=objc +func (a_ AssetTrack) ExtendedLanguageTag() string { + rv := objc.Call[string](a_, objc.Sel("extendedLanguageTag")) + return rv +} + +// The format descriptions of the media samples that a track references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1386694-formatdescriptions?language=objc +func (a_ AssetTrack) FormatDescriptions() []objc.Object { + rv := objc.Call[[]objc.Object](a_, objc.Sel("formatDescriptions")) + return rv +} + +// The persistent unique identifier for this track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1385799-trackid?language=objc +func (a_ AssetTrack) TrackID() objc.Object { + rv := objc.Call[objc.Object](a_, objc.Sel("trackID")) + return rv +} + +// The track’s volume preference for playing its audible media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1388832-preferredvolume?language=objc +func (a_ AssetTrack) PreferredVolume() float64 { + rv := objc.Call[float64](a_, objc.Sel("preferredVolume")) + return rv +} + +// A Boolean value that indicates whether the track has sample dependencies. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/3131265-hasaudiosampledependencies?language=objc +func (a_ AssetTrack) HasAudioSampleDependencies() bool { + rv := objc.Call[bool](a_, objc.Sel("hasAudioSampleDependencies")) + return rv +} + +// An array of metadata items for all metadata identifiers that have a value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1389054-metadata?language=objc +func (a_ AssetTrack) Metadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](a_, objc.Sel("metadata")) + return rv +} + +// The type of media that a track presents. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1385741-mediatype?language=objc +func (a_ AssetTrack) MediaType() MediaType { + rv := objc.Call[MediaType](a_, objc.Sel("mediaType")) + return rv +} + +// A Boolean value that indicates whether samples in the track may have different presentation and decode timestamps. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1390844-requiresframereordering?language=objc +func (a_ AssetTrack) RequiresFrameReordering() bool { + rv := objc.Call[bool](a_, objc.Sel("requiresFrameReordering")) + return rv +} + +// The total number of bytes of sample data the track requires. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1388900-totalsampledatalength?language=objc +func (a_ AssetTrack) TotalSampleDataLength() int64 { + rv := objc.Call[int64](a_, objc.Sel("totalSampleDataLength")) + return rv +} + +// The time mappings from the track’s media samples to its timeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1390665-segments?language=objc +func (a_ AssetTrack) Segments() []AssetTrackSegment { + rv := objc.Call[[]AssetTrackSegment](a_, objc.Sel("segments")) + return rv +} + +// A Boolean value that indicates whether the track is decodable in the current environment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/2887366-decodable?language=objc +func (a_ AssetTrack) IsDecodable() bool { + rv := objc.Call[bool](a_, objc.Sel("isDecodable")) + return rv +} + +// The minimum duration of the track’s frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1388608-minframeduration?language=objc +func (a_ AssetTrack) MinFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("minFrameDuration")) + return rv +} + +// The natural dimensions of the media data that the track references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1387724-naturalsize?language=objc +func (a_ AssetTrack) NaturalSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](a_, objc.Sel("naturalSize")) + return rv +} + +// An array of metadata formats available for the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1385751-availablemetadataformats?language=objc +func (a_ AssetTrack) AvailableMetadataFormats() []MetadataFormat { + rv := objc.Call[[]MetadataFormat](a_, objc.Sel("availableMetadataFormats")) + return rv +} + +// The estimated data rate, in bits per second, of the media that the track references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1389758-estimateddatarate?language=objc +func (a_ AssetTrack) EstimatedDataRate() float64 { + rv := objc.Call[float64](a_, objc.Sel("estimatedDataRate")) + return rv +} + +// The time range of the track within the overall timeline of the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1388335-timerange?language=objc +func (a_ AssetTrack) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](a_, objc.Sel("timeRange")) + return rv +} + +// The frame rate of the track, in frames per second. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1386182-nominalframerate?language=objc +func (a_ AssetTrack) NominalFrameRate() float64 { + rv := objc.Call[float64](a_, objc.Sel("nominalFrameRate")) + return rv +} + +// A Boolean value that indicates whether the track can provide instances of sample cursors to traverse its media samples and discover information. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1386692-canprovidesamplecursors?language=objc +func (a_ AssetTrack) CanProvideSampleCursors() bool { + rv := objc.Call[bool](a_, objc.Sel("canProvideSampleCursors")) + return rv +} + +// A Boolean value that indicates whether this track references sample data only within its container file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1387643-selfcontained?language=objc +func (a_ AssetTrack) IsSelfContained() bool { + rv := objc.Call[bool](a_, objc.Sel("isSelfContained")) + return rv +} + +// The language code of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1388627-languagecode?language=objc +func (a_ AssetTrack) LanguageCode() string { + rv := objc.Call[string](a_, objc.Sel("languageCode")) + return rv +} + +// A Boolean value that indicates whether the track’s container enables it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1387546-enabled?language=objc +func (a_ AssetTrack) IsEnabled() bool { + rv := objc.Call[bool](a_, objc.Sel("isEnabled")) + return rv +} + +// The natural time scale of the media that a track references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1389233-naturaltimescale?language=objc +func (a_ AssetTrack) NaturalTimeScale() coremedia.TimeScale { + rv := objc.Call[coremedia.TimeScale](a_, objc.Sel("naturalTimeScale")) + return rv +} + +// An array of association types that the track uses to associate with other tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1388065-availabletrackassociationtypes?language=objc +func (a_ AssetTrack) AvailableTrackAssociationTypes() []TrackAssociationType { + rv := objc.Call[[]TrackAssociationType](a_, objc.Sel("availableTrackAssociationTypes")) + return rv +} + +// The asset object that contains this track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1385611-asset?language=objc +func (a_ AssetTrack) Asset() Asset { + rv := objc.Call[Asset](a_, objc.Sel("asset")) + return rv +} + +// The track’s transform preference to apply to its visual content during presentation or processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1389837-preferredtransform?language=objc +func (a_ AssetTrack) PreferredTransform() coregraphics.AffineTransform { + rv := objc.Call[coregraphics.AffineTransform](a_, objc.Sel("preferredTransform")) + return rv +} + +// A Boolean value that indicates whether the track is playable in the current environment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1388276-playable?language=objc +func (a_ AssetTrack) IsPlayable() bool { + rv := objc.Call[bool](a_, objc.Sel("isPlayable")) + return rv +} + +// An array of metadata items for all common metadata keys that have a value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrack/1390832-commonmetadata?language=objc +func (a_ AssetTrack) CommonMetadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](a_, objc.Sel("commonMetadata")) + return rv +} diff --git a/macos/avfoundation/asset_track_group.gen.go b/macos/avfoundation/asset_track_group.gen.go new file mode 100644 index 00000000..6041f08b --- /dev/null +++ b/macos/avfoundation/asset_track_group.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetTrackGroup] class. +var AssetTrackGroupClass = _AssetTrackGroupClass{objc.GetClass("AVAssetTrackGroup")} + +type _AssetTrackGroupClass struct { + objc.Class +} + +// An interface definition for the [AssetTrackGroup] class. +type IAssetTrackGroup interface { + objc.IObject + TrackIDs() []foundation.Number +} + +// A group of related tracks in an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrackgroup?language=objc +type AssetTrackGroup struct { + objc.Object +} + +func AssetTrackGroupFrom(ptr unsafe.Pointer) AssetTrackGroup { + return AssetTrackGroup{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetTrackGroupClass) Alloc() AssetTrackGroup { + rv := objc.Call[AssetTrackGroup](ac, objc.Sel("alloc")) + return rv +} + +func AssetTrackGroup_Alloc() AssetTrackGroup { + return AssetTrackGroupClass.Alloc() +} + +func (ac _AssetTrackGroupClass) New() AssetTrackGroup { + rv := objc.Call[AssetTrackGroup](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetTrackGroup() AssetTrackGroup { + return AssetTrackGroupClass.New() +} + +func (a_ AssetTrackGroup) Init() AssetTrackGroup { + rv := objc.Call[AssetTrackGroup](a_, objc.Sel("init")) + return rv +} + +// The IDs of the tracks in the group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettrackgroup/1389024-trackids?language=objc +func (a_ AssetTrackGroup) TrackIDs() []foundation.Number { + rv := objc.Call[[]foundation.Number](a_, objc.Sel("trackIDs")) + return rv +} diff --git a/macos/avfoundation/asset_track_segment.gen.go b/macos/avfoundation/asset_track_segment.gen.go new file mode 100644 index 00000000..b08ee9e6 --- /dev/null +++ b/macos/avfoundation/asset_track_segment.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetTrackSegment] class. +var AssetTrackSegmentClass = _AssetTrackSegmentClass{objc.GetClass("AVAssetTrackSegment")} + +type _AssetTrackSegmentClass struct { + objc.Class +} + +// An interface definition for the [AssetTrackSegment] class. +type IAssetTrackSegment interface { + objc.IObject + IsEmpty() bool + TimeMapping() coremedia.TimeMapping +} + +// An object that represents a time range segment of an asset track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettracksegment?language=objc +type AssetTrackSegment struct { + objc.Object +} + +func AssetTrackSegmentFrom(ptr unsafe.Pointer) AssetTrackSegment { + return AssetTrackSegment{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetTrackSegmentClass) Alloc() AssetTrackSegment { + rv := objc.Call[AssetTrackSegment](ac, objc.Sel("alloc")) + return rv +} + +func AssetTrackSegment_Alloc() AssetTrackSegment { + return AssetTrackSegmentClass.Alloc() +} + +func (ac _AssetTrackSegmentClass) New() AssetTrackSegment { + rv := objc.Call[AssetTrackSegment](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetTrackSegment() AssetTrackSegment { + return AssetTrackSegmentClass.New() +} + +func (a_ AssetTrackSegment) Init() AssetTrackSegment { + rv := objc.Call[AssetTrackSegment](a_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the segment is empty. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettracksegment/1385714-empty?language=objc +func (a_ AssetTrackSegment) IsEmpty() bool { + rv := objc.Call[bool](a_, objc.Sel("isEmpty")) + return rv +} + +// The time range of the track that this segment presents. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassettracksegment/1390557-timemapping?language=objc +func (a_ AssetTrackSegment) TimeMapping() coremedia.TimeMapping { + rv := objc.Call[coremedia.TimeMapping](a_, objc.Sel("timeMapping")) + return rv +} diff --git a/macos/avfoundation/asset_variant.gen.go b/macos/avfoundation/asset_variant.gen.go new file mode 100644 index 00000000..e694a57f --- /dev/null +++ b/macos/avfoundation/asset_variant.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetVariant] class. +var AssetVariantClass = _AssetVariantClass{objc.GetClass("AVAssetVariant")} + +type _AssetVariantClass struct { + objc.Class +} + +// An interface definition for the [AssetVariant] class. +type IAssetVariant interface { + objc.IObject + PeakBitRate() float64 + AudioAttributes() AssetVariantAudioAttributes + AverageBitRate() float64 + VideoAttributes() AssetVariantVideoAttributes +} + +// An object that represents a bit rate variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariant?language=objc +type AssetVariant struct { + objc.Object +} + +func AssetVariantFrom(ptr unsafe.Pointer) AssetVariant { + return AssetVariant{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetVariantClass) Alloc() AssetVariant { + rv := objc.Call[AssetVariant](ac, objc.Sel("alloc")) + return rv +} + +func AssetVariant_Alloc() AssetVariant { + return AssetVariantClass.Alloc() +} + +func (ac _AssetVariantClass) New() AssetVariant { + rv := objc.Call[AssetVariant](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetVariant() AssetVariant { + return AssetVariantClass.New() +} + +func (a_ AssetVariant) Init() AssetVariant { + rv := objc.Call[AssetVariant](a_, objc.Sel("init")) + return rv +} + +// The peak bit rate for the variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariant/3746545-peakbitrate?language=objc +func (a_ AssetVariant) PeakBitRate() float64 { + rv := objc.Call[float64](a_, objc.Sel("peakBitRate")) + return rv +} + +// The audio rendition attributes for the variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariant/3746543-audioattributes?language=objc +func (a_ AssetVariant) AudioAttributes() AssetVariantAudioAttributes { + rv := objc.Call[AssetVariantAudioAttributes](a_, objc.Sel("audioAttributes")) + return rv +} + +// The average bit rate for the variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariant/3746544-averagebitrate?language=objc +func (a_ AssetVariant) AverageBitRate() float64 { + rv := objc.Call[float64](a_, objc.Sel("averageBitRate")) + return rv +} + +// The audio rendition attributes for the variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariant/3746546-videoattributes?language=objc +func (a_ AssetVariant) VideoAttributes() AssetVariantVideoAttributes { + rv := objc.Call[AssetVariantVideoAttributes](a_, objc.Sel("videoAttributes")) + return rv +} diff --git a/macos/avfoundation/asset_variant_audio_attributes.gen.go b/macos/avfoundation/asset_variant_audio_attributes.gen.go new file mode 100644 index 00000000..5ba74771 --- /dev/null +++ b/macos/avfoundation/asset_variant_audio_attributes.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetVariantAudioAttributes] class. +var AssetVariantAudioAttributesClass = _AssetVariantAudioAttributesClass{objc.GetClass("AVAssetVariantAudioAttributes")} + +type _AssetVariantAudioAttributesClass struct { + objc.Class +} + +// An interface definition for the [AssetVariantAudioAttributes] class. +type IAssetVariantAudioAttributes interface { + objc.IObject + RenditionSpecificAttributesForMediaOption(mediaSelectionOption IMediaSelectionOption) AssetVariantAudioRenditionSpecificAttributes + FormatIDs() []foundation.Number +} + +// An object that defines the audio attributes for an asset variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantaudioattributes?language=objc +type AssetVariantAudioAttributes struct { + objc.Object +} + +func AssetVariantAudioAttributesFrom(ptr unsafe.Pointer) AssetVariantAudioAttributes { + return AssetVariantAudioAttributes{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetVariantAudioAttributesClass) Alloc() AssetVariantAudioAttributes { + rv := objc.Call[AssetVariantAudioAttributes](ac, objc.Sel("alloc")) + return rv +} + +func AssetVariantAudioAttributes_Alloc() AssetVariantAudioAttributes { + return AssetVariantAudioAttributesClass.Alloc() +} + +func (ac _AssetVariantAudioAttributesClass) New() AssetVariantAudioAttributes { + rv := objc.Call[AssetVariantAudioAttributes](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetVariantAudioAttributes() AssetVariantAudioAttributes { + return AssetVariantAudioAttributesClass.New() +} + +func (a_ AssetVariantAudioAttributes) Init() AssetVariantAudioAttributes { + rv := objc.Call[AssetVariantAudioAttributes](a_, objc.Sel("init")) + return rv +} + +// Returns specific attributes for the media option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantaudioattributes/3746549-renditionspecificattributesforme?language=objc +func (a_ AssetVariantAudioAttributes) RenditionSpecificAttributesForMediaOption(mediaSelectionOption IMediaSelectionOption) AssetVariantAudioRenditionSpecificAttributes { + rv := objc.Call[AssetVariantAudioRenditionSpecificAttributes](a_, objc.Sel("renditionSpecificAttributesForMediaOption:"), objc.Ptr(mediaSelectionOption)) + return rv +} + +// The audio formats of the renditions present in the variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantaudioattributes/3746548-formatids?language=objc +func (a_ AssetVariantAudioAttributes) FormatIDs() []foundation.Number { + rv := objc.Call[[]foundation.Number](a_, objc.Sel("formatIDs")) + return rv +} diff --git a/macos/avfoundation/asset_variant_audio_rendition_specific_attributes.gen.go b/macos/avfoundation/asset_variant_audio_rendition_specific_attributes.gen.go new file mode 100644 index 00000000..d998f023 --- /dev/null +++ b/macos/avfoundation/asset_variant_audio_rendition_specific_attributes.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetVariantAudioRenditionSpecificAttributes] class. +var AssetVariantAudioRenditionSpecificAttributesClass = _AssetVariantAudioRenditionSpecificAttributesClass{objc.GetClass("AVAssetVariantAudioRenditionSpecificAttributes")} + +type _AssetVariantAudioRenditionSpecificAttributesClass struct { + objc.Class +} + +// An interface definition for the [AssetVariantAudioRenditionSpecificAttributes] class. +type IAssetVariantAudioRenditionSpecificAttributes interface { + objc.IObject + ChannelCount() int +} + +// An object that represents attributes specific to a particular rendition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantaudiorenditionspecificattributes?language=objc +type AssetVariantAudioRenditionSpecificAttributes struct { + objc.Object +} + +func AssetVariantAudioRenditionSpecificAttributesFrom(ptr unsafe.Pointer) AssetVariantAudioRenditionSpecificAttributes { + return AssetVariantAudioRenditionSpecificAttributes{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetVariantAudioRenditionSpecificAttributesClass) Alloc() AssetVariantAudioRenditionSpecificAttributes { + rv := objc.Call[AssetVariantAudioRenditionSpecificAttributes](ac, objc.Sel("alloc")) + return rv +} + +func AssetVariantAudioRenditionSpecificAttributes_Alloc() AssetVariantAudioRenditionSpecificAttributes { + return AssetVariantAudioRenditionSpecificAttributesClass.Alloc() +} + +func (ac _AssetVariantAudioRenditionSpecificAttributesClass) New() AssetVariantAudioRenditionSpecificAttributes { + rv := objc.Call[AssetVariantAudioRenditionSpecificAttributes](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetVariantAudioRenditionSpecificAttributes() AssetVariantAudioRenditionSpecificAttributes { + return AssetVariantAudioRenditionSpecificAttributesClass.New() +} + +func (a_ AssetVariantAudioRenditionSpecificAttributes) Init() AssetVariantAudioRenditionSpecificAttributes { + rv := objc.Call[AssetVariantAudioRenditionSpecificAttributes](a_, objc.Sel("init")) + return rv +} + +// The count of audio channels in the rendition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantaudiorenditionspecificattributes/3746551-channelcount?language=objc +func (a_ AssetVariantAudioRenditionSpecificAttributes) ChannelCount() int { + rv := objc.Call[int](a_, objc.Sel("channelCount")) + return rv +} diff --git a/macos/avfoundation/asset_variant_qualifier.gen.go b/macos/avfoundation/asset_variant_qualifier.gen.go new file mode 100644 index 00000000..6b69fabd --- /dev/null +++ b/macos/avfoundation/asset_variant_qualifier.gen.go @@ -0,0 +1,128 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetVariantQualifier] class. +var AssetVariantQualifierClass = _AssetVariantQualifierClass{objc.GetClass("AVAssetVariantQualifier")} + +type _AssetVariantQualifierClass struct { + objc.Class +} + +// An interface definition for the [AssetVariantQualifier] class. +type IAssetVariantQualifier interface { + objc.IObject +} + +// An object that represents an HTTP Live Streaming asset variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier?language=objc +type AssetVariantQualifier struct { + objc.Object +} + +func AssetVariantQualifierFrom(ptr unsafe.Pointer) AssetVariantQualifier { + return AssetVariantQualifier{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetVariantQualifierClass) AssetVariantQualifierWithVariant(variant IAssetVariant) AssetVariantQualifier { + rv := objc.Call[AssetVariantQualifier](ac, objc.Sel("assetVariantQualifierWithVariant:"), objc.Ptr(variant)) + return rv +} + +// Creates a variant qualifier with an asset variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3750228-assetvariantqualifierwithvariant?language=objc +func AssetVariantQualifier_AssetVariantQualifierWithVariant(variant IAssetVariant) AssetVariantQualifier { + return AssetVariantQualifierClass.AssetVariantQualifierWithVariant(variant) +} + +func (ac _AssetVariantQualifierClass) AssetVariantQualifierWithPredicate(predicate foundation.IPredicate) AssetVariantQualifier { + rv := objc.Call[AssetVariantQualifier](ac, objc.Sel("assetVariantQualifierWithPredicate:"), objc.Ptr(predicate)) + return rv +} + +// Creates a variant qualifier with a predicate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3750227-assetvariantqualifierwithpredica?language=objc +func AssetVariantQualifier_AssetVariantQualifierWithPredicate(predicate foundation.IPredicate) AssetVariantQualifier { + return AssetVariantQualifierClass.AssetVariantQualifierWithPredicate(predicate) +} + +func (ac _AssetVariantQualifierClass) Alloc() AssetVariantQualifier { + rv := objc.Call[AssetVariantQualifier](ac, objc.Sel("alloc")) + return rv +} + +func AssetVariantQualifier_Alloc() AssetVariantQualifier { + return AssetVariantQualifierClass.Alloc() +} + +func (ac _AssetVariantQualifierClass) New() AssetVariantQualifier { + rv := objc.Call[AssetVariantQualifier](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetVariantQualifier() AssetVariantQualifier { + return AssetVariantQualifierClass.New() +} + +func (a_ AssetVariantQualifier) Init() AssetVariantQualifier { + rv := objc.Call[AssetVariantQualifier](a_, objc.Sel("init")) + return rv +} + +// Creates a predicate with a width and operator type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3857562-predicateforpresentationwidth?language=objc +func (ac _AssetVariantQualifierClass) PredicateForPresentationWidthOperatorType(width float64, operatorType foundation.PredicateOperatorType) foundation.Predicate { + rv := objc.Call[foundation.Predicate](ac, objc.Sel("predicateForPresentationWidth:operatorType:"), width, operatorType) + return rv +} + +// Creates a predicate with a width and operator type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3857562-predicateforpresentationwidth?language=objc +func AssetVariantQualifier_PredicateForPresentationWidthOperatorType(width float64, operatorType foundation.PredicateOperatorType) foundation.Predicate { + return AssetVariantQualifierClass.PredicateForPresentationWidthOperatorType(width, operatorType) +} + +// Creates a predicate with a channel count, media selection option, and operator type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3750230-predicateforchannelcount?language=objc +func (ac _AssetVariantQualifierClass) PredicateForChannelCountMediaSelectionOptionOperatorType(channelCount int, mediaSelectionOption IMediaSelectionOption, operatorType foundation.PredicateOperatorType) foundation.Predicate { + rv := objc.Call[foundation.Predicate](ac, objc.Sel("predicateForChannelCount:mediaSelectionOption:operatorType:"), channelCount, objc.Ptr(mediaSelectionOption), operatorType) + return rv +} + +// Creates a predicate with a channel count, media selection option, and operator type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3750230-predicateforchannelcount?language=objc +func AssetVariantQualifier_PredicateForChannelCountMediaSelectionOptionOperatorType(channelCount int, mediaSelectionOption IMediaSelectionOption, operatorType foundation.PredicateOperatorType) foundation.Predicate { + return AssetVariantQualifierClass.PredicateForChannelCountMediaSelectionOptionOperatorType(channelCount, mediaSelectionOption, operatorType) +} + +// Creates a predicate with a height and operator type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3857561-predicateforpresentationheight?language=objc +func (ac _AssetVariantQualifierClass) PredicateForPresentationHeightOperatorType(height float64, operatorType foundation.PredicateOperatorType) foundation.Predicate { + rv := objc.Call[foundation.Predicate](ac, objc.Sel("predicateForPresentationHeight:operatorType:"), height, operatorType) + return rv +} + +// Creates a predicate with a height and operator type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier/3857561-predicateforpresentationheight?language=objc +func AssetVariantQualifier_PredicateForPresentationHeightOperatorType(height float64, operatorType foundation.PredicateOperatorType) foundation.Predicate { + return AssetVariantQualifierClass.PredicateForPresentationHeightOperatorType(height, operatorType) +} diff --git a/macos/avfoundation/asset_variant_video_attributes.gen.go b/macos/avfoundation/asset_variant_video_attributes.gen.go new file mode 100644 index 00000000..f6fe324b --- /dev/null +++ b/macos/avfoundation/asset_variant_video_attributes.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetVariantVideoAttributes] class. +var AssetVariantVideoAttributesClass = _AssetVariantVideoAttributesClass{objc.GetClass("AVAssetVariantVideoAttributes")} + +type _AssetVariantVideoAttributesClass struct { + objc.Class +} + +// An interface definition for the [AssetVariantVideoAttributes] class. +type IAssetVariantVideoAttributes interface { + objc.IObject + VideoRange() VideoRange + CodecTypes() []foundation.Number + PresentationSize() coregraphics.Size + NominalFrameRate() float64 +} + +// An object that defines the video attributes for an asset variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantvideoattributes?language=objc +type AssetVariantVideoAttributes struct { + objc.Object +} + +func AssetVariantVideoAttributesFrom(ptr unsafe.Pointer) AssetVariantVideoAttributes { + return AssetVariantVideoAttributes{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetVariantVideoAttributesClass) Alloc() AssetVariantVideoAttributes { + rv := objc.Call[AssetVariantVideoAttributes](ac, objc.Sel("alloc")) + return rv +} + +func AssetVariantVideoAttributes_Alloc() AssetVariantVideoAttributes { + return AssetVariantVideoAttributesClass.Alloc() +} + +func (ac _AssetVariantVideoAttributesClass) New() AssetVariantVideoAttributes { + rv := objc.Call[AssetVariantVideoAttributes](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetVariantVideoAttributes() AssetVariantVideoAttributes { + return AssetVariantVideoAttributesClass.New() +} + +func (a_ AssetVariantVideoAttributes) Init() AssetVariantVideoAttributes { + rv := objc.Call[AssetVariantVideoAttributes](a_, objc.Sel("init")) + return rv +} + +// The video range of the variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantvideoattributes/3746556-videorange?language=objc +func (a_ AssetVariantVideoAttributes) VideoRange() VideoRange { + rv := objc.Call[VideoRange](a_, objc.Sel("videoRange")) + return rv +} + +// The video sample codec types present in the variant’s renditions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantvideoattributes/3746553-codectypes?language=objc +func (a_ AssetVariantVideoAttributes) CodecTypes() []foundation.Number { + rv := objc.Call[[]foundation.Number](a_, objc.Sel("codecTypes")) + return rv +} + +// The presentation size of the variant’s renditions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantvideoattributes/3746555-presentationsize?language=objc +func (a_ AssetVariantVideoAttributes) PresentationSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](a_, objc.Sel("presentationSize")) + return rv +} + +// The nominal frame rate of the variant’s renditions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetvariantvideoattributes/3746554-nominalframerate?language=objc +func (a_ AssetVariantVideoAttributes) NominalFrameRate() float64 { + rv := objc.Call[float64](a_, objc.Sel("nominalFrameRate")) + return rv +} diff --git a/macos/avfoundation/asset_writer.gen.go b/macos/avfoundation/asset_writer.gen.go new file mode 100644 index 00000000..7734c782 --- /dev/null +++ b/macos/avfoundation/asset_writer.gen.go @@ -0,0 +1,470 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/uti" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetWriter] class. +var AssetWriterClass = _AssetWriterClass{objc.GetClass("AVAssetWriter")} + +type _AssetWriterClass struct { + objc.Class +} + +// An interface definition for the [AssetWriter] class. +type IAssetWriter interface { + objc.IObject + AddInput(input IAssetWriterInput) + CanAddInput(input IAssetWriterInput) bool + StartSessionAtSourceTime(startTime coremedia.Time) + AddInputGroup(inputGroup IAssetWriterInputGroup) + CanAddInputGroup(inputGroup IAssetWriterInputGroup) bool + FlushSegment() + CancelWriting() + CanApplyOutputSettingsForMediaType(outputSettings map[string]objc.IObject, mediaType MediaType) bool + EndSessionAtSourceTime(endTime coremedia.Time) + StartWriting() bool + FinishWritingWithCompletionHandler(handler func()) + Error() foundation.Error + InitialMovieFragmentSequenceNumber() int + SetInitialMovieFragmentSequenceNumber(value int) + OutputFileTypeProfile() FileTypeProfile + SetOutputFileTypeProfile(value FileTypeProfile) + MovieFragmentInterval() coremedia.Time + SetMovieFragmentInterval(value coremedia.Time) + InputGroups() []AssetWriterInputGroup + Metadata() []MetadataItem + SetMetadata(value []IMetadataItem) + Delegate() AssetWriterDelegateWrapper + SetDelegate(value PAssetWriterDelegate) + SetDelegateObject(valueObject objc.IObject) + InitialSegmentStartTime() coremedia.Time + SetInitialSegmentStartTime(value coremedia.Time) + OutputFileType() FileType + Inputs() []AssetWriterInput + PreferredOutputSegmentInterval() coremedia.Time + SetPreferredOutputSegmentInterval(value coremedia.Time) + ShouldOptimizeForNetworkUse() bool + SetShouldOptimizeForNetworkUse(value bool) + AvailableMediaTypes() []MediaType + DirectoryForTemporaryFiles() foundation.URL + SetDirectoryForTemporaryFiles(value foundation.IURL) + OverallDurationHint() coremedia.Time + SetOverallDurationHint(value coremedia.Time) + ProducesCombinableFragments() bool + SetProducesCombinableFragments(value bool) + Status() AssetWriterStatus + OutputURL() foundation.URL + MovieTimeScale() coremedia.TimeScale + SetMovieTimeScale(value coremedia.TimeScale) +} + +// An object that writes media data to a container file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter?language=objc +type AssetWriter struct { + objc.Object +} + +func AssetWriterFrom(ptr unsafe.Pointer) AssetWriter { + return AssetWriter{ + Object: objc.ObjectFrom(ptr), + } +} + +func (a_ AssetWriter) InitWithURLFileTypeError(outputURL foundation.IURL, outputFileType FileType, outError foundation.IError) AssetWriter { + rv := objc.Call[AssetWriter](a_, objc.Sel("initWithURL:fileType:error:"), objc.Ptr(outputURL), outputFileType, objc.Ptr(outError)) + return rv +} + +// Creates an object that writes media data to a container file at the output URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1389201-initwithurl?language=objc +func NewAssetWriterWithURLFileTypeError(outputURL foundation.IURL, outputFileType FileType, outError foundation.IError) AssetWriter { + instance := AssetWriterClass.Alloc().InitWithURLFileTypeError(outputURL, outputFileType, outError) + instance.Autorelease() + return instance +} + +func (a_ AssetWriter) InitWithContentType(outputContentType uti.IType) AssetWriter { + rv := objc.Call[AssetWriter](a_, objc.Sel("initWithContentType:"), objc.Ptr(outputContentType)) + return rv +} + +// Creates an object that outputs segment data in a specified container format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3563935-initwithcontenttype?language=objc +func NewAssetWriterWithContentType(outputContentType uti.IType) AssetWriter { + instance := AssetWriterClass.Alloc().InitWithContentType(outputContentType) + instance.Autorelease() + return instance +} + +func (ac _AssetWriterClass) AssetWriterWithURLFileTypeError(outputURL foundation.IURL, outputFileType FileType, outError foundation.IError) AssetWriter { + rv := objc.Call[AssetWriter](ac, objc.Sel("assetWriterWithURL:fileType:error:"), objc.Ptr(outputURL), outputFileType, objc.Ptr(outError)) + return rv +} + +// Returns a new object that writes media data to a container file at the output URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1426663-assetwriterwithurl?language=objc +func AssetWriter_AssetWriterWithURLFileTypeError(outputURL foundation.IURL, outputFileType FileType, outError foundation.IError) AssetWriter { + return AssetWriterClass.AssetWriterWithURLFileTypeError(outputURL, outputFileType, outError) +} + +func (ac _AssetWriterClass) Alloc() AssetWriter { + rv := objc.Call[AssetWriter](ac, objc.Sel("alloc")) + return rv +} + +func AssetWriter_Alloc() AssetWriter { + return AssetWriterClass.Alloc() +} + +func (ac _AssetWriterClass) New() AssetWriter { + rv := objc.Call[AssetWriter](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetWriter() AssetWriter { + return AssetWriterClass.New() +} + +func (a_ AssetWriter) Init() AssetWriter { + rv := objc.Call[AssetWriter](a_, objc.Sel("init")) + return rv +} + +// Adds an input to an asset writer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1390389-addinput?language=objc +func (a_ AssetWriter) AddInput(input IAssetWriterInput) { + objc.Call[objc.Void](a_, objc.Sel("addInput:"), objc.Ptr(input)) +} + +// Determines whether the asset writer supports adding the input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387863-canaddinput?language=objc +func (a_ AssetWriter) CanAddInput(input IAssetWriterInput) bool { + rv := objc.Call[bool](a_, objc.Sel("canAddInput:"), objc.Ptr(input)) + return rv +} + +// Starts an asset-writing session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1389908-startsessionatsourcetime?language=objc +func (a_ AssetWriter) StartSessionAtSourceTime(startTime coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("startSessionAtSourceTime:"), startTime) +} + +// Adds an input group to an asset writer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1385643-addinputgroup?language=objc +func (a_ AssetWriter) AddInputGroup(inputGroup IAssetWriterInputGroup) { + objc.Call[objc.Void](a_, objc.Sel("addInputGroup:"), objc.Ptr(inputGroup)) +} + +// Determines whether the asset writer supports adding the input group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1386698-canaddinputgroup?language=objc +func (a_ AssetWriter) CanAddInputGroup(inputGroup IAssetWriterInputGroup) bool { + rv := objc.Call[bool](a_, objc.Sel("canAddInputGroup:"), objc.Ptr(inputGroup)) + return rv +} + +// Closes the current segment and outputs it to a delegate method. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546586-flushsegment?language=objc +func (a_ AssetWriter) FlushSegment() { + objc.Call[objc.Void](a_, objc.Sel("flushSegment")) +} + +// Cancels the creation of the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387234-cancelwriting?language=objc +func (a_ AssetWriter) CancelWriting() { + objc.Call[objc.Void](a_, objc.Sel("cancelWriting")) +} + +// Determines whether the output file format supports the output settings for a specific media type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1388842-canapplyoutputsettings?language=objc +func (a_ AssetWriter) CanApplyOutputSettingsForMediaType(outputSettings map[string]objc.IObject, mediaType MediaType) bool { + rv := objc.Call[bool](a_, objc.Sel("canApplyOutputSettings:forMediaType:"), outputSettings, mediaType) + return rv +} + +// Finishes an asset-writing session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1389921-endsessionatsourcetime?language=objc +func (a_ AssetWriter) EndSessionAtSourceTime(endTime coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("endSessionAtSourceTime:"), endTime) +} + +// Tells the writer to start writing its output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1386724-startwriting?language=objc +func (a_ AssetWriter) StartWriting() bool { + rv := objc.Call[bool](a_, objc.Sel("startWriting")) + return rv +} + +// Marks all unfinished inputs as finished and completes the writing of the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1390432-finishwritingwithcompletionhandl?language=objc +func (a_ AssetWriter) FinishWritingWithCompletionHandler(handler func()) { + objc.Call[objc.Void](a_, objc.Sel("finishWritingWithCompletionHandler:"), handler) +} + +// An error object that describes an asset-writing failure. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1390725-error?language=objc +func (a_ AssetWriter) Error() foundation.Error { + rv := objc.Call[foundation.Error](a_, objc.Sel("error")) + return rv +} + +// The sequence number of the initial movie fragment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3577532-initialmoviefragmentsequencenumb?language=objc +func (a_ AssetWriter) InitialMovieFragmentSequenceNumber() int { + rv := objc.Call[int](a_, objc.Sel("initialMovieFragmentSequenceNumber")) + return rv +} + +// The sequence number of the initial movie fragment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3577532-initialmoviefragmentsequencenumb?language=objc +func (a_ AssetWriter) SetInitialMovieFragmentSequenceNumber(value int) { + objc.Call[objc.Void](a_, objc.Sel("setInitialMovieFragmentSequenceNumber:"), value) +} + +// A profile for the output file type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546589-outputfiletypeprofile?language=objc +func (a_ AssetWriter) OutputFileTypeProfile() FileTypeProfile { + rv := objc.Call[FileTypeProfile](a_, objc.Sel("outputFileTypeProfile")) + return rv +} + +// A profile for the output file type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546589-outputfiletypeprofile?language=objc +func (a_ AssetWriter) SetOutputFileTypeProfile(value FileTypeProfile) { + objc.Call[objc.Void](a_, objc.Sel("setOutputFileTypeProfile:"), value) +} + +// The interval at which to write movie fragments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387469-moviefragmentinterval?language=objc +func (a_ AssetWriter) MovieFragmentInterval() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("movieFragmentInterval")) + return rv +} + +// The interval at which to write movie fragments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387469-moviefragmentinterval?language=objc +func (a_ AssetWriter) SetMovieFragmentInterval(value coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("setMovieFragmentInterval:"), value) +} + +// The input groups an asset writer contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1388432-inputgroups?language=objc +func (a_ AssetWriter) InputGroups() []AssetWriterInputGroup { + rv := objc.Call[[]AssetWriterInputGroup](a_, objc.Sel("inputGroups")) + return rv +} + +// An array of metadata items to write to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387974-metadata?language=objc +func (a_ AssetWriter) Metadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](a_, objc.Sel("metadata")) + return rv +} + +// An array of metadata items to write to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387974-metadata?language=objc +func (a_ AssetWriter) SetMetadata(value []IMetadataItem) { + objc.Call[objc.Void](a_, objc.Sel("setMetadata:"), value) +} + +// A delegate object that responds to asset-writing events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546585-delegate?language=objc +func (a_ AssetWriter) Delegate() AssetWriterDelegateWrapper { + rv := objc.Call[AssetWriterDelegateWrapper](a_, objc.Sel("delegate")) + return rv +} + +// A delegate object that responds to asset-writing events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546585-delegate?language=objc +func (a_ AssetWriter) SetDelegate(value PAssetWriterDelegate) { + po0 := objc.WrapAsProtocol("AVAssetWriterDelegate", value) + objc.SetAssociatedObject(a_, objc.AssociationKey("setDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](a_, objc.Sel("setDelegate:"), po0) +} + +// A delegate object that responds to asset-writing events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546585-delegate?language=objc +func (a_ AssetWriter) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](a_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// The start time of the initial segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546588-initialsegmentstarttime?language=objc +func (a_ AssetWriter) InitialSegmentStartTime() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("initialSegmentStartTime")) + return rv +} + +// The start time of the initial segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546588-initialsegmentstarttime?language=objc +func (a_ AssetWriter) SetInitialSegmentStartTime(value coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("setInitialSegmentStartTime:"), value) +} + +// The type of container file that the writer outputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387349-outputfiletype?language=objc +func (a_ AssetWriter) OutputFileType() FileType { + rv := objc.Call[FileType](a_, objc.Sel("outputFileType")) + return rv +} + +// The inputs an asset writer contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1388264-inputs?language=objc +func (a_ AssetWriter) Inputs() []AssetWriterInput { + rv := objc.Call[[]AssetWriterInput](a_, objc.Sel("inputs")) + return rv +} + +// The interval of output segments that you prefer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546590-preferredoutputsegmentinterval?language=objc +func (a_ AssetWriter) PreferredOutputSegmentInterval() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("preferredOutputSegmentInterval")) + return rv +} + +// The interval of output segments that you prefer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3546590-preferredoutputsegmentinterval?language=objc +func (a_ AssetWriter) SetPreferredOutputSegmentInterval(value coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("setPreferredOutputSegmentInterval:"), value) +} + +// A Boolean value that indicates whether to write the output file to make it more suitable for playback over a network. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1389811-shouldoptimizefornetworkuse?language=objc +func (a_ AssetWriter) ShouldOptimizeForNetworkUse() bool { + rv := objc.Call[bool](a_, objc.Sel("shouldOptimizeForNetworkUse")) + return rv +} + +// A Boolean value that indicates whether to write the output file to make it more suitable for playback over a network. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1389811-shouldoptimizefornetworkuse?language=objc +func (a_ AssetWriter) SetShouldOptimizeForNetworkUse(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setShouldOptimizeForNetworkUse:"), value) +} + +// The media types the asset writer supports adding as inputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1388730-availablemediatypes?language=objc +func (a_ AssetWriter) AvailableMediaTypes() []MediaType { + rv := objc.Call[[]MediaType](a_, objc.Sel("availableMediaTypes")) + return rv +} + +// A directory to contain temporary files that the export process generates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387445-directoryfortemporaryfiles?language=objc +func (a_ AssetWriter) DirectoryForTemporaryFiles() foundation.URL { + rv := objc.Call[foundation.URL](a_, objc.Sel("directoryForTemporaryFiles")) + return rv +} + +// A directory to contain temporary files that the export process generates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387445-directoryfortemporaryfiles?language=objc +func (a_ AssetWriter) SetDirectoryForTemporaryFiles(value foundation.IURL) { + objc.Call[objc.Void](a_, objc.Sel("setDirectoryForTemporaryFiles:"), objc.Ptr(value)) +} + +// A hint of the final duration of the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1388408-overalldurationhint?language=objc +func (a_ AssetWriter) OverallDurationHint() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("overallDurationHint")) + return rv +} + +// A hint of the final duration of the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1388408-overalldurationhint?language=objc +func (a_ AssetWriter) SetOverallDurationHint(value coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("setOverallDurationHint:"), value) +} + +// A Boolean value that indicates whether the asset writer outputs movie fragments suitable for combining with others. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3626025-producescombinablefragments?language=objc +func (a_ AssetWriter) ProducesCombinableFragments() bool { + rv := objc.Call[bool](a_, objc.Sel("producesCombinableFragments")) + return rv +} + +// A Boolean value that indicates whether the asset writer outputs movie fragments suitable for combining with others. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/3626025-producescombinablefragments?language=objc +func (a_ AssetWriter) SetProducesCombinableFragments(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setProducesCombinableFragments:"), value) +} + +// The status of writing samples to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1389335-status?language=objc +func (a_ AssetWriter) Status() AssetWriterStatus { + rv := objc.Call[AssetWriterStatus](a_, objc.Sel("status")) + return rv +} + +// The location of the container file that the writer outputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1387731-outputurl?language=objc +func (a_ AssetWriter) OutputURL() foundation.URL { + rv := objc.Call[foundation.URL](a_, objc.Sel("outputURL")) + return rv +} + +// The time scale of the movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1386762-movietimescale?language=objc +func (a_ AssetWriter) MovieTimeScale() coremedia.TimeScale { + rv := objc.Call[coremedia.TimeScale](a_, objc.Sel("movieTimeScale")) + return rv +} + +// The time scale of the movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriter/1386762-movietimescale?language=objc +func (a_ AssetWriter) SetMovieTimeScale(value coremedia.TimeScale) { + objc.Call[objc.Void](a_, objc.Sel("setMovieTimeScale:"), value) +} diff --git a/macos/avfoundation/asset_writer_delegate.gen.go b/macos/avfoundation/asset_writer_delegate.gen.go new file mode 100644 index 00000000..0efc027a --- /dev/null +++ b/macos/avfoundation/asset_writer_delegate.gen.go @@ -0,0 +1,55 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A delegate protocol that defines the methods to implement to respond to asset-writing events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterdelegate?language=objc +type PAssetWriterDelegate interface { + // optional + AssetWriterDidOutputSegmentDataSegmentType(writer AssetWriter, segmentData []byte, segmentType AssetSegmentType) + HasAssetWriterDidOutputSegmentDataSegmentType() bool +} + +// A delegate implementation builder for the [PAssetWriterDelegate] protocol. +type AssetWriterDelegate struct { + _AssetWriterDidOutputSegmentDataSegmentType func(writer AssetWriter, segmentData []byte, segmentType AssetSegmentType) +} + +func (di *AssetWriterDelegate) HasAssetWriterDidOutputSegmentDataSegmentType() bool { + return di._AssetWriterDidOutputSegmentDataSegmentType != nil +} + +// Tells the delegate that the asset writer output segment data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterdelegate/3546592-assetwriter?language=objc +func (di *AssetWriterDelegate) SetAssetWriterDidOutputSegmentDataSegmentType(f func(writer AssetWriter, segmentData []byte, segmentType AssetSegmentType)) { + di._AssetWriterDidOutputSegmentDataSegmentType = f +} + +// Tells the delegate that the asset writer output segment data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterdelegate/3546592-assetwriter?language=objc +func (di *AssetWriterDelegate) AssetWriterDidOutputSegmentDataSegmentType(writer AssetWriter, segmentData []byte, segmentType AssetSegmentType) { + di._AssetWriterDidOutputSegmentDataSegmentType(writer, segmentData, segmentType) +} + +// A concrete type wrapper for the [PAssetWriterDelegate] protocol. +type AssetWriterDelegateWrapper struct { + objc.Object +} + +func (a_ AssetWriterDelegateWrapper) HasAssetWriterDidOutputSegmentDataSegmentType() bool { + return a_.RespondsToSelector(objc.Sel("assetWriter:didOutputSegmentData:segmentType:")) +} + +// Tells the delegate that the asset writer output segment data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterdelegate/3546592-assetwriter?language=objc +func (a_ AssetWriterDelegateWrapper) AssetWriterDidOutputSegmentDataSegmentType(writer IAssetWriter, segmentData []byte, segmentType AssetSegmentType) { + objc.Call[objc.Void](a_, objc.Sel("assetWriter:didOutputSegmentData:segmentType:"), objc.Ptr(writer), segmentData, segmentType) +} diff --git a/macos/avfoundation/asset_writer_input.gen.go b/macos/avfoundation/asset_writer_input.gen.go new file mode 100644 index 00000000..21cee419 --- /dev/null +++ b/macos/avfoundation/asset_writer_input.gen.go @@ -0,0 +1,438 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetWriterInput] class. +var AssetWriterInputClass = _AssetWriterInputClass{objc.GetClass("AVAssetWriterInput")} + +type _AssetWriterInputClass struct { + objc.Class +} + +// An interface definition for the [AssetWriterInput] class. +type IAssetWriterInput interface { + objc.IObject + AddTrackAssociationWithTrackOfInputType(input IAssetWriterInput, trackAssociationType string) + MarkCurrentPassAsFinished() + RespondToEachPassDescriptionOnQueueUsingBlock(queue dispatch.Queue, block func()) + RequestMediaDataWhenReadyOnQueueUsingBlock(queue dispatch.Queue, block func()) + AppendSampleBuffer(sampleBuffer coremedia.SampleBufferRef) bool + CanAddTrackAssociationWithTrackOfInputType(input IAssetWriterInput, trackAssociationType string) bool + MarkAsFinished() + CurrentPassDescription() AssetWriterInputPassDescription + IsReadyForMoreMediaData() bool + ExtendedLanguageTag() string + SetExtendedLanguageTag(value string) + PerformsMultiPassEncodingIfSupported() bool + SetPerformsMultiPassEncodingIfSupported(value bool) + OutputSettings() map[string]objc.Object + PreferredMediaChunkAlignment() int + SetPreferredMediaChunkAlignment(value int) + PreferredVolume() float64 + SetPreferredVolume(value float64) + Metadata() []MetadataItem + SetMetadata(value []IMetadataItem) + ExpectsMediaDataInRealTime() bool + SetExpectsMediaDataInRealTime(value bool) + MediaType() MediaType + SampleReferenceBaseURL() foundation.URL + SetSampleReferenceBaseURL(value foundation.IURL) + MarksOutputTrackAsEnabled() bool + SetMarksOutputTrackAsEnabled(value bool) + NaturalSize() coregraphics.Size + SetNaturalSize(value coregraphics.Size) + CanPerformMultiplePasses() bool + MediaTimeScale() coremedia.TimeScale + SetMediaTimeScale(value coremedia.TimeScale) + PreferredMediaChunkDuration() coremedia.Time + SetPreferredMediaChunkDuration(value coremedia.Time) + Transform() coregraphics.AffineTransform + SetTransform(value coregraphics.AffineTransform) + LanguageCode() string + SetLanguageCode(value string) + SourceFormatHint() coremedia.FormatDescriptionRef + MediaDataLocation() AssetWriterInputMediaDataLocation + SetMediaDataLocation(value AssetWriterInputMediaDataLocation) +} + +// An object that appends media samples to a track in an asset writer’s output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput?language=objc +type AssetWriterInput struct { + objc.Object +} + +func AssetWriterInputFrom(ptr unsafe.Pointer) AssetWriterInput { + return AssetWriterInput{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetWriterInputClass) AssetWriterInputWithMediaTypeOutputSettingsSourceFormatHint(mediaType MediaType, outputSettings map[string]objc.IObject, sourceFormatHint coremedia.FormatDescriptionRef) AssetWriterInput { + rv := objc.Call[AssetWriterInput](ac, objc.Sel("assetWriterInputWithMediaType:outputSettings:sourceFormatHint:"), mediaType, outputSettings, sourceFormatHint) + return rv +} + +// Returns a new input that appends sample buffers of the specified type and format hint to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1449091-assetwriterinputwithmediatype?language=objc +func AssetWriterInput_AssetWriterInputWithMediaTypeOutputSettingsSourceFormatHint(mediaType MediaType, outputSettings map[string]objc.IObject, sourceFormatHint coremedia.FormatDescriptionRef) AssetWriterInput { + return AssetWriterInputClass.AssetWriterInputWithMediaTypeOutputSettingsSourceFormatHint(mediaType, outputSettings, sourceFormatHint) +} + +func (a_ AssetWriterInput) InitWithMediaTypeOutputSettingsSourceFormatHint(mediaType MediaType, outputSettings map[string]objc.IObject, sourceFormatHint coremedia.FormatDescriptionRef) AssetWriterInput { + rv := objc.Call[AssetWriterInput](a_, objc.Sel("initWithMediaType:outputSettings:sourceFormatHint:"), mediaType, outputSettings, sourceFormatHint) + return rv +} + +// Creates an input that appends sample buffers of the specified type and format hint to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1389994-initwithmediatype?language=objc +func NewAssetWriterInputWithMediaTypeOutputSettingsSourceFormatHint(mediaType MediaType, outputSettings map[string]objc.IObject, sourceFormatHint coremedia.FormatDescriptionRef) AssetWriterInput { + instance := AssetWriterInputClass.Alloc().InitWithMediaTypeOutputSettingsSourceFormatHint(mediaType, outputSettings, sourceFormatHint) + instance.Autorelease() + return instance +} + +func (ac _AssetWriterInputClass) Alloc() AssetWriterInput { + rv := objc.Call[AssetWriterInput](ac, objc.Sel("alloc")) + return rv +} + +func AssetWriterInput_Alloc() AssetWriterInput { + return AssetWriterInputClass.Alloc() +} + +func (ac _AssetWriterInputClass) New() AssetWriterInput { + rv := objc.Call[AssetWriterInput](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetWriterInput() AssetWriterInput { + return AssetWriterInputClass.New() +} + +func (a_ AssetWriterInput) Init() AssetWriterInput { + rv := objc.Call[AssetWriterInput](a_, objc.Sel("init")) + return rv +} + +// Adds an association between input tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388347-addtrackassociationwithtrackofin?language=objc +func (a_ AssetWriterInput) AddTrackAssociationWithTrackOfInputType(input IAssetWriterInput, trackAssociationType string) { + objc.Call[objc.Void](a_, objc.Sel("addTrackAssociationWithTrackOfInput:type:"), objc.Ptr(input), trackAssociationType) +} + +// Tells the input to analyze the appended media to determine whether it can improve the results by reencoding certain segments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1389652-markcurrentpassasfinished?language=objc +func (a_ AssetWriterInput) MarkCurrentPassAsFinished() { + objc.Call[objc.Void](a_, objc.Sel("markCurrentPassAsFinished")) +} + +// Tells the input to invoke a callback whenever it begins a new pass. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388489-respondtoeachpassdescriptiononqu?language=objc +func (a_ AssetWriterInput) RespondToEachPassDescriptionOnQueueUsingBlock(queue dispatch.Queue, block func()) { + objc.Call[objc.Void](a_, objc.Sel("respondToEachPassDescriptionOnQueue:usingBlock:"), queue, block) +} + +// Tells the input to request media data, at its convenience, to write to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1387508-requestmediadatawhenreadyonqueue?language=objc +func (a_ AssetWriterInput) RequestMediaDataWhenReadyOnQueueUsingBlock(queue dispatch.Queue, block func()) { + objc.Call[objc.Void](a_, objc.Sel("requestMediaDataWhenReadyOnQueue:usingBlock:"), queue, block) +} + +// Appends a sample buffer to an input to write to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1389566-appendsamplebuffer?language=objc +func (a_ AssetWriterInput) AppendSampleBuffer(sampleBuffer coremedia.SampleBufferRef) bool { + rv := objc.Call[bool](a_, objc.Sel("appendSampleBuffer:"), sampleBuffer) + return rv +} + +// Determines whether it’s valid to associate another input’s track with this input’s track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388292-canaddtrackassociationwithtracko?language=objc +func (a_ AssetWriterInput) CanAddTrackAssociationWithTrackOfInputType(input IAssetWriterInput, trackAssociationType string) bool { + rv := objc.Call[bool](a_, objc.Sel("canAddTrackAssociationWithTrackOfInput:type:"), objc.Ptr(input), trackAssociationType) + return rv +} + +// Marks the input as finished to indicate that you’re done appending samples to it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390122-markasfinished?language=objc +func (a_ AssetWriterInput) MarkAsFinished() { + objc.Call[objc.Void](a_, objc.Sel("markAsFinished")) +} + +// An object that describes the requirements for the current pass. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390627-currentpassdescription?language=objc +func (a_ AssetWriterInput) CurrentPassDescription() AssetWriterInputPassDescription { + rv := objc.Call[AssetWriterInputPassDescription](a_, objc.Sel("currentPassDescription")) + return rv +} + +// A Boolean value that indicates whether the input is ready to accept media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1389084-readyformoremediadata?language=objc +func (a_ AssetWriterInput) IsReadyForMoreMediaData() bool { + rv := objc.Call[bool](a_, objc.Sel("isReadyForMoreMediaData")) + return rv +} + +// The extended language for the input’s track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390768-extendedlanguagetag?language=objc +func (a_ AssetWriterInput) ExtendedLanguageTag() string { + rv := objc.Call[string](a_, objc.Sel("extendedLanguageTag")) + return rv +} + +// The extended language for the input’s track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390768-extendedlanguagetag?language=objc +func (a_ AssetWriterInput) SetExtendedLanguageTag(value string) { + objc.Call[objc.Void](a_, objc.Sel("setExtendedLanguageTag:"), value) +} + +// A Boolean value that indicates whether the input attempts to encode the source media data using multiple passes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386570-performsmultipassencodingifsuppo?language=objc +func (a_ AssetWriterInput) PerformsMultiPassEncodingIfSupported() bool { + rv := objc.Call[bool](a_, objc.Sel("performsMultiPassEncodingIfSupported")) + return rv +} + +// A Boolean value that indicates whether the input attempts to encode the source media data using multiple passes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386570-performsmultipassencodingifsuppo?language=objc +func (a_ AssetWriterInput) SetPerformsMultiPassEncodingIfSupported(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setPerformsMultiPassEncodingIfSupported:"), value) +} + +// The settings to use for encoding media data you append to the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388406-outputsettings?language=objc +func (a_ AssetWriterInput) OutputSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](a_, objc.Sel("outputSettings")) + return rv +} + +// The boundary, in bytes, for aligning media chunks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388163-preferredmediachunkalignment?language=objc +func (a_ AssetWriterInput) PreferredMediaChunkAlignment() int { + rv := objc.Call[int](a_, objc.Sel("preferredMediaChunkAlignment")) + return rv +} + +// The boundary, in bytes, for aligning media chunks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388163-preferredmediachunkalignment?language=objc +func (a_ AssetWriterInput) SetPreferredMediaChunkAlignment(value int) { + objc.Call[objc.Void](a_, objc.Sel("setPreferredMediaChunkAlignment:"), value) +} + +// The volume to prefer for playback of the output’s audio data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1389949-preferredvolume?language=objc +func (a_ AssetWriterInput) PreferredVolume() float64 { + rv := objc.Call[float64](a_, objc.Sel("preferredVolume")) + return rv +} + +// The volume to prefer for playback of the output’s audio data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1389949-preferredvolume?language=objc +func (a_ AssetWriterInput) SetPreferredVolume(value float64) { + objc.Call[objc.Void](a_, objc.Sel("setPreferredVolume:"), value) +} + +// The track-level metadata to write to the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386328-metadata?language=objc +func (a_ AssetWriterInput) Metadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](a_, objc.Sel("metadata")) + return rv +} + +// The track-level metadata to write to the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386328-metadata?language=objc +func (a_ AssetWriterInput) SetMetadata(value []IMetadataItem) { + objc.Call[objc.Void](a_, objc.Sel("setMetadata:"), value) +} + +// A Boolean value that indicates whether the input tailors its processing for real-time sources. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1387827-expectsmediadatainrealtime?language=objc +func (a_ AssetWriterInput) ExpectsMediaDataInRealTime() bool { + rv := objc.Call[bool](a_, objc.Sel("expectsMediaDataInRealTime")) + return rv +} + +// A Boolean value that indicates whether the input tailors its processing for real-time sources. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1387827-expectsmediadatainrealtime?language=objc +func (a_ AssetWriterInput) SetExpectsMediaDataInRealTime(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setExpectsMediaDataInRealTime:"), value) +} + +// The media type of the samples that the input accepts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1385565-mediatype?language=objc +func (a_ AssetWriterInput) MediaType() MediaType { + rv := objc.Call[MediaType](a_, objc.Sel("mediaType")) + return rv +} + +// The base URL sample references are relative to. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386316-samplereferencebaseurl?language=objc +func (a_ AssetWriterInput) SampleReferenceBaseURL() foundation.URL { + rv := objc.Call[foundation.URL](a_, objc.Sel("sampleReferenceBaseURL")) + return rv +} + +// The base URL sample references are relative to. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386316-samplereferencebaseurl?language=objc +func (a_ AssetWriterInput) SetSampleReferenceBaseURL(value foundation.IURL) { + objc.Call[objc.Void](a_, objc.Sel("setSampleReferenceBaseURL:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether to enable a track in the output for playback and processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386764-marksoutputtrackasenabled?language=objc +func (a_ AssetWriterInput) MarksOutputTrackAsEnabled() bool { + rv := objc.Call[bool](a_, objc.Sel("marksOutputTrackAsEnabled")) + return rv +} + +// A Boolean value that indicates whether to enable a track in the output for playback and processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386764-marksoutputtrackasenabled?language=objc +func (a_ AssetWriterInput) SetMarksOutputTrackAsEnabled(value bool) { + objc.Call[objc.Void](a_, objc.Sel("setMarksOutputTrackAsEnabled:"), value) +} + +// The natural display dimensions of the output’s visual media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1387437-naturalsize?language=objc +func (a_ AssetWriterInput) NaturalSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](a_, objc.Sel("naturalSize")) + return rv +} + +// The natural display dimensions of the output’s visual media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1387437-naturalsize?language=objc +func (a_ AssetWriterInput) SetNaturalSize(value coregraphics.Size) { + objc.Call[objc.Void](a_, objc.Sel("setNaturalSize:"), value) +} + +// A Boolean value that indicates whether the input may perform multiple passes over appended media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388284-canperformmultiplepasses?language=objc +func (a_ AssetWriterInput) CanPerformMultiplePasses() bool { + rv := objc.Call[bool](a_, objc.Sel("canPerformMultiplePasses")) + return rv +} + +// The time scale of the track in the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386902-mediatimescale?language=objc +func (a_ AssetWriterInput) MediaTimeScale() coremedia.TimeScale { + rv := objc.Call[coremedia.TimeScale](a_, objc.Sel("mediaTimeScale")) + return rv +} + +// The time scale of the track in the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1386902-mediatimescale?language=objc +func (a_ AssetWriterInput) SetMediaTimeScale(value coremedia.TimeScale) { + objc.Call[objc.Void](a_, objc.Sel("setMediaTimeScale:"), value) +} + +// The duration to use for each chunk of sample data in the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390463-preferredmediachunkduration?language=objc +func (a_ AssetWriterInput) PreferredMediaChunkDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("preferredMediaChunkDuration")) + return rv +} + +// The duration to use for each chunk of sample data in the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390463-preferredmediachunkduration?language=objc +func (a_ AssetWriterInput) SetPreferredMediaChunkDuration(value coremedia.Time) { + objc.Call[objc.Void](a_, objc.Sel("setPreferredMediaChunkDuration:"), value) +} + +// The transform to use for display of the output’s visual media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390183-transform?language=objc +func (a_ AssetWriterInput) Transform() coregraphics.AffineTransform { + rv := objc.Call[coregraphics.AffineTransform](a_, objc.Sel("transform")) + return rv +} + +// The transform to use for display of the output’s visual media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390183-transform?language=objc +func (a_ AssetWriterInput) SetTransform(value coregraphics.AffineTransform) { + objc.Call[objc.Void](a_, objc.Sel("setTransform:"), value) +} + +// The language code of the input’s track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388507-languagecode?language=objc +func (a_ AssetWriterInput) LanguageCode() string { + rv := objc.Call[string](a_, objc.Sel("languageCode")) + return rv +} + +// The language code of the input’s track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1388507-languagecode?language=objc +func (a_ AssetWriterInput) SetLanguageCode(value string) { + objc.Call[objc.Void](a_, objc.Sel("setLanguageCode:"), value) +} + +// A hint about the format of the sample buffers to append to the input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1387647-sourceformathint?language=objc +func (a_ AssetWriterInput) SourceFormatHint() coremedia.FormatDescriptionRef { + rv := objc.Call[coremedia.FormatDescriptionRef](a_, objc.Sel("sourceFormatHint")) + return rv +} + +// Specifies how the input lays out and interleaves media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/2867633-mediadatalocation?language=objc +func (a_ AssetWriterInput) MediaDataLocation() AssetWriterInputMediaDataLocation { + rv := objc.Call[AssetWriterInputMediaDataLocation](a_, objc.Sel("mediaDataLocation")) + return rv +} + +// Specifies how the input lays out and interleaves media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/2867633-mediadatalocation?language=objc +func (a_ AssetWriterInput) SetMediaDataLocation(value AssetWriterInputMediaDataLocation) { + objc.Call[objc.Void](a_, objc.Sel("setMediaDataLocation:"), value) +} diff --git a/macos/avfoundation/asset_writer_input_caption_adaptor.gen.go b/macos/avfoundation/asset_writer_input_caption_adaptor.gen.go new file mode 100644 index 00000000..c4c84a6a --- /dev/null +++ b/macos/avfoundation/asset_writer_input_caption_adaptor.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetWriterInputCaptionAdaptor] class. +var AssetWriterInputCaptionAdaptorClass = _AssetWriterInputCaptionAdaptorClass{objc.GetClass("AVAssetWriterInputCaptionAdaptor")} + +type _AssetWriterInputCaptionAdaptorClass struct { + objc.Class +} + +// An interface definition for the [AssetWriterInputCaptionAdaptor] class. +type IAssetWriterInputCaptionAdaptor interface { + objc.IObject + AppendCaptionGroup(captionGroup ICaptionGroup) bool + AppendCaption(caption ICaption) bool + AssetWriterInput() AssetWriterInput +} + +// An object that appends captions to an asset writer input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputcaptionadaptor?language=objc +type AssetWriterInputCaptionAdaptor struct { + objc.Object +} + +func AssetWriterInputCaptionAdaptorFrom(ptr unsafe.Pointer) AssetWriterInputCaptionAdaptor { + return AssetWriterInputCaptionAdaptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (a_ AssetWriterInputCaptionAdaptor) InitWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputCaptionAdaptor { + rv := objc.Call[AssetWriterInputCaptionAdaptor](a_, objc.Sel("initWithAssetWriterInput:"), objc.Ptr(input)) + return rv +} + +// Creates a new caption adaptor that writes to the specified asset writer input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputcaptionadaptor/3752805-initwithassetwriterinput?language=objc +func NewAssetWriterInputCaptionAdaptorWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputCaptionAdaptor { + instance := AssetWriterInputCaptionAdaptorClass.Alloc().InitWithAssetWriterInput(input) + instance.Autorelease() + return instance +} + +func (ac _AssetWriterInputCaptionAdaptorClass) AssetWriterInputCaptionAdaptorWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputCaptionAdaptor { + rv := objc.Call[AssetWriterInputCaptionAdaptor](ac, objc.Sel("assetWriterInputCaptionAdaptorWithAssetWriterInput:"), objc.Ptr(input)) + return rv +} + +// A class method that creates a new caption adaptor that writes to the specified asset writer input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputcaptionadaptor/3752804-assetwriterinputcaptionadaptorwi?language=objc +func AssetWriterInputCaptionAdaptor_AssetWriterInputCaptionAdaptorWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputCaptionAdaptor { + return AssetWriterInputCaptionAdaptorClass.AssetWriterInputCaptionAdaptorWithAssetWriterInput(input) +} + +func (ac _AssetWriterInputCaptionAdaptorClass) Alloc() AssetWriterInputCaptionAdaptor { + rv := objc.Call[AssetWriterInputCaptionAdaptor](ac, objc.Sel("alloc")) + return rv +} + +func AssetWriterInputCaptionAdaptor_Alloc() AssetWriterInputCaptionAdaptor { + return AssetWriterInputCaptionAdaptorClass.Alloc() +} + +func (ac _AssetWriterInputCaptionAdaptorClass) New() AssetWriterInputCaptionAdaptor { + rv := objc.Call[AssetWriterInputCaptionAdaptor](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetWriterInputCaptionAdaptor() AssetWriterInputCaptionAdaptor { + return AssetWriterInputCaptionAdaptorClass.New() +} + +func (a_ AssetWriterInputCaptionAdaptor) Init() AssetWriterInputCaptionAdaptor { + rv := objc.Call[AssetWriterInputCaptionAdaptor](a_, objc.Sel("init")) + return rv +} + +// Appends a caption group that the system writes to the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputcaptionadaptor/3752802-appendcaptiongroup?language=objc +func (a_ AssetWriterInputCaptionAdaptor) AppendCaptionGroup(captionGroup ICaptionGroup) bool { + rv := objc.Call[bool](a_, objc.Sel("appendCaptionGroup:"), objc.Ptr(captionGroup)) + return rv +} + +// Appends a caption to the writer input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputcaptionadaptor/3752801-appendcaption?language=objc +func (a_ AssetWriterInputCaptionAdaptor) AppendCaption(caption ICaption) bool { + rv := objc.Call[bool](a_, objc.Sel("appendCaption:"), objc.Ptr(caption)) + return rv +} + +// The associated asset writer input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputcaptionadaptor/3752803-assetwriterinput?language=objc +func (a_ AssetWriterInputCaptionAdaptor) AssetWriterInput() AssetWriterInput { + rv := objc.Call[AssetWriterInput](a_, objc.Sel("assetWriterInput")) + return rv +} diff --git a/macos/avfoundation/asset_writer_input_group.gen.go b/macos/avfoundation/asset_writer_input_group.gen.go new file mode 100644 index 00000000..cf0badbb --- /dev/null +++ b/macos/avfoundation/asset_writer_input_group.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetWriterInputGroup] class. +var AssetWriterInputGroupClass = _AssetWriterInputGroupClass{objc.GetClass("AVAssetWriterInputGroup")} + +type _AssetWriterInputGroupClass struct { + objc.Class +} + +// An interface definition for the [AssetWriterInputGroup] class. +type IAssetWriterInputGroup interface { + IMediaSelectionGroup + DefaultInput() AssetWriterInput + Inputs() []AssetWriterInput +} + +// A group of inputs with tracks that are mutually exclusive to each other for playback or processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputgroup?language=objc +type AssetWriterInputGroup struct { + MediaSelectionGroup +} + +func AssetWriterInputGroupFrom(ptr unsafe.Pointer) AssetWriterInputGroup { + return AssetWriterInputGroup{ + MediaSelectionGroup: MediaSelectionGroupFrom(ptr), + } +} + +func (a_ AssetWriterInputGroup) InitWithInputsDefaultInput(inputs []IAssetWriterInput, defaultInput IAssetWriterInput) AssetWriterInputGroup { + rv := objc.Call[AssetWriterInputGroup](a_, objc.Sel("initWithInputs:defaultInput:"), inputs, objc.Ptr(defaultInput)) + return rv +} + +// Creates a group for the asset writer inputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputgroup/1389502-initwithinputs?language=objc +func NewAssetWriterInputGroupWithInputsDefaultInput(inputs []IAssetWriterInput, defaultInput IAssetWriterInput) AssetWriterInputGroup { + instance := AssetWriterInputGroupClass.Alloc().InitWithInputsDefaultInput(inputs, defaultInput) + instance.Autorelease() + return instance +} + +func (ac _AssetWriterInputGroupClass) AssetWriterInputGroupWithInputsDefaultInput(inputs []IAssetWriterInput, defaultInput IAssetWriterInput) AssetWriterInputGroup { + rv := objc.Call[AssetWriterInputGroup](ac, objc.Sel("assetWriterInputGroupWithInputs:defaultInput:"), inputs, objc.Ptr(defaultInput)) + return rv +} + +// Returns a new group for the asset writer inputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputgroup/1426655-assetwriterinputgroupwithinputs?language=objc +func AssetWriterInputGroup_AssetWriterInputGroupWithInputsDefaultInput(inputs []IAssetWriterInput, defaultInput IAssetWriterInput) AssetWriterInputGroup { + return AssetWriterInputGroupClass.AssetWriterInputGroupWithInputsDefaultInput(inputs, defaultInput) +} + +func (ac _AssetWriterInputGroupClass) Alloc() AssetWriterInputGroup { + rv := objc.Call[AssetWriterInputGroup](ac, objc.Sel("alloc")) + return rv +} + +func AssetWriterInputGroup_Alloc() AssetWriterInputGroup { + return AssetWriterInputGroupClass.Alloc() +} + +func (ac _AssetWriterInputGroupClass) New() AssetWriterInputGroup { + rv := objc.Call[AssetWriterInputGroup](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetWriterInputGroup() AssetWriterInputGroup { + return AssetWriterInputGroupClass.New() +} + +func (a_ AssetWriterInputGroup) Init() AssetWriterInputGroup { + rv := objc.Call[AssetWriterInputGroup](a_, objc.Sel("init")) + return rv +} + +// The default input for the group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputgroup/1389698-defaultinput?language=objc +func (a_ AssetWriterInputGroup) DefaultInput() AssetWriterInput { + rv := objc.Call[AssetWriterInput](a_, objc.Sel("defaultInput")) + return rv +} + +// The inputs with tracks that are mutually exclusive to each other for playback or processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputgroup/1388226-inputs?language=objc +func (a_ AssetWriterInputGroup) Inputs() []AssetWriterInput { + rv := objc.Call[[]AssetWriterInput](a_, objc.Sel("inputs")) + return rv +} diff --git a/macos/avfoundation/asset_writer_input_metadata_adaptor.gen.go b/macos/avfoundation/asset_writer_input_metadata_adaptor.gen.go new file mode 100644 index 00000000..bf261ca7 --- /dev/null +++ b/macos/avfoundation/asset_writer_input_metadata_adaptor.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetWriterInputMetadataAdaptor] class. +var AssetWriterInputMetadataAdaptorClass = _AssetWriterInputMetadataAdaptorClass{objc.GetClass("AVAssetWriterInputMetadataAdaptor")} + +type _AssetWriterInputMetadataAdaptorClass struct { + objc.Class +} + +// An interface definition for the [AssetWriterInputMetadataAdaptor] class. +type IAssetWriterInputMetadataAdaptor interface { + objc.IObject + AppendTimedMetadataGroup(timedMetadataGroup ITimedMetadataGroup) bool + AssetWriterInput() AssetWriterInput +} + +// An object that appends timed metadata groups to an asset writer input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputmetadataadaptor?language=objc +type AssetWriterInputMetadataAdaptor struct { + objc.Object +} + +func AssetWriterInputMetadataAdaptorFrom(ptr unsafe.Pointer) AssetWriterInputMetadataAdaptor { + return AssetWriterInputMetadataAdaptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (a_ AssetWriterInputMetadataAdaptor) InitWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputMetadataAdaptor { + rv := objc.Call[AssetWriterInputMetadataAdaptor](a_, objc.Sel("initWithAssetWriterInput:"), objc.Ptr(input)) + return rv +} + +// Creates a metadata group adaptor to append timed metadata groups to write to an output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputmetadataadaptor/1389706-initwithassetwriterinput?language=objc +func NewAssetWriterInputMetadataAdaptorWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputMetadataAdaptor { + instance := AssetWriterInputMetadataAdaptorClass.Alloc().InitWithAssetWriterInput(input) + instance.Autorelease() + return instance +} + +func (ac _AssetWriterInputMetadataAdaptorClass) AssetWriterInputMetadataAdaptorWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputMetadataAdaptor { + rv := objc.Call[AssetWriterInputMetadataAdaptor](ac, objc.Sel("assetWriterInputMetadataAdaptorWithAssetWriterInput:"), objc.Ptr(input)) + return rv +} + +// Returns a new metadata adaptor to append timed metadata groups to write to an output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputmetadataadaptor/1449094-assetwriterinputmetadataadaptorw?language=objc +func AssetWriterInputMetadataAdaptor_AssetWriterInputMetadataAdaptorWithAssetWriterInput(input IAssetWriterInput) AssetWriterInputMetadataAdaptor { + return AssetWriterInputMetadataAdaptorClass.AssetWriterInputMetadataAdaptorWithAssetWriterInput(input) +} + +func (ac _AssetWriterInputMetadataAdaptorClass) Alloc() AssetWriterInputMetadataAdaptor { + rv := objc.Call[AssetWriterInputMetadataAdaptor](ac, objc.Sel("alloc")) + return rv +} + +func AssetWriterInputMetadataAdaptor_Alloc() AssetWriterInputMetadataAdaptor { + return AssetWriterInputMetadataAdaptorClass.Alloc() +} + +func (ac _AssetWriterInputMetadataAdaptorClass) New() AssetWriterInputMetadataAdaptor { + rv := objc.Call[AssetWriterInputMetadataAdaptor](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetWriterInputMetadataAdaptor() AssetWriterInputMetadataAdaptor { + return AssetWriterInputMetadataAdaptorClass.New() +} + +func (a_ AssetWriterInputMetadataAdaptor) Init() AssetWriterInputMetadataAdaptor { + rv := objc.Call[AssetWriterInputMetadataAdaptor](a_, objc.Sel("init")) + return rv +} + +// Appends a timed metadata group to the adaptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputmetadataadaptor/1389014-appendtimedmetadatagroup?language=objc +func (a_ AssetWriterInputMetadataAdaptor) AppendTimedMetadataGroup(timedMetadataGroup ITimedMetadataGroup) bool { + rv := objc.Call[bool](a_, objc.Sel("appendTimedMetadataGroup:"), objc.Ptr(timedMetadataGroup)) + return rv +} + +// The input for the metadata adaptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputmetadataadaptor/1386633-assetwriterinput?language=objc +func (a_ AssetWriterInputMetadataAdaptor) AssetWriterInput() AssetWriterInput { + rv := objc.Call[AssetWriterInput](a_, objc.Sel("assetWriterInput")) + return rv +} diff --git a/macos/avfoundation/asset_writer_input_pass_description.gen.go b/macos/avfoundation/asset_writer_input_pass_description.gen.go new file mode 100644 index 00000000..ed4ce1ec --- /dev/null +++ b/macos/avfoundation/asset_writer_input_pass_description.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetWriterInputPassDescription] class. +var AssetWriterInputPassDescriptionClass = _AssetWriterInputPassDescriptionClass{objc.GetClass("AVAssetWriterInputPassDescription")} + +type _AssetWriterInputPassDescriptionClass struct { + objc.Class +} + +// An interface definition for the [AssetWriterInputPassDescription] class. +type IAssetWriterInputPassDescription interface { + objc.IObject + SourceTimeRanges() []foundation.Value +} + +// An object that defines the interface to query for the requirements of the current pass. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpassdescription?language=objc +type AssetWriterInputPassDescription struct { + objc.Object +} + +func AssetWriterInputPassDescriptionFrom(ptr unsafe.Pointer) AssetWriterInputPassDescription { + return AssetWriterInputPassDescription{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetWriterInputPassDescriptionClass) Alloc() AssetWriterInputPassDescription { + rv := objc.Call[AssetWriterInputPassDescription](ac, objc.Sel("alloc")) + return rv +} + +func AssetWriterInputPassDescription_Alloc() AssetWriterInputPassDescription { + return AssetWriterInputPassDescriptionClass.Alloc() +} + +func (ac _AssetWriterInputPassDescriptionClass) New() AssetWriterInputPassDescription { + rv := objc.Call[AssetWriterInputPassDescription](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetWriterInputPassDescription() AssetWriterInputPassDescription { + return AssetWriterInputPassDescriptionClass.New() +} + +func (a_ AssetWriterInputPassDescription) Init() AssetWriterInputPassDescription { + rv := objc.Call[AssetWriterInputPassDescription](a_, objc.Sel("init")) + return rv +} + +// An array of time ranges. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpassdescription/1388732-sourcetimeranges?language=objc +func (a_ AssetWriterInputPassDescription) SourceTimeRanges() []foundation.Value { + rv := objc.Call[[]foundation.Value](a_, objc.Sel("sourceTimeRanges")) + return rv +} diff --git a/macos/avfoundation/asset_writer_input_pixel_buffer_adaptor.gen.go b/macos/avfoundation/asset_writer_input_pixel_buffer_adaptor.gen.go new file mode 100644 index 00000000..513ef9e1 --- /dev/null +++ b/macos/avfoundation/asset_writer_input_pixel_buffer_adaptor.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AssetWriterInputPixelBufferAdaptor] class. +var AssetWriterInputPixelBufferAdaptorClass = _AssetWriterInputPixelBufferAdaptorClass{objc.GetClass("AVAssetWriterInputPixelBufferAdaptor")} + +type _AssetWriterInputPixelBufferAdaptorClass struct { + objc.Class +} + +// An interface definition for the [AssetWriterInputPixelBufferAdaptor] class. +type IAssetWriterInputPixelBufferAdaptor interface { + objc.IObject + AppendPixelBufferWithPresentationTime(pixelBuffer corevideo.PixelBufferRef, presentationTime coremedia.Time) bool + AssetWriterInput() AssetWriterInput + SourcePixelBufferAttributes() map[string]objc.Object + PixelBufferPool() corevideo.PixelBufferPoolRef +} + +// An object that appends video samples to an asset writer input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor?language=objc +type AssetWriterInputPixelBufferAdaptor struct { + objc.Object +} + +func AssetWriterInputPixelBufferAdaptorFrom(ptr unsafe.Pointer) AssetWriterInputPixelBufferAdaptor { + return AssetWriterInputPixelBufferAdaptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AssetWriterInputPixelBufferAdaptorClass) AssetWriterInputPixelBufferAdaptorWithAssetWriterInputSourcePixelBufferAttributes(input IAssetWriterInput, sourcePixelBufferAttributes map[string]objc.IObject) AssetWriterInputPixelBufferAdaptor { + rv := objc.Call[AssetWriterInputPixelBufferAdaptor](ac, objc.Sel("assetWriterInputPixelBufferAdaptorWithAssetWriterInput:sourcePixelBufferAttributes:"), objc.Ptr(input), sourcePixelBufferAttributes) + return rv +} + +// Returns a new pixel buffer adaptor that appends pixel buffers to write to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor/1449096-assetwriterinputpixelbufferadapt?language=objc +func AssetWriterInputPixelBufferAdaptor_AssetWriterInputPixelBufferAdaptorWithAssetWriterInputSourcePixelBufferAttributes(input IAssetWriterInput, sourcePixelBufferAttributes map[string]objc.IObject) AssetWriterInputPixelBufferAdaptor { + return AssetWriterInputPixelBufferAdaptorClass.AssetWriterInputPixelBufferAdaptorWithAssetWriterInputSourcePixelBufferAttributes(input, sourcePixelBufferAttributes) +} + +func (a_ AssetWriterInputPixelBufferAdaptor) InitWithAssetWriterInputSourcePixelBufferAttributes(input IAssetWriterInput, sourcePixelBufferAttributes map[string]objc.IObject) AssetWriterInputPixelBufferAdaptor { + rv := objc.Call[AssetWriterInputPixelBufferAdaptor](a_, objc.Sel("initWithAssetWriterInput:sourcePixelBufferAttributes:"), objc.Ptr(input), sourcePixelBufferAttributes) + return rv +} + +// Creates a new pixel buffer adaptor to receive pixel buffers for writing to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor/1390639-initwithassetwriterinput?language=objc +func NewAssetWriterInputPixelBufferAdaptorWithAssetWriterInputSourcePixelBufferAttributes(input IAssetWriterInput, sourcePixelBufferAttributes map[string]objc.IObject) AssetWriterInputPixelBufferAdaptor { + instance := AssetWriterInputPixelBufferAdaptorClass.Alloc().InitWithAssetWriterInputSourcePixelBufferAttributes(input, sourcePixelBufferAttributes) + instance.Autorelease() + return instance +} + +func (ac _AssetWriterInputPixelBufferAdaptorClass) Alloc() AssetWriterInputPixelBufferAdaptor { + rv := objc.Call[AssetWriterInputPixelBufferAdaptor](ac, objc.Sel("alloc")) + return rv +} + +func AssetWriterInputPixelBufferAdaptor_Alloc() AssetWriterInputPixelBufferAdaptor { + return AssetWriterInputPixelBufferAdaptorClass.Alloc() +} + +func (ac _AssetWriterInputPixelBufferAdaptorClass) New() AssetWriterInputPixelBufferAdaptor { + rv := objc.Call[AssetWriterInputPixelBufferAdaptor](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAssetWriterInputPixelBufferAdaptor() AssetWriterInputPixelBufferAdaptor { + return AssetWriterInputPixelBufferAdaptorClass.New() +} + +func (a_ AssetWriterInputPixelBufferAdaptor) Init() AssetWriterInputPixelBufferAdaptor { + rv := objc.Call[AssetWriterInputPixelBufferAdaptor](a_, objc.Sel("init")) + return rv +} + +// Appends a pixel buffer to the adaptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor/1388102-appendpixelbuffer?language=objc +func (a_ AssetWriterInputPixelBufferAdaptor) AppendPixelBufferWithPresentationTime(pixelBuffer corevideo.PixelBufferRef, presentationTime coremedia.Time) bool { + rv := objc.Call[bool](a_, objc.Sel("appendPixelBuffer:withPresentationTime:"), pixelBuffer, presentationTime) + return rv +} + +// The asset writer input to which the adaptor appends pixel buffers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor/1387565-assetwriterinput?language=objc +func (a_ AssetWriterInputPixelBufferAdaptor) AssetWriterInput() AssetWriterInput { + rv := objc.Call[AssetWriterInput](a_, objc.Sel("assetWriterInput")) + return rv +} + +// The attributes of the pixel buffers that the pool contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor/1387829-sourcepixelbufferattributes?language=objc +func (a_ AssetWriterInputPixelBufferAdaptor) SourcePixelBufferAttributes() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](a_, objc.Sel("sourcePixelBufferAttributes")) + return rv +} + +// A pool of pixel buffers to append to the adaptor’s input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputpixelbufferadaptor/1389662-pixelbufferpool?language=objc +func (a_ AssetWriterInputPixelBufferAdaptor) PixelBufferPool() corevideo.PixelBufferPoolRef { + rv := objc.Call[corevideo.PixelBufferPoolRef](a_, objc.Sel("pixelBufferPool")) + return rv +} diff --git a/macos/avfoundation/asynchronous_ci_image_filtering_request.gen.go b/macos/avfoundation/asynchronous_ci_image_filtering_request.gen.go new file mode 100644 index 00000000..ff76f5fa --- /dev/null +++ b/macos/avfoundation/asynchronous_ci_image_filtering_request.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AsynchronousCIImageFilteringRequest] class. +var AsynchronousCIImageFilteringRequestClass = _AsynchronousCIImageFilteringRequestClass{objc.GetClass("AVAsynchronousCIImageFilteringRequest")} + +type _AsynchronousCIImageFilteringRequestClass struct { + objc.Class +} + +// An interface definition for the [AsynchronousCIImageFilteringRequest] class. +type IAsynchronousCIImageFilteringRequest interface { + objc.IObject + FinishWithImageContext(filteredImage coreimage.IImage, context coreimage.IContext) + FinishWithError(error foundation.IError) + RenderSize() coregraphics.Size + CompositionTime() coremedia.Time + SourceImage() coreimage.Image +} + +// An object that supprts using Core Image filters to process an individual video frame in a video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousciimagefilteringrequest?language=objc +type AsynchronousCIImageFilteringRequest struct { + objc.Object +} + +func AsynchronousCIImageFilteringRequestFrom(ptr unsafe.Pointer) AsynchronousCIImageFilteringRequest { + return AsynchronousCIImageFilteringRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AsynchronousCIImageFilteringRequestClass) Alloc() AsynchronousCIImageFilteringRequest { + rv := objc.Call[AsynchronousCIImageFilteringRequest](ac, objc.Sel("alloc")) + return rv +} + +func AsynchronousCIImageFilteringRequest_Alloc() AsynchronousCIImageFilteringRequest { + return AsynchronousCIImageFilteringRequestClass.Alloc() +} + +func (ac _AsynchronousCIImageFilteringRequestClass) New() AsynchronousCIImageFilteringRequest { + rv := objc.Call[AsynchronousCIImageFilteringRequest](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAsynchronousCIImageFilteringRequest() AsynchronousCIImageFilteringRequest { + return AsynchronousCIImageFilteringRequestClass.New() +} + +func (a_ AsynchronousCIImageFilteringRequest) Init() AsynchronousCIImageFilteringRequest { + rv := objc.Call[AsynchronousCIImageFilteringRequest](a_, objc.Sel("init")) + return rv +} + +// Provides the filtered video frame image to AVFoundation for further processing or display. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousciimagefilteringrequest/1389124-finishwithimage?language=objc +func (a_ AsynchronousCIImageFilteringRequest) FinishWithImageContext(filteredImage coreimage.IImage, context coreimage.IContext) { + objc.Call[objc.Void](a_, objc.Sel("finishWithImage:context:"), objc.Ptr(filteredImage), objc.Ptr(context)) +} + +// Notifies AVFoundation that you cannot fulfill the image filtering request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousciimagefilteringrequest/1386608-finishwitherror?language=objc +func (a_ AsynchronousCIImageFilteringRequest) FinishWithError(error foundation.IError) { + objc.Call[objc.Void](a_, objc.Sel("finishWithError:"), objc.Ptr(error)) +} + +// The width and height, in pixels, of the frame being processed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousciimagefilteringrequest/1387933-rendersize?language=objc +func (a_ AsynchronousCIImageFilteringRequest) RenderSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](a_, objc.Sel("renderSize")) + return rv +} + +// The time in the video composition corresponding to the frame being processed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousciimagefilteringrequest/1388240-compositiontime?language=objc +func (a_ AsynchronousCIImageFilteringRequest) CompositionTime() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("compositionTime")) + return rv +} + +// The current video frame image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousciimagefilteringrequest/1387577-sourceimage?language=objc +func (a_ AsynchronousCIImageFilteringRequest) SourceImage() coreimage.Image { + rv := objc.Call[coreimage.Image](a_, objc.Sel("sourceImage")) + return rv +} diff --git a/macos/avfoundation/asynchronous_key_value_loading.gen.go b/macos/avfoundation/asynchronous_key_value_loading.gen.go new file mode 100644 index 00000000..02d60408 --- /dev/null +++ b/macos/avfoundation/asynchronous_key_value_loading.gen.go @@ -0,0 +1,49 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the interface to load media data asynchronously. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronouskeyvalueloading?language=objc +type PAsynchronousKeyValueLoading interface { + // optional + StatusOfValueForKeyError(key string, outError foundation.Error) KeyValueStatus + HasStatusOfValueForKeyError() bool + + // optional + LoadValuesAsynchronouslyForKeysCompletionHandler(keys []string, handler func()) + HasLoadValuesAsynchronouslyForKeysCompletionHandler() bool +} + +// A concrete type wrapper for the [PAsynchronousKeyValueLoading] protocol. +type AsynchronousKeyValueLoadingWrapper struct { + objc.Object +} + +func (a_ AsynchronousKeyValueLoadingWrapper) HasStatusOfValueForKeyError() bool { + return a_.RespondsToSelector(objc.Sel("statusOfValueForKey:error:")) +} + +// Returns a status that indicates whether a property value is immediately available without blocking the calling thread. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronouskeyvalueloading/1386816-statusofvalueforkey?language=objc +func (a_ AsynchronousKeyValueLoadingWrapper) StatusOfValueForKeyError(key string, outError foundation.IError) KeyValueStatus { + rv := objc.Call[KeyValueStatus](a_, objc.Sel("statusOfValueForKey:error:"), key, objc.Ptr(outError)) + return rv +} + +func (a_ AsynchronousKeyValueLoadingWrapper) HasLoadValuesAsynchronouslyForKeysCompletionHandler() bool { + return a_.RespondsToSelector(objc.Sel("loadValuesAsynchronouslyForKeys:completionHandler:")) +} + +// Tells the asset to load the values of all of the specified keys that aren’t already loaded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronouskeyvalueloading/1387321-loadvaluesasynchronouslyforkeys?language=objc +func (a_ AsynchronousKeyValueLoadingWrapper) LoadValuesAsynchronouslyForKeysCompletionHandler(keys []string, handler func()) { + objc.Call[objc.Void](a_, objc.Sel("loadValuesAsynchronouslyForKeys:completionHandler:"), keys, handler) +} diff --git a/macos/avfoundation/asynchronous_video_composition_request.gen.go b/macos/avfoundation/asynchronous_video_composition_request.gen.go new file mode 100644 index 00000000..bbfdc52e --- /dev/null +++ b/macos/avfoundation/asynchronous_video_composition_request.gen.go @@ -0,0 +1,157 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AsynchronousVideoCompositionRequest] class. +var AsynchronousVideoCompositionRequestClass = _AsynchronousVideoCompositionRequestClass{objc.GetClass("AVAsynchronousVideoCompositionRequest")} + +type _AsynchronousVideoCompositionRequestClass struct { + objc.Class +} + +// An interface definition for the [AsynchronousVideoCompositionRequest] class. +type IAsynchronousVideoCompositionRequest interface { + objc.IObject + SourceFrameByTrackID(trackID objc.IObject) corevideo.PixelBufferRef + FinishWithComposedVideoFrame(composedVideoFrame corevideo.PixelBufferRef) + SourceTimedMetadataByTrackID(trackID objc.IObject) TimedMetadataGroup + SourceSampleBufferByTrackID(trackID objc.IObject) coremedia.SampleBufferRef + FinishWithError(error foundation.IError) + FinishCancelledRequest() + VideoCompositionInstruction() objc.Object + SourceSampleDataTrackIDs() []foundation.Number + SourceTrackIDs() []foundation.Number + CompositionTime() coremedia.Time + RenderContext() VideoCompositionRenderContext +} + +// An object that contains information a video compositor needs to render an output pixel buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest?language=objc +type AsynchronousVideoCompositionRequest struct { + objc.Object +} + +func AsynchronousVideoCompositionRequestFrom(ptr unsafe.Pointer) AsynchronousVideoCompositionRequest { + return AsynchronousVideoCompositionRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AsynchronousVideoCompositionRequestClass) Alloc() AsynchronousVideoCompositionRequest { + rv := objc.Call[AsynchronousVideoCompositionRequest](ac, objc.Sel("alloc")) + return rv +} + +func AsynchronousVideoCompositionRequest_Alloc() AsynchronousVideoCompositionRequest { + return AsynchronousVideoCompositionRequestClass.Alloc() +} + +func (ac _AsynchronousVideoCompositionRequestClass) New() AsynchronousVideoCompositionRequest { + rv := objc.Call[AsynchronousVideoCompositionRequest](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAsynchronousVideoCompositionRequest() AsynchronousVideoCompositionRequest { + return AsynchronousVideoCompositionRequestClass.New() +} + +func (a_ AsynchronousVideoCompositionRequest) Init() AsynchronousVideoCompositionRequest { + rv := objc.Call[AsynchronousVideoCompositionRequest](a_, objc.Sel("init")) + return rv +} + +// Returns a source pixel buffer for the track that contains the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1390379-sourceframebytrackid?language=objc +func (a_ AsynchronousVideoCompositionRequest) SourceFrameByTrackID(trackID objc.IObject) corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](a_, objc.Sel("sourceFrameByTrackID:"), objc.Ptr(trackID)) + return rv +} + +// Finishes the request to compose the frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1387450-finishwithcomposedvideoframe?language=objc +func (a_ AsynchronousVideoCompositionRequest) FinishWithComposedVideoFrame(composedVideoFrame corevideo.PixelBufferRef) { + objc.Call[objc.Void](a_, objc.Sel("finishWithComposedVideoFrame:"), composedVideoFrame) +} + +// Returns a source timed metadata group for the track that contains the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/3750313-sourcetimedmetadatabytrackid?language=objc +func (a_ AsynchronousVideoCompositionRequest) SourceTimedMetadataByTrackID(trackID objc.IObject) TimedMetadataGroup { + rv := objc.Call[TimedMetadataGroup](a_, objc.Sel("sourceTimedMetadataByTrackID:"), objc.Ptr(trackID)) + return rv +} + +// Returns a source sample buffer for the track that contains the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/3750311-sourcesamplebufferbytrackid?language=objc +func (a_ AsynchronousVideoCompositionRequest) SourceSampleBufferByTrackID(trackID objc.IObject) coremedia.SampleBufferRef { + rv := objc.Call[coremedia.SampleBufferRef](a_, objc.Sel("sourceSampleBufferByTrackID:"), objc.Ptr(trackID)) + return rv +} + +// Finishes the request with an error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1390797-finishwitherror?language=objc +func (a_ AsynchronousVideoCompositionRequest) FinishWithError(error foundation.IError) { + objc.Call[objc.Void](a_, objc.Sel("finishWithError:"), objc.Ptr(error)) +} + +// Cancels the request to compose a video frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1386261-finishcancelledrequest?language=objc +func (a_ AsynchronousVideoCompositionRequest) FinishCancelledRequest() { + objc.Call[objc.Void](a_, objc.Sel("finishCancelledRequest")) +} + +// A video composition instruction that indicates how to compose the frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1386672-videocompositioninstruction?language=objc +func (a_ AsynchronousVideoCompositionRequest) VideoCompositionInstruction() objc.Object { + rv := objc.Call[objc.Object](a_, objc.Sel("videoCompositionInstruction")) + return rv +} + +// The identifiers of tracks that contain source metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/3750312-sourcesampledatatrackids?language=objc +func (a_ AsynchronousVideoCompositionRequest) SourceSampleDataTrackIDs() []foundation.Number { + rv := objc.Call[[]foundation.Number](a_, objc.Sel("sourceSampleDataTrackIDs")) + return rv +} + +// The identifiers of tracks that contain source video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1388898-sourcetrackids?language=objc +func (a_ AsynchronousVideoCompositionRequest) SourceTrackIDs() []foundation.Number { + rv := objc.Call[[]foundation.Number](a_, objc.Sel("sourceTrackIDs")) + return rv +} + +// A time for which to compose the frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1386888-compositiontime?language=objc +func (a_ AsynchronousVideoCompositionRequest) CompositionTime() coremedia.Time { + rv := objc.Call[coremedia.Time](a_, objc.Sel("compositionTime")) + return rv +} + +// The rendering context of the video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasynchronousvideocompositionrequest/1389112-rendercontext?language=objc +func (a_ AsynchronousVideoCompositionRequest) RenderContext() VideoCompositionRenderContext { + rv := objc.Call[VideoCompositionRenderContext](a_, objc.Sel("renderContext")) + return rv +} diff --git a/macos/avfoundation/audio_mix.gen.go b/macos/avfoundation/audio_mix.gen.go new file mode 100644 index 00000000..ca06745e --- /dev/null +++ b/macos/avfoundation/audio_mix.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AudioMix] class. +var AudioMixClass = _AudioMixClass{objc.GetClass("AVAudioMix")} + +type _AudioMixClass struct { + objc.Class +} + +// An interface definition for the [AudioMix] class. +type IAudioMix interface { + objc.IObject + InputParameters() []AudioMixInputParameters +} + +// An object that manages the input parameters for mixing audio tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiomix?language=objc +type AudioMix struct { + objc.Object +} + +func AudioMixFrom(ptr unsafe.Pointer) AudioMix { + return AudioMix{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AudioMixClass) Alloc() AudioMix { + rv := objc.Call[AudioMix](ac, objc.Sel("alloc")) + return rv +} + +func AudioMix_Alloc() AudioMix { + return AudioMixClass.Alloc() +} + +func (ac _AudioMixClass) New() AudioMix { + rv := objc.Call[AudioMix](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAudioMix() AudioMix { + return AudioMixClass.New() +} + +func (a_ AudioMix) Init() AudioMix { + rv := objc.Call[AudioMix](a_, objc.Sel("init")) + return rv +} + +// An array of input parameters for the mix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiomix/1388791-inputparameters?language=objc +func (a_ AudioMix) InputParameters() []AudioMixInputParameters { + rv := objc.Call[[]AudioMixInputParameters](a_, objc.Sel("inputParameters")) + return rv +} diff --git a/macos/avfoundation/audio_mix_input_parameters.gen.go b/macos/avfoundation/audio_mix_input_parameters.gen.go new file mode 100644 index 00000000..6cbfa6c1 --- /dev/null +++ b/macos/avfoundation/audio_mix_input_parameters.gen.go @@ -0,0 +1,95 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AudioMixInputParameters] class. +var AudioMixInputParametersClass = _AudioMixInputParametersClass{objc.GetClass("AVAudioMixInputParameters")} + +type _AudioMixInputParametersClass struct { + objc.Class +} + +// An interface definition for the [AudioMixInputParameters] class. +type IAudioMixInputParameters interface { + objc.IObject + GetVolumeRampForTimeStartVolumeEndVolumeTimeRange(time coremedia.Time, startVolume *float64, endVolume *float64, timeRange *coremedia.TimeRange) bool + AudioTimePitchAlgorithm() AudioTimePitchAlgorithm + TrackID() objc.Object + AudioTapProcessor() objc.Object +} + +// An object that represents the parameters that you apply when adding an audio track to a mix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiomixinputparameters?language=objc +type AudioMixInputParameters struct { + objc.Object +} + +func AudioMixInputParametersFrom(ptr unsafe.Pointer) AudioMixInputParameters { + return AudioMixInputParameters{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AudioMixInputParametersClass) Alloc() AudioMixInputParameters { + rv := objc.Call[AudioMixInputParameters](ac, objc.Sel("alloc")) + return rv +} + +func AudioMixInputParameters_Alloc() AudioMixInputParameters { + return AudioMixInputParametersClass.Alloc() +} + +func (ac _AudioMixInputParametersClass) New() AudioMixInputParameters { + rv := objc.Call[AudioMixInputParameters](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAudioMixInputParameters() AudioMixInputParameters { + return AudioMixInputParametersClass.New() +} + +func (a_ AudioMixInputParameters) Init() AudioMixInputParameters { + rv := objc.Call[AudioMixInputParameters](a_, objc.Sel("init")) + return rv +} + +// Retrieves the volume ramp that includes the specified time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiomixinputparameters/1389578-getvolumerampfortime?language=objc +func (a_ AudioMixInputParameters) GetVolumeRampForTimeStartVolumeEndVolumeTimeRange(time coremedia.Time, startVolume *float64, endVolume *float64, timeRange *coremedia.TimeRange) bool { + rv := objc.Call[bool](a_, objc.Sel("getVolumeRampForTime:startVolume:endVolume:timeRange:"), time, startVolume, endVolume, timeRange) + return rv +} + +// The processing algorithm used to manage audio pitch for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiomixinputparameters/1387042-audiotimepitchalgorithm?language=objc +func (a_ AudioMixInputParameters) AudioTimePitchAlgorithm() AudioTimePitchAlgorithm { + rv := objc.Call[AudioTimePitchAlgorithm](a_, objc.Sel("audioTimePitchAlgorithm")) + return rv +} + +// The identifier of the audio track to which the parameters should be applied. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiomixinputparameters/1387471-trackid?language=objc +func (a_ AudioMixInputParameters) TrackID() objc.Object { + rv := objc.Call[objc.Object](a_, objc.Sel("trackID")) + return rv +} + +// The audio processing tap associated with the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiomixinputparameters/1388578-audiotapprocessor?language=objc +func (a_ AudioMixInputParameters) AudioTapProcessor() objc.Object { + rv := objc.Call[objc.Object](a_, objc.Sel("audioTapProcessor")) + return rv +} diff --git a/macos/avfoundation/avfoundation_structs.go b/macos/avfoundation/avfoundation_structs.go new file mode 100644 index 00000000..97323a5b --- /dev/null +++ b/macos/avfoundation/avfoundation_structs.go @@ -0,0 +1,12 @@ +package avfoundation + +// TODO: +type CaptionPoint struct{} +type CaptionSize struct{} +type SampleCursorStorageRange struct{} +type SampleCursorSyncInfo struct{} +type SampleCursorChunkInfo struct{} +type SampleCursorDependencyInfo struct{} +type SampleCursorAudioDependencyInfo struct{} +type PixelAspectRatio struct{} +type EdgeWidths struct{} diff --git a/macos/avfoundation/camera_calibration_data.gen.go b/macos/avfoundation/camera_calibration_data.gen.go new file mode 100644 index 00000000..052c748d --- /dev/null +++ b/macos/avfoundation/camera_calibration_data.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/kernel" + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CameraCalibrationData] class. +var CameraCalibrationDataClass = _CameraCalibrationDataClass{objc.GetClass("AVCameraCalibrationData")} + +type _CameraCalibrationDataClass struct { + objc.Class +} + +// An interface definition for the [CameraCalibrationData] class. +type ICameraCalibrationData interface { + objc.IObject + LensDistortionCenter() coregraphics.Point + InverseLensDistortionLookupTable() []byte + LensDistortionLookupTable() []byte + IntrinsicMatrixReferenceDimensions() coregraphics.Size + IntrinsicMatrix() kernel.Matrix_float3x3 + ExtrinsicMatrix() kernel.Matrix_float4x3 + PixelSize() float64 +} + +// Information about the camera characteristics used to capture images and depth data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata?language=objc +type CameraCalibrationData struct { + objc.Object +} + +func CameraCalibrationDataFrom(ptr unsafe.Pointer) CameraCalibrationData { + return CameraCalibrationData{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CameraCalibrationDataClass) Alloc() CameraCalibrationData { + rv := objc.Call[CameraCalibrationData](cc, objc.Sel("alloc")) + return rv +} + +func CameraCalibrationData_Alloc() CameraCalibrationData { + return CameraCalibrationDataClass.Alloc() +} + +func (cc _CameraCalibrationDataClass) New() CameraCalibrationData { + rv := objc.Call[CameraCalibrationData](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCameraCalibrationData() CameraCalibrationData { + return CameraCalibrationDataClass.New() +} + +func (c_ CameraCalibrationData) Init() CameraCalibrationData { + rv := objc.Call[CameraCalibrationData](c_, objc.Sel("init")) + return rv +} + +// The offset of the distortion center of the camera lens from the top-left corner of the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881131-lensdistortioncenter?language=objc +func (c_ CameraCalibrationData) LensDistortionCenter() coregraphics.Point { + rv := objc.Call[coregraphics.Point](c_, objc.Sel("lensDistortionCenter")) + return rv +} + +// A map of floating-point values describing radial distortions for use in reapplying camera geometry to a rectified image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881132-inverselensdistortionlookuptable?language=objc +func (c_ CameraCalibrationData) InverseLensDistortionLookupTable() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("inverseLensDistortionLookupTable")) + return rv +} + +// A map of floating-point values describing radial distortions imparted by the camera lens, for use in rectifying camera images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881129-lensdistortionlookuptable?language=objc +func (c_ CameraCalibrationData) LensDistortionLookupTable() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("lensDistortionLookupTable")) + return rv +} + +// The image dimensions to which the camera’s intrinsic matrix values are relative. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881134-intrinsicmatrixreferencedimensio?language=objc +func (c_ CameraCalibrationData) IntrinsicMatrixReferenceDimensions() coregraphics.Size { + rv := objc.Call[coregraphics.Size](c_, objc.Sel("intrinsicMatrixReferenceDimensions")) + return rv +} + +// A matrix that relates a camera’s internal properties to an ideal pinhole-camera model. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881135-intrinsicmatrix?language=objc +func (c_ CameraCalibrationData) IntrinsicMatrix() kernel.Matrix_float3x3 { + rv := objc.Call[kernel.Matrix_float3x3](c_, objc.Sel("intrinsicMatrix")) + return rv +} + +// A matrix relating a camera’s position and orientation to a world or scene coordinate system. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881130-extrinsicmatrix?language=objc +func (c_ CameraCalibrationData) ExtrinsicMatrix() kernel.Matrix_float4x3 { + rv := objc.Call[kernel.Matrix_float4x3](c_, objc.Sel("extrinsicMatrix")) + return rv +} + +// The size, in millimeters, of one image pixel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881128-pixelsize?language=objc +func (c_ CameraCalibrationData) PixelSize() float64 { + rv := objc.Call[float64](c_, objc.Sel("pixelSize")) + return rv +} diff --git a/macos/avfoundation/caption.gen.go b/macos/avfoundation/caption.gen.go new file mode 100644 index 00000000..c616edb0 --- /dev/null +++ b/macos/avfoundation/caption.gen.go @@ -0,0 +1,183 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Caption] class. +var CaptionClass = _CaptionClass{objc.GetClass("AVCaption")} + +type _CaptionClass struct { + objc.Class +} + +// An interface definition for the [Caption] class. +type ICaption interface { + objc.IObject + DecorationAtIndexRange(index int, outRange *foundation.Range) CaptionDecoration + TextCombineAtIndexRange(index int, outRange *foundation.Range) CaptionTextCombine + TextColorAtIndexRange(index int, outRange *foundation.Range) coregraphics.ColorRef + FontWeightAtIndexRange(index int, outRange *foundation.Range) CaptionFontWeight + FontStyleAtIndexRange(index int, outRange *foundation.Range) CaptionFontStyle + RubyAtIndexRange(index int, outRange *foundation.Range) CaptionRuby + BackgroundColorAtIndexRange(index int, outRange *foundation.Range) coregraphics.ColorRef + Animation() CaptionAnimation + TextAlignment() CaptionTextAlignment + TimeRange() coremedia.TimeRange + Region() CaptionRegion + Text() string +} + +// An object that represents text to present over a time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption?language=objc +type Caption struct { + objc.Object +} + +func CaptionFrom(ptr unsafe.Pointer) Caption { + return Caption{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ Caption) InitWithTextTimeRange(text string, timeRange coremedia.TimeRange) Caption { + rv := objc.Call[Caption](c_, objc.Sel("initWithText:timeRange:"), text, timeRange) + return rv +} + +// Creates a caption that contains text and a time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752820-initwithtext?language=objc +func NewCaptionWithTextTimeRange(text string, timeRange coremedia.TimeRange) Caption { + instance := CaptionClass.Alloc().InitWithTextTimeRange(text, timeRange) + instance.Autorelease() + return instance +} + +func (cc _CaptionClass) Alloc() Caption { + rv := objc.Call[Caption](cc, objc.Sel("alloc")) + return rv +} + +func Caption_Alloc() Caption { + return CaptionClass.Alloc() +} + +func (cc _CaptionClass) New() Caption { + rv := objc.Call[Caption](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaption() Caption { + return CaptionClass.New() +} + +func (c_ Caption) Init() Caption { + rv := objc.Call[Caption](c_, objc.Sel("init")) + return rv +} + +// Returns the text decoration at the index position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752817-decorationatindex?language=objc +func (c_ Caption) DecorationAtIndexRange(index int, outRange *foundation.Range) CaptionDecoration { + rv := objc.Call[CaptionDecoration](c_, objc.Sel("decorationAtIndex:range:"), index, outRange) + return rv +} + +// Returns the text combine at the index position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752826-textcombineatindex?language=objc +func (c_ Caption) TextCombineAtIndexRange(index int, outRange *foundation.Range) CaptionTextCombine { + rv := objc.Call[CaptionTextCombine](c_, objc.Sel("textCombineAtIndex:range:"), index, outRange) + return rv +} + +// Returns the text color at the index position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752825-textcoloratindex?language=objc +func (c_ Caption) TextColorAtIndexRange(index int, outRange *foundation.Range) coregraphics.ColorRef { + rv := objc.Call[coregraphics.ColorRef](c_, objc.Sel("textColorAtIndex:range:"), index, outRange) + return rv +} + +// Returns the font weight and range at the index position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752819-fontweightatindex?language=objc +func (c_ Caption) FontWeightAtIndexRange(index int, outRange *foundation.Range) CaptionFontWeight { + rv := objc.Call[CaptionFontWeight](c_, objc.Sel("fontWeightAtIndex:range:"), index, outRange) + return rv +} + +// Returns the font style and range at the index position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752818-fontstyleatindex?language=objc +func (c_ Caption) FontStyleAtIndexRange(index int, outRange *foundation.Range) CaptionFontStyle { + rv := objc.Call[CaptionFontStyle](c_, objc.Sel("fontStyleAtIndex:range:"), index, outRange) + return rv +} + +// Returns the ruby text at the index position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752822-rubyatindex?language=objc +func (c_ Caption) RubyAtIndexRange(index int, outRange *foundation.Range) CaptionRuby { + rv := objc.Call[CaptionRuby](c_, objc.Sel("rubyAtIndex:range:"), index, outRange) + return rv +} + +// Returns the background color at the index position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752816-backgroundcoloratindex?language=objc +func (c_ Caption) BackgroundColorAtIndexRange(index int, outRange *foundation.Range) coregraphics.ColorRef { + rv := objc.Call[coregraphics.ColorRef](c_, objc.Sel("backgroundColorAtIndex:range:"), index, outRange) + return rv +} + +// The animation that the system applies to this caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752815-animation?language=objc +func (c_ Caption) Animation() CaptionAnimation { + rv := objc.Call[CaptionAnimation](c_, objc.Sel("animation")) + return rv +} + +// The alignment for the caption text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752824-textalignment?language=objc +func (c_ Caption) TextAlignment() CaptionTextAlignment { + rv := objc.Call[CaptionTextAlignment](c_, objc.Sel("textAlignment")) + return rv +} + +// The time range over which the system presents the caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752827-timerange?language=objc +func (c_ Caption) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](c_, objc.Sel("timeRange")) + return rv +} + +// The region in which the caption exists. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752821-region?language=objc +func (c_ Caption) Region() CaptionRegion { + rv := objc.Call[CaptionRegion](c_, objc.Sel("region")) + return rv +} + +// The caption text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752823-text?language=objc +func (c_ Caption) Text() string { + rv := objc.Call[string](c_, objc.Sel("text")) + return rv +} diff --git a/macos/avfoundation/caption_conversion_adjustment.gen.go b/macos/avfoundation/caption_conversion_adjustment.gen.go new file mode 100644 index 00000000..f41db49b --- /dev/null +++ b/macos/avfoundation/caption_conversion_adjustment.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionConversionAdjustment] class. +var CaptionConversionAdjustmentClass = _CaptionConversionAdjustmentClass{objc.GetClass("AVCaptionConversionAdjustment")} + +type _CaptionConversionAdjustmentClass struct { + objc.Class +} + +// An interface definition for the [CaptionConversionAdjustment] class. +type ICaptionConversionAdjustment interface { + objc.IObject + AdjustmentType() CaptionConversionAdjustmentType +} + +// An object that describes an adjustment to correct a problem found during validation of a caption conversion. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionadjustment?language=objc +type CaptionConversionAdjustment struct { + objc.Object +} + +func CaptionConversionAdjustmentFrom(ptr unsafe.Pointer) CaptionConversionAdjustment { + return CaptionConversionAdjustment{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptionConversionAdjustmentClass) Alloc() CaptionConversionAdjustment { + rv := objc.Call[CaptionConversionAdjustment](cc, objc.Sel("alloc")) + return rv +} + +func CaptionConversionAdjustment_Alloc() CaptionConversionAdjustment { + return CaptionConversionAdjustmentClass.Alloc() +} + +func (cc _CaptionConversionAdjustmentClass) New() CaptionConversionAdjustment { + rv := objc.Call[CaptionConversionAdjustment](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionConversionAdjustment() CaptionConversionAdjustment { + return CaptionConversionAdjustmentClass.New() +} + +func (c_ CaptionConversionAdjustment) Init() CaptionConversionAdjustment { + rv := objc.Call[CaptionConversionAdjustment](c_, objc.Sel("init")) + return rv +} + +// The type of caption conversion adjustment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionadjustment/3752928-adjustmenttype?language=objc +func (c_ CaptionConversionAdjustment) AdjustmentType() CaptionConversionAdjustmentType { + rv := objc.Call[CaptionConversionAdjustmentType](c_, objc.Sel("adjustmentType")) + return rv +} diff --git a/macos/avfoundation/caption_conversion_time_range_adjustment.gen.go b/macos/avfoundation/caption_conversion_time_range_adjustment.gen.go new file mode 100644 index 00000000..ea1eb247 --- /dev/null +++ b/macos/avfoundation/caption_conversion_time_range_adjustment.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionConversionTimeRangeAdjustment] class. +var CaptionConversionTimeRangeAdjustmentClass = _CaptionConversionTimeRangeAdjustmentClass{objc.GetClass("AVCaptionConversionTimeRangeAdjustment")} + +type _CaptionConversionTimeRangeAdjustmentClass struct { + objc.Class +} + +// An interface definition for the [CaptionConversionTimeRangeAdjustment] class. +type ICaptionConversionTimeRangeAdjustment interface { + ICaptionConversionAdjustment + StartTimeOffset() coremedia.Time + DurationOffset() coremedia.Time +} + +// An object that describes an adjustment to the time range of one or more captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversiontimerangeadjustment?language=objc +type CaptionConversionTimeRangeAdjustment struct { + CaptionConversionAdjustment +} + +func CaptionConversionTimeRangeAdjustmentFrom(ptr unsafe.Pointer) CaptionConversionTimeRangeAdjustment { + return CaptionConversionTimeRangeAdjustment{ + CaptionConversionAdjustment: CaptionConversionAdjustmentFrom(ptr), + } +} + +func (cc _CaptionConversionTimeRangeAdjustmentClass) Alloc() CaptionConversionTimeRangeAdjustment { + rv := objc.Call[CaptionConversionTimeRangeAdjustment](cc, objc.Sel("alloc")) + return rv +} + +func CaptionConversionTimeRangeAdjustment_Alloc() CaptionConversionTimeRangeAdjustment { + return CaptionConversionTimeRangeAdjustmentClass.Alloc() +} + +func (cc _CaptionConversionTimeRangeAdjustmentClass) New() CaptionConversionTimeRangeAdjustment { + rv := objc.Call[CaptionConversionTimeRangeAdjustment](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionConversionTimeRangeAdjustment() CaptionConversionTimeRangeAdjustment { + return CaptionConversionTimeRangeAdjustmentClass.New() +} + +func (c_ CaptionConversionTimeRangeAdjustment) Init() CaptionConversionTimeRangeAdjustment { + rv := objc.Call[CaptionConversionTimeRangeAdjustment](c_, objc.Sel("init")) + return rv +} + +// The time value by which the system offsets the start times of captions to correct a problem. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversiontimerangeadjustment/3857641-starttimeoffset?language=objc +func (c_ CaptionConversionTimeRangeAdjustment) StartTimeOffset() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("startTimeOffset")) + return rv +} + +// The time value by which the system offsets the durations of captions to correct a problem. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversiontimerangeadjustment/3857640-durationoffset?language=objc +func (c_ CaptionConversionTimeRangeAdjustment) DurationOffset() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("durationOffset")) + return rv +} diff --git a/macos/avfoundation/caption_conversion_validator.gen.go b/macos/avfoundation/caption_conversion_validator.gen.go new file mode 100644 index 00000000..84fdfbef --- /dev/null +++ b/macos/avfoundation/caption_conversion_validator.gen.go @@ -0,0 +1,137 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionConversionValidator] class. +var CaptionConversionValidatorClass = _CaptionConversionValidatorClass{objc.GetClass("AVCaptionConversionValidator")} + +type _CaptionConversionValidatorClass struct { + objc.Class +} + +// An interface definition for the [CaptionConversionValidator] class. +type ICaptionConversionValidator interface { + objc.IObject + StopValidating() + ValidateCaptionConversionWithWarningHandler(handler func(warning CaptionConversionWarning)) + Captions() []Caption + TimeRange() coremedia.TimeRange + Status() CaptionConversionValidatorStatus + Warnings() []CaptionConversionWarning +} + +// An object that validates captions for a conversion operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator?language=objc +type CaptionConversionValidator struct { + objc.Object +} + +func CaptionConversionValidatorFrom(ptr unsafe.Pointer) CaptionConversionValidator { + return CaptionConversionValidator{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptionConversionValidatorClass) CaptionConversionValidatorWithCaptionsTimeRangeConversionSettings(captions []ICaption, timeRange coremedia.TimeRange, conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionConversionValidator { + rv := objc.Call[CaptionConversionValidator](cc, objc.Sel("captionConversionValidatorWithCaptions:timeRange:conversionSettings:"), captions, timeRange, conversionSettings) + return rv +} + +// A convenience initializer to create an object that validates captions for a conversion operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752935-captionconversionvalidatorwithca?language=objc +func CaptionConversionValidator_CaptionConversionValidatorWithCaptionsTimeRangeConversionSettings(captions []ICaption, timeRange coremedia.TimeRange, conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionConversionValidator { + return CaptionConversionValidatorClass.CaptionConversionValidatorWithCaptionsTimeRangeConversionSettings(captions, timeRange, conversionSettings) +} + +func (c_ CaptionConversionValidator) InitWithCaptionsTimeRangeConversionSettings(captions []ICaption, timeRange coremedia.TimeRange, conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionConversionValidator { + rv := objc.Call[CaptionConversionValidator](c_, objc.Sel("initWithCaptions:timeRange:conversionSettings:"), captions, timeRange, conversionSettings) + return rv +} + +// Creates an object that validates captions for a conversion operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752937-initwithcaptions?language=objc +func NewCaptionConversionValidatorWithCaptionsTimeRangeConversionSettings(captions []ICaption, timeRange coremedia.TimeRange, conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionConversionValidator { + instance := CaptionConversionValidatorClass.Alloc().InitWithCaptionsTimeRangeConversionSettings(captions, timeRange, conversionSettings) + instance.Autorelease() + return instance +} + +func (cc _CaptionConversionValidatorClass) Alloc() CaptionConversionValidator { + rv := objc.Call[CaptionConversionValidator](cc, objc.Sel("alloc")) + return rv +} + +func CaptionConversionValidator_Alloc() CaptionConversionValidator { + return CaptionConversionValidatorClass.Alloc() +} + +func (cc _CaptionConversionValidatorClass) New() CaptionConversionValidator { + rv := objc.Call[CaptionConversionValidator](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionConversionValidator() CaptionConversionValidator { + return CaptionConversionValidatorClass.New() +} + +func (c_ CaptionConversionValidator) Init() CaptionConversionValidator { + rv := objc.Call[CaptionConversionValidator](c_, objc.Sel("init")) + return rv +} + +// Stops the active validation operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752939-stopvalidating?language=objc +func (c_ CaptionConversionValidator) StopValidating() { + objc.Call[objc.Void](c_, objc.Sel("stopValidating")) +} + +// Validates the object’s captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752941-validatecaptionconversionwithwar?language=objc +func (c_ CaptionConversionValidator) ValidateCaptionConversionWithWarningHandler(handler func(warning CaptionConversionWarning)) { + objc.Call[objc.Void](c_, objc.Sel("validateCaptionConversionWithWarningHandler:"), handler) +} + +// The array of captions that the system validates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752936-captions?language=objc +func (c_ CaptionConversionValidator) Captions() []Caption { + rv := objc.Call[[]Caption](c_, objc.Sel("captions")) + return rv +} + +// The time range of the media timeline in which the captions must exist. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752940-timerange?language=objc +func (c_ CaptionConversionValidator) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](c_, objc.Sel("timeRange")) + return rv +} + +// A value that indicates the status of validation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752938-status?language=objc +func (c_ CaptionConversionValidator) Status() CaptionConversionValidatorStatus { + rv := objc.Call[CaptionConversionValidatorStatus](c_, objc.Sel("status")) + return rv +} + +// The collection of warnings the validator encountered. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidator/3752942-warnings?language=objc +func (c_ CaptionConversionValidator) Warnings() []CaptionConversionWarning { + rv := objc.Call[[]CaptionConversionWarning](c_, objc.Sel("warnings")) + return rv +} diff --git a/macos/avfoundation/caption_conversion_warning.gen.go b/macos/avfoundation/caption_conversion_warning.gen.go new file mode 100644 index 00000000..72a1f0a5 --- /dev/null +++ b/macos/avfoundation/caption_conversion_warning.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionConversionWarning] class. +var CaptionConversionWarningClass = _CaptionConversionWarningClass{objc.GetClass("AVCaptionConversionWarning")} + +type _CaptionConversionWarningClass struct { + objc.Class +} + +// An interface definition for the [CaptionConversionWarning] class. +type ICaptionConversionWarning interface { + objc.IObject + WarningType() CaptionConversionWarningType + RangeOfCaptions() foundation.Range + Adjustment() CaptionConversionAdjustment +} + +// An object that represents a conversion warning produced by a validator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionwarning?language=objc +type CaptionConversionWarning struct { + objc.Object +} + +func CaptionConversionWarningFrom(ptr unsafe.Pointer) CaptionConversionWarning { + return CaptionConversionWarning{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptionConversionWarningClass) Alloc() CaptionConversionWarning { + rv := objc.Call[CaptionConversionWarning](cc, objc.Sel("alloc")) + return rv +} + +func CaptionConversionWarning_Alloc() CaptionConversionWarning { + return CaptionConversionWarningClass.Alloc() +} + +func (cc _CaptionConversionWarningClass) New() CaptionConversionWarning { + rv := objc.Call[CaptionConversionWarning](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionConversionWarning() CaptionConversionWarning { + return CaptionConversionWarningClass.New() +} + +func (c_ CaptionConversionWarning) Init() CaptionConversionWarning { + rv := objc.Call[CaptionConversionWarning](c_, objc.Sel("init")) + return rv +} + +// A type that indicates the nature of the validation warning. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionwarning/3752951-warningtype?language=objc +func (c_ CaptionConversionWarning) WarningType() CaptionConversionWarningType { + rv := objc.Call[CaptionConversionWarningType](c_, objc.Sel("warningType")) + return rv +} + +// The range of the captions for which the system issued a warning. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionwarning/3752950-rangeofcaptions?language=objc +func (c_ CaptionConversionWarning) RangeOfCaptions() foundation.Range { + rv := objc.Call[foundation.Range](c_, objc.Sel("rangeOfCaptions")) + return rv +} + +// A correction the converter makes when it converts a caption to a specific format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionwarning/3752949-adjustment?language=objc +func (c_ CaptionConversionWarning) Adjustment() CaptionConversionAdjustment { + rv := objc.Call[CaptionConversionAdjustment](c_, objc.Sel("adjustment")) + return rv +} diff --git a/macos/avfoundation/caption_format_conformer.gen.go b/macos/avfoundation/caption_format_conformer.gen.go new file mode 100644 index 00000000..496335fd --- /dev/null +++ b/macos/avfoundation/caption_format_conformer.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionFormatConformer] class. +var CaptionFormatConformerClass = _CaptionFormatConformerClass{objc.GetClass("AVCaptionFormatConformer")} + +type _CaptionFormatConformerClass struct { + objc.Class +} + +// An interface definition for the [CaptionFormatConformer] class. +type ICaptionFormatConformer interface { + objc.IObject + ConformedCaptionForCaptionError(caption ICaption, outError foundation.IError) Caption + ConformsCaptionsToTimeRange() bool + SetConformsCaptionsToTimeRange(value bool) +} + +// An object that converts a canonical caption to a specific format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionformatconformer?language=objc +type CaptionFormatConformer struct { + objc.Object +} + +func CaptionFormatConformerFrom(ptr unsafe.Pointer) CaptionFormatConformer { + return CaptionFormatConformer{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CaptionFormatConformer) InitWithConversionSettings(conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionFormatConformer { + rv := objc.Call[CaptionFormatConformer](c_, objc.Sel("initWithConversionSettings:"), conversionSettings) + return rv +} + +// Creates a new object with format conversion settings. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionformatconformer/3752958-initwithconversionsettings?language=objc +func NewCaptionFormatConformerWithConversionSettings(conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionFormatConformer { + instance := CaptionFormatConformerClass.Alloc().InitWithConversionSettings(conversionSettings) + instance.Autorelease() + return instance +} + +func (cc _CaptionFormatConformerClass) CaptionFormatConformerWithConversionSettings(conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionFormatConformer { + rv := objc.Call[CaptionFormatConformer](cc, objc.Sel("captionFormatConformerWithConversionSettings:"), conversionSettings) + return rv +} + +// A class method that creates a new object with format conversion settings. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionformatconformer/3752955-captionformatconformerwithconver?language=objc +func CaptionFormatConformer_CaptionFormatConformerWithConversionSettings(conversionSettings map[CaptionSettingsKey]objc.IObject) CaptionFormatConformer { + return CaptionFormatConformerClass.CaptionFormatConformerWithConversionSettings(conversionSettings) +} + +func (cc _CaptionFormatConformerClass) Alloc() CaptionFormatConformer { + rv := objc.Call[CaptionFormatConformer](cc, objc.Sel("alloc")) + return rv +} + +func CaptionFormatConformer_Alloc() CaptionFormatConformer { + return CaptionFormatConformerClass.Alloc() +} + +func (cc _CaptionFormatConformerClass) New() CaptionFormatConformer { + rv := objc.Call[CaptionFormatConformer](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionFormatConformer() CaptionFormatConformer { + return CaptionFormatConformerClass.New() +} + +func (c_ CaptionFormatConformer) Init() CaptionFormatConformer { + rv := objc.Call[CaptionFormatConformer](c_, objc.Sel("init")) + return rv +} + +// Creates a caption that conforms to a specific format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionformatconformer/3752956-conformedcaptionforcaption?language=objc +func (c_ CaptionFormatConformer) ConformedCaptionForCaptionError(caption ICaption, outError foundation.IError) Caption { + rv := objc.Call[Caption](c_, objc.Sel("conformedCaptionForCaption:error:"), objc.Ptr(caption), objc.Ptr(outError)) + return rv +} + +// A Boolean value that indicates whether to conform the time range of a canonical caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionformatconformer/3857642-conformscaptionstotimerange?language=objc +func (c_ CaptionFormatConformer) ConformsCaptionsToTimeRange() bool { + rv := objc.Call[bool](c_, objc.Sel("conformsCaptionsToTimeRange")) + return rv +} + +// A Boolean value that indicates whether to conform the time range of a canonical caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionformatconformer/3857642-conformscaptionstotimerange?language=objc +func (c_ CaptionFormatConformer) SetConformsCaptionsToTimeRange(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setConformsCaptionsToTimeRange:"), value) +} diff --git a/macos/avfoundation/caption_group.gen.go b/macos/avfoundation/caption_group.gen.go new file mode 100644 index 00000000..3a09e8fc --- /dev/null +++ b/macos/avfoundation/caption_group.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionGroup] class. +var CaptionGroupClass = _CaptionGroupClass{objc.GetClass("AVCaptionGroup")} + +type _CaptionGroupClass struct { + objc.Class +} + +// An interface definition for the [CaptionGroup] class. +type ICaptionGroup interface { + objc.IObject + Captions() []Caption + TimeRange() coremedia.TimeRange +} + +// An object that represents zero or more captions that intersect in time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongroup?language=objc +type CaptionGroup struct { + objc.Object +} + +func CaptionGroupFrom(ptr unsafe.Pointer) CaptionGroup { + return CaptionGroup{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CaptionGroup) InitWithTimeRange(timeRange coremedia.TimeRange) CaptionGroup { + rv := objc.Call[CaptionGroup](c_, objc.Sel("initWithTimeRange:"), timeRange) + return rv +} + +// Creates a caption group with a time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongroup/3752962-initwithtimerange?language=objc +func NewCaptionGroupWithTimeRange(timeRange coremedia.TimeRange) CaptionGroup { + instance := CaptionGroupClass.Alloc().InitWithTimeRange(timeRange) + instance.Autorelease() + return instance +} + +func (c_ CaptionGroup) InitWithCaptionsTimeRange(captions []ICaption, timeRange coremedia.TimeRange) CaptionGroup { + rv := objc.Call[CaptionGroup](c_, objc.Sel("initWithCaptions:timeRange:"), captions, timeRange) + return rv +} + +// Creates a caption group with captions and a time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongroup/3752961-initwithcaptions?language=objc +func NewCaptionGroupWithCaptionsTimeRange(captions []ICaption, timeRange coremedia.TimeRange) CaptionGroup { + instance := CaptionGroupClass.Alloc().InitWithCaptionsTimeRange(captions, timeRange) + instance.Autorelease() + return instance +} + +func (cc _CaptionGroupClass) Alloc() CaptionGroup { + rv := objc.Call[CaptionGroup](cc, objc.Sel("alloc")) + return rv +} + +func CaptionGroup_Alloc() CaptionGroup { + return CaptionGroupClass.Alloc() +} + +func (cc _CaptionGroupClass) New() CaptionGroup { + rv := objc.Call[CaptionGroup](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionGroup() CaptionGroup { + return CaptionGroupClass.New() +} + +func (c_ CaptionGroup) Init() CaptionGroup { + rv := objc.Call[CaptionGroup](c_, objc.Sel("init")) + return rv +} + +// The captions associated with the caption group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongroup/3752960-captions?language=objc +func (c_ CaptionGroup) Captions() []Caption { + rv := objc.Call[[]Caption](c_, objc.Sel("captions")) + return rv +} + +// The time range of the caption group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongroup/3752963-timerange?language=objc +func (c_ CaptionGroup) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](c_, objc.Sel("timeRange")) + return rv +} diff --git a/macos/avfoundation/caption_grouper.gen.go b/macos/avfoundation/caption_grouper.gen.go new file mode 100644 index 00000000..486b6f8d --- /dev/null +++ b/macos/avfoundation/caption_grouper.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionGrouper] class. +var CaptionGrouperClass = _CaptionGrouperClass{objc.GetClass("AVCaptionGrouper")} + +type _CaptionGrouperClass struct { + objc.Class +} + +// An interface definition for the [CaptionGrouper] class. +type ICaptionGrouper interface { + objc.IObject + AddCaption(input ICaption) + FlushAddedCaptionsIntoGroupsUpToTime(upToTime coremedia.Time) []CaptionGroup +} + +// An object that analyzes the temporal overlaps of caption objects to create caption groups for each span of concurrent captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongrouper?language=objc +type CaptionGrouper struct { + objc.Object +} + +func CaptionGrouperFrom(ptr unsafe.Pointer) CaptionGrouper { + return CaptionGrouper{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptionGrouperClass) Alloc() CaptionGrouper { + rv := objc.Call[CaptionGrouper](cc, objc.Sel("alloc")) + return rv +} + +func CaptionGrouper_Alloc() CaptionGrouper { + return CaptionGrouperClass.Alloc() +} + +func (cc _CaptionGrouperClass) New() CaptionGrouper { + rv := objc.Call[CaptionGrouper](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionGrouper() CaptionGrouper { + return CaptionGrouperClass.New() +} + +func (c_ CaptionGrouper) Init() CaptionGrouper { + rv := objc.Call[CaptionGrouper](c_, objc.Sel("init")) + return rv +} + +// Adds a caption to the pending group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongrouper/3752965-addcaption?language=objc +func (c_ CaptionGrouper) AddCaption(input ICaption) { + objc.Call[objc.Void](c_, objc.Sel("addCaption:"), objc.Ptr(input)) +} + +// Creates caption groups for the captions you enqueue up to the time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiongrouper/3752966-flushaddedcaptionsintogroupsupto?language=objc +func (c_ CaptionGrouper) FlushAddedCaptionsIntoGroupsUpToTime(upToTime coremedia.Time) []CaptionGroup { + rv := objc.Call[[]CaptionGroup](c_, objc.Sel("flushAddedCaptionsIntoGroupsUpToTime:"), upToTime) + return rv +} diff --git a/macos/avfoundation/caption_region.gen.go b/macos/avfoundation/caption_region.gen.go new file mode 100644 index 00000000..8260807c --- /dev/null +++ b/macos/avfoundation/caption_region.gen.go @@ -0,0 +1,187 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionRegion] class. +var CaptionRegionClass = _CaptionRegionClass{objc.GetClass("AVCaptionRegion")} + +type _CaptionRegionClass struct { + objc.Class +} + +// An interface definition for the [CaptionRegion] class. +type ICaptionRegion interface { + objc.IObject + Origin() CaptionPoint + Scroll() CaptionRegionScroll + WritingMode() CaptionRegionWritingMode + Identifier() string + Size() CaptionSize + DisplayAlignment() CaptionRegionDisplayAlignment +} + +// An object that represents the region in which the system presents a caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion?language=objc +type CaptionRegion struct { + objc.Object +} + +func CaptionRegionFrom(ptr unsafe.Pointer) CaptionRegion { + return CaptionRegion{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptionRegionClass) Alloc() CaptionRegion { + rv := objc.Call[CaptionRegion](cc, objc.Sel("alloc")) + return rv +} + +func CaptionRegion_Alloc() CaptionRegion { + return CaptionRegionClass.Alloc() +} + +func (cc _CaptionRegionClass) New() CaptionRegion { + rv := objc.Call[CaptionRegion](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionRegion() CaptionRegion { + return CaptionRegionClass.New() +} + +func (c_ CaptionRegion) Init() CaptionRegion { + rv := objc.Call[CaptionRegion](c_, objc.Sel("init")) + return rv +} + +// The bottom caption region for SubRip Text (SRT) format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857629-subriptextbottomregion?language=objc +func (cc _CaptionRegionClass) SubRipTextBottomRegion() CaptionRegion { + rv := objc.Call[CaptionRegion](cc, objc.Sel("subRipTextBottomRegion")) + return rv +} + +// The bottom caption region for SubRip Text (SRT) format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857629-subriptextbottomregion?language=objc +func CaptionRegion_SubRipTextBottomRegion() CaptionRegion { + return CaptionRegionClass.SubRipTextBottomRegion() +} + +// The right region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857625-appleittrightregion?language=objc +func (cc _CaptionRegionClass) AppleITTRightRegion() CaptionRegion { + rv := objc.Call[CaptionRegion](cc, objc.Sel("appleITTRightRegion")) + return rv +} + +// The right region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857625-appleittrightregion?language=objc +func CaptionRegion_AppleITTRightRegion() CaptionRegion { + return CaptionRegionClass.AppleITTRightRegion() +} + +// The region’s top-left position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857627-origin?language=objc +func (c_ CaptionRegion) Origin() CaptionPoint { + rv := objc.Call[CaptionPoint](c_, objc.Sel("origin")) + return rv +} + +// The scroll mode of the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3752855-scroll?language=objc +func (c_ CaptionRegion) Scroll() CaptionRegionScroll { + rv := objc.Call[CaptionRegionScroll](c_, objc.Sel("scroll")) + return rv +} + +// The top region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857626-appleitttopregion?language=objc +func (cc _CaptionRegionClass) AppleITTTopRegion() CaptionRegion { + rv := objc.Call[CaptionRegion](cc, objc.Sel("appleITTTopRegion")) + return rv +} + +// The top region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857626-appleitttopregion?language=objc +func CaptionRegion_AppleITTTopRegion() CaptionRegion { + return CaptionRegionClass.AppleITTTopRegion() +} + +// The block and inline progression direction of the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3752857-writingmode?language=objc +func (c_ CaptionRegion) WritingMode() CaptionRegionWritingMode { + rv := objc.Call[CaptionRegionWritingMode](c_, objc.Sel("writingMode")) + return rv +} + +// The left region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857624-appleittleftregion?language=objc +func (cc _CaptionRegionClass) AppleITTLeftRegion() CaptionRegion { + rv := objc.Call[CaptionRegion](cc, objc.Sel("appleITTLeftRegion")) + return rv +} + +// The left region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857624-appleittleftregion?language=objc +func CaptionRegion_AppleITTLeftRegion() CaptionRegion { + return CaptionRegionClass.AppleITTLeftRegion() +} + +// The bottom region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857623-appleittbottomregion?language=objc +func (cc _CaptionRegionClass) AppleITTBottomRegion() CaptionRegion { + rv := objc.Call[CaptionRegion](cc, objc.Sel("appleITTBottomRegion")) + return rv +} + +// The bottom region for iTT format captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857623-appleittbottomregion?language=objc +func CaptionRegion_AppleITTBottomRegion() CaptionRegion { + return CaptionRegionClass.AppleITTBottomRegion() +} + +// A string that identifies the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3752853-identifier?language=objc +func (c_ CaptionRegion) Identifier() string { + rv := objc.Call[string](c_, objc.Sel("identifier")) + return rv +} + +// The height and width of the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3857628-size?language=objc +func (c_ CaptionRegion) Size() CaptionSize { + rv := objc.Call[CaptionSize](c_, objc.Sel("size")) + return rv +} + +// The alignment of lines for the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregion/3752850-displayalignment?language=objc +func (c_ CaptionRegion) DisplayAlignment() CaptionRegionDisplayAlignment { + rv := objc.Call[CaptionRegionDisplayAlignment](c_, objc.Sel("displayAlignment")) + return rv +} diff --git a/macos/avfoundation/caption_renderer.gen.go b/macos/avfoundation/caption_renderer.gen.go new file mode 100644 index 00000000..5ae63963 --- /dev/null +++ b/macos/avfoundation/caption_renderer.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionRenderer] class. +var CaptionRendererClass = _CaptionRendererClass{objc.GetClass("AVCaptionRenderer")} + +type _CaptionRendererClass struct { + objc.Class +} + +// An interface definition for the [CaptionRenderer] class. +type ICaptionRenderer interface { + objc.IObject + RenderInContextForTime(ctx coregraphics.ContextRef, time coremedia.Time) + CaptionSceneChangesInRange(consideredTimeRange coremedia.TimeRange) []CaptionRendererScene + Captions() []Caption + SetCaptions(value []ICaption) + Bounds() coregraphics.Rect + SetBounds(value coregraphics.Rect) +} + +// An object that renders captions for display at a particular time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrenderer?language=objc +type CaptionRenderer struct { + objc.Object +} + +func CaptionRendererFrom(ptr unsafe.Pointer) CaptionRenderer { + return CaptionRenderer{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptionRendererClass) Alloc() CaptionRenderer { + rv := objc.Call[CaptionRenderer](cc, objc.Sel("alloc")) + return rv +} + +func CaptionRenderer_Alloc() CaptionRenderer { + return CaptionRendererClass.Alloc() +} + +func (cc _CaptionRendererClass) New() CaptionRenderer { + rv := objc.Call[CaptionRenderer](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionRenderer() CaptionRenderer { + return CaptionRendererClass.New() +} + +func (c_ CaptionRenderer) Init() CaptionRenderer { + rv := objc.Call[CaptionRenderer](c_, objc.Sel("init")) + return rv +} + +// Draw the captions for the time you specify. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrenderer/3752971-renderincontext?language=objc +func (c_ CaptionRenderer) RenderInContextForTime(ctx coregraphics.ContextRef, time coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("renderInContext:forTime:"), ctx, time) +} + +// Determine render time ranges within an enclosing time range to account for visual changes among captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrenderer/3752969-captionscenechangesinrange?language=objc +func (c_ CaptionRenderer) CaptionSceneChangesInRange(consideredTimeRange coremedia.TimeRange) []CaptionRendererScene { + rv := objc.Call[[]CaptionRendererScene](c_, objc.Sel("captionSceneChangesInRange:"), consideredTimeRange) + return rv +} + +// The captions to render. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrenderer/3752970-captions?language=objc +func (c_ CaptionRenderer) Captions() []Caption { + rv := objc.Call[[]Caption](c_, objc.Sel("captions")) + return rv +} + +// The captions to render. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrenderer/3752970-captions?language=objc +func (c_ CaptionRenderer) SetCaptions(value []ICaption) { + objc.Call[objc.Void](c_, objc.Sel("setCaptions:"), value) +} + +// The drawing bounds of caption scenes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrenderer/3752968-bounds?language=objc +func (c_ CaptionRenderer) Bounds() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](c_, objc.Sel("bounds")) + return rv +} + +// The drawing bounds of caption scenes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrenderer/3752968-bounds?language=objc +func (c_ CaptionRenderer) SetBounds(value coregraphics.Rect) { + objc.Call[objc.Void](c_, objc.Sel("setBounds:"), value) +} diff --git a/macos/avfoundation/caption_renderer_scene.gen.go b/macos/avfoundation/caption_renderer_scene.gen.go new file mode 100644 index 00000000..41eb6823 --- /dev/null +++ b/macos/avfoundation/caption_renderer_scene.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionRendererScene] class. +var CaptionRendererSceneClass = _CaptionRendererSceneClass{objc.GetClass("AVCaptionRendererScene")} + +type _CaptionRendererSceneClass struct { + objc.Class +} + +// An interface definition for the [CaptionRendererScene] class. +type ICaptionRendererScene interface { + objc.IObject + HasActiveCaptions() bool + TimeRange() coremedia.TimeRange + NeedsPeriodicRefresh() bool +} + +// An object that holds a time range and an associated state which indicates when the renderer draws output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrendererscene?language=objc +type CaptionRendererScene struct { + objc.Object +} + +func CaptionRendererSceneFrom(ptr unsafe.Pointer) CaptionRendererScene { + return CaptionRendererScene{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptionRendererSceneClass) Alloc() CaptionRendererScene { + rv := objc.Call[CaptionRendererScene](cc, objc.Sel("alloc")) + return rv +} + +func CaptionRendererScene_Alloc() CaptionRendererScene { + return CaptionRendererSceneClass.Alloc() +} + +func (cc _CaptionRendererSceneClass) New() CaptionRendererScene { + rv := objc.Call[CaptionRendererScene](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionRendererScene() CaptionRendererScene { + return CaptionRendererSceneClass.New() +} + +func (c_ CaptionRendererScene) Init() CaptionRendererScene { + rv := objc.Call[CaptionRendererScene](c_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the scene contains one or more active captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrendererscene/3752973-hasactivecaptions?language=objc +func (c_ CaptionRendererScene) HasActiveCaptions() bool { + rv := objc.Call[bool](c_, objc.Sel("hasActiveCaptions")) + return rv +} + +// The time range during which the system doesn’t modify the scene. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrendererscene/3752975-timerange?language=objc +func (c_ CaptionRendererScene) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](c_, objc.Sel("timeRange")) + return rv +} + +// A Boolean value that indicates whether the scene requires redrawing while your app progresses through the content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrendererscene/3752974-needsperiodicrefresh?language=objc +func (c_ CaptionRendererScene) NeedsPeriodicRefresh() bool { + rv := objc.Call[bool](c_, objc.Sel("needsPeriodicRefresh")) + return rv +} diff --git a/macos/avfoundation/caption_ruby.gen.go b/macos/avfoundation/caption_ruby.gen.go new file mode 100644 index 00000000..17006c43 --- /dev/null +++ b/macos/avfoundation/caption_ruby.gen.go @@ -0,0 +1,99 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptionRuby] class. +var CaptionRubyClass = _CaptionRubyClass{objc.GetClass("AVCaptionRuby")} + +type _CaptionRubyClass struct { + objc.Class +} + +// An interface definition for the [CaptionRuby] class. +type ICaptionRuby interface { + objc.IObject + Alignment() CaptionRubyAlignment + Position() CaptionRubyPosition + Text() string +} + +// An object that presents ruby characters. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionruby?language=objc +type CaptionRuby struct { + objc.Object +} + +func CaptionRubyFrom(ptr unsafe.Pointer) CaptionRuby { + return CaptionRuby{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CaptionRuby) InitWithText(text string) CaptionRuby { + rv := objc.Call[CaptionRuby](c_, objc.Sel("initWithText:"), text) + return rv +} + +// Creates ruby text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionruby/3752870-initwithtext?language=objc +func NewCaptionRubyWithText(text string) CaptionRuby { + instance := CaptionRubyClass.Alloc().InitWithText(text) + instance.Autorelease() + return instance +} + +func (cc _CaptionRubyClass) Alloc() CaptionRuby { + rv := objc.Call[CaptionRuby](cc, objc.Sel("alloc")) + return rv +} + +func CaptionRuby_Alloc() CaptionRuby { + return CaptionRubyClass.Alloc() +} + +func (cc _CaptionRubyClass) New() CaptionRuby { + rv := objc.Call[CaptionRuby](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptionRuby() CaptionRuby { + return CaptionRubyClass.New() +} + +func (c_ CaptionRuby) Init() CaptionRuby { + rv := objc.Call[CaptionRuby](c_, objc.Sel("init")) + return rv +} + +// The ruby text alignment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionruby/3752869-alignment?language=objc +func (c_ CaptionRuby) Alignment() CaptionRubyAlignment { + rv := objc.Call[CaptionRubyAlignment](c_, objc.Sel("alignment")) + return rv +} + +// The ruby text position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionruby/3752872-position?language=objc +func (c_ CaptionRuby) Position() CaptionRubyPosition { + rv := objc.Call[CaptionRubyPosition](c_, objc.Sel("position")) + return rv +} + +// The ruby text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionruby/3752873-text?language=objc +func (c_ CaptionRuby) Text() string { + rv := objc.Call[string](c_, objc.Sel("text")) + return rv +} diff --git a/macos/avfoundation/capture_audio_channel.gen.go b/macos/avfoundation/capture_audio_channel.gen.go new file mode 100644 index 00000000..cb67fe8a --- /dev/null +++ b/macos/avfoundation/capture_audio_channel.gen.go @@ -0,0 +1,110 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureAudioChannel] class. +var CaptureAudioChannelClass = _CaptureAudioChannelClass{objc.GetClass("AVCaptureAudioChannel")} + +type _CaptureAudioChannelClass struct { + objc.Class +} + +// An interface definition for the [CaptureAudioChannel] class. +type ICaptureAudioChannel interface { + objc.IObject + Volume() float64 + SetVolume(value float64) + AveragePowerLevel() float64 + PeakHoldLevel() float64 + IsEnabled() bool + SetEnabled(value bool) +} + +// An object that monitors average and peak power levels for an audio channel in a capture connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel?language=objc +type CaptureAudioChannel struct { + objc.Object +} + +func CaptureAudioChannelFrom(ptr unsafe.Pointer) CaptureAudioChannel { + return CaptureAudioChannel{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureAudioChannelClass) Alloc() CaptureAudioChannel { + rv := objc.Call[CaptureAudioChannel](cc, objc.Sel("alloc")) + return rv +} + +func CaptureAudioChannel_Alloc() CaptureAudioChannel { + return CaptureAudioChannelClass.Alloc() +} + +func (cc _CaptureAudioChannelClass) New() CaptureAudioChannel { + rv := objc.Call[CaptureAudioChannel](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureAudioChannel() CaptureAudioChannel { + return CaptureAudioChannelClass.New() +} + +func (c_ CaptureAudioChannel) Init() CaptureAudioChannel { + rv := objc.Call[CaptureAudioChannel](c_, objc.Sel("init")) + return rv +} + +// The current volume (gain) of the channel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel/1388396-volume?language=objc +func (c_ CaptureAudioChannel) Volume() float64 { + rv := objc.Call[float64](c_, objc.Sel("volume")) + return rv +} + +// The current volume (gain) of the channel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel/1388396-volume?language=objc +func (c_ CaptureAudioChannel) SetVolume(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setVolume:"), value) +} + +// The instantaneous average power level in decibels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel/1387368-averagepowerlevel?language=objc +func (c_ CaptureAudioChannel) AveragePowerLevel() float64 { + rv := objc.Call[float64](c_, objc.Sel("averagePowerLevel")) + return rv +} + +// The peak hold power level in decibels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel/1390872-peakholdlevel?language=objc +func (c_ CaptureAudioChannel) PeakHoldLevel() float64 { + rv := objc.Call[float64](c_, objc.Sel("peakHoldLevel")) + return rv +} + +// A Boolean value that indicates whether the channel is in an enabled state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel/1388574-enabled?language=objc +func (c_ CaptureAudioChannel) IsEnabled() bool { + rv := objc.Call[bool](c_, objc.Sel("isEnabled")) + return rv +} + +// A Boolean value that indicates whether the channel is in an enabled state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel/1388574-enabled?language=objc +func (c_ CaptureAudioChannel) SetEnabled(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setEnabled:"), value) +} diff --git a/macos/avfoundation/capture_audio_data_output.gen.go b/macos/avfoundation/capture_audio_data_output.gen.go new file mode 100644 index 00000000..9f1f45fd --- /dev/null +++ b/macos/avfoundation/capture_audio_data_output.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureAudioDataOutput] class. +var CaptureAudioDataOutputClass = _CaptureAudioDataOutputClass{objc.GetClass("AVCaptureAudioDataOutput")} + +type _CaptureAudioDataOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureAudioDataOutput] class. +type ICaptureAudioDataOutput interface { + ICaptureOutput + RecommendedAudioSettingsForAssetWriterWithOutputFileType(outputFileType FileType) map[string]objc.Object + SetSampleBufferDelegateQueue(sampleBufferDelegate PCaptureAudioDataOutputSampleBufferDelegate, sampleBufferCallbackQueue dispatch.Queue) + SetSampleBufferDelegateObjectQueue(sampleBufferDelegateObject objc.IObject, sampleBufferCallbackQueue dispatch.Queue) + AudioSettings() map[string]objc.Object + SetAudioSettings(value map[string]objc.IObject) + SampleBufferCallbackQueue() dispatch.Queue + SampleBufferDelegate() CaptureAudioDataOutputSampleBufferDelegateWrapper +} + +// A capture output that records audio and provides access to audio sample buffers as they are recorded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput?language=objc +type CaptureAudioDataOutput struct { + CaptureOutput +} + +func CaptureAudioDataOutputFrom(ptr unsafe.Pointer) CaptureAudioDataOutput { + return CaptureAudioDataOutput{ + CaptureOutput: CaptureOutputFrom(ptr), + } +} + +func (cc _CaptureAudioDataOutputClass) New() CaptureAudioDataOutput { + rv := objc.Call[CaptureAudioDataOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureAudioDataOutput() CaptureAudioDataOutput { + return CaptureAudioDataOutputClass.New() +} + +func (c_ CaptureAudioDataOutput) Init() CaptureAudioDataOutput { + rv := objc.Call[CaptureAudioDataOutput](c_, objc.Sel("init")) + return rv +} + +func (cc _CaptureAudioDataOutputClass) Alloc() CaptureAudioDataOutput { + rv := objc.Call[CaptureAudioDataOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureAudioDataOutput_Alloc() CaptureAudioDataOutput { + return CaptureAudioDataOutputClass.Alloc() +} + +// Specifies the recommended settings for use with an AVAssetWriterInput. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput/1616308-recommendedaudiosettingsforasset?language=objc +func (c_ CaptureAudioDataOutput) RecommendedAudioSettingsForAssetWriterWithOutputFileType(outputFileType FileType) map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("recommendedAudioSettingsForAssetWriterWithOutputFileType:"), outputFileType) + return rv +} + +// Sets the delegate that will accept captured buffers and the dispatch queue on which the delegate will be called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput/1390651-setsamplebufferdelegate?language=objc +func (c_ CaptureAudioDataOutput) SetSampleBufferDelegateQueue(sampleBufferDelegate PCaptureAudioDataOutputSampleBufferDelegate, sampleBufferCallbackQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVCaptureAudioDataOutputSampleBufferDelegate", sampleBufferDelegate) + objc.Call[objc.Void](c_, objc.Sel("setSampleBufferDelegate:queue:"), po0, sampleBufferCallbackQueue) +} + +// Sets the delegate that will accept captured buffers and the dispatch queue on which the delegate will be called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput/1390651-setsamplebufferdelegate?language=objc +func (c_ CaptureAudioDataOutput) SetSampleBufferDelegateObjectQueue(sampleBufferDelegateObject objc.IObject, sampleBufferCallbackQueue dispatch.Queue) { + objc.Call[objc.Void](c_, objc.Sel("setSampleBufferDelegate:queue:"), objc.Ptr(sampleBufferDelegateObject), sampleBufferCallbackQueue) +} + +// The settings used to decode or re-encode audio before it’s output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput/1388527-audiosettings?language=objc +func (c_ CaptureAudioDataOutput) AudioSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("audioSettings")) + return rv +} + +// The settings used to decode or re-encode audio before it’s output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput/1388527-audiosettings?language=objc +func (c_ CaptureAudioDataOutput) SetAudioSettings(value map[string]objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setAudioSettings:"), value) +} + +// The queue on which delegate callbacks are invoked [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput/1389355-samplebuffercallbackqueue?language=objc +func (c_ CaptureAudioDataOutput) SampleBufferCallbackQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](c_, objc.Sel("sampleBufferCallbackQueue")) + return rv +} + +// The capture object’s delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutput/1386344-samplebufferdelegate?language=objc +func (c_ CaptureAudioDataOutput) SampleBufferDelegate() CaptureAudioDataOutputSampleBufferDelegateWrapper { + rv := objc.Call[CaptureAudioDataOutputSampleBufferDelegateWrapper](c_, objc.Sel("sampleBufferDelegate")) + return rv +} diff --git a/macos/avfoundation/capture_audio_data_output_sample_buffer_delegate.gen.go b/macos/avfoundation/capture_audio_data_output_sample_buffer_delegate.gen.go new file mode 100644 index 00000000..ed1f2810 --- /dev/null +++ b/macos/avfoundation/capture_audio_data_output_sample_buffer_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// Methods for receiving audio sample data from an audio capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutputsamplebufferdelegate?language=objc +type PCaptureAudioDataOutputSampleBufferDelegate interface { + // optional + CaptureOutputDidOutputSampleBufferFromConnection(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) + HasCaptureOutputDidOutputSampleBufferFromConnection() bool +} + +// A delegate implementation builder for the [PCaptureAudioDataOutputSampleBufferDelegate] protocol. +type CaptureAudioDataOutputSampleBufferDelegate struct { + _CaptureOutputDidOutputSampleBufferFromConnection func(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) +} + +func (di *CaptureAudioDataOutputSampleBufferDelegate) HasCaptureOutputDidOutputSampleBufferFromConnection() bool { + return di._CaptureOutputDidOutputSampleBufferFromConnection != nil +} + +// Notifies the delegate that a sample buffer was written. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutputsamplebufferdelegate/1386039-captureoutput?language=objc +func (di *CaptureAudioDataOutputSampleBufferDelegate) SetCaptureOutputDidOutputSampleBufferFromConnection(f func(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection)) { + di._CaptureOutputDidOutputSampleBufferFromConnection = f +} + +// Notifies the delegate that a sample buffer was written. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutputsamplebufferdelegate/1386039-captureoutput?language=objc +func (di *CaptureAudioDataOutputSampleBufferDelegate) CaptureOutputDidOutputSampleBufferFromConnection(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) { + di._CaptureOutputDidOutputSampleBufferFromConnection(output, sampleBuffer, connection) +} + +// A concrete type wrapper for the [PCaptureAudioDataOutputSampleBufferDelegate] protocol. +type CaptureAudioDataOutputSampleBufferDelegateWrapper struct { + objc.Object +} + +func (c_ CaptureAudioDataOutputSampleBufferDelegateWrapper) HasCaptureOutputDidOutputSampleBufferFromConnection() bool { + return c_.RespondsToSelector(objc.Sel("captureOutput:didOutputSampleBuffer:fromConnection:")) +} + +// Notifies the delegate that a sample buffer was written. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiodataoutputsamplebufferdelegate/1386039-captureoutput?language=objc +func (c_ CaptureAudioDataOutputSampleBufferDelegateWrapper) CaptureOutputDidOutputSampleBufferFromConnection(output ICaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection ICaptureConnection) { + objc.Call[objc.Void](c_, objc.Sel("captureOutput:didOutputSampleBuffer:fromConnection:"), objc.Ptr(output), sampleBuffer, objc.Ptr(connection)) +} diff --git a/macos/avfoundation/capture_audio_file_output.gen.go b/macos/avfoundation/capture_audio_file_output.gen.go new file mode 100644 index 00000000..32d0eae6 --- /dev/null +++ b/macos/avfoundation/capture_audio_file_output.gen.go @@ -0,0 +1,125 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureAudioFileOutput] class. +var CaptureAudioFileOutputClass = _CaptureAudioFileOutputClass{objc.GetClass("AVCaptureAudioFileOutput")} + +type _CaptureAudioFileOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureAudioFileOutput] class. +type ICaptureAudioFileOutput interface { + ICaptureFileOutput + StartRecordingToOutputFileURLOutputFileTypeRecordingDelegate(outputFileURL foundation.IURL, fileType FileType, delegate PCaptureFileOutputRecordingDelegate) + StartRecordingToOutputFileURLOutputFileTypeRecordingDelegateObject(outputFileURL foundation.IURL, fileType FileType, delegateObject objc.IObject) + Metadata() []MetadataItem + SetMetadata(value []IMetadataItem) + AudioSettings() map[string]objc.Object + SetAudioSettings(value map[string]objc.IObject) +} + +// A capture output that records audio and saves the recorded audio to a file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput?language=objc +type CaptureAudioFileOutput struct { + CaptureFileOutput +} + +func CaptureAudioFileOutputFrom(ptr unsafe.Pointer) CaptureAudioFileOutput { + return CaptureAudioFileOutput{ + CaptureFileOutput: CaptureFileOutputFrom(ptr), + } +} + +func (cc _CaptureAudioFileOutputClass) New() CaptureAudioFileOutput { + rv := objc.Call[CaptureAudioFileOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureAudioFileOutput() CaptureAudioFileOutput { + return CaptureAudioFileOutputClass.New() +} + +func (c_ CaptureAudioFileOutput) Init() CaptureAudioFileOutput { + rv := objc.Call[CaptureAudioFileOutput](c_, objc.Sel("init")) + return rv +} + +func (cc _CaptureAudioFileOutputClass) Alloc() CaptureAudioFileOutput { + rv := objc.Call[CaptureAudioFileOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureAudioFileOutput_Alloc() CaptureAudioFileOutput { + return CaptureAudioFileOutputClass.Alloc() +} + +// Tells the receiver to start recording to a new file of the specified format, and specifies a delegate that will be notified when recording is finished. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1387420-startrecordingtooutputfileurl?language=objc +func (c_ CaptureAudioFileOutput) StartRecordingToOutputFileURLOutputFileTypeRecordingDelegate(outputFileURL foundation.IURL, fileType FileType, delegate PCaptureFileOutputRecordingDelegate) { + po2 := objc.WrapAsProtocol("AVCaptureFileOutputRecordingDelegate", delegate) + objc.Call[objc.Void](c_, objc.Sel("startRecordingToOutputFileURL:outputFileType:recordingDelegate:"), objc.Ptr(outputFileURL), fileType, po2) +} + +// Tells the receiver to start recording to a new file of the specified format, and specifies a delegate that will be notified when recording is finished. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1387420-startrecordingtooutputfileurl?language=objc +func (c_ CaptureAudioFileOutput) StartRecordingToOutputFileURLOutputFileTypeRecordingDelegateObject(outputFileURL foundation.IURL, fileType FileType, delegateObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("startRecordingToOutputFileURL:outputFileType:recordingDelegate:"), objc.Ptr(outputFileURL), fileType, objc.Ptr(delegateObject)) +} + +// Returns an array containing UTIs identifying the file types AVCaptureAudioFileOutput can write. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1390895-availableoutputfiletypes?language=objc +func (cc _CaptureAudioFileOutputClass) AvailableOutputFileTypes() []FileType { + rv := objc.Call[[]FileType](cc, objc.Sel("availableOutputFileTypes")) + return rv +} + +// Returns an array containing UTIs identifying the file types AVCaptureAudioFileOutput can write. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1390895-availableoutputfiletypes?language=objc +func CaptureAudioFileOutput_AvailableOutputFileTypes() []FileType { + return CaptureAudioFileOutputClass.AvailableOutputFileTypes() +} + +// A collection of metadata to be written to the receiver's output files. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1389881-metadata?language=objc +func (c_ CaptureAudioFileOutput) Metadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](c_, objc.Sel("metadata")) + return rv +} + +// A collection of metadata to be written to the receiver's output files. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1389881-metadata?language=objc +func (c_ CaptureAudioFileOutput) SetMetadata(value []IMetadataItem) { + objc.Call[objc.Void](c_, objc.Sel("setMetadata:"), value) +} + +// The settings used to decode or re-encode audio before it is output by the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1389958-audiosettings?language=objc +func (c_ CaptureAudioFileOutput) AudioSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("audioSettings")) + return rv +} + +// The settings used to decode or re-encode audio before it is output by the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiofileoutput/1389958-audiosettings?language=objc +func (c_ CaptureAudioFileOutput) SetAudioSettings(value map[string]objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setAudioSettings:"), value) +} diff --git a/macos/avfoundation/capture_audio_preview_output.gen.go b/macos/avfoundation/capture_audio_preview_output.gen.go new file mode 100644 index 00000000..04321ea8 --- /dev/null +++ b/macos/avfoundation/capture_audio_preview_output.gen.go @@ -0,0 +1,92 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureAudioPreviewOutput] class. +var CaptureAudioPreviewOutputClass = _CaptureAudioPreviewOutputClass{objc.GetClass("AVCaptureAudioPreviewOutput")} + +type _CaptureAudioPreviewOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureAudioPreviewOutput] class. +type ICaptureAudioPreviewOutput interface { + ICaptureOutput + Volume() float64 + SetVolume(value float64) + OutputDeviceUniqueID() string + SetOutputDeviceUniqueID(value string) +} + +// A capture output that provides a preview of the captured audio. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiopreviewoutput?language=objc +type CaptureAudioPreviewOutput struct { + CaptureOutput +} + +func CaptureAudioPreviewOutputFrom(ptr unsafe.Pointer) CaptureAudioPreviewOutput { + return CaptureAudioPreviewOutput{ + CaptureOutput: CaptureOutputFrom(ptr), + } +} + +func (cc _CaptureAudioPreviewOutputClass) New() CaptureAudioPreviewOutput { + rv := objc.Call[CaptureAudioPreviewOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureAudioPreviewOutput() CaptureAudioPreviewOutput { + return CaptureAudioPreviewOutputClass.New() +} + +func (c_ CaptureAudioPreviewOutput) Init() CaptureAudioPreviewOutput { + rv := objc.Call[CaptureAudioPreviewOutput](c_, objc.Sel("init")) + return rv +} + +func (cc _CaptureAudioPreviewOutputClass) Alloc() CaptureAudioPreviewOutput { + rv := objc.Call[CaptureAudioPreviewOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureAudioPreviewOutput_Alloc() CaptureAudioPreviewOutput { + return CaptureAudioPreviewOutputClass.Alloc() +} + +// The output volume of the audio preview. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiopreviewoutput/1390510-volume?language=objc +func (c_ CaptureAudioPreviewOutput) Volume() float64 { + rv := objc.Call[float64](c_, objc.Sel("volume")) + return rv +} + +// The output volume of the audio preview. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiopreviewoutput/1390510-volume?language=objc +func (c_ CaptureAudioPreviewOutput) SetVolume(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setVolume:"), value) +} + +// The unique identifier of the Core Audio output device to use for audio preview. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiopreviewoutput/1390610-outputdeviceuniqueid?language=objc +func (c_ CaptureAudioPreviewOutput) OutputDeviceUniqueID() string { + rv := objc.Call[string](c_, objc.Sel("outputDeviceUniqueID")) + return rv +} + +// The unique identifier of the Core Audio output device to use for audio preview. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureaudiopreviewoutput/1390610-outputdeviceuniqueid?language=objc +func (c_ CaptureAudioPreviewOutput) SetOutputDeviceUniqueID(value string) { + objc.Call[objc.Void](c_, objc.Sel("setOutputDeviceUniqueID:"), value) +} diff --git a/macos/avfoundation/capture_connection.gen.go b/macos/avfoundation/capture_connection.gen.go new file mode 100644 index 00000000..4e3baa2f --- /dev/null +++ b/macos/avfoundation/capture_connection.gen.go @@ -0,0 +1,294 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureConnection] class. +var CaptureConnectionClass = _CaptureConnectionClass{objc.GetClass("AVCaptureConnection")} + +type _CaptureConnectionClass struct { + objc.Class +} + +// An interface definition for the [CaptureConnection] class. +type ICaptureConnection interface { + objc.IObject + IsVideoMirrored() bool + SetVideoMirrored(value bool) + AudioChannels() []CaptureAudioChannel + VideoFieldMode() VideoFieldMode + SetVideoFieldMode(value VideoFieldMode) + IsVideoMirroringSupported() bool + IsVideoMaxFrameDurationSupported() bool + VideoPreviewLayer() CaptureVideoPreviewLayer + IsActive() bool + Output() CaptureOutput + VideoMaxFrameDuration() coremedia.Time + SetVideoMaxFrameDuration(value coremedia.Time) + IsVideoFieldModeSupported() bool + AutomaticallyAdjustsVideoMirroring() bool + SetAutomaticallyAdjustsVideoMirroring(value bool) + IsVideoMinFrameDurationSupported() bool + IsEnabled() bool + SetEnabled(value bool) + InputPorts() []CaptureInputPort + VideoMinFrameDuration() coremedia.Time + SetVideoMinFrameDuration(value coremedia.Time) +} + +// An object that represents a connection from a capture input to a capture output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection?language=objc +type CaptureConnection struct { + objc.Object +} + +func CaptureConnectionFrom(ptr unsafe.Pointer) CaptureConnection { + return CaptureConnection{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CaptureConnection) InitWithInputPortVideoPreviewLayer(port ICaptureInputPort, layer ICaptureVideoPreviewLayer) CaptureConnection { + rv := objc.Call[CaptureConnection](c_, objc.Sel("initWithInputPort:videoPreviewLayer:"), objc.Ptr(port), objc.Ptr(layer)) + return rv +} + +// Creates a capture connection that represents a connection between an input port and a video preview layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1385882-initwithinputport?language=objc +func NewCaptureConnectionWithInputPortVideoPreviewLayer(port ICaptureInputPort, layer ICaptureVideoPreviewLayer) CaptureConnection { + instance := CaptureConnectionClass.Alloc().InitWithInputPortVideoPreviewLayer(port, layer) + instance.Autorelease() + return instance +} + +func (cc _CaptureConnectionClass) ConnectionWithInputPortsOutput(ports []ICaptureInputPort, output ICaptureOutput) CaptureConnection { + rv := objc.Call[CaptureConnection](cc, objc.Sel("connectionWithInputPorts:output:"), ports, objc.Ptr(output)) + return rv +} + +// Returns a capture connection that represents a connection between multiple input ports and an output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1444473-connectionwithinputports?language=objc +func CaptureConnection_ConnectionWithInputPortsOutput(ports []ICaptureInputPort, output ICaptureOutput) CaptureConnection { + return CaptureConnectionClass.ConnectionWithInputPortsOutput(ports, output) +} + +func (c_ CaptureConnection) InitWithInputPortsOutput(ports []ICaptureInputPort, output ICaptureOutput) CaptureConnection { + rv := objc.Call[CaptureConnection](c_, objc.Sel("initWithInputPorts:output:"), ports, objc.Ptr(output)) + return rv +} + +// Creates a capture connection that represents a connection between multiple input ports and an output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1388896-initwithinputports?language=objc +func NewCaptureConnectionWithInputPortsOutput(ports []ICaptureInputPort, output ICaptureOutput) CaptureConnection { + instance := CaptureConnectionClass.Alloc().InitWithInputPortsOutput(ports, output) + instance.Autorelease() + return instance +} + +func (cc _CaptureConnectionClass) ConnectionWithInputPortVideoPreviewLayer(port ICaptureInputPort, layer ICaptureVideoPreviewLayer) CaptureConnection { + rv := objc.Call[CaptureConnection](cc, objc.Sel("connectionWithInputPort:videoPreviewLayer:"), objc.Ptr(port), objc.Ptr(layer)) + return rv +} + +// Returns a capture connection that represents a connection between an input port and a video preview layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1444495-connectionwithinputport?language=objc +func CaptureConnection_ConnectionWithInputPortVideoPreviewLayer(port ICaptureInputPort, layer ICaptureVideoPreviewLayer) CaptureConnection { + return CaptureConnectionClass.ConnectionWithInputPortVideoPreviewLayer(port, layer) +} + +func (cc _CaptureConnectionClass) Alloc() CaptureConnection { + rv := objc.Call[CaptureConnection](cc, objc.Sel("alloc")) + return rv +} + +func CaptureConnection_Alloc() CaptureConnection { + return CaptureConnectionClass.Alloc() +} + +func (cc _CaptureConnectionClass) New() CaptureConnection { + rv := objc.Call[CaptureConnection](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureConnection() CaptureConnection { + return CaptureConnectionClass.New() +} + +func (c_ CaptureConnection) Init() CaptureConnection { + rv := objc.Call[CaptureConnection](c_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the connection horizontally flips the video flowing through it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1389172-videomirrored?language=objc +func (c_ CaptureConnection) IsVideoMirrored() bool { + rv := objc.Call[bool](c_, objc.Sel("isVideoMirrored")) + return rv +} + +// A Boolean value that indicates whether the connection horizontally flips the video flowing through it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1389172-videomirrored?language=objc +func (c_ CaptureConnection) SetVideoMirrored(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setVideoMirrored:"), value) +} + +// An array of audio channels that the connection provides. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1387519-audiochannels?language=objc +func (c_ CaptureConnection) AudioChannels() []CaptureAudioChannel { + rv := objc.Call[[]CaptureAudioChannel](c_, objc.Sel("audioChannels")) + return rv +} + +// A setting that tells the connection how to interlace video flowing through it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390559-videofieldmode?language=objc +func (c_ CaptureConnection) VideoFieldMode() VideoFieldMode { + rv := objc.Call[VideoFieldMode](c_, objc.Sel("videoFieldMode")) + return rv +} + +// A setting that tells the connection how to interlace video flowing through it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390559-videofieldmode?language=objc +func (c_ CaptureConnection) SetVideoFieldMode(value VideoFieldMode) { + objc.Call[objc.Void](c_, objc.Sel("setVideoFieldMode:"), value) +} + +// A Boolean value that indicates whether the connection supports video mirroring. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1387424-supportsvideomirroring?language=objc +func (c_ CaptureConnection) IsVideoMirroringSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isVideoMirroringSupported")) + return rv +} + +// A Boolean value that indicates whether the connection supports a maximum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1389158-supportsvideomaxframeduration?language=objc +func (c_ CaptureConnection) IsVideoMaxFrameDurationSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isVideoMaxFrameDurationSupported")) + return rv +} + +// The video preview layer associated with the connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390614-videopreviewlayer?language=objc +func (c_ CaptureConnection) VideoPreviewLayer() CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](c_, objc.Sel("videoPreviewLayer")) + return rv +} + +// Indicates whether the connection is active. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1387696-active?language=objc +func (c_ CaptureConnection) IsActive() bool { + rv := objc.Call[bool](c_, objc.Sel("isActive")) + return rv +} + +// The connection’s output port, if applicable. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1385571-output?language=objc +func (c_ CaptureConnection) Output() CaptureOutput { + rv := objc.Call[CaptureOutput](c_, objc.Sel("output")) + return rv +} + +// The largest time interval the connection can apply between consecutive video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390246-videomaxframeduration?language=objc +func (c_ CaptureConnection) VideoMaxFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("videoMaxFrameDuration")) + return rv +} + +// The largest time interval the connection can apply between consecutive video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390246-videomaxframeduration?language=objc +func (c_ CaptureConnection) SetVideoMaxFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("setVideoMaxFrameDuration:"), value) +} + +// A Boolean value that indicates whether the connection supports setting a video field mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390836-supportsvideofieldmode?language=objc +func (c_ CaptureConnection) IsVideoFieldModeSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isVideoFieldModeSupported")) + return rv +} + +// A Boolean value that indicates whether you can enable mirroring based on a session’s configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1387082-automaticallyadjustsvideomirrori?language=objc +func (c_ CaptureConnection) AutomaticallyAdjustsVideoMirroring() bool { + rv := objc.Call[bool](c_, objc.Sel("automaticallyAdjustsVideoMirroring")) + return rv +} + +// A Boolean value that indicates whether you can enable mirroring based on a session’s configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1387082-automaticallyadjustsvideomirrori?language=objc +func (c_ CaptureConnection) SetAutomaticallyAdjustsVideoMirroring(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setAutomaticallyAdjustsVideoMirroring:"), value) +} + +// A Boolean value that indicates whether the connection supports a minimum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1386978-supportsvideominframeduration?language=objc +func (c_ CaptureConnection) IsVideoMinFrameDurationSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isVideoMinFrameDurationSupported")) + return rv +} + +// Turns the connection on and off. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390131-enabled?language=objc +func (c_ CaptureConnection) IsEnabled() bool { + rv := objc.Call[bool](c_, objc.Sel("isEnabled")) + return rv +} + +// Turns the connection on and off. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390131-enabled?language=objc +func (c_ CaptureConnection) SetEnabled(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setEnabled:"), value) +} + +// An array of the connection’s input ports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1388322-inputports?language=objc +func (c_ CaptureConnection) InputPorts() []CaptureInputPort { + rv := objc.Call[[]CaptureInputPort](c_, objc.Sel("inputPorts")) + return rv +} + +// The smallest time interval the connection can apply between consecutive video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1388931-videominframeduration?language=objc +func (c_ CaptureConnection) VideoMinFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("videoMinFrameDuration")) + return rv +} + +// The smallest time interval the connection can apply between consecutive video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1388931-videominframeduration?language=objc +func (c_ CaptureConnection) SetVideoMinFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("setVideoMinFrameDuration:"), value) +} diff --git a/macos/avfoundation/capture_device.gen.go b/macos/avfoundation/capture_device.gen.go new file mode 100644 index 00000000..68aa5e3d --- /dev/null +++ b/macos/avfoundation/capture_device.gen.go @@ -0,0 +1,893 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureDevice] class. +var CaptureDeviceClass = _CaptureDeviceClass{objc.GetClass("AVCaptureDevice")} + +type _CaptureDeviceClass struct { + objc.Class +} + +// An interface definition for the [CaptureDevice] class. +type ICaptureDevice interface { + objc.IObject + HasMediaType(mediaType MediaType) bool + SetTorchModeOnWithLevelError(torchLevel float64, outError foundation.IError) bool + IsWhiteBalanceModeSupported(whiteBalanceMode CaptureWhiteBalanceMode) bool + SetTransportControlsPlaybackModeSpeed(mode CaptureDeviceTransportControlsPlaybackMode, speed CaptureDeviceTransportControlsSpeed) + UnlockForConfiguration() + IsFocusModeSupported(focusMode CaptureFocusMode) bool + IsExposureModeSupported(exposureMode CaptureExposureMode) bool + LockForConfiguration(outError foundation.IError) bool + IsTorchModeSupported(torchMode CaptureTorchMode) bool + SetPrimaryConstituentDeviceSwitchingBehaviorRestrictedSwitchingBehaviorConditions(switchingBehavior CapturePrimaryConstituentDeviceSwitchingBehavior, restrictedSwitchingBehaviorConditions CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions) + SupportsAVCaptureSessionPreset(preset CaptureSessionPreset) bool + Formats() []CaptureDeviceFormat + IsInUseByAnotherApplication() bool + ModelID() string + TransportControlsPlaybackMode() CaptureDeviceTransportControlsPlaybackMode + TransportType() int32 + TorchLevel() float64 + ActiveVideoMaxFrameDuration() coremedia.Time + SetActiveVideoMaxFrameDuration(value coremedia.Time) + HasFlash() bool + IsExposurePointOfInterestSupported() bool + FocusPointOfInterest() coregraphics.Point + SetFocusPointOfInterest(value coregraphics.Point) + IsTorchActive() bool + PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions() CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions + ActivePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions() CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions + IsConnected() bool + FlashMode() CaptureFlashMode + SetFlashMode(value CaptureFlashMode) + MinimumFocusDistance() int + IsAdjustingExposure() bool + LocalizedName() string + WhiteBalanceMode() CaptureWhiteBalanceMode + SetWhiteBalanceMode(value CaptureWhiteBalanceMode) + UniqueID() string + ActivePrimaryConstituentDeviceSwitchingBehavior() CapturePrimaryConstituentDeviceSwitchingBehavior + HasTorch() bool + Position() CaptureDevicePosition + ActiveInputSource() CaptureDeviceInputSource + SetActiveInputSource(value ICaptureDeviceInputSource) + IsTorchAvailable() bool + TransportControlsSpeed() CaptureDeviceTransportControlsSpeed + SupportedFallbackPrimaryConstituentDevices() []CaptureDevice + IsSuspended() bool + Manufacturer() string + TorchMode() CaptureTorchMode + SetTorchMode(value CaptureTorchMode) + PrimaryConstituentDeviceSwitchingBehavior() CapturePrimaryConstituentDeviceSwitchingBehavior + ActiveVideoMinFrameDuration() coremedia.Time + SetActiveVideoMinFrameDuration(value coremedia.Time) + IsFlashAvailable() bool + IsPortraitEffectActive() bool + FocusMode() CaptureFocusMode + SetFocusMode(value CaptureFocusMode) + InputSources() []CaptureDeviceInputSource + ExposureMode() CaptureExposureMode + SetExposureMode(value CaptureExposureMode) + IsFocusPointOfInterestSupported() bool + TransportControlsSupported() bool + ActivePrimaryConstituentDevice() CaptureDevice + LinkedDevices() []CaptureDevice + IsAdjustingWhiteBalance() bool + DeviceType() CaptureDeviceType + IsAdjustingFocus() bool + ExposurePointOfInterest() coregraphics.Point + SetExposurePointOfInterest(value coregraphics.Point) + ActiveColorSpace() CaptureColorSpace + SetActiveColorSpace(value CaptureColorSpace) + FallbackPrimaryConstituentDevices() []CaptureDevice + SetFallbackPrimaryConstituentDevices(value []ICaptureDevice) + ActiveFormat() CaptureDeviceFormat + SetActiveFormat(value ICaptureDeviceFormat) + IsCenterStageActive() bool +} + +// An object that represents a hardware or virtual capture device like a camera or microphone. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice?language=objc +type CaptureDevice struct { + objc.Object +} + +func CaptureDeviceFrom(ptr unsafe.Pointer) CaptureDevice { + return CaptureDevice{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureDeviceClass) Alloc() CaptureDevice { + rv := objc.Call[CaptureDevice](cc, objc.Sel("alloc")) + return rv +} + +func CaptureDevice_Alloc() CaptureDevice { + return CaptureDeviceClass.Alloc() +} + +func (cc _CaptureDeviceClass) New() CaptureDevice { + rv := objc.Call[CaptureDevice](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureDevice() CaptureDevice { + return CaptureDeviceClass.New() +} + +func (c_ CaptureDevice) Init() CaptureDevice { + rv := objc.Call[CaptureDevice](c_, objc.Sel("init")) + return rv +} + +// Returns an authorization status that indicates whether the user grants the app permission to capture media of a particular type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624613-authorizationstatusformediatype?language=objc +func (cc _CaptureDeviceClass) AuthorizationStatusForMediaType(mediaType MediaType) AuthorizationStatus { + rv := objc.Call[AuthorizationStatus](cc, objc.Sel("authorizationStatusForMediaType:"), mediaType) + return rv +} + +// Returns an authorization status that indicates whether the user grants the app permission to capture media of a particular type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624613-authorizationstatusformediatype?language=objc +func CaptureDevice_AuthorizationStatusForMediaType(mediaType MediaType) AuthorizationStatus { + return CaptureDeviceClass.AuthorizationStatusForMediaType(mediaType) +} + +// Returns a Boolean value that indicates whether the device captures media of a particular type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389487-hasmediatype?language=objc +func (c_ CaptureDevice) HasMediaType(mediaType MediaType) bool { + rv := objc.Call[bool](c_, objc.Sel("hasMediaType:"), mediaType) + return rv +} + +// Sets the illumination level when in torch mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624609-settorchmodeonwithlevel?language=objc +func (c_ CaptureDevice) SetTorchModeOnWithLevelError(torchLevel float64, outError foundation.IError) bool { + rv := objc.Call[bool](c_, objc.Sel("setTorchModeOnWithLevel:error:"), torchLevel, objc.Ptr(outError)) + return rv +} + +// Returns the default device for the specified device type, media type, and position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/2361508-defaultdevicewithdevicetype?language=objc +func (cc _CaptureDeviceClass) DefaultDeviceWithDeviceTypeMediaTypePosition(deviceType CaptureDeviceType, mediaType MediaType, position CaptureDevicePosition) CaptureDevice { + rv := objc.Call[CaptureDevice](cc, objc.Sel("defaultDeviceWithDeviceType:mediaType:position:"), deviceType, mediaType, position) + return rv +} + +// Returns the default device for the specified device type, media type, and position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/2361508-defaultdevicewithdevicetype?language=objc +func CaptureDevice_DefaultDeviceWithDeviceTypeMediaTypePosition(deviceType CaptureDeviceType, mediaType MediaType, position CaptureDevicePosition) CaptureDevice { + return CaptureDeviceClass.DefaultDeviceWithDeviceTypeMediaTypePosition(deviceType, mediaType, position) +} + +// Creates an object that represents a device with the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388904-devicewithuniqueid?language=objc +func (cc _CaptureDeviceClass) DeviceWithUniqueID(deviceUniqueID string) CaptureDevice { + rv := objc.Call[CaptureDevice](cc, objc.Sel("deviceWithUniqueID:"), deviceUniqueID) + return rv +} + +// Creates an object that represents a device with the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388904-devicewithuniqueid?language=objc +func CaptureDevice_DeviceWithUniqueID(deviceUniqueID string) CaptureDevice { + return CaptureDeviceClass.DeviceWithUniqueID(deviceUniqueID) +} + +// Returns a Boolean value that indicates whether the device supports the specified white balance mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388587-iswhitebalancemodesupported?language=objc +func (c_ CaptureDevice) IsWhiteBalanceModeSupported(whiteBalanceMode CaptureWhiteBalanceMode) bool { + rv := objc.Call[bool](c_, objc.Sel("isWhiteBalanceModeSupported:"), whiteBalanceMode) + return rv +} + +// Sets the transport control’s playback mode and speed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388481-settransportcontrolsplaybackmode?language=objc +func (c_ CaptureDevice) SetTransportControlsPlaybackModeSpeed(mode CaptureDeviceTransportControlsPlaybackMode, speed CaptureDeviceTransportControlsSpeed) { + objc.Call[objc.Void](c_, objc.Sel("setTransportControlsPlaybackMode:speed:"), mode, speed) +} + +// Returns the default device that captures the specified media type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386589-defaultdevicewithmediatype?language=objc +func (cc _CaptureDeviceClass) DefaultDeviceWithMediaType(mediaType MediaType) CaptureDevice { + rv := objc.Call[CaptureDevice](cc, objc.Sel("defaultDeviceWithMediaType:"), mediaType) + return rv +} + +// Returns the default device that captures the specified media type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386589-defaultdevicewithmediatype?language=objc +func CaptureDevice_DefaultDeviceWithMediaType(mediaType MediaType) CaptureDevice { + return CaptureDeviceClass.DefaultDeviceWithMediaType(mediaType) +} + +// Displays the system’s user interface to configure video effects or microphone modes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850459-showsystemuserinterface?language=objc +func (cc _CaptureDeviceClass) ShowSystemUserInterface(systemUserInterface CaptureSystemUserInterface) { + objc.Call[objc.Void](cc, objc.Sel("showSystemUserInterface:"), systemUserInterface) +} + +// Displays the system’s user interface to configure video effects or microphone modes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850459-showsystemuserinterface?language=objc +func CaptureDevice_ShowSystemUserInterface(systemUserInterface CaptureSystemUserInterface) { + CaptureDeviceClass.ShowSystemUserInterface(systemUserInterface) +} + +// Releases exclusive control over device hardware properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387917-unlockforconfiguration?language=objc +func (c_ CaptureDevice) UnlockForConfiguration() { + objc.Call[objc.Void](c_, objc.Sel("unlockForConfiguration")) +} + +// Requests the user’s permission to allow the app to capture media of a particular type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624584-requestaccessformediatype?language=objc +func (cc _CaptureDeviceClass) RequestAccessForMediaTypeCompletionHandler(mediaType MediaType, handler func(granted bool)) { + objc.Call[objc.Void](cc, objc.Sel("requestAccessForMediaType:completionHandler:"), mediaType, handler) +} + +// Requests the user’s permission to allow the app to capture media of a particular type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624584-requestaccessformediatype?language=objc +func CaptureDevice_RequestAccessForMediaTypeCompletionHandler(mediaType MediaType, handler func(granted bool)) { + CaptureDeviceClass.RequestAccessForMediaTypeCompletionHandler(mediaType, handler) +} + +// Returns a Boolean value that indicates whether the device supports the specified focus mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1390215-isfocusmodesupported?language=objc +func (c_ CaptureDevice) IsFocusModeSupported(focusMode CaptureFocusMode) bool { + rv := objc.Call[bool](c_, objc.Sel("isFocusModeSupported:"), focusMode) + return rv +} + +// Returns a Boolean value that indicates whether a device supports the specified exposure mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389048-isexposuremodesupported?language=objc +func (c_ CaptureDevice) IsExposureModeSupported(exposureMode CaptureExposureMode) bool { + rv := objc.Call[bool](c_, objc.Sel("isExposureModeSupported:"), exposureMode) + return rv +} + +// Requests exclusive access to configure device hardware properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387810-lockforconfiguration?language=objc +func (c_ CaptureDevice) LockForConfiguration(outError foundation.IError) bool { + rv := objc.Call[bool](c_, objc.Sel("lockForConfiguration:"), objc.Ptr(outError)) + return rv +} + +// Returns a Boolean value that indicates whether the device supports the specified torch mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388822-istorchmodesupported?language=objc +func (c_ CaptureDevice) IsTorchModeSupported(torchMode CaptureTorchMode) bool { + rv := objc.Call[bool](c_, objc.Sel("isTorchModeSupported:"), torchMode) + return rv +} + +// Sets the switching behavior of the primary constituent device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875310-setprimaryconstituentdeviceswitc?language=objc +func (c_ CaptureDevice) SetPrimaryConstituentDeviceSwitchingBehaviorRestrictedSwitchingBehaviorConditions(switchingBehavior CapturePrimaryConstituentDeviceSwitchingBehavior, restrictedSwitchingBehaviorConditions CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryConstituentDeviceSwitchingBehavior:restrictedSwitchingBehaviorConditions:"), switchingBehavior, restrictedSwitchingBehaviorConditions) +} + +// Returns a Boolean value that indicates whether you can use the device with capture session configured with the specified preset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386263-supportsavcapturesessionpreset?language=objc +func (c_ CaptureDevice) SupportsAVCaptureSessionPreset(preset CaptureSessionPreset) bool { + rv := objc.Call[bool](c_, objc.Sel("supportsAVCaptureSessionPreset:"), preset) + return rv +} + +// The capture formats a device supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388738-formats?language=objc +func (c_ CaptureDevice) Formats() []CaptureDeviceFormat { + rv := objc.Call[[]CaptureDeviceFormat](c_, objc.Sel("formats")) + return rv +} + +// A Boolean value that indicates whether another app is using the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389512-inusebyanotherapplication?language=objc +func (c_ CaptureDevice) IsInUseByAnotherApplication() bool { + rv := objc.Call[bool](c_, objc.Sel("isInUseByAnotherApplication")) + return rv +} + +// A Boolean value that indicates whether a user or an app enabled Center Stage on a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738419-centerstageenabled?language=objc +func (cc _CaptureDeviceClass) CenterStageEnabled() bool { + rv := objc.Call[bool](cc, objc.Sel("centerStageEnabled")) + return rv +} + +// A Boolean value that indicates whether a user or an app enabled Center Stage on a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738419-centerstageenabled?language=objc +func CaptureDevice_CenterStageEnabled() bool { + return CaptureDeviceClass.CenterStageEnabled() +} + +// A Boolean value that indicates whether a user or an app enabled Center Stage on a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738419-centerstageenabled?language=objc +func (cc _CaptureDeviceClass) SetCenterStageEnabled(value bool) { + objc.Call[objc.Void](cc, objc.Sel("setCenterStageEnabled:"), value) +} + +// A Boolean value that indicates whether a user or an app enabled Center Stage on a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738419-centerstageenabled?language=objc +func CaptureDevice_SetCenterStageEnabled(value bool) { + CaptureDeviceClass.SetCenterStageEnabled(value) +} + +// A model identifier for the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389500-modelid?language=objc +func (c_ CaptureDevice) ModelID() string { + rv := objc.Call[string](c_, objc.Sel("modelID")) + return rv +} + +// The microphone mode that the user selects in Control Center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850458-preferredmicrophonemode?language=objc +func (cc _CaptureDeviceClass) PreferredMicrophoneMode() CaptureMicrophoneMode { + rv := objc.Call[CaptureMicrophoneMode](cc, objc.Sel("preferredMicrophoneMode")) + return rv +} + +// The microphone mode that the user selects in Control Center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850458-preferredmicrophonemode?language=objc +func CaptureDevice_PreferredMicrophoneMode() CaptureMicrophoneMode { + return CaptureDeviceClass.PreferredMicrophoneMode() +} + +// The current playback mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386373-transportcontrolsplaybackmode?language=objc +func (c_ CaptureDevice) TransportControlsPlaybackMode() CaptureDeviceTransportControlsPlaybackMode { + rv := objc.Call[CaptureDeviceTransportControlsPlaybackMode](c_, objc.Sel("transportControlsPlaybackMode")) + return rv +} + +// The transport type of the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387804-transporttype?language=objc +func (c_ CaptureDevice) TransportType() int32 { + rv := objc.Call[int32](c_, objc.Sel("transportType")) + return rv +} + +// The current torch brightness level. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624605-torchlevel?language=objc +func (c_ CaptureDevice) TorchLevel() float64 { + rv := objc.Call[float64](c_, objc.Sel("torchLevel")) + return rv +} + +// The currently active maximum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387816-activevideomaxframeduration?language=objc +func (c_ CaptureDevice) ActiveVideoMaxFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("activeVideoMaxFrameDuration")) + return rv +} + +// The currently active maximum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387816-activevideomaxframeduration?language=objc +func (c_ CaptureDevice) SetActiveVideoMaxFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("setActiveVideoMaxFrameDuration:"), value) +} + +// A Boolean value that indicates whether the capture device has a flash. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388988-hasflash?language=objc +func (c_ CaptureDevice) HasFlash() bool { + rv := objc.Call[bool](c_, objc.Sel("hasFlash")) + return rv +} + +// A Boolean value that indicates whether the device supports a point of interest for exposure. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387263-exposurepointofinterestsupported?language=objc +func (c_ CaptureDevice) IsExposurePointOfInterestSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isExposurePointOfInterestSupported")) + return rv +} + +// The point of interest for focusing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1385853-focuspointofinterest?language=objc +func (c_ CaptureDevice) FocusPointOfInterest() coregraphics.Point { + rv := objc.Call[coregraphics.Point](c_, objc.Sel("focusPointOfInterest")) + return rv +} + +// The point of interest for focusing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1385853-focuspointofinterest?language=objc +func (c_ CaptureDevice) SetFocusPointOfInterest(value coregraphics.Point) { + objc.Call[objc.Void](c_, objc.Sel("setFocusPointOfInterest:"), value) +} + +// A Boolean value that indicates whether the device’s torch is currently active. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624578-torchactive?language=objc +func (c_ CaptureDevice) IsTorchActive() bool { + rv := objc.Call[bool](c_, objc.Sel("isTorchActive")) + return rv +} + +// The conditions that restrict the primary constituent device’s switching behavior. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875308-primaryconstituentdevicerestrict?language=objc +func (c_ CaptureDevice) PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions() CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions { + rv := objc.Call[CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions](c_, objc.Sel("primaryConstituentDeviceRestrictedSwitchingBehaviorConditions")) + return rv +} + +// The conditions that restrict camera switching behavior for the active primary constituent device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875305-activeprimaryconstituentdevicere?language=objc +func (c_ CaptureDevice) ActivePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions() CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions { + rv := objc.Call[CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions](c_, objc.Sel("activePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions")) + return rv +} + +// A Boolean value that indicates whether a device is currently connected to the system and available for use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389343-connected?language=objc +func (c_ CaptureDevice) IsConnected() bool { + rv := objc.Call[bool](c_, objc.Sel("isConnected")) + return rv +} + +// The device’s current flash mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388116-flashmode?language=objc +func (c_ CaptureDevice) FlashMode() CaptureFlashMode { + rv := objc.Call[CaptureFlashMode](c_, objc.Sel("flashMode")) + return rv +} + +// The device’s current flash mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388116-flashmode?language=objc +func (c_ CaptureDevice) SetFlashMode(value CaptureFlashMode) { + objc.Call[objc.Void](c_, objc.Sel("setFlashMode:"), value) +} + +// The capture device’s minimum focus distance in millimeters. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3751762-minimumfocusdistance?language=objc +func (c_ CaptureDevice) MinimumFocusDistance() int { + rv := objc.Call[int](c_, objc.Sel("minimumFocusDistance")) + return rv +} + +// A Boolean value that indicates whether the device is currently adjusting its exposure setting. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386253-adjustingexposure?language=objc +func (c_ CaptureDevice) IsAdjustingExposure() bool { + rv := objc.Call[bool](c_, objc.Sel("isAdjustingExposure")) + return rv +} + +// A localized device name for display in the user interface. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388222-localizedname?language=objc +func (c_ CaptureDevice) LocalizedName() string { + rv := objc.Call[string](c_, objc.Sel("localizedName")) + return rv +} + +// The current white balance mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386369-whitebalancemode?language=objc +func (c_ CaptureDevice) WhiteBalanceMode() CaptureWhiteBalanceMode { + rv := objc.Call[CaptureWhiteBalanceMode](c_, objc.Sel("whiteBalanceMode")) + return rv +} + +// The current white balance mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386369-whitebalancemode?language=objc +func (c_ CaptureDevice) SetWhiteBalanceMode(value CaptureWhiteBalanceMode) { + objc.Call[objc.Void](c_, objc.Sel("setWhiteBalanceMode:"), value) +} + +// An identifier that uniquely identifies the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1390477-uniqueid?language=objc +func (c_ CaptureDevice) UniqueID() string { + rv := objc.Call[string](c_, objc.Sel("uniqueID")) + return rv +} + +// The switching behavior of the active constituent device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875306-activeprimaryconstituentdevicesw?language=objc +func (c_ CaptureDevice) ActivePrimaryConstituentDeviceSwitchingBehavior() CapturePrimaryConstituentDeviceSwitchingBehavior { + rv := objc.Call[CapturePrimaryConstituentDeviceSwitchingBehavior](c_, objc.Sel("activePrimaryConstituentDeviceSwitchingBehavior")) + return rv +} + +// A Boolean value that specifies whether the capture device has a torch. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387674-hastorch?language=objc +func (c_ CaptureDevice) HasTorch() bool { + rv := objc.Call[bool](c_, objc.Sel("hasTorch")) + return rv +} + +// The physical position of the capture device hardware. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386909-position?language=objc +func (c_ CaptureDevice) Position() CaptureDevicePosition { + rv := objc.Call[CaptureDevicePosition](c_, objc.Sel("position")) + return rv +} + +// The currently active input source of the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1390141-activeinputsource?language=objc +func (c_ CaptureDevice) ActiveInputSource() CaptureDeviceInputSource { + rv := objc.Call[CaptureDeviceInputSource](c_, objc.Sel("activeInputSource")) + return rv +} + +// The currently active input source of the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1390141-activeinputsource?language=objc +func (c_ CaptureDevice) SetActiveInputSource(value ICaptureDeviceInputSource) { + objc.Call[objc.Void](c_, objc.Sel("setActiveInputSource:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether the torch is currently available for use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624626-torchavailable?language=objc +func (c_ CaptureDevice) IsTorchAvailable() bool { + rv := objc.Call[bool](c_, objc.Sel("isTorchAvailable")) + return rv +} + +// The current playback speed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386639-transportcontrolsspeed?language=objc +func (c_ CaptureDevice) TransportControlsSpeed() CaptureDeviceTransportControlsSpeed { + rv := objc.Call[CaptureDeviceTransportControlsSpeed](c_, objc.Sel("transportControlsSpeed")) + return rv +} + +// The constituent devices available to select as a fallback for a longer focal length primary constituent device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875311-supportedfallbackprimaryconstitu?language=objc +func (c_ CaptureDevice) SupportedFallbackPrimaryConstituentDevices() []CaptureDevice { + rv := objc.Call[[]CaptureDevice](c_, objc.Sel("supportedFallbackPrimaryConstituentDevices")) + return rv +} + +// A Boolean value that indicates whether the device is in a suspended state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387761-suspended?language=objc +func (c_ CaptureDevice) IsSuspended() bool { + rv := objc.Call[bool](c_, objc.Sel("isSuspended")) + return rv +} + +// A human-readable string for the manufacturer of the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1390193-manufacturer?language=objc +func (c_ CaptureDevice) Manufacturer() string { + rv := objc.Call[string](c_, objc.Sel("manufacturer")) + return rv +} + +// The current torch mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386035-torchmode?language=objc +func (c_ CaptureDevice) TorchMode() CaptureTorchMode { + rv := objc.Call[CaptureTorchMode](c_, objc.Sel("torchMode")) + return rv +} + +// The current torch mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386035-torchmode?language=objc +func (c_ CaptureDevice) SetTorchMode(value CaptureTorchMode) { + objc.Call[objc.Void](c_, objc.Sel("setTorchMode:"), value) +} + +// The switching behavior for the primary constituent device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875309-primaryconstituentdeviceswitchin?language=objc +func (c_ CaptureDevice) PrimaryConstituentDeviceSwitchingBehavior() CapturePrimaryConstituentDeviceSwitchingBehavior { + rv := objc.Call[CapturePrimaryConstituentDeviceSwitchingBehavior](c_, objc.Sel("primaryConstituentDeviceSwitchingBehavior")) + return rv +} + +// The currently active minimum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389290-activevideominframeduration?language=objc +func (c_ CaptureDevice) ActiveVideoMinFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("activeVideoMinFrameDuration")) + return rv +} + +// The currently active minimum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389290-activevideominframeduration?language=objc +func (c_ CaptureDevice) SetActiveVideoMinFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("setActiveVideoMinFrameDuration:"), value) +} + +// A Boolean value that indicates whether the flash is currently available for use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624627-flashavailable?language=objc +func (c_ CaptureDevice) IsFlashAvailable() bool { + rv := objc.Call[bool](c_, objc.Sel("isFlashAvailable")) + return rv +} + +// A Boolean value that indicates whether the Portrait video effect is active on a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850456-portraiteffectactive?language=objc +func (c_ CaptureDevice) IsPortraitEffectActive() bool { + rv := objc.Call[bool](c_, objc.Sel("isPortraitEffectActive")) + return rv +} + +// The capture device’s focus mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389191-focusmode?language=objc +func (c_ CaptureDevice) FocusMode() CaptureFocusMode { + rv := objc.Call[CaptureFocusMode](c_, objc.Sel("focusMode")) + return rv +} + +// The capture device’s focus mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389191-focusmode?language=objc +func (c_ CaptureDevice) SetFocusMode(value CaptureFocusMode) { + objc.Call[objc.Void](c_, objc.Sel("setFocusMode:"), value) +} + +// An array of input sources that the device supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388404-inputsources?language=objc +func (c_ CaptureDevice) InputSources() []CaptureDeviceInputSource { + rv := objc.Call[[]CaptureDeviceInputSource](c_, objc.Sel("inputSources")) + return rv +} + +// The exposure mode for the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388858-exposuremode?language=objc +func (c_ CaptureDevice) ExposureMode() CaptureExposureMode { + rv := objc.Call[CaptureExposureMode](c_, objc.Sel("exposureMode")) + return rv +} + +// The exposure mode for the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388858-exposuremode?language=objc +func (c_ CaptureDevice) SetExposureMode(value CaptureExposureMode) { + objc.Call[objc.Void](c_, objc.Sel("setExposureMode:"), value) +} + +// A Boolean value that indicates whether the user enabled the Portrait video effect in Control Center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850457-portraiteffectenabled?language=objc +func (cc _CaptureDeviceClass) PortraitEffectEnabled() bool { + rv := objc.Call[bool](cc, objc.Sel("portraitEffectEnabled")) + return rv +} + +// A Boolean value that indicates whether the user enabled the Portrait video effect in Control Center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850457-portraiteffectenabled?language=objc +func CaptureDevice_PortraitEffectEnabled() bool { + return CaptureDeviceClass.PortraitEffectEnabled() +} + +// A Boolean value that indicates whether the device supports a point of interest for focus. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1390436-focuspointofinterestsupported?language=objc +func (c_ CaptureDevice) IsFocusPointOfInterestSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isFocusPointOfInterestSupported")) + return rv +} + +// A Boolean value that indicates whether the device supports transport control commands. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388479-transportcontrolssupported?language=objc +func (c_ CaptureDevice) TransportControlsSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("transportControlsSupported")) + return rv +} + +// A virtual device’s active primary constituent device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875304-activeprimaryconstituentdevice?language=objc +func (c_ CaptureDevice) ActivePrimaryConstituentDevice() CaptureDevice { + rv := objc.Call[CaptureDevice](c_, objc.Sel("activePrimaryConstituentDevice")) + return rv +} + +// An array of capture devices that are physically linked to a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388720-linkeddevices?language=objc +func (c_ CaptureDevice) LinkedDevices() []CaptureDevice { + rv := objc.Call[[]CaptureDevice](c_, objc.Sel("linkedDevices")) + return rv +} + +// A Boolean value that indicates whether the device is currently adjusting the white balance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1386544-adjustingwhitebalance?language=objc +func (c_ CaptureDevice) IsAdjustingWhiteBalance() bool { + rv := objc.Call[bool](c_, objc.Sel("isAdjustingWhiteBalance")) + return rv +} + +// The type of device, such as a built-in microphone or wide-angle camera. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/2361119-devicetype?language=objc +func (c_ CaptureDevice) DeviceType() CaptureDeviceType { + rv := objc.Call[CaptureDeviceType](c_, objc.Sel("deviceType")) + return rv +} + +// A Boolean value that indicates whether the device is currently adjusting its focus setting. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1390577-adjustingfocus?language=objc +func (c_ CaptureDevice) IsAdjustingFocus() bool { + rv := objc.Call[bool](c_, objc.Sel("isAdjustingFocus")) + return rv +} + +// The point of interest for exposure. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388777-exposurepointofinterest?language=objc +func (c_ CaptureDevice) ExposurePointOfInterest() coregraphics.Point { + rv := objc.Call[coregraphics.Point](c_, objc.Sel("exposurePointOfInterest")) + return rv +} + +// The point of interest for exposure. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1388777-exposurepointofinterest?language=objc +func (c_ CaptureDevice) SetExposurePointOfInterest(value coregraphics.Point) { + objc.Call[objc.Void](c_, objc.Sel("setExposurePointOfInterest:"), value) +} + +// A value that indicates the current mode of Center Stage control. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738418-centerstagecontrolmode?language=objc +func (cc _CaptureDeviceClass) CenterStageControlMode() CaptureCenterStageControlMode { + rv := objc.Call[CaptureCenterStageControlMode](cc, objc.Sel("centerStageControlMode")) + return rv +} + +// A value that indicates the current mode of Center Stage control. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738418-centerstagecontrolmode?language=objc +func CaptureDevice_CenterStageControlMode() CaptureCenterStageControlMode { + return CaptureDeviceClass.CenterStageControlMode() +} + +// A value that indicates the current mode of Center Stage control. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738418-centerstagecontrolmode?language=objc +func (cc _CaptureDeviceClass) SetCenterStageControlMode(value CaptureCenterStageControlMode) { + objc.Call[objc.Void](cc, objc.Sel("setCenterStageControlMode:"), value) +} + +// A value that indicates the current mode of Center Stage control. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738418-centerstagecontrolmode?language=objc +func CaptureDevice_SetCenterStageControlMode(value CaptureCenterStageControlMode) { + CaptureDeviceClass.SetCenterStageControlMode(value) +} + +// The currently active color space for capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1648668-activecolorspace?language=objc +func (c_ CaptureDevice) ActiveColorSpace() CaptureColorSpace { + rv := objc.Call[CaptureColorSpace](c_, objc.Sel("activeColorSpace")) + return rv +} + +// The currently active color space for capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1648668-activecolorspace?language=objc +func (c_ CaptureDevice) SetActiveColorSpace(value CaptureColorSpace) { + objc.Call[objc.Void](c_, objc.Sel("setActiveColorSpace:"), value) +} + +// The fallback devices to use when a constituent device with a longer focal length becomes limited by its light sensitivity or minimum focus distance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875307-fallbackprimaryconstituentdevice?language=objc +func (c_ CaptureDevice) FallbackPrimaryConstituentDevices() []CaptureDevice { + rv := objc.Call[[]CaptureDevice](c_, objc.Sel("fallbackPrimaryConstituentDevices")) + return rv +} + +// The fallback devices to use when a constituent device with a longer focal length becomes limited by its light sensitivity or minimum focus distance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3875307-fallbackprimaryconstituentdevice?language=objc +func (c_ CaptureDevice) SetFallbackPrimaryConstituentDevices(value []ICaptureDevice) { + objc.Call[objc.Void](c_, objc.Sel("setFallbackPrimaryConstituentDevices:"), value) +} + +// The capture format in use by the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389221-activeformat?language=objc +func (c_ CaptureDevice) ActiveFormat() CaptureDeviceFormat { + rv := objc.Call[CaptureDeviceFormat](c_, objc.Sel("activeFormat")) + return rv +} + +// The capture format in use by the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1389221-activeformat?language=objc +func (c_ CaptureDevice) SetActiveFormat(value ICaptureDeviceFormat) { + objc.Call[objc.Void](c_, objc.Sel("setActiveFormat:"), objc.Ptr(value)) +} + +// The device’s active microphone mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850455-activemicrophonemode?language=objc +func (cc _CaptureDeviceClass) ActiveMicrophoneMode() CaptureMicrophoneMode { + rv := objc.Call[CaptureMicrophoneMode](cc, objc.Sel("activeMicrophoneMode")) + return rv +} + +// The device’s active microphone mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3850455-activemicrophonemode?language=objc +func CaptureDevice_ActiveMicrophoneMode() CaptureMicrophoneMode { + return CaptureDeviceClass.ActiveMicrophoneMode() +} + +// A Boolean value that indicates whether Center Stage is active on a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevice/3738417-centerstageactive?language=objc +func (c_ CaptureDevice) IsCenterStageActive() bool { + rv := objc.Call[bool](c_, objc.Sel("isCenterStageActive")) + return rv +} diff --git a/macos/avfoundation/capture_device_discovery_session.gen.go b/macos/avfoundation/capture_device_discovery_session.gen.go new file mode 100644 index 00000000..e3df77b2 --- /dev/null +++ b/macos/avfoundation/capture_device_discovery_session.gen.go @@ -0,0 +1,79 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureDeviceDiscoverySession] class. +var CaptureDeviceDiscoverySessionClass = _CaptureDeviceDiscoverySessionClass{objc.GetClass("AVCaptureDeviceDiscoverySession")} + +type _CaptureDeviceDiscoverySessionClass struct { + objc.Class +} + +// An interface definition for the [CaptureDeviceDiscoverySession] class. +type ICaptureDeviceDiscoverySession interface { + objc.IObject + Devices() []CaptureDevice +} + +// An object that finds capture devices that match specific search criteria. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevicediscoverysession?language=objc +type CaptureDeviceDiscoverySession struct { + objc.Object +} + +func CaptureDeviceDiscoverySessionFrom(ptr unsafe.Pointer) CaptureDeviceDiscoverySession { + return CaptureDeviceDiscoverySession{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureDeviceDiscoverySessionClass) DiscoverySessionWithDeviceTypesMediaTypePosition(deviceTypes []CaptureDeviceType, mediaType MediaType, position CaptureDevicePosition) CaptureDeviceDiscoverySession { + rv := objc.Call[CaptureDeviceDiscoverySession](cc, objc.Sel("discoverySessionWithDeviceTypes:mediaType:position:"), deviceTypes, mediaType, position) + return rv +} + +// Creates a discovery session that finds devices that match the specified criteria. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevicediscoverysession/2361539-discoverysessionwithdevicetypes?language=objc +func CaptureDeviceDiscoverySession_DiscoverySessionWithDeviceTypesMediaTypePosition(deviceTypes []CaptureDeviceType, mediaType MediaType, position CaptureDevicePosition) CaptureDeviceDiscoverySession { + return CaptureDeviceDiscoverySessionClass.DiscoverySessionWithDeviceTypesMediaTypePosition(deviceTypes, mediaType, position) +} + +func (cc _CaptureDeviceDiscoverySessionClass) Alloc() CaptureDeviceDiscoverySession { + rv := objc.Call[CaptureDeviceDiscoverySession](cc, objc.Sel("alloc")) + return rv +} + +func CaptureDeviceDiscoverySession_Alloc() CaptureDeviceDiscoverySession { + return CaptureDeviceDiscoverySessionClass.Alloc() +} + +func (cc _CaptureDeviceDiscoverySessionClass) New() CaptureDeviceDiscoverySession { + rv := objc.Call[CaptureDeviceDiscoverySession](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureDeviceDiscoverySession() CaptureDeviceDiscoverySession { + return CaptureDeviceDiscoverySessionClass.New() +} + +func (c_ CaptureDeviceDiscoverySession) Init() CaptureDeviceDiscoverySession { + rv := objc.Call[CaptureDeviceDiscoverySession](c_, objc.Sel("init")) + return rv +} + +// A list of devices that match the search criteria of the discovery session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevicediscoverysession/2361002-devices?language=objc +func (c_ CaptureDeviceDiscoverySession) Devices() []CaptureDevice { + rv := objc.Call[[]CaptureDevice](c_, objc.Sel("devices")) + return rv +} diff --git a/macos/avfoundation/capture_device_format.gen.go b/macos/avfoundation/capture_device_format.gen.go new file mode 100644 index 00000000..f89b208c --- /dev/null +++ b/macos/avfoundation/capture_device_format.gen.go @@ -0,0 +1,168 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureDeviceFormat] class. +var CaptureDeviceFormatClass = _CaptureDeviceFormatClass{objc.GetClass("AVCaptureDeviceFormat")} + +type _CaptureDeviceFormatClass struct { + objc.Class +} + +// An interface definition for the [CaptureDeviceFormat] class. +type ICaptureDeviceFormat interface { + objc.IObject + VideoSupportedFrameRateRanges() []FrameRateRange + AutoFocusSystem() CaptureAutoFocusSystem + IsHighPhotoQualitySupported() bool + VideoMaxZoomFactorForCenterStage() float64 + VideoFrameRateRangeForPortraitEffect() FrameRateRange + MediaType() MediaType + IsPortraitEffectSupported() bool + SupportedColorSpaces() []foundation.Number + IsCenterStageSupported() bool + VideoFrameRateRangeForCenterStage() FrameRateRange + VideoMinZoomFactorForCenterStage() float64 + FormatDescription() coremedia.FormatDescriptionRef +} + +// A class that defines media formats and capture settings that capture devices support. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat?language=objc +type CaptureDeviceFormat struct { + objc.Object +} + +func CaptureDeviceFormatFrom(ptr unsafe.Pointer) CaptureDeviceFormat { + return CaptureDeviceFormat{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureDeviceFormatClass) Alloc() CaptureDeviceFormat { + rv := objc.Call[CaptureDeviceFormat](cc, objc.Sel("alloc")) + return rv +} + +func CaptureDeviceFormat_Alloc() CaptureDeviceFormat { + return CaptureDeviceFormatClass.Alloc() +} + +func (cc _CaptureDeviceFormatClass) New() CaptureDeviceFormat { + rv := objc.Call[CaptureDeviceFormat](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureDeviceFormat() CaptureDeviceFormat { + return CaptureDeviceFormatClass.New() +} + +func (c_ CaptureDeviceFormat) Init() CaptureDeviceFormat { + rv := objc.Call[CaptureDeviceFormat](c_, objc.Sel("init")) + return rv +} + +// A list of frame rate ranges that a format supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/1387592-videosupportedframerateranges?language=objc +func (c_ CaptureDeviceFormat) VideoSupportedFrameRateRanges() []FrameRateRange { + rv := objc.Call[[]FrameRateRange](c_, objc.Sel("videoSupportedFrameRateRanges")) + return rv +} + +// The auto focus system the format uses. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/1624600-autofocussystem?language=objc +func (c_ CaptureDeviceFormat) AutoFocusSystem() CaptureAutoFocusSystem { + rv := objc.Call[CaptureAutoFocusSystem](c_, objc.Sel("autoFocusSystem")) + return rv +} + +// A Boolean value that indicates whether this format supports high-quality capture with the current quality prioritization setting. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/3751763-highphotoqualitysupported?language=objc +func (c_ CaptureDeviceFormat) IsHighPhotoQualitySupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isHighPhotoQualitySupported")) + return rv +} + +// The maximum zoom factor available when Center Stage is active. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/3738422-videomaxzoomfactorforcenterstage?language=objc +func (c_ CaptureDeviceFormat) VideoMaxZoomFactorForCenterStage() float64 { + rv := objc.Call[float64](c_, objc.Sel("videoMaxZoomFactorForCenterStage")) + return rv +} + +// The range of frame rates available when Portrait Effect is active. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/3875313-videoframeraterangeforportraitef?language=objc +func (c_ CaptureDeviceFormat) VideoFrameRateRangeForPortraitEffect() FrameRateRange { + rv := objc.Call[FrameRateRange](c_, objc.Sel("videoFrameRateRangeForPortraitEffect")) + return rv +} + +// A constant describing the media type of an AVCaptureDevice active or supported format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/1388503-mediatype?language=objc +func (c_ CaptureDeviceFormat) MediaType() MediaType { + rv := objc.Call[MediaType](c_, objc.Sel("mediaType")) + return rv +} + +// A Boolean value that indicates whether the format supports the Portrait Effect feature. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/3875312-portraiteffectsupported?language=objc +func (c_ CaptureDeviceFormat) IsPortraitEffectSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isPortraitEffectSupported")) + return rv +} + +// The list of color spaces the format supports for image and video capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/1648611-supportedcolorspaces?language=objc +func (c_ CaptureDeviceFormat) SupportedColorSpaces() []foundation.Number { + rv := objc.Call[[]foundation.Number](c_, objc.Sel("supportedColorSpaces")) + return rv +} + +// A Boolean value that indicates whether the format supports Center Stage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/3738420-centerstagesupported?language=objc +func (c_ CaptureDeviceFormat) IsCenterStageSupported() bool { + rv := objc.Call[bool](c_, objc.Sel("isCenterStageSupported")) + return rv +} + +// The range of frame rates available when Center Stage is active. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/3738421-videoframeraterangeforcenterstag?language=objc +func (c_ CaptureDeviceFormat) VideoFrameRateRangeForCenterStage() FrameRateRange { + rv := objc.Call[FrameRateRange](c_, objc.Sel("videoFrameRateRangeForCenterStage")) + return rv +} + +// The minimum zoom factor available when Center Stage is active. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/3738423-videominzoomfactorforcenterstage?language=objc +func (c_ CaptureDeviceFormat) VideoMinZoomFactorForCenterStage() float64 { + rv := objc.Call[float64](c_, objc.Sel("videoMinZoomFactorForCenterStage")) + return rv +} + +// An object describing the capture format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceformat/1389445-formatdescription?language=objc +func (c_ CaptureDeviceFormat) FormatDescription() coremedia.FormatDescriptionRef { + rv := objc.Call[coremedia.FormatDescriptionRef](c_, objc.Sel("formatDescription")) + return rv +} diff --git a/macos/avfoundation/capture_device_input.gen.go b/macos/avfoundation/capture_device_input.gen.go new file mode 100644 index 00000000..317efdf8 --- /dev/null +++ b/macos/avfoundation/capture_device_input.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureDeviceInput] class. +var CaptureDeviceInputClass = _CaptureDeviceInputClass{objc.GetClass("AVCaptureDeviceInput")} + +type _CaptureDeviceInputClass struct { + objc.Class +} + +// An interface definition for the [CaptureDeviceInput] class. +type ICaptureDeviceInput interface { + ICaptureInput + Device() CaptureDevice +} + +// An object that provides media input from a capture device to a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceinput?language=objc +type CaptureDeviceInput struct { + CaptureInput +} + +func CaptureDeviceInputFrom(ptr unsafe.Pointer) CaptureDeviceInput { + return CaptureDeviceInput{ + CaptureInput: CaptureInputFrom(ptr), + } +} + +func (c_ CaptureDeviceInput) InitWithDeviceError(device ICaptureDevice, outError foundation.IError) CaptureDeviceInput { + rv := objc.Call[CaptureDeviceInput](c_, objc.Sel("initWithDevice:error:"), objc.Ptr(device), objc.Ptr(outError)) + return rv +} + +// Creates an input for the specified capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceinput/1387609-initwithdevice?language=objc +func NewCaptureDeviceInputWithDeviceError(device ICaptureDevice, outError foundation.IError) CaptureDeviceInput { + instance := CaptureDeviceInputClass.Alloc().InitWithDeviceError(device, outError) + instance.Autorelease() + return instance +} + +func (cc _CaptureDeviceInputClass) DeviceInputWithDeviceError(device ICaptureDevice, outError foundation.IError) CaptureDeviceInput { + rv := objc.Call[CaptureDeviceInput](cc, objc.Sel("deviceInputWithDevice:error:"), objc.Ptr(device), objc.Ptr(outError)) + return rv +} + +// Returns a new input for the specified capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceinput/1450880-deviceinputwithdevice?language=objc +func CaptureDeviceInput_DeviceInputWithDeviceError(device ICaptureDevice, outError foundation.IError) CaptureDeviceInput { + return CaptureDeviceInputClass.DeviceInputWithDeviceError(device, outError) +} + +func (cc _CaptureDeviceInputClass) Alloc() CaptureDeviceInput { + rv := objc.Call[CaptureDeviceInput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureDeviceInput_Alloc() CaptureDeviceInput { + return CaptureDeviceInputClass.Alloc() +} + +func (cc _CaptureDeviceInputClass) New() CaptureDeviceInput { + rv := objc.Call[CaptureDeviceInput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureDeviceInput() CaptureDeviceInput { + return CaptureDeviceInputClass.New() +} + +func (c_ CaptureDeviceInput) Init() CaptureDeviceInput { + rv := objc.Call[CaptureDeviceInput](c_, objc.Sel("init")) + return rv +} + +// A capture device associated with this input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceinput/1387915-device?language=objc +func (c_ CaptureDeviceInput) Device() CaptureDevice { + rv := objc.Call[CaptureDevice](c_, objc.Sel("device")) + return rv +} diff --git a/macos/avfoundation/capture_device_input_source.gen.go b/macos/avfoundation/capture_device_input_source.gen.go new file mode 100644 index 00000000..ee9ac4cd --- /dev/null +++ b/macos/avfoundation/capture_device_input_source.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureDeviceInputSource] class. +var CaptureDeviceInputSourceClass = _CaptureDeviceInputSourceClass{objc.GetClass("AVCaptureDeviceInputSource")} + +type _CaptureDeviceInputSourceClass struct { + objc.Class +} + +// An interface definition for the [CaptureDeviceInputSource] class. +type ICaptureDeviceInputSource interface { + objc.IObject + InputSourceID() string + LocalizedName() string +} + +// A distinct input source on a capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceinputsource?language=objc +type CaptureDeviceInputSource struct { + objc.Object +} + +func CaptureDeviceInputSourceFrom(ptr unsafe.Pointer) CaptureDeviceInputSource { + return CaptureDeviceInputSource{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureDeviceInputSourceClass) Alloc() CaptureDeviceInputSource { + rv := objc.Call[CaptureDeviceInputSource](cc, objc.Sel("alloc")) + return rv +} + +func CaptureDeviceInputSource_Alloc() CaptureDeviceInputSource { + return CaptureDeviceInputSourceClass.Alloc() +} + +func (cc _CaptureDeviceInputSourceClass) New() CaptureDeviceInputSource { + rv := objc.Call[CaptureDeviceInputSource](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureDeviceInputSource() CaptureDeviceInputSource { + return CaptureDeviceInputSourceClass.New() +} + +func (c_ CaptureDeviceInputSource) Init() CaptureDeviceInputSource { + rv := objc.Call[CaptureDeviceInputSource](c_, objc.Sel("init")) + return rv +} + +// An identifier for an input source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceinputsource/1387788-inputsourceid?language=objc +func (c_ CaptureDeviceInputSource) InputSourceID() string { + rv := objc.Call[string](c_, objc.Sel("inputSourceID")) + return rv +} + +// A localized, human-readable name for the input source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceinputsource/1390422-localizedname?language=objc +func (c_ CaptureDeviceInputSource) LocalizedName() string { + rv := objc.Call[string](c_, objc.Sel("localizedName")) + return rv +} diff --git a/macos/avfoundation/capture_file_output.gen.go b/macos/avfoundation/capture_file_output.gen.go new file mode 100644 index 00000000..2f8c9351 --- /dev/null +++ b/macos/avfoundation/capture_file_output.gen.go @@ -0,0 +1,223 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureFileOutput] class. +var CaptureFileOutputClass = _CaptureFileOutputClass{objc.GetClass("AVCaptureFileOutput")} + +type _CaptureFileOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureFileOutput] class. +type ICaptureFileOutput interface { + ICaptureOutput + PauseRecording() + StartRecordingToOutputFileURLRecordingDelegate(outputFileURL foundation.IURL, delegate PCaptureFileOutputRecordingDelegate) + StartRecordingToOutputFileURLRecordingDelegateObject(outputFileURL foundation.IURL, delegateObject objc.IObject) + StopRecording() + ResumeRecording() + IsRecordingPaused() bool + MaxRecordedFileSize() int64 + SetMaxRecordedFileSize(value int64) + MaxRecordedDuration() coremedia.Time + SetMaxRecordedDuration(value coremedia.Time) + IsRecording() bool + Delegate() CaptureFileOutputDelegateWrapper + SetDelegate(value PCaptureFileOutputDelegate) + SetDelegateObject(valueObject objc.IObject) + MinFreeDiskSpaceLimit() int64 + SetMinFreeDiskSpaceLimit(value int64) + RecordedDuration() coremedia.Time + OutputFileURL() foundation.URL + RecordedFileSize() int64 +} + +// The abstract superclass for capture outputs that can record captured data to a file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput?language=objc +type CaptureFileOutput struct { + CaptureOutput +} + +func CaptureFileOutputFrom(ptr unsafe.Pointer) CaptureFileOutput { + return CaptureFileOutput{ + CaptureOutput: CaptureOutputFrom(ptr), + } +} + +func (cc _CaptureFileOutputClass) Alloc() CaptureFileOutput { + rv := objc.Call[CaptureFileOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureFileOutput_Alloc() CaptureFileOutput { + return CaptureFileOutputClass.Alloc() +} + +func (cc _CaptureFileOutputClass) New() CaptureFileOutput { + rv := objc.Call[CaptureFileOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureFileOutput() CaptureFileOutput { + return CaptureFileOutputClass.New() +} + +func (c_ CaptureFileOutput) Init() CaptureFileOutput { + rv := objc.Call[CaptureFileOutput](c_, objc.Sel("init")) + return rv +} + +// Pauses recording to the current output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1386806-pauserecording?language=objc +func (c_ CaptureFileOutput) PauseRecording() { + objc.Call[objc.Void](c_, objc.Sel("pauseRecording")) +} + +// Starts recording media to the specified output URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387224-startrecordingtooutputfileurl?language=objc +func (c_ CaptureFileOutput) StartRecordingToOutputFileURLRecordingDelegate(outputFileURL foundation.IURL, delegate PCaptureFileOutputRecordingDelegate) { + po1 := objc.WrapAsProtocol("AVCaptureFileOutputRecordingDelegate", delegate) + objc.Call[objc.Void](c_, objc.Sel("startRecordingToOutputFileURL:recordingDelegate:"), objc.Ptr(outputFileURL), po1) +} + +// Starts recording media to the specified output URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387224-startrecordingtooutputfileurl?language=objc +func (c_ CaptureFileOutput) StartRecordingToOutputFileURLRecordingDelegateObject(outputFileURL foundation.IURL, delegateObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("startRecordingToOutputFileURL:recordingDelegate:"), objc.Ptr(outputFileURL), objc.Ptr(delegateObject)) +} + +// Tells the receiver to stop recording to the current file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1389485-stoprecording?language=objc +func (c_ CaptureFileOutput) StopRecording() { + objc.Call[objc.Void](c_, objc.Sel("stopRecording")) +} + +// Resumes recording to the current output file after it was previously paused using pauseRecording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1389849-resumerecording?language=objc +func (c_ CaptureFileOutput) ResumeRecording() { + objc.Call[objc.Void](c_, objc.Sel("resumeRecording")) +} + +// Indicates whether recording to the current output file is paused. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1385716-recordingpaused?language=objc +func (c_ CaptureFileOutput) IsRecordingPaused() bool { + rv := objc.Call[bool](c_, objc.Sel("isRecordingPaused")) + return rv +} + +// The maximum size, in bytes, of the data that should be recorded by the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387684-maxrecordedfilesize?language=objc +func (c_ CaptureFileOutput) MaxRecordedFileSize() int64 { + rv := objc.Call[int64](c_, objc.Sel("maxRecordedFileSize")) + return rv +} + +// The maximum size, in bytes, of the data that should be recorded by the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387684-maxrecordedfilesize?language=objc +func (c_ CaptureFileOutput) SetMaxRecordedFileSize(value int64) { + objc.Call[objc.Void](c_, objc.Sel("setMaxRecordedFileSize:"), value) +} + +// The longest duration allowed for the recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387390-maxrecordedduration?language=objc +func (c_ CaptureFileOutput) MaxRecordedDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("maxRecordedDuration")) + return rv +} + +// The longest duration allowed for the recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387390-maxrecordedduration?language=objc +func (c_ CaptureFileOutput) SetMaxRecordedDuration(value coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("setMaxRecordedDuration:"), value) +} + +// Indicates whether recording is in progress. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387539-recording?language=objc +func (c_ CaptureFileOutput) IsRecording() bool { + rv := objc.Call[bool](c_, objc.Sel("isRecording")) + return rv +} + +// The delegate object for the capture file output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1388718-delegate?language=objc +func (c_ CaptureFileOutput) Delegate() CaptureFileOutputDelegateWrapper { + rv := objc.Call[CaptureFileOutputDelegateWrapper](c_, objc.Sel("delegate")) + return rv +} + +// The delegate object for the capture file output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1388718-delegate?language=objc +func (c_ CaptureFileOutput) SetDelegate(value PCaptureFileOutputDelegate) { + po0 := objc.WrapAsProtocol("AVCaptureFileOutputDelegate", value) + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), po0) +} + +// The delegate object for the capture file output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1388718-delegate?language=objc +func (c_ CaptureFileOutput) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// The minimum amount of free space, in bytes, required for recording to continue on a given volume. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387523-minfreediskspacelimit?language=objc +func (c_ CaptureFileOutput) MinFreeDiskSpaceLimit() int64 { + rv := objc.Call[int64](c_, objc.Sel("minFreeDiskSpaceLimit")) + return rv +} + +// The minimum amount of free space, in bytes, required for recording to continue on a given volume. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1387523-minfreediskspacelimit?language=objc +func (c_ CaptureFileOutput) SetMinFreeDiskSpaceLimit(value int64) { + objc.Call[objc.Void](c_, objc.Sel("setMinFreeDiskSpaceLimit:"), value) +} + +// Indicates the duration of the media recorded to the current output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1389028-recordedduration?language=objc +func (c_ CaptureFileOutput) RecordedDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("recordedDuration")) + return rv +} + +// The URL to which output is directed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1388576-outputfileurl?language=objc +func (c_ CaptureFileOutput) OutputFileURL() foundation.URL { + rv := objc.Call[foundation.URL](c_, objc.Sel("outputFileURL")) + return rv +} + +// Indicates the size, in bytes, of the data recorded to the current output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutput/1386933-recordedfilesize?language=objc +func (c_ CaptureFileOutput) RecordedFileSize() int64 { + rv := objc.Call[int64](c_, objc.Sel("recordedFileSize")) + return rv +} diff --git a/macos/avfoundation/capture_file_output_delegate.gen.go b/macos/avfoundation/capture_file_output_delegate.gen.go new file mode 100644 index 00000000..886aca64 --- /dev/null +++ b/macos/avfoundation/capture_file_output_delegate.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// Methods for monitoring or controlling the output of a media file capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputdelegate?language=objc +type PCaptureFileOutputDelegate interface { + // optional + CaptureOutputShouldProvideSampleAccurateRecordingStart(output CaptureOutput) bool + HasCaptureOutputShouldProvideSampleAccurateRecordingStart() bool + + // optional + CaptureOutputDidOutputSampleBufferFromConnection(output CaptureFileOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) + HasCaptureOutputDidOutputSampleBufferFromConnection() bool +} + +// A delegate implementation builder for the [PCaptureFileOutputDelegate] protocol. +type CaptureFileOutputDelegate struct { + _CaptureOutputShouldProvideSampleAccurateRecordingStart func(output CaptureOutput) bool + _CaptureOutputDidOutputSampleBufferFromConnection func(output CaptureFileOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) +} + +func (di *CaptureFileOutputDelegate) HasCaptureOutputShouldProvideSampleAccurateRecordingStart() bool { + return di._CaptureOutputShouldProvideSampleAccurateRecordingStart != nil +} + +// Allows a client to opt in to frame accurate recording in captureOutput:didOutputSampleBuffer:fromConnection:. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputdelegate/1388760-captureoutputshouldprovidesample?language=objc +func (di *CaptureFileOutputDelegate) SetCaptureOutputShouldProvideSampleAccurateRecordingStart(f func(output CaptureOutput) bool) { + di._CaptureOutputShouldProvideSampleAccurateRecordingStart = f +} + +// Allows a client to opt in to frame accurate recording in captureOutput:didOutputSampleBuffer:fromConnection:. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputdelegate/1388760-captureoutputshouldprovidesample?language=objc +func (di *CaptureFileOutputDelegate) CaptureOutputShouldProvideSampleAccurateRecordingStart(output CaptureOutput) bool { + return di._CaptureOutputShouldProvideSampleAccurateRecordingStart(output) +} +func (di *CaptureFileOutputDelegate) HasCaptureOutputDidOutputSampleBufferFromConnection() bool { + return di._CaptureOutputDidOutputSampleBufferFromConnection != nil +} + +// Gives the delegate the opportunity to inspect samples as they are received by the output and start and stop recording at exact times. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputdelegate/1390096-captureoutput?language=objc +func (di *CaptureFileOutputDelegate) SetCaptureOutputDidOutputSampleBufferFromConnection(f func(output CaptureFileOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection)) { + di._CaptureOutputDidOutputSampleBufferFromConnection = f +} + +// Gives the delegate the opportunity to inspect samples as they are received by the output and start and stop recording at exact times. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputdelegate/1390096-captureoutput?language=objc +func (di *CaptureFileOutputDelegate) CaptureOutputDidOutputSampleBufferFromConnection(output CaptureFileOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) { + di._CaptureOutputDidOutputSampleBufferFromConnection(output, sampleBuffer, connection) +} + +// A concrete type wrapper for the [PCaptureFileOutputDelegate] protocol. +type CaptureFileOutputDelegateWrapper struct { + objc.Object +} + +func (c_ CaptureFileOutputDelegateWrapper) HasCaptureOutputShouldProvideSampleAccurateRecordingStart() bool { + return c_.RespondsToSelector(objc.Sel("captureOutputShouldProvideSampleAccurateRecordingStart:")) +} + +// Allows a client to opt in to frame accurate recording in captureOutput:didOutputSampleBuffer:fromConnection:. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputdelegate/1388760-captureoutputshouldprovidesample?language=objc +func (c_ CaptureFileOutputDelegateWrapper) CaptureOutputShouldProvideSampleAccurateRecordingStart(output ICaptureOutput) bool { + rv := objc.Call[bool](c_, objc.Sel("captureOutputShouldProvideSampleAccurateRecordingStart:"), objc.Ptr(output)) + return rv +} + +func (c_ CaptureFileOutputDelegateWrapper) HasCaptureOutputDidOutputSampleBufferFromConnection() bool { + return c_.RespondsToSelector(objc.Sel("captureOutput:didOutputSampleBuffer:fromConnection:")) +} + +// Gives the delegate the opportunity to inspect samples as they are received by the output and start and stop recording at exact times. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputdelegate/1390096-captureoutput?language=objc +func (c_ CaptureFileOutputDelegateWrapper) CaptureOutputDidOutputSampleBufferFromConnection(output ICaptureFileOutput, sampleBuffer coremedia.SampleBufferRef, connection ICaptureConnection) { + objc.Call[objc.Void](c_, objc.Sel("captureOutput:didOutputSampleBuffer:fromConnection:"), objc.Ptr(output), sampleBuffer, objc.Ptr(connection)) +} diff --git a/macos/avfoundation/capture_file_output_recording_delegate.gen.go b/macos/avfoundation/capture_file_output_recording_delegate.gen.go new file mode 100644 index 00000000..fa2c2f8c --- /dev/null +++ b/macos/avfoundation/capture_file_output_recording_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Methods for responding to events that occur while recording captured media to a file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputrecordingdelegate?language=objc +type PCaptureFileOutputRecordingDelegate interface { + // optional + CaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections(output CaptureFileOutput, fileURL foundation.URL, connections []CaptureConnection) + HasCaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections() bool +} + +// A delegate implementation builder for the [PCaptureFileOutputRecordingDelegate] protocol. +type CaptureFileOutputRecordingDelegate struct { + _CaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections func(output CaptureFileOutput, fileURL foundation.URL, connections []CaptureConnection) +} + +func (di *CaptureFileOutputRecordingDelegate) HasCaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections() bool { + return di._CaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections != nil +} + +// Called whenever the output is recording to a file and successfully pauses the recording at the request of a client. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputrecordingdelegate/1388838-captureoutput?language=objc +func (di *CaptureFileOutputRecordingDelegate) SetCaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections(f func(output CaptureFileOutput, fileURL foundation.URL, connections []CaptureConnection)) { + di._CaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections = f +} + +// Called whenever the output is recording to a file and successfully pauses the recording at the request of a client. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputrecordingdelegate/1388838-captureoutput?language=objc +func (di *CaptureFileOutputRecordingDelegate) CaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections(output CaptureFileOutput, fileURL foundation.URL, connections []CaptureConnection) { + di._CaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections(output, fileURL, connections) +} + +// A concrete type wrapper for the [PCaptureFileOutputRecordingDelegate] protocol. +type CaptureFileOutputRecordingDelegateWrapper struct { + objc.Object +} + +func (c_ CaptureFileOutputRecordingDelegateWrapper) HasCaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections() bool { + return c_.RespondsToSelector(objc.Sel("captureOutput:didPauseRecordingToOutputFileAtURL:fromConnections:")) +} + +// Called whenever the output is recording to a file and successfully pauses the recording at the request of a client. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefileoutputrecordingdelegate/1388838-captureoutput?language=objc +func (c_ CaptureFileOutputRecordingDelegateWrapper) CaptureOutputDidPauseRecordingToOutputFileAtURLFromConnections(output ICaptureFileOutput, fileURL foundation.IURL, connections []ICaptureConnection) { + objc.Call[objc.Void](c_, objc.Sel("captureOutput:didPauseRecordingToOutputFileAtURL:fromConnections:"), objc.Ptr(output), objc.Ptr(fileURL), connections) +} diff --git a/macos/avfoundation/capture_input.gen.go b/macos/avfoundation/capture_input.gen.go new file mode 100644 index 00000000..30c5ea78 --- /dev/null +++ b/macos/avfoundation/capture_input.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureInput] class. +var CaptureInputClass = _CaptureInputClass{objc.GetClass("AVCaptureInput")} + +type _CaptureInputClass struct { + objc.Class +} + +// An interface definition for the [CaptureInput] class. +type ICaptureInput interface { + objc.IObject + Ports() []CaptureInputPort +} + +// An abstract superclass for objects that provide input data to a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinput?language=objc +type CaptureInput struct { + objc.Object +} + +func CaptureInputFrom(ptr unsafe.Pointer) CaptureInput { + return CaptureInput{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureInputClass) Alloc() CaptureInput { + rv := objc.Call[CaptureInput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureInput_Alloc() CaptureInput { + return CaptureInputClass.Alloc() +} + +func (cc _CaptureInputClass) New() CaptureInput { + rv := objc.Call[CaptureInput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureInput() CaptureInput { + return CaptureInputClass.New() +} + +func (c_ CaptureInput) Init() CaptureInput { + rv := objc.Call[CaptureInput](c_, objc.Sel("init")) + return rv +} + +// The ports available on a capture input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinput/1386635-ports?language=objc +func (c_ CaptureInput) Ports() []CaptureInputPort { + rv := objc.Call[[]CaptureInputPort](c_, objc.Sel("ports")) + return rv +} diff --git a/macos/avfoundation/capture_input_port.gen.go b/macos/avfoundation/capture_input_port.gen.go new file mode 100644 index 00000000..933ad0e3 --- /dev/null +++ b/macos/avfoundation/capture_input_port.gen.go @@ -0,0 +1,112 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureInputPort] class. +var CaptureInputPortClass = _CaptureInputPortClass{objc.GetClass("AVCaptureInputPort")} + +type _CaptureInputPortClass struct { + objc.Class +} + +// An interface definition for the [CaptureInputPort] class. +type ICaptureInputPort interface { + objc.IObject + Clock() coremedia.ClockRef + Input() CaptureInput + MediaType() MediaType + IsEnabled() bool + SetEnabled(value bool) + FormatDescription() coremedia.FormatDescriptionRef +} + +// An object that represents a stream of data that a capture input provides. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinputport?language=objc +type CaptureInputPort struct { + objc.Object +} + +func CaptureInputPortFrom(ptr unsafe.Pointer) CaptureInputPort { + return CaptureInputPort{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureInputPortClass) Alloc() CaptureInputPort { + rv := objc.Call[CaptureInputPort](cc, objc.Sel("alloc")) + return rv +} + +func CaptureInputPort_Alloc() CaptureInputPort { + return CaptureInputPortClass.Alloc() +} + +func (cc _CaptureInputPortClass) New() CaptureInputPort { + rv := objc.Call[CaptureInputPort](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureInputPort() CaptureInputPort { + return CaptureInputPortClass.New() +} + +func (c_ CaptureInputPort) Init() CaptureInputPort { + rv := objc.Call[CaptureInputPort](c_, objc.Sel("init")) + return rv +} + +// An object that represents the capture device’s clock. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinputport/1385908-clock?language=objc +func (c_ CaptureInputPort) Clock() coremedia.ClockRef { + rv := objc.Call[coremedia.ClockRef](c_, objc.Sel("clock")) + return rv +} + +// The input object that owns the port. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinputport/1387702-input?language=objc +func (c_ CaptureInputPort) Input() CaptureInput { + rv := objc.Call[CaptureInput](c_, objc.Sel("input")) + return rv +} + +// The media type of the port. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinputport/1387120-mediatype?language=objc +func (c_ CaptureInputPort) MediaType() MediaType { + rv := objc.Call[MediaType](c_, objc.Sel("mediaType")) + return rv +} + +// A Boolean value that indicates whether the port is in an enabled state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinputport/1386833-enabled?language=objc +func (c_ CaptureInputPort) IsEnabled() bool { + rv := objc.Call[bool](c_, objc.Sel("isEnabled")) + return rv +} + +// A Boolean value that indicates whether the port is in an enabled state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinputport/1386833-enabled?language=objc +func (c_ CaptureInputPort) SetEnabled(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setEnabled:"), value) +} + +// A description of the port format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureinputport/1385890-formatdescription?language=objc +func (c_ CaptureInputPort) FormatDescription() coremedia.FormatDescriptionRef { + rv := objc.Call[coremedia.FormatDescriptionRef](c_, objc.Sel("formatDescription")) + return rv +} diff --git a/macos/avfoundation/capture_movie_file_output.gen.go b/macos/avfoundation/capture_movie_file_output.gen.go new file mode 100644 index 00000000..5e548393 --- /dev/null +++ b/macos/avfoundation/capture_movie_file_output.gen.go @@ -0,0 +1,144 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureMovieFileOutput] class. +var CaptureMovieFileOutputClass = _CaptureMovieFileOutputClass{objc.GetClass("AVCaptureMovieFileOutput")} + +type _CaptureMovieFileOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureMovieFileOutput] class. +type ICaptureMovieFileOutput interface { + ICaptureFileOutput + OutputSettingsForConnection(connection ICaptureConnection) map[string]objc.Object + SetOutputSettingsForConnection(outputSettings map[string]objc.IObject, connection ICaptureConnection) + SetPrimaryConstituentDeviceSwitchingBehaviorForRecordingRestrictedSwitchingBehaviorConditions(switchingBehavior CapturePrimaryConstituentDeviceSwitchingBehavior, restrictedSwitchingBehaviorConditions CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions) + PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionsForRecording() CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions + MovieFragmentInterval() coremedia.Time + SetMovieFragmentInterval(value coremedia.Time) + Metadata() []MetadataItem + SetMetadata(value []IMetadataItem) + IsPrimaryConstituentDeviceSwitchingBehaviorForRecordingEnabled() bool + SetPrimaryConstituentDeviceSwitchingBehaviorForRecordingEnabled(value bool) +} + +// A capture output that records video and audio to a QuickTime movie file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput?language=objc +type CaptureMovieFileOutput struct { + CaptureFileOutput +} + +func CaptureMovieFileOutputFrom(ptr unsafe.Pointer) CaptureMovieFileOutput { + return CaptureMovieFileOutput{ + CaptureFileOutput: CaptureFileOutputFrom(ptr), + } +} + +func (cc _CaptureMovieFileOutputClass) New() CaptureMovieFileOutput { + rv := objc.Call[CaptureMovieFileOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureMovieFileOutput() CaptureMovieFileOutput { + return CaptureMovieFileOutputClass.New() +} + +func (c_ CaptureMovieFileOutput) Init() CaptureMovieFileOutput { + rv := objc.Call[CaptureMovieFileOutput](c_, objc.Sel("init")) + return rv +} + +func (cc _CaptureMovieFileOutputClass) Alloc() CaptureMovieFileOutput { + rv := objc.Call[CaptureMovieFileOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureMovieFileOutput_Alloc() CaptureMovieFileOutput { + return CaptureMovieFileOutputClass.Alloc() +} + +// Returns the options used to reencode media from a given connection as it's being recorded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/1386479-outputsettingsforconnection?language=objc +func (c_ CaptureMovieFileOutput) OutputSettingsForConnection(connection ICaptureConnection) map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("outputSettingsForConnection:"), objc.Ptr(connection)) + return rv +} + +// Sets the options dictionary used to reencode media from the given connection as it's being recorded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/1388448-setoutputsettings?language=objc +func (c_ CaptureMovieFileOutput) SetOutputSettingsForConnection(outputSettings map[string]objc.IObject, connection ICaptureConnection) { + objc.Call[objc.Void](c_, objc.Sel("setOutputSettings:forConnection:"), outputSettings, objc.Ptr(connection)) +} + +// Sets the camera switching behavior to use during recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/3875327-setprimaryconstituentdeviceswitc?language=objc +func (c_ CaptureMovieFileOutput) SetPrimaryConstituentDeviceSwitchingBehaviorForRecordingRestrictedSwitchingBehaviorConditions(switchingBehavior CapturePrimaryConstituentDeviceSwitchingBehavior, restrictedSwitchingBehaviorConditions CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryConstituentDeviceSwitchingBehaviorForRecording:restrictedSwitchingBehaviorConditions:"), switchingBehavior, restrictedSwitchingBehaviorConditions) +} + +// The conditions during which camera switching may occur while recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/3875324-primaryconstituentdevicerestrict?language=objc +func (c_ CaptureMovieFileOutput) PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionsForRecording() CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions { + rv := objc.Call[CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions](c_, objc.Sel("primaryConstituentDeviceRestrictedSwitchingBehaviorConditionsForRecording")) + return rv +} + +// The number of seconds of output that are written per fragment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/1387146-moviefragmentinterval?language=objc +func (c_ CaptureMovieFileOutput) MovieFragmentInterval() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("movieFragmentInterval")) + return rv +} + +// The number of seconds of output that are written per fragment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/1387146-moviefragmentinterval?language=objc +func (c_ CaptureMovieFileOutput) SetMovieFragmentInterval(value coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("setMovieFragmentInterval:"), value) +} + +// The metadata for the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/1387808-metadata?language=objc +func (c_ CaptureMovieFileOutput) Metadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](c_, objc.Sel("metadata")) + return rv +} + +// The metadata for the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/1387808-metadata?language=objc +func (c_ CaptureMovieFileOutput) SetMetadata(value []IMetadataItem) { + objc.Call[objc.Void](c_, objc.Sel("setMetadata:"), value) +} + +// A Boolean value that indicates whether to restrict constituent device switching behavior during recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/3875326-primaryconstituentdeviceswitchin?language=objc +func (c_ CaptureMovieFileOutput) IsPrimaryConstituentDeviceSwitchingBehaviorForRecordingEnabled() bool { + rv := objc.Call[bool](c_, objc.Sel("isPrimaryConstituentDeviceSwitchingBehaviorForRecordingEnabled")) + return rv +} + +// A Boolean value that indicates whether to restrict constituent device switching behavior during recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/3875326-primaryconstituentdeviceswitchin?language=objc +func (c_ CaptureMovieFileOutput) SetPrimaryConstituentDeviceSwitchingBehaviorForRecordingEnabled(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryConstituentDeviceSwitchingBehaviorForRecordingEnabled:"), value) +} diff --git a/macos/avfoundation/capture_output.gen.go b/macos/avfoundation/capture_output.gen.go new file mode 100644 index 00000000..bfde8743 --- /dev/null +++ b/macos/avfoundation/capture_output.gen.go @@ -0,0 +1,104 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureOutput] class. +var CaptureOutputClass = _CaptureOutputClass{objc.GetClass("AVCaptureOutput")} + +type _CaptureOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureOutput] class. +type ICaptureOutput interface { + objc.IObject + TransformedMetadataObjectForMetadataObjectConnection(metadataObject IMetadataObject, connection ICaptureConnection) MetadataObject + MetadataOutputRectOfInterestForRect(rectInOutputCoordinates coregraphics.Rect) coregraphics.Rect + RectForMetadataOutputRectOfInterest(rectInMetadataOutputCoordinates coregraphics.Rect) coregraphics.Rect + ConnectionWithMediaType(mediaType MediaType) CaptureConnection + Connections() []CaptureConnection +} + +// An abstract superclass for objects that provide media output destinations for a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureoutput?language=objc +type CaptureOutput struct { + objc.Object +} + +func CaptureOutputFrom(ptr unsafe.Pointer) CaptureOutput { + return CaptureOutput{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureOutputClass) Alloc() CaptureOutput { + rv := objc.Call[CaptureOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureOutput_Alloc() CaptureOutput { + return CaptureOutputClass.Alloc() +} + +func (cc _CaptureOutputClass) New() CaptureOutput { + rv := objc.Call[CaptureOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureOutput() CaptureOutput { + return CaptureOutputClass.New() +} + +func (c_ CaptureOutput) Init() CaptureOutput { + rv := objc.Call[CaptureOutput](c_, objc.Sel("init")) + return rv +} + +// Converts a metadata object’s visual properties to layer coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureoutput/1616310-transformedmetadataobjectformeta?language=objc +func (c_ CaptureOutput) TransformedMetadataObjectForMetadataObjectConnection(metadataObject IMetadataObject, connection ICaptureConnection) MetadataObject { + rv := objc.Call[MetadataObject](c_, objc.Sel("transformedMetadataObjectForMetadataObject:connection:"), objc.Ptr(metadataObject), objc.Ptr(connection)) + return rv +} + +// Converts a rectangle in the capture output object’s coordinate system to one in the coordinate system used for metadata outputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureoutput/1616304-metadataoutputrectofinterestforr?language=objc +func (c_ CaptureOutput) MetadataOutputRectOfInterestForRect(rectInOutputCoordinates coregraphics.Rect) coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](c_, objc.Sel("metadataOutputRectOfInterestForRect:"), rectInOutputCoordinates) + return rv +} + +// Converts a rectangle in the coordinate system used for metadata outputs to one in the capture output object’s coordinate system. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureoutput/1616311-rectformetadataoutputrectofinter?language=objc +func (c_ CaptureOutput) RectForMetadataOutputRectOfInterest(rectInMetadataOutputCoordinates coregraphics.Rect) coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](c_, objc.Sel("rectForMetadataOutputRectOfInterest:"), rectInMetadataOutputCoordinates) + return rv +} + +// Returns the first connection with an input port of a specified media type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureoutput/1389574-connectionwithmediatype?language=objc +func (c_ CaptureOutput) ConnectionWithMediaType(mediaType MediaType) CaptureConnection { + rv := objc.Call[CaptureConnection](c_, objc.Sel("connectionWithMediaType:"), mediaType) + return rv +} + +// The capture output object’s connections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureoutput/1386239-connections?language=objc +func (c_ CaptureOutput) Connections() []CaptureConnection { + rv := objc.Call[[]CaptureConnection](c_, objc.Sel("connections")) + return rv +} diff --git a/macos/avfoundation/capture_photo.gen.go b/macos/avfoundation/capture_photo.gen.go new file mode 100644 index 00000000..cbb5c45f --- /dev/null +++ b/macos/avfoundation/capture_photo.gen.go @@ -0,0 +1,115 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CapturePhoto] class. +var CapturePhotoClass = _CapturePhotoClass{objc.GetClass("AVCapturePhoto")} + +type _CapturePhotoClass struct { + objc.Class +} + +// An interface definition for the [CapturePhoto] class. +type ICapturePhoto interface { + objc.IObject + FileDataRepresentation() []byte + CGImageRepresentation() coregraphics.ImageRef + PixelBuffer() corevideo.PixelBufferRef + PhotoCount() int + ResolvedSettings() CaptureResolvedPhotoSettings + Timestamp() coremedia.Time +} + +// A container for image data from a photo capture output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephoto?language=objc +type CapturePhoto struct { + objc.Object +} + +func CapturePhotoFrom(ptr unsafe.Pointer) CapturePhoto { + return CapturePhoto{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CapturePhotoClass) Alloc() CapturePhoto { + rv := objc.Call[CapturePhoto](cc, objc.Sel("alloc")) + return rv +} + +func CapturePhoto_Alloc() CapturePhoto { + return CapturePhotoClass.Alloc() +} + +func (cc _CapturePhotoClass) New() CapturePhoto { + rv := objc.Call[CapturePhoto](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCapturePhoto() CapturePhoto { + return CapturePhotoClass.New() +} + +func (c_ CapturePhoto) Init() CapturePhoto { + rv := objc.Call[CapturePhoto](c_, objc.Sel("init")) + return rv +} + +// Generates and returns a flat data representation of the photo and its attachments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873919-filedatarepresentation?language=objc +func (c_ CapturePhoto) FileDataRepresentation() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("fileDataRepresentation")) + return rv +} + +// Extracts and returns the captured photo's primary image as a Core Graphics image object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873963-cgimagerepresentation?language=objc +func (c_ CapturePhoto) CGImageRepresentation() coregraphics.ImageRef { + rv := objc.Call[coregraphics.ImageRef](c_, objc.Sel("CGImageRepresentation")) + return rv +} + +// The uncompressed or RAW image sample buffer for the photo, if requested. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873914-pixelbuffer?language=objc +func (c_ CapturePhoto) PixelBuffer() corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](c_, objc.Sel("pixelBuffer")) + return rv +} + +// The 1-based index of this photo capture relative to other results from the same capture request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873906-photocount?language=objc +func (c_ CapturePhoto) PhotoCount() int { + rv := objc.Call[int](c_, objc.Sel("photoCount")) + return rv +} + +// The settings object that was used to request this photo capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873898-resolvedsettings?language=objc +func (c_ CapturePhoto) ResolvedSettings() CaptureResolvedPhotoSettings { + rv := objc.Call[CaptureResolvedPhotoSettings](c_, objc.Sel("resolvedSettings")) + return rv +} + +// The time at which the image was captured. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873981-timestamp?language=objc +func (c_ CapturePhoto) Timestamp() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("timestamp")) + return rv +} diff --git a/macos/avfoundation/capture_photo_capture_delegate.gen.go b/macos/avfoundation/capture_photo_capture_delegate.gen.go new file mode 100644 index 00000000..f07fbfb9 --- /dev/null +++ b/macos/avfoundation/capture_photo_capture_delegate.gen.go @@ -0,0 +1,55 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// Methods for monitoring progress and receiving results from a photo capture output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotocapturedelegate?language=objc +type PCapturePhotoCaptureDelegate interface { + // optional + CaptureOutputDidCapturePhotoForResolvedSettings(output CapturePhotoOutput, resolvedSettings CaptureResolvedPhotoSettings) + HasCaptureOutputDidCapturePhotoForResolvedSettings() bool +} + +// A delegate implementation builder for the [PCapturePhotoCaptureDelegate] protocol. +type CapturePhotoCaptureDelegate struct { + _CaptureOutputDidCapturePhotoForResolvedSettings func(output CapturePhotoOutput, resolvedSettings CaptureResolvedPhotoSettings) +} + +func (di *CapturePhotoCaptureDelegate) HasCaptureOutputDidCapturePhotoForResolvedSettings() bool { + return di._CaptureOutputDidCapturePhotoForResolvedSettings != nil +} + +// Notifies the delegate that the photo has been taken. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotocapturedelegate/1778632-captureoutput?language=objc +func (di *CapturePhotoCaptureDelegate) SetCaptureOutputDidCapturePhotoForResolvedSettings(f func(output CapturePhotoOutput, resolvedSettings CaptureResolvedPhotoSettings)) { + di._CaptureOutputDidCapturePhotoForResolvedSettings = f +} + +// Notifies the delegate that the photo has been taken. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotocapturedelegate/1778632-captureoutput?language=objc +func (di *CapturePhotoCaptureDelegate) CaptureOutputDidCapturePhotoForResolvedSettings(output CapturePhotoOutput, resolvedSettings CaptureResolvedPhotoSettings) { + di._CaptureOutputDidCapturePhotoForResolvedSettings(output, resolvedSettings) +} + +// A concrete type wrapper for the [PCapturePhotoCaptureDelegate] protocol. +type CapturePhotoCaptureDelegateWrapper struct { + objc.Object +} + +func (c_ CapturePhotoCaptureDelegateWrapper) HasCaptureOutputDidCapturePhotoForResolvedSettings() bool { + return c_.RespondsToSelector(objc.Sel("captureOutput:didCapturePhotoForResolvedSettings:")) +} + +// Notifies the delegate that the photo has been taken. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotocapturedelegate/1778632-captureoutput?language=objc +func (c_ CapturePhotoCaptureDelegateWrapper) CaptureOutputDidCapturePhotoForResolvedSettings(output ICapturePhotoOutput, resolvedSettings ICaptureResolvedPhotoSettings) { + objc.Call[objc.Void](c_, objc.Sel("captureOutput:didCapturePhotoForResolvedSettings:"), objc.Ptr(output), objc.Ptr(resolvedSettings)) +} diff --git a/macos/avfoundation/capture_photo_output.gen.go b/macos/avfoundation/capture_photo_output.gen.go new file mode 100644 index 00000000..3511b0ea --- /dev/null +++ b/macos/avfoundation/capture_photo_output.gen.go @@ -0,0 +1,121 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CapturePhotoOutput] class. +var CapturePhotoOutputClass = _CapturePhotoOutputClass{objc.GetClass("AVCapturePhotoOutput")} + +type _CapturePhotoOutputClass struct { + objc.Class +} + +// An interface definition for the [CapturePhotoOutput] class. +type ICapturePhotoOutput interface { + ICaptureOutput + SupportedPhotoPixelFormatTypesForFileType(fileType FileType) []foundation.Number + SupportedPhotoCodecTypesForFileType(fileType FileType) []VideoCodecType + CapturePhotoWithSettingsDelegate(settings ICapturePhotoSettings, delegate PCapturePhotoCaptureDelegate) + CapturePhotoWithSettingsDelegateObject(settings ICapturePhotoSettings, delegateObject objc.IObject) + AvailablePhotoCodecTypes() []VideoCodecType + AvailablePhotoPixelFormatTypes() []foundation.Number + AvailablePhotoFileTypes() []FileType +} + +// A capture output for still image, Live Photos, and other photography workflows. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput?language=objc +type CapturePhotoOutput struct { + CaptureOutput +} + +func CapturePhotoOutputFrom(ptr unsafe.Pointer) CapturePhotoOutput { + return CapturePhotoOutput{ + CaptureOutput: CaptureOutputFrom(ptr), + } +} + +func (cc _CapturePhotoOutputClass) New() CapturePhotoOutput { + rv := objc.Call[CapturePhotoOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCapturePhotoOutput() CapturePhotoOutput { + return CapturePhotoOutputClass.New() +} + +func (c_ CapturePhotoOutput) Init() CapturePhotoOutput { + rv := objc.Call[CapturePhotoOutput](c_, objc.Sel("init")) + return rv +} + +func (cc _CapturePhotoOutputClass) Alloc() CapturePhotoOutput { + rv := objc.Call[CapturePhotoOutput](cc, objc.Sel("alloc")) + return rv +} + +func CapturePhotoOutput_Alloc() CapturePhotoOutput { + return CapturePhotoOutputClass.Alloc() +} + +// Returns the list of uncompressed pixel formats supported for photo data in the specified file type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/2873950-supportedphotopixelformattypesfo?language=objc +func (c_ CapturePhotoOutput) SupportedPhotoPixelFormatTypesForFileType(fileType FileType) []foundation.Number { + rv := objc.Call[[]foundation.Number](c_, objc.Sel("supportedPhotoPixelFormatTypesForFileType:"), fileType) + return rv +} + +// Returns the list of photo codecs (such as JPEG or HEVC) supported for photo data in the specified file type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/2873916-supportedphotocodectypesforfilet?language=objc +func (c_ CapturePhotoOutput) SupportedPhotoCodecTypesForFileType(fileType FileType) []VideoCodecType { + rv := objc.Call[[]VideoCodecType](c_, objc.Sel("supportedPhotoCodecTypesForFileType:"), fileType) + return rv +} + +// Initiates a photo capture using the specified settings. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1648765-capturephotowithsettings?language=objc +func (c_ CapturePhotoOutput) CapturePhotoWithSettingsDelegate(settings ICapturePhotoSettings, delegate PCapturePhotoCaptureDelegate) { + po1 := objc.WrapAsProtocol("AVCapturePhotoCaptureDelegate", delegate) + objc.Call[objc.Void](c_, objc.Sel("capturePhotoWithSettings:delegate:"), objc.Ptr(settings), po1) +} + +// Initiates a photo capture using the specified settings. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1648765-capturephotowithsettings?language=objc +func (c_ CapturePhotoOutput) CapturePhotoWithSettingsDelegateObject(settings ICapturePhotoSettings, delegateObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("capturePhotoWithSettings:delegate:"), objc.Ptr(settings), objc.Ptr(delegateObject)) +} + +// The compression codecs this capture output currently supports for photo capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1648654-availablephotocodectypes?language=objc +func (c_ CapturePhotoOutput) AvailablePhotoCodecTypes() []VideoCodecType { + rv := objc.Call[[]VideoCodecType](c_, objc.Sel("availablePhotoCodecTypes")) + return rv +} + +// The pixel formats the capture output supports for photo capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1778630-availablephotopixelformattypes?language=objc +func (c_ CapturePhotoOutput) AvailablePhotoPixelFormatTypes() []foundation.Number { + rv := objc.Call[[]foundation.Number](c_, objc.Sel("availablePhotoPixelFormatTypes")) + return rv +} + +// The list of file types currently supported for photo capture and output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/2873918-availablephotofiletypes?language=objc +func (c_ CapturePhotoOutput) AvailablePhotoFileTypes() []FileType { + rv := objc.Call[[]FileType](c_, objc.Sel("availablePhotoFileTypes")) + return rv +} diff --git a/macos/avfoundation/capture_photo_settings.gen.go b/macos/avfoundation/capture_photo_settings.gen.go new file mode 100644 index 00000000..a3a14f3f --- /dev/null +++ b/macos/avfoundation/capture_photo_settings.gen.go @@ -0,0 +1,121 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CapturePhotoSettings] class. +var CapturePhotoSettingsClass = _CapturePhotoSettingsClass{objc.GetClass("AVCapturePhotoSettings")} + +type _CapturePhotoSettingsClass struct { + objc.Class +} + +// An interface definition for the [CapturePhotoSettings] class. +type ICapturePhotoSettings interface { + objc.IObject + UniqueID() int64 + Format() map[string]objc.Object + ProcessedFileType() FileType +} + +// A specification of the features and settings to use for a single photo capture request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings?language=objc +type CapturePhotoSettings struct { + objc.Object +} + +func CapturePhotoSettingsFrom(ptr unsafe.Pointer) CapturePhotoSettings { + return CapturePhotoSettings{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CapturePhotoSettingsClass) PhotoSettingsFromPhotoSettings(photoSettings ICapturePhotoSettings) CapturePhotoSettings { + rv := objc.Call[CapturePhotoSettings](cc, objc.Sel("photoSettingsFromPhotoSettings:"), objc.Ptr(photoSettings)) + return rv +} + +// Creates a unique photo settings object, copying all settings values from the specified photo settings object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/1778655-photosettingsfromphotosettings?language=objc +func CapturePhotoSettings_PhotoSettingsFromPhotoSettings(photoSettings ICapturePhotoSettings) CapturePhotoSettings { + return CapturePhotoSettingsClass.PhotoSettingsFromPhotoSettings(photoSettings) +} + +func (cc _CapturePhotoSettingsClass) PhotoSettings() CapturePhotoSettings { + rv := objc.Call[CapturePhotoSettings](cc, objc.Sel("photoSettings")) + return rv +} + +// Creates a photo settings object with default settings. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/1649254-photosettings?language=objc +func CapturePhotoSettings_PhotoSettings() CapturePhotoSettings { + return CapturePhotoSettingsClass.PhotoSettings() +} + +func (cc _CapturePhotoSettingsClass) PhotoSettingsWithFormat(format map[string]objc.IObject) CapturePhotoSettings { + rv := objc.Call[CapturePhotoSettings](cc, objc.Sel("photoSettingsWithFormat:"), format) + return rv +} + +// Creates a photo settings object with the specified output format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/1648673-photosettingswithformat?language=objc +func CapturePhotoSettings_PhotoSettingsWithFormat(format map[string]objc.IObject) CapturePhotoSettings { + return CapturePhotoSettingsClass.PhotoSettingsWithFormat(format) +} + +func (cc _CapturePhotoSettingsClass) Alloc() CapturePhotoSettings { + rv := objc.Call[CapturePhotoSettings](cc, objc.Sel("alloc")) + return rv +} + +func CapturePhotoSettings_Alloc() CapturePhotoSettings { + return CapturePhotoSettingsClass.Alloc() +} + +func (cc _CapturePhotoSettingsClass) New() CapturePhotoSettings { + rv := objc.Call[CapturePhotoSettings](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCapturePhotoSettings() CapturePhotoSettings { + return CapturePhotoSettingsClass.New() +} + +func (c_ CapturePhotoSettings) Init() CapturePhotoSettings { + rv := objc.Call[CapturePhotoSettings](c_, objc.Sel("init")) + return rv +} + +// A unique identifier for this photo settings instance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/1648767-uniqueid?language=objc +func (c_ CapturePhotoSettings) UniqueID() int64 { + rv := objc.Call[int64](c_, objc.Sel("uniqueID")) + return rv +} + +// A dictionary describing the processed format (for example, JPEG) to deliver captured photos in. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/1648783-format?language=objc +func (c_ CapturePhotoSettings) Format() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("format")) + return rv +} + +// The container file format for eventual output of the processed image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/2873970-processedfiletype?language=objc +func (c_ CapturePhotoSettings) ProcessedFileType() FileType { + rv := objc.Call[FileType](c_, objc.Sel("processedFileType")) + return rv +} diff --git a/macos/avfoundation/capture_resolved_photo_settings.gen.go b/macos/avfoundation/capture_resolved_photo_settings.gen.go new file mode 100644 index 00000000..b58c5d80 --- /dev/null +++ b/macos/avfoundation/capture_resolved_photo_settings.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureResolvedPhotoSettings] class. +var CaptureResolvedPhotoSettingsClass = _CaptureResolvedPhotoSettingsClass{objc.GetClass("AVCaptureResolvedPhotoSettings")} + +type _CaptureResolvedPhotoSettingsClass struct { + objc.Class +} + +// An interface definition for the [CaptureResolvedPhotoSettings] class. +type ICaptureResolvedPhotoSettings interface { + objc.IObject + PhotoDimensions() coremedia.VideoDimensions + ExpectedPhotoCount() uint + UniqueID() int64 +} + +// A description of the features and settings in use for an in-progress or complete photo capture request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureresolvedphotosettings?language=objc +type CaptureResolvedPhotoSettings struct { + objc.Object +} + +func CaptureResolvedPhotoSettingsFrom(ptr unsafe.Pointer) CaptureResolvedPhotoSettings { + return CaptureResolvedPhotoSettings{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureResolvedPhotoSettingsClass) Alloc() CaptureResolvedPhotoSettings { + rv := objc.Call[CaptureResolvedPhotoSettings](cc, objc.Sel("alloc")) + return rv +} + +func CaptureResolvedPhotoSettings_Alloc() CaptureResolvedPhotoSettings { + return CaptureResolvedPhotoSettingsClass.Alloc() +} + +func (cc _CaptureResolvedPhotoSettingsClass) New() CaptureResolvedPhotoSettings { + rv := objc.Call[CaptureResolvedPhotoSettings](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureResolvedPhotoSettings() CaptureResolvedPhotoSettings { + return CaptureResolvedPhotoSettingsClass.New() +} + +func (c_ CaptureResolvedPhotoSettings) Init() CaptureResolvedPhotoSettings { + rv := objc.Call[CaptureResolvedPhotoSettings](c_, objc.Sel("init")) + return rv +} + +// The size, in pixels, of the photo image (in a processed format, such as JPEG) that the capture delivers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureresolvedphotosettings/1648782-photodimensions?language=objc +func (c_ CaptureResolvedPhotoSettings) PhotoDimensions() coremedia.VideoDimensions { + rv := objc.Call[coremedia.VideoDimensions](c_, objc.Sel("photoDimensions")) + return rv +} + +// The number of photo capture results in the capture request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureresolvedphotosettings/2873973-expectedphotocount?language=objc +func (c_ CaptureResolvedPhotoSettings) ExpectedPhotoCount() uint { + rv := objc.Call[uint](c_, objc.Sel("expectedPhotoCount")) + return rv +} + +// The unique identifier for the photo capture this settings object corresponds to. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureresolvedphotosettings/1648656-uniqueid?language=objc +func (c_ CaptureResolvedPhotoSettings) UniqueID() int64 { + rv := objc.Call[int64](c_, objc.Sel("uniqueID")) + return rv +} diff --git a/macos/avfoundation/capture_screen_input.gen.go b/macos/avfoundation/capture_screen_input.gen.go new file mode 100644 index 00000000..f0e1f604 --- /dev/null +++ b/macos/avfoundation/capture_screen_input.gen.go @@ -0,0 +1,159 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureScreenInput] class. +var CaptureScreenInputClass = _CaptureScreenInputClass{objc.GetClass("AVCaptureScreenInput")} + +type _CaptureScreenInputClass struct { + objc.Class +} + +// An interface definition for the [CaptureScreenInput] class. +type ICaptureScreenInput interface { + ICaptureInput + CapturesCursor() bool + SetCapturesCursor(value bool) + ScaleFactor() float64 + SetScaleFactor(value float64) + CapturesMouseClicks() bool + SetCapturesMouseClicks(value bool) + MinFrameDuration() coremedia.Time + SetMinFrameDuration(value coremedia.Time) + CropRect() coregraphics.Rect + SetCropRect(value coregraphics.Rect) +} + +// A capture input for recording from a screen in macOS. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput?language=objc +type CaptureScreenInput struct { + CaptureInput +} + +func CaptureScreenInputFrom(ptr unsafe.Pointer) CaptureScreenInput { + return CaptureScreenInput{ + CaptureInput: CaptureInputFrom(ptr), + } +} + +func (cc _CaptureScreenInputClass) New() CaptureScreenInput { + rv := objc.Call[CaptureScreenInput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureScreenInput() CaptureScreenInput { + return CaptureScreenInputClass.New() +} + +func (c_ CaptureScreenInput) InitWithDisplayID(displayID coregraphics.DirectDisplayID) CaptureScreenInput { + rv := objc.Call[CaptureScreenInput](c_, objc.Sel("initWithDisplayID:"), displayID) + return rv +} + +// Initializes a capture screen input that provides media data from the specified display. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1386383-initwithdisplayid?language=objc +func NewCaptureScreenInputWithDisplayID(displayID coregraphics.DirectDisplayID) CaptureScreenInput { + instance := CaptureScreenInputClass.Alloc().InitWithDisplayID(displayID) + instance.Autorelease() + return instance +} + +func (c_ CaptureScreenInput) Init() CaptureScreenInput { + rv := objc.Call[CaptureScreenInput](c_, objc.Sel("init")) + return rv +} + +func (cc _CaptureScreenInputClass) Alloc() CaptureScreenInput { + rv := objc.Call[CaptureScreenInput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureScreenInput_Alloc() CaptureScreenInput { + return CaptureScreenInputClass.Alloc() +} + +// A Boolean value that specifies whether the mouse cursor appears in the captured output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1385601-capturescursor?language=objc +func (c_ CaptureScreenInput) CapturesCursor() bool { + rv := objc.Call[bool](c_, objc.Sel("capturesCursor")) + return rv +} + +// A Boolean value that specifies whether the mouse cursor appears in the captured output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1385601-capturescursor?language=objc +func (c_ CaptureScreenInput) SetCapturesCursor(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setCapturesCursor:"), value) +} + +// Indicates the factor by which video buffers captured from the screen are to be scaled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1390311-scalefactor?language=objc +func (c_ CaptureScreenInput) ScaleFactor() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactor")) + return rv +} + +// Indicates the factor by which video buffers captured from the screen are to be scaled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1390311-scalefactor?language=objc +func (c_ CaptureScreenInput) SetScaleFactor(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setScaleFactor:"), value) +} + +// A Boolean value that specifies whether mouse clicks appear highlighted in the captured output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1385722-capturesmouseclicks?language=objc +func (c_ CaptureScreenInput) CapturesMouseClicks() bool { + rv := objc.Call[bool](c_, objc.Sel("capturesMouseClicks")) + return rv +} + +// A Boolean value that specifies whether mouse clicks appear highlighted in the captured output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1385722-capturesmouseclicks?language=objc +func (c_ CaptureScreenInput) SetCapturesMouseClicks(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setCapturesMouseClicks:"), value) +} + +// The screen input's minimum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1387216-minframeduration?language=objc +func (c_ CaptureScreenInput) MinFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](c_, objc.Sel("minFrameDuration")) + return rv +} + +// The screen input's minimum frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1387216-minframeduration?language=objc +func (c_ CaptureScreenInput) SetMinFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("setMinFrameDuration:"), value) +} + +// Indicates the bounding rectangle of the screen area to be captured, in pixels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1390518-croprect?language=objc +func (c_ CaptureScreenInput) CropRect() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](c_, objc.Sel("cropRect")) + return rv +} + +// Indicates the bounding rectangle of the screen area to be captured, in pixels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturescreeninput/1390518-croprect?language=objc +func (c_ CaptureScreenInput) SetCropRect(value coregraphics.Rect) { + objc.Call[objc.Void](c_, objc.Sel("setCropRect:"), value) +} diff --git a/macos/avfoundation/capture_session.gen.go b/macos/avfoundation/capture_session.gen.go new file mode 100644 index 00000000..65b1e3e9 --- /dev/null +++ b/macos/avfoundation/capture_session.gen.go @@ -0,0 +1,253 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureSession] class. +var CaptureSessionClass = _CaptureSessionClass{objc.GetClass("AVCaptureSession")} + +type _CaptureSessionClass struct { + objc.Class +} + +// An interface definition for the [CaptureSession] class. +type ICaptureSession interface { + objc.IObject + StopRunning() + CanSetSessionPreset(preset CaptureSessionPreset) bool + RemoveInput(input ICaptureInput) + AddConnection(connection ICaptureConnection) + BeginConfiguration() + StartRunning() + AddInput(input ICaptureInput) + RemoveConnection(connection ICaptureConnection) + CanAddInput(input ICaptureInput) bool + AddInputWithNoConnections(input ICaptureInput) + AddOutput(output ICaptureOutput) + CommitConfiguration() + RemoveOutput(output ICaptureOutput) + CanAddOutput(output ICaptureOutput) bool + AddOutputWithNoConnections(output ICaptureOutput) + CanAddConnection(connection ICaptureConnection) bool + Connections() []CaptureConnection + IsRunning() bool + SessionPreset() CaptureSessionPreset + SetSessionPreset(value CaptureSessionPreset) + Outputs() []CaptureOutput + SynchronizationClock() coremedia.ClockRef + Inputs() []CaptureInput +} + +// An object that configures capture behavior and coordinates the flow of data from input devices to capture outputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession?language=objc +type CaptureSession struct { + objc.Object +} + +func CaptureSessionFrom(ptr unsafe.Pointer) CaptureSession { + return CaptureSession{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CaptureSessionClass) Alloc() CaptureSession { + rv := objc.Call[CaptureSession](cc, objc.Sel("alloc")) + return rv +} + +func CaptureSession_Alloc() CaptureSession { + return CaptureSessionClass.Alloc() +} + +func (cc _CaptureSessionClass) New() CaptureSession { + rv := objc.Call[CaptureSession](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureSession() CaptureSession { + return CaptureSessionClass.New() +} + +func (c_ CaptureSession) Init() CaptureSession { + rv := objc.Call[CaptureSession](c_, objc.Sel("init")) + return rv +} + +// Stops the flow of data through the capture pipeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1385661-stoprunning?language=objc +func (c_ CaptureSession) StopRunning() { + objc.Call[objc.Void](c_, objc.Sel("stopRunning")) +} + +// Determines whether you can configure a capture session with the specified preset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1389824-cansetsessionpreset?language=objc +func (c_ CaptureSession) CanSetSessionPreset(preset CaptureSessionPreset) bool { + rv := objc.Call[bool](c_, objc.Sel("canSetSessionPreset:"), preset) + return rv +} + +// Removes an input from the session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1388073-removeinput?language=objc +func (c_ CaptureSession) RemoveInput(input ICaptureInput) { + objc.Call[objc.Void](c_, objc.Sel("removeInput:"), objc.Ptr(input)) +} + +// Adds a connection to the capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1389687-addconnection?language=objc +func (c_ CaptureSession) AddConnection(connection ICaptureConnection) { + objc.Call[objc.Void](c_, objc.Sel("addConnection:"), objc.Ptr(connection)) +} + +// Marks the beginning of changes to a running capture session’s configuration to perform in a single atomic update. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1389174-beginconfiguration?language=objc +func (c_ CaptureSession) BeginConfiguration() { + objc.Call[objc.Void](c_, objc.Sel("beginConfiguration")) +} + +// Starts the flow of data through the capture pipeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1388185-startrunning?language=objc +func (c_ CaptureSession) StartRunning() { + objc.Call[objc.Void](c_, objc.Sel("startRunning")) +} + +// Adds a capture input to the session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1387239-addinput?language=objc +func (c_ CaptureSession) AddInput(input ICaptureInput) { + objc.Call[objc.Void](c_, objc.Sel("addInput:"), objc.Ptr(input)) +} + +// Removes a capture connection from the session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1390041-removeconnection?language=objc +func (c_ CaptureSession) RemoveConnection(connection ICaptureConnection) { + objc.Call[objc.Void](c_, objc.Sel("removeConnection:"), objc.Ptr(connection)) +} + +// Determines whether you can add an input to a session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1387180-canaddinput?language=objc +func (c_ CaptureSession) CanAddInput(input ICaptureInput) bool { + rv := objc.Call[bool](c_, objc.Sel("canAddInput:"), objc.Ptr(input)) + return rv +} + +// Adds a capture input to a session without forming any connections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1390383-addinputwithnoconnections?language=objc +func (c_ CaptureSession) AddInputWithNoConnections(input ICaptureInput) { + objc.Call[objc.Void](c_, objc.Sel("addInputWithNoConnections:"), objc.Ptr(input)) +} + +// Adds an output to the capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1387325-addoutput?language=objc +func (c_ CaptureSession) AddOutput(output ICaptureOutput) { + objc.Call[objc.Void](c_, objc.Sel("addOutput:"), objc.Ptr(output)) +} + +// Commits one or more changes to a running capture session’s configuration in a single atomic update. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1388173-commitconfiguration?language=objc +func (c_ CaptureSession) CommitConfiguration() { + objc.Call[objc.Void](c_, objc.Sel("commitConfiguration")) +} + +// Removes an output from a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1385688-removeoutput?language=objc +func (c_ CaptureSession) RemoveOutput(output ICaptureOutput) { + objc.Call[objc.Void](c_, objc.Sel("removeOutput:"), objc.Ptr(output)) +} + +// Determines whether you can add an output to a session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1388944-canaddoutput?language=objc +func (c_ CaptureSession) CanAddOutput(output ICaptureOutput) bool { + rv := objc.Call[bool](c_, objc.Sel("canAddOutput:"), objc.Ptr(output)) + return rv +} + +// Adds a capture output to the session without forming any connections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1388709-addoutputwithnoconnections?language=objc +func (c_ CaptureSession) AddOutputWithNoConnections(output ICaptureOutput) { + objc.Call[objc.Void](c_, objc.Sel("addOutputWithNoConnections:"), objc.Ptr(output)) +} + +// Determines whether a you can add a connection to a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1389596-canaddconnection?language=objc +func (c_ CaptureSession) CanAddConnection(connection ICaptureConnection) bool { + rv := objc.Call[bool](c_, objc.Sel("canAddConnection:"), objc.Ptr(connection)) + return rv +} + +// The connections between inputs and outputs that a capture session contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/3153020-connections?language=objc +func (c_ CaptureSession) Connections() []CaptureConnection { + rv := objc.Call[[]CaptureConnection](c_, objc.Sel("connections")) + return rv +} + +// A Boolean value that indicates whether the capture session is in a running state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1388133-running?language=objc +func (c_ CaptureSession) IsRunning() bool { + rv := objc.Call[bool](c_, objc.Sel("isRunning")) + return rv +} + +// A preset value that indicates the quality level or bit rate of the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1389696-sessionpreset?language=objc +func (c_ CaptureSession) SessionPreset() CaptureSessionPreset { + rv := objc.Call[CaptureSessionPreset](c_, objc.Sel("sessionPreset")) + return rv +} + +// A preset value that indicates the quality level or bit rate of the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1389696-sessionpreset?language=objc +func (c_ CaptureSession) SetSessionPreset(value CaptureSessionPreset) { + objc.Call[objc.Void](c_, objc.Sel("setSessionPreset:"), value) +} + +// The output destinations to which a captures session sends its data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1387621-outputs?language=objc +func (c_ CaptureSession) Outputs() []CaptureOutput { + rv := objc.Call[[]CaptureOutput](c_, objc.Sel("outputs")) + return rv +} + +// A clock to use for output synchronization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/3915813-synchronizationclock?language=objc +func (c_ CaptureSession) SynchronizationClock() coremedia.ClockRef { + rv := objc.Call[coremedia.ClockRef](c_, objc.Sel("synchronizationClock")) + return rv +} + +// The inputs that provide media data to a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesession/1390865-inputs?language=objc +func (c_ CaptureSession) Inputs() []CaptureInput { + rv := objc.Call[[]CaptureInput](c_, objc.Sel("inputs")) + return rv +} diff --git a/macos/avfoundation/capture_still_image_output.gen.go b/macos/avfoundation/capture_still_image_output.gen.go new file mode 100644 index 00000000..e83f59af --- /dev/null +++ b/macos/avfoundation/capture_still_image_output.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureStillImageOutput] class. +var CaptureStillImageOutputClass = _CaptureStillImageOutputClass{objc.GetClass("AVCaptureStillImageOutput")} + +type _CaptureStillImageOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureStillImageOutput] class. +type ICaptureStillImageOutput interface { + ICaptureOutput +} + +// A capture output for capturing still photos. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturestillimageoutput?language=objc +type CaptureStillImageOutput struct { + CaptureOutput +} + +func CaptureStillImageOutputFrom(ptr unsafe.Pointer) CaptureStillImageOutput { + return CaptureStillImageOutput{ + CaptureOutput: CaptureOutputFrom(ptr), + } +} + +func (cc _CaptureStillImageOutputClass) Alloc() CaptureStillImageOutput { + rv := objc.Call[CaptureStillImageOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureStillImageOutput_Alloc() CaptureStillImageOutput { + return CaptureStillImageOutputClass.Alloc() +} + +func (cc _CaptureStillImageOutputClass) New() CaptureStillImageOutput { + rv := objc.Call[CaptureStillImageOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureStillImageOutput() CaptureStillImageOutput { + return CaptureStillImageOutputClass.New() +} + +func (c_ CaptureStillImageOutput) Init() CaptureStillImageOutput { + rv := objc.Call[CaptureStillImageOutput](c_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/capture_video_data_output.gen.go b/macos/avfoundation/capture_video_data_output.gen.go new file mode 100644 index 00000000..484db08b --- /dev/null +++ b/macos/avfoundation/capture_video_data_output.gen.go @@ -0,0 +1,174 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureVideoDataOutput] class. +var CaptureVideoDataOutputClass = _CaptureVideoDataOutputClass{objc.GetClass("AVCaptureVideoDataOutput")} + +type _CaptureVideoDataOutputClass struct { + objc.Class +} + +// An interface definition for the [CaptureVideoDataOutput] class. +type ICaptureVideoDataOutput interface { + ICaptureOutput + AvailableVideoCodecTypesForAssetWriterWithOutputFileType(outputFileType FileType) []VideoCodecType + RecommendedVideoSettingsForAssetWriterWithOutputFileType(outputFileType FileType) map[string]objc.Object + RecommendedVideoSettingsForVideoCodecTypeAssetWriterOutputFileType(videoCodecType VideoCodecType, outputFileType FileType) map[string]objc.Object + SetSampleBufferDelegateQueue(sampleBufferDelegate PCaptureVideoDataOutputSampleBufferDelegate, sampleBufferCallbackQueue dispatch.Queue) + SetSampleBufferDelegateObjectQueue(sampleBufferDelegateObject objc.IObject, sampleBufferCallbackQueue dispatch.Queue) + AvailableVideoCVPixelFormatTypes() []foundation.Number + VideoSettings() map[string]objc.Object + SetVideoSettings(value map[string]objc.IObject) + SampleBufferCallbackQueue() dispatch.Queue + AvailableVideoCodecTypes() []VideoCodecType + AlwaysDiscardsLateVideoFrames() bool + SetAlwaysDiscardsLateVideoFrames(value bool) + SampleBufferDelegate() CaptureVideoDataOutputSampleBufferDelegateWrapper +} + +// A capture output that records video and provides access to video frames for processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput?language=objc +type CaptureVideoDataOutput struct { + CaptureOutput +} + +func CaptureVideoDataOutputFrom(ptr unsafe.Pointer) CaptureVideoDataOutput { + return CaptureVideoDataOutput{ + CaptureOutput: CaptureOutputFrom(ptr), + } +} + +func (cc _CaptureVideoDataOutputClass) New() CaptureVideoDataOutput { + rv := objc.Call[CaptureVideoDataOutput](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureVideoDataOutput() CaptureVideoDataOutput { + return CaptureVideoDataOutputClass.New() +} + +func (c_ CaptureVideoDataOutput) Init() CaptureVideoDataOutput { + rv := objc.Call[CaptureVideoDataOutput](c_, objc.Sel("init")) + return rv +} + +func (cc _CaptureVideoDataOutputClass) Alloc() CaptureVideoDataOutput { + rv := objc.Call[CaptureVideoDataOutput](cc, objc.Sel("alloc")) + return rv +} + +func CaptureVideoDataOutput_Alloc() CaptureVideoDataOutput { + return CaptureVideoDataOutputClass.Alloc() +} + +// The video codecs that the output supports for writing video to the output file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/2867901-availablevideocodectypesforasset?language=objc +func (c_ CaptureVideoDataOutput) AvailableVideoCodecTypesForAssetWriterWithOutputFileType(outputFileType FileType) []VideoCodecType { + rv := objc.Call[[]VideoCodecType](c_, objc.Sel("availableVideoCodecTypesForAssetWriterWithOutputFileType:"), outputFileType) + return rv +} + +// Specifies the recommended settings for use with an AVAssetWriterInput. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1616290-recommendedvideosettingsforasset?language=objc +func (c_ CaptureVideoDataOutput) RecommendedVideoSettingsForAssetWriterWithOutputFileType(outputFileType FileType) map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("recommendedVideoSettingsForAssetWriterWithOutputFileType:"), outputFileType) + return rv +} + +// Returns a video settings dictionary appropriate for capturing video to be recorded to a file with the specified codec and type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/2867900-recommendedvideosettingsforvideo?language=objc +func (c_ CaptureVideoDataOutput) RecommendedVideoSettingsForVideoCodecTypeAssetWriterOutputFileType(videoCodecType VideoCodecType, outputFileType FileType) map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("recommendedVideoSettingsForVideoCodecType:assetWriterOutputFileType:"), videoCodecType, outputFileType) + return rv +} + +// Sets the sample buffer delegate and the queue for invoking callbacks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1389008-setsamplebufferdelegate?language=objc +func (c_ CaptureVideoDataOutput) SetSampleBufferDelegateQueue(sampleBufferDelegate PCaptureVideoDataOutputSampleBufferDelegate, sampleBufferCallbackQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVCaptureVideoDataOutputSampleBufferDelegate", sampleBufferDelegate) + objc.Call[objc.Void](c_, objc.Sel("setSampleBufferDelegate:queue:"), po0, sampleBufferCallbackQueue) +} + +// Sets the sample buffer delegate and the queue for invoking callbacks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1389008-setsamplebufferdelegate?language=objc +func (c_ CaptureVideoDataOutput) SetSampleBufferDelegateObjectQueue(sampleBufferDelegateObject objc.IObject, sampleBufferCallbackQueue dispatch.Queue) { + objc.Call[objc.Void](c_, objc.Sel("setSampleBufferDelegate:queue:"), objc.Ptr(sampleBufferDelegateObject), sampleBufferCallbackQueue) +} + +// The video pixel formats that the output supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1387050-availablevideocvpixelformattypes?language=objc +func (c_ CaptureVideoDataOutput) AvailableVideoCVPixelFormatTypes() []foundation.Number { + rv := objc.Call[[]foundation.Number](c_, objc.Sel("availableVideoCVPixelFormatTypes")) + return rv +} + +// A dictionary that contains the compression settings for the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1389945-videosettings?language=objc +func (c_ CaptureVideoDataOutput) VideoSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("videoSettings")) + return rv +} + +// A dictionary that contains the compression settings for the output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1389945-videosettings?language=objc +func (c_ CaptureVideoDataOutput) SetVideoSettings(value map[string]objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setVideoSettings:"), value) +} + +// The queue on which the system invokes delegate callbacks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1385831-samplebuffercallbackqueue?language=objc +func (c_ CaptureVideoDataOutput) SampleBufferCallbackQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](c_, objc.Sel("sampleBufferCallbackQueue")) + return rv +} + +// The video codecs that the output supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1389227-availablevideocodectypes?language=objc +func (c_ CaptureVideoDataOutput) AvailableVideoCodecTypes() []VideoCodecType { + rv := objc.Call[[]VideoCodecType](c_, objc.Sel("availableVideoCodecTypes")) + return rv +} + +// Indicates whether to drop video frames if they arrive late. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1385780-alwaysdiscardslatevideoframes?language=objc +func (c_ CaptureVideoDataOutput) AlwaysDiscardsLateVideoFrames() bool { + rv := objc.Call[bool](c_, objc.Sel("alwaysDiscardsLateVideoFrames")) + return rv +} + +// Indicates whether to drop video frames if they arrive late. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1385780-alwaysdiscardslatevideoframes?language=objc +func (c_ CaptureVideoDataOutput) SetAlwaysDiscardsLateVideoFrames(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setAlwaysDiscardsLateVideoFrames:"), value) +} + +// The capture object’s delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1385886-samplebufferdelegate?language=objc +func (c_ CaptureVideoDataOutput) SampleBufferDelegate() CaptureVideoDataOutputSampleBufferDelegateWrapper { + rv := objc.Call[CaptureVideoDataOutputSampleBufferDelegateWrapper](c_, objc.Sel("sampleBufferDelegate")) + return rv +} diff --git a/macos/avfoundation/capture_video_data_output_sample_buffer_delegate.gen.go b/macos/avfoundation/capture_video_data_output_sample_buffer_delegate.gen.go new file mode 100644 index 00000000..49952d23 --- /dev/null +++ b/macos/avfoundation/capture_video_data_output_sample_buffer_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// Methods for receiving sample buffers from, and monitoring the status of, a video data output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutputsamplebufferdelegate?language=objc +type PCaptureVideoDataOutputSampleBufferDelegate interface { + // optional + CaptureOutputDidOutputSampleBufferFromConnection(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) + HasCaptureOutputDidOutputSampleBufferFromConnection() bool +} + +// A delegate implementation builder for the [PCaptureVideoDataOutputSampleBufferDelegate] protocol. +type CaptureVideoDataOutputSampleBufferDelegate struct { + _CaptureOutputDidOutputSampleBufferFromConnection func(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) +} + +func (di *CaptureVideoDataOutputSampleBufferDelegate) HasCaptureOutputDidOutputSampleBufferFromConnection() bool { + return di._CaptureOutputDidOutputSampleBufferFromConnection != nil +} + +// Notifies the delegate that a new video frame was written. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutputsamplebufferdelegate/1385775-captureoutput?language=objc +func (di *CaptureVideoDataOutputSampleBufferDelegate) SetCaptureOutputDidOutputSampleBufferFromConnection(f func(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection)) { + di._CaptureOutputDidOutputSampleBufferFromConnection = f +} + +// Notifies the delegate that a new video frame was written. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutputsamplebufferdelegate/1385775-captureoutput?language=objc +func (di *CaptureVideoDataOutputSampleBufferDelegate) CaptureOutputDidOutputSampleBufferFromConnection(output CaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection CaptureConnection) { + di._CaptureOutputDidOutputSampleBufferFromConnection(output, sampleBuffer, connection) +} + +// A concrete type wrapper for the [PCaptureVideoDataOutputSampleBufferDelegate] protocol. +type CaptureVideoDataOutputSampleBufferDelegateWrapper struct { + objc.Object +} + +func (c_ CaptureVideoDataOutputSampleBufferDelegateWrapper) HasCaptureOutputDidOutputSampleBufferFromConnection() bool { + return c_.RespondsToSelector(objc.Sel("captureOutput:didOutputSampleBuffer:fromConnection:")) +} + +// Notifies the delegate that a new video frame was written. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutputsamplebufferdelegate/1385775-captureoutput?language=objc +func (c_ CaptureVideoDataOutputSampleBufferDelegateWrapper) CaptureOutputDidOutputSampleBufferFromConnection(output ICaptureOutput, sampleBuffer coremedia.SampleBufferRef, connection ICaptureConnection) { + objc.Call[objc.Void](c_, objc.Sel("captureOutput:didOutputSampleBuffer:fromConnection:"), objc.Ptr(output), sampleBuffer, objc.Ptr(connection)) +} diff --git a/macos/avfoundation/capture_video_preview_layer.gen.go b/macos/avfoundation/capture_video_preview_layer.gen.go new file mode 100644 index 00000000..a1e944d2 --- /dev/null +++ b/macos/avfoundation/capture_video_preview_layer.gen.go @@ -0,0 +1,262 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureVideoPreviewLayer] class. +var CaptureVideoPreviewLayerClass = _CaptureVideoPreviewLayerClass{objc.GetClass("AVCaptureVideoPreviewLayer")} + +type _CaptureVideoPreviewLayerClass struct { + objc.Class +} + +// An interface definition for the [CaptureVideoPreviewLayer] class. +type ICaptureVideoPreviewLayer interface { + quartzcore.ILayer + TransformedMetadataObjectForMetadataObject(metadataObject IMetadataObject) MetadataObject + MetadataOutputRectOfInterestForRect(rectInLayerCoordinates coregraphics.Rect) coregraphics.Rect + CaptureDevicePointOfInterestForPoint(pointInLayer coregraphics.Point) coregraphics.Point + SetSessionWithNoConnection(session ICaptureSession) + RectForMetadataOutputRectOfInterest(rectInMetadataOutputCoordinates coregraphics.Rect) coregraphics.Rect + PointForCaptureDevicePointOfInterest(captureDevicePointOfInterest coregraphics.Point) coregraphics.Point + VideoGravity() LayerVideoGravity + SetVideoGravity(value LayerVideoGravity) + Session() CaptureSession + SetSession(value ICaptureSession) + Connection() CaptureConnection +} + +// A Core Animation layer that displays video from a camera device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer?language=objc +type CaptureVideoPreviewLayer struct { + quartzcore.Layer +} + +func CaptureVideoPreviewLayerFrom(ptr unsafe.Pointer) CaptureVideoPreviewLayer { + return CaptureVideoPreviewLayer{ + Layer: quartzcore.LayerFrom(ptr), + } +} + +func (c_ CaptureVideoPreviewLayer) InitWithSessionWithNoConnection(session ICaptureSession) CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](c_, objc.Sel("initWithSessionWithNoConnection:"), objc.Ptr(session)) + return rv +} + +// Creates a layer to preview the visual output of a capture session, without making connections to eligible video inputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1387426-initwithsessionwithnoconnection?language=objc +func NewCaptureVideoPreviewLayerWithSessionWithNoConnection(session ICaptureSession) CaptureVideoPreviewLayer { + instance := CaptureVideoPreviewLayerClass.Alloc().InitWithSessionWithNoConnection(session) + instance.Autorelease() + return instance +} + +func (cc _CaptureVideoPreviewLayerClass) LayerWithSessionWithNoConnection(session ICaptureSession) CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](cc, objc.Sel("layerWithSessionWithNoConnection:"), objc.Ptr(session)) + return rv +} + +// Returns a new layer to preview the visual output of a capture session, without making connections to eligible video inputs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1567197-layerwithsessionwithnoconnection?language=objc +func CaptureVideoPreviewLayer_LayerWithSessionWithNoConnection(session ICaptureSession) CaptureVideoPreviewLayer { + return CaptureVideoPreviewLayerClass.LayerWithSessionWithNoConnection(session) +} + +func (cc _CaptureVideoPreviewLayerClass) LayerWithSession(session ICaptureSession) CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](cc, objc.Sel("layerWithSession:"), objc.Ptr(session)) + return rv +} + +// Returns a new layer to preview the visual output of a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1567198-layerwithsession?language=objc +func CaptureVideoPreviewLayer_LayerWithSession(session ICaptureSession) CaptureVideoPreviewLayer { + return CaptureVideoPreviewLayerClass.LayerWithSession(session) +} + +func (c_ CaptureVideoPreviewLayer) InitWithSession(session ICaptureSession) CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](c_, objc.Sel("initWithSession:"), objc.Ptr(session)) + return rv +} + +// Creates a layer to preview the visual output of a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1387766-initwithsession?language=objc +func NewCaptureVideoPreviewLayerWithSession(session ICaptureSession) CaptureVideoPreviewLayer { + instance := CaptureVideoPreviewLayerClass.Alloc().InitWithSession(session) + instance.Autorelease() + return instance +} + +func (cc _CaptureVideoPreviewLayerClass) Alloc() CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](cc, objc.Sel("alloc")) + return rv +} + +func CaptureVideoPreviewLayer_Alloc() CaptureVideoPreviewLayer { + return CaptureVideoPreviewLayerClass.Alloc() +} + +func (cc _CaptureVideoPreviewLayerClass) New() CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureVideoPreviewLayer() CaptureVideoPreviewLayer { + return CaptureVideoPreviewLayerClass.New() +} + +func (c_ CaptureVideoPreviewLayer) Init() CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](c_, objc.Sel("init")) + return rv +} + +func (cc _CaptureVideoPreviewLayerClass) Layer() CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](cc, objc.Sel("layer")) + return rv +} + +// Creates and returns an instance of the layer object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410793-layer?language=objc +func CaptureVideoPreviewLayer_Layer() CaptureVideoPreviewLayer { + return CaptureVideoPreviewLayerClass.Layer() +} + +func (c_ CaptureVideoPreviewLayer) InitWithLayer(layer objc.IObject) CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](c_, objc.Sel("initWithLayer:"), layer) + return rv +} + +// Override to copy or initialize custom fields of the specified layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410842-initwithlayer?language=objc +func NewCaptureVideoPreviewLayerWithLayer(layer objc.IObject) CaptureVideoPreviewLayer { + instance := CaptureVideoPreviewLayerClass.Alloc().InitWithLayer(layer) + instance.Autorelease() + return instance +} + +func (c_ CaptureVideoPreviewLayer) ModelLayer() CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](c_, objc.Sel("modelLayer")) + return rv +} + +// Returns the model layer object associated with the receiver, if any. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410853-modellayer?language=objc +func CaptureVideoPreviewLayer_ModelLayer() CaptureVideoPreviewLayer { + instance := CaptureVideoPreviewLayerClass.Alloc().ModelLayer() + instance.Autorelease() + return instance +} + +func (c_ CaptureVideoPreviewLayer) PresentationLayer() CaptureVideoPreviewLayer { + rv := objc.Call[CaptureVideoPreviewLayer](c_, objc.Sel("presentationLayer")) + return rv +} + +// Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410744-presentationlayer?language=objc +func CaptureVideoPreviewLayer_PresentationLayer() CaptureVideoPreviewLayer { + instance := CaptureVideoPreviewLayerClass.Alloc().PresentationLayer() + instance.Autorelease() + return instance +} + +// Converts a metadata object’s visual properties to layer coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1623501-transformedmetadataobjectformeta?language=objc +func (c_ CaptureVideoPreviewLayer) TransformedMetadataObjectForMetadataObject(metadataObject IMetadataObject) MetadataObject { + rv := objc.Call[MetadataObject](c_, objc.Sel("transformedMetadataObjectForMetadataObject:"), objc.Ptr(metadataObject)) + return rv +} + +// Converts a rectangle from layer coordinates to the coordinate space of the metadata output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1623495-metadataoutputrectofinterestforr?language=objc +func (c_ CaptureVideoPreviewLayer) MetadataOutputRectOfInterestForRect(rectInLayerCoordinates coregraphics.Rect) coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](c_, objc.Sel("metadataOutputRectOfInterestForRect:"), rectInLayerCoordinates) + return rv +} + +// Converts a point from layer coordinates to the coordinate space of the capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1623497-capturedevicepointofinterestforp?language=objc +func (c_ CaptureVideoPreviewLayer) CaptureDevicePointOfInterestForPoint(pointInLayer coregraphics.Point) coregraphics.Point { + rv := objc.Call[coregraphics.Point](c_, objc.Sel("captureDevicePointOfInterestForPoint:"), pointInLayer) + return rv +} + +// Associates a session with the layer without automatically forming a connection to an eligible input port. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1390387-setsessionwithnoconnection?language=objc +func (c_ CaptureVideoPreviewLayer) SetSessionWithNoConnection(session ICaptureSession) { + objc.Call[objc.Void](c_, objc.Sel("setSessionWithNoConnection:"), objc.Ptr(session)) +} + +// Converts a rectangle from metadata output coordinates to the coordinate space of the layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1623498-rectformetadataoutputrectofinter?language=objc +func (c_ CaptureVideoPreviewLayer) RectForMetadataOutputRectOfInterest(rectInMetadataOutputCoordinates coregraphics.Rect) coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](c_, objc.Sel("rectForMetadataOutputRectOfInterest:"), rectInMetadataOutputCoordinates) + return rv +} + +// Converts a point from the coordinate space of the capture device to the coordinate space of the layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1623502-pointforcapturedevicepointofinte?language=objc +func (c_ CaptureVideoPreviewLayer) PointForCaptureDevicePointOfInterest(captureDevicePointOfInterest coregraphics.Point) coregraphics.Point { + rv := objc.Call[coregraphics.Point](c_, objc.Sel("pointForCaptureDevicePointOfInterest:"), captureDevicePointOfInterest) + return rv +} + +// A value that indicates how the layer displays video content within its bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1386708-videogravity?language=objc +func (c_ CaptureVideoPreviewLayer) VideoGravity() LayerVideoGravity { + rv := objc.Call[LayerVideoGravity](c_, objc.Sel("videoGravity")) + return rv +} + +// A value that indicates how the layer displays video content within its bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1386708-videogravity?language=objc +func (c_ CaptureVideoPreviewLayer) SetVideoGravity(value LayerVideoGravity) { + objc.Call[objc.Void](c_, objc.Sel("setVideoGravity:"), value) +} + +// A capture session with visual output to preview. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1386157-session?language=objc +func (c_ CaptureVideoPreviewLayer) Session() CaptureSession { + rv := objc.Call[CaptureSession](c_, objc.Sel("session")) + return rv +} + +// A capture session with visual output to preview. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1386157-session?language=objc +func (c_ CaptureVideoPreviewLayer) SetSession(value ICaptureSession) { + objc.Call[objc.Void](c_, objc.Sel("setSession:"), objc.Ptr(value)) +} + +// An object that describes the connection from the layer to a particular input port. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer/1390893-connection?language=objc +func (c_ CaptureVideoPreviewLayer) Connection() CaptureConnection { + rv := objc.Call[CaptureConnection](c_, objc.Sel("connection")) + return rv +} diff --git a/macos/avfoundation/composition.gen.go b/macos/avfoundation/composition.gen.go new file mode 100644 index 00000000..d37beb4e --- /dev/null +++ b/macos/avfoundation/composition.gen.go @@ -0,0 +1,117 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Composition] class. +var CompositionClass = _CompositionClass{objc.GetClass("AVComposition")} + +type _CompositionClass struct { + objc.Class +} + +// An interface definition for the [Composition] class. +type IComposition interface { + IAsset + TracksWithMediaType(mediaType MediaType) []CompositionTrack + TracksWithMediaCharacteristic(mediaCharacteristic MediaCharacteristic) []CompositionTrack + TrackWithTrackID(trackID objc.IObject) CompositionTrack + URLAssetInitializationOptions() map[string]objc.Object + NaturalSize() coregraphics.Size +} + +// An object that combines and arranges media from multiple assets into a single composite asset that you can play or process. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcomposition?language=objc +type Composition struct { + Asset +} + +func CompositionFrom(ptr unsafe.Pointer) Composition { + return Composition{ + Asset: AssetFrom(ptr), + } +} + +func (cc _CompositionClass) Alloc() Composition { + rv := objc.Call[Composition](cc, objc.Sel("alloc")) + return rv +} + +func Composition_Alloc() Composition { + return CompositionClass.Alloc() +} + +func (cc _CompositionClass) New() Composition { + rv := objc.Call[Composition](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewComposition() Composition { + return CompositionClass.New() +} + +func (c_ Composition) Init() Composition { + rv := objc.Call[Composition](c_, objc.Sel("init")) + return rv +} + +func (cc _CompositionClass) AssetWithURL(URL foundation.IURL) Composition { + rv := objc.Call[Composition](cc, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func Composition_AssetWithURL(URL foundation.IURL) Composition { + return CompositionClass.AssetWithURL(URL) +} + +// Returns tracks that contain media of a specified type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcomposition/1386534-trackswithmediatype?language=objc +func (c_ Composition) TracksWithMediaType(mediaType MediaType) []CompositionTrack { + rv := objc.Call[[]CompositionTrack](c_, objc.Sel("tracksWithMediaType:"), mediaType) + return rv +} + +// Returns tracks that contain media of a specified characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcomposition/1387525-trackswithmediacharacteristic?language=objc +func (c_ Composition) TracksWithMediaCharacteristic(mediaCharacteristic MediaCharacteristic) []CompositionTrack { + rv := objc.Call[[]CompositionTrack](c_, objc.Sel("tracksWithMediaCharacteristic:"), mediaCharacteristic) + return rv +} + +// Returns a track that contains the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcomposition/1388473-trackwithtrackid?language=objc +func (c_ Composition) TrackWithTrackID(trackID objc.IObject) CompositionTrack { + rv := objc.Call[CompositionTrack](c_, objc.Sel("trackWithTrackID:"), objc.Ptr(trackID)) + return rv +} + +// The options you used to create a composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcomposition/1387080-urlassetinitializationoptions?language=objc +func (c_ Composition) URLAssetInitializationOptions() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("URLAssetInitializationOptions")) + return rv +} + +// The authored size of the visual portion of the composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcomposition/1387247-naturalsize?language=objc +func (c_ Composition) NaturalSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](c_, objc.Sel("naturalSize")) + return rv +} diff --git a/macos/avfoundation/composition_track.gen.go b/macos/avfoundation/composition_track.gen.go new file mode 100644 index 00000000..5c01ca83 --- /dev/null +++ b/macos/avfoundation/composition_track.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionTrack] class. +var CompositionTrackClass = _CompositionTrackClass{objc.GetClass("AVCompositionTrack")} + +type _CompositionTrackClass struct { + objc.Class +} + +// An interface definition for the [CompositionTrack] class. +type ICompositionTrack interface { + IAssetTrack + SegmentForTrackTime(trackTime coremedia.Time) CompositionTrackSegment + FormatDescriptionReplacements() []CompositionTrackFormatDescriptionReplacement +} + +// A track in a composition that presents media of a uniform type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontrack?language=objc +type CompositionTrack struct { + AssetTrack +} + +func CompositionTrackFrom(ptr unsafe.Pointer) CompositionTrack { + return CompositionTrack{ + AssetTrack: AssetTrackFrom(ptr), + } +} + +func (cc _CompositionTrackClass) Alloc() CompositionTrack { + rv := objc.Call[CompositionTrack](cc, objc.Sel("alloc")) + return rv +} + +func CompositionTrack_Alloc() CompositionTrack { + return CompositionTrackClass.Alloc() +} + +func (cc _CompositionTrackClass) New() CompositionTrack { + rv := objc.Call[CompositionTrack](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionTrack() CompositionTrack { + return CompositionTrackClass.New() +} + +func (c_ CompositionTrack) Init() CompositionTrack { + rv := objc.Call[CompositionTrack](c_, objc.Sel("init")) + return rv +} + +// Returns a segment whose target time range contains, or is closest to, the specified track time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontrack/2865555-segmentfortracktime?language=objc +func (c_ CompositionTrack) SegmentForTrackTime(trackTime coremedia.Time) CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](c_, objc.Sel("segmentForTrackTime:"), trackTime) + return rv +} + +// The replacement format descriptions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontrack/3194194-formatdescriptionreplacements?language=objc +func (c_ CompositionTrack) FormatDescriptionReplacements() []CompositionTrackFormatDescriptionReplacement { + rv := objc.Call[[]CompositionTrackFormatDescriptionReplacement](c_, objc.Sel("formatDescriptionReplacements")) + return rv +} diff --git a/macos/avfoundation/composition_track_format_description_replacement.gen.go b/macos/avfoundation/composition_track_format_description_replacement.gen.go new file mode 100644 index 00000000..88a7c100 --- /dev/null +++ b/macos/avfoundation/composition_track_format_description_replacement.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionTrackFormatDescriptionReplacement] class. +var CompositionTrackFormatDescriptionReplacementClass = _CompositionTrackFormatDescriptionReplacementClass{objc.GetClass("AVCompositionTrackFormatDescriptionReplacement")} + +type _CompositionTrackFormatDescriptionReplacementClass struct { + objc.Class +} + +// An interface definition for the [CompositionTrackFormatDescriptionReplacement] class. +type ICompositionTrackFormatDescriptionReplacement interface { + objc.IObject + OriginalFormatDescription() coremedia.FormatDescriptionRef + ReplacementFormatDescription() coremedia.FormatDescriptionRef +} + +// An object that represents a format description and its replacement. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontrackformatdescriptionreplacement?language=objc +type CompositionTrackFormatDescriptionReplacement struct { + objc.Object +} + +func CompositionTrackFormatDescriptionReplacementFrom(ptr unsafe.Pointer) CompositionTrackFormatDescriptionReplacement { + return CompositionTrackFormatDescriptionReplacement{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CompositionTrackFormatDescriptionReplacementClass) Alloc() CompositionTrackFormatDescriptionReplacement { + rv := objc.Call[CompositionTrackFormatDescriptionReplacement](cc, objc.Sel("alloc")) + return rv +} + +func CompositionTrackFormatDescriptionReplacement_Alloc() CompositionTrackFormatDescriptionReplacement { + return CompositionTrackFormatDescriptionReplacementClass.Alloc() +} + +func (cc _CompositionTrackFormatDescriptionReplacementClass) New() CompositionTrackFormatDescriptionReplacement { + rv := objc.Call[CompositionTrackFormatDescriptionReplacement](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionTrackFormatDescriptionReplacement() CompositionTrackFormatDescriptionReplacement { + return CompositionTrackFormatDescriptionReplacementClass.New() +} + +func (c_ CompositionTrackFormatDescriptionReplacement) Init() CompositionTrackFormatDescriptionReplacement { + rv := objc.Call[CompositionTrackFormatDescriptionReplacement](c_, objc.Sel("init")) + return rv +} + +// The format description to replace. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontrackformatdescriptionreplacement/3180002-originalformatdescription?language=objc +func (c_ CompositionTrackFormatDescriptionReplacement) OriginalFormatDescription() coremedia.FormatDescriptionRef { + rv := objc.Call[coremedia.FormatDescriptionRef](c_, objc.Sel("originalFormatDescription")) + return rv +} + +// The replacement format description. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontrackformatdescriptionreplacement/3180003-replacementformatdescription?language=objc +func (c_ CompositionTrackFormatDescriptionReplacement) ReplacementFormatDescription() coremedia.FormatDescriptionRef { + rv := objc.Call[coremedia.FormatDescriptionRef](c_, objc.Sel("replacementFormatDescription")) + return rv +} diff --git a/macos/avfoundation/composition_track_segment.gen.go b/macos/avfoundation/composition_track_segment.gen.go new file mode 100644 index 00000000..3c96b493 --- /dev/null +++ b/macos/avfoundation/composition_track_segment.gen.go @@ -0,0 +1,130 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionTrackSegment] class. +var CompositionTrackSegmentClass = _CompositionTrackSegmentClass{objc.GetClass("AVCompositionTrackSegment")} + +type _CompositionTrackSegmentClass struct { + objc.Class +} + +// An interface definition for the [CompositionTrackSegment] class. +type ICompositionTrackSegment interface { + IAssetTrackSegment + SourceURL() foundation.URL + SourceTrackID() objc.Object +} + +// A track segment that maps a time from the source media track to the composition track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment?language=objc +type CompositionTrackSegment struct { + AssetTrackSegment +} + +func CompositionTrackSegmentFrom(ptr unsafe.Pointer) CompositionTrackSegment { + return CompositionTrackSegment{ + AssetTrackSegment: AssetTrackSegmentFrom(ptr), + } +} + +func (cc _CompositionTrackSegmentClass) CompositionTrackSegmentWithTimeRange(timeRange coremedia.TimeRange) CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](cc, objc.Sel("compositionTrackSegmentWithTimeRange:"), timeRange) + return rv +} + +// Returns a new object that presents an empty composition track segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment/1400556-compositiontracksegmentwithtimer?language=objc +func CompositionTrackSegment_CompositionTrackSegmentWithTimeRange(timeRange coremedia.TimeRange) CompositionTrackSegment { + return CompositionTrackSegmentClass.CompositionTrackSegmentWithTimeRange(timeRange) +} + +func (c_ CompositionTrackSegment) InitWithTimeRange(timeRange coremedia.TimeRange) CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](c_, objc.Sel("initWithTimeRange:"), timeRange) + return rv +} + +// Creates an object that presents an empty composition track segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment/1386841-initwithtimerange?language=objc +func NewCompositionTrackSegmentWithTimeRange(timeRange coremedia.TimeRange) CompositionTrackSegment { + instance := CompositionTrackSegmentClass.Alloc().InitWithTimeRange(timeRange) + instance.Autorelease() + return instance +} + +func (c_ CompositionTrackSegment) InitWithURLTrackIDSourceTimeRangeTargetTimeRange(URL foundation.IURL, trackID objc.IObject, sourceTimeRange coremedia.TimeRange, targetTimeRange coremedia.TimeRange) CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](c_, objc.Sel("initWithURL:trackID:sourceTimeRange:targetTimeRange:"), objc.Ptr(URL), objc.Ptr(trackID), sourceTimeRange, targetTimeRange) + return rv +} + +// Creates an object that presents a segment of a media file that the specified URL references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment/1390282-initwithurl?language=objc +func NewCompositionTrackSegmentWithURLTrackIDSourceTimeRangeTargetTimeRange(URL foundation.IURL, trackID objc.IObject, sourceTimeRange coremedia.TimeRange, targetTimeRange coremedia.TimeRange) CompositionTrackSegment { + instance := CompositionTrackSegmentClass.Alloc().InitWithURLTrackIDSourceTimeRangeTargetTimeRange(URL, trackID, sourceTimeRange, targetTimeRange) + instance.Autorelease() + return instance +} + +func (cc _CompositionTrackSegmentClass) CompositionTrackSegmentWithURLTrackIDSourceTimeRangeTargetTimeRange(URL foundation.IURL, trackID objc.IObject, sourceTimeRange coremedia.TimeRange, targetTimeRange coremedia.TimeRange) CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](cc, objc.Sel("compositionTrackSegmentWithURL:trackID:sourceTimeRange:targetTimeRange:"), objc.Ptr(URL), objc.Ptr(trackID), sourceTimeRange, targetTimeRange) + return rv +} + +// Returns a new an object that presents a segment of a media file that the specified URL references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment/1400552-compositiontracksegmentwithurl?language=objc +func CompositionTrackSegment_CompositionTrackSegmentWithURLTrackIDSourceTimeRangeTargetTimeRange(URL foundation.IURL, trackID objc.IObject, sourceTimeRange coremedia.TimeRange, targetTimeRange coremedia.TimeRange) CompositionTrackSegment { + return CompositionTrackSegmentClass.CompositionTrackSegmentWithURLTrackIDSourceTimeRangeTargetTimeRange(URL, trackID, sourceTimeRange, targetTimeRange) +} + +func (cc _CompositionTrackSegmentClass) Alloc() CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](cc, objc.Sel("alloc")) + return rv +} + +func CompositionTrackSegment_Alloc() CompositionTrackSegment { + return CompositionTrackSegmentClass.Alloc() +} + +func (cc _CompositionTrackSegmentClass) New() CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionTrackSegment() CompositionTrackSegment { + return CompositionTrackSegmentClass.New() +} + +func (c_ CompositionTrackSegment) Init() CompositionTrackSegment { + rv := objc.Call[CompositionTrackSegment](c_, objc.Sel("init")) + return rv +} + +// A URL of the container file whose media this track segment presents. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment/1386814-sourceurl?language=objc +func (c_ CompositionTrackSegment) SourceURL() foundation.URL { + rv := objc.Call[foundation.URL](c_, objc.Sel("sourceURL")) + return rv +} + +// An identifier of a track in the container file whose media this track segment presents. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment/1388326-sourcetrackid?language=objc +func (c_ CompositionTrackSegment) SourceTrackID() objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("sourceTrackID")) + return rv +} diff --git a/macos/avfoundation/content_key.gen.go b/macos/avfoundation/content_key.gen.go new file mode 100644 index 00000000..c27c4701 --- /dev/null +++ b/macos/avfoundation/content_key.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContentKey] class. +var ContentKeyClass = _ContentKeyClass{objc.GetClass("AVContentKey")} + +type _ContentKeyClass struct { + objc.Class +} + +// An interface definition for the [ContentKey] class. +type IContentKey interface { + objc.IObject + ContentKeySpecifier() ContentKeySpecifier +} + +// An object that represents the content key decryptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkey?language=objc +type ContentKey struct { + objc.Object +} + +func ContentKeyFrom(ptr unsafe.Pointer) ContentKey { + return ContentKey{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _ContentKeyClass) Alloc() ContentKey { + rv := objc.Call[ContentKey](cc, objc.Sel("alloc")) + return rv +} + +func ContentKey_Alloc() ContentKey { + return ContentKeyClass.Alloc() +} + +func (cc _ContentKeyClass) New() ContentKey { + rv := objc.Call[ContentKey](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContentKey() ContentKey { + return ContentKeyClass.New() +} + +func (c_ ContentKey) Init() ContentKey { + rv := objc.Call[ContentKey](c_, objc.Sel("init")) + return rv +} + +// The content key’s unique identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkey/3726100-contentkeyspecifier?language=objc +func (c_ ContentKey) ContentKeySpecifier() ContentKeySpecifier { + rv := objc.Call[ContentKeySpecifier](c_, objc.Sel("contentKeySpecifier")) + return rv +} diff --git a/macos/avfoundation/content_key_recipient.gen.go b/macos/avfoundation/content_key_recipient.gen.go new file mode 100644 index 00000000..be842232 --- /dev/null +++ b/macos/avfoundation/content_key_recipient.gen.go @@ -0,0 +1,48 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol for requiring decryption keys for media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrecipient?language=objc +type PContentKeyRecipient interface { + // optional + ContentKeySessionDidProvideContentKey(contentKeySession ContentKeySession, contentKey ContentKey) + HasContentKeySessionDidProvideContentKey() bool + + // optional + MayRequireContentKeysForMediaDataProcessing() bool + HasMayRequireContentKeysForMediaDataProcessing() bool +} + +// A concrete type wrapper for the [PContentKeyRecipient] protocol. +type ContentKeyRecipientWrapper struct { + objc.Object +} + +func (c_ ContentKeyRecipientWrapper) HasContentKeySessionDidProvideContentKey() bool { + return c_.RespondsToSelector(objc.Sel("contentKeySession:didProvideContentKey:")) +} + +// Tells the recipient that a content key is available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrecipient/3726101-contentkeysession?language=objc +func (c_ ContentKeyRecipientWrapper) ContentKeySessionDidProvideContentKey(contentKeySession IContentKeySession, contentKey IContentKey) { + objc.Call[objc.Void](c_, objc.Sel("contentKeySession:didProvideContentKey:"), objc.Ptr(contentKeySession), objc.Ptr(contentKey)) +} + +func (c_ ContentKeyRecipientWrapper) HasMayRequireContentKeysForMediaDataProcessing() bool { + return c_.RespondsToSelector(objc.Sel("mayRequireContentKeysForMediaDataProcessing")) +} + +// A Boolean value that indicates whether the recipient requires decryption keys for media data to enable processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrecipient/2799194-mayrequirecontentkeysformediadat?language=objc +func (c_ ContentKeyRecipientWrapper) MayRequireContentKeysForMediaDataProcessing() bool { + rv := objc.Call[bool](c_, objc.Sel("mayRequireContentKeysForMediaDataProcessing")) + return rv +} diff --git a/macos/avfoundation/content_key_request.gen.go b/macos/avfoundation/content_key_request.gen.go new file mode 100644 index 00000000..996083f8 --- /dev/null +++ b/macos/avfoundation/content_key_request.gen.go @@ -0,0 +1,164 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContentKeyRequest] class. +var ContentKeyRequestClass = _ContentKeyRequestClass{objc.GetClass("AVContentKeyRequest")} + +type _ContentKeyRequestClass struct { + objc.Class +} + +// An interface definition for the [ContentKeyRequest] class. +type IContentKeyRequest interface { + objc.IObject + ProcessContentKeyResponseError(error foundation.IError) + ProcessContentKeyResponse(keyResponse IContentKeyResponse) + MakeStreamingContentKeyRequestDataForAppContentIdentifierOptionsCompletionHandler(appIdentifier []byte, contentIdentifier []byte, options map[string]objc.IObject, handler func(contentKeyRequestData []byte, error foundation.Error)) + RenewsExpiringResponseData() bool + Error() foundation.Error + Options() map[string]objc.Object + ContentKey() ContentKey + CanProvidePersistableContentKey() bool + InitializationData() []byte + ContentKeySpecifier() ContentKeySpecifier + Status() ContentKeyRequestStatus + Identifier() objc.Object +} + +// An object that encapsulates information about a content decryption key request issued from a content key session object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest?language=objc +type ContentKeyRequest struct { + objc.Object +} + +func ContentKeyRequestFrom(ptr unsafe.Pointer) ContentKeyRequest { + return ContentKeyRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _ContentKeyRequestClass) Alloc() ContentKeyRequest { + rv := objc.Call[ContentKeyRequest](cc, objc.Sel("alloc")) + return rv +} + +func ContentKeyRequest_Alloc() ContentKeyRequest { + return ContentKeyRequestClass.Alloc() +} + +func (cc _ContentKeyRequestClass) New() ContentKeyRequest { + rv := objc.Call[ContentKeyRequest](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContentKeyRequest() ContentKeyRequest { + return ContentKeyRequestClass.New() +} + +func (c_ ContentKeyRequest) Init() ContentKeyRequest { + rv := objc.Call[ContentKeyRequest](c_, objc.Sel("init")) + return rv +} + +// Tells the receiver that the app was unable to obtain a content key response. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799159-processcontentkeyresponseerror?language=objc +func (c_ ContentKeyRequest) ProcessContentKeyResponseError(error foundation.IError) { + objc.Call[objc.Void](c_, objc.Sel("processContentKeyResponseError:"), objc.Ptr(error)) +} + +// Sends the specified content key response to the receiver for processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799165-processcontentkeyresponse?language=objc +func (c_ ContentKeyRequest) ProcessContentKeyResponse(keyResponse IContentKeyResponse) { + objc.Call[objc.Void](c_, objc.Sel("processContentKeyResponse:"), objc.Ptr(keyResponse)) +} + +// Obtains encrypted key request data for a specific combination of app and content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799198-makestreamingcontentkeyrequestda?language=objc +func (c_ ContentKeyRequest) MakeStreamingContentKeyRequestDataForAppContentIdentifierOptionsCompletionHandler(appIdentifier []byte, contentIdentifier []byte, options map[string]objc.IObject, handler func(contentKeyRequestData []byte, error foundation.Error)) { + objc.Call[objc.Void](c_, objc.Sel("makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:"), appIdentifier, contentIdentifier, options, handler) +} + +// A Boolean value that indicates whether the content key request renews previously provided response data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799193-renewsexpiringresponsedata?language=objc +func (c_ ContentKeyRequest) RenewsExpiringResponseData() bool { + rv := objc.Call[bool](c_, objc.Sel("renewsExpiringResponseData")) + return rv +} + +// The error description for a failed key request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799182-error?language=objc +func (c_ ContentKeyRequest) Error() foundation.Error { + rv := objc.Call[foundation.Error](c_, objc.Sel("error")) + return rv +} + +// A dictionary of options used to initialize key loading. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/3112525-options?language=objc +func (c_ ContentKeyRequest) Options() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("options")) + return rv +} + +// The generated content key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/3726102-contentkey?language=objc +func (c_ ContentKeyRequest) ContentKey() ContentKey { + rv := objc.Call[ContentKey](c_, objc.Sel("contentKey")) + return rv +} + +// The content key request used to create a persistable content key or respond to a previous request with a persistable content key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799185-canprovidepersistablecontentkey?language=objc +func (c_ ContentKeyRequest) CanProvidePersistableContentKey() bool { + rv := objc.Call[bool](c_, objc.Sel("canProvidePersistableContentKey")) + return rv +} + +// The data used to obtain a key response. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799186-initializationdata?language=objc +func (c_ ContentKeyRequest) InitializationData() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("initializationData")) + return rv +} + +// The requested content key specifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/3726103-contentkeyspecifier?language=objc +func (c_ ContentKeyRequest) ContentKeySpecifier() ContentKeySpecifier { + rv := objc.Call[ContentKeySpecifier](c_, objc.Sel("contentKeySpecifier")) + return rv +} + +// The current state of the content key request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799190-status?language=objc +func (c_ ContentKeyRequest) Status() ContentKeyRequestStatus { + rv := objc.Call[ContentKeyRequestStatus](c_, objc.Sel("status")) + return rv +} + +// The identifier for the content key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799205-identifier?language=objc +func (c_ ContentKeyRequest) Identifier() objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("identifier")) + return rv +} diff --git a/macos/avfoundation/content_key_response.gen.go b/macos/avfoundation/content_key_response.gen.go new file mode 100644 index 00000000..cfd2c20a --- /dev/null +++ b/macos/avfoundation/content_key_response.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContentKeyResponse] class. +var ContentKeyResponseClass = _ContentKeyResponseClass{objc.GetClass("AVContentKeyResponse")} + +type _ContentKeyResponseClass struct { + objc.Class +} + +// An interface definition for the [ContentKeyResponse] class. +type IContentKeyResponse interface { + objc.IObject +} + +// An object that encapsulates information about a response to a content decryption key request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyresponse?language=objc +type ContentKeyResponse struct { + objc.Object +} + +func ContentKeyResponseFrom(ptr unsafe.Pointer) ContentKeyResponse { + return ContentKeyResponse{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _ContentKeyResponseClass) ContentKeyResponseWithClearKeyDataInitializationVector(keyData []byte, initializationVector []byte) ContentKeyResponse { + rv := objc.Call[ContentKeyResponse](cc, objc.Sel("contentKeyResponseWithClearKeyData:initializationVector:"), keyData, initializationVector) + return rv +} + +// Creates a new key response object for key data and initialization vector sent in the clear. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyresponse/2867986-contentkeyresponsewithclearkeyda?language=objc +func ContentKeyResponse_ContentKeyResponseWithClearKeyDataInitializationVector(keyData []byte, initializationVector []byte) ContentKeyResponse { + return ContentKeyResponseClass.ContentKeyResponseWithClearKeyDataInitializationVector(keyData, initializationVector) +} + +func (cc _ContentKeyResponseClass) ContentKeyResponseWithAuthorizationTokenData(authorizationTokenData []byte) ContentKeyResponse { + rv := objc.Call[ContentKeyResponse](cc, objc.Sel("contentKeyResponseWithAuthorizationTokenData:"), authorizationTokenData) + return rv +} + +// Creates a content key response with an authorization token. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyresponse/3088798-contentkeyresponsewithauthorizat?language=objc +func ContentKeyResponse_ContentKeyResponseWithAuthorizationTokenData(authorizationTokenData []byte) ContentKeyResponse { + return ContentKeyResponseClass.ContentKeyResponseWithAuthorizationTokenData(authorizationTokenData) +} + +func (cc _ContentKeyResponseClass) ContentKeyResponseWithFairPlayStreamingKeyResponseData(keyResponseData []byte) ContentKeyResponse { + rv := objc.Call[ContentKeyResponse](cc, objc.Sel("contentKeyResponseWithFairPlayStreamingKeyResponseData:"), keyResponseData) + return rv +} + +// Creates a content key response with an encrypted key response data blob when FairPlay Streaming is the key delivery method. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyresponse/2799183-contentkeyresponsewithfairplayst?language=objc +func ContentKeyResponse_ContentKeyResponseWithFairPlayStreamingKeyResponseData(keyResponseData []byte) ContentKeyResponse { + return ContentKeyResponseClass.ContentKeyResponseWithFairPlayStreamingKeyResponseData(keyResponseData) +} + +func (cc _ContentKeyResponseClass) Alloc() ContentKeyResponse { + rv := objc.Call[ContentKeyResponse](cc, objc.Sel("alloc")) + return rv +} + +func ContentKeyResponse_Alloc() ContentKeyResponse { + return ContentKeyResponseClass.Alloc() +} + +func (cc _ContentKeyResponseClass) New() ContentKeyResponse { + rv := objc.Call[ContentKeyResponse](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContentKeyResponse() ContentKeyResponse { + return ContentKeyResponseClass.New() +} + +func (c_ ContentKeyResponse) Init() ContentKeyResponse { + rv := objc.Call[ContentKeyResponse](c_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/content_key_session.gen.go b/macos/avfoundation/content_key_session.gen.go new file mode 100644 index 00000000..7002fb49 --- /dev/null +++ b/macos/avfoundation/content_key_session.gen.go @@ -0,0 +1,254 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContentKeySession] class. +var ContentKeySessionClass = _ContentKeySessionClass{objc.GetClass("AVContentKeySession")} + +type _ContentKeySessionClass struct { + objc.Class +} + +// An interface definition for the [ContentKeySession] class. +type IContentKeySession interface { + objc.IObject + MakeSecureTokenForExpirationDateOfPersistableContentKeyCompletionHandler(persistableContentKeyData []byte, handler func(secureTokenData []byte, error foundation.Error)) + RenewExpiringResponseDataForContentKeyRequest(contentKeyRequest IContentKeyRequest) + AddContentKeyRecipient(recipient PContentKeyRecipient) + AddContentKeyRecipientObject(recipientObject objc.IObject) + SetDelegateQueue(delegate PContentKeySessionDelegate, delegateQueue dispatch.Queue) + SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) + RemoveContentKeyRecipient(recipient PContentKeyRecipient) + RemoveContentKeyRecipientObject(recipientObject objc.IObject) + InvalidatePersistableContentKeyOptionsCompletionHandler(persistableContentKeyData []byte, options map[ContentKeySessionServerPlaybackContextOption]objc.IObject, handler func(secureTokenData []byte, error foundation.Error)) + InvalidateAllPersistableContentKeysForAppOptionsCompletionHandler(appIdentifier []byte, options map[ContentKeySessionServerPlaybackContextOption]objc.IObject, handler func(secureTokenData []byte, error foundation.Error)) + Expire() + ProcessContentKeyRequestWithIdentifierInitializationDataOptions(identifier objc.IObject, initializationData []byte, options map[string]objc.IObject) + KeySystem() ContentKeySystem + ContentProtectionSessionIdentifier() []byte + Delegate() ContentKeySessionDelegateWrapper + StorageURL() foundation.URL + ContentKeyRecipients() []ContentKeyRecipientWrapper + DelegateQueue() dispatch.Queue +} + +// An object that creates and tracks decryption keys for media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession?language=objc +type ContentKeySession struct { + objc.Object +} + +func ContentKeySessionFrom(ptr unsafe.Pointer) ContentKeySession { + return ContentKeySession{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _ContentKeySessionClass) ContentKeySessionWithKeySystem(keySystem ContentKeySystem) ContentKeySession { + rv := objc.Call[ContentKeySession](cc, objc.Sel("contentKeySessionWithKeySystem:"), keySystem) + return rv +} + +// Creates a content key session to manage a collection of content decryption keys. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2887362-contentkeysessionwithkeysystem?language=objc +func ContentKeySession_ContentKeySessionWithKeySystem(keySystem ContentKeySystem) ContentKeySession { + return ContentKeySessionClass.ContentKeySessionWithKeySystem(keySystem) +} + +func (cc _ContentKeySessionClass) Alloc() ContentKeySession { + rv := objc.Call[ContentKeySession](cc, objc.Sel("alloc")) + return rv +} + +func ContentKeySession_Alloc() ContentKeySession { + return ContentKeySessionClass.Alloc() +} + +func (cc _ContentKeySessionClass) New() ContentKeySession { + rv := objc.Call[ContentKeySession](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContentKeySession() ContentKeySession { + return ContentKeySessionClass.New() +} + +func (c_ ContentKeySession) Init() ContentKeySession { + rv := objc.Call[ContentKeySession](c_, objc.Sel("init")) + return rv +} + +// Removes expired session reports from storage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799170-removependingexpiredsessionrepor?language=objc +func (cc _ContentKeySessionClass) RemovePendingExpiredSessionReportsWithAppIdentifierStorageDirectoryAtURL(expiredSessionReports [][]byte, appIdentifier []byte, storageURL foundation.IURL) { + objc.Call[objc.Void](cc, objc.Sel("removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:"), expiredSessionReports, appIdentifier, objc.Ptr(storageURL)) +} + +// Removes expired session reports from storage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799170-removependingexpiredsessionrepor?language=objc +func ContentKeySession_RemovePendingExpiredSessionReportsWithAppIdentifierStorageDirectoryAtURL(expiredSessionReports [][]byte, appIdentifier []byte, storageURL foundation.IURL) { + ContentKeySessionClass.RemovePendingExpiredSessionReportsWithAppIdentifierStorageDirectoryAtURL(expiredSessionReports, appIdentifier, storageURL) +} + +// Creates a secure server playback context that the client sends to the key server to get an expiration date for the given persistable content key data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2887476-makesecuretokenforexpirationdate?language=objc +func (c_ ContentKeySession) MakeSecureTokenForExpirationDateOfPersistableContentKeyCompletionHandler(persistableContentKeyData []byte, handler func(secureTokenData []byte, error foundation.Error)) { + objc.Call[objc.Void](c_, objc.Sel("makeSecureTokenForExpirationDateOfPersistableContentKey:completionHandler:"), persistableContentKeyData, handler) +} + +// Tells the delegate that previously provided response data for a content key request is about to expire. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799208-renewexpiringresponsedataforcont?language=objc +func (c_ ContentKeySession) RenewExpiringResponseDataForContentKeyRequest(contentKeyRequest IContentKeyRequest) { + objc.Call[objc.Void](c_, objc.Sel("renewExpiringResponseDataForContentKeyRequest:"), objc.Ptr(contentKeyRequest)) +} + +// Tells the delegate that the specified recipient should have access to the decryption keys loaded with the session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799174-addcontentkeyrecipient?language=objc +func (c_ ContentKeySession) AddContentKeyRecipient(recipient PContentKeyRecipient) { + po0 := objc.WrapAsProtocol("AVContentKeyRecipient", recipient) + objc.Call[objc.Void](c_, objc.Sel("addContentKeyRecipient:"), po0) +} + +// Tells the delegate that the specified recipient should have access to the decryption keys loaded with the session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799174-addcontentkeyrecipient?language=objc +func (c_ ContentKeySession) AddContentKeyRecipientObject(recipientObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("addContentKeyRecipient:"), objc.Ptr(recipientObject)) +} + +// Sets the session’s delegate object and the dispatch queue on which to call the delegate’s methods. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799164-setdelegate?language=objc +func (c_ ContentKeySession) SetDelegateQueue(delegate PContentKeySessionDelegate, delegateQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVContentKeySessionDelegate", delegate) + objc.Call[objc.Void](c_, objc.Sel("setDelegate:queue:"), po0, delegateQueue) +} + +// Sets the session’s delegate object and the dispatch queue on which to call the delegate’s methods. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799164-setdelegate?language=objc +func (c_ ContentKeySession) SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) { + objc.Call[objc.Void](c_, objc.Sel("setDelegate:queue:"), objc.Ptr(delegateObject), delegateQueue) +} + +// Tells the delegate to remove the specified recipient. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799181-removecontentkeyrecipient?language=objc +func (c_ ContentKeySession) RemoveContentKeyRecipient(recipient PContentKeyRecipient) { + po0 := objc.WrapAsProtocol("AVContentKeyRecipient", recipient) + objc.Call[objc.Void](c_, objc.Sel("removeContentKeyRecipient:"), po0) +} + +// Tells the delegate to remove the specified recipient. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799181-removecontentkeyrecipient?language=objc +func (c_ ContentKeySession) RemoveContentKeyRecipientObject(recipientObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("removeContentKeyRecipient:"), objc.Ptr(recipientObject)) +} + +// Invalidates the persistable content key and creates a secure server playback context (SPC) to verify the outcome of an invalidation request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/3089138-invalidatepersistablecontentkey?language=objc +func (c_ ContentKeySession) InvalidatePersistableContentKeyOptionsCompletionHandler(persistableContentKeyData []byte, options map[ContentKeySessionServerPlaybackContextOption]objc.IObject, handler func(secureTokenData []byte, error foundation.Error)) { + objc.Call[objc.Void](c_, objc.Sel("invalidatePersistableContentKey:options:completionHandler:"), persistableContentKeyData, options, handler) +} + +// Returns the expired session reports for content key sessions created with the specified app identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799161-pendingexpiredsessionreportswith?language=objc +func (cc _ContentKeySessionClass) PendingExpiredSessionReportsWithAppIdentifierStorageDirectoryAtURL(appIdentifier []byte, storageURL foundation.IURL) [][]byte { + rv := objc.Call[[][]byte](cc, objc.Sel("pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:"), appIdentifier, objc.Ptr(storageURL)) + return rv +} + +// Returns the expired session reports for content key sessions created with the specified app identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799161-pendingexpiredsessionreportswith?language=objc +func ContentKeySession_PendingExpiredSessionReportsWithAppIdentifierStorageDirectoryAtURL(appIdentifier []byte, storageURL foundation.IURL) [][]byte { + return ContentKeySessionClass.PendingExpiredSessionReportsWithAppIdentifierStorageDirectoryAtURL(appIdentifier, storageURL) +} + +// Invalidates all of an app’s persistable content keys and creates a secure server playback context (SPC) to verify the outcome of an invalidation request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/3089137-invalidateallpersistablecontentk?language=objc +func (c_ ContentKeySession) InvalidateAllPersistableContentKeysForAppOptionsCompletionHandler(appIdentifier []byte, options map[ContentKeySessionServerPlaybackContextOption]objc.IObject, handler func(secureTokenData []byte, error foundation.Error)) { + objc.Call[objc.Void](c_, objc.Sel("invalidateAllPersistableContentKeysForApp:options:completionHandler:"), appIdentifier, options, handler) +} + +// Tells the delegate that the session expired as the result of normal, intentional processes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799171-expire?language=objc +func (c_ ContentKeySession) Expire() { + objc.Call[objc.Void](c_, objc.Sel("expire")) +} + +// Tells the delegate to start loading the content decryption key with the specified identifier and initialization data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799180-processcontentkeyrequestwithiden?language=objc +func (c_ ContentKeySession) ProcessContentKeyRequestWithIdentifierInitializationDataOptions(identifier objc.IObject, initializationData []byte, options map[string]objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("processContentKeyRequestWithIdentifier:initializationData:options:"), identifier, initializationData, options) +} + +// The type of key system used to retrieve keys. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799167-keysystem?language=objc +func (c_ ContentKeySession) KeySystem() ContentKeySystem { + rv := objc.Call[ContentKeySystem](c_, objc.Sel("keySystem")) + return rv +} + +// The identifier for the current content protection session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799189-contentprotectionsessionidentifi?language=objc +func (c_ ContentKeySession) ContentProtectionSessionIdentifier() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("contentProtectionSessionIdentifier")) + return rv +} + +// The content key session’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799191-delegate?language=objc +func (c_ ContentKeySession) Delegate() ContentKeySessionDelegateWrapper { + rv := objc.Call[ContentKeySessionDelegateWrapper](c_, objc.Sel("delegate")) + return rv +} + +// A URL that points to a writable storage directory. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799203-storageurl?language=objc +func (c_ ContentKeySession) StorageURL() foundation.URL { + rv := objc.Call[foundation.URL](c_, objc.Sel("storageURL")) + return rv +} + +// An array of content key recipients. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799192-contentkeyrecipients?language=objc +func (c_ ContentKeySession) ContentKeyRecipients() []ContentKeyRecipientWrapper { + rv := objc.Call[[]ContentKeyRecipientWrapper](c_, objc.Sel("contentKeyRecipients")) + return rv +} + +// The dispatch queue the session uses to invoke delegate callbacks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2799178-delegatequeue?language=objc +func (c_ ContentKeySession) DelegateQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](c_, objc.Sel("delegateQueue")) + return rv +} diff --git a/macos/avfoundation/content_key_session_delegate.gen.go b/macos/avfoundation/content_key_session_delegate.gen.go new file mode 100644 index 00000000..76c3a746 --- /dev/null +++ b/macos/avfoundation/content_key_session_delegate.gen.go @@ -0,0 +1,121 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that handles content key requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate?language=objc +type PContentKeySessionDelegate interface { + // optional + ContentKeySessionDidGenerateExpiredSessionReport(session ContentKeySession) + HasContentKeySessionDidGenerateExpiredSessionReport() bool + + // optional + ContentKeySessionContentProtectionSessionIdentifierDidChange(session ContentKeySession) + HasContentKeySessionContentProtectionSessionIdentifierDidChange() bool + + // optional + ContentKeySessionDidProvideContentKeyRequest(session ContentKeySession, keyRequest ContentKeyRequest) + HasContentKeySessionDidProvideContentKeyRequest() bool +} + +// A delegate implementation builder for the [PContentKeySessionDelegate] protocol. +type ContentKeySessionDelegate struct { + _ContentKeySessionDidGenerateExpiredSessionReport func(session ContentKeySession) + _ContentKeySessionContentProtectionSessionIdentifierDidChange func(session ContentKeySession) + _ContentKeySessionDidProvideContentKeyRequest func(session ContentKeySession, keyRequest ContentKeyRequest) +} + +func (di *ContentKeySessionDelegate) HasContentKeySessionDidGenerateExpiredSessionReport() bool { + return di._ContentKeySessionDidGenerateExpiredSessionReport != nil +} + +// Notifies the sender that an expired session report has been generated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2966513-contentkeysessiondidgenerateexpi?language=objc +func (di *ContentKeySessionDelegate) SetContentKeySessionDidGenerateExpiredSessionReport(f func(session ContentKeySession)) { + di._ContentKeySessionDidGenerateExpiredSessionReport = f +} + +// Notifies the sender that an expired session report has been generated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2966513-contentkeysessiondidgenerateexpi?language=objc +func (di *ContentKeySessionDelegate) ContentKeySessionDidGenerateExpiredSessionReport(session ContentKeySession) { + di._ContentKeySessionDidGenerateExpiredSessionReport(session) +} +func (di *ContentKeySessionDelegate) HasContentKeySessionContentProtectionSessionIdentifierDidChange() bool { + return di._ContentKeySessionContentProtectionSessionIdentifierDidChange != nil +} + +// Tells the receiver the content protection session identifier changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2799160-contentkeysessioncontentprotecti?language=objc +func (di *ContentKeySessionDelegate) SetContentKeySessionContentProtectionSessionIdentifierDidChange(f func(session ContentKeySession)) { + di._ContentKeySessionContentProtectionSessionIdentifierDidChange = f +} + +// Tells the receiver the content protection session identifier changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2799160-contentkeysessioncontentprotecti?language=objc +func (di *ContentKeySessionDelegate) ContentKeySessionContentProtectionSessionIdentifierDidChange(session ContentKeySession) { + di._ContentKeySessionContentProtectionSessionIdentifierDidChange(session) +} +func (di *ContentKeySessionDelegate) HasContentKeySessionDidProvideContentKeyRequest() bool { + return di._ContentKeySessionDidProvideContentKeyRequest != nil +} + +// Provides the receiver with a new content key request object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2799204-contentkeysession?language=objc +func (di *ContentKeySessionDelegate) SetContentKeySessionDidProvideContentKeyRequest(f func(session ContentKeySession, keyRequest ContentKeyRequest)) { + di._ContentKeySessionDidProvideContentKeyRequest = f +} + +// Provides the receiver with a new content key request object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2799204-contentkeysession?language=objc +func (di *ContentKeySessionDelegate) ContentKeySessionDidProvideContentKeyRequest(session ContentKeySession, keyRequest ContentKeyRequest) { + di._ContentKeySessionDidProvideContentKeyRequest(session, keyRequest) +} + +// A concrete type wrapper for the [PContentKeySessionDelegate] protocol. +type ContentKeySessionDelegateWrapper struct { + objc.Object +} + +func (c_ ContentKeySessionDelegateWrapper) HasContentKeySessionDidGenerateExpiredSessionReport() bool { + return c_.RespondsToSelector(objc.Sel("contentKeySessionDidGenerateExpiredSessionReport:")) +} + +// Notifies the sender that an expired session report has been generated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2966513-contentkeysessiondidgenerateexpi?language=objc +func (c_ ContentKeySessionDelegateWrapper) ContentKeySessionDidGenerateExpiredSessionReport(session IContentKeySession) { + objc.Call[objc.Void](c_, objc.Sel("contentKeySessionDidGenerateExpiredSessionReport:"), objc.Ptr(session)) +} + +func (c_ ContentKeySessionDelegateWrapper) HasContentKeySessionContentProtectionSessionIdentifierDidChange() bool { + return c_.RespondsToSelector(objc.Sel("contentKeySessionContentProtectionSessionIdentifierDidChange:")) +} + +// Tells the receiver the content protection session identifier changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2799160-contentkeysessioncontentprotecti?language=objc +func (c_ ContentKeySessionDelegateWrapper) ContentKeySessionContentProtectionSessionIdentifierDidChange(session IContentKeySession) { + objc.Call[objc.Void](c_, objc.Sel("contentKeySessionContentProtectionSessionIdentifierDidChange:"), objc.Ptr(session)) +} + +func (c_ ContentKeySessionDelegateWrapper) HasContentKeySessionDidProvideContentKeyRequest() bool { + return c_.RespondsToSelector(objc.Sel("contentKeySession:didProvideContentKeyRequest:")) +} + +// Provides the receiver with a new content key request object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessiondelegate/2799204-contentkeysession?language=objc +func (c_ ContentKeySessionDelegateWrapper) ContentKeySessionDidProvideContentKeyRequest(session IContentKeySession, keyRequest IContentKeyRequest) { + objc.Call[objc.Void](c_, objc.Sel("contentKeySession:didProvideContentKeyRequest:"), objc.Ptr(session), objc.Ptr(keyRequest)) +} diff --git a/macos/avfoundation/content_key_specifier.gen.go b/macos/avfoundation/content_key_specifier.gen.go new file mode 100644 index 00000000..68ab97f7 --- /dev/null +++ b/macos/avfoundation/content_key_specifier.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContentKeySpecifier] class. +var ContentKeySpecifierClass = _ContentKeySpecifierClass{objc.GetClass("AVContentKeySpecifier")} + +type _ContentKeySpecifierClass struct { + objc.Class +} + +// An interface definition for the [ContentKeySpecifier] class. +type IContentKeySpecifier interface { + objc.IObject + KeySystem() ContentKeySystem + Options() map[string]objc.Object + Identifier() objc.Object +} + +// An object that uniquely identifies a content key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyspecifier?language=objc +type ContentKeySpecifier struct { + objc.Object +} + +func ContentKeySpecifierFrom(ptr unsafe.Pointer) ContentKeySpecifier { + return ContentKeySpecifier{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ ContentKeySpecifier) InitForKeySystemIdentifierOptions(keySystem ContentKeySystem, contentKeyIdentifier objc.IObject, options map[string]objc.IObject) ContentKeySpecifier { + rv := objc.Call[ContentKeySpecifier](c_, objc.Sel("initForKeySystem:identifier:options:"), keySystem, contentKeyIdentifier, options) + return rv +} + +// Creates a content key specifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyspecifier/3726107-initforkeysystem?language=objc +func NewContentKeySpecifierForKeySystemIdentifierOptions(keySystem ContentKeySystem, contentKeyIdentifier objc.IObject, options map[string]objc.IObject) ContentKeySpecifier { + instance := ContentKeySpecifierClass.Alloc().InitForKeySystemIdentifierOptions(keySystem, contentKeyIdentifier, options) + instance.Autorelease() + return instance +} + +func (cc _ContentKeySpecifierClass) ContentKeySpecifierForKeySystemIdentifierOptions(keySystem ContentKeySystem, contentKeyIdentifier objc.IObject, options map[string]objc.IObject) ContentKeySpecifier { + rv := objc.Call[ContentKeySpecifier](cc, objc.Sel("contentKeySpecifierForKeySystem:identifier:options:"), keySystem, contentKeyIdentifier, options) + return rv +} + +// A convenience initializer to create a content key specifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyspecifier/3726105-contentkeyspecifierforkeysystem?language=objc +func ContentKeySpecifier_ContentKeySpecifierForKeySystemIdentifierOptions(keySystem ContentKeySystem, contentKeyIdentifier objc.IObject, options map[string]objc.IObject) ContentKeySpecifier { + return ContentKeySpecifierClass.ContentKeySpecifierForKeySystemIdentifierOptions(keySystem, contentKeyIdentifier, options) +} + +func (cc _ContentKeySpecifierClass) Alloc() ContentKeySpecifier { + rv := objc.Call[ContentKeySpecifier](cc, objc.Sel("alloc")) + return rv +} + +func ContentKeySpecifier_Alloc() ContentKeySpecifier { + return ContentKeySpecifierClass.Alloc() +} + +func (cc _ContentKeySpecifierClass) New() ContentKeySpecifier { + rv := objc.Call[ContentKeySpecifier](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContentKeySpecifier() ContentKeySpecifier { + return ContentKeySpecifierClass.New() +} + +func (c_ ContentKeySpecifier) Init() ContentKeySpecifier { + rv := objc.Call[ContentKeySpecifier](c_, objc.Sel("init")) + return rv +} + +// The key system that generates content keys. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyspecifier/3726108-keysystem?language=objc +func (c_ ContentKeySpecifier) KeySystem() ContentKeySystem { + rv := objc.Call[ContentKeySystem](c_, objc.Sel("keySystem")) + return rv +} + +// A dictionary of options with which you initialized the specifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyspecifier/3726109-options?language=objc +func (c_ ContentKeySpecifier) Options() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](c_, objc.Sel("options")) + return rv +} + +// The container and protocol-specific key identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyspecifier/3726106-identifier?language=objc +func (c_ ContentKeySpecifier) Identifier() objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("identifier")) + return rv +} diff --git a/macos/avfoundation/coordinated_playback_participant.gen.go b/macos/avfoundation/coordinated_playback_participant.gen.go new file mode 100644 index 00000000..7eea4ef4 --- /dev/null +++ b/macos/avfoundation/coordinated_playback_participant.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CoordinatedPlaybackParticipant] class. +var CoordinatedPlaybackParticipantClass = _CoordinatedPlaybackParticipantClass{objc.GetClass("AVCoordinatedPlaybackParticipant")} + +type _CoordinatedPlaybackParticipantClass struct { + objc.Class +} + +// An interface definition for the [CoordinatedPlaybackParticipant] class. +type ICoordinatedPlaybackParticipant interface { + objc.IObject + IsReadyToPlay() bool + SuspensionReasons() []CoordinatedPlaybackSuspensionReason + Identifier() foundation.UUID +} + +// An object that represents a participant in a coordinated playback session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybackparticipant?language=objc +type CoordinatedPlaybackParticipant struct { + objc.Object +} + +func CoordinatedPlaybackParticipantFrom(ptr unsafe.Pointer) CoordinatedPlaybackParticipant { + return CoordinatedPlaybackParticipant{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CoordinatedPlaybackParticipantClass) Alloc() CoordinatedPlaybackParticipant { + rv := objc.Call[CoordinatedPlaybackParticipant](cc, objc.Sel("alloc")) + return rv +} + +func CoordinatedPlaybackParticipant_Alloc() CoordinatedPlaybackParticipant { + return CoordinatedPlaybackParticipantClass.Alloc() +} + +func (cc _CoordinatedPlaybackParticipantClass) New() CoordinatedPlaybackParticipant { + rv := objc.Call[CoordinatedPlaybackParticipant](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCoordinatedPlaybackParticipant() CoordinatedPlaybackParticipant { + return CoordinatedPlaybackParticipantClass.New() +} + +func (c_ CoordinatedPlaybackParticipant) Init() CoordinatedPlaybackParticipant { + rv := objc.Call[CoordinatedPlaybackParticipant](c_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the participant is ready to start coordinated playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybackparticipant/3750236-readytoplay?language=objc +func (c_ CoordinatedPlaybackParticipant) IsReadyToPlay() bool { + rv := objc.Call[bool](c_, objc.Sel("isReadyToPlay")) + return rv +} + +// The reasons a participant isn’t currently participating in coordinated playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybackparticipant/3750237-suspensionreasons?language=objc +func (c_ CoordinatedPlaybackParticipant) SuspensionReasons() []CoordinatedPlaybackSuspensionReason { + rv := objc.Call[[]CoordinatedPlaybackSuspensionReason](c_, objc.Sel("suspensionReasons")) + return rv +} + +// A unique identifier for the participant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybackparticipant/3750235-identifier?language=objc +func (c_ CoordinatedPlaybackParticipant) Identifier() foundation.UUID { + rv := objc.Call[foundation.UUID](c_, objc.Sel("identifier")) + return rv +} diff --git a/macos/avfoundation/coordinated_playback_suspension.gen.go b/macos/avfoundation/coordinated_playback_suspension.gen.go new file mode 100644 index 00000000..72234078 --- /dev/null +++ b/macos/avfoundation/coordinated_playback_suspension.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CoordinatedPlaybackSuspension] class. +var CoordinatedPlaybackSuspensionClass = _CoordinatedPlaybackSuspensionClass{objc.GetClass("AVCoordinatedPlaybackSuspension")} + +type _CoordinatedPlaybackSuspensionClass struct { + objc.Class +} + +// An interface definition for the [CoordinatedPlaybackSuspension] class. +type ICoordinatedPlaybackSuspension interface { + objc.IObject + End() + EndProposingNewTime(time coremedia.Time) + BeginDate() foundation.Date + Reason() CoordinatedPlaybackSuspensionReason +} + +// An object that represents a temporary suspension of coordinated playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspension?language=objc +type CoordinatedPlaybackSuspension struct { + objc.Object +} + +func CoordinatedPlaybackSuspensionFrom(ptr unsafe.Pointer) CoordinatedPlaybackSuspension { + return CoordinatedPlaybackSuspension{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CoordinatedPlaybackSuspensionClass) Alloc() CoordinatedPlaybackSuspension { + rv := objc.Call[CoordinatedPlaybackSuspension](cc, objc.Sel("alloc")) + return rv +} + +func CoordinatedPlaybackSuspension_Alloc() CoordinatedPlaybackSuspension { + return CoordinatedPlaybackSuspensionClass.Alloc() +} + +func (cc _CoordinatedPlaybackSuspensionClass) New() CoordinatedPlaybackSuspension { + rv := objc.Call[CoordinatedPlaybackSuspension](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCoordinatedPlaybackSuspension() CoordinatedPlaybackSuspension { + return CoordinatedPlaybackSuspensionClass.New() +} + +func (c_ CoordinatedPlaybackSuspension) Init() CoordinatedPlaybackSuspension { + rv := objc.Call[CoordinatedPlaybackSuspension](c_, objc.Sel("init")) + return rv +} + +// Ends a suspension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspension/3750240-end?language=objc +func (c_ CoordinatedPlaybackSuspension) End() { + objc.Call[objc.Void](c_, objc.Sel("end")) +} + +// Ends a suspension and proposes a new playback time to the group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspension/3750241-endproposingnewtime?language=objc +func (c_ CoordinatedPlaybackSuspension) EndProposingNewTime(time coremedia.Time) { + objc.Call[objc.Void](c_, objc.Sel("endProposingNewTime:"), time) +} + +// The time the suspension begins. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspension/3750239-begindate?language=objc +func (c_ CoordinatedPlaybackSuspension) BeginDate() foundation.Date { + rv := objc.Call[foundation.Date](c_, objc.Sel("beginDate")) + return rv +} + +// The reason for the suspension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspension/3750242-reason?language=objc +func (c_ CoordinatedPlaybackSuspension) Reason() CoordinatedPlaybackSuspensionReason { + rv := objc.Call[CoordinatedPlaybackSuspensionReason](c_, objc.Sel("reason")) + return rv +} diff --git a/macos/avfoundation/date_range_metadata_group.gen.go b/macos/avfoundation/date_range_metadata_group.gen.go new file mode 100644 index 00000000..3dbda984 --- /dev/null +++ b/macos/avfoundation/date_range_metadata_group.gen.go @@ -0,0 +1,91 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DateRangeMetadataGroup] class. +var DateRangeMetadataGroupClass = _DateRangeMetadataGroupClass{objc.GetClass("AVDateRangeMetadataGroup")} + +type _DateRangeMetadataGroupClass struct { + objc.Class +} + +// An interface definition for the [DateRangeMetadataGroup] class. +type IDateRangeMetadataGroup interface { + IMetadataGroup + StartDate() foundation.Date + EndDate() foundation.Date +} + +// A collection of metadata items that are valid for use within a specific date range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdaterangemetadatagroup?language=objc +type DateRangeMetadataGroup struct { + MetadataGroup +} + +func DateRangeMetadataGroupFrom(ptr unsafe.Pointer) DateRangeMetadataGroup { + return DateRangeMetadataGroup{ + MetadataGroup: MetadataGroupFrom(ptr), + } +} + +func (d_ DateRangeMetadataGroup) InitWithItemsStartDateEndDate(items []IMetadataItem, startDate foundation.IDate, endDate foundation.IDate) DateRangeMetadataGroup { + rv := objc.Call[DateRangeMetadataGroup](d_, objc.Sel("initWithItems:startDate:endDate:"), items, objc.Ptr(startDate), objc.Ptr(endDate)) + return rv +} + +// Initializes an instance of AVDateRangeMetadataGroup with a collection of metadata items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdaterangemetadatagroup/1389614-initwithitems?language=objc +func NewDateRangeMetadataGroupWithItemsStartDateEndDate(items []IMetadataItem, startDate foundation.IDate, endDate foundation.IDate) DateRangeMetadataGroup { + instance := DateRangeMetadataGroupClass.Alloc().InitWithItemsStartDateEndDate(items, startDate, endDate) + instance.Autorelease() + return instance +} + +func (dc _DateRangeMetadataGroupClass) Alloc() DateRangeMetadataGroup { + rv := objc.Call[DateRangeMetadataGroup](dc, objc.Sel("alloc")) + return rv +} + +func DateRangeMetadataGroup_Alloc() DateRangeMetadataGroup { + return DateRangeMetadataGroupClass.Alloc() +} + +func (dc _DateRangeMetadataGroupClass) New() DateRangeMetadataGroup { + rv := objc.Call[DateRangeMetadataGroup](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDateRangeMetadataGroup() DateRangeMetadataGroup { + return DateRangeMetadataGroupClass.New() +} + +func (d_ DateRangeMetadataGroup) Init() DateRangeMetadataGroup { + rv := objc.Call[DateRangeMetadataGroup](d_, objc.Sel("init")) + return rv +} + +// The start date for the metadata date range group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdaterangemetadatagroup/1386420-startdate?language=objc +func (d_ DateRangeMetadataGroup) StartDate() foundation.Date { + rv := objc.Call[foundation.Date](d_, objc.Sel("startDate")) + return rv +} + +// The end date for the metadata date range group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdaterangemetadatagroup/1386255-enddate?language=objc +func (d_ DateRangeMetadataGroup) EndDate() foundation.Date { + rv := objc.Call[foundation.Date](d_, objc.Sel("endDate")) + return rv +} diff --git a/macos/avfoundation/delegating_playback_coordinator.gen.go b/macos/avfoundation/delegating_playback_coordinator.gen.go new file mode 100644 index 00000000..5b3d3a03 --- /dev/null +++ b/macos/avfoundation/delegating_playback_coordinator.gen.go @@ -0,0 +1,124 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DelegatingPlaybackCoordinator] class. +var DelegatingPlaybackCoordinatorClass = _DelegatingPlaybackCoordinatorClass{objc.GetClass("AVDelegatingPlaybackCoordinator")} + +type _DelegatingPlaybackCoordinatorClass struct { + objc.Class +} + +// An interface definition for the [DelegatingPlaybackCoordinator] class. +type IDelegatingPlaybackCoordinator interface { + IPlaybackCoordinator + CoordinateRateChangeToRateOptions(rate float64, options DelegatingPlaybackCoordinatorRateChangeOptions) + TransitionToItemWithIdentifierProposingInitialTimingBasedOnTimebase(itemIdentifier string, snapshotTimebase coremedia.TimebaseRef) + ReapplyCurrentItemStateToPlaybackControlDelegate() + CoordinateSeekToTimeOptions(time coremedia.Time, options DelegatingPlaybackCoordinatorSeekOptions) + PlaybackControlDelegate() PlaybackCoordinatorPlaybackControlDelegateWrapper + CurrentItemIdentifier() string +} + +// A playback coordinator subclass that coordinates the playback of custom player objects in a connected group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator?language=objc +type DelegatingPlaybackCoordinator struct { + PlaybackCoordinator +} + +func DelegatingPlaybackCoordinatorFrom(ptr unsafe.Pointer) DelegatingPlaybackCoordinator { + return DelegatingPlaybackCoordinator{ + PlaybackCoordinator: PlaybackCoordinatorFrom(ptr), + } +} + +func (d_ DelegatingPlaybackCoordinator) InitWithPlaybackControlDelegate(playbackControlDelegate PPlaybackCoordinatorPlaybackControlDelegate) DelegatingPlaybackCoordinator { + po0 := objc.WrapAsProtocol("AVPlaybackCoordinatorPlaybackControlDelegate", playbackControlDelegate) + rv := objc.Call[DelegatingPlaybackCoordinator](d_, objc.Sel("initWithPlaybackControlDelegate:"), po0) + return rv +} + +// Creates a playback coordinator for a custom playback object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator/3750256-initwithplaybackcontroldelegate?language=objc +func NewDelegatingPlaybackCoordinatorWithPlaybackControlDelegate(playbackControlDelegate PPlaybackCoordinatorPlaybackControlDelegate) DelegatingPlaybackCoordinator { + instance := DelegatingPlaybackCoordinatorClass.Alloc().InitWithPlaybackControlDelegate(playbackControlDelegate) + instance.Autorelease() + return instance +} + +func (dc _DelegatingPlaybackCoordinatorClass) Alloc() DelegatingPlaybackCoordinator { + rv := objc.Call[DelegatingPlaybackCoordinator](dc, objc.Sel("alloc")) + return rv +} + +func DelegatingPlaybackCoordinator_Alloc() DelegatingPlaybackCoordinator { + return DelegatingPlaybackCoordinatorClass.Alloc() +} + +func (dc _DelegatingPlaybackCoordinatorClass) New() DelegatingPlaybackCoordinator { + rv := objc.Call[DelegatingPlaybackCoordinator](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDelegatingPlaybackCoordinator() DelegatingPlaybackCoordinator { + return DelegatingPlaybackCoordinatorClass.New() +} + +func (d_ DelegatingPlaybackCoordinator) Init() DelegatingPlaybackCoordinator { + rv := objc.Call[DelegatingPlaybackCoordinator](d_, objc.Sel("init")) + return rv +} + +// Coordinates a rate change across all participants, waiting for others to become ready, if necessary. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator/3750250-coordinateratechangetorate?language=objc +func (d_ DelegatingPlaybackCoordinator) CoordinateRateChangeToRateOptions(rate float64, options DelegatingPlaybackCoordinatorRateChangeOptions) { + objc.Call[objc.Void](d_, objc.Sel("coordinateRateChangeToRate:options:"), rate, options) +} + +// Tells the coordinator to transition to a new item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator/3750259-transitiontoitemwithidentifier?language=objc +func (d_ DelegatingPlaybackCoordinator) TransitionToItemWithIdentifierProposingInitialTimingBasedOnTimebase(itemIdentifier string, snapshotTimebase coremedia.TimebaseRef) { + objc.Call[objc.Void](d_, objc.Sel("transitionToItemWithIdentifier:proposingInitialTimingBasedOnTimebase:"), itemIdentifier, snapshotTimebase) +} + +// Tells the coordinator to reissue current play state commands to synchronize the current item to the state of other participants. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator/3750258-reapplycurrentitemstatetoplaybac?language=objc +func (d_ DelegatingPlaybackCoordinator) ReapplyCurrentItemStateToPlaybackControlDelegate() { + objc.Call[objc.Void](d_, objc.Sel("reapplyCurrentItemStateToPlaybackControlDelegate")) +} + +// Coordinates a seek to the specified time for all connected participants. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator/3750251-coordinateseektotime?language=objc +func (d_ DelegatingPlaybackCoordinator) CoordinateSeekToTimeOptions(time coremedia.Time, options DelegatingPlaybackCoordinatorSeekOptions) { + objc.Call[objc.Void](d_, objc.Sel("coordinateSeekToTime:options:"), time, options) +} + +// The delegate object for the playback coordinator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator/3750257-playbackcontroldelegate?language=objc +func (d_ DelegatingPlaybackCoordinator) PlaybackControlDelegate() PlaybackCoordinatorPlaybackControlDelegateWrapper { + rv := objc.Call[PlaybackCoordinatorPlaybackControlDelegateWrapper](d_, objc.Sel("playbackControlDelegate")) + return rv +} + +// An identifier of the current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinator/3750252-currentitemidentifier?language=objc +func (d_ DelegatingPlaybackCoordinator) CurrentItemIdentifier() string { + rv := objc.Call[string](d_, objc.Sel("currentItemIdentifier")) + return rv +} diff --git a/macos/avfoundation/delegating_playback_coordinator_buffering_command.gen.go b/macos/avfoundation/delegating_playback_coordinator_buffering_command.gen.go new file mode 100644 index 00000000..7363600f --- /dev/null +++ b/macos/avfoundation/delegating_playback_coordinator_buffering_command.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DelegatingPlaybackCoordinatorBufferingCommand] class. +var DelegatingPlaybackCoordinatorBufferingCommandClass = _DelegatingPlaybackCoordinatorBufferingCommandClass{objc.GetClass("AVDelegatingPlaybackCoordinatorBufferingCommand")} + +type _DelegatingPlaybackCoordinatorBufferingCommandClass struct { + objc.Class +} + +// An interface definition for the [DelegatingPlaybackCoordinatorBufferingCommand] class. +type IDelegatingPlaybackCoordinatorBufferingCommand interface { + IDelegatingPlaybackCoordinatorPlaybackControlCommand + AnticipatedPlaybackRate() float64 + CompletionDueDate() foundation.Date +} + +// A command that indicates to start buffering data in preparation for playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorbufferingcommand?language=objc +type DelegatingPlaybackCoordinatorBufferingCommand struct { + DelegatingPlaybackCoordinatorPlaybackControlCommand +} + +func DelegatingPlaybackCoordinatorBufferingCommandFrom(ptr unsafe.Pointer) DelegatingPlaybackCoordinatorBufferingCommand { + return DelegatingPlaybackCoordinatorBufferingCommand{ + DelegatingPlaybackCoordinatorPlaybackControlCommand: DelegatingPlaybackCoordinatorPlaybackControlCommandFrom(ptr), + } +} + +func (dc _DelegatingPlaybackCoordinatorBufferingCommandClass) Alloc() DelegatingPlaybackCoordinatorBufferingCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorBufferingCommand](dc, objc.Sel("alloc")) + return rv +} + +func DelegatingPlaybackCoordinatorBufferingCommand_Alloc() DelegatingPlaybackCoordinatorBufferingCommand { + return DelegatingPlaybackCoordinatorBufferingCommandClass.Alloc() +} + +func (dc _DelegatingPlaybackCoordinatorBufferingCommandClass) New() DelegatingPlaybackCoordinatorBufferingCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorBufferingCommand](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDelegatingPlaybackCoordinatorBufferingCommand() DelegatingPlaybackCoordinatorBufferingCommand { + return DelegatingPlaybackCoordinatorBufferingCommandClass.New() +} + +func (d_ DelegatingPlaybackCoordinatorBufferingCommand) Init() DelegatingPlaybackCoordinatorBufferingCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorBufferingCommand](d_, objc.Sel("init")) + return rv +} + +// The rate at which the coordinator expects the current item to play. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorbufferingcommand/3750261-anticipatedplaybackrate?language=objc +func (d_ DelegatingPlaybackCoordinatorBufferingCommand) AnticipatedPlaybackRate() float64 { + rv := objc.Call[float64](d_, objc.Sel("anticipatedPlaybackRate")) + return rv +} + +// The deadline by which the coordinator expects the delegate to complete execution of a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorbufferingcommand/3778530-completionduedate?language=objc +func (d_ DelegatingPlaybackCoordinatorBufferingCommand) CompletionDueDate() foundation.Date { + rv := objc.Call[foundation.Date](d_, objc.Sel("completionDueDate")) + return rv +} diff --git a/macos/avfoundation/delegating_playback_coordinator_pause_command.gen.go b/macos/avfoundation/delegating_playback_coordinator_pause_command.gen.go new file mode 100644 index 00000000..ba19e26c --- /dev/null +++ b/macos/avfoundation/delegating_playback_coordinator_pause_command.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DelegatingPlaybackCoordinatorPauseCommand] class. +var DelegatingPlaybackCoordinatorPauseCommandClass = _DelegatingPlaybackCoordinatorPauseCommandClass{objc.GetClass("AVDelegatingPlaybackCoordinatorPauseCommand")} + +type _DelegatingPlaybackCoordinatorPauseCommandClass struct { + objc.Class +} + +// An interface definition for the [DelegatingPlaybackCoordinatorPauseCommand] class. +type IDelegatingPlaybackCoordinatorPauseCommand interface { + IDelegatingPlaybackCoordinatorPlaybackControlCommand + ShouldBufferInAnticipationOfPlayback() bool + AnticipatedPlaybackRate() float64 +} + +// A command that indicates to pause playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorpausecommand?language=objc +type DelegatingPlaybackCoordinatorPauseCommand struct { + DelegatingPlaybackCoordinatorPlaybackControlCommand +} + +func DelegatingPlaybackCoordinatorPauseCommandFrom(ptr unsafe.Pointer) DelegatingPlaybackCoordinatorPauseCommand { + return DelegatingPlaybackCoordinatorPauseCommand{ + DelegatingPlaybackCoordinatorPlaybackControlCommand: DelegatingPlaybackCoordinatorPlaybackControlCommandFrom(ptr), + } +} + +func (dc _DelegatingPlaybackCoordinatorPauseCommandClass) Alloc() DelegatingPlaybackCoordinatorPauseCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPauseCommand](dc, objc.Sel("alloc")) + return rv +} + +func DelegatingPlaybackCoordinatorPauseCommand_Alloc() DelegatingPlaybackCoordinatorPauseCommand { + return DelegatingPlaybackCoordinatorPauseCommandClass.Alloc() +} + +func (dc _DelegatingPlaybackCoordinatorPauseCommandClass) New() DelegatingPlaybackCoordinatorPauseCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPauseCommand](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDelegatingPlaybackCoordinatorPauseCommand() DelegatingPlaybackCoordinatorPauseCommand { + return DelegatingPlaybackCoordinatorPauseCommandClass.New() +} + +func (d_ DelegatingPlaybackCoordinatorPauseCommand) Init() DelegatingPlaybackCoordinatorPauseCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPauseCommand](d_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the player starts buffering in preparation for a request to begin playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorpausecommand/3750264-shouldbufferinanticipationofplay?language=objc +func (d_ DelegatingPlaybackCoordinatorPauseCommand) ShouldBufferInAnticipationOfPlayback() bool { + rv := objc.Call[bool](d_, objc.Sel("shouldBufferInAnticipationOfPlayback")) + return rv +} + +// The rate at which the coordinator expects the current item to play. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorpausecommand/3750263-anticipatedplaybackrate?language=objc +func (d_ DelegatingPlaybackCoordinatorPauseCommand) AnticipatedPlaybackRate() float64 { + rv := objc.Call[float64](d_, objc.Sel("anticipatedPlaybackRate")) + return rv +} diff --git a/macos/avfoundation/delegating_playback_coordinator_play_command.gen.go b/macos/avfoundation/delegating_playback_coordinator_play_command.gen.go new file mode 100644 index 00000000..c42174c2 --- /dev/null +++ b/macos/avfoundation/delegating_playback_coordinator_play_command.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DelegatingPlaybackCoordinatorPlayCommand] class. +var DelegatingPlaybackCoordinatorPlayCommandClass = _DelegatingPlaybackCoordinatorPlayCommandClass{objc.GetClass("AVDelegatingPlaybackCoordinatorPlayCommand")} + +type _DelegatingPlaybackCoordinatorPlayCommandClass struct { + objc.Class +} + +// An interface definition for the [DelegatingPlaybackCoordinatorPlayCommand] class. +type IDelegatingPlaybackCoordinatorPlayCommand interface { + IDelegatingPlaybackCoordinatorPlaybackControlCommand + Rate() float64 + ItemTime() coremedia.Time + HostClockTime() coremedia.Time +} + +// A command that indicates to play at a specific rate and time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaycommand?language=objc +type DelegatingPlaybackCoordinatorPlayCommand struct { + DelegatingPlaybackCoordinatorPlaybackControlCommand +} + +func DelegatingPlaybackCoordinatorPlayCommandFrom(ptr unsafe.Pointer) DelegatingPlaybackCoordinatorPlayCommand { + return DelegatingPlaybackCoordinatorPlayCommand{ + DelegatingPlaybackCoordinatorPlaybackControlCommand: DelegatingPlaybackCoordinatorPlaybackControlCommandFrom(ptr), + } +} + +func (dc _DelegatingPlaybackCoordinatorPlayCommandClass) Alloc() DelegatingPlaybackCoordinatorPlayCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPlayCommand](dc, objc.Sel("alloc")) + return rv +} + +func DelegatingPlaybackCoordinatorPlayCommand_Alloc() DelegatingPlaybackCoordinatorPlayCommand { + return DelegatingPlaybackCoordinatorPlayCommandClass.Alloc() +} + +func (dc _DelegatingPlaybackCoordinatorPlayCommandClass) New() DelegatingPlaybackCoordinatorPlayCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPlayCommand](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDelegatingPlaybackCoordinatorPlayCommand() DelegatingPlaybackCoordinatorPlayCommand { + return DelegatingPlaybackCoordinatorPlayCommandClass.New() +} + +func (d_ DelegatingPlaybackCoordinatorPlayCommand) Init() DelegatingPlaybackCoordinatorPlayCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPlayCommand](d_, objc.Sel("init")) + return rv +} + +// A rate to use when starting playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaycommand/3750268-rate?language=objc +func (d_ DelegatingPlaybackCoordinatorPlayCommand) Rate() float64 { + rv := objc.Call[float64](d_, objc.Sel("rate")) + return rv +} + +// A time in the item timeline to use to begin playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaycommand/3750267-itemtime?language=objc +func (d_ DelegatingPlaybackCoordinatorPlayCommand) ItemTime() coremedia.Time { + rv := objc.Call[coremedia.Time](d_, objc.Sel("itemTime")) + return rv +} + +// A host clock time to use to begin playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaycommand/3750266-hostclocktime?language=objc +func (d_ DelegatingPlaybackCoordinatorPlayCommand) HostClockTime() coremedia.Time { + rv := objc.Call[coremedia.Time](d_, objc.Sel("hostClockTime")) + return rv +} diff --git a/macos/avfoundation/delegating_playback_coordinator_playback_control_command.gen.go b/macos/avfoundation/delegating_playback_coordinator_playback_control_command.gen.go new file mode 100644 index 00000000..84f5037d --- /dev/null +++ b/macos/avfoundation/delegating_playback_coordinator_playback_control_command.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DelegatingPlaybackCoordinatorPlaybackControlCommand] class. +var DelegatingPlaybackCoordinatorPlaybackControlCommandClass = _DelegatingPlaybackCoordinatorPlaybackControlCommandClass{objc.GetClass("AVDelegatingPlaybackCoordinatorPlaybackControlCommand")} + +type _DelegatingPlaybackCoordinatorPlaybackControlCommandClass struct { + objc.Class +} + +// An interface definition for the [DelegatingPlaybackCoordinatorPlaybackControlCommand] class. +type IDelegatingPlaybackCoordinatorPlaybackControlCommand interface { + objc.IObject + Originator() CoordinatedPlaybackParticipant + ExpectedCurrentItemIdentifier() string +} + +// An abstract superclass for playback commands. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaybackcontrolcommand?language=objc +type DelegatingPlaybackCoordinatorPlaybackControlCommand struct { + objc.Object +} + +func DelegatingPlaybackCoordinatorPlaybackControlCommandFrom(ptr unsafe.Pointer) DelegatingPlaybackCoordinatorPlaybackControlCommand { + return DelegatingPlaybackCoordinatorPlaybackControlCommand{ + Object: objc.ObjectFrom(ptr), + } +} + +func (dc _DelegatingPlaybackCoordinatorPlaybackControlCommandClass) Alloc() DelegatingPlaybackCoordinatorPlaybackControlCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPlaybackControlCommand](dc, objc.Sel("alloc")) + return rv +} + +func DelegatingPlaybackCoordinatorPlaybackControlCommand_Alloc() DelegatingPlaybackCoordinatorPlaybackControlCommand { + return DelegatingPlaybackCoordinatorPlaybackControlCommandClass.Alloc() +} + +func (dc _DelegatingPlaybackCoordinatorPlaybackControlCommandClass) New() DelegatingPlaybackCoordinatorPlaybackControlCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPlaybackControlCommand](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDelegatingPlaybackCoordinatorPlaybackControlCommand() DelegatingPlaybackCoordinatorPlaybackControlCommand { + return DelegatingPlaybackCoordinatorPlaybackControlCommandClass.New() +} + +func (d_ DelegatingPlaybackCoordinatorPlaybackControlCommand) Init() DelegatingPlaybackCoordinatorPlaybackControlCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorPlaybackControlCommand](d_, objc.Sel("init")) + return rv +} + +// The participant that causes the coordinator to issue the command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaybackcontrolcommand/3750271-originator?language=objc +func (d_ DelegatingPlaybackCoordinatorPlaybackControlCommand) Originator() CoordinatedPlaybackParticipant { + rv := objc.Call[CoordinatedPlaybackParticipant](d_, objc.Sel("originator")) + return rv +} + +// An item identifier the coordinator issues the command for. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorplaybackcontrolcommand/3750270-expectedcurrentitemidentifier?language=objc +func (d_ DelegatingPlaybackCoordinatorPlaybackControlCommand) ExpectedCurrentItemIdentifier() string { + rv := objc.Call[string](d_, objc.Sel("expectedCurrentItemIdentifier")) + return rv +} diff --git a/macos/avfoundation/delegating_playback_coordinator_seek_command.gen.go b/macos/avfoundation/delegating_playback_coordinator_seek_command.gen.go new file mode 100644 index 00000000..e4b768d0 --- /dev/null +++ b/macos/avfoundation/delegating_playback_coordinator_seek_command.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DelegatingPlaybackCoordinatorSeekCommand] class. +var DelegatingPlaybackCoordinatorSeekCommandClass = _DelegatingPlaybackCoordinatorSeekCommandClass{objc.GetClass("AVDelegatingPlaybackCoordinatorSeekCommand")} + +type _DelegatingPlaybackCoordinatorSeekCommandClass struct { + objc.Class +} + +// An interface definition for the [DelegatingPlaybackCoordinatorSeekCommand] class. +type IDelegatingPlaybackCoordinatorSeekCommand interface { + IDelegatingPlaybackCoordinatorPlaybackControlCommand + ShouldBufferInAnticipationOfPlayback() bool + ItemTime() coremedia.Time + AnticipatedPlaybackRate() float64 + CompletionDueDate() foundation.Date +} + +// A command that indicates to seek to a new time in the item timeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekcommand?language=objc +type DelegatingPlaybackCoordinatorSeekCommand struct { + DelegatingPlaybackCoordinatorPlaybackControlCommand +} + +func DelegatingPlaybackCoordinatorSeekCommandFrom(ptr unsafe.Pointer) DelegatingPlaybackCoordinatorSeekCommand { + return DelegatingPlaybackCoordinatorSeekCommand{ + DelegatingPlaybackCoordinatorPlaybackControlCommand: DelegatingPlaybackCoordinatorPlaybackControlCommandFrom(ptr), + } +} + +func (dc _DelegatingPlaybackCoordinatorSeekCommandClass) Alloc() DelegatingPlaybackCoordinatorSeekCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorSeekCommand](dc, objc.Sel("alloc")) + return rv +} + +func DelegatingPlaybackCoordinatorSeekCommand_Alloc() DelegatingPlaybackCoordinatorSeekCommand { + return DelegatingPlaybackCoordinatorSeekCommandClass.Alloc() +} + +func (dc _DelegatingPlaybackCoordinatorSeekCommandClass) New() DelegatingPlaybackCoordinatorSeekCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorSeekCommand](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDelegatingPlaybackCoordinatorSeekCommand() DelegatingPlaybackCoordinatorSeekCommand { + return DelegatingPlaybackCoordinatorSeekCommandClass.New() +} + +func (d_ DelegatingPlaybackCoordinatorSeekCommand) Init() DelegatingPlaybackCoordinatorSeekCommand { + rv := objc.Call[DelegatingPlaybackCoordinatorSeekCommand](d_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the player starts buffering in anticipation of a request to begin playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekcommand/3750281-shouldbufferinanticipationofplay?language=objc +func (d_ DelegatingPlaybackCoordinatorSeekCommand) ShouldBufferInAnticipationOfPlayback() bool { + rv := objc.Call[bool](d_, objc.Sel("shouldBufferInAnticipationOfPlayback")) + return rv +} + +// The time to seek to in the item timeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekcommand/3750280-itemtime?language=objc +func (d_ DelegatingPlaybackCoordinatorSeekCommand) ItemTime() coremedia.Time { + rv := objc.Call[coremedia.Time](d_, objc.Sel("itemTime")) + return rv +} + +// The rate at which the coordinator expects playback to resume. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekcommand/3750279-anticipatedplaybackrate?language=objc +func (d_ DelegatingPlaybackCoordinatorSeekCommand) AnticipatedPlaybackRate() float64 { + rv := objc.Call[float64](d_, objc.Sel("anticipatedPlaybackRate")) + return rv +} + +// The deadline by which the coordinator expects the delegate to handle the command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekcommand/3778531-completionduedate?language=objc +func (d_ DelegatingPlaybackCoordinatorSeekCommand) CompletionDueDate() foundation.Date { + rv := objc.Call[foundation.Date](d_, objc.Sel("completionDueDate")) + return rv +} diff --git a/macos/avfoundation/depth_data.gen.go b/macos/avfoundation/depth_data.gen.go new file mode 100644 index 00000000..21ed4007 --- /dev/null +++ b/macos/avfoundation/depth_data.gen.go @@ -0,0 +1,187 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/imageio" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DepthData] class. +var DepthDataClass = _DepthDataClass{objc.GetClass("AVDepthData")} + +type _DepthDataClass struct { + objc.Class +} + +// An interface definition for the [DepthData] class. +type IDepthData interface { + objc.IObject + DictionaryRepresentationForAuxiliaryDataType(outAuxDataType string) foundation.Dictionary + AvailableDepthDataTypes() []foundation.Number + IsDepthDataFiltered() bool + DepthDataAccuracy() DepthDataAccuracy + DepthDataQuality() DepthDataQuality + DepthDataType() uint + DepthDataMap() corevideo.PixelBufferRef + CameraCalibrationData() CameraCalibrationData +} + +// A container for per-pixel distance or disparity information captured by compatible camera devices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata?language=objc +type DepthData struct { + objc.Object +} + +func DepthDataFrom(ptr unsafe.Pointer) DepthData { + return DepthData{ + Object: objc.ObjectFrom(ptr), + } +} + +func (d_ DepthData) DepthDataByApplyingExifOrientation(exifOrientation imageio.ImagePropertyOrientation) DepthData { + rv := objc.Call[DepthData](d_, objc.Sel("depthDataByApplyingExifOrientation:"), exifOrientation) + return rv +} + +// Returns a derivative depth data object by mirroring or rotating it to the specified orientation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881225-depthdatabyapplyingexiforientati?language=objc +func DepthData_DepthDataByApplyingExifOrientation(exifOrientation imageio.ImagePropertyOrientation) DepthData { + instance := DepthDataClass.Alloc().DepthDataByApplyingExifOrientation(exifOrientation) + instance.Autorelease() + return instance +} + +func (dc _DepthDataClass) DepthDataFromDictionaryRepresentationError(imageSourceAuxDataInfoDictionary foundation.Dictionary, outError foundation.IError) DepthData { + rv := objc.Call[DepthData](dc, objc.Sel("depthDataFromDictionaryRepresentation:error:"), imageSourceAuxDataInfoDictionary, objc.Ptr(outError)) + return rv +} + +// Creates a depth data object from depth information such as that found in an image file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881221-depthdatafromdictionaryrepresent?language=objc +func DepthData_DepthDataFromDictionaryRepresentationError(imageSourceAuxDataInfoDictionary foundation.Dictionary, outError foundation.IError) DepthData { + return DepthDataClass.DepthDataFromDictionaryRepresentationError(imageSourceAuxDataInfoDictionary, outError) +} + +func (d_ DepthData) DepthDataByConvertingToDepthDataType(depthDataType uint) DepthData { + rv := objc.Call[DepthData](d_, objc.Sel("depthDataByConvertingToDepthDataType:"), depthDataType) + return rv +} + +// Returns a derivative depth data object by converting the depth data map to the specified data type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881222-depthdatabyconvertingtodepthdata?language=objc +func DepthData_DepthDataByConvertingToDepthDataType(depthDataType uint) DepthData { + instance := DepthDataClass.Alloc().DepthDataByConvertingToDepthDataType(depthDataType) + instance.Autorelease() + return instance +} + +func (d_ DepthData) DepthDataByReplacingDepthDataMapWithPixelBufferError(pixelBuffer corevideo.PixelBufferRef, outError foundation.IError) DepthData { + rv := objc.Call[DepthData](d_, objc.Sel("depthDataByReplacingDepthDataMapWithPixelBuffer:error:"), pixelBuffer, objc.Ptr(outError)) + return rv +} + +// Returns a derivative depth data object by replacing the depth data map. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881231-depthdatabyreplacingdepthdatamap?language=objc +func DepthData_DepthDataByReplacingDepthDataMapWithPixelBufferError(pixelBuffer corevideo.PixelBufferRef, outError foundation.IError) DepthData { + instance := DepthDataClass.Alloc().DepthDataByReplacingDepthDataMapWithPixelBufferError(pixelBuffer, outError) + instance.Autorelease() + return instance +} + +func (dc _DepthDataClass) Alloc() DepthData { + rv := objc.Call[DepthData](dc, objc.Sel("alloc")) + return rv +} + +func DepthData_Alloc() DepthData { + return DepthDataClass.Alloc() +} + +func (dc _DepthDataClass) New() DepthData { + rv := objc.Call[DepthData](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDepthData() DepthData { + return DepthDataClass.New() +} + +func (d_ DepthData) Init() DepthData { + rv := objc.Call[DepthData](d_, objc.Sel("init")) + return rv +} + +// Returns a dictionary representation of the depth data suitable for writing into an image file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2873883-dictionaryrepresentationforauxil?language=objc +func (d_ DepthData) DictionaryRepresentationForAuxiliaryDataType(outAuxDataType string) foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](d_, objc.Sel("dictionaryRepresentationForAuxiliaryDataType:"), outAuxDataType) + return rv +} + +// The list of depth data formats to which this depth data can be converted. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881233-availabledepthdatatypes?language=objc +func (d_ DepthData) AvailableDepthDataTypes() []foundation.Number { + rv := objc.Call[[]foundation.Number](d_, objc.Sel("availableDepthDataTypes")) + return rv +} + +// A Boolean value indicating whether the depth map contains temporally smoothed data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881224-depthdatafiltered?language=objc +func (d_ DepthData) IsDepthDataFiltered() bool { + rv := objc.Call[bool](d_, objc.Sel("isDepthDataFiltered")) + return rv +} + +// The general accuracy of depth data map values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881229-depthdataaccuracy?language=objc +func (d_ DepthData) DepthDataAccuracy() DepthDataAccuracy { + rv := objc.Call[DepthDataAccuracy](d_, objc.Sel("depthDataAccuracy")) + return rv +} + +// The overall quality of the depth map. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2919804-depthdataquality?language=objc +func (d_ DepthData) DepthDataQuality() DepthDataQuality { + rv := objc.Call[DepthDataQuality](d_, objc.Sel("depthDataQuality")) + return rv +} + +// The pixel format of the depth data map. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881228-depthdatatype?language=objc +func (d_ DepthData) DepthDataType() uint { + rv := objc.Call[uint](d_, objc.Sel("depthDataType")) + return rv +} + +// A pixel buffer containing the depth data's per-pixel depth or disparity data map. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881227-depthdatamap?language=objc +func (d_ DepthData) DepthDataMap() corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](d_, objc.Sel("depthDataMap")) + return rv +} + +// The imaging parameters with which this depth data was captured. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdata/2881230-cameracalibrationdata?language=objc +func (d_ DepthData) CameraCalibrationData() CameraCalibrationData { + rv := objc.Call[CameraCalibrationData](d_, objc.Sel("cameraCalibrationData")) + return rv +} diff --git a/macos/avfoundation/doc.gen.go b/macos/avfoundation/doc.gen.go new file mode 100644 index 00000000..d660d042 --- /dev/null +++ b/macos/avfoundation/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Work with audiovisual assets, control device cameras, process audio, and configure system audio interactions. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/avfoundation?language=objc +package avfoundation diff --git a/macos/avfoundation/enumtypes.gen.go b/macos/avfoundation/enumtypes.gen.go new file mode 100644 index 00000000..90c51ec9 --- /dev/null +++ b/macos/avfoundation/enumtypes.gen.go @@ -0,0 +1,1724 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +// Constants that define eviction priorities for a storage management policy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetdownloadedassetevictionpriority?language=objc +type AssetDownloadedAssetEvictionPriority string + +const ( + AssetDownloadedAssetEvictionPriorityDefault AssetDownloadedAssetEvictionPriority = "default" + AssetDownloadedAssetEvictionPriorityImportant AssetDownloadedAssetEvictionPriority = "important" +) + +// Values that indicate the state of an export session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetexportsessionstatus?language=objc +type AssetExportSessionStatus int + +const ( + AssetExportSessionStatusCancelled AssetExportSessionStatus = 5 + AssetExportSessionStatusCompleted AssetExportSessionStatus = 3 + AssetExportSessionStatusExporting AssetExportSessionStatus = 2 + AssetExportSessionStatusFailed AssetExportSessionStatus = 4 + AssetExportSessionStatusUnknown AssetExportSessionStatus = 0 + AssetExportSessionStatusWaiting AssetExportSessionStatus = 1 +) + +// Constants that define aperture modes to use when generating images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegeneratoraperturemode?language=objc +type AssetImageGeneratorApertureMode string + +const ( + AssetImageGeneratorApertureModeCleanAperture AssetImageGeneratorApertureMode = "CleanAperture" + AssetImageGeneratorApertureModeEncodedPixels AssetImageGeneratorApertureMode = "EncodedPixels" + AssetImageGeneratorApertureModeProductionAperture AssetImageGeneratorApertureMode = "ProductionAperture" +) + +// Constants that indicate the result of an image generation request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetimagegeneratorresult?language=objc +type AssetImageGeneratorResult int + +const ( + AssetImageGeneratorCancelled AssetImageGeneratorResult = 2 + AssetImageGeneratorFailed AssetImageGeneratorResult = 1 + AssetImageGeneratorSucceeded AssetImageGeneratorResult = 0 +) + +// Values that represent the possible states of an asset reader. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreaderstatus?language=objc +type AssetReaderStatus int + +const ( + AssetReaderStatusCancelled AssetReaderStatus = 4 + AssetReaderStatusCompleted AssetReaderStatus = 2 + AssetReaderStatusFailed AssetReaderStatus = 3 + AssetReaderStatusReading AssetReaderStatus = 1 + AssetReaderStatusUnknown AssetReaderStatus = 0 +) + +// Restrictions to use when resolving references to external media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetreferencerestrictions?language=objc +type AssetReferenceRestrictions uint + +const ( + AssetReferenceRestrictionDefaultPolicy AssetReferenceRestrictions = 2 + AssetReferenceRestrictionForbidAll AssetReferenceRestrictions = 65535 + AssetReferenceRestrictionForbidCrossSiteReference AssetReferenceRestrictions = 4 + AssetReferenceRestrictionForbidLocalReferenceToLocal AssetReferenceRestrictions = 8 + AssetReferenceRestrictionForbidLocalReferenceToRemote AssetReferenceRestrictions = 2 + AssetReferenceRestrictionForbidNone AssetReferenceRestrictions = 0 + AssetReferenceRestrictionForbidRemoteReferenceToLocal AssetReferenceRestrictions = 1 +) + +// Constants that define the type of a segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetsegmenttype?language=objc +type AssetSegmentType int + +const ( + AssetSegmentTypeInitialization AssetSegmentType = 1 + AssetSegmentTypeSeparable AssetSegmentType = 2 +) + +// A structure that indicates how to lay out and interleave media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterinputmediadatalocation?language=objc +type AssetWriterInputMediaDataLocation string + +const ( + AssetWriterInputMediaDataLocationBeforeMainMediaDataNotInterleaved AssetWriterInputMediaDataLocation = "AVAssetWriterInputMediaDataLocationBeforeMainMediaDataNotInterleaved" + AssetWriterInputMediaDataLocationInterleavedWithMainMediaData AssetWriterInputMediaDataLocation = "AVAssetWriterInputMediaDataLocationInterleavedWithMainMediaData" +) + +// Values that indicate the state of an asset writer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avassetwriterstatus?language=objc +type AssetWriterStatus int + +const ( + AssetWriterStatusCancelled AssetWriterStatus = 4 + AssetWriterStatusCompleted AssetWriterStatus = 2 + AssetWriterStatusFailed AssetWriterStatus = 3 + AssetWriterStatusUnknown AssetWriterStatus = 0 + AssetWriterStatusWriting AssetWriterStatus = 1 +) + +// A structure that defines the spatialization formats that a player item supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiospatializationformats?language=objc +type AudioSpatializationFormats uint + +const ( + AudioSpatializationFormatMonoAndStereo AudioSpatializationFormats = 3 + AudioSpatializationFormatMonoStereoAndMultichannel AudioSpatializationFormats = 7 + AudioSpatializationFormatMultichannel AudioSpatializationFormats = 4 + AudioSpatializationFormatNone AudioSpatializationFormats = 0 +) + +// An algorithm used to set the audio pitch as the rate changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avaudiotimepitchalgorithm?language=objc +type AudioTimePitchAlgorithm string + +const ( + AudioTimePitchAlgorithmSpectral AudioTimePitchAlgorithm = "Spectral" + AudioTimePitchAlgorithmTimeDomain AudioTimePitchAlgorithm = "TimeDomain" + AudioTimePitchAlgorithmVarispeed AudioTimePitchAlgorithm = "Varispeed" +) + +// Constants that indicate the status of an app’s authorization to capture media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avauthorizationstatus?language=objc +type AuthorizationStatus int + +const ( + AuthorizationStatusAuthorized AuthorizationStatus = 3 + AuthorizationStatusDenied AuthorizationStatus = 2 + AuthorizationStatusNotDetermined AuthorizationStatus = 0 + AuthorizationStatusRestricted AuthorizationStatus = 1 +) + +// Animation options for a caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionanimation?language=objc +type CaptionAnimation int + +const ( + CaptionAnimationCharacterReveal CaptionAnimation = 1 + CaptionAnimationNone CaptionAnimation = 0 +) + +// Constants that indicate an adjustment type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionadjustmenttype?language=objc +type CaptionConversionAdjustmentType string + +const ( + CaptionConversionAdjustmentTypeTimeRange CaptionConversionAdjustmentType = "AVCaptionConversionAdjustmentTypeTimeRange" +) + +// Constants that indicate the status of a validator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionvalidatorstatus?language=objc +type CaptionConversionValidatorStatus int + +const ( + CaptionConversionValidatorStatusCompleted CaptionConversionValidatorStatus = 2 + CaptionConversionValidatorStatusStopped CaptionConversionValidatorStatus = 3 + CaptionConversionValidatorStatusUnknown CaptionConversionValidatorStatus = 0 + CaptionConversionValidatorStatusValidating CaptionConversionValidatorStatus = 1 +) + +// The type of a caption conversion warning. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionconversionwarningtype?language=objc +type CaptionConversionWarningType string + +const ( + CaptionConversionWarningTypeExcessMediaData CaptionConversionWarningType = "AVCaptionConversionWarningTypeExcessMediaData" +) + +// Text decorations for caption text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiondecoration?language=objc +type CaptionDecoration uint + +const ( + CaptionDecorationLineThrough CaptionDecoration = 2 + CaptionDecorationNone CaptionDecoration = 0 + CaptionDecorationOverline CaptionDecoration = 4 + CaptionDecorationUnderline CaptionDecoration = 1 +) + +// Font styles for caption text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionfontstyle?language=objc +type CaptionFontStyle int + +const ( + CaptionFontStyleItalic CaptionFontStyle = 2 + CaptionFontStyleNormal CaptionFontStyle = 1 + CaptionFontStyleUnknown CaptionFontStyle = 0 +) + +// Font weights for a caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionfontweight?language=objc +type CaptionFontWeight int + +const ( + CaptionFontWeightBold CaptionFontWeight = 2 + CaptionFontWeightNormal CaptionFontWeight = 1 + CaptionFontWeightUnknown CaptionFontWeight = 0 +) + +// Constants that indicate the alignment of lines in a region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregiondisplayalignment?language=objc +type CaptionRegionDisplayAlignment int + +const ( + CaptionRegionDisplayAlignmentAfter CaptionRegionDisplayAlignment = 2 + CaptionRegionDisplayAlignmentBefore CaptionRegionDisplayAlignment = 0 + CaptionRegionDisplayAlignmentCenter CaptionRegionDisplayAlignment = 1 +) + +// Constants that indicate the scrolling effects the system applies to a region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregionscroll?language=objc +type CaptionRegionScroll int + +const ( + CaptionRegionScrollNone CaptionRegionScroll = 0 + CaptionRegionScrollRollUp CaptionRegionScroll = 1 +) + +// Constants that indicate the writing mode for a region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionregionwritingmode?language=objc +type CaptionRegionWritingMode int + +const ( + CaptionRegionWritingModeLeftToRightAndTopToBottom CaptionRegionWritingMode = 0 + CaptionRegionWritingModeTopToBottomAndRightToLeft CaptionRegionWritingMode = 2 +) + +// Constants that indicate ruby text alignments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrubyalignment?language=objc +type CaptionRubyAlignment int + +const ( + CaptionRubyAlignmentCenter CaptionRubyAlignment = 1 + CaptionRubyAlignmentDistributeSpaceAround CaptionRubyAlignment = 3 + CaptionRubyAlignmentDistributeSpaceBetween CaptionRubyAlignment = 2 + CaptionRubyAlignmentStart CaptionRubyAlignment = 0 +) + +// Constants that indicate ruby text positions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionrubyposition?language=objc +type CaptionRubyPosition int + +const ( + CaptionRubyPositionAfter CaptionRubyPosition = 1 + CaptionRubyPositionBefore CaptionRubyPosition = 0 +) + +// A structure that defines dictionary keys to configure the caption converter and validator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionsettingskey?language=objc +type CaptionSettingsKey string + +const ( + CaptionMediaSubTypeKey CaptionSettingsKey = "AVCaptionMediaSubTypeKey" + CaptionMediaTypeKey CaptionSettingsKey = "AVCaptionMediaTypeKey" + CaptionTimeCodeFrameDurationKey CaptionSettingsKey = "AVCaptionTimeCodeFrameDurationKey" + CaptionUseDropFrameTimeCodeKey CaptionSettingsKey = "AVCaptionUseDropFrameTimeCodeKey" +) + +// Text alignment options for a caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiontextalignment?language=objc +type CaptionTextAlignment int + +const ( + CaptionTextAlignmentCenter CaptionTextAlignment = 2 + CaptionTextAlignmentEnd CaptionTextAlignment = 1 + CaptionTextAlignmentLeft CaptionTextAlignment = 3 + CaptionTextAlignmentRight CaptionTextAlignment = 4 + CaptionTextAlignmentStart CaptionTextAlignment = 0 +) + +// The caption’s supported rendering policy options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptiontextcombine?language=objc +type CaptionTextCombine int + +const ( + CaptionTextCombineAll CaptionTextCombine = -1 + CaptionTextCombineFourDigits CaptionTextCombine = 4 + CaptionTextCombineNone CaptionTextCombine = 0 + CaptionTextCombineOneDigit CaptionTextCombine = 1 + CaptionTextCombineThreeDigits CaptionTextCombine = 3 + CaptionTextCombineTwoDigits CaptionTextCombine = 2 +) + +// A structure that defines a units for caption formats. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptionunitstype?language=objc +type CaptionUnitsType int + +const ( + CaptionUnitsTypeCells CaptionUnitsType = 1 + CaptionUnitsTypePercent CaptionUnitsType = 2 + CaptionUnitsTypeUnspecified CaptionUnitsType = 0 +) + +// An enumeration of auto focus systems. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureautofocussystem?language=objc +type CaptureAutoFocusSystem int + +const ( + CaptureAutoFocusSystemContrastDetection CaptureAutoFocusSystem = 1 + CaptureAutoFocusSystemNone CaptureAutoFocusSystem = 0 + CaptureAutoFocusSystemPhaseDetection CaptureAutoFocusSystem = 2 +) + +// Constants that indicate the current Center Stage control mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturecenterstagecontrolmode?language=objc +type CaptureCenterStageControlMode int + +// An enumeration of color spaces a device can support. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturecolorspace?language=objc +type CaptureColorSpace int + +const ( + CaptureColorSpace_P3_D65 CaptureColorSpace = 1 + CaptureColorSpace_sRGB CaptureColorSpace = 0 +) + +// Constants that indicate the physical position of a capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedeviceposition?language=objc +type CaptureDevicePosition int + +const ( + CaptureDevicePositionBack CaptureDevicePosition = 1 + CaptureDevicePositionFront CaptureDevicePosition = 2 + CaptureDevicePositionUnspecified CaptureDevicePosition = 0 +) + +// Constants that indicate the transport control’s current mode of playback, if it has one. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevicetransportcontrolsplaybackmode?language=objc +type CaptureDeviceTransportControlsPlaybackMode int + +const ( + CaptureDeviceTransportControlsNotPlayingMode CaptureDeviceTransportControlsPlaybackMode = 0 + CaptureDeviceTransportControlsPlayingMode CaptureDeviceTransportControlsPlaybackMode = 1 +) + +// A constant that specifies speed of transport controls. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevicetransportcontrolsspeed?language=objc +type CaptureDeviceTransportControlsSpeed float64 + +// A structure that defines the device types the framework supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturedevicetype?language=objc +type CaptureDeviceType string + +const ( + CaptureDeviceTypeBuiltInMicrophone CaptureDeviceType = "AVCaptureDeviceTypeBuiltInMicrophone" + CaptureDeviceTypeBuiltInWideAngleCamera CaptureDeviceType = "AVCaptureDeviceTypeBuiltInWideAngleCamera" + CaptureDeviceTypeExternalUnknown CaptureDeviceType = "AVCaptureDeviceTypeExternalUnknown" +) + +// Constants that specify the exposure mode of a capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureexposuremode?language=objc +type CaptureExposureMode int + +const ( + CaptureExposureModeAutoExpose CaptureExposureMode = 1 + CaptureExposureModeContinuousAutoExposure CaptureExposureMode = 2 + CaptureExposureModeCustom CaptureExposureMode = 3 + CaptureExposureModeLocked CaptureExposureMode = 0 +) + +// Constants that specify the flash modes of a capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureflashmode?language=objc +type CaptureFlashMode int + +const ( + CaptureFlashModeAuto CaptureFlashMode = 2 + CaptureFlashModeOff CaptureFlashMode = 0 + CaptureFlashModeOn CaptureFlashMode = 1 +) + +// Constants to specify the focus mode of a capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturefocusmode?language=objc +type CaptureFocusMode int + +const ( + CaptureFocusModeAutoFocus CaptureFocusMode = 1 + CaptureFocusModeContinuousAutoFocus CaptureFocusMode = 2 + CaptureFocusModeLocked CaptureFocusMode = 0 +) + +// Constants that define the available microphone modes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturemicrophonemode?language=objc +type CaptureMicrophoneMode int + +const ( + CaptureMicrophoneModeStandard CaptureMicrophoneMode = 0 + CaptureMicrophoneModeVoiceIsolation CaptureMicrophoneMode = 2 + CaptureMicrophoneModeWideSpectrum CaptureMicrophoneMode = 1 +) + +// Constants that define reasons for why the system dropped a frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureoutputdatadroppedreason?language=objc +type CaptureOutputDataDroppedReason int + +const ( + CaptureOutputDataDroppedReasonDiscontinuity CaptureOutputDataDroppedReason = 3 + CaptureOutputDataDroppedReasonLateData CaptureOutputDataDroppedReason = 1 + CaptureOutputDataDroppedReasonNone CaptureOutputDataDroppedReason = 0 + CaptureOutputDataDroppedReasonOutOfBuffers CaptureOutputDataDroppedReason = 2 +) + +// A structure that defines the conditions in which to restrict camera switching. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureprimaryconstituentdevicerestrictedswitchingbehaviorconditions?language=objc +type CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions uint + +const ( + CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionExposureModeChanged CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions = 4 + CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionFocusModeChanged CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions = 2 + CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionNone CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions = 0 + CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionVideoZoomChanged CapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions = 1 +) + +// Constants that control when to allow a virtual device to switch its active primary constituent device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaptureprimaryconstituentdeviceswitchingbehavior?language=objc +type CapturePrimaryConstituentDeviceSwitchingBehavior int + +const ( + CapturePrimaryConstituentDeviceSwitchingBehaviorAuto CapturePrimaryConstituentDeviceSwitchingBehavior = 1 + CapturePrimaryConstituentDeviceSwitchingBehaviorLocked CapturePrimaryConstituentDeviceSwitchingBehavior = 3 + CapturePrimaryConstituentDeviceSwitchingBehaviorRestricted CapturePrimaryConstituentDeviceSwitchingBehavior = 2 + CapturePrimaryConstituentDeviceSwitchingBehaviorUnsupported CapturePrimaryConstituentDeviceSwitchingBehavior = 0 +) + +// Presets that define standard configurations for a capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesessionpreset?language=objc +type CaptureSessionPreset string + +const ( + CaptureSessionPreset1280x720 CaptureSessionPreset = "AVCaptureSessionPreset1280x720" + CaptureSessionPreset1920x1080 CaptureSessionPreset = "AVCaptureSessionPreset1920x1080" + CaptureSessionPreset320x240 CaptureSessionPreset = "AVCaptureSessionPreset320x240" + CaptureSessionPreset352x288 CaptureSessionPreset = "AVCaptureSessionPreset352x288" + CaptureSessionPreset3840x2160 CaptureSessionPreset = "AVCaptureSessionPreset3840x2160" + CaptureSessionPreset640x480 CaptureSessionPreset = "AVCaptureSessionPreset640x480" + CaptureSessionPreset960x540 CaptureSessionPreset = "AVCaptureSessionPreset960x540" + CaptureSessionPresetHigh CaptureSessionPreset = "AVCaptureSessionPresetHigh" + CaptureSessionPresetLow CaptureSessionPreset = "AVCaptureSessionPresetLow" + CaptureSessionPresetMedium CaptureSessionPreset = "AVCaptureSessionPresetMedium" + CaptureSessionPresetPhoto CaptureSessionPreset = "AVCaptureSessionPresetPhoto" + CaptureSessionPresetiFrame1280x720 CaptureSessionPreset = "AVCaptureSessionPresetiFrame1280x720" + CaptureSessionPresetiFrame960x540 CaptureSessionPreset = "AVCaptureSessionPresetiFrame960x540" +) + +// Constants that describe the capture device configuration user interfaces. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturesystemuserinterface?language=objc +type CaptureSystemUserInterface int + +const ( + CaptureSystemUserInterfaceMicrophoneModes CaptureSystemUserInterface = 2 + CaptureSystemUserInterfaceVideoEffects CaptureSystemUserInterface = 1 +) + +// Constants to specify the capture device’s torch mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturetorchmode?language=objc +type CaptureTorchMode int + +const ( + CaptureTorchModeAuto CaptureTorchMode = 2 + CaptureTorchModeOff CaptureTorchMode = 0 + CaptureTorchModeOn CaptureTorchMode = 1 +) + +// Constants indicating video orientation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturevideoorientation?language=objc +type CaptureVideoOrientation int + +const ( + CaptureVideoOrientationLandscapeLeft CaptureVideoOrientation = 4 + CaptureVideoOrientationLandscapeRight CaptureVideoOrientation = 3 + CaptureVideoOrientationPortrait CaptureVideoOrientation = 1 + CaptureVideoOrientationPortraitUpsideDown CaptureVideoOrientation = 2 +) + +// Constants to specify the white balance mode of a capture device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcapturewhitebalancemode?language=objc +type CaptureWhiteBalanceMode int + +const ( + CaptureWhiteBalanceModeAutoWhiteBalance CaptureWhiteBalanceMode = 1 + CaptureWhiteBalanceModeContinuousAutoWhiteBalance CaptureWhiteBalanceMode = 2 + CaptureWhiteBalanceModeLocked CaptureWhiteBalanceMode = 0 +) + +// A value representing the status of a content authorization request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentauthorizationstatus?language=objc +type ContentAuthorizationStatus int + +const ( + ContentAuthorizationBusy ContentAuthorizationStatus = 4 + ContentAuthorizationCancelled ContentAuthorizationStatus = 2 + ContentAuthorizationCompleted ContentAuthorizationStatus = 1 + ContentAuthorizationNotAvailable ContentAuthorizationStatus = 5 + ContentAuthorizationNotPossible ContentAuthorizationStatus = 6 + ContentAuthorizationTimedOut ContentAuthorizationStatus = 3 + ContentAuthorizationUnknown ContentAuthorizationStatus = 0 +) + +// The reason for asking the client to retry a content key request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequestretryreason?language=objc +type ContentKeyRequestRetryReason string + +const ( + ContentKeyRequestRetryReasonReceivedObsoleteContentKey ContentKeyRequestRetryReason = "ReceivedObsoleteKeyResponse" + ContentKeyRequestRetryReasonReceivedResponseWithExpiredLease ContentKeyRequestRetryReason = "ReceivedKeyResponseWithExpiredLease" + ContentKeyRequestRetryReasonTimedOut ContentKeyRequestRetryReason = "ReceivedKeyResponseAfterSPCTimedOut" +) + +// The status for a content key request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeyrequeststatus?language=objc +type ContentKeyRequestStatus int + +const ( + ContentKeyRequestStatusCancelled ContentKeyRequestStatus = 4 + ContentKeyRequestStatusFailed ContentKeyRequestStatus = 5 + ContentKeyRequestStatusReceivedResponse ContentKeyRequestStatus = 1 + ContentKeyRequestStatusRenewed ContentKeyRequestStatus = 2 + ContentKeyRequestStatusRequestingResponse ContentKeyRequestStatus = 0 + ContentKeyRequestStatusRetried ContentKeyRequestStatus = 3 +) + +// Options for specifying additional information for generating server playback context (SPC). [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysessionserverplaybackcontextoption?language=objc +type ContentKeySessionServerPlaybackContextOption string + +const ( + ContentKeySessionServerPlaybackContextOptionProtocolVersions ContentKeySessionServerPlaybackContextOption = "ProtocolVersionsKey" + ContentKeySessionServerPlaybackContextOptionServerChallenge ContentKeySessionServerPlaybackContextOption = "ServerChallenge" +) + +// A key-delivery method for a content key session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcontentkeysystem?language=objc +type ContentKeySystem string + +const ( + ContentKeySystemAuthorizationToken ContentKeySystem = "AuthorizationTokenSystem" + ContentKeySystemClearKey ContentKeySystem = "ClearKeySystem" + ContentKeySystemFairPlayStreaming ContentKeySystem = "FairPlayStreaming" +) + +// Constants that identify playback suspension reasons. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcoordinatedplaybacksuspensionreason?language=objc +type CoordinatedPlaybackSuspensionReason string + +const ( + CoordinatedPlaybackSuspensionReasonAudioSessionInterrupted CoordinatedPlaybackSuspensionReason = "AVCoordinatedPlaybackSuspensionReasonAudioSessionInterrupted" + CoordinatedPlaybackSuspensionReasonCoordinatedPlaybackNotPossible CoordinatedPlaybackSuspensionReason = "AVCoordinatedPlaybackSuspensionReasonCoordinatedPlaybackNotPossible" + CoordinatedPlaybackSuspensionReasonPlayingInterstitial CoordinatedPlaybackSuspensionReason = "AVCoordinatedPlaybackSuspensionReasonPlayingInterstitial" + CoordinatedPlaybackSuspensionReasonStallRecovery CoordinatedPlaybackSuspensionReason = "AVCoordinatedPlaybackSuspensionReasonStallRecovery" + CoordinatedPlaybackSuspensionReasonUserActionRequired CoordinatedPlaybackSuspensionReason = "AVCoordinatedPlaybackSuspensionReasonUserActionRequired" + CoordinatedPlaybackSuspensionReasonUserIsChangingCurrentTime CoordinatedPlaybackSuspensionReason = "AVCoordinatedPlaybackSuspensionReasonUserIsChangingCurrentTime" +) + +// Constants that define rate change options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorratechangeoptions?language=objc +type DelegatingPlaybackCoordinatorRateChangeOptions uint + +const ( + DelegatingPlaybackCoordinatorRateChangeOptionPlayImmediately DelegatingPlaybackCoordinatorRateChangeOptions = 1 +) + +// Constants that define seek options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdelegatingplaybackcoordinatorseekoptions?language=objc +type DelegatingPlaybackCoordinatorSeekOptions uint + +const ( + DelegatingPlaybackCoordinatorSeekOptionResumeImmediately DelegatingPlaybackCoordinatorSeekOptions = 1 +) + +// Values indicating the general accuracy of a depth data map. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdataaccuracy?language=objc +type DepthDataAccuracy int + +const ( + DepthDataAccuracyAbsolute DepthDataAccuracy = 1 + DepthDataAccuracyRelative DepthDataAccuracy = 0 +) + +// Values indicating the overall quality of a depth data map. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdepthdataquality?language=objc +type DepthDataQuality int + +const ( + DepthDataQualityHigh DepthDataQuality = 1 + DepthDataQualityLow DepthDataQuality = 0 +) + +// An enumeration that defines the errors that framework operations can generate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/averror?language=objc +type Error int + +const ( + ErrorAirPlayControllerRequiresInternet Error = -11856 + ErrorAirPlayReceiverRequiresInternet Error = -11857 + ErrorApplicationIsNotAuthorized Error = -11836 + ErrorApplicationIsNotAuthorizedToUseDevice Error = -11852 + ErrorCompositionTrackSegmentsNotContiguous Error = -11824 + ErrorContentIsNotAuthorized Error = -11835 + ErrorContentIsProtected Error = -11831 + ErrorContentIsUnavailable Error = -11863 + ErrorContentKeyRequestCancelled Error = -11879 + ErrorContentNotUpdated Error = -11866 + ErrorCreateContentKeyRequestFailed Error = -11860 + ErrorDecodeFailed Error = -11821 + ErrorDecoderNotFound Error = -11833 + ErrorDecoderTemporarilyUnavailable Error = -11839 + ErrorDeviceAlreadyUsedByAnotherSession Error = -11804 + ErrorDeviceInUseByAnotherApplication Error = -11815 + ErrorDeviceLockedForConfigurationByAnotherProcess Error = -11817 + ErrorDeviceNotConnected Error = -11814 + ErrorDeviceWasDisconnected Error = -11808 + ErrorDiskFull Error = -11807 + ErrorDisplayWasDisabled Error = -11845 + ErrorEncoderNotFound Error = -11834 + ErrorEncoderTemporarilyUnavailable Error = -11840 + ErrorExportFailed Error = -11820 + ErrorExternalPlaybackNotSupportedForAsset Error = -11870 + ErrorFailedToLoadMediaData Error = -11849 + ErrorFailedToParse Error = -11853 + ErrorFileAlreadyExists Error = -11823 + ErrorFileFailedToParse Error = -11829 + ErrorFileFormatNotRecognized Error = -11828 + ErrorFileTypeDoesNotSupportSampleReferences Error = -11854 + ErrorFormatUnsupported Error = -11864 + ErrorIncompatibleAsset Error = -11848 + ErrorIncorrectlyConfigured Error = -11875 + ErrorInvalidCompositionTrackSegmentDuration Error = -11825 + ErrorInvalidCompositionTrackSegmentSourceDuration Error = -11827 + ErrorInvalidCompositionTrackSegmentSourceStartTime Error = -11826 + ErrorInvalidOutputURLPathExtension Error = -11843 + ErrorInvalidSourceMedia Error = -11822 + ErrorInvalidVideoComposition Error = -11841 + ErrorMalformedDepth Error = -11865 + ErrorMaximumDurationReached Error = -11810 + ErrorMaximumFileSizeReached Error = -11811 + ErrorMaximumNumberOfSamplesForFileFormatReached Error = -11813 + ErrorMaximumStillImageCaptureRequestsExceeded Error = -11830 + ErrorMediaChanged Error = -11809 + ErrorMediaDiscontinuity Error = -11812 + ErrorNoCompatibleAlternatesForExternalDisplay Error = -11868 + ErrorNoDataCaptured Error = -11805 + ErrorNoImageAtTime Error = -11832 + ErrorNoLongerPlayable Error = -11867 + ErrorNoSourceTrack Error = -11869 + ErrorOperationCancelled Error = -11878 + ErrorOperationNotAllowed Error = -11862 + ErrorOperationNotSupportedForAsset Error = -11838 + ErrorOperationNotSupportedForPreset Error = -11871 + ErrorOutOfMemory Error = -11801 + ErrorReferenceForbiddenByReferencePolicy Error = -11842 + ErrorRosettaNotInstalled Error = -11877 + ErrorScreenCaptureFailed Error = -11844 + ErrorSegmentStartedWithNonSyncSample Error = -11876 + ErrorServerIncorrectlyConfigured Error = -11850 + ErrorSessionConfigurationChanged Error = -11806 + ErrorSessionNotRunning Error = -11803 + ErrorTorchLevelUnavailable Error = -11846 + ErrorUndecodableMediaData Error = -11855 + ErrorUnknown Error = -11800 + ErrorUnsupportedOutputSettings Error = -11861 + ErrorVideoCompositorFailed Error = -11858 +) + +// The uniform type identifiers for various file formats. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfiletype?language=objc +type FileType string + +const ( + FileType3GPP FileType = "public.3gpp" + FileType3GPP2 FileType = "public.3gpp2" + FileTypeAC3 FileType = "public.ac3-audio" + FileTypeAIFC FileType = "public.aifc-audio" + FileTypeAIFF FileType = "public.aiff-audio" + FileTypeAMR FileType = "org.3gpp.adaptive-multi-rate-audio" + FileTypeAVCI FileType = "public.avci" + FileTypeAppleM4A FileType = "com.apple.m4a-audio" + FileTypeAppleM4V FileType = "com.apple.m4v-video" + FileTypeAppleiTT FileType = "com.apple.itunes-timed-text" + FileTypeCoreAudioFormat FileType = "com.apple.coreaudio-format" + FileTypeDNG FileType = "com.adobe.raw-image" + FileTypeEnhancedAC3 FileType = "public.enhanced-ac3-audio" + FileTypeHEIC FileType = "public.heic" + FileTypeHEIF FileType = "public.heif" + FileTypeJPEG FileType = "public.jpeg" + FileTypeMPEG4 FileType = "public.mpeg-4" + FileTypeMPEGLayer3 FileType = "public.mp3" + FileTypeQuickTimeMovie FileType = "com.apple.quicktime-movie" + FileTypeSCC FileType = "com.scenarist.closed-caption" + FileTypeSunAU FileType = "public.au-audio" + FileTypeTIFF FileType = "public.tiff" + FileTypeWAVE FileType = "com.microsoft.waveform-audio" +) + +// File type profiles for streaming formats. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfiletypeprofile?language=objc +type FileTypeProfile string + +const ( + FileTypeProfileMPEG4AppleHLS FileTypeProfile = "MPEG4AppleHLS" + FileTypeProfileMPEG4CMAFCompliant FileTypeProfile = "MPEG4CMAFCompliant" +) + +// Values that indicate the loaded status of a property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avkeyvaluestatus?language=objc +type KeyValueStatus int + +const ( + KeyValueStatusCancelled KeyValueStatus = 4 + KeyValueStatusFailed KeyValueStatus = 3 + KeyValueStatusLoaded KeyValueStatus = 2 + KeyValueStatusLoading KeyValueStatus = 1 + KeyValueStatusUnknown KeyValueStatus = 0 +) + +// A structure that defines how a layer displays a player’s visual content within the layer’s bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avlayervideogravity?language=objc +type LayerVideoGravity string + +const ( + LayerVideoGravityResize LayerVideoGravity = "AVLayerVideoGravityResize" + LayerVideoGravityResizeAspect LayerVideoGravity = "AVLayerVideoGravityResizeAspect" + LayerVideoGravityResizeAspectFill LayerVideoGravity = "AVLayerVideoGravityResizeAspectFill" +) + +// A structure that defines media data characteristics. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediacharacteristic?language=objc +type MediaCharacteristic string + +const ( + MediaCharacteristicAudible MediaCharacteristic = "AVMediaCharacteristicAudible" + MediaCharacteristicContainsAlphaChannel MediaCharacteristic = "public.contains-alpha-channel" + MediaCharacteristicContainsHDRVideo MediaCharacteristic = "public.contains-hdr-video" + MediaCharacteristicContainsOnlyForcedSubtitles MediaCharacteristic = "public.subtitles.forced-only" + MediaCharacteristicDescribesMusicAndSoundForAccessibility MediaCharacteristic = "public.accessibility.describes-music-and-sound" + MediaCharacteristicDescribesVideoForAccessibility MediaCharacteristic = "public.accessibility.describes-video" + MediaCharacteristicDubbedTranslation MediaCharacteristic = "public.translation.dubbed" + MediaCharacteristicEasyToRead MediaCharacteristic = "public.easy-to-read" + MediaCharacteristicFrameBased MediaCharacteristic = "AVMediaCharacteristicFrameBased" + MediaCharacteristicIsAuxiliaryContent MediaCharacteristic = "public.auxiliary-content" + MediaCharacteristicIsMainProgramContent MediaCharacteristic = "public.main-program-content" + MediaCharacteristicIsOriginalContent MediaCharacteristic = "public.original-content" + MediaCharacteristicLanguageTranslation MediaCharacteristic = "public.translation" + MediaCharacteristicLegible MediaCharacteristic = "AVMediaCharacteristicLegible" + MediaCharacteristicTranscribesSpokenDialogForAccessibility MediaCharacteristic = "public.accessibility.transcribes-spoken-dialog" + MediaCharacteristicUsesWideGamutColorSpace MediaCharacteristic = "public.uses-wide-gamut-color-space" + MediaCharacteristicVisual MediaCharacteristic = "AVMediaCharacteristicVisual" + MediaCharacteristicVoiceOverTranslation MediaCharacteristic = "public.translation.voice-over" +) + +// An identifier for various media types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediatype?language=objc +type MediaType string + +const ( + MediaTypeAudio MediaType = "soun" + MediaTypeClosedCaption MediaType = "clcp" + MediaTypeDepthData MediaType = "dpth" + MediaTypeMetadata MediaType = "meta" + MediaTypeMuxed MediaType = "muxx" + MediaTypeSubtitle MediaType = "sbtl" + MediaTypeText MediaType = "text" + MediaTypeTimecode MediaType = "tmcd" + MediaTypeVideo MediaType = "vide" +) + +// A structure that defines keys for extra metadata attributes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataextraattributekey?language=objc +type MetadataExtraAttributeKey string + +const ( + MetadataExtraAttributeBaseURIKey MetadataExtraAttributeKey = "baseURL" + MetadataExtraAttributeInfoKey MetadataExtraAttributeKey = "info" + MetadataExtraAttributeValueURIKey MetadataExtraAttributeKey = "URL" +) + +// A structure that defines metadata formats. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataformat?language=objc +type MetadataFormat string + +const ( + MetadataFormatHLSMetadata MetadataFormat = "com.apple.quicktime.HLS" + MetadataFormatID3Metadata MetadataFormat = "org.id3" + MetadataFormatISOUserData MetadataFormat = "org.mp4ra" + MetadataFormatQuickTimeMetadata MetadataFormat = "com.apple.quicktime.mdta" + MetadataFormatQuickTimeUserData MetadataFormat = "com.apple.quicktime.udta" + MetadataFormatUnknown MetadataFormat = "public.unknown" + MetadataFormatiTunesMetadata MetadataFormat = "com.apple.itunes" +) + +// A structure that defines identifiers for metadata formats. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataidentifier?language=objc +type MetadataIdentifier string + +const ( + MetadataCommonIdentifierAccessibilityDescription MetadataIdentifier = "common/accessibilityDescription" + MetadataCommonIdentifierAlbumName MetadataIdentifier = "common/albumName" + MetadataCommonIdentifierArtist MetadataIdentifier = "common/artist" + MetadataCommonIdentifierArtwork MetadataIdentifier = "common/artwork" + MetadataCommonIdentifierAssetIdentifier MetadataIdentifier = "common/identifier" + MetadataCommonIdentifierAuthor MetadataIdentifier = "common/author" + MetadataCommonIdentifierContributor MetadataIdentifier = "common/contributor" + MetadataCommonIdentifierCopyrights MetadataIdentifier = "common/copyrights" + MetadataCommonIdentifierCreationDate MetadataIdentifier = "common/creationDate" + MetadataCommonIdentifierCreator MetadataIdentifier = "common/creator" + MetadataCommonIdentifierDescription MetadataIdentifier = "common/description" + MetadataCommonIdentifierFormat MetadataIdentifier = "common/format" + MetadataCommonIdentifierLanguage MetadataIdentifier = "common/language" + MetadataCommonIdentifierLastModifiedDate MetadataIdentifier = "common/lastModifiedDate" + MetadataCommonIdentifierLocation MetadataIdentifier = "common/location" + MetadataCommonIdentifierMake MetadataIdentifier = "common/make" + MetadataCommonIdentifierModel MetadataIdentifier = "common/model" + MetadataCommonIdentifierPublisher MetadataIdentifier = "common/publisher" + MetadataCommonIdentifierRelation MetadataIdentifier = "common/relation" + MetadataCommonIdentifierSoftware MetadataIdentifier = "common/software" + MetadataCommonIdentifierSource MetadataIdentifier = "common/source" + MetadataCommonIdentifierSubject MetadataIdentifier = "common/subject" + MetadataCommonIdentifierTitle MetadataIdentifier = "common/title" + MetadataCommonIdentifierType MetadataIdentifier = "common/type" + MetadataIdentifier3GPUserDataAlbumAndTrack MetadataIdentifier = "uiso/albm" + MetadataIdentifier3GPUserDataAuthor MetadataIdentifier = "uiso/auth" + MetadataIdentifier3GPUserDataCollection MetadataIdentifier = "uiso/coll" + MetadataIdentifier3GPUserDataCopyright MetadataIdentifier = "uiso/cprt" + MetadataIdentifier3GPUserDataDescription MetadataIdentifier = "uiso/dscp" + MetadataIdentifier3GPUserDataGenre MetadataIdentifier = "uiso/gnre" + MetadataIdentifier3GPUserDataKeywordList MetadataIdentifier = "uiso/kywd" + MetadataIdentifier3GPUserDataLocation MetadataIdentifier = "uiso/loci" + MetadataIdentifier3GPUserDataMediaClassification MetadataIdentifier = "uiso/clsf" + MetadataIdentifier3GPUserDataMediaRating MetadataIdentifier = "uiso/rtng" + MetadataIdentifier3GPUserDataPerformer MetadataIdentifier = "uiso/perf" + MetadataIdentifier3GPUserDataRecordingYear MetadataIdentifier = "uiso/yrrc" + MetadataIdentifier3GPUserDataThumbnail MetadataIdentifier = "uiso/thmb" + MetadataIdentifier3GPUserDataTitle MetadataIdentifier = "uiso/titl" + MetadataIdentifier3GPUserDataUserRating MetadataIdentifier = "uiso/urat" + MetadataIdentifierID3MetadataAlbumSortOrder MetadataIdentifier = "id3/TSOA" + MetadataIdentifierID3MetadataAlbumTitle MetadataIdentifier = "id3/TALB" + MetadataIdentifierID3MetadataAttachedPicture MetadataIdentifier = "id3/APIC" + MetadataIdentifierID3MetadataAudioEncryption MetadataIdentifier = "id3/AENC" + MetadataIdentifierID3MetadataAudioSeekPointIndex MetadataIdentifier = "id3/ASPI" + MetadataIdentifierID3MetadataBand MetadataIdentifier = "id3/TPE2" + MetadataIdentifierID3MetadataBeatsPerMinute MetadataIdentifier = "id3/TBPM" + MetadataIdentifierID3MetadataComments MetadataIdentifier = "id3/COMM" + MetadataIdentifierID3MetadataCommercial MetadataIdentifier = "id3/COMR" + MetadataIdentifierID3MetadataCommercialInformation MetadataIdentifier = "id3/WCOM" + MetadataIdentifierID3MetadataCommerical MetadataIdentifier = "id3/COMR" + MetadataIdentifierID3MetadataComposer MetadataIdentifier = "id3/TCOM" + MetadataIdentifierID3MetadataConductor MetadataIdentifier = "id3/TPE3" + MetadataIdentifierID3MetadataContentGroupDescription MetadataIdentifier = "id3/TIT1" + MetadataIdentifierID3MetadataContentType MetadataIdentifier = "id3/TCON" + MetadataIdentifierID3MetadataCopyright MetadataIdentifier = "id3/TCOP" + MetadataIdentifierID3MetadataCopyrightInformation MetadataIdentifier = "id3/WCOP" + MetadataIdentifierID3MetadataDate MetadataIdentifier = "id3/TDAT" + MetadataIdentifierID3MetadataEncodedBy MetadataIdentifier = "id3/TENC" + MetadataIdentifierID3MetadataEncodedWith MetadataIdentifier = "id3/TSSE" + MetadataIdentifierID3MetadataEncodingTime MetadataIdentifier = "id3/TDEN" + MetadataIdentifierID3MetadataEncryption MetadataIdentifier = "id3/ENCR" + MetadataIdentifierID3MetadataEqualization MetadataIdentifier = "id3/EQUA" + MetadataIdentifierID3MetadataEqualization2 MetadataIdentifier = "id3/EQU2" + MetadataIdentifierID3MetadataEventTimingCodes MetadataIdentifier = "id3/ETCO" + MetadataIdentifierID3MetadataFileOwner MetadataIdentifier = "id3/TOWN" + MetadataIdentifierID3MetadataFileType MetadataIdentifier = "id3/TFLT" + MetadataIdentifierID3MetadataGeneralEncapsulatedObject MetadataIdentifier = "id3/GEOB" + MetadataIdentifierID3MetadataGroupIdentifier MetadataIdentifier = "id3/GRID" + MetadataIdentifierID3MetadataInitialKey MetadataIdentifier = "id3/TKEY" + MetadataIdentifierID3MetadataInternationalStandardRecordingCode MetadataIdentifier = "id3/TSRC" + MetadataIdentifierID3MetadataInternetRadioStationName MetadataIdentifier = "id3/TRSN" + MetadataIdentifierID3MetadataInternetRadioStationOwner MetadataIdentifier = "id3/TRSO" + MetadataIdentifierID3MetadataInvolvedPeopleList_v23 MetadataIdentifier = "id3/IPLS" + MetadataIdentifierID3MetadataInvolvedPeopleList_v24 MetadataIdentifier = "id3/TIPL" + MetadataIdentifierID3MetadataLanguage MetadataIdentifier = "id3/TLAN" + MetadataIdentifierID3MetadataLeadPerformer MetadataIdentifier = "id3/TPE1" + MetadataIdentifierID3MetadataLength MetadataIdentifier = "id3/TLEN" + MetadataIdentifierID3MetadataLink MetadataIdentifier = "id3/LINK" + MetadataIdentifierID3MetadataLyricist MetadataIdentifier = "id3/TEXT" + MetadataIdentifierID3MetadataMPEGLocationLookupTable MetadataIdentifier = "id3/MLLT" + MetadataIdentifierID3MetadataMediaType MetadataIdentifier = "id3/TMED" + MetadataIdentifierID3MetadataModifiedBy MetadataIdentifier = "id3/TPE4" + MetadataIdentifierID3MetadataMood MetadataIdentifier = "id3/TMOO" + MetadataIdentifierID3MetadataMusicCDIdentifier MetadataIdentifier = "id3/MCDI" + MetadataIdentifierID3MetadataMusicianCreditsList MetadataIdentifier = "id3/TMCL" + MetadataIdentifierID3MetadataOfficialArtistWebpage MetadataIdentifier = "id3/WOAR" + MetadataIdentifierID3MetadataOfficialAudioFileWebpage MetadataIdentifier = "id3/WOAF" + MetadataIdentifierID3MetadataOfficialAudioSourceWebpage MetadataIdentifier = "id3/WOAS" + MetadataIdentifierID3MetadataOfficialInternetRadioStationHomepage MetadataIdentifier = "id3/WORS" + MetadataIdentifierID3MetadataOfficialPublisherWebpage MetadataIdentifier = "id3/WPUB" + MetadataIdentifierID3MetadataOriginalAlbumTitle MetadataIdentifier = "id3/TOAL" + MetadataIdentifierID3MetadataOriginalArtist MetadataIdentifier = "id3/TOPE" + MetadataIdentifierID3MetadataOriginalFilename MetadataIdentifier = "id3/TOFN" + MetadataIdentifierID3MetadataOriginalLyricist MetadataIdentifier = "id3/TOLY" + MetadataIdentifierID3MetadataOriginalReleaseTime MetadataIdentifier = "id3/TDOR" + MetadataIdentifierID3MetadataOriginalReleaseYear MetadataIdentifier = "id3/TORY" + MetadataIdentifierID3MetadataOwnership MetadataIdentifier = "id3/OWNE" + MetadataIdentifierID3MetadataPartOfASet MetadataIdentifier = "id3/TPOS" + MetadataIdentifierID3MetadataPayment MetadataIdentifier = "id3/WPAY" + MetadataIdentifierID3MetadataPerformerSortOrder MetadataIdentifier = "id3/TSOP" + MetadataIdentifierID3MetadataPlayCounter MetadataIdentifier = "id3/PCNT" + MetadataIdentifierID3MetadataPlaylistDelay MetadataIdentifier = "id3/TDLY" + MetadataIdentifierID3MetadataPopularimeter MetadataIdentifier = "id3/POPM" + MetadataIdentifierID3MetadataPositionSynchronization MetadataIdentifier = "id3/POSS" + MetadataIdentifierID3MetadataPrivate MetadataIdentifier = "id3/PRIV" + MetadataIdentifierID3MetadataProducedNotice MetadataIdentifier = "id3/TPRO" + MetadataIdentifierID3MetadataPublisher MetadataIdentifier = "id3/TPUB" + MetadataIdentifierID3MetadataRecommendedBufferSize MetadataIdentifier = "id3/RBUF" + MetadataIdentifierID3MetadataRecordingDates MetadataIdentifier = "id3/TRDA" + MetadataIdentifierID3MetadataRecordingTime MetadataIdentifier = "id3/TDRC" + MetadataIdentifierID3MetadataRelativeVolumeAdjustment MetadataIdentifier = "id3/RVAD" + MetadataIdentifierID3MetadataRelativeVolumeAdjustment2 MetadataIdentifier = "id3/RVA2" + MetadataIdentifierID3MetadataReleaseTime MetadataIdentifier = "id3/TDRL" + MetadataIdentifierID3MetadataReverb MetadataIdentifier = "id3/RVRB" + MetadataIdentifierID3MetadataSeek MetadataIdentifier = "id3/SEEK" + MetadataIdentifierID3MetadataSetSubtitle MetadataIdentifier = "id3/TSST" + MetadataIdentifierID3MetadataSignature MetadataIdentifier = "id3/SIGN" + MetadataIdentifierID3MetadataSize MetadataIdentifier = "id3/TSIZ" + MetadataIdentifierID3MetadataSubTitle MetadataIdentifier = "id3/TIT3" + MetadataIdentifierID3MetadataSynchronizedLyric MetadataIdentifier = "id3/SYLT" + MetadataIdentifierID3MetadataSynchronizedTempoCodes MetadataIdentifier = "id3/SYTC" + MetadataIdentifierID3MetadataTaggingTime MetadataIdentifier = "id3/TDTG" + MetadataIdentifierID3MetadataTermsOfUse MetadataIdentifier = "id3/USER" + MetadataIdentifierID3MetadataTime MetadataIdentifier = "id3/TIME" + MetadataIdentifierID3MetadataTitleDescription MetadataIdentifier = "id3/TIT2" + MetadataIdentifierID3MetadataTitleSortOrder MetadataIdentifier = "id3/TSOT" + MetadataIdentifierID3MetadataTrackNumber MetadataIdentifier = "id3/TRCK" + MetadataIdentifierID3MetadataUniqueFileIdentifier MetadataIdentifier = "id3/UFID" + MetadataIdentifierID3MetadataUnsynchronizedLyric MetadataIdentifier = "id3/USLT" + MetadataIdentifierID3MetadataUserText MetadataIdentifier = "id3/TXXX" + MetadataIdentifierID3MetadataUserURL MetadataIdentifier = "id3/WXXX" + MetadataIdentifierID3MetadataYear MetadataIdentifier = "id3/TYER" + MetadataIdentifierISOUserDataAccessibilityDescription MetadataIdentifier = "uiso/ades" + MetadataIdentifierISOUserDataCopyright MetadataIdentifier = "uiso/cprt" + MetadataIdentifierISOUserDataDate MetadataIdentifier = "uiso/date" + MetadataIdentifierISOUserDataTaggedCharacteristic MetadataIdentifier = "uiso/tagc" + MetadataIdentifierIcyMetadataStreamTitle MetadataIdentifier = "icy/StreamTitle" + MetadataIdentifierIcyMetadataStreamURL MetadataIdentifier = "icy/StreamUrl" + MetadataIdentifierQuickTimeMetadataAccessibilityDescription MetadataIdentifier = "mdta/com.apple.quicktime.accessibility.description" + MetadataIdentifierQuickTimeMetadataAlbum MetadataIdentifier = "mdta/com.apple.quicktime.album" + MetadataIdentifierQuickTimeMetadataArranger MetadataIdentifier = "mdta/com.apple.quicktime.arranger" + MetadataIdentifierQuickTimeMetadataArtist MetadataIdentifier = "mdta/com.apple.quicktime.artist" + MetadataIdentifierQuickTimeMetadataArtwork MetadataIdentifier = "mdta/com.apple.quicktime.artwork" + MetadataIdentifierQuickTimeMetadataAuthor MetadataIdentifier = "mdta/com.apple.quicktime.author" + MetadataIdentifierQuickTimeMetadataAutoLivePhoto MetadataIdentifier = "mdta/com.apple.quicktime.live-photo.auto" + MetadataIdentifierQuickTimeMetadataCameraFrameReadoutTime MetadataIdentifier = "mdta/com.apple.quicktime.camera.framereadouttimeinmicroseconds" + MetadataIdentifierQuickTimeMetadataCameraIdentifier MetadataIdentifier = "mdta/com.apple.quicktime.camera.identifier" + MetadataIdentifierQuickTimeMetadataCollectionUser MetadataIdentifier = "mdta/com.apple.quicktime.collection.user" + MetadataIdentifierQuickTimeMetadataComment MetadataIdentifier = "mdta/com.apple.quicktime.comment" + MetadataIdentifierQuickTimeMetadataComposer MetadataIdentifier = "mdta/com.apple.quicktime.composer" + MetadataIdentifierQuickTimeMetadataContentIdentifier MetadataIdentifier = "mdta/com.apple.quicktime.content.identifier" + MetadataIdentifierQuickTimeMetadataCopyright MetadataIdentifier = "mdta/com.apple.quicktime.copyright" + MetadataIdentifierQuickTimeMetadataCreationDate MetadataIdentifier = "mdta/com.apple.quicktime.creationdate" + MetadataIdentifierQuickTimeMetadataCredits MetadataIdentifier = "mdta/com.apple.quicktime.credits" + MetadataIdentifierQuickTimeMetadataDescription MetadataIdentifier = "mdta/com.apple.quicktime.description" + MetadataIdentifierQuickTimeMetadataDetectedCatBody MetadataIdentifier = "mdta/com.apple.quicktime.detected-cat-body" + MetadataIdentifierQuickTimeMetadataDetectedDogBody MetadataIdentifier = "mdta/com.apple.quicktime.detected-dog-body" + MetadataIdentifierQuickTimeMetadataDetectedFace MetadataIdentifier = "mdta/com.apple.quicktime.detected-face" + MetadataIdentifierQuickTimeMetadataDetectedHumanBody MetadataIdentifier = "mdta/com.apple.quicktime.detected-human-body" + MetadataIdentifierQuickTimeMetadataDetectedSalientObject MetadataIdentifier = "mdta/com.apple.quicktime.detected-salient-object" + MetadataIdentifierQuickTimeMetadataDirectionFacing MetadataIdentifier = "mdta/com.apple.quicktime.direction.facing" + MetadataIdentifierQuickTimeMetadataDirectionMotion MetadataIdentifier = "mdta/com.apple.quicktime.direction.motion" + MetadataIdentifierQuickTimeMetadataDirector MetadataIdentifier = "mdta/com.apple.quicktime.director" + MetadataIdentifierQuickTimeMetadataDisplayName MetadataIdentifier = "mdta/com.apple.quicktime.displayname" + MetadataIdentifierQuickTimeMetadataEncodedBy MetadataIdentifier = "mdta/com.apple.quicktime.encodedby" + MetadataIdentifierQuickTimeMetadataGenre MetadataIdentifier = "mdta/com.apple.quicktime.genre" + MetadataIdentifierQuickTimeMetadataInformation MetadataIdentifier = "mdta/com.apple.quicktime.information" + MetadataIdentifierQuickTimeMetadataIsMontage MetadataIdentifier = "mdta/com.apple.quicktime.is-montage" + MetadataIdentifierQuickTimeMetadataKeywords MetadataIdentifier = "mdta/com.apple.quicktime.keywords" + MetadataIdentifierQuickTimeMetadataLivePhotoVitalityScore MetadataIdentifier = "mdta/com.apple.quicktime.live-photo.vitality-score" + MetadataIdentifierQuickTimeMetadataLivePhotoVitalityScoringVersion MetadataIdentifier = "mdta/com.apple.quicktime.live-photo.vitality-scoring-version" + MetadataIdentifierQuickTimeMetadataLocationBody MetadataIdentifier = "mdta/com.apple.quicktime.location.body" + MetadataIdentifierQuickTimeMetadataLocationDate MetadataIdentifier = "mdta/com.apple.quicktime.location.date" + MetadataIdentifierQuickTimeMetadataLocationHorizontalAccuracyInMeters MetadataIdentifier = "mdta/com.apple.quicktime.location.accuracy.horizontal" + MetadataIdentifierQuickTimeMetadataLocationISO6709 MetadataIdentifier = "mdta/com.apple.quicktime.location.ISO6709" + MetadataIdentifierQuickTimeMetadataLocationName MetadataIdentifier = "mdta/com.apple.quicktime.location.name" + MetadataIdentifierQuickTimeMetadataLocationNote MetadataIdentifier = "mdta/com.apple.quicktime.location.note" + MetadataIdentifierQuickTimeMetadataLocationRole MetadataIdentifier = "mdta/com.apple.quicktime.location.role" + MetadataIdentifierQuickTimeMetadataMake MetadataIdentifier = "mdta/com.apple.quicktime.make" + MetadataIdentifierQuickTimeMetadataModel MetadataIdentifier = "mdta/com.apple.quicktime.model" + MetadataIdentifierQuickTimeMetadataOriginalArtist MetadataIdentifier = "mdta/com.apple.quicktime.originalartist" + MetadataIdentifierQuickTimeMetadataPerformer MetadataIdentifier = "mdta/com.apple.quicktime.performer" + MetadataIdentifierQuickTimeMetadataPhonogramRights MetadataIdentifier = "mdta/com.apple.quicktime.phonogramrights" + MetadataIdentifierQuickTimeMetadataPreferredAffineTransform MetadataIdentifier = "mdta/com.apple.quicktime.preferred-affine-transform" + MetadataIdentifierQuickTimeMetadataProducer MetadataIdentifier = "mdta/com.apple.quicktime.producer" + MetadataIdentifierQuickTimeMetadataPublisher MetadataIdentifier = "mdta/com.apple.quicktime.publisher" + MetadataIdentifierQuickTimeMetadataRatingUser MetadataIdentifier = "mdta/com.apple.quicktime.rating.user" + MetadataIdentifierQuickTimeMetadataSoftware MetadataIdentifier = "mdta/com.apple.quicktime.software" + MetadataIdentifierQuickTimeMetadataSpatialOverCaptureQualityScore MetadataIdentifier = "mdta/com.apple.quicktime.spatial-overcapture.quality-score" + MetadataIdentifierQuickTimeMetadataSpatialOverCaptureQualityScoringVersion MetadataIdentifier = "mdta/com.apple.quicktime.spatial-overcapture.quality-scoring-version" + MetadataIdentifierQuickTimeMetadataTitle MetadataIdentifier = "mdta/com.apple.quicktime.title" + MetadataIdentifierQuickTimeMetadataVideoOrientation MetadataIdentifier = "mdta/com.apple.quicktime.video-orientation" + MetadataIdentifierQuickTimeMetadataYear MetadataIdentifier = "mdta/com.apple.quicktime.year" + MetadataIdentifierQuickTimeMetadataiXML MetadataIdentifier = "mdta/info.ixml.xml" + MetadataIdentifierQuickTimeUserDataAccessibilityDescription MetadataIdentifier = "udta/%A9ade" + MetadataIdentifierQuickTimeUserDataAlbum MetadataIdentifier = "udta/%A9alb" + MetadataIdentifierQuickTimeUserDataArranger MetadataIdentifier = "udta/%A9arg" + MetadataIdentifierQuickTimeUserDataArtist MetadataIdentifier = "udta/%A9ART" + MetadataIdentifierQuickTimeUserDataAuthor MetadataIdentifier = "udta/%A9aut" + MetadataIdentifierQuickTimeUserDataChapter MetadataIdentifier = "udta/%A9chp" + MetadataIdentifierQuickTimeUserDataComment MetadataIdentifier = "udta/%A9cmt" + MetadataIdentifierQuickTimeUserDataComposer MetadataIdentifier = "udta/%A9com" + MetadataIdentifierQuickTimeUserDataCopyright MetadataIdentifier = "udta/%A9cpy" + MetadataIdentifierQuickTimeUserDataCreationDate MetadataIdentifier = "udta/%A9day" + MetadataIdentifierQuickTimeUserDataCredits MetadataIdentifier = "udta/%A9src" + MetadataIdentifierQuickTimeUserDataDescription MetadataIdentifier = "udta/%A9des" + MetadataIdentifierQuickTimeUserDataDirector MetadataIdentifier = "udta/%A9dir" + MetadataIdentifierQuickTimeUserDataDisclaimer MetadataIdentifier = "udta/%A9dis" + MetadataIdentifierQuickTimeUserDataEncodedBy MetadataIdentifier = "udta/%A9enc" + MetadataIdentifierQuickTimeUserDataFullName MetadataIdentifier = "udta/%A9nam" + MetadataIdentifierQuickTimeUserDataGenre MetadataIdentifier = "udta/%A9gen" + MetadataIdentifierQuickTimeUserDataHostComputer MetadataIdentifier = "udta/%A9hst" + MetadataIdentifierQuickTimeUserDataInformation MetadataIdentifier = "udta/%A9inf" + MetadataIdentifierQuickTimeUserDataKeywords MetadataIdentifier = "udta/%A9key" + MetadataIdentifierQuickTimeUserDataLocationISO6709 MetadataIdentifier = "udta/%A9xyz" + MetadataIdentifierQuickTimeUserDataMake MetadataIdentifier = "udta/%A9mak" + MetadataIdentifierQuickTimeUserDataModel MetadataIdentifier = "udta/%A9mod" + MetadataIdentifierQuickTimeUserDataOriginalArtist MetadataIdentifier = "udta/%A9ope" + MetadataIdentifierQuickTimeUserDataOriginalFormat MetadataIdentifier = "udta/%A9fmt" + MetadataIdentifierQuickTimeUserDataOriginalSource MetadataIdentifier = "udta/%A9src" + MetadataIdentifierQuickTimeUserDataPerformers MetadataIdentifier = "udta/%A9prf" + MetadataIdentifierQuickTimeUserDataPhonogramRights MetadataIdentifier = "udta/%A9phg" + MetadataIdentifierQuickTimeUserDataProducer MetadataIdentifier = "udta/%A9prd" + MetadataIdentifierQuickTimeUserDataProduct MetadataIdentifier = "udta/%A9PRD" + MetadataIdentifierQuickTimeUserDataPublisher MetadataIdentifier = "udta/%A9pub" + MetadataIdentifierQuickTimeUserDataSoftware MetadataIdentifier = "udta/%A9swr" + MetadataIdentifierQuickTimeUserDataSpecialPlaybackRequirements MetadataIdentifier = "udta/%A9req" + MetadataIdentifierQuickTimeUserDataTaggedCharacteristic MetadataIdentifier = "udta/tagc" + MetadataIdentifierQuickTimeUserDataTrack MetadataIdentifier = "udta/%A9trk" + MetadataIdentifierQuickTimeUserDataTrackName MetadataIdentifier = "udta/tnam" + MetadataIdentifierQuickTimeUserDataURLLink MetadataIdentifier = "udta/%A9url" + MetadataIdentifierQuickTimeUserDataWarning MetadataIdentifier = "udta/%A9wrn" + MetadataIdentifierQuickTimeUserDataWriter MetadataIdentifier = "udta/%A9wrt" + MetadataIdentifieriTunesMetadataAccountKind MetadataIdentifier = "itsk/akID" + MetadataIdentifieriTunesMetadataAcknowledgement MetadataIdentifier = "itsk/%A9cak" + MetadataIdentifieriTunesMetadataAlbum MetadataIdentifier = "itsk/%A9alb" + MetadataIdentifieriTunesMetadataAlbumArtist MetadataIdentifier = "itsk/aART" + MetadataIdentifieriTunesMetadataAppleID MetadataIdentifier = "itsk/apID" + MetadataIdentifieriTunesMetadataArranger MetadataIdentifier = "itsk/%A9arg" + MetadataIdentifieriTunesMetadataArtDirector MetadataIdentifier = "itsk/%A9ard" + MetadataIdentifieriTunesMetadataArtist MetadataIdentifier = "itsk/%A9ART" + MetadataIdentifieriTunesMetadataArtistID MetadataIdentifier = "itsk/atID" + MetadataIdentifieriTunesMetadataAuthor MetadataIdentifier = "itsk/%A9aut" + MetadataIdentifieriTunesMetadataBeatsPerMin MetadataIdentifier = "itsk/tmpo" + MetadataIdentifieriTunesMetadataComposer MetadataIdentifier = "itsk/%A9wrt" + MetadataIdentifieriTunesMetadataConductor MetadataIdentifier = "itsk/%A9con" + MetadataIdentifieriTunesMetadataContentRating MetadataIdentifier = "itsk/rtng" + MetadataIdentifieriTunesMetadataCopyright MetadataIdentifier = "itsk/cprt" + MetadataIdentifieriTunesMetadataCoverArt MetadataIdentifier = "itsk/covr" + MetadataIdentifieriTunesMetadataCredits MetadataIdentifier = "itsk/%A9src" + MetadataIdentifieriTunesMetadataDescription MetadataIdentifier = "itsk/%A9des" + MetadataIdentifieriTunesMetadataDirector MetadataIdentifier = "itsk/%A9dir" + MetadataIdentifieriTunesMetadataDiscCompilation MetadataIdentifier = "itsk/cpil" + MetadataIdentifieriTunesMetadataDiscNumber MetadataIdentifier = "itsk/disk" + MetadataIdentifieriTunesMetadataEQ MetadataIdentifier = "itsk/%A9equ" + MetadataIdentifieriTunesMetadataEncodedBy MetadataIdentifier = "itsk/%A9enc" + MetadataIdentifieriTunesMetadataEncodingTool MetadataIdentifier = "itsk/%A9too" + MetadataIdentifieriTunesMetadataExecProducer MetadataIdentifier = "itsk/%A9xpd" + MetadataIdentifieriTunesMetadataGenreID MetadataIdentifier = "itsk/geID" + MetadataIdentifieriTunesMetadataGrouping MetadataIdentifier = "itsk/grup" + MetadataIdentifieriTunesMetadataLinerNotes MetadataIdentifier = "itsk/%A9lnt" + MetadataIdentifieriTunesMetadataLyrics MetadataIdentifier = "itsk/%A9lyr" + MetadataIdentifieriTunesMetadataOnlineExtras MetadataIdentifier = "itsk/%A9url" + MetadataIdentifieriTunesMetadataOriginalArtist MetadataIdentifier = "itsk/%A9ope" + MetadataIdentifieriTunesMetadataPerformer MetadataIdentifier = "itsk/%A9prf" + MetadataIdentifieriTunesMetadataPhonogramRights MetadataIdentifier = "itsk/%A9phg" + MetadataIdentifieriTunesMetadataPlaylistID MetadataIdentifier = "itsk/plID" + MetadataIdentifieriTunesMetadataPredefinedGenre MetadataIdentifier = "itsk/gnre" + MetadataIdentifieriTunesMetadataProducer MetadataIdentifier = "itsk/%A9prd" + MetadataIdentifieriTunesMetadataPublisher MetadataIdentifier = "itsk/%A9pub" + MetadataIdentifieriTunesMetadataRecordCompany MetadataIdentifier = "itsk/%A9mak" + MetadataIdentifieriTunesMetadataReleaseDate MetadataIdentifier = "itsk/%A9day" + MetadataIdentifieriTunesMetadataSoloist MetadataIdentifier = "itsk/%A9sol" + MetadataIdentifieriTunesMetadataSongID MetadataIdentifier = "itsk/cnID" + MetadataIdentifieriTunesMetadataSongName MetadataIdentifier = "itsk/%A9nam" + MetadataIdentifieriTunesMetadataSoundEngineer MetadataIdentifier = "itsk/%A9sne" + MetadataIdentifieriTunesMetadataThanks MetadataIdentifier = "itsk/%A9thx" + MetadataIdentifieriTunesMetadataTrackNumber MetadataIdentifier = "itsk/trkn" + MetadataIdentifieriTunesMetadataTrackSubTitle MetadataIdentifier = "itsk/%A9st3" + MetadataIdentifieriTunesMetadataUserComment MetadataIdentifier = "itsk/%A9cmt" + MetadataIdentifieriTunesMetadataUserGenre MetadataIdentifier = "itsk/%A9gen" +) + +// A structure that defines a metadata key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatakey?language=objc +type MetadataKey string + +const ( + Metadata3GPUserDataKeyAlbumAndTrack MetadataKey = "albm" + Metadata3GPUserDataKeyAuthor MetadataKey = "auth" + Metadata3GPUserDataKeyCollection MetadataKey = "coll" + Metadata3GPUserDataKeyCopyright MetadataKey = "cprt" + Metadata3GPUserDataKeyDescription MetadataKey = "dscp" + Metadata3GPUserDataKeyGenre MetadataKey = "gnre" + Metadata3GPUserDataKeyKeywordList MetadataKey = "kywd" + Metadata3GPUserDataKeyLocation MetadataKey = "loci" + Metadata3GPUserDataKeyMediaClassification MetadataKey = "clsf" + Metadata3GPUserDataKeyMediaRating MetadataKey = "rtng" + Metadata3GPUserDataKeyPerformer MetadataKey = "perf" + Metadata3GPUserDataKeyRecordingYear MetadataKey = "yrrc" + Metadata3GPUserDataKeyThumbnail MetadataKey = "thmb" + Metadata3GPUserDataKeyTitle MetadataKey = "titl" + Metadata3GPUserDataKeyUserRating MetadataKey = "urat" + MetadataCommonKeyAccessibilityDescription MetadataKey = "accessibilityDescription" + MetadataCommonKeyAlbumName MetadataKey = "albumName" + MetadataCommonKeyArtist MetadataKey = "artist" + MetadataCommonKeyArtwork MetadataKey = "artwork" + MetadataCommonKeyAuthor MetadataKey = "author" + MetadataCommonKeyContributor MetadataKey = "contributor" + MetadataCommonKeyCopyrights MetadataKey = "copyrights" + MetadataCommonKeyCreationDate MetadataKey = "creationDate" + MetadataCommonKeyCreator MetadataKey = "creator" + MetadataCommonKeyDescription MetadataKey = "description" + MetadataCommonKeyFormat MetadataKey = "format" + MetadataCommonKeyIdentifier MetadataKey = "identifier" + MetadataCommonKeyLanguage MetadataKey = "language" + MetadataCommonKeyLastModifiedDate MetadataKey = "lastModifiedDate" + MetadataCommonKeyLocation MetadataKey = "location" + MetadataCommonKeyMake MetadataKey = "make" + MetadataCommonKeyModel MetadataKey = "model" + MetadataCommonKeyPublisher MetadataKey = "publisher" + MetadataCommonKeyRelation MetadataKey = "relation" + MetadataCommonKeySoftware MetadataKey = "software" + MetadataCommonKeySource MetadataKey = "source" + MetadataCommonKeySubject MetadataKey = "subject" + MetadataCommonKeyTitle MetadataKey = "title" + MetadataCommonKeyType MetadataKey = "type" + MetadataID3MetadataKeyAlbumSortOrder MetadataKey = "TSOA" + MetadataID3MetadataKeyAlbumTitle MetadataKey = "TALB" + MetadataID3MetadataKeyAttachedPicture MetadataKey = "APIC" + MetadataID3MetadataKeyAudioEncryption MetadataKey = "AENC" + MetadataID3MetadataKeyAudioSeekPointIndex MetadataKey = "ASPI" + MetadataID3MetadataKeyBand MetadataKey = "TPE2" + MetadataID3MetadataKeyBeatsPerMinute MetadataKey = "TBPM" + MetadataID3MetadataKeyComments MetadataKey = "COMM" + MetadataID3MetadataKeyCommercial MetadataKey = "COMR" + MetadataID3MetadataKeyCommercialInformation MetadataKey = "WCOM" + MetadataID3MetadataKeyCommerical MetadataKey = "COMR" + MetadataID3MetadataKeyComposer MetadataKey = "TCOM" + MetadataID3MetadataKeyConductor MetadataKey = "TPE3" + MetadataID3MetadataKeyContentGroupDescription MetadataKey = "TIT1" + MetadataID3MetadataKeyContentType MetadataKey = "TCON" + MetadataID3MetadataKeyCopyright MetadataKey = "TCOP" + MetadataID3MetadataKeyCopyrightInformation MetadataKey = "WCOP" + MetadataID3MetadataKeyDate MetadataKey = "TDAT" + MetadataID3MetadataKeyEncodedBy MetadataKey = "TENC" + MetadataID3MetadataKeyEncodedWith MetadataKey = "TSSE" + MetadataID3MetadataKeyEncodingTime MetadataKey = "TDEN" + MetadataID3MetadataKeyEncryption MetadataKey = "ENCR" + MetadataID3MetadataKeyEqualization MetadataKey = "EQUA" + MetadataID3MetadataKeyEqualization2 MetadataKey = "EQU2" + MetadataID3MetadataKeyEventTimingCodes MetadataKey = "ETCO" + MetadataID3MetadataKeyFileOwner MetadataKey = "TOWN" + MetadataID3MetadataKeyFileType MetadataKey = "TFLT" + MetadataID3MetadataKeyGeneralEncapsulatedObject MetadataKey = "GEOB" + MetadataID3MetadataKeyGroupIdentifier MetadataKey = "GRID" + MetadataID3MetadataKeyInitialKey MetadataKey = "TKEY" + MetadataID3MetadataKeyInternationalStandardRecordingCode MetadataKey = "TSRC" + MetadataID3MetadataKeyInternetRadioStationName MetadataKey = "TRSN" + MetadataID3MetadataKeyInternetRadioStationOwner MetadataKey = "TRSO" + MetadataID3MetadataKeyInvolvedPeopleList_v23 MetadataKey = "IPLS" + MetadataID3MetadataKeyInvolvedPeopleList_v24 MetadataKey = "TIPL" + MetadataID3MetadataKeyLanguage MetadataKey = "TLAN" + MetadataID3MetadataKeyLeadPerformer MetadataKey = "TPE1" + MetadataID3MetadataKeyLength MetadataKey = "TLEN" + MetadataID3MetadataKeyLink MetadataKey = "LINK" + MetadataID3MetadataKeyLyricist MetadataKey = "TEXT" + MetadataID3MetadataKeyMPEGLocationLookupTable MetadataKey = "MLLT" + MetadataID3MetadataKeyMediaType MetadataKey = "TMED" + MetadataID3MetadataKeyModifiedBy MetadataKey = "TPE4" + MetadataID3MetadataKeyMood MetadataKey = "TMOO" + MetadataID3MetadataKeyMusicCDIdentifier MetadataKey = "MCDI" + MetadataID3MetadataKeyMusicianCreditsList MetadataKey = "TMCL" + MetadataID3MetadataKeyOfficialArtistWebpage MetadataKey = "WOAR" + MetadataID3MetadataKeyOfficialAudioFileWebpage MetadataKey = "WOAF" + MetadataID3MetadataKeyOfficialAudioSourceWebpage MetadataKey = "WOAS" + MetadataID3MetadataKeyOfficialInternetRadioStationHomepage MetadataKey = "WORS" + MetadataID3MetadataKeyOfficialPublisherWebpage MetadataKey = "WPUB" + MetadataID3MetadataKeyOriginalAlbumTitle MetadataKey = "TOAL" + MetadataID3MetadataKeyOriginalArtist MetadataKey = "TOPE" + MetadataID3MetadataKeyOriginalFilename MetadataKey = "TOFN" + MetadataID3MetadataKeyOriginalLyricist MetadataKey = "TOLY" + MetadataID3MetadataKeyOriginalReleaseTime MetadataKey = "TDOR" + MetadataID3MetadataKeyOriginalReleaseYear MetadataKey = "TORY" + MetadataID3MetadataKeyOwnership MetadataKey = "OWNE" + MetadataID3MetadataKeyPartOfASet MetadataKey = "TPOS" + MetadataID3MetadataKeyPayment MetadataKey = "WPAY" + MetadataID3MetadataKeyPerformerSortOrder MetadataKey = "TSOP" + MetadataID3MetadataKeyPlayCounter MetadataKey = "PCNT" + MetadataID3MetadataKeyPlaylistDelay MetadataKey = "TDLY" + MetadataID3MetadataKeyPopularimeter MetadataKey = "POPM" + MetadataID3MetadataKeyPositionSynchronization MetadataKey = "POSS" + MetadataID3MetadataKeyPrivate MetadataKey = "PRIV" + MetadataID3MetadataKeyProducedNotice MetadataKey = "TPRO" + MetadataID3MetadataKeyPublisher MetadataKey = "TPUB" + MetadataID3MetadataKeyRecommendedBufferSize MetadataKey = "RBUF" + MetadataID3MetadataKeyRecordingDates MetadataKey = "TRDA" + MetadataID3MetadataKeyRecordingTime MetadataKey = "TDRC" + MetadataID3MetadataKeyRelativeVolumeAdjustment MetadataKey = "RVAD" + MetadataID3MetadataKeyRelativeVolumeAdjustment2 MetadataKey = "RVA2" + MetadataID3MetadataKeyReleaseTime MetadataKey = "TDRL" + MetadataID3MetadataKeyReverb MetadataKey = "RVRB" + MetadataID3MetadataKeySeek MetadataKey = "SEEK" + MetadataID3MetadataKeySetSubtitle MetadataKey = "TSST" + MetadataID3MetadataKeySignature MetadataKey = "SIGN" + MetadataID3MetadataKeySize MetadataKey = "TSIZ" + MetadataID3MetadataKeySubTitle MetadataKey = "TIT3" + MetadataID3MetadataKeySynchronizedLyric MetadataKey = "SYLT" + MetadataID3MetadataKeySynchronizedTempoCodes MetadataKey = "SYTC" + MetadataID3MetadataKeyTaggingTime MetadataKey = "TDTG" + MetadataID3MetadataKeyTermsOfUse MetadataKey = "USER" + MetadataID3MetadataKeyTime MetadataKey = "TIME" + MetadataID3MetadataKeyTitleDescription MetadataKey = "TIT2" + MetadataID3MetadataKeyTitleSortOrder MetadataKey = "TSOT" + MetadataID3MetadataKeyTrackNumber MetadataKey = "TRCK" + MetadataID3MetadataKeyUniqueFileIdentifier MetadataKey = "UFID" + MetadataID3MetadataKeyUnsynchronizedLyric MetadataKey = "USLT" + MetadataID3MetadataKeyUserText MetadataKey = "TXXX" + MetadataID3MetadataKeyUserURL MetadataKey = "WXXX" + MetadataID3MetadataKeyYear MetadataKey = "TYER" + MetadataISOUserDataKeyAccessibilityDescription MetadataKey = "ades" + MetadataISOUserDataKeyCopyright MetadataKey = "cprt" + MetadataISOUserDataKeyDate MetadataKey = "date" + MetadataISOUserDataKeyTaggedCharacteristic MetadataKey = "tagc" + MetadataIcyMetadataKeyStreamTitle MetadataKey = "StreamTitle" + MetadataIcyMetadataKeyStreamURL MetadataKey = "StreamUrl" + MetadataQuickTimeMetadataKeyAccessibilityDescription MetadataKey = "com.apple.quicktime.accessibility.description" + MetadataQuickTimeMetadataKeyAlbum MetadataKey = "com.apple.quicktime.album" + MetadataQuickTimeMetadataKeyArranger MetadataKey = "com.apple.quicktime.arranger" + MetadataQuickTimeMetadataKeyArtist MetadataKey = "com.apple.quicktime.artist" + MetadataQuickTimeMetadataKeyArtwork MetadataKey = "com.apple.quicktime.artwork" + MetadataQuickTimeMetadataKeyAuthor MetadataKey = "com.apple.quicktime.author" + MetadataQuickTimeMetadataKeyCameraFrameReadoutTime MetadataKey = "com.apple.quicktime.camera.framereadouttimeinmicroseconds" + MetadataQuickTimeMetadataKeyCameraIdentifier MetadataKey = "com.apple.quicktime.camera.identifier" + MetadataQuickTimeMetadataKeyCollectionUser MetadataKey = "com.apple.quicktime.collection.user" + MetadataQuickTimeMetadataKeyComment MetadataKey = "com.apple.quicktime.comment" + MetadataQuickTimeMetadataKeyComposer MetadataKey = "com.apple.quicktime.composer" + MetadataQuickTimeMetadataKeyContentIdentifier MetadataKey = "com.apple.quicktime.content.identifier" + MetadataQuickTimeMetadataKeyCopyright MetadataKey = "com.apple.quicktime.copyright" + MetadataQuickTimeMetadataKeyCreationDate MetadataKey = "com.apple.quicktime.creationdate" + MetadataQuickTimeMetadataKeyCredits MetadataKey = "com.apple.quicktime.credits" + MetadataQuickTimeMetadataKeyDescription MetadataKey = "com.apple.quicktime.description" + MetadataQuickTimeMetadataKeyDirectionFacing MetadataKey = "com.apple.quicktime.direction.facing" + MetadataQuickTimeMetadataKeyDirectionMotion MetadataKey = "com.apple.quicktime.direction.motion" + MetadataQuickTimeMetadataKeyDirector MetadataKey = "com.apple.quicktime.director" + MetadataQuickTimeMetadataKeyDisplayName MetadataKey = "com.apple.quicktime.displayname" + MetadataQuickTimeMetadataKeyEncodedBy MetadataKey = "com.apple.quicktime.encodedby" + MetadataQuickTimeMetadataKeyGenre MetadataKey = "com.apple.quicktime.genre" + MetadataQuickTimeMetadataKeyInformation MetadataKey = "com.apple.quicktime.information" + MetadataQuickTimeMetadataKeyIsMontage MetadataKey = "com.apple.quicktime.is-montage" + MetadataQuickTimeMetadataKeyKeywords MetadataKey = "com.apple.quicktime.keywords" + MetadataQuickTimeMetadataKeyLocationBody MetadataKey = "com.apple.quicktime.location.body" + MetadataQuickTimeMetadataKeyLocationDate MetadataKey = "com.apple.quicktime.location.date" + MetadataQuickTimeMetadataKeyLocationISO6709 MetadataKey = "com.apple.quicktime.location.ISO6709" + MetadataQuickTimeMetadataKeyLocationName MetadataKey = "com.apple.quicktime.location.name" + MetadataQuickTimeMetadataKeyLocationNote MetadataKey = "com.apple.quicktime.location.note" + MetadataQuickTimeMetadataKeyLocationRole MetadataKey = "com.apple.quicktime.location.role" + MetadataQuickTimeMetadataKeyMake MetadataKey = "com.apple.quicktime.make" + MetadataQuickTimeMetadataKeyModel MetadataKey = "com.apple.quicktime.model" + MetadataQuickTimeMetadataKeyOriginalArtist MetadataKey = "com.apple.quicktime.originalartist" + MetadataQuickTimeMetadataKeyPerformer MetadataKey = "com.apple.quicktime.performer" + MetadataQuickTimeMetadataKeyPhonogramRights MetadataKey = "com.apple.quicktime.phonogramrights" + MetadataQuickTimeMetadataKeyProducer MetadataKey = "com.apple.quicktime.producer" + MetadataQuickTimeMetadataKeyPublisher MetadataKey = "com.apple.quicktime.publisher" + MetadataQuickTimeMetadataKeyRatingUser MetadataKey = "com.apple.quicktime.rating.user" + MetadataQuickTimeMetadataKeySoftware MetadataKey = "com.apple.quicktime.software" + MetadataQuickTimeMetadataKeyTitle MetadataKey = "com.apple.quicktime.title" + MetadataQuickTimeMetadataKeyYear MetadataKey = "com.apple.quicktime.year" + MetadataQuickTimeMetadataKeyiXML MetadataKey = "info.ixml.xml" + MetadataQuickTimeUserDataKeyAccessibilityDescription MetadataKey = "@ade" + MetadataQuickTimeUserDataKeyAlbum MetadataKey = "@alb" + MetadataQuickTimeUserDataKeyArranger MetadataKey = "@arg" + MetadataQuickTimeUserDataKeyArtist MetadataKey = "@ART" + MetadataQuickTimeUserDataKeyAuthor MetadataKey = "@aut" + MetadataQuickTimeUserDataKeyChapter MetadataKey = "@chp" + MetadataQuickTimeUserDataKeyComment MetadataKey = "@cmt" + MetadataQuickTimeUserDataKeyComposer MetadataKey = "@com" + MetadataQuickTimeUserDataKeyCopyright MetadataKey = "@cpy" + MetadataQuickTimeUserDataKeyCreationDate MetadataKey = "@day" + MetadataQuickTimeUserDataKeyCredits MetadataKey = "@src" + MetadataQuickTimeUserDataKeyDescription MetadataKey = "@des" + MetadataQuickTimeUserDataKeyDirector MetadataKey = "@dir" + MetadataQuickTimeUserDataKeyDisclaimer MetadataKey = "@dis" + MetadataQuickTimeUserDataKeyEncodedBy MetadataKey = "@enc" + MetadataQuickTimeUserDataKeyFullName MetadataKey = "@nam" + MetadataQuickTimeUserDataKeyGenre MetadataKey = "@gen" + MetadataQuickTimeUserDataKeyHostComputer MetadataKey = "@hst" + MetadataQuickTimeUserDataKeyInformation MetadataKey = "@inf" + MetadataQuickTimeUserDataKeyKeywords MetadataKey = "@key" + MetadataQuickTimeUserDataKeyLocationISO6709 MetadataKey = "@xyz" + MetadataQuickTimeUserDataKeyMake MetadataKey = "@mak" + MetadataQuickTimeUserDataKeyModel MetadataKey = "@mod" + MetadataQuickTimeUserDataKeyOriginalArtist MetadataKey = "@ope" + MetadataQuickTimeUserDataKeyOriginalFormat MetadataKey = "@fmt" + MetadataQuickTimeUserDataKeyOriginalSource MetadataKey = "@src" + MetadataQuickTimeUserDataKeyPerformers MetadataKey = "@prf" + MetadataQuickTimeUserDataKeyPhonogramRights MetadataKey = "@phg" + MetadataQuickTimeUserDataKeyProducer MetadataKey = "@prd" + MetadataQuickTimeUserDataKeyProduct MetadataKey = "@PRD" + MetadataQuickTimeUserDataKeyPublisher MetadataKey = "@pub" + MetadataQuickTimeUserDataKeySoftware MetadataKey = "@swr" + MetadataQuickTimeUserDataKeySpecialPlaybackRequirements MetadataKey = "@req" + MetadataQuickTimeUserDataKeyTaggedCharacteristic MetadataKey = "tagc" + MetadataQuickTimeUserDataKeyTrack MetadataKey = "@trk" + MetadataQuickTimeUserDataKeyTrackName MetadataKey = "tnam" + MetadataQuickTimeUserDataKeyURLLink MetadataKey = "@url" + MetadataQuickTimeUserDataKeyWarning MetadataKey = "@wrn" + MetadataQuickTimeUserDataKeyWriter MetadataKey = "@wrt" + MetadataiTunesMetadataKeyAccountKind MetadataKey = "akID" + MetadataiTunesMetadataKeyAcknowledgement MetadataKey = "@cak" + MetadataiTunesMetadataKeyAlbum MetadataKey = "@alb" + MetadataiTunesMetadataKeyAlbumArtist MetadataKey = "aART" + MetadataiTunesMetadataKeyAppleID MetadataKey = "apID" + MetadataiTunesMetadataKeyArranger MetadataKey = "@arg" + MetadataiTunesMetadataKeyArtDirector MetadataKey = "@ard" + MetadataiTunesMetadataKeyArtist MetadataKey = "@ART" + MetadataiTunesMetadataKeyArtistID MetadataKey = "atID" + MetadataiTunesMetadataKeyAuthor MetadataKey = "@aut" + MetadataiTunesMetadataKeyBeatsPerMin MetadataKey = "tmpo" + MetadataiTunesMetadataKeyComposer MetadataKey = "@wrt" + MetadataiTunesMetadataKeyConductor MetadataKey = "@con" + MetadataiTunesMetadataKeyContentRating MetadataKey = "rtng" + MetadataiTunesMetadataKeyCopyright MetadataKey = "cprt" + MetadataiTunesMetadataKeyCoverArt MetadataKey = "covr" + MetadataiTunesMetadataKeyCredits MetadataKey = "@src" + MetadataiTunesMetadataKeyDescription MetadataKey = "@des" + MetadataiTunesMetadataKeyDirector MetadataKey = "@dir" + MetadataiTunesMetadataKeyDiscCompilation MetadataKey = "cpil" + MetadataiTunesMetadataKeyDiscNumber MetadataKey = "disk" + MetadataiTunesMetadataKeyEQ MetadataKey = "@equ" + MetadataiTunesMetadataKeyEncodedBy MetadataKey = "@enc" + MetadataiTunesMetadataKeyEncodingTool MetadataKey = "@too" + MetadataiTunesMetadataKeyExecProducer MetadataKey = "@xpd" + MetadataiTunesMetadataKeyGenreID MetadataKey = "geID" + MetadataiTunesMetadataKeyGrouping MetadataKey = "grup" + MetadataiTunesMetadataKeyLinerNotes MetadataKey = "@lnt" + MetadataiTunesMetadataKeyLyrics MetadataKey = "@lyr" + MetadataiTunesMetadataKeyOnlineExtras MetadataKey = "@url" + MetadataiTunesMetadataKeyOriginalArtist MetadataKey = "@ope" + MetadataiTunesMetadataKeyPerformer MetadataKey = "@prf" + MetadataiTunesMetadataKeyPhonogramRights MetadataKey = "@phg" + MetadataiTunesMetadataKeyPlaylistID MetadataKey = "plID" + MetadataiTunesMetadataKeyPredefinedGenre MetadataKey = "gnre" + MetadataiTunesMetadataKeyProducer MetadataKey = "@prd" + MetadataiTunesMetadataKeyPublisher MetadataKey = "@pub" + MetadataiTunesMetadataKeyRecordCompany MetadataKey = "@mak" + MetadataiTunesMetadataKeyReleaseDate MetadataKey = "@day" + MetadataiTunesMetadataKeySoloist MetadataKey = "@sol" + MetadataiTunesMetadataKeySongID MetadataKey = "cnID" + MetadataiTunesMetadataKeySongName MetadataKey = "@nam" + MetadataiTunesMetadataKeySoundEngineer MetadataKey = "@sne" + MetadataiTunesMetadataKeyThanks MetadataKey = "@thx" + MetadataiTunesMetadataKeyTrackNumber MetadataKey = "trkn" + MetadataiTunesMetadataKeyTrackSubTitle MetadataKey = "@st3" + MetadataiTunesMetadataKeyUserComment MetadataKey = "@cmt" + MetadataiTunesMetadataKeyUserGenre MetadataKey = "@gen" +) + +// A structure that defines a metadata key space. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatakeyspace?language=objc +type MetadataKeySpace string + +const ( + MetadataKeySpaceAudioFile MetadataKeySpace = "caaf" + MetadataKeySpaceCommon MetadataKeySpace = "comn" + MetadataKeySpaceHLSDateRange MetadataKeySpace = "lsdr" + MetadataKeySpaceID3 MetadataKeySpace = "org.id3" + MetadataKeySpaceISOUserData MetadataKeySpace = "uiso" + MetadataKeySpaceIcy MetadataKeySpace = "icy" + MetadataKeySpaceQuickTimeMetadata MetadataKeySpace = "mdta" + MetadataKeySpaceQuickTimeUserData MetadataKeySpace = "udta" + MetadataKeySpaceiTunes MetadataKeySpace = "itsk" +) + +// Constants that identify metadata object types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataobjecttype?language=objc +type MetadataObjectType string + +const ( + MetadataObjectTypeAztecCode MetadataObjectType = "org.iso.Aztec" + MetadataObjectTypeCatBody MetadataObjectType = "catBody" + MetadataObjectTypeCode128Code MetadataObjectType = "org.iso.Code128" + MetadataObjectTypeCode39Code MetadataObjectType = "org.iso.Code39" + MetadataObjectTypeCode39Mod43Code MetadataObjectType = "org.iso.Code39Mod43" + MetadataObjectTypeCode93Code MetadataObjectType = "com.intermec.Code93" + MetadataObjectTypeDataMatrixCode MetadataObjectType = "org.iso.DataMatrix" + MetadataObjectTypeDogBody MetadataObjectType = "dogBody" + MetadataObjectTypeEAN13Code MetadataObjectType = "org.gs1.EAN-13" + MetadataObjectTypeEAN8Code MetadataObjectType = "org.gs1.EAN-8" + MetadataObjectTypeFace MetadataObjectType = "face" + MetadataObjectTypeHumanBody MetadataObjectType = "humanBody" + MetadataObjectTypeITF14Code MetadataObjectType = "org.gs1.ITF14" + MetadataObjectTypeInterleaved2of5Code MetadataObjectType = "org.ansi.Interleaved2of5" + MetadataObjectTypePDF417Code MetadataObjectType = "org.iso.PDF417" + MetadataObjectTypeQRCode MetadataObjectType = "org.iso.QRCode" + MetadataObjectTypeSalientObject MetadataObjectType = "salientObject" + MetadataObjectTypeUPCECode MetadataObjectType = "org.gs1.UPC-E" +) + +// A structure that defines options to control the writing of a movie header to a destination URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmoviewritingoptions?language=objc +type MovieWritingOptions uint + +const ( + MovieWritingAddMovieHeaderToDestination MovieWritingOptions = 0 + MovieWritingTruncateDestinationToMovieHeaderOnly MovieWritingOptions = 1 +) + +// A structure that defines preset configurations for an output settings assistant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingspreset?language=objc +type OutputSettingsPreset string + +const ( + OutputSettingsPreset1280x720 OutputSettingsPreset = "AVOutputSettingsPreset1280x720" + OutputSettingsPreset1920x1080 OutputSettingsPreset = "AVOutputSettingsPreset1920x1080" + OutputSettingsPreset3840x2160 OutputSettingsPreset = "AVOutputSettingsPreset3840x2160" + OutputSettingsPreset640x480 OutputSettingsPreset = "AVOutputSettingsPreset640x480" + OutputSettingsPreset960x540 OutputSettingsPreset = "AVOutputSettingsPreset960x540" + OutputSettingsPresetHEVC1920x1080 OutputSettingsPreset = "AVOutputSettingsPresetHEVC1920x1080" + OutputSettingsPresetHEVC1920x1080WithAlpha OutputSettingsPreset = "AVOutputSettingsPresetHEVC1920x1080WithAlpha" + OutputSettingsPresetHEVC3840x2160 OutputSettingsPreset = "AVOutputSettingsPresetHEVC3840x2160" + OutputSettingsPresetHEVC3840x2160WithAlpha OutputSettingsPreset = "AVOutputSettingsPresetHEVC3840x2160WithAlpha" +) + +// The actions a player can take when it finishes playing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeractionatitemend?language=objc +type PlayerActionAtItemEnd int + +const ( + PlayerActionAtItemEndAdvance PlayerActionAtItemEnd = 0 + PlayerActionAtItemEndNone PlayerActionAtItemEnd = 2 + PlayerActionAtItemEndPause PlayerActionAtItemEnd = 1 +) + +// Policies that describe playback behavior when an app transitions to the background while playing video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeraudiovisualbackgroundplaybackpolicy?language=objc +type PlayerAudiovisualBackgroundPlaybackPolicy int + +const ( + PlayerAudiovisualBackgroundPlaybackPolicyAutomatic PlayerAudiovisualBackgroundPlaybackPolicy = 1 + PlayerAudiovisualBackgroundPlaybackPolicyContinuesIfPossible PlayerAudiovisualBackgroundPlaybackPolicy = 3 + PlayerAudiovisualBackgroundPlaybackPolicyPauses PlayerAudiovisualBackgroundPlaybackPolicy = 2 +) + +// Constants that define restrictions on the playback of interstitial content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventrestrictions?language=objc +type PlayerInterstitialEventRestrictions uint + +const ( + PlayerInterstitialEventRestrictionConstrainsSeekingForwardInPrimaryContent PlayerInterstitialEventRestrictions = 1 + PlayerInterstitialEventRestrictionDefaultPolicy PlayerInterstitialEventRestrictions = 0 + PlayerInterstitialEventRestrictionNone PlayerInterstitialEventRestrictions = 0 + PlayerInterstitialEventRestrictionRequiresPlaybackAtPreferredRateForAdvancement PlayerInterstitialEventRestrictions = 4 +) + +// A text styling resolution. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutputtextstylingresolution?language=objc +type PlayerItemLegibleOutputTextStylingResolution string + +const ( + PlayerItemLegibleOutputTextStylingResolutionDefault PlayerItemLegibleOutputTextStylingResolution = "AVPlayerItemLegibleOutputTextStylingResolutionDefault" + PlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly PlayerItemLegibleOutputTextStylingResolution = "AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly" +) + +// The statuses for a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemstatus?language=objc +type PlayerItemStatus int + +const ( + PlayerItemStatusFailed PlayerItemStatus = 2 + PlayerItemStatusReadyToPlay PlayerItemStatus = 1 + PlayerItemStatusUnknown PlayerItemStatus = 0 +) + +// Status constants that indicate whether a looper can successfully perform looping playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooperstatus?language=objc +type PlayerLooperStatus int + +const ( + PlayerLooperStatusCancelled PlayerLooperStatus = 3 + PlayerLooperStatusFailed PlayerLooperStatus = 2 + PlayerLooperStatusReady PlayerLooperStatus = 1 + PlayerLooperStatusUnknown PlayerLooperStatus = 0 +) + +// A structure that represents a rate change reason. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerratedidchangereason?language=objc +type PlayerRateDidChangeReason string + +const ( + PlayerRateDidChangeReasonAppBackgrounded PlayerRateDidChangeReason = "AVPlayerRateDidChangeReasonAppBackgrounded" + PlayerRateDidChangeReasonAudioSessionInterrupted PlayerRateDidChangeReason = "AVPlayerRateDidChangeReasonAudioSessionInterrupted" + PlayerRateDidChangeReasonSetRateCalled PlayerRateDidChangeReason = "AVPlayerRateDidChangeReasonSetRateCalled" + PlayerRateDidChangeReasonSetRateFailed PlayerRateDidChangeReason = "AVPlayerRateDidChangeReasonSetRateFailed" +) + +// Status values that indicate whether a player can successfully play media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerstatus?language=objc +type PlayerStatus int + +const ( + PlayerStatusFailed PlayerStatus = 2 + PlayerStatusReadyToPlay PlayerStatus = 1 + PlayerStatusUnknown PlayerStatus = 0 +) + +// Constants that indicate the state of playback control. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayertimecontrolstatus?language=objc +type PlayerTimeControlStatus int + +const ( + PlayerTimeControlStatusPaused PlayerTimeControlStatus = 0 + PlayerTimeControlStatusPlaying PlayerTimeControlStatus = 2 + PlayerTimeControlStatusWaitingToPlayAtSpecifiedRate PlayerTimeControlStatus = 1 +) + +// The reasons a player is waiting to begin or resume playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerwaitingreason?language=objc +type PlayerWaitingReason string + +const ( + PlayerWaitingDuringInterstitialEventReason PlayerWaitingReason = "AVPlayerWaitingDuringInterstitialEventReason" + PlayerWaitingForCoordinatedPlaybackReason PlayerWaitingReason = "AVPlayerWaitingForCoordinatedPlaybackReason" + PlayerWaitingToMinimizeStallsReason PlayerWaitingReason = "AVPlayerWaitingToMinimizeStallsReason" + PlayerWaitingWhileEvaluatingBufferingRateReason PlayerWaitingReason = "AVPlayerWaitingWhileEvaluatingBufferingRateReason" + PlayerWaitingWithNoItemToPlayReason PlayerWaitingReason = "AVPlayerWaitingWithNoItemToPlayReason" +) + +// The statuses for sample buffer rendering. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrenderingstatus?language=objc +type QueuedSampleBufferRenderingStatus int + +const ( + QueuedSampleBufferRenderingStatusFailed QueuedSampleBufferRenderingStatus = 2 + QueuedSampleBufferRenderingStatusRendering QueuedSampleBufferRenderingStatus = 1 + QueuedSampleBufferRenderingStatusUnknown QueuedSampleBufferRenderingStatus = 0 +) + +// The modes that describe the buffer request direction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequestdirection?language=objc +type SampleBufferRequestDirection int + +const ( + SampleBufferRequestDirectionForward SampleBufferRequestDirection = 1 + SampleBufferRequestDirectionNone SampleBufferRequestDirection = 0 + SampleBufferRequestDirectionReverse SampleBufferRequestDirection = -1 +) + +// The modes in which a sample buffer generator processes a request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequestmode?language=objc +type SampleBufferRequestMode int + +const ( + SampleBufferRequestModeImmediate SampleBufferRequestMode = 0 + SampleBufferRequestModeOpportunistic SampleBufferRequestMode = 2 + SampleBufferRequestModeScheduled SampleBufferRequestMode = 1 +) + +// String constants defining the types of segmentation matte images that you can capture along with the primary image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmattetype?language=objc +type SemanticSegmentationMatteType string + +const ( + SemanticSegmentationMatteTypeGlasses SemanticSegmentationMatteType = "AVSemanticSegmentationMatteTypeGlasses" + SemanticSegmentationMatteTypeHair SemanticSegmentationMatteType = "AVSemanticSegmentationMatteTypeHair" + SemanticSegmentationMatteTypeSkin SemanticSegmentationMatteType = "AVSemanticSegmentationMatteTypeSkin" + SemanticSegmentationMatteTypeTeeth SemanticSegmentationMatteType = "AVSemanticSegmentationMatteTypeTeeth" +) + +// Constants that define track association types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtrackassociationtype?language=objc +type TrackAssociationType string + +const ( + TrackAssociationTypeAudioFallback TrackAssociationType = "fall" + TrackAssociationTypeChapterList TrackAssociationType = "chap" + TrackAssociationTypeForcedSubtitlesOnly TrackAssociationType = "forc" + TrackAssociationTypeMetadataReferent TrackAssociationType = "cdsc" + TrackAssociationTypeSelectionFollower TrackAssociationType = "folw" + TrackAssociationTypeTimecode TrackAssociationType = "tmcd" +) + +// Defines the preferences the player item uses when selecting variant playlists. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvariantpreferences?language=objc +type VariantPreferences uint + +const ( + VariantPreferenceNone VariantPreferences = 0 + VariantPreferenceScalabilityToLosslessAudio VariantPreferences = 1 +) + +// A value that describes how a video is scaled or cropped. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideoaperturemode?language=objc +type VideoApertureMode string + +const ( + VideoApertureModeCleanAperture VideoApertureMode = "CleanAperture" + VideoApertureModeEncodedPixels VideoApertureMode = "EncodedPixels" + VideoApertureModeProductionAperture VideoApertureMode = "ProductionAperture" +) + +// A set of constants describing the codecs that the system supports for video capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocodectype?language=objc +type VideoCodecType string + +const ( + VideoCodecTypeAppleProRes422 VideoCodecType = "apcn" + VideoCodecTypeAppleProRes422HQ VideoCodecType = "apch" + VideoCodecTypeAppleProRes422LT VideoCodecType = "apcs" + VideoCodecTypeAppleProRes422Proxy VideoCodecType = "apco" + VideoCodecTypeAppleProRes4444 VideoCodecType = "ap4h" + VideoCodecTypeH264 VideoCodecType = "avc1" + VideoCodecTypeHEVC VideoCodecType = "hvc1" + VideoCodecTypeHEVCWithAlpha VideoCodecType = "muxa" + VideoCodecTypeJPEG VideoCodecType = "jpeg" +) + +// Constants that indicate which interlacing modes the connection applies to video flowing through it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideofieldmode?language=objc +type VideoFieldMode int + +const ( + VideoFieldModeBoth VideoFieldMode = 0 + VideoFieldModeBottomOnly VideoFieldMode = 2 + VideoFieldModeDeinterlace VideoFieldMode = 3 + VideoFieldModeTopOnly VideoFieldMode = 1 +) + +// Constants that describe a video variant’s dynamic range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideorange?language=objc +type VideoRange string + +const ( + VideoRangeHLG VideoRange = "AVVideoRangeHLG" + VideoRangePQ VideoRange = "AVVideoRangePQ" + VideoRangeSDR VideoRange = "AVVideoRangeSDR" +) diff --git a/macos/avfoundation/fragment_minding.gen.go b/macos/avfoundation/fragment_minding.gen.go new file mode 100644 index 00000000..3dea5221 --- /dev/null +++ b/macos/avfoundation/fragment_minding.gen.go @@ -0,0 +1,33 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines whether an asset supports fragment minding. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentminding?language=objc +type PFragmentMinding interface { + // optional + IsAssociatedWithFragmentMinder() bool + HasIsAssociatedWithFragmentMinder() bool +} + +// A concrete type wrapper for the [PFragmentMinding] protocol. +type FragmentMindingWrapper struct { + objc.Object +} + +func (f_ FragmentMindingWrapper) HasIsAssociatedWithFragmentMinder() bool { + return f_.RespondsToSelector(objc.Sel("isAssociatedWithFragmentMinder")) +} + +// A Boolean value that indicates whether an asset that supports fragment minding is currently associated with a fragment minder. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentminding/1390175-associatedwithfragmentminder?language=objc +func (f_ FragmentMindingWrapper) IsAssociatedWithFragmentMinder() bool { + rv := objc.Call[bool](f_, objc.Sel("isAssociatedWithFragmentMinder")) + return rv +} diff --git a/macos/avfoundation/fragmented_asset.gen.go b/macos/avfoundation/fragmented_asset.gen.go new file mode 100644 index 00000000..ba66c1f9 --- /dev/null +++ b/macos/avfoundation/fragmented_asset.gen.go @@ -0,0 +1,109 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FragmentedAsset] class. +var FragmentedAssetClass = _FragmentedAssetClass{objc.GetClass("AVFragmentedAsset")} + +type _FragmentedAssetClass struct { + objc.Class +} + +// An interface definition for the [FragmentedAsset] class. +type IFragmentedAsset interface { + IURLAsset +} + +// An asset with a duration that the system can extend without modifying its existing media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedasset?language=objc +type FragmentedAsset struct { + URLAsset +} + +func FragmentedAssetFrom(ptr unsafe.Pointer) FragmentedAsset { + return FragmentedAsset{ + URLAsset: URLAssetFrom(ptr), + } +} + +func (fc _FragmentedAssetClass) FragmentedAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedAsset { + rv := objc.Call[FragmentedAsset](fc, objc.Sel("fragmentedAssetWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Creates a fragmented asset for the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedasset/1508700-fragmentedassetwithurl?language=objc +func FragmentedAsset_FragmentedAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedAsset { + return FragmentedAssetClass.FragmentedAssetWithURLOptions(URL, options) +} + +func (fc _FragmentedAssetClass) Alloc() FragmentedAsset { + rv := objc.Call[FragmentedAsset](fc, objc.Sel("alloc")) + return rv +} + +func FragmentedAsset_Alloc() FragmentedAsset { + return FragmentedAssetClass.Alloc() +} + +func (fc _FragmentedAssetClass) New() FragmentedAsset { + rv := objc.Call[FragmentedAsset](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFragmentedAsset() FragmentedAsset { + return FragmentedAssetClass.New() +} + +func (f_ FragmentedAsset) Init() FragmentedAsset { + rv := objc.Call[FragmentedAsset](f_, objc.Sel("init")) + return rv +} + +func (fc _FragmentedAssetClass) URLAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedAsset { + rv := objc.Call[FragmentedAsset](fc, objc.Sel("URLAssetWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Returns an asset that models the media resource found at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1508727-urlassetwithurl?language=objc +func FragmentedAsset_URLAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedAsset { + return FragmentedAssetClass.URLAssetWithURLOptions(URL, options) +} + +func (f_ FragmentedAsset) InitWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedAsset { + rv := objc.Call[FragmentedAsset](f_, objc.Sel("initWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Creates an asset that models the media resource at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1385698-initwithurl?language=objc +func NewFragmentedAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedAsset { + instance := FragmentedAssetClass.Alloc().InitWithURLOptions(URL, options) + instance.Autorelease() + return instance +} + +func (fc _FragmentedAssetClass) AssetWithURL(URL foundation.IURL) FragmentedAsset { + rv := objc.Call[FragmentedAsset](fc, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func FragmentedAsset_AssetWithURL(URL foundation.IURL) FragmentedAsset { + return FragmentedAssetClass.AssetWithURL(URL) +} diff --git a/macos/avfoundation/fragmented_asset_minder.gen.go b/macos/avfoundation/fragmented_asset_minder.gen.go new file mode 100644 index 00000000..870279b1 --- /dev/null +++ b/macos/avfoundation/fragmented_asset_minder.gen.go @@ -0,0 +1,127 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FragmentedAssetMinder] class. +var FragmentedAssetMinderClass = _FragmentedAssetMinderClass{objc.GetClass("AVFragmentedAssetMinder")} + +type _FragmentedAssetMinderClass struct { + objc.Class +} + +// An interface definition for the [FragmentedAssetMinder] class. +type IFragmentedAssetMinder interface { + objc.IObject + AddFragmentedAsset(asset IAsset) + RemoveFragmentedAsset(asset IAsset) + MindingInterval() foundation.TimeInterval + SetMindingInterval(value foundation.TimeInterval) + Assets() []Asset +} + +// An object that periodically checks whether the system adds new fragments to a fragmented asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder?language=objc +type FragmentedAssetMinder struct { + objc.Object +} + +func FragmentedAssetMinderFrom(ptr unsafe.Pointer) FragmentedAssetMinder { + return FragmentedAssetMinder{ + Object: objc.ObjectFrom(ptr), + } +} + +func (fc _FragmentedAssetMinderClass) FragmentedAssetMinderWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedAssetMinder { + rv := objc.Call[FragmentedAssetMinder](fc, objc.Sel("fragmentedAssetMinderWithAsset:mindingInterval:"), objc.Ptr(asset), mindingInterval) + return rv +} + +// Creates a fragmented asset minder containing the specified asset and minding interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/1387182-fragmentedassetminderwithasset?language=objc +func FragmentedAssetMinder_FragmentedAssetMinderWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedAssetMinder { + return FragmentedAssetMinderClass.FragmentedAssetMinderWithAssetMindingInterval(asset, mindingInterval) +} + +func (f_ FragmentedAssetMinder) InitWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedAssetMinder { + rv := objc.Call[FragmentedAssetMinder](f_, objc.Sel("initWithAsset:mindingInterval:"), objc.Ptr(asset), mindingInterval) + return rv +} + +// Creates a fragmented asset minder that monitors the specified asset at the indicated minding interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/2966508-initwithasset?language=objc +func NewFragmentedAssetMinderWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedAssetMinder { + instance := FragmentedAssetMinderClass.Alloc().InitWithAssetMindingInterval(asset, mindingInterval) + instance.Autorelease() + return instance +} + +func (fc _FragmentedAssetMinderClass) Alloc() FragmentedAssetMinder { + rv := objc.Call[FragmentedAssetMinder](fc, objc.Sel("alloc")) + return rv +} + +func FragmentedAssetMinder_Alloc() FragmentedAssetMinder { + return FragmentedAssetMinderClass.Alloc() +} + +func (fc _FragmentedAssetMinderClass) New() FragmentedAssetMinder { + rv := objc.Call[FragmentedAssetMinder](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFragmentedAssetMinder() FragmentedAssetMinder { + return FragmentedAssetMinderClass.New() +} + +func (f_ FragmentedAssetMinder) Init() FragmentedAssetMinder { + rv := objc.Call[FragmentedAssetMinder](f_, objc.Sel("init")) + return rv +} + +// Adds a fragmented asset to the array of minded assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/1387483-addfragmentedasset?language=objc +func (f_ FragmentedAssetMinder) AddFragmentedAsset(asset IAsset) { + objc.Call[objc.Void](f_, objc.Sel("addFragmentedAsset:"), objc.Ptr(asset)) +} + +// Removes a fragmented asset from the array of minded assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/1389856-removefragmentedasset?language=objc +func (f_ FragmentedAssetMinder) RemoveFragmentedAsset(asset IAsset) { + objc.Call[objc.Void](f_, objc.Sel("removeFragmentedAsset:"), objc.Ptr(asset)) +} + +// An interval that specifies when to perform a check for additional fragments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/1390760-mindinginterval?language=objc +func (f_ FragmentedAssetMinder) MindingInterval() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](f_, objc.Sel("mindingInterval")) + return rv +} + +// An interval that specifies when to perform a check for additional fragments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/1390760-mindinginterval?language=objc +func (f_ FragmentedAssetMinder) SetMindingInterval(value foundation.TimeInterval) { + objc.Call[objc.Void](f_, objc.Sel("setMindingInterval:"), value) +} + +// The minded array of fragmented assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/1390319-assets?language=objc +func (f_ FragmentedAssetMinder) Assets() []Asset { + rv := objc.Call[[]Asset](f_, objc.Sel("assets")) + return rv +} diff --git a/macos/avfoundation/fragmented_asset_track.gen.go b/macos/avfoundation/fragmented_asset_track.gen.go new file mode 100644 index 00000000..8779daef --- /dev/null +++ b/macos/avfoundation/fragmented_asset_track.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FragmentedAssetTrack] class. +var FragmentedAssetTrackClass = _FragmentedAssetTrackClass{objc.GetClass("AVFragmentedAssetTrack")} + +type _FragmentedAssetTrackClass struct { + objc.Class +} + +// An interface definition for the [FragmentedAssetTrack] class. +type IFragmentedAssetTrack interface { + IAssetTrack +} + +// An object that provides the track-level interface to inspect a fragmented asset’s media tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassettrack?language=objc +type FragmentedAssetTrack struct { + AssetTrack +} + +func FragmentedAssetTrackFrom(ptr unsafe.Pointer) FragmentedAssetTrack { + return FragmentedAssetTrack{ + AssetTrack: AssetTrackFrom(ptr), + } +} + +func (fc _FragmentedAssetTrackClass) Alloc() FragmentedAssetTrack { + rv := objc.Call[FragmentedAssetTrack](fc, objc.Sel("alloc")) + return rv +} + +func FragmentedAssetTrack_Alloc() FragmentedAssetTrack { + return FragmentedAssetTrackClass.Alloc() +} + +func (fc _FragmentedAssetTrackClass) New() FragmentedAssetTrack { + rv := objc.Call[FragmentedAssetTrack](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFragmentedAssetTrack() FragmentedAssetTrack { + return FragmentedAssetTrackClass.New() +} + +func (f_ FragmentedAssetTrack) Init() FragmentedAssetTrack { + rv := objc.Call[FragmentedAssetTrack](f_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/fragmented_movie.gen.go b/macos/avfoundation/fragmented_movie.gen.go new file mode 100644 index 00000000..00f5e712 --- /dev/null +++ b/macos/avfoundation/fragmented_movie.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FragmentedMovie] class. +var FragmentedMovieClass = _FragmentedMovieClass{objc.GetClass("AVFragmentedMovie")} + +type _FragmentedMovieClass struct { + objc.Class +} + +// An interface definition for the [FragmentedMovie] class. +type IFragmentedMovie interface { + IMovie +} + +// An object that represents a fragmented movie file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovie?language=objc +type FragmentedMovie struct { + Movie +} + +func FragmentedMovieFrom(ptr unsafe.Pointer) FragmentedMovie { + return FragmentedMovie{ + Movie: MovieFrom(ptr), + } +} + +func (fc _FragmentedMovieClass) Alloc() FragmentedMovie { + rv := objc.Call[FragmentedMovie](fc, objc.Sel("alloc")) + return rv +} + +func FragmentedMovie_Alloc() FragmentedMovie { + return FragmentedMovieClass.Alloc() +} + +func (fc _FragmentedMovieClass) New() FragmentedMovie { + rv := objc.Call[FragmentedMovie](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFragmentedMovie() FragmentedMovie { + return FragmentedMovieClass.New() +} + +func (f_ FragmentedMovie) Init() FragmentedMovie { + rv := objc.Call[FragmentedMovie](f_, objc.Sel("init")) + return rv +} + +func (f_ FragmentedMovie) InitWithDataOptions(data []byte, options map[string]objc.IObject) FragmentedMovie { + rv := objc.Call[FragmentedMovie](f_, objc.Sel("initWithData:options:"), data, options) + return rv +} + +// Creates a movie object from a movie file’s data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388090-initwithdata?language=objc +func NewFragmentedMovieWithDataOptions(data []byte, options map[string]objc.IObject) FragmentedMovie { + instance := FragmentedMovieClass.Alloc().InitWithDataOptions(data, options) + instance.Autorelease() + return instance +} + +func (fc _FragmentedMovieClass) MovieWithDataOptions(data []byte, options map[string]objc.IObject) FragmentedMovie { + rv := objc.Call[FragmentedMovie](fc, objc.Sel("movieWithData:options:"), data, options) + return rv +} + +// Returns a new movie object from a movie file’s data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1458261-moviewithdata?language=objc +func FragmentedMovie_MovieWithDataOptions(data []byte, options map[string]objc.IObject) FragmentedMovie { + return FragmentedMovieClass.MovieWithDataOptions(data, options) +} + +func (f_ FragmentedMovie) InitWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedMovie { + rv := objc.Call[FragmentedMovie](f_, objc.Sel("initWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Creates a movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1387923-initwithurl?language=objc +func NewFragmentedMovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedMovie { + instance := FragmentedMovieClass.Alloc().InitWithURLOptions(URL, options) + instance.Autorelease() + return instance +} + +func (fc _FragmentedMovieClass) MovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedMovie { + rv := objc.Call[FragmentedMovie](fc, objc.Sel("movieWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Returns a new movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1458223-moviewithurl?language=objc +func FragmentedMovie_MovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) FragmentedMovie { + return FragmentedMovieClass.MovieWithURLOptions(URL, options) +} + +func (fc _FragmentedMovieClass) AssetWithURL(URL foundation.IURL) FragmentedMovie { + rv := objc.Call[FragmentedMovie](fc, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func FragmentedMovie_AssetWithURL(URL foundation.IURL) FragmentedMovie { + return FragmentedMovieClass.AssetWithURL(URL) +} diff --git a/macos/avfoundation/fragmented_movie_minder.gen.go b/macos/avfoundation/fragmented_movie_minder.gen.go new file mode 100644 index 00000000..49a7c976 --- /dev/null +++ b/macos/avfoundation/fragmented_movie_minder.gen.go @@ -0,0 +1,136 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FragmentedMovieMinder] class. +var FragmentedMovieMinderClass = _FragmentedMovieMinderClass{objc.GetClass("AVFragmentedMovieMinder")} + +type _FragmentedMovieMinderClass struct { + objc.Class +} + +// An interface definition for the [FragmentedMovieMinder] class. +type IFragmentedMovieMinder interface { + IFragmentedAssetMinder + RemoveFragmentedMovie(movie IFragmentedMovie) + AddFragmentedMovie(movie IFragmentedMovie) + Movies() []FragmentedMovie +} + +// An object that checks whether a fragmented movie appends additional movie fragments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovieminder?language=objc +type FragmentedMovieMinder struct { + FragmentedAssetMinder +} + +func FragmentedMovieMinderFrom(ptr unsafe.Pointer) FragmentedMovieMinder { + return FragmentedMovieMinder{ + FragmentedAssetMinder: FragmentedAssetMinderFrom(ptr), + } +} + +func (f_ FragmentedMovieMinder) InitWithMovieMindingInterval(movie IFragmentedMovie, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + rv := objc.Call[FragmentedMovieMinder](f_, objc.Sel("initWithMovie:mindingInterval:"), objc.Ptr(movie), mindingInterval) + return rv +} + +// Creates a movie minder and adds a movie with a minding interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovieminder/1390294-initwithmovie?language=objc +func NewFragmentedMovieMinderWithMovieMindingInterval(movie IFragmentedMovie, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + instance := FragmentedMovieMinderClass.Alloc().InitWithMovieMindingInterval(movie, mindingInterval) + instance.Autorelease() + return instance +} + +func (fc _FragmentedMovieMinderClass) FragmentedMovieMinderWithMovieMindingInterval(movie IFragmentedMovie, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + rv := objc.Call[FragmentedMovieMinder](fc, objc.Sel("fragmentedMovieMinderWithMovie:mindingInterval:"), objc.Ptr(movie), mindingInterval) + return rv +} + +// Creates a movie minder and adds a movie with a minding interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovieminder/1458262-fragmentedmovieminderwithmovie?language=objc +func FragmentedMovieMinder_FragmentedMovieMinderWithMovieMindingInterval(movie IFragmentedMovie, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + return FragmentedMovieMinderClass.FragmentedMovieMinderWithMovieMindingInterval(movie, mindingInterval) +} + +func (fc _FragmentedMovieMinderClass) Alloc() FragmentedMovieMinder { + rv := objc.Call[FragmentedMovieMinder](fc, objc.Sel("alloc")) + return rv +} + +func FragmentedMovieMinder_Alloc() FragmentedMovieMinder { + return FragmentedMovieMinderClass.Alloc() +} + +func (fc _FragmentedMovieMinderClass) New() FragmentedMovieMinder { + rv := objc.Call[FragmentedMovieMinder](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFragmentedMovieMinder() FragmentedMovieMinder { + return FragmentedMovieMinderClass.New() +} + +func (f_ FragmentedMovieMinder) Init() FragmentedMovieMinder { + rv := objc.Call[FragmentedMovieMinder](f_, objc.Sel("init")) + return rv +} + +func (fc _FragmentedMovieMinderClass) FragmentedAssetMinderWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + rv := objc.Call[FragmentedMovieMinder](fc, objc.Sel("fragmentedAssetMinderWithAsset:mindingInterval:"), objc.Ptr(asset), mindingInterval) + return rv +} + +// Creates a fragmented asset minder containing the specified asset and minding interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/1387182-fragmentedassetminderwithasset?language=objc +func FragmentedMovieMinder_FragmentedAssetMinderWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + return FragmentedMovieMinderClass.FragmentedAssetMinderWithAssetMindingInterval(asset, mindingInterval) +} + +func (f_ FragmentedMovieMinder) InitWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + rv := objc.Call[FragmentedMovieMinder](f_, objc.Sel("initWithAsset:mindingInterval:"), objc.Ptr(asset), mindingInterval) + return rv +} + +// Creates a fragmented asset minder that monitors the specified asset at the indicated minding interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder/2966508-initwithasset?language=objc +func NewFragmentedMovieMinderWithAssetMindingInterval(asset IAsset, mindingInterval foundation.TimeInterval) FragmentedMovieMinder { + instance := FragmentedMovieMinderClass.Alloc().InitWithAssetMindingInterval(asset, mindingInterval) + instance.Autorelease() + return instance +} + +// Removes a fragmented movie from the array of movies being minded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovieminder/1389794-removefragmentedmovie?language=objc +func (f_ FragmentedMovieMinder) RemoveFragmentedMovie(movie IFragmentedMovie) { + objc.Call[objc.Void](f_, objc.Sel("removeFragmentedMovie:"), objc.Ptr(movie)) +} + +// Adds a fragmented movie to the array of movies being minded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovieminder/1386171-addfragmentedmovie?language=objc +func (f_ FragmentedMovieMinder) AddFragmentedMovie(movie IFragmentedMovie) { + objc.Call[objc.Void](f_, objc.Sel("addFragmentedMovie:"), objc.Ptr(movie)) +} + +// An array containing the fragmented movie objects being minded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovieminder/1388707-movies?language=objc +func (f_ FragmentedMovieMinder) Movies() []FragmentedMovie { + rv := objc.Call[[]FragmentedMovie](f_, objc.Sel("movies")) + return rv +} diff --git a/macos/avfoundation/fragmented_movie_track.gen.go b/macos/avfoundation/fragmented_movie_track.gen.go new file mode 100644 index 00000000..2ff4564d --- /dev/null +++ b/macos/avfoundation/fragmented_movie_track.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FragmentedMovieTrack] class. +var FragmentedMovieTrackClass = _FragmentedMovieTrackClass{objc.GetClass("AVFragmentedMovieTrack")} + +type _FragmentedMovieTrackClass struct { + objc.Class +} + +// An interface definition for the [FragmentedMovieTrack] class. +type IFragmentedMovieTrack interface { + IMovieTrack +} + +// An object that represents a track in a fragmented movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avfragmentedmovietrack?language=objc +type FragmentedMovieTrack struct { + MovieTrack +} + +func FragmentedMovieTrackFrom(ptr unsafe.Pointer) FragmentedMovieTrack { + return FragmentedMovieTrack{ + MovieTrack: MovieTrackFrom(ptr), + } +} + +func (fc _FragmentedMovieTrackClass) Alloc() FragmentedMovieTrack { + rv := objc.Call[FragmentedMovieTrack](fc, objc.Sel("alloc")) + return rv +} + +func FragmentedMovieTrack_Alloc() FragmentedMovieTrack { + return FragmentedMovieTrackClass.Alloc() +} + +func (fc _FragmentedMovieTrackClass) New() FragmentedMovieTrack { + rv := objc.Call[FragmentedMovieTrack](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFragmentedMovieTrack() FragmentedMovieTrack { + return FragmentedMovieTrackClass.New() +} + +func (f_ FragmentedMovieTrack) Init() FragmentedMovieTrack { + rv := objc.Call[FragmentedMovieTrack](f_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/frame_rate_range.gen.go b/macos/avfoundation/frame_rate_range.gen.go new file mode 100644 index 00000000..e9c9b686 --- /dev/null +++ b/macos/avfoundation/frame_rate_range.gen.go @@ -0,0 +1,95 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FrameRateRange] class. +var FrameRateRangeClass = _FrameRateRangeClass{objc.GetClass("AVFrameRateRange")} + +type _FrameRateRangeClass struct { + objc.Class +} + +// An interface definition for the [FrameRateRange] class. +type IFrameRateRange interface { + objc.IObject + MaxFrameDuration() coremedia.Time + MaxFrameRate() float64 + MinFrameRate() float64 + MinFrameDuration() coremedia.Time +} + +// An immutable type that represents a range of valid frame rates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avframeraterange?language=objc +type FrameRateRange struct { + objc.Object +} + +func FrameRateRangeFrom(ptr unsafe.Pointer) FrameRateRange { + return FrameRateRange{ + Object: objc.ObjectFrom(ptr), + } +} + +func (fc _FrameRateRangeClass) Alloc() FrameRateRange { + rv := objc.Call[FrameRateRange](fc, objc.Sel("alloc")) + return rv +} + +func FrameRateRange_Alloc() FrameRateRange { + return FrameRateRangeClass.Alloc() +} + +func (fc _FrameRateRangeClass) New() FrameRateRange { + rv := objc.Call[FrameRateRange](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFrameRateRange() FrameRateRange { + return FrameRateRangeClass.New() +} + +func (f_ FrameRateRange) Init() FrameRateRange { + rv := objc.Call[FrameRateRange](f_, objc.Sel("init")) + return rv +} + +// The maximum frame duration supported by the range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avframeraterange/1386786-maxframeduration?language=objc +func (f_ FrameRateRange) MaxFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](f_, objc.Sel("maxFrameDuration")) + return rv +} + +// The maximum frame rate supported by the range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avframeraterange/1386988-maxframerate?language=objc +func (f_ FrameRateRange) MaxFrameRate() float64 { + rv := objc.Call[float64](f_, objc.Sel("maxFrameRate")) + return rv +} + +// The minimum frame rate supported by the range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avframeraterange/1389132-minframerate?language=objc +func (f_ FrameRateRange) MinFrameRate() float64 { + rv := objc.Call[float64](f_, objc.Sel("minFrameRate")) + return rv +} + +// The minimum frame duration supported by the range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avframeraterange/1388420-minframeduration?language=objc +func (f_ FrameRateRange) MinFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](f_, objc.Sel("minFrameDuration")) + return rv +} diff --git a/macos/avfoundation/media_data_storage.gen.go b/macos/avfoundation/media_data_storage.gen.go new file mode 100644 index 00000000..a20e23b2 --- /dev/null +++ b/macos/avfoundation/media_data_storage.gen.go @@ -0,0 +1,82 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MediaDataStorage] class. +var MediaDataStorageClass = _MediaDataStorageClass{objc.GetClass("AVMediaDataStorage")} + +type _MediaDataStorageClass struct { + objc.Class +} + +// An interface definition for the [MediaDataStorage] class. +type IMediaDataStorage interface { + objc.IObject + URL() foundation.URL +} + +// An object that represents the media sample data storage file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediadatastorage?language=objc +type MediaDataStorage struct { + objc.Object +} + +func MediaDataStorageFrom(ptr unsafe.Pointer) MediaDataStorage { + return MediaDataStorage{ + Object: objc.ObjectFrom(ptr), + } +} + +func (m_ MediaDataStorage) InitWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) MediaDataStorage { + rv := objc.Call[MediaDataStorage](m_, objc.Sel("initWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Creates a media data storage object associated with a file URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediadatastorage/1386008-initwithurl?language=objc +func NewMediaDataStorageWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) MediaDataStorage { + instance := MediaDataStorageClass.Alloc().InitWithURLOptions(URL, options) + instance.Autorelease() + return instance +} + +func (mc _MediaDataStorageClass) Alloc() MediaDataStorage { + rv := objc.Call[MediaDataStorage](mc, objc.Sel("alloc")) + return rv +} + +func MediaDataStorage_Alloc() MediaDataStorage { + return MediaDataStorageClass.Alloc() +} + +func (mc _MediaDataStorageClass) New() MediaDataStorage { + rv := objc.Call[MediaDataStorage](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMediaDataStorage() MediaDataStorage { + return MediaDataStorageClass.New() +} + +func (m_ MediaDataStorage) Init() MediaDataStorage { + rv := objc.Call[MediaDataStorage](m_, objc.Sel("init")) + return rv +} + +// Returns the URL used to initialize the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediadatastorage/1385809-url?language=objc +func (m_ MediaDataStorage) URL() foundation.URL { + rv := objc.Call[foundation.URL](m_, objc.Sel("URL")) + return rv +} diff --git a/macos/avfoundation/media_selection.gen.go b/macos/avfoundation/media_selection.gen.go new file mode 100644 index 00000000..dc70d6a2 --- /dev/null +++ b/macos/avfoundation/media_selection.gen.go @@ -0,0 +1,85 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MediaSelection] class. +var MediaSelectionClass = _MediaSelectionClass{objc.GetClass("AVMediaSelection")} + +type _MediaSelectionClass struct { + objc.Class +} + +// An interface definition for the [MediaSelection] class. +type IMediaSelection interface { + objc.IObject + MediaSelectionCriteriaCanBeAppliedAutomaticallyToMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) bool + SelectedMediaOptionInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) MediaSelectionOption + Asset() Asset +} + +// An object that represents a complete rendition of media selection options on an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselection?language=objc +type MediaSelection struct { + objc.Object +} + +func MediaSelectionFrom(ptr unsafe.Pointer) MediaSelection { + return MediaSelection{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MediaSelectionClass) Alloc() MediaSelection { + rv := objc.Call[MediaSelection](mc, objc.Sel("alloc")) + return rv +} + +func MediaSelection_Alloc() MediaSelection { + return MediaSelectionClass.Alloc() +} + +func (mc _MediaSelectionClass) New() MediaSelection { + rv := objc.Call[MediaSelection](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMediaSelection() MediaSelection { + return MediaSelectionClass.New() +} + +func (m_ MediaSelection) Init() MediaSelection { + rv := objc.Call[MediaSelection](m_, objc.Sel("init")) + return rv +} + +// Indicates whether the specified media selection group is subject to automatic media selection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselection/1386716-mediaselectioncriteriacanbeappli?language=objc +func (m_ MediaSelection) MediaSelectionCriteriaCanBeAppliedAutomaticallyToMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) bool { + rv := objc.Call[bool](m_, objc.Sel("mediaSelectionCriteriaCanBeAppliedAutomaticallyToMediaSelectionGroup:"), objc.Ptr(mediaSelectionGroup)) + return rv +} + +// Returns the media selection option that’s currently selected in the specified group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselection/1389197-selectedmediaoptioninmediaselect?language=objc +func (m_ MediaSelection) SelectedMediaOptionInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) MediaSelectionOption { + rv := objc.Call[MediaSelectionOption](m_, objc.Sel("selectedMediaOptionInMediaSelectionGroup:"), objc.Ptr(mediaSelectionGroup)) + return rv +} + +// The asset associated with the media selection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselection/1390874-asset?language=objc +func (m_ MediaSelection) Asset() Asset { + rv := objc.Call[Asset](m_, objc.Sel("asset")) + return rv +} diff --git a/macos/avfoundation/media_selection_group.gen.go b/macos/avfoundation/media_selection_group.gen.go new file mode 100644 index 00000000..09f2c54b --- /dev/null +++ b/macos/avfoundation/media_selection_group.gen.go @@ -0,0 +1,125 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MediaSelectionGroup] class. +var MediaSelectionGroupClass = _MediaSelectionGroupClass{objc.GetClass("AVMediaSelectionGroup")} + +type _MediaSelectionGroupClass struct { + objc.Class +} + +// An interface definition for the [MediaSelectionGroup] class. +type IMediaSelectionGroup interface { + objc.IObject + MediaSelectionOptionWithPropertyList(plist objc.IObject) MediaSelectionOption + AllowsEmptySelection() bool + Options() []MediaSelectionOption + DefaultOption() MediaSelectionOption +} + +// An object that represents a collection of mutually exclusive options for the presentation of media within an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup?language=objc +type MediaSelectionGroup struct { + objc.Object +} + +func MediaSelectionGroupFrom(ptr unsafe.Pointer) MediaSelectionGroup { + return MediaSelectionGroup{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MediaSelectionGroupClass) Alloc() MediaSelectionGroup { + rv := objc.Call[MediaSelectionGroup](mc, objc.Sel("alloc")) + return rv +} + +func MediaSelectionGroup_Alloc() MediaSelectionGroup { + return MediaSelectionGroupClass.Alloc() +} + +func (mc _MediaSelectionGroupClass) New() MediaSelectionGroup { + rv := objc.Call[MediaSelectionGroup](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMediaSelectionGroup() MediaSelectionGroup { + return MediaSelectionGroupClass.New() +} + +func (m_ MediaSelectionGroup) Init() MediaSelectionGroup { + rv := objc.Call[MediaSelectionGroup](m_, objc.Sel("init")) + return rv +} + +// Returns an array containing the media selection options from a given array that are playable. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1387351-playablemediaselectionoptionsfro?language=objc +func (mc _MediaSelectionGroupClass) PlayableMediaSelectionOptionsFromArray(mediaSelectionOptions []IMediaSelectionOption) []MediaSelectionOption { + rv := objc.Call[[]MediaSelectionOption](mc, objc.Sel("playableMediaSelectionOptionsFromArray:"), mediaSelectionOptions) + return rv +} + +// Returns an array containing the media selection options from a given array that are playable. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1387351-playablemediaselectionoptionsfro?language=objc +func MediaSelectionGroup_PlayableMediaSelectionOptionsFromArray(mediaSelectionOptions []IMediaSelectionOption) []MediaSelectionOption { + return MediaSelectionGroupClass.PlayableMediaSelectionOptionsFromArray(mediaSelectionOptions) +} + +// Returns the media selection options that match the given property list. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1389968-mediaselectionoptionwithproperty?language=objc +func (m_ MediaSelectionGroup) MediaSelectionOptionWithPropertyList(plist objc.IObject) MediaSelectionOption { + rv := objc.Call[MediaSelectionOption](m_, objc.Sel("mediaSelectionOptionWithPropertyList:"), plist) + return rv +} + +// Returns an array containing the media selection options from a given array that match the specified locale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1387494-mediaselectionoptionsfromarray?language=objc +func (mc _MediaSelectionGroupClass) MediaSelectionOptionsFromArrayWithLocale(mediaSelectionOptions []IMediaSelectionOption, locale foundation.ILocale) []MediaSelectionOption { + rv := objc.Call[[]MediaSelectionOption](mc, objc.Sel("mediaSelectionOptionsFromArray:withLocale:"), mediaSelectionOptions, objc.Ptr(locale)) + return rv +} + +// Returns an array containing the media selection options from a given array that match the specified locale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1387494-mediaselectionoptionsfromarray?language=objc +func MediaSelectionGroup_MediaSelectionOptionsFromArrayWithLocale(mediaSelectionOptions []IMediaSelectionOption, locale foundation.ILocale) []MediaSelectionOption { + return MediaSelectionGroupClass.MediaSelectionOptionsFromArrayWithLocale(mediaSelectionOptions, locale) +} + +// A Boolean value that indicates whether it’s possible to present none of the options in the group when an associated player item is played. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1388483-allowsemptyselection?language=objc +func (m_ MediaSelectionGroup) AllowsEmptySelection() bool { + rv := objc.Call[bool](m_, objc.Sel("allowsEmptySelection")) + return rv +} + +// A collection of mutually exclusive media selection options [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1388351-options?language=objc +func (m_ MediaSelectionGroup) Options() []MediaSelectionOption { + rv := objc.Call[[]MediaSelectionOption](m_, objc.Sel("options")) + return rv +} + +// The default option in the group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup/1388440-defaultoption?language=objc +func (m_ MediaSelectionGroup) DefaultOption() MediaSelectionOption { + rv := objc.Call[MediaSelectionOption](m_, objc.Sel("defaultOption")) + return rv +} diff --git a/macos/avfoundation/media_selection_option.gen.go b/macos/avfoundation/media_selection_option.gen.go new file mode 100644 index 00000000..a6430fc5 --- /dev/null +++ b/macos/avfoundation/media_selection_option.gen.go @@ -0,0 +1,176 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MediaSelectionOption] class. +var MediaSelectionOptionClass = _MediaSelectionOptionClass{objc.GetClass("AVMediaSelectionOption")} + +type _MediaSelectionOptionClass struct { + objc.Class +} + +// An interface definition for the [MediaSelectionOption] class. +type IMediaSelectionOption interface { + objc.IObject + DisplayNameWithLocale(locale foundation.ILocale) string + AssociatedMediaSelectionOptionInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) MediaSelectionOption + HasMediaCharacteristic(mediaCharacteristic MediaCharacteristic) bool + PropertyList() objc.Object + MetadataForFormat(format string) []MetadataItem + ExtendedLanguageTag() string + MediaSubTypes() []foundation.Number + MediaType() MediaType + Locale() foundation.Locale + AvailableMetadataFormats() []string + DisplayName() string + IsPlayable() bool + CommonMetadata() []MetadataItem +} + +// An object that represents a specific option for the presentation of media within a group of options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption?language=objc +type MediaSelectionOption struct { + objc.Object +} + +func MediaSelectionOptionFrom(ptr unsafe.Pointer) MediaSelectionOption { + return MediaSelectionOption{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MediaSelectionOptionClass) Alloc() MediaSelectionOption { + rv := objc.Call[MediaSelectionOption](mc, objc.Sel("alloc")) + return rv +} + +func MediaSelectionOption_Alloc() MediaSelectionOption { + return MediaSelectionOptionClass.Alloc() +} + +func (mc _MediaSelectionOptionClass) New() MediaSelectionOption { + rv := objc.Call[MediaSelectionOption](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMediaSelectionOption() MediaSelectionOption { + return MediaSelectionOptionClass.New() +} + +func (m_ MediaSelectionOption) Init() MediaSelectionOption { + rv := objc.Call[MediaSelectionOption](m_, objc.Sel("init")) + return rv +} + +// Returns a string suitable for display using the specified locale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1388021-displaynamewithlocale?language=objc +func (m_ MediaSelectionOption) DisplayNameWithLocale(locale foundation.ILocale) string { + rv := objc.Call[string](m_, objc.Sel("displayNameWithLocale:"), objc.Ptr(locale)) + return rv +} + +// Returns a media selection option associated with the receiver in a given group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1388232-associatedmediaselectionoptionin?language=objc +func (m_ MediaSelectionOption) AssociatedMediaSelectionOptionInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) MediaSelectionOption { + rv := objc.Call[MediaSelectionOption](m_, objc.Sel("associatedMediaSelectionOptionInMediaSelectionGroup:"), objc.Ptr(mediaSelectionGroup)) + return rv +} + +// Returns a Boolean value that indicates whether the receiver has media with the given media characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1388531-hasmediacharacteristic?language=objc +func (m_ MediaSelectionOption) HasMediaCharacteristic(mediaCharacteristic MediaCharacteristic) bool { + rv := objc.Call[bool](m_, objc.Sel("hasMediaCharacteristic:"), mediaCharacteristic) + return rv +} + +// Returns a serializable property list that’s sufficient to identify the option within its group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1386310-propertylist?language=objc +func (m_ MediaSelectionOption) PropertyList() objc.Object { + rv := objc.Call[objc.Object](m_, objc.Sel("propertyList")) + return rv +} + +// Returns an array of metadata items—one for each metadata item in the container of a given format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1386666-metadataforformat?language=objc +func (m_ MediaSelectionOption) MetadataForFormat(format string) []MetadataItem { + rv := objc.Call[[]MetadataItem](m_, objc.Sel("metadataForFormat:"), format) + return rv +} + +// The IETF BCP 47 language tag associated with the option [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1387619-extendedlanguagetag?language=objc +func (m_ MediaSelectionOption) ExtendedLanguageTag() string { + rv := objc.Call[string](m_, objc.Sel("extendedLanguageTag")) + return rv +} + +// The media sub-types of the media data associated with the option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1385587-mediasubtypes?language=objc +func (m_ MediaSelectionOption) MediaSubTypes() []foundation.Number { + rv := objc.Call[[]foundation.Number](m_, objc.Sel("mediaSubTypes")) + return rv +} + +// The media type of the media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1386322-mediatype?language=objc +func (m_ MediaSelectionOption) MediaType() MediaType { + rv := objc.Call[MediaType](m_, objc.Sel("mediaType")) + return rv +} + +// The locale for which the media option was authored. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1388436-locale?language=objc +func (m_ MediaSelectionOption) Locale() foundation.Locale { + rv := objc.Call[foundation.Locale](m_, objc.Sel("locale")) + return rv +} + +// The metadata formats that contain metadata associated with the option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1389504-availablemetadataformats?language=objc +func (m_ MediaSelectionOption) AvailableMetadataFormats() []string { + rv := objc.Call[[]string](m_, objc.Sel("availableMetadataFormats")) + return rv +} + +// A string suitable for display using the current system locale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1388485-displayname?language=objc +func (m_ MediaSelectionOption) DisplayName() string { + rv := objc.Call[string](m_, objc.Sel("displayName")) + return rv +} + +// A Boolean value that indicates whether the media selection option is playable. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1390917-playable?language=objc +func (m_ MediaSelectionOption) IsPlayable() bool { + rv := objc.Call[bool](m_, objc.Sel("isPlayable")) + return rv +} + +// An array of metadata items for each common metadata key for which a value is available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmediaselectionoption/1387859-commonmetadata?language=objc +func (m_ MediaSelectionOption) CommonMetadata() []MetadataItem { + rv := objc.Call[[]MetadataItem](m_, objc.Sel("commonMetadata")) + return rv +} diff --git a/macos/avfoundation/metadata_body_object.gen.go b/macos/avfoundation/metadata_body_object.gen.go new file mode 100644 index 00000000..cfe33277 --- /dev/null +++ b/macos/avfoundation/metadata_body_object.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataBodyObject] class. +var MetadataBodyObjectClass = _MetadataBodyObjectClass{objc.GetClass("AVMetadataBodyObject")} + +type _MetadataBodyObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataBodyObject] class. +type IMetadataBodyObject interface { + IMetadataObject + BodyID() int +} + +// An abstract class that defines the interface for a metadata body object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatabodyobject?language=objc +type MetadataBodyObject struct { + MetadataObject +} + +func MetadataBodyObjectFrom(ptr unsafe.Pointer) MetadataBodyObject { + return MetadataBodyObject{ + MetadataObject: MetadataObjectFrom(ptr), + } +} + +func (mc _MetadataBodyObjectClass) Alloc() MetadataBodyObject { + rv := objc.Call[MetadataBodyObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataBodyObject_Alloc() MetadataBodyObject { + return MetadataBodyObjectClass.Alloc() +} + +func (mc _MetadataBodyObjectClass) New() MetadataBodyObject { + rv := objc.Call[MetadataBodyObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataBodyObject() MetadataBodyObject { + return MetadataBodyObjectClass.New() +} + +func (m_ MetadataBodyObject) Init() MetadataBodyObject { + rv := objc.Call[MetadataBodyObject](m_, objc.Sel("init")) + return rv +} + +// An integer value that defines the unique identifier of an object in a picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatabodyobject/3174758-bodyid?language=objc +func (m_ MetadataBodyObject) BodyID() int { + rv := objc.Call[int](m_, objc.Sel("bodyID")) + return rv +} diff --git a/macos/avfoundation/metadata_cat_body_object.gen.go b/macos/avfoundation/metadata_cat_body_object.gen.go new file mode 100644 index 00000000..a4ea159e --- /dev/null +++ b/macos/avfoundation/metadata_cat_body_object.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataCatBodyObject] class. +var MetadataCatBodyObjectClass = _MetadataCatBodyObjectClass{objc.GetClass("AVMetadataCatBodyObject")} + +type _MetadataCatBodyObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataCatBodyObject] class. +type IMetadataCatBodyObject interface { + IMetadataBodyObject +} + +// An object representing a single detected cat body in a picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatacatbodyobject?language=objc +type MetadataCatBodyObject struct { + MetadataBodyObject +} + +func MetadataCatBodyObjectFrom(ptr unsafe.Pointer) MetadataCatBodyObject { + return MetadataCatBodyObject{ + MetadataBodyObject: MetadataBodyObjectFrom(ptr), + } +} + +func (mc _MetadataCatBodyObjectClass) Alloc() MetadataCatBodyObject { + rv := objc.Call[MetadataCatBodyObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataCatBodyObject_Alloc() MetadataCatBodyObject { + return MetadataCatBodyObjectClass.Alloc() +} + +func (mc _MetadataCatBodyObjectClass) New() MetadataCatBodyObject { + rv := objc.Call[MetadataCatBodyObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataCatBodyObject() MetadataCatBodyObject { + return MetadataCatBodyObjectClass.New() +} + +func (m_ MetadataCatBodyObject) Init() MetadataCatBodyObject { + rv := objc.Call[MetadataCatBodyObject](m_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/metadata_dog_body_object.gen.go b/macos/avfoundation/metadata_dog_body_object.gen.go new file mode 100644 index 00000000..6c0872bb --- /dev/null +++ b/macos/avfoundation/metadata_dog_body_object.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataDogBodyObject] class. +var MetadataDogBodyObjectClass = _MetadataDogBodyObjectClass{objc.GetClass("AVMetadataDogBodyObject")} + +type _MetadataDogBodyObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataDogBodyObject] class. +type IMetadataDogBodyObject interface { + IMetadataBodyObject +} + +// An object representing a single detected dog body in a picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatadogbodyobject?language=objc +type MetadataDogBodyObject struct { + MetadataBodyObject +} + +func MetadataDogBodyObjectFrom(ptr unsafe.Pointer) MetadataDogBodyObject { + return MetadataDogBodyObject{ + MetadataBodyObject: MetadataBodyObjectFrom(ptr), + } +} + +func (mc _MetadataDogBodyObjectClass) Alloc() MetadataDogBodyObject { + rv := objc.Call[MetadataDogBodyObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataDogBodyObject_Alloc() MetadataDogBodyObject { + return MetadataDogBodyObjectClass.Alloc() +} + +func (mc _MetadataDogBodyObjectClass) New() MetadataDogBodyObject { + rv := objc.Call[MetadataDogBodyObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataDogBodyObject() MetadataDogBodyObject { + return MetadataDogBodyObjectClass.New() +} + +func (m_ MetadataDogBodyObject) Init() MetadataDogBodyObject { + rv := objc.Call[MetadataDogBodyObject](m_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/metadata_face_object.gen.go b/macos/avfoundation/metadata_face_object.gen.go new file mode 100644 index 00000000..8468bc46 --- /dev/null +++ b/macos/avfoundation/metadata_face_object.gen.go @@ -0,0 +1,103 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataFaceObject] class. +var MetadataFaceObjectClass = _MetadataFaceObjectClass{objc.GetClass("AVMetadataFaceObject")} + +type _MetadataFaceObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataFaceObject] class. +type IMetadataFaceObject interface { + IMetadataObject + HasRollAngle() bool + YawAngle() float64 + RollAngle() float64 + HasYawAngle() bool + FaceID() int +} + +// Face information detected by a metadata capture output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject?language=objc +type MetadataFaceObject struct { + MetadataObject +} + +func MetadataFaceObjectFrom(ptr unsafe.Pointer) MetadataFaceObject { + return MetadataFaceObject{ + MetadataObject: MetadataObjectFrom(ptr), + } +} + +func (mc _MetadataFaceObjectClass) Alloc() MetadataFaceObject { + rv := objc.Call[MetadataFaceObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataFaceObject_Alloc() MetadataFaceObject { + return MetadataFaceObjectClass.Alloc() +} + +func (mc _MetadataFaceObjectClass) New() MetadataFaceObject { + rv := objc.Call[MetadataFaceObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataFaceObject() MetadataFaceObject { + return MetadataFaceObjectClass.New() +} + +func (m_ MetadataFaceObject) Init() MetadataFaceObject { + rv := objc.Call[MetadataFaceObject](m_, objc.Sel("init")) + return rv +} + +// A Boolean value indicating whether there is a valid roll angle associated with the face. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject/1386866-hasrollangle?language=objc +func (m_ MetadataFaceObject) HasRollAngle() bool { + rv := objc.Call[bool](m_, objc.Sel("hasRollAngle")) + return rv +} + +// The yaw angle of the face specified in degrees. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject/1386517-yawangle?language=objc +func (m_ MetadataFaceObject) YawAngle() float64 { + rv := objc.Call[float64](m_, objc.Sel("yawAngle")) + return rv +} + +// The roll angle of the face specified in degrees. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject/1389110-rollangle?language=objc +func (m_ MetadataFaceObject) RollAngle() float64 { + rv := objc.Call[float64](m_, objc.Sel("rollAngle")) + return rv +} + +// A Boolean value indicating whether there is a valid yaw angle associated with the face. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject/1385888-hasyawangle?language=objc +func (m_ MetadataFaceObject) HasYawAngle() bool { + rv := objc.Call[bool](m_, objc.Sel("hasYawAngle")) + return rv +} + +// The unique ID for this face metadata object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatafaceobject/1386945-faceid?language=objc +func (m_ MetadataFaceObject) FaceID() int { + rv := objc.Call[int](m_, objc.Sel("faceID")) + return rv +} diff --git a/macos/avfoundation/metadata_group.gen.go b/macos/avfoundation/metadata_group.gen.go new file mode 100644 index 00000000..7fd9ad41 --- /dev/null +++ b/macos/avfoundation/metadata_group.gen.go @@ -0,0 +1,85 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataGroup] class. +var MetadataGroupClass = _MetadataGroupClass{objc.GetClass("AVMetadataGroup")} + +type _MetadataGroupClass struct { + objc.Class +} + +// An interface definition for the [MetadataGroup] class. +type IMetadataGroup interface { + objc.IObject + Items() []MetadataItem + ClassifyingLabel() string + UniqueID() string +} + +// A collection of metadata items associated with a timeline segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatagroup?language=objc +type MetadataGroup struct { + objc.Object +} + +func MetadataGroupFrom(ptr unsafe.Pointer) MetadataGroup { + return MetadataGroup{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MetadataGroupClass) Alloc() MetadataGroup { + rv := objc.Call[MetadataGroup](mc, objc.Sel("alloc")) + return rv +} + +func MetadataGroup_Alloc() MetadataGroup { + return MetadataGroupClass.Alloc() +} + +func (mc _MetadataGroupClass) New() MetadataGroup { + rv := objc.Call[MetadataGroup](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataGroup() MetadataGroup { + return MetadataGroupClass.New() +} + +func (m_ MetadataGroup) Init() MetadataGroup { + rv := objc.Call[MetadataGroup](m_, objc.Sel("init")) + return rv +} + +// The array of metadata items associated with the metadata group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatagroup/1389935-items?language=objc +func (m_ MetadataGroup) Items() []MetadataItem { + rv := objc.Call[[]MetadataItem](m_, objc.Sel("items")) + return rv +} + +// The classifying label associated with the metadata group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatagroup/1620087-classifyinglabel?language=objc +func (m_ MetadataGroup) ClassifyingLabel() string { + rv := objc.Call[string](m_, objc.Sel("classifyingLabel")) + return rv +} + +// The unique identifier for the metadata group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatagroup/1620088-uniqueid?language=objc +func (m_ MetadataGroup) UniqueID() string { + rv := objc.Call[string](m_, objc.Sel("uniqueID")) + return rv +} diff --git a/macos/avfoundation/metadata_human_body_object.gen.go b/macos/avfoundation/metadata_human_body_object.gen.go new file mode 100644 index 00000000..26a0c7b1 --- /dev/null +++ b/macos/avfoundation/metadata_human_body_object.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataHumanBodyObject] class. +var MetadataHumanBodyObjectClass = _MetadataHumanBodyObjectClass{objc.GetClass("AVMetadataHumanBodyObject")} + +type _MetadataHumanBodyObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataHumanBodyObject] class. +type IMetadataHumanBodyObject interface { + IMetadataBodyObject +} + +// An object representing a single detected human body in a picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatahumanbodyobject?language=objc +type MetadataHumanBodyObject struct { + MetadataBodyObject +} + +func MetadataHumanBodyObjectFrom(ptr unsafe.Pointer) MetadataHumanBodyObject { + return MetadataHumanBodyObject{ + MetadataBodyObject: MetadataBodyObjectFrom(ptr), + } +} + +func (mc _MetadataHumanBodyObjectClass) Alloc() MetadataHumanBodyObject { + rv := objc.Call[MetadataHumanBodyObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataHumanBodyObject_Alloc() MetadataHumanBodyObject { + return MetadataHumanBodyObjectClass.Alloc() +} + +func (mc _MetadataHumanBodyObjectClass) New() MetadataHumanBodyObject { + rv := objc.Call[MetadataHumanBodyObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataHumanBodyObject() MetadataHumanBodyObject { + return MetadataHumanBodyObjectClass.New() +} + +func (m_ MetadataHumanBodyObject) Init() MetadataHumanBodyObject { + rv := objc.Call[MetadataHumanBodyObject](m_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/metadata_item.gen.go b/macos/avfoundation/metadata_item.gen.go new file mode 100644 index 00000000..7df73bed --- /dev/null +++ b/macos/avfoundation/metadata_item.gen.go @@ -0,0 +1,296 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataItem] class. +var MetadataItemClass = _MetadataItemClass{objc.GetClass("AVMetadataItem")} + +type _MetadataItemClass struct { + objc.Class +} + +// An interface definition for the [MetadataItem] class. +type IMetadataItem interface { + objc.IObject + StatusOfValueForKeyError(key string, outError foundation.IError) KeyValueStatus + LoadValuesAsynchronouslyForKeysCompletionHandler(keys []string, handler func()) + KeySpace() MetadataKeySpace + ExtendedLanguageTag() string + DataValue() []byte + Key() objc.Object + Value() objc.Object + StringValue() string + ExtraAttributes() map[MetadataExtraAttributeKey]objc.Object + NumberValue() foundation.Number + Locale() foundation.Locale + DateValue() foundation.Date + Time() coremedia.Time + DataType() string + StartDate() foundation.Date + Duration() coremedia.Time + CommonKey() MetadataKey + Identifier() MetadataIdentifier +} + +// A metadata item for an audiovisual asset or one of its tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem?language=objc +type MetadataItem struct { + objc.Object +} + +func MetadataItemFrom(ptr unsafe.Pointer) MetadataItem { + return MetadataItem{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MetadataItemClass) Alloc() MetadataItem { + rv := objc.Call[MetadataItem](mc, objc.Sel("alloc")) + return rv +} + +func MetadataItem_Alloc() MetadataItem { + return MetadataItemClass.Alloc() +} + +func (mc _MetadataItemClass) New() MetadataItem { + rv := objc.Call[MetadataItem](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataItem() MetadataItem { + return MetadataItemClass.New() +} + +func (m_ MetadataItem) Init() MetadataItem { + rv := objc.Call[MetadataItem](m_, objc.Sel("init")) + return rv +} + +// Reports whether the value for a given key is immediately available without blocking. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1388523-statusofvalueforkey?language=objc +func (m_ MetadataItem) StatusOfValueForKeyError(key string, outError foundation.IError) KeyValueStatus { + rv := objc.Call[KeyValueStatus](m_, objc.Sel("statusOfValueForKey:error:"), key, objc.Ptr(outError)) + return rv +} + +// Returns a metadata key space for the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1390663-keyspaceforidentifier?language=objc +func (mc _MetadataItemClass) KeySpaceForIdentifier(identifier MetadataIdentifier) MetadataKeySpace { + rv := objc.Call[MetadataKeySpace](mc, objc.Sel("keySpaceForIdentifier:"), identifier) + return rv +} + +// Returns a metadata key space for the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1390663-keyspaceforidentifier?language=objc +func MetadataItem_KeySpaceForIdentifier(identifier MetadataIdentifier) MetadataKeySpace { + return MetadataItemClass.KeySpaceForIdentifier(identifier) +} + +// Returns a metadata identifier for the specified key and key space. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387869-identifierforkey?language=objc +func (mc _MetadataItemClass) IdentifierForKeyKeySpace(key objc.IObject, keySpace MetadataKeySpace) MetadataIdentifier { + rv := objc.Call[MetadataIdentifier](mc, objc.Sel("identifierForKey:keySpace:"), key, keySpace) + return rv +} + +// Returns a metadata identifier for the specified key and key space. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387869-identifierforkey?language=objc +func MetadataItem_IdentifierForKeyKeySpace(key objc.IObject, keySpace MetadataKeySpace) MetadataIdentifier { + return MetadataItemClass.IdentifierForKeyKeySpace(key, keySpace) +} + +// Returns a metadata key for the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1385613-keyforidentifier?language=objc +func (mc _MetadataItemClass) KeyForIdentifier(identifier MetadataIdentifier) objc.Object { + rv := objc.Call[objc.Object](mc, objc.Sel("keyForIdentifier:"), identifier) + return rv +} + +// Returns a metadata key for the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1385613-keyforidentifier?language=objc +func MetadataItem_KeyForIdentifier(identifier MetadataIdentifier) objc.Object { + return MetadataItemClass.KeyForIdentifier(identifier) +} + +// Tells the object to load the values of any of the specified keys that aren’t already loaded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387102-loadvaluesasynchronouslyforkeys?language=objc +func (m_ MetadataItem) LoadValuesAsynchronouslyForKeysCompletionHandler(keys []string, handler func()) { + objc.Call[objc.Void](m_, objc.Sel("loadValuesAsynchronouslyForKeys:completionHandler:"), keys, handler) +} + +// Creates a metadata item whose value loads on an on-demand basis only. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387745-metadataitemwithpropertiesofmeta?language=objc +func (mc _MetadataItemClass) MetadataItemWithPropertiesOfMetadataItemValueLoadingHandler(metadataItem IMetadataItem, handler func(valueRequest MetadataItemValueRequest)) MetadataItem { + rv := objc.Call[MetadataItem](mc, objc.Sel("metadataItemWithPropertiesOfMetadataItem:valueLoadingHandler:"), objc.Ptr(metadataItem), handler) + return rv +} + +// Creates a metadata item whose value loads on an on-demand basis only. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387745-metadataitemwithpropertiesofmeta?language=objc +func MetadataItem_MetadataItemWithPropertiesOfMetadataItemValueLoadingHandler(metadataItem IMetadataItem, handler func(valueRequest MetadataItemValueRequest)) MetadataItem { + return MetadataItemClass.MetadataItemWithPropertiesOfMetadataItemValueLoadingHandler(metadataItem, handler) +} + +// Returns metadata items that match a specified locale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1389374-metadataitemsfromarray?language=objc +func (mc _MetadataItemClass) MetadataItemsFromArrayWithLocale(metadataItems []IMetadataItem, locale foundation.ILocale) []MetadataItem { + rv := objc.Call[[]MetadataItem](mc, objc.Sel("metadataItemsFromArray:withLocale:"), metadataItems, objc.Ptr(locale)) + return rv +} + +// Returns metadata items that match a specified locale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1389374-metadataitemsfromarray?language=objc +func MetadataItem_MetadataItemsFromArrayWithLocale(metadataItems []IMetadataItem, locale foundation.ILocale) []MetadataItem { + return MetadataItemClass.MetadataItemsFromArrayWithLocale(metadataItems, locale) +} + +// The key space for the metadata item’s key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1385757-keyspace?language=objc +func (m_ MetadataItem) KeySpace() MetadataKeySpace { + rv := objc.Call[MetadataKeySpace](m_, objc.Sel("keySpace")) + return rv +} + +// The IETF BCP 47 (RFC 4646) language identifier of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387068-extendedlanguagetag?language=objc +func (m_ MetadataItem) ExtendedLanguageTag() string { + rv := objc.Call[string](m_, objc.Sel("extendedLanguageTag")) + return rv +} + +// The value of the metadata item as a data value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387641-datavalue?language=objc +func (m_ MetadataItem) DataValue() []byte { + rv := objc.Call[[]byte](m_, objc.Sel("dataValue")) + return rv +} + +// The key of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387843-key?language=objc +func (m_ MetadataItem) Key() objc.Object { + rv := objc.Call[objc.Object](m_, objc.Sel("key")) + return rv +} + +// The value of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1390537-value?language=objc +func (m_ MetadataItem) Value() objc.Object { + rv := objc.Call[objc.Object](m_, objc.Sel("value")) + return rv +} + +// The value of the metadata item as a string. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1390846-stringvalue?language=objc +func (m_ MetadataItem) StringValue() string { + rv := objc.Call[string](m_, objc.Sel("stringValue")) + return rv +} + +// A dictionary of additional attributes for a metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1389570-extraattributes?language=objc +func (m_ MetadataItem) ExtraAttributes() map[MetadataExtraAttributeKey]objc.Object { + rv := objc.Call[map[MetadataExtraAttributeKey]objc.Object](m_, objc.Sel("extraAttributes")) + return rv +} + +// The value of the metadata item as a number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1390681-numbervalue?language=objc +func (m_ MetadataItem) NumberValue() foundation.Number { + rv := objc.Call[foundation.Number](m_, objc.Sel("numberValue")) + return rv +} + +// The locale of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1387114-locale?language=objc +func (m_ MetadataItem) Locale() foundation.Locale { + rv := objc.Call[foundation.Locale](m_, objc.Sel("locale")) + return rv +} + +// The value of the metadata item as a date. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1385563-datevalue?language=objc +func (m_ MetadataItem) DateValue() foundation.Date { + rv := objc.Call[foundation.Date](m_, objc.Sel("dateValue")) + return rv +} + +// The timestamp of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1388612-time?language=objc +func (m_ MetadataItem) Time() coremedia.Time { + rv := objc.Call[coremedia.Time](m_, objc.Sel("time")) + return rv +} + +// The data type of the metadata item’s value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1386856-datatype?language=objc +func (m_ MetadataItem) DataType() string { + rv := objc.Call[string](m_, objc.Sel("dataType")) + return rv +} + +// The start date of the timed metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1388535-startdate?language=objc +func (m_ MetadataItem) StartDate() foundation.Date { + rv := objc.Call[foundation.Date](m_, objc.Sel("startDate")) + return rv +} + +// The duration of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1386610-duration?language=objc +func (m_ MetadataItem) Duration() coremedia.Time { + rv := objc.Call[coremedia.Time](m_, objc.Sel("duration")) + return rv +} + +// The common key of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1389864-commonkey?language=objc +func (m_ MetadataItem) CommonKey() MetadataKey { + rv := objc.Call[MetadataKey](m_, objc.Sel("commonKey")) + return rv +} + +// An identifier for a metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitem/1386968-identifier?language=objc +func (m_ MetadataItem) Identifier() MetadataIdentifier { + rv := objc.Call[MetadataIdentifier](m_, objc.Sel("identifier")) + return rv +} diff --git a/macos/avfoundation/metadata_item_filter.gen.go b/macos/avfoundation/metadata_item_filter.gen.go new file mode 100644 index 00000000..3f13e589 --- /dev/null +++ b/macos/avfoundation/metadata_item_filter.gen.go @@ -0,0 +1,73 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataItemFilter] class. +var MetadataItemFilterClass = _MetadataItemFilterClass{objc.GetClass("AVMetadataItemFilter")} + +type _MetadataItemFilterClass struct { + objc.Class +} + +// An interface definition for the [MetadataItemFilter] class. +type IMetadataItemFilter interface { + objc.IObject +} + +// An object that filters selected information from a metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitemfilter?language=objc +type MetadataItemFilter struct { + objc.Object +} + +func MetadataItemFilterFrom(ptr unsafe.Pointer) MetadataItemFilter { + return MetadataItemFilter{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MetadataItemFilterClass) Alloc() MetadataItemFilter { + rv := objc.Call[MetadataItemFilter](mc, objc.Sel("alloc")) + return rv +} + +func MetadataItemFilter_Alloc() MetadataItemFilter { + return MetadataItemFilterClass.Alloc() +} + +func (mc _MetadataItemFilterClass) New() MetadataItemFilter { + rv := objc.Call[MetadataItemFilter](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataItemFilter() MetadataItemFilter { + return MetadataItemFilterClass.New() +} + +func (m_ MetadataItemFilter) Init() MetadataItemFilter { + rv := objc.Call[MetadataItemFilter](m_, objc.Sel("init")) + return rv +} + +// Returns a metadata filter to use for sharing assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitemfilter/1387905-metadataitemfilterforsharing?language=objc +func (mc _MetadataItemFilterClass) MetadataItemFilterForSharing() MetadataItemFilter { + rv := objc.Call[MetadataItemFilter](mc, objc.Sel("metadataItemFilterForSharing")) + return rv +} + +// Returns a metadata filter to use for sharing assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitemfilter/1387905-metadataitemfilterforsharing?language=objc +func MetadataItemFilter_MetadataItemFilterForSharing() MetadataItemFilter { + return MetadataItemFilterClass.MetadataItemFilterForSharing() +} diff --git a/macos/avfoundation/metadata_item_value_request.gen.go b/macos/avfoundation/metadata_item_value_request.gen.go new file mode 100644 index 00000000..63af2dd1 --- /dev/null +++ b/macos/avfoundation/metadata_item_value_request.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataItemValueRequest] class. +var MetadataItemValueRequestClass = _MetadataItemValueRequestClass{objc.GetClass("AVMetadataItemValueRequest")} + +type _MetadataItemValueRequestClass struct { + objc.Class +} + +// An interface definition for the [MetadataItemValueRequest] class. +type IMetadataItemValueRequest interface { + objc.IObject + RespondWithValue(value objc.IObject) + RespondWithError(error foundation.IError) + MetadataItem() MetadataItem +} + +// An object that responds to a request to load the value of a metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitemvaluerequest?language=objc +type MetadataItemValueRequest struct { + objc.Object +} + +func MetadataItemValueRequestFrom(ptr unsafe.Pointer) MetadataItemValueRequest { + return MetadataItemValueRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MetadataItemValueRequestClass) Alloc() MetadataItemValueRequest { + rv := objc.Call[MetadataItemValueRequest](mc, objc.Sel("alloc")) + return rv +} + +func MetadataItemValueRequest_Alloc() MetadataItemValueRequest { + return MetadataItemValueRequestClass.Alloc() +} + +func (mc _MetadataItemValueRequestClass) New() MetadataItemValueRequest { + rv := objc.Call[MetadataItemValueRequest](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataItemValueRequest() MetadataItemValueRequest { + return MetadataItemValueRequestClass.New() +} + +func (m_ MetadataItemValueRequest) Init() MetadataItemValueRequest { + rv := objc.Call[MetadataItemValueRequest](m_, objc.Sel("init")) + return rv +} + +// Returns the metadata item’s value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitemvaluerequest/1386820-respondwithvalue?language=objc +func (m_ MetadataItemValueRequest) RespondWithValue(value objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("respondWithValue:"), value) +} + +// Returns an error when the system fails to load the value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitemvaluerequest/1390783-respondwitherror?language=objc +func (m_ MetadataItemValueRequest) RespondWithError(error foundation.IError) { + objc.Call[objc.Void](m_, objc.Sel("respondWithError:"), objc.Ptr(error)) +} + +// The metadata item to request a value for. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataitemvaluerequest/1388069-metadataitem?language=objc +func (m_ MetadataItemValueRequest) MetadataItem() MetadataItem { + rv := objc.Call[MetadataItem](m_, objc.Sel("metadataItem")) + return rv +} diff --git a/macos/avfoundation/metadata_machine_readable_code_object.gen.go b/macos/avfoundation/metadata_machine_readable_code_object.gen.go new file mode 100644 index 00000000..7522816f --- /dev/null +++ b/macos/avfoundation/metadata_machine_readable_code_object.gen.go @@ -0,0 +1,87 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataMachineReadableCodeObject] class. +var MetadataMachineReadableCodeObjectClass = _MetadataMachineReadableCodeObjectClass{objc.GetClass("AVMetadataMachineReadableCodeObject")} + +type _MetadataMachineReadableCodeObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataMachineReadableCodeObject] class. +type IMetadataMachineReadableCodeObject interface { + IMetadataObject + Corners() []foundation.Dictionary + StringValue() string + Descriptor() coreimage.BarcodeDescriptor +} + +// Barcode information detected by a metadata capture output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject?language=objc +type MetadataMachineReadableCodeObject struct { + MetadataObject +} + +func MetadataMachineReadableCodeObjectFrom(ptr unsafe.Pointer) MetadataMachineReadableCodeObject { + return MetadataMachineReadableCodeObject{ + MetadataObject: MetadataObjectFrom(ptr), + } +} + +func (mc _MetadataMachineReadableCodeObjectClass) Alloc() MetadataMachineReadableCodeObject { + rv := objc.Call[MetadataMachineReadableCodeObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataMachineReadableCodeObject_Alloc() MetadataMachineReadableCodeObject { + return MetadataMachineReadableCodeObjectClass.Alloc() +} + +func (mc _MetadataMachineReadableCodeObjectClass) New() MetadataMachineReadableCodeObject { + rv := objc.Call[MetadataMachineReadableCodeObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataMachineReadableCodeObject() MetadataMachineReadableCodeObject { + return MetadataMachineReadableCodeObjectClass.New() +} + +func (m_ MetadataMachineReadableCodeObject) Init() MetadataMachineReadableCodeObject { + rv := objc.Call[MetadataMachineReadableCodeObject](m_, objc.Sel("init")) + return rv +} + +// The points defining the (x, y) locations of the corners. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject/1618815-corners?language=objc +func (m_ MetadataMachineReadableCodeObject) Corners() []foundation.Dictionary { + rv := objc.Call[[]foundation.Dictionary](m_, objc.Sel("corners")) + return rv +} + +// Returns the error-corrected data decoded into a human-readable string. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject/1618800-stringvalue?language=objc +func (m_ MetadataMachineReadableCodeObject) StringValue() string { + rv := objc.Call[string](m_, objc.Sel("stringValue")) + return rv +} + +// A barcode description for use in Core Image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject/2875944-descriptor?language=objc +func (m_ MetadataMachineReadableCodeObject) Descriptor() coreimage.BarcodeDescriptor { + rv := objc.Call[coreimage.BarcodeDescriptor](m_, objc.Sel("descriptor")) + return rv +} diff --git a/macos/avfoundation/metadata_object.gen.go b/macos/avfoundation/metadata_object.gen.go new file mode 100644 index 00000000..054199dd --- /dev/null +++ b/macos/avfoundation/metadata_object.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataObject] class. +var MetadataObjectClass = _MetadataObjectClass{objc.GetClass("AVMetadataObject")} + +type _MetadataObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataObject] class. +type IMetadataObject interface { + objc.IObject + Bounds() coregraphics.Rect + Time() coremedia.Time + Type() MetadataObjectType + Duration() coremedia.Time +} + +// The abstract superclass for objects provided by a metadata capture output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataobject?language=objc +type MetadataObject struct { + objc.Object +} + +func MetadataObjectFrom(ptr unsafe.Pointer) MetadataObject { + return MetadataObject{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MetadataObjectClass) Alloc() MetadataObject { + rv := objc.Call[MetadataObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataObject_Alloc() MetadataObject { + return MetadataObjectClass.Alloc() +} + +func (mc _MetadataObjectClass) New() MetadataObject { + rv := objc.Call[MetadataObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataObject() MetadataObject { + return MetadataObjectClass.New() +} + +func (m_ MetadataObject) Init() MetadataObject { + rv := objc.Call[MetadataObject](m_, objc.Sel("init")) + return rv +} + +// The bounding rectangle associated with the metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataobject/1386043-bounds?language=objc +func (m_ MetadataObject) Bounds() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](m_, objc.Sel("bounds")) + return rv +} + +// The media time value associated with the metadata object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataobject/1388593-time?language=objc +func (m_ MetadataObject) Time() coremedia.Time { + rv := objc.Call[coremedia.Time](m_, objc.Sel("time")) + return rv +} + +// The type of metadata that this object provides. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataobject/1387841-type?language=objc +func (m_ MetadataObject) Type() MetadataObjectType { + rv := objc.Call[MetadataObjectType](m_, objc.Sel("type")) + return rv +} + +// The duration of the media associated with this metadata object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadataobject/1386827-duration?language=objc +func (m_ MetadataObject) Duration() coremedia.Time { + rv := objc.Call[coremedia.Time](m_, objc.Sel("duration")) + return rv +} diff --git a/macos/avfoundation/metadata_salient_object.gen.go b/macos/avfoundation/metadata_salient_object.gen.go new file mode 100644 index 00000000..f363f5c7 --- /dev/null +++ b/macos/avfoundation/metadata_salient_object.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MetadataSalientObject] class. +var MetadataSalientObjectClass = _MetadataSalientObjectClass{objc.GetClass("AVMetadataSalientObject")} + +type _MetadataSalientObjectClass struct { + objc.Class +} + +// An interface definition for the [MetadataSalientObject] class. +type IMetadataSalientObject interface { + IMetadataObject + ObjectID() int +} + +// An object representing a single salient area in a picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatasalientobject?language=objc +type MetadataSalientObject struct { + MetadataObject +} + +func MetadataSalientObjectFrom(ptr unsafe.Pointer) MetadataSalientObject { + return MetadataSalientObject{ + MetadataObject: MetadataObjectFrom(ptr), + } +} + +func (mc _MetadataSalientObjectClass) Alloc() MetadataSalientObject { + rv := objc.Call[MetadataSalientObject](mc, objc.Sel("alloc")) + return rv +} + +func MetadataSalientObject_Alloc() MetadataSalientObject { + return MetadataSalientObjectClass.Alloc() +} + +func (mc _MetadataSalientObjectClass) New() MetadataSalientObject { + rv := objc.Call[MetadataSalientObject](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMetadataSalientObject() MetadataSalientObject { + return MetadataSalientObjectClass.New() +} + +func (m_ MetadataSalientObject) Init() MetadataSalientObject { + rv := objc.Call[MetadataSalientObject](m_, objc.Sel("init")) + return rv +} + +// An integer value that defines the unique identifier of an object in a picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmetadatasalientobject/3152378-objectid?language=objc +func (m_ MetadataSalientObject) ObjectID() int { + rv := objc.Call[int](m_, objc.Sel("objectID")) + return rv +} diff --git a/macos/avfoundation/movie.gen.go b/macos/avfoundation/movie.gen.go new file mode 100644 index 00000000..381fc5d8 --- /dev/null +++ b/macos/avfoundation/movie.gen.go @@ -0,0 +1,210 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Movie] class. +var MovieClass = _MovieClass{objc.GetClass("AVMovie")} + +type _MovieClass struct { + objc.Class +} + +// An interface definition for the [Movie] class. +type IMovie interface { + IAsset + WriteMovieHeaderToURLFileTypeOptionsError(URL foundation.IURL, fileType FileType, options MovieWritingOptions, outError foundation.IError) bool + IsCompatibleWithFileType(fileType FileType) bool + MovieHeaderWithFileTypeError(fileType FileType, outError foundation.IError) []byte + DefaultMediaDataStorage() MediaDataStorage + ContainsMovieFragments() bool + Data() []byte + URL() foundation.URL + CanContainMovieFragments() bool +} + +// An object that represents an audiovisual container that conforms to the QuickTime movie file format or a related format like MPEG-4. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie?language=objc +type Movie struct { + Asset +} + +func MovieFrom(ptr unsafe.Pointer) Movie { + return Movie{ + Asset: AssetFrom(ptr), + } +} + +func (m_ Movie) InitWithDataOptions(data []byte, options map[string]objc.IObject) Movie { + rv := objc.Call[Movie](m_, objc.Sel("initWithData:options:"), data, options) + return rv +} + +// Creates a movie object from a movie file’s data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388090-initwithdata?language=objc +func NewMovieWithDataOptions(data []byte, options map[string]objc.IObject) Movie { + instance := MovieClass.Alloc().InitWithDataOptions(data, options) + instance.Autorelease() + return instance +} + +func (mc _MovieClass) MovieWithDataOptions(data []byte, options map[string]objc.IObject) Movie { + rv := objc.Call[Movie](mc, objc.Sel("movieWithData:options:"), data, options) + return rv +} + +// Returns a new movie object from a movie file’s data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1458261-moviewithdata?language=objc +func Movie_MovieWithDataOptions(data []byte, options map[string]objc.IObject) Movie { + return MovieClass.MovieWithDataOptions(data, options) +} + +func (m_ Movie) InitWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) Movie { + rv := objc.Call[Movie](m_, objc.Sel("initWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Creates a movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1387923-initwithurl?language=objc +func NewMovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) Movie { + instance := MovieClass.Alloc().InitWithURLOptions(URL, options) + instance.Autorelease() + return instance +} + +func (mc _MovieClass) MovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) Movie { + rv := objc.Call[Movie](mc, objc.Sel("movieWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Returns a new movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1458223-moviewithurl?language=objc +func Movie_MovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) Movie { + return MovieClass.MovieWithURLOptions(URL, options) +} + +func (mc _MovieClass) Alloc() Movie { + rv := objc.Call[Movie](mc, objc.Sel("alloc")) + return rv +} + +func Movie_Alloc() Movie { + return MovieClass.Alloc() +} + +func (mc _MovieClass) New() Movie { + rv := objc.Call[Movie](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMovie() Movie { + return MovieClass.New() +} + +func (m_ Movie) Init() Movie { + rv := objc.Call[Movie](m_, objc.Sel("init")) + return rv +} + +func (mc _MovieClass) AssetWithURL(URL foundation.IURL) Movie { + rv := objc.Call[Movie](mc, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func Movie_AssetWithURL(URL foundation.IURL) Movie { + return MovieClass.AssetWithURL(URL) +} + +// Returns the file types that a movie supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388690-movietypes?language=objc +func (mc _MovieClass) MovieTypes() []FileType { + rv := objc.Call[[]FileType](mc, objc.Sel("movieTypes")) + return rv +} + +// Returns the file types that a movie supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388690-movietypes?language=objc +func Movie_MovieTypes() []FileType { + return MovieClass.MovieTypes() +} + +// Writes the movie header to the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1386682-writemovieheadertourl?language=objc +func (m_ Movie) WriteMovieHeaderToURLFileTypeOptionsError(URL foundation.IURL, fileType FileType, options MovieWritingOptions, outError foundation.IError) bool { + rv := objc.Call[bool](m_, objc.Sel("writeMovieHeaderToURL:fileType:options:error:"), objc.Ptr(URL), fileType, options, objc.Ptr(outError)) + return rv +} + +// Returns a Boolean value that indicates whether the system can create a movie header of the specified type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1385982-iscompatiblewithfiletype?language=objc +func (m_ Movie) IsCompatibleWithFileType(fileType FileType) bool { + rv := objc.Call[bool](m_, objc.Sel("isCompatibleWithFileType:"), fileType) + return rv +} + +// Creates a header for a movie for the specified file type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1386686-movieheaderwithfiletype?language=objc +func (m_ Movie) MovieHeaderWithFileTypeError(fileType FileType, outError foundation.IError) []byte { + rv := objc.Call[[]byte](m_, objc.Sel("movieHeaderWithFileType:error:"), fileType, objc.Ptr(outError)) + return rv +} + +// The default storage container for media data added to a movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388424-defaultmediadatastorage?language=objc +func (m_ Movie) DefaultMediaDataStorage() MediaDataStorage { + rv := objc.Call[MediaDataStorage](m_, objc.Sel("defaultMediaDataStorage")) + return rv +} + +// A Boolean value that indicates whether at least one movie fragment extends the movie file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388597-containsmoviefragments?language=objc +func (m_ Movie) ContainsMovieFragments() bool { + rv := objc.Call[bool](m_, objc.Sel("containsMovieFragments")) + return rv +} + +// A data object that contains the movie file’s data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388017-data?language=objc +func (m_ Movie) Data() []byte { + rv := objc.Call[[]byte](m_, objc.Sel("data")) + return rv +} + +// A URL to a QuickTime or ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1386990-url?language=objc +func (m_ Movie) URL() foundation.URL { + rv := objc.Call[foundation.URL](m_, objc.Sel("URL")) + return rv +} + +// A Boolean value that indicates whether fragments can extend the movie file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1387333-cancontainmoviefragments?language=objc +func (m_ Movie) CanContainMovieFragments() bool { + rv := objc.Call[bool](m_, objc.Sel("canContainMovieFragments")) + return rv +} diff --git a/macos/avfoundation/movie_track.gen.go b/macos/avfoundation/movie_track.gen.go new file mode 100644 index 00000000..07b270eb --- /dev/null +++ b/macos/avfoundation/movie_track.gen.go @@ -0,0 +1,95 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MovieTrack] class. +var MovieTrackClass = _MovieTrackClass{objc.GetClass("AVMovieTrack")} + +type _MovieTrackClass struct { + objc.Class +} + +// An interface definition for the [MovieTrack] class. +type IMovieTrack interface { + IAssetTrack + MediaPresentationTimeRange() coremedia.TimeRange + AlternateGroupID() int + MediaDataStorage() MediaDataStorage + MediaDecodeTimeRange() coremedia.TimeRange +} + +// A track in a movie that conforms to the QuickTime or ISO base media file format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovietrack?language=objc +type MovieTrack struct { + AssetTrack +} + +func MovieTrackFrom(ptr unsafe.Pointer) MovieTrack { + return MovieTrack{ + AssetTrack: AssetTrackFrom(ptr), + } +} + +func (mc _MovieTrackClass) Alloc() MovieTrack { + rv := objc.Call[MovieTrack](mc, objc.Sel("alloc")) + return rv +} + +func MovieTrack_Alloc() MovieTrack { + return MovieTrackClass.Alloc() +} + +func (mc _MovieTrackClass) New() MovieTrack { + rv := objc.Call[MovieTrack](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMovieTrack() MovieTrack { + return MovieTrackClass.New() +} + +func (m_ MovieTrack) Init() MovieTrack { + rv := objc.Call[MovieTrack](m_, objc.Sel("init")) + return rv +} + +// A range of presentation times for the track’s media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovietrack/1389982-mediapresentationtimerange?language=objc +func (m_ MovieTrack) MediaPresentationTimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](m_, objc.Sel("mediaPresentationTimeRange")) + return rv +} + +// A value that identifies the track as a member of a particular alternate group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovietrack/1387020-alternategroupid?language=objc +func (m_ MovieTrack) AlternateGroupID() int { + rv := objc.Call[int](m_, objc.Sel("alternateGroupID")) + return rv +} + +// The storage container for media data added to a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovietrack/1386868-mediadatastorage?language=objc +func (m_ MovieTrack) MediaDataStorage() MediaDataStorage { + rv := objc.Call[MediaDataStorage](m_, objc.Sel("mediaDataStorage")) + return rv +} + +// A range of decode times for the track’s media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovietrack/1388187-mediadecodetimerange?language=objc +func (m_ MovieTrack) MediaDecodeTimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](m_, objc.Sel("mediaDecodeTimeRange")) + return rv +} diff --git a/macos/avfoundation/mutable_asset_download_storage_management_policy.gen.go b/macos/avfoundation/mutable_asset_download_storage_management_policy.gen.go new file mode 100644 index 00000000..840c5958 --- /dev/null +++ b/macos/avfoundation/mutable_asset_download_storage_management_policy.gen.go @@ -0,0 +1,75 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableAssetDownloadStorageManagementPolicy] class. +var MutableAssetDownloadStorageManagementPolicyClass = _MutableAssetDownloadStorageManagementPolicyClass{objc.GetClass("AVMutableAssetDownloadStorageManagementPolicy")} + +type _MutableAssetDownloadStorageManagementPolicyClass struct { + objc.Class +} + +// An interface definition for the [MutableAssetDownloadStorageManagementPolicy] class. +type IMutableAssetDownloadStorageManagementPolicy interface { + IAssetDownloadStorageManagementPolicy + SetPriority(value AssetDownloadedAssetEvictionPriority) + SetExpirationDate(value foundation.IDate) +} + +// A mutable object that you use to create a new storage management policy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableassetdownloadstoragemanagementpolicy?language=objc +type MutableAssetDownloadStorageManagementPolicy struct { + AssetDownloadStorageManagementPolicy +} + +func MutableAssetDownloadStorageManagementPolicyFrom(ptr unsafe.Pointer) MutableAssetDownloadStorageManagementPolicy { + return MutableAssetDownloadStorageManagementPolicy{ + AssetDownloadStorageManagementPolicy: AssetDownloadStorageManagementPolicyFrom(ptr), + } +} + +func (mc _MutableAssetDownloadStorageManagementPolicyClass) Alloc() MutableAssetDownloadStorageManagementPolicy { + rv := objc.Call[MutableAssetDownloadStorageManagementPolicy](mc, objc.Sel("alloc")) + return rv +} + +func MutableAssetDownloadStorageManagementPolicy_Alloc() MutableAssetDownloadStorageManagementPolicy { + return MutableAssetDownloadStorageManagementPolicyClass.Alloc() +} + +func (mc _MutableAssetDownloadStorageManagementPolicyClass) New() MutableAssetDownloadStorageManagementPolicy { + rv := objc.Call[MutableAssetDownloadStorageManagementPolicy](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableAssetDownloadStorageManagementPolicy() MutableAssetDownloadStorageManagementPolicy { + return MutableAssetDownloadStorageManagementPolicyClass.New() +} + +func (m_ MutableAssetDownloadStorageManagementPolicy) Init() MutableAssetDownloadStorageManagementPolicy { + rv := objc.Call[MutableAssetDownloadStorageManagementPolicy](m_, objc.Sel("init")) + return rv +} + +// The eviction priority for a downloaded asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableassetdownloadstoragemanagementpolicy/2865558-priority?language=objc +func (m_ MutableAssetDownloadStorageManagementPolicy) SetPriority(value AssetDownloadedAssetEvictionPriority) { + objc.Call[objc.Void](m_, objc.Sel("setPriority:"), value) +} + +// The expiration date for an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableassetdownloadstoragemanagementpolicy/2865564-expirationdate?language=objc +func (m_ MutableAssetDownloadStorageManagementPolicy) SetExpirationDate(value foundation.IDate) { + objc.Call[objc.Void](m_, objc.Sel("setExpirationDate:"), objc.Ptr(value)) +} diff --git a/macos/avfoundation/mutable_audio_mix.gen.go b/macos/avfoundation/mutable_audio_mix.gen.go new file mode 100644 index 00000000..cc80fe95 --- /dev/null +++ b/macos/avfoundation/mutable_audio_mix.gen.go @@ -0,0 +1,78 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableAudioMix] class. +var MutableAudioMixClass = _MutableAudioMixClass{objc.GetClass("AVMutableAudioMix")} + +type _MutableAudioMixClass struct { + objc.Class +} + +// An interface definition for the [MutableAudioMix] class. +type IMutableAudioMix interface { + IAudioMix + SetInputParameters(value []IAudioMixInputParameters) +} + +// An object that manages the input parameters for mixing audio tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomix?language=objc +type MutableAudioMix struct { + AudioMix +} + +func MutableAudioMixFrom(ptr unsafe.Pointer) MutableAudioMix { + return MutableAudioMix{ + AudioMix: AudioMixFrom(ptr), + } +} + +func (mc _MutableAudioMixClass) AudioMix() MutableAudioMix { + rv := objc.Call[MutableAudioMix](mc, objc.Sel("audioMix")) + return rv +} + +// Returns a new mutable audio mix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomix/1560973-audiomix?language=objc +func MutableAudioMix_AudioMix() MutableAudioMix { + return MutableAudioMixClass.AudioMix() +} + +func (mc _MutableAudioMixClass) Alloc() MutableAudioMix { + rv := objc.Call[MutableAudioMix](mc, objc.Sel("alloc")) + return rv +} + +func MutableAudioMix_Alloc() MutableAudioMix { + return MutableAudioMixClass.Alloc() +} + +func (mc _MutableAudioMixClass) New() MutableAudioMix { + rv := objc.Call[MutableAudioMix](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableAudioMix() MutableAudioMix { + return MutableAudioMixClass.New() +} + +func (m_ MutableAudioMix) Init() MutableAudioMix { + rv := objc.Call[MutableAudioMix](m_, objc.Sel("init")) + return rv +} + +// An array of input parameters for the mix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomix/1388159-inputparameters?language=objc +func (m_ MutableAudioMix) SetInputParameters(value []IAudioMixInputParameters) { + objc.Call[objc.Void](m_, objc.Sel("setInputParameters:"), value) +} diff --git a/macos/avfoundation/mutable_audio_mix_input_parameters.gen.go b/macos/avfoundation/mutable_audio_mix_input_parameters.gen.go new file mode 100644 index 00000000..21d457e6 --- /dev/null +++ b/macos/avfoundation/mutable_audio_mix_input_parameters.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableAudioMixInputParameters] class. +var MutableAudioMixInputParametersClass = _MutableAudioMixInputParametersClass{objc.GetClass("AVMutableAudioMixInputParameters")} + +type _MutableAudioMixInputParametersClass struct { + objc.Class +} + +// An interface definition for the [MutableAudioMixInputParameters] class. +type IMutableAudioMixInputParameters interface { + IAudioMixInputParameters + SetVolumeRampFromStartVolumeToEndVolumeTimeRange(startVolume float64, endVolume float64, timeRange coremedia.TimeRange) + SetVolumeAtTime(volume float64, time coremedia.Time) + SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) + SetTrackID(value objc.IObject) + SetAudioTapProcessor(value objc.IObject) +} + +// The parameters you use when adding an audio track to a mix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters?language=objc +type MutableAudioMixInputParameters struct { + AudioMixInputParameters +} + +func MutableAudioMixInputParametersFrom(ptr unsafe.Pointer) MutableAudioMixInputParameters { + return MutableAudioMixInputParameters{ + AudioMixInputParameters: AudioMixInputParametersFrom(ptr), + } +} + +func (mc _MutableAudioMixInputParametersClass) AudioMixInputParameters() MutableAudioMixInputParameters { + rv := objc.Call[MutableAudioMixInputParameters](mc, objc.Sel("audioMixInputParameters")) + return rv +} + +// Creates a mutable input parameters object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters/1560974-audiomixinputparameters?language=objc +func MutableAudioMixInputParameters_AudioMixInputParameters() MutableAudioMixInputParameters { + return MutableAudioMixInputParametersClass.AudioMixInputParameters() +} + +func (mc _MutableAudioMixInputParametersClass) AudioMixInputParametersWithTrack(track IAssetTrack) MutableAudioMixInputParameters { + rv := objc.Call[MutableAudioMixInputParameters](mc, objc.Sel("audioMixInputParametersWithTrack:"), objc.Ptr(track)) + return rv +} + +// Creates a mutable input parameters object for a given track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters/1386858-audiomixinputparameterswithtrack?language=objc +func MutableAudioMixInputParameters_AudioMixInputParametersWithTrack(track IAssetTrack) MutableAudioMixInputParameters { + return MutableAudioMixInputParametersClass.AudioMixInputParametersWithTrack(track) +} + +func (mc _MutableAudioMixInputParametersClass) Alloc() MutableAudioMixInputParameters { + rv := objc.Call[MutableAudioMixInputParameters](mc, objc.Sel("alloc")) + return rv +} + +func MutableAudioMixInputParameters_Alloc() MutableAudioMixInputParameters { + return MutableAudioMixInputParametersClass.Alloc() +} + +func (mc _MutableAudioMixInputParametersClass) New() MutableAudioMixInputParameters { + rv := objc.Call[MutableAudioMixInputParameters](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableAudioMixInputParameters() MutableAudioMixInputParameters { + return MutableAudioMixInputParametersClass.New() +} + +func (m_ MutableAudioMixInputParameters) Init() MutableAudioMixInputParameters { + rv := objc.Call[MutableAudioMixInputParameters](m_, objc.Sel("init")) + return rv +} + +// Sets a volume ramp to apply during a specified time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters/1386056-setvolumerampfromstartvolume?language=objc +func (m_ MutableAudioMixInputParameters) SetVolumeRampFromStartVolumeToEndVolumeTimeRange(startVolume float64, endVolume float64, timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("setVolumeRampFromStartVolume:toEndVolume:timeRange:"), startVolume, endVolume, timeRange) +} + +// Sets the value of the audio volume starting at the specified time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters/1389875-setvolume?language=objc +func (m_ MutableAudioMixInputParameters) SetVolumeAtTime(volume float64, time coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setVolume:atTime:"), volume, time) +} + +// The processing algorithm used to manage audio pitch for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters/1388300-audiotimepitchalgorithm?language=objc +func (m_ MutableAudioMixInputParameters) SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) { + objc.Call[objc.Void](m_, objc.Sel("setAudioTimePitchAlgorithm:"), value) +} + +// The identifier of the audio track to which the parameters should be applied. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters/1389209-trackid?language=objc +func (m_ MutableAudioMixInputParameters) SetTrackID(value objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setTrackID:"), objc.Ptr(value)) +} + +// The audio processing tap associated with the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters/1389296-audiotapprocessor?language=objc +func (m_ MutableAudioMixInputParameters) SetAudioTapProcessor(value objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setAudioTapProcessor:"), objc.Ptr(value)) +} diff --git a/macos/avfoundation/mutable_caption.gen.go b/macos/avfoundation/mutable_caption.gen.go new file mode 100644 index 00000000..0b719aa5 --- /dev/null +++ b/macos/avfoundation/mutable_caption.gen.go @@ -0,0 +1,227 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableCaption] class. +var MutableCaptionClass = _MutableCaptionClass{objc.GetClass("AVMutableCaption")} + +type _MutableCaptionClass struct { + objc.Class +} + +// An interface definition for the [MutableCaption] class. +type IMutableCaption interface { + ICaption + RemoveTextCombineInRange(range_ foundation.Range) + RemoveDecorationInRange(range_ foundation.Range) + RemoveTextColorInRange(range_ foundation.Range) + RemoveFontStyleInRange(range_ foundation.Range) + SetDecorationInRange(decoration CaptionDecoration, range_ foundation.Range) + SetRubyInRange(ruby ICaptionRuby, range_ foundation.Range) + SetFontWeightInRange(fontWeight CaptionFontWeight, range_ foundation.Range) + SetFontStyleInRange(fontStyle CaptionFontStyle, range_ foundation.Range) + RemoveBackgroundColorInRange(range_ foundation.Range) + RemoveFontWeightInRange(range_ foundation.Range) + RemoveRubyInRange(range_ foundation.Range) + SetBackgroundColorInRange(color coregraphics.ColorRef, range_ foundation.Range) + SetTextCombineInRange(textCombine CaptionTextCombine, range_ foundation.Range) + SetTextColorInRange(color coregraphics.ColorRef, range_ foundation.Range) + SetAnimation(value CaptionAnimation) + SetTextAlignment(value CaptionTextAlignment) + SetTimeRange(value coremedia.TimeRange) + SetRegion(value ICaptionRegion) + SetText(value string) +} + +// A mutable caption subclass that you use to create new captions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption?language=objc +type MutableCaption struct { + Caption +} + +func MutableCaptionFrom(ptr unsafe.Pointer) MutableCaption { + return MutableCaption{ + Caption: CaptionFrom(ptr), + } +} + +func (mc _MutableCaptionClass) Alloc() MutableCaption { + rv := objc.Call[MutableCaption](mc, objc.Sel("alloc")) + return rv +} + +func MutableCaption_Alloc() MutableCaption { + return MutableCaptionClass.Alloc() +} + +func (mc _MutableCaptionClass) New() MutableCaption { + rv := objc.Call[MutableCaption](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableCaption() MutableCaption { + return MutableCaptionClass.New() +} + +func (m_ MutableCaption) Init() MutableCaption { + rv := objc.Call[MutableCaption](m_, objc.Sel("init")) + return rv +} + +func (m_ MutableCaption) InitWithTextTimeRange(text string, timeRange coremedia.TimeRange) MutableCaption { + rv := objc.Call[MutableCaption](m_, objc.Sel("initWithText:timeRange:"), text, timeRange) + return rv +} + +// Creates a caption that contains text and a time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avcaption/3752820-initwithtext?language=objc +func NewMutableCaptionWithTextTimeRange(text string, timeRange coremedia.TimeRange) MutableCaption { + instance := MutableCaptionClass.Alloc().InitWithTextTimeRange(text, timeRange) + instance.Autorelease() + return instance +} + +// Removes text combine from a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752907-removetextcombineinrange?language=objc +func (m_ MutableCaption) RemoveTextCombineInRange(range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("removeTextCombineInRange:"), range_) +} + +// Removes a decoration from a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752902-removedecorationinrange?language=objc +func (m_ MutableCaption) RemoveDecorationInRange(range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("removeDecorationInRange:"), range_) +} + +// Removes the text color for a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752906-removetextcolorinrange?language=objc +func (m_ MutableCaption) RemoveTextColorInRange(range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("removeTextColorInRange:"), range_) +} + +// Removes a font style from a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752903-removefontstyleinrange?language=objc +func (m_ MutableCaption) RemoveFontStyleInRange(range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("removeFontStyleInRange:"), range_) +} + +// Sets a decoration for a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752909-setdecoration?language=objc +func (m_ MutableCaption) SetDecorationInRange(decoration CaptionDecoration, range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("setDecoration:inRange:"), decoration, range_) +} + +// Sets ruby text for a range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752912-setruby?language=objc +func (m_ MutableCaption) SetRubyInRange(ruby ICaptionRuby, range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("setRuby:inRange:"), objc.Ptr(ruby), range_) +} + +// Sets the font weight for a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752911-setfontweight?language=objc +func (m_ MutableCaption) SetFontWeightInRange(fontWeight CaptionFontWeight, range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("setFontWeight:inRange:"), fontWeight, range_) +} + +// Sets the font style for a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752910-setfontstyle?language=objc +func (m_ MutableCaption) SetFontStyleInRange(fontStyle CaptionFontStyle, range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("setFontStyle:inRange:"), fontStyle, range_) +} + +// Removes a background color from a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752901-removebackgroundcolorinrange?language=objc +func (m_ MutableCaption) RemoveBackgroundColorInRange(range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("removeBackgroundColorInRange:"), range_) +} + +// Removes a font weight from a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752904-removefontweightinrange?language=objc +func (m_ MutableCaption) RemoveFontWeightInRange(range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("removeFontWeightInRange:"), range_) +} + +// Removes ruby text from a range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752905-removerubyinrange?language=objc +func (m_ MutableCaption) RemoveRubyInRange(range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("removeRubyInRange:"), range_) +} + +// Sets the background color for a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752908-setbackgroundcolor?language=objc +func (m_ MutableCaption) SetBackgroundColorInRange(color coregraphics.ColorRef, range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("setBackgroundColor:inRange:"), color, range_) +} + +// Sets text combine for a range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752914-settextcombine?language=objc +func (m_ MutableCaption) SetTextCombineInRange(textCombine CaptionTextCombine, range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("setTextCombine:inRange:"), textCombine, range_) +} + +// Sets the text color for a range of text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752913-settextcolor?language=objc +func (m_ MutableCaption) SetTextColorInRange(color coregraphics.ColorRef, range_ foundation.Range) { + objc.Call[objc.Void](m_, objc.Sel("setTextColor:inRange:"), color, range_) +} + +// Animations to apply to the caption text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752899-animation?language=objc +func (m_ MutableCaption) SetAnimation(value CaptionAnimation) { + objc.Call[objc.Void](m_, objc.Sel("setAnimation:"), value) +} + +// The alignment of the caption text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752916-textalignment?language=objc +func (m_ MutableCaption) SetTextAlignment(value CaptionTextAlignment) { + objc.Call[objc.Void](m_, objc.Sel("setTextAlignment:"), value) +} + +// The time range over which the system presents the caption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752917-timerange?language=objc +func (m_ MutableCaption) SetTimeRange(value coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("setTimeRange:"), value) +} + +// The region in which the caption exists. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752900-region?language=objc +func (m_ MutableCaption) SetRegion(value ICaptionRegion) { + objc.Call[objc.Void](m_, objc.Sel("setRegion:"), objc.Ptr(value)) +} + +// The caption text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaption/3752915-text?language=objc +func (m_ MutableCaption) SetText(value string) { + objc.Call[objc.Void](m_, objc.Sel("setText:"), value) +} diff --git a/macos/avfoundation/mutable_caption_region.gen.go b/macos/avfoundation/mutable_caption_region.gen.go new file mode 100644 index 00000000..cfb842bd --- /dev/null +++ b/macos/avfoundation/mutable_caption_region.gen.go @@ -0,0 +1,112 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableCaptionRegion] class. +var MutableCaptionRegionClass = _MutableCaptionRegionClass{objc.GetClass("AVMutableCaptionRegion")} + +type _MutableCaptionRegionClass struct { + objc.Class +} + +// An interface definition for the [MutableCaptionRegion] class. +type IMutableCaptionRegion interface { + ICaptionRegion + SetOrigin(value CaptionPoint) + SetScroll(value CaptionRegionScroll) + SetWritingMode(value CaptionRegionWritingMode) + SetSize(value CaptionSize) + SetDisplayAlignment(value CaptionRegionDisplayAlignment) +} + +// A mutable caption region subclass that you use to create new caption regions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaptionregion?language=objc +type MutableCaptionRegion struct { + CaptionRegion +} + +func MutableCaptionRegionFrom(ptr unsafe.Pointer) MutableCaptionRegion { + return MutableCaptionRegion{ + CaptionRegion: CaptionRegionFrom(ptr), + } +} + +func (m_ MutableCaptionRegion) InitWithIdentifier(identifier string) MutableCaptionRegion { + rv := objc.Call[MutableCaptionRegion](m_, objc.Sel("initWithIdentifier:"), identifier) + return rv +} + +// Creates a caption region that has an identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaptionregion/3752923-initwithidentifier?language=objc +func NewMutableCaptionRegionWithIdentifier(identifier string) MutableCaptionRegion { + instance := MutableCaptionRegionClass.Alloc().InitWithIdentifier(identifier) + instance.Autorelease() + return instance +} + +func (m_ MutableCaptionRegion) Init() MutableCaptionRegion { + rv := objc.Call[MutableCaptionRegion](m_, objc.Sel("init")) + return rv +} + +func (mc _MutableCaptionRegionClass) Alloc() MutableCaptionRegion { + rv := objc.Call[MutableCaptionRegion](mc, objc.Sel("alloc")) + return rv +} + +func MutableCaptionRegion_Alloc() MutableCaptionRegion { + return MutableCaptionRegionClass.Alloc() +} + +func (mc _MutableCaptionRegionClass) New() MutableCaptionRegion { + rv := objc.Call[MutableCaptionRegion](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableCaptionRegion() MutableCaptionRegion { + return MutableCaptionRegionClass.New() +} + +// The region’s top-left position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaptionregion/3857638-origin?language=objc +func (m_ MutableCaptionRegion) SetOrigin(value CaptionPoint) { + objc.Call[objc.Void](m_, objc.Sel("setOrigin:"), value) +} + +// The scroll mode of the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaptionregion/3752925-scroll?language=objc +func (m_ MutableCaptionRegion) SetScroll(value CaptionRegionScroll) { + objc.Call[objc.Void](m_, objc.Sel("setScroll:"), value) +} + +// The block and inline progression direction of the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaptionregion/3752926-writingmode?language=objc +func (m_ MutableCaptionRegion) SetWritingMode(value CaptionRegionWritingMode) { + objc.Call[objc.Void](m_, objc.Sel("setWritingMode:"), value) +} + +// The height and width of the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaptionregion/3857639-size?language=objc +func (m_ MutableCaptionRegion) SetSize(value CaptionSize) { + objc.Call[objc.Void](m_, objc.Sel("setSize:"), value) +} + +// The alignment of lines for the region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecaptionregion/3752919-displayalignment?language=objc +func (m_ MutableCaptionRegion) SetDisplayAlignment(value CaptionRegionDisplayAlignment) { + objc.Call[objc.Void](m_, objc.Sel("setDisplayAlignment:"), value) +} diff --git a/macos/avfoundation/mutable_composition.gen.go b/macos/avfoundation/mutable_composition.gen.go new file mode 100644 index 00000000..a413c47f --- /dev/null +++ b/macos/avfoundation/mutable_composition.gen.go @@ -0,0 +1,155 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableComposition] class. +var MutableCompositionClass = _MutableCompositionClass{objc.GetClass("AVMutableComposition")} + +type _MutableCompositionClass struct { + objc.Class +} + +// An interface definition for the [MutableComposition] class. +type IMutableComposition interface { + IComposition + RemoveTimeRange(timeRange coremedia.TimeRange) + MutableTrackCompatibleWithTrack(track IAssetTrack) MutableCompositionTrack + RemoveTrack(track ICompositionTrack) + AddMutableTrackWithMediaTypePreferredTrackID(mediaType MediaType, preferredTrackID objc.IObject) MutableCompositionTrack + ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) + InsertEmptyTimeRange(timeRange coremedia.TimeRange) + SetNaturalSize(value coregraphics.Size) +} + +// An object that you use to create a new composition from existing assets. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition?language=objc +type MutableComposition struct { + Composition +} + +func MutableCompositionFrom(ptr unsafe.Pointer) MutableComposition { + return MutableComposition{ + Composition: CompositionFrom(ptr), + } +} + +func (mc _MutableCompositionClass) CompositionWithURLAssetInitializationOptions(URLAssetInitializationOptions map[string]objc.IObject) MutableComposition { + rv := objc.Call[MutableComposition](mc, objc.Sel("compositionWithURLAssetInitializationOptions:"), URLAssetInitializationOptions) + return rv +} + +// Creates a mutable composition that uses the specified initialization options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1390705-compositionwithurlassetinitializ?language=objc +func MutableComposition_CompositionWithURLAssetInitializationOptions(URLAssetInitializationOptions map[string]objc.IObject) MutableComposition { + return MutableCompositionClass.CompositionWithURLAssetInitializationOptions(URLAssetInitializationOptions) +} + +func (mc _MutableCompositionClass) Composition() MutableComposition { + rv := objc.Call[MutableComposition](mc, objc.Sel("composition")) + return rv +} + +// Returns a new mutable composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1495098-composition?language=objc +func MutableComposition_Composition() MutableComposition { + return MutableCompositionClass.Composition() +} + +func (mc _MutableCompositionClass) Alloc() MutableComposition { + rv := objc.Call[MutableComposition](mc, objc.Sel("alloc")) + return rv +} + +func MutableComposition_Alloc() MutableComposition { + return MutableCompositionClass.Alloc() +} + +func (mc _MutableCompositionClass) New() MutableComposition { + rv := objc.Call[MutableComposition](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableComposition() MutableComposition { + return MutableCompositionClass.New() +} + +func (m_ MutableComposition) Init() MutableComposition { + rv := objc.Call[MutableComposition](m_, objc.Sel("init")) + return rv +} + +func (mc _MutableCompositionClass) AssetWithURL(URL foundation.IURL) MutableComposition { + rv := objc.Call[MutableComposition](mc, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func MutableComposition_AssetWithURL(URL foundation.IURL) MutableComposition { + return MutableCompositionClass.AssetWithURL(URL) +} + +// Removes a specified time range from all tracks of the composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1387768-removetimerange?language=objc +func (m_ MutableComposition) RemoveTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("removeTimeRange:"), timeRange) +} + +// Returns a composition track into which you can insert any time range of the specified asset track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1386662-mutabletrackcompatiblewithtrack?language=objc +func (m_ MutableComposition) MutableTrackCompatibleWithTrack(track IAssetTrack) MutableCompositionTrack { + rv := objc.Call[MutableCompositionTrack](m_, objc.Sel("mutableTrackCompatibleWithTrack:"), objc.Ptr(track)) + return rv +} + +// Removes a specified track from the composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1386818-removetrack?language=objc +func (m_ MutableComposition) RemoveTrack(track ICompositionTrack) { + objc.Call[objc.Void](m_, objc.Sel("removeTrack:"), objc.Ptr(track)) +} + +// Adds an empty track to a composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1387601-addmutabletrackwithmediatype?language=objc +func (m_ MutableComposition) AddMutableTrackWithMediaTypePreferredTrackID(mediaType MediaType, preferredTrackID objc.IObject) MutableCompositionTrack { + rv := objc.Call[MutableCompositionTrack](m_, objc.Sel("addMutableTrackWithMediaType:preferredTrackID:"), mediaType, objc.Ptr(preferredTrackID)) + return rv +} + +// Changes the duration of all tracks in a given time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1390549-scaletimerange?language=objc +func (m_ MutableComposition) ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("scaleTimeRange:toDuration:"), timeRange, duration) +} + +// Adds or extends an empty time range within all tracks of the composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1386710-insertemptytimerange?language=objc +func (m_ MutableComposition) InsertEmptyTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("insertEmptyTimeRange:"), timeRange) +} + +// The encoded or authored size of the visual portion of the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecomposition/1390424-naturalsize?language=objc +func (m_ MutableComposition) SetNaturalSize(value coregraphics.Size) { + objc.Call[objc.Void](m_, objc.Sel("setNaturalSize:"), value) +} diff --git a/macos/avfoundation/mutable_composition_track.gen.go b/macos/avfoundation/mutable_composition_track.gen.go new file mode 100644 index 00000000..9ee9a516 --- /dev/null +++ b/macos/avfoundation/mutable_composition_track.gen.go @@ -0,0 +1,192 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableCompositionTrack] class. +var MutableCompositionTrackClass = _MutableCompositionTrackClass{objc.GetClass("AVMutableCompositionTrack")} + +type _MutableCompositionTrackClass struct { + objc.Class +} + +// An interface definition for the [MutableCompositionTrack] class. +type IMutableCompositionTrack interface { + ICompositionTrack + RemoveTrackAssociationToTrackType(compositionTrack ICompositionTrack, trackAssociationType TrackAssociationType) + AddTrackAssociationToTrackType(compositionTrack ICompositionTrack, trackAssociationType TrackAssociationType) + RemoveTimeRange(timeRange coremedia.TimeRange) + ValidateTrackSegmentsError(trackSegments []ICompositionTrackSegment, outError foundation.IError) bool + InsertTimeRangesOfTracksAtTimeError(timeRanges []foundation.IValue, tracks []IAssetTrack, startTime coremedia.Time, outError foundation.IError) bool + InsertTimeRangeOfTrackAtTimeError(timeRange coremedia.TimeRange, track IAssetTrack, startTime coremedia.Time, outError foundation.IError) bool + ReplaceFormatDescriptionWithFormatDescription(originalFormatDescription coremedia.FormatDescriptionRef, replacementFormatDescription coremedia.FormatDescriptionRef) + ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) + InsertEmptyTimeRange(timeRange coremedia.TimeRange) + SetExtendedLanguageTag(value string) + SetPreferredVolume(value float64) + SetSegments(value []ICompositionTrackSegment) + SetLanguageCode(value string) + SetEnabled(value bool) + SetNaturalTimeScale(value coremedia.TimeScale) + SetPreferredTransform(value coregraphics.AffineTransform) +} + +// A mutable track in a composition that you use to insert, remove, and scale track segments without affecting their low-level representation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack?language=objc +type MutableCompositionTrack struct { + CompositionTrack +} + +func MutableCompositionTrackFrom(ptr unsafe.Pointer) MutableCompositionTrack { + return MutableCompositionTrack{ + CompositionTrack: CompositionTrackFrom(ptr), + } +} + +func (mc _MutableCompositionTrackClass) Alloc() MutableCompositionTrack { + rv := objc.Call[MutableCompositionTrack](mc, objc.Sel("alloc")) + return rv +} + +func MutableCompositionTrack_Alloc() MutableCompositionTrack { + return MutableCompositionTrackClass.Alloc() +} + +func (mc _MutableCompositionTrackClass) New() MutableCompositionTrack { + rv := objc.Call[MutableCompositionTrack](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableCompositionTrack() MutableCompositionTrack { + return MutableCompositionTrackClass.New() +} + +func (m_ MutableCompositionTrack) Init() MutableCompositionTrack { + rv := objc.Call[MutableCompositionTrack](m_, objc.Sel("init")) + return rv +} + +// Removes an association from a composition track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/3013765-removetrackassociationtotrack?language=objc +func (m_ MutableCompositionTrack) RemoveTrackAssociationToTrackType(compositionTrack ICompositionTrack, trackAssociationType TrackAssociationType) { + objc.Call[objc.Void](m_, objc.Sel("removeTrackAssociationToTrack:type:"), objc.Ptr(compositionTrack), trackAssociationType) +} + +// Establishes a track association of a specific type between two tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/3013764-addtrackassociationtotrack?language=objc +func (m_ MutableCompositionTrack) AddTrackAssociationToTrackType(compositionTrack ICompositionTrack, trackAssociationType TrackAssociationType) { + objc.Call[objc.Void](m_, objc.Sel("addTrackAssociationToTrack:type:"), objc.Ptr(compositionTrack), trackAssociationType) +} + +// Removes a time range of media from a composition track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1386048-removetimerange?language=objc +func (m_ MutableCompositionTrack) RemoveTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("removeTimeRange:"), timeRange) +} + +// Returns a Boolean value that indicates whether a given array of track segments conform to the timing rules for a composition track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1388746-validatetracksegments?language=objc +func (m_ MutableCompositionTrack) ValidateTrackSegmentsError(trackSegments []ICompositionTrackSegment, outError foundation.IError) bool { + rv := objc.Call[bool](m_, objc.Sel("validateTrackSegments:error:"), trackSegments, objc.Ptr(outError)) + return rv +} + +// Inserts the time ranges of multiple source tracks into a track of a composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1388629-inserttimeranges?language=objc +func (m_ MutableCompositionTrack) InsertTimeRangesOfTracksAtTimeError(timeRanges []foundation.IValue, tracks []IAssetTrack, startTime coremedia.Time, outError foundation.IError) bool { + rv := objc.Call[bool](m_, objc.Sel("insertTimeRanges:ofTracks:atTime:error:"), timeRanges, tracks, startTime, objc.Ptr(outError)) + return rv +} + +// Inserts a time range of media from a source track into a composition track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1390691-inserttimerange?language=objc +func (m_ MutableCompositionTrack) InsertTimeRangeOfTrackAtTimeError(timeRange coremedia.TimeRange, track IAssetTrack, startTime coremedia.Time, outError foundation.IError) bool { + rv := objc.Call[bool](m_, objc.Sel("insertTimeRange:ofTrack:atTime:error:"), timeRange, objc.Ptr(track), startTime, objc.Ptr(outError)) + return rv +} + +// Replaces a format description with another or cancels a previous replacement. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/3180005-replaceformatdescription?language=objc +func (m_ MutableCompositionTrack) ReplaceFormatDescriptionWithFormatDescription(originalFormatDescription coremedia.FormatDescriptionRef, replacementFormatDescription coremedia.FormatDescriptionRef) { + objc.Call[objc.Void](m_, objc.Sel("replaceFormatDescription:withFormatDescription:"), originalFormatDescription, replacementFormatDescription) +} + +// Changes the duration of a time range of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1388212-scaletimerange?language=objc +func (m_ MutableCompositionTrack) ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("scaleTimeRange:toDuration:"), timeRange, duration) +} + +// Adds or extends an empty time range within the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1389483-insertemptytimerange?language=objc +func (m_ MutableCompositionTrack) InsertEmptyTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("insertEmptyTimeRange:"), timeRange) +} + +// The language tag associated with the track, as an RFC 4646 language tag. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1388866-extendedlanguagetag?language=objc +func (m_ MutableCompositionTrack) SetExtendedLanguageTag(value string) { + objc.Call[objc.Void](m_, objc.Sel("setExtendedLanguageTag:"), value) +} + +// The volume the track prefers for its audible media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1388649-preferredvolume?language=objc +func (m_ MutableCompositionTrack) SetPreferredVolume(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredVolume:"), value) +} + +// The track segments that a composition track contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1390321-segments?language=objc +func (m_ MutableCompositionTrack) SetSegments(value []ICompositionTrackSegment) { + objc.Call[objc.Void](m_, objc.Sel("setSegments:"), value) +} + +// The language associated with the track, as an ISO 639-2/T language code. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1387192-languagecode?language=objc +func (m_ MutableCompositionTrack) SetLanguageCode(value string) { + objc.Call[objc.Void](m_, objc.Sel("setLanguageCode:"), value) +} + +// A Boolean value that indicates whether the tracks is in an enabled state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/3334926-enabled?language=objc +func (m_ MutableCompositionTrack) SetEnabled(value bool) { + objc.Call[objc.Void](m_, objc.Sel("setEnabled:"), value) +} + +// The time scale in which you can perform time-based operations without extra numerical conversion. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1389030-naturaltimescale?language=objc +func (m_ MutableCompositionTrack) SetNaturalTimeScale(value coremedia.TimeScale) { + objc.Call[objc.Void](m_, objc.Sel("setNaturalTimeScale:"), value) +} + +// The preferred transformation of the visual media data for display purposes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablecompositiontrack/1388304-preferredtransform?language=objc +func (m_ MutableCompositionTrack) SetPreferredTransform(value coregraphics.AffineTransform) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredTransform:"), value) +} diff --git a/macos/avfoundation/mutable_date_range_metadata_group.gen.go b/macos/avfoundation/mutable_date_range_metadata_group.gen.go new file mode 100644 index 00000000..078f9fce --- /dev/null +++ b/macos/avfoundation/mutable_date_range_metadata_group.gen.go @@ -0,0 +1,97 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableDateRangeMetadataGroup] class. +var MutableDateRangeMetadataGroupClass = _MutableDateRangeMetadataGroupClass{objc.GetClass("AVMutableDateRangeMetadataGroup")} + +type _MutableDateRangeMetadataGroupClass struct { + objc.Class +} + +// An interface definition for the [MutableDateRangeMetadataGroup] class. +type IMutableDateRangeMetadataGroup interface { + IDateRangeMetadataGroup + SetItems(value []IMetadataItem) + SetStartDate(value foundation.IDate) + SetEndDate(value foundation.IDate) +} + +// A mutable collection of metadata items that are valid for use within a specific range of dates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutabledaterangemetadatagroup?language=objc +type MutableDateRangeMetadataGroup struct { + DateRangeMetadataGroup +} + +func MutableDateRangeMetadataGroupFrom(ptr unsafe.Pointer) MutableDateRangeMetadataGroup { + return MutableDateRangeMetadataGroup{ + DateRangeMetadataGroup: DateRangeMetadataGroupFrom(ptr), + } +} + +func (mc _MutableDateRangeMetadataGroupClass) Alloc() MutableDateRangeMetadataGroup { + rv := objc.Call[MutableDateRangeMetadataGroup](mc, objc.Sel("alloc")) + return rv +} + +func MutableDateRangeMetadataGroup_Alloc() MutableDateRangeMetadataGroup { + return MutableDateRangeMetadataGroupClass.Alloc() +} + +func (mc _MutableDateRangeMetadataGroupClass) New() MutableDateRangeMetadataGroup { + rv := objc.Call[MutableDateRangeMetadataGroup](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableDateRangeMetadataGroup() MutableDateRangeMetadataGroup { + return MutableDateRangeMetadataGroupClass.New() +} + +func (m_ MutableDateRangeMetadataGroup) Init() MutableDateRangeMetadataGroup { + rv := objc.Call[MutableDateRangeMetadataGroup](m_, objc.Sel("init")) + return rv +} + +func (m_ MutableDateRangeMetadataGroup) InitWithItemsStartDateEndDate(items []IMetadataItem, startDate foundation.IDate, endDate foundation.IDate) MutableDateRangeMetadataGroup { + rv := objc.Call[MutableDateRangeMetadataGroup](m_, objc.Sel("initWithItems:startDate:endDate:"), items, objc.Ptr(startDate), objc.Ptr(endDate)) + return rv +} + +// Initializes an instance of AVDateRangeMetadataGroup with a collection of metadata items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avdaterangemetadatagroup/1389614-initwithitems?language=objc +func NewMutableDateRangeMetadataGroupWithItemsStartDateEndDate(items []IMetadataItem, startDate foundation.IDate, endDate foundation.IDate) MutableDateRangeMetadataGroup { + instance := MutableDateRangeMetadataGroupClass.Alloc().InitWithItemsStartDateEndDate(items, startDate, endDate) + instance.Autorelease() + return instance +} + +// An array of associated metadata items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutabledaterangemetadatagroup/1388262-items?language=objc +func (m_ MutableDateRangeMetadataGroup) SetItems(value []IMetadataItem) { + objc.Call[objc.Void](m_, objc.Sel("setItems:"), value) +} + +// The start date for the metadata date range group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutabledaterangemetadatagroup/1390555-startdate?language=objc +func (m_ MutableDateRangeMetadataGroup) SetStartDate(value foundation.IDate) { + objc.Call[objc.Void](m_, objc.Sel("setStartDate:"), objc.Ptr(value)) +} + +// The end date for the metadata date range group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutabledaterangemetadatagroup/1387651-enddate?language=objc +func (m_ MutableDateRangeMetadataGroup) SetEndDate(value foundation.IDate) { + objc.Call[objc.Void](m_, objc.Sel("setEndDate:"), objc.Ptr(value)) +} diff --git a/macos/avfoundation/mutable_media_selection.gen.go b/macos/avfoundation/mutable_media_selection.gen.go new file mode 100644 index 00000000..9992f2a7 --- /dev/null +++ b/macos/avfoundation/mutable_media_selection.gen.go @@ -0,0 +1,66 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableMediaSelection] class. +var MutableMediaSelectionClass = _MutableMediaSelectionClass{objc.GetClass("AVMutableMediaSelection")} + +type _MutableMediaSelectionClass struct { + objc.Class +} + +// An interface definition for the [MutableMediaSelection] class. +type IMutableMediaSelection interface { + IMediaSelection + SelectMediaOptionInMediaSelectionGroup(mediaSelectionOption IMediaSelectionOption, mediaSelectionGroup IMediaSelectionGroup) +} + +// A mutable object that represents a complete rendition of media selection options on an asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemediaselection?language=objc +type MutableMediaSelection struct { + MediaSelection +} + +func MutableMediaSelectionFrom(ptr unsafe.Pointer) MutableMediaSelection { + return MutableMediaSelection{ + MediaSelection: MediaSelectionFrom(ptr), + } +} + +func (mc _MutableMediaSelectionClass) Alloc() MutableMediaSelection { + rv := objc.Call[MutableMediaSelection](mc, objc.Sel("alloc")) + return rv +} + +func MutableMediaSelection_Alloc() MutableMediaSelection { + return MutableMediaSelectionClass.Alloc() +} + +func (mc _MutableMediaSelectionClass) New() MutableMediaSelection { + rv := objc.Call[MutableMediaSelection](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableMediaSelection() MutableMediaSelection { + return MutableMediaSelectionClass.New() +} + +func (m_ MutableMediaSelection) Init() MutableMediaSelection { + rv := objc.Call[MutableMediaSelection](m_, objc.Sel("init")) + return rv +} + +// Selects the media option in the specified media selection group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemediaselection/1386768-selectmediaoption?language=objc +func (m_ MutableMediaSelection) SelectMediaOptionInMediaSelectionGroup(mediaSelectionOption IMediaSelectionOption, mediaSelectionGroup IMediaSelectionGroup) { + objc.Call[objc.Void](m_, objc.Sel("selectMediaOption:inMediaSelectionGroup:"), objc.Ptr(mediaSelectionOption), objc.Ptr(mediaSelectionGroup)) +} diff --git a/macos/avfoundation/mutable_metadata_item.gen.go b/macos/avfoundation/mutable_metadata_item.gen.go new file mode 100644 index 00000000..debb4d64 --- /dev/null +++ b/macos/avfoundation/mutable_metadata_item.gen.go @@ -0,0 +1,163 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableMetadataItem] class. +var MutableMetadataItemClass = _MutableMetadataItemClass{objc.GetClass("AVMutableMetadataItem")} + +type _MutableMetadataItemClass struct { + objc.Class +} + +// An interface definition for the [MutableMetadataItem] class. +type IMutableMetadataItem interface { + IMetadataItem + SetKeySpace(value MetadataKeySpace) + SetExtendedLanguageTag(value string) + SetKey(value objc.IObject) + SetValue(value objc.IObject) + SetExtraAttributes(value map[MetadataExtraAttributeKey]objc.IObject) + SetLocale(value foundation.ILocale) + SetTime(value coremedia.Time) + SetDataType(value string) + SetStartDate(value foundation.IDate) + SetDuration(value coremedia.Time) + SetIdentifier(value MetadataIdentifier) +} + +// A mutable metadata item for an audiovisual asset or for one of its tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem?language=objc +type MutableMetadataItem struct { + MetadataItem +} + +func MutableMetadataItemFrom(ptr unsafe.Pointer) MutableMetadataItem { + return MutableMetadataItem{ + MetadataItem: MetadataItemFrom(ptr), + } +} + +func (mc _MutableMetadataItemClass) Alloc() MutableMetadataItem { + rv := objc.Call[MutableMetadataItem](mc, objc.Sel("alloc")) + return rv +} + +func MutableMetadataItem_Alloc() MutableMetadataItem { + return MutableMetadataItemClass.Alloc() +} + +func (mc _MutableMetadataItemClass) New() MutableMetadataItem { + rv := objc.Call[MutableMetadataItem](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableMetadataItem() MutableMetadataItem { + return MutableMetadataItemClass.New() +} + +func (m_ MutableMetadataItem) Init() MutableMetadataItem { + rv := objc.Call[MutableMetadataItem](m_, objc.Sel("init")) + return rv +} + +// Returns a new mutable metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1426379-metadataitem?language=objc +func (mc _MutableMetadataItemClass) MetadataItem() MutableMetadataItem { + rv := objc.Call[MutableMetadataItem](mc, objc.Sel("metadataItem")) + return rv +} + +// Returns a new mutable metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1426379-metadataitem?language=objc +func MutableMetadataItem_MetadataItem() MutableMetadataItem { + return MutableMetadataItemClass.MetadataItem() +} + +// The key space of the metadata item’s key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1385655-keyspace?language=objc +func (m_ MutableMetadataItem) SetKeySpace(value MetadataKeySpace) { + objc.Call[objc.Void](m_, objc.Sel("setKeySpace:"), value) +} + +// The IETF BCP 47 (RFC 4646) language identifier of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1386664-extendedlanguagetag?language=objc +func (m_ MutableMetadataItem) SetExtendedLanguageTag(value string) { + objc.Call[objc.Void](m_, objc.Sel("setExtendedLanguageTag:"), value) +} + +// The key for a mutable metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1386776-key?language=objc +func (m_ MutableMetadataItem) SetKey(value objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setKey:"), value) +} + +// The value for the mutable metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1388296-value?language=objc +func (m_ MutableMetadataItem) SetValue(value objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setValue:"), value) +} + +// A dictionary of additional attributes for a metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1390397-extraattributes?language=objc +func (m_ MutableMetadataItem) SetExtraAttributes(value map[MetadataExtraAttributeKey]objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setExtraAttributes:"), value) +} + +// The locale for a mutable metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1389292-locale?language=objc +func (m_ MutableMetadataItem) SetLocale(value foundation.ILocale) { + objc.Call[objc.Void](m_, objc.Sel("setLocale:"), objc.Ptr(value)) +} + +// The timestamp for a mutable metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1389990-time?language=objc +func (m_ MutableMetadataItem) SetTime(value coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setTime:"), value) +} + +// The data type of the metadata item’s value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1389471-datatype?language=objc +func (m_ MutableMetadataItem) SetDataType(value string) { + objc.Call[objc.Void](m_, objc.Sel("setDataType:"), value) +} + +// The start date of the timed metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1389966-startdate?language=objc +func (m_ MutableMetadataItem) SetStartDate(value foundation.IDate) { + objc.Call[objc.Void](m_, objc.Sel("setStartDate:"), objc.Ptr(value)) +} + +// The duration of a mutable metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1389980-duration?language=objc +func (m_ MutableMetadataItem) SetDuration(value coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setDuration:"), value) +} + +// Indicates the identifier of the metadata item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem/1386688-identifier?language=objc +func (m_ MutableMetadataItem) SetIdentifier(value MetadataIdentifier) { + objc.Call[objc.Void](m_, objc.Sel("setIdentifier:"), value) +} diff --git a/macos/avfoundation/mutable_movie.gen.go b/macos/avfoundation/mutable_movie.gen.go new file mode 100644 index 00000000..d561e4da --- /dev/null +++ b/macos/avfoundation/mutable_movie.gen.go @@ -0,0 +1,389 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableMovie] class. +var MutableMovieClass = _MutableMovieClass{objc.GetClass("AVMutableMovie")} + +type _MutableMovieClass struct { + objc.Class +} + +// An interface definition for the [MutableMovie] class. +type IMutableMovie interface { + IMovie + TracksWithMediaType(mediaType MediaType) []MutableMovieTrack + RemoveTimeRange(timeRange coremedia.TimeRange) + AddMutableTracksCopyingSettingsFromTracksOptions(existingTracks []IAssetTrack, options map[string]objc.IObject) []MutableMovieTrack + TracksWithMediaCharacteristic(mediaCharacteristic MediaCharacteristic) []MutableMovieTrack + MutableTrackCompatibleWithTrack(track IAssetTrack) MutableMovieTrack + InsertTimeRangeOfAssetAtTimeCopySampleDataError(timeRange coremedia.TimeRange, asset IAsset, startTime coremedia.Time, copySampleData bool, outError foundation.IError) bool + RemoveTrack(track IMovieTrack) + AddMutableTrackWithMediaTypeCopySettingsFromTrackOptions(mediaType MediaType, track IAssetTrack, options map[string]objc.IObject) MutableMovieTrack + ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) + TrackWithTrackID(trackID objc.IObject) MutableMovieTrack + InsertEmptyTimeRange(timeRange coremedia.TimeRange) + SetDefaultMediaDataStorage(value IMediaDataStorage) + IsModified() bool + SetModified(value bool) + SetPreferredVolume(value float64) + InterleavingPeriod() coremedia.Time + SetInterleavingPeriod(value coremedia.Time) + SetMetadata(value []IMetadataItem) + SetPreferredRate(value float64) + Timescale() coremedia.TimeScale + SetTimescale(value coremedia.TimeScale) + SetPreferredTransform(value coregraphics.AffineTransform) +} + +// A mutable object that represents an audiovisual container that conforms to the QuickTime movie file format or a related format like MPEG-4. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie?language=objc +type MutableMovie struct { + Movie +} + +func MutableMovieFrom(ptr unsafe.Pointer) MutableMovie { + return MutableMovie{ + Movie: MovieFrom(ptr), + } +} + +func (m_ MutableMovie) InitWithDataOptionsError(data []byte, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + rv := objc.Call[MutableMovie](m_, objc.Sel("initWithData:options:error:"), data, options, objc.Ptr(outError)) + return rv +} + +// Creates a mutable movie object from a movie stored in a data object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1388442-initwithdata?language=objc +func NewMutableMovieWithDataOptionsError(data []byte, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + instance := MutableMovieClass.Alloc().InitWithDataOptionsError(data, options, outError) + instance.Autorelease() + return instance +} + +func (mc _MutableMovieClass) MovieWithDataOptionsError(data []byte, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("movieWithData:options:error:"), data, options, objc.Ptr(outError)) + return rv +} + +// Returns a new mutable movie object from a movie stored in a data object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1458234-moviewithdata?language=objc +func MutableMovie_MovieWithDataOptionsError(data []byte, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + return MutableMovieClass.MovieWithDataOptionsError(data, options, outError) +} + +func (m_ MutableMovie) InitWithSettingsFromMovieOptionsError(movie IMovie, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + rv := objc.Call[MutableMovie](m_, objc.Sel("initWithSettingsFromMovie:options:error:"), objc.Ptr(movie), options, objc.Ptr(outError)) + return rv +} + +// Creates a mutable movie object without tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1386408-initwithsettingsfrommovie?language=objc +func NewMutableMovieWithSettingsFromMovieOptionsError(movie IMovie, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + instance := MutableMovieClass.Alloc().InitWithSettingsFromMovieOptionsError(movie, options, outError) + instance.Autorelease() + return instance +} + +func (m_ MutableMovie) InitWithURLOptionsError(URL foundation.IURL, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + rv := objc.Call[MutableMovie](m_, objc.Sel("initWithURL:options:error:"), objc.Ptr(URL), options, objc.Ptr(outError)) + return rv +} + +// Creates a mutable movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1386052-initwithurl?language=objc +func NewMutableMovieWithURLOptionsError(URL foundation.IURL, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + instance := MutableMovieClass.Alloc().InitWithURLOptionsError(URL, options, outError) + instance.Autorelease() + return instance +} + +func (mc _MutableMovieClass) MovieWithURLOptionsError(URL foundation.IURL, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("movieWithURL:options:error:"), objc.Ptr(URL), options, objc.Ptr(outError)) + return rv +} + +// Returns a new mutable movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1458226-moviewithurl?language=objc +func MutableMovie_MovieWithURLOptionsError(URL foundation.IURL, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + return MutableMovieClass.MovieWithURLOptionsError(URL, options, outError) +} + +func (mc _MutableMovieClass) MovieWithSettingsFromMovieOptionsError(movie IMovie, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("movieWithSettingsFromMovie:options:error:"), objc.Ptr(movie), options, objc.Ptr(outError)) + return rv +} + +// Returns a new mutable movie object without tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1458238-moviewithsettingsfrommovie?language=objc +func MutableMovie_MovieWithSettingsFromMovieOptionsError(movie IMovie, options map[string]objc.IObject, outError foundation.IError) MutableMovie { + return MutableMovieClass.MovieWithSettingsFromMovieOptionsError(movie, options, outError) +} + +func (mc _MutableMovieClass) Alloc() MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("alloc")) + return rv +} + +func MutableMovie_Alloc() MutableMovie { + return MutableMovieClass.Alloc() +} + +func (mc _MutableMovieClass) New() MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableMovie() MutableMovie { + return MutableMovieClass.New() +} + +func (m_ MutableMovie) Init() MutableMovie { + rv := objc.Call[MutableMovie](m_, objc.Sel("init")) + return rv +} + +func (m_ MutableMovie) InitWithDataOptions(data []byte, options map[string]objc.IObject) MutableMovie { + rv := objc.Call[MutableMovie](m_, objc.Sel("initWithData:options:"), data, options) + return rv +} + +// Creates a movie object from a movie file’s data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1388090-initwithdata?language=objc +func NewMutableMovieWithDataOptions(data []byte, options map[string]objc.IObject) MutableMovie { + instance := MutableMovieClass.Alloc().InitWithDataOptions(data, options) + instance.Autorelease() + return instance +} + +func (mc _MutableMovieClass) MovieWithDataOptions(data []byte, options map[string]objc.IObject) MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("movieWithData:options:"), data, options) + return rv +} + +// Returns a new movie object from a movie file’s data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1458261-moviewithdata?language=objc +func MutableMovie_MovieWithDataOptions(data []byte, options map[string]objc.IObject) MutableMovie { + return MutableMovieClass.MovieWithDataOptions(data, options) +} + +func (m_ MutableMovie) InitWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) MutableMovie { + rv := objc.Call[MutableMovie](m_, objc.Sel("initWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Creates a movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1387923-initwithurl?language=objc +func NewMutableMovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) MutableMovie { + instance := MutableMovieClass.Alloc().InitWithURLOptions(URL, options) + instance.Autorelease() + return instance +} + +func (mc _MutableMovieClass) MovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("movieWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Returns a new movie object from a movie header stored in a QuickTime movie file of ISO base media file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmovie/1458223-moviewithurl?language=objc +func MutableMovie_MovieWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) MutableMovie { + return MutableMovieClass.MovieWithURLOptions(URL, options) +} + +func (mc _MutableMovieClass) AssetWithURL(URL foundation.IURL) MutableMovie { + rv := objc.Call[MutableMovie](mc, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func MutableMovie_AssetWithURL(URL foundation.IURL) MutableMovie { + return MutableMovieClass.AssetWithURL(URL) +} + +// Retrieves tracks in the movie that present media of the specified type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1390443-trackswithmediatype?language=objc +func (m_ MutableMovie) TracksWithMediaType(mediaType MediaType) []MutableMovieTrack { + rv := objc.Call[[]MutableMovieTrack](m_, objc.Sel("tracksWithMediaType:"), mediaType) + return rv +} + +// Removes the specified time range from a movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1385605-removetimerange?language=objc +func (m_ MutableMovie) RemoveTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("removeTimeRange:"), timeRange) +} + +// Adds one or more empty tracks to the target movie and copies the track settings from the source tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1389215-addmutabletrackscopyingsettingsf?language=objc +func (m_ MutableMovie) AddMutableTracksCopyingSettingsFromTracksOptions(existingTracks []IAssetTrack, options map[string]objc.IObject) []MutableMovieTrack { + rv := objc.Call[[]MutableMovieTrack](m_, objc.Sel("addMutableTracksCopyingSettingsFromTracks:options:"), existingTracks, options) + return rv +} + +// Retrieve tracks in the movie that present media of the specified characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1388547-trackswithmediacharacteristic?language=objc +func (m_ MutableMovie) TracksWithMediaCharacteristic(mediaCharacteristic MediaCharacteristic) []MutableMovieTrack { + rv := objc.Call[[]MutableMovieTrack](m_, objc.Sel("tracksWithMediaCharacteristic:"), mediaCharacteristic) + return rv +} + +// Provides a reference to a track from a mutable movie into which you can insert any time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1388669-mutabletrackcompatiblewithtrack?language=objc +func (m_ MutableMovie) MutableTrackCompatibleWithTrack(track IAssetTrack) MutableMovieTrack { + rv := objc.Call[MutableMovieTrack](m_, objc.Sel("mutableTrackCompatibleWithTrack:"), objc.Ptr(track)) + return rv +} + +// Inserts all of the tracks in a specified time range of an asset into a movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1389598-inserttimerange?language=objc +func (m_ MutableMovie) InsertTimeRangeOfAssetAtTimeCopySampleDataError(timeRange coremedia.TimeRange, asset IAsset, startTime coremedia.Time, copySampleData bool, outError foundation.IError) bool { + rv := objc.Call[bool](m_, objc.Sel("insertTimeRange:ofAsset:atTime:copySampleData:error:"), timeRange, objc.Ptr(asset), startTime, copySampleData, objc.Ptr(outError)) + return rv +} + +// Removes the specified track from the target movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1386735-removetrack?language=objc +func (m_ MutableMovie) RemoveTrack(track IMovieTrack) { + objc.Call[objc.Void](m_, objc.Sel("removeTrack:"), objc.Ptr(track)) +} + +// Adds an empty track to the target movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1390063-addmutabletrackwithmediatype?language=objc +func (m_ MutableMovie) AddMutableTrackWithMediaTypeCopySettingsFromTrackOptions(mediaType MediaType, track IAssetTrack, options map[string]objc.IObject) MutableMovieTrack { + rv := objc.Call[MutableMovieTrack](m_, objc.Sel("addMutableTrackWithMediaType:copySettingsFromTrack:options:"), mediaType, objc.Ptr(track), options) + return rv +} + +// Changes the duration of a time range in a movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1385653-scaletimerange?language=objc +func (m_ MutableMovie) ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("scaleTimeRange:toDuration:"), timeRange, duration) +} + +// Retrieves a track in the movie that contains the specified identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1389467-trackwithtrackid?language=objc +func (m_ MutableMovie) TrackWithTrackID(trackID objc.IObject) MutableMovieTrack { + rv := objc.Call[MutableMovieTrack](m_, objc.Sel("trackWithTrackID:"), objc.Ptr(trackID)) + return rv +} + +// Adds an empty time range to a movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1387515-insertemptytimerange?language=objc +func (m_ MutableMovie) InsertEmptyTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("insertEmptyTimeRange:"), timeRange) +} + +// The default storage container for media data that you add to a movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1389320-defaultmediadatastorage?language=objc +func (m_ MutableMovie) SetDefaultMediaDataStorage(value IMediaDataStorage) { + objc.Call[objc.Void](m_, objc.Sel("setDefaultMediaDataStorage:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether the movie is in a modified state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1389960-modified?language=objc +func (m_ MutableMovie) IsModified() bool { + rv := objc.Call[bool](m_, objc.Sel("isModified")) + return rv +} + +// A Boolean value that indicates whether the movie is in a modified state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1389960-modified?language=objc +func (m_ MutableMovie) SetModified(value bool) { + objc.Call[objc.Void](m_, objc.Sel("setModified:"), value) +} + +// The preferred volume for the audible medata data of the movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1388614-preferredvolume?language=objc +func (m_ MutableMovie) SetPreferredVolume(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredVolume:"), value) +} + +// A time period indicating the duration for interleaving runs of samples for each track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1386969-interleavingperiod?language=objc +func (m_ MutableMovie) InterleavingPeriod() coremedia.Time { + rv := objc.Call[coremedia.Time](m_, objc.Sel("interleavingPeriod")) + return rv +} + +// A time period indicating the duration for interleaving runs of samples for each track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1386969-interleavingperiod?language=objc +func (m_ MutableMovie) SetInterleavingPeriod(value coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setInterleavingPeriod:"), value) +} + +// An array of metadata the movie stores. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1388742-metadata?language=objc +func (m_ MutableMovie) SetMetadata(value []IMetadataItem) { + objc.Call[objc.Void](m_, objc.Sel("setMetadata:"), value) +} + +// The natural rate for playing the movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1387335-preferredrate?language=objc +func (m_ MutableMovie) SetPreferredRate(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredRate:"), value) +} + +// The time scale of the movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1390622-timescale?language=objc +func (m_ MutableMovie) Timescale() coremedia.TimeScale { + rv := objc.Call[coremedia.TimeScale](m_, objc.Sel("timescale")) + return rv +} + +// The time scale of the movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1390622-timescale?language=objc +func (m_ MutableMovie) SetTimescale(value coremedia.TimeScale) { + objc.Call[objc.Void](m_, objc.Sel("setTimescale:"), value) +} + +// The transform performed on the visual media data of the movie for display purposes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovie/1388771-preferredtransform?language=objc +func (m_ MutableMovie) SetPreferredTransform(value coregraphics.AffineTransform) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredTransform:"), value) +} diff --git a/macos/avfoundation/mutable_movie_track.gen.go b/macos/avfoundation/mutable_movie_track.gen.go new file mode 100644 index 00000000..2fe7ed67 --- /dev/null +++ b/macos/avfoundation/mutable_movie_track.gen.go @@ -0,0 +1,387 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableMovieTrack] class. +var MutableMovieTrackClass = _MutableMovieTrackClass{objc.GetClass("AVMutableMovieTrack")} + +type _MutableMovieTrackClass struct { + objc.Class +} + +// An interface definition for the [MutableMovieTrack] class. +type IMutableMovieTrack interface { + IMovieTrack + RemoveTrackAssociationToTrackType(movieTrack IMovieTrack, trackAssociationType TrackAssociationType) + AddTrackAssociationToTrackType(movieTrack IMovieTrack, trackAssociationType TrackAssociationType) + InsertMediaTimeRangeIntoTimeRange(mediaTimeRange coremedia.TimeRange, trackTimeRange coremedia.TimeRange) bool + RemoveTimeRange(timeRange coremedia.TimeRange) + AppendSampleBufferDecodeTimePresentationTimeError(sampleBuffer coremedia.SampleBufferRef, outDecodeTime *coremedia.Time, outPresentationTime *coremedia.Time, outError foundation.IError) bool + InsertTimeRangeOfTrackAtTimeCopySampleDataError(timeRange coremedia.TimeRange, track IAssetTrack, startTime coremedia.Time, copySampleData bool, outError foundation.IError) bool + ReplaceFormatDescriptionWithFormatDescription(formatDescription coremedia.FormatDescriptionRef, newFormatDescription coremedia.FormatDescriptionRef) + ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) + InsertEmptyTimeRange(timeRange coremedia.TimeRange) + Layer() int + SetLayer(value int) + PreferredMediaChunkSize() int + SetPreferredMediaChunkSize(value int) + SetExtendedLanguageTag(value string) + ProductionApertureDimensions() coregraphics.Size + SetProductionApertureDimensions(value coregraphics.Size) + IsModified() bool + SetModified(value bool) + PreferredMediaChunkAlignment() int + SetPreferredMediaChunkAlignment(value int) + SetPreferredVolume(value float64) + SetAlternateGroupID(value int) + SetMetadata(value []IMetadataItem) + SampleReferenceBaseURL() foundation.URL + SetSampleReferenceBaseURL(value foundation.IURL) + SetMediaDataStorage(value IMediaDataStorage) + CleanApertureDimensions() coregraphics.Size + SetCleanApertureDimensions(value coregraphics.Size) + SetNaturalSize(value coregraphics.Size) + EncodedPixelsDimensions() coregraphics.Size + SetEncodedPixelsDimensions(value coregraphics.Size) + PreferredMediaChunkDuration() coremedia.Time + SetPreferredMediaChunkDuration(value coremedia.Time) + HasProtectedContent() bool + SetLanguageCode(value string) + SetEnabled(value bool) + Timescale() coremedia.TimeScale + SetTimescale(value coremedia.TimeScale) + SetPreferredTransform(value coregraphics.AffineTransform) +} + +// A mutable track that conforms to the QuickTime or ISO base media file format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack?language=objc +type MutableMovieTrack struct { + MovieTrack +} + +func MutableMovieTrackFrom(ptr unsafe.Pointer) MutableMovieTrack { + return MutableMovieTrack{ + MovieTrack: MovieTrackFrom(ptr), + } +} + +func (mc _MutableMovieTrackClass) Alloc() MutableMovieTrack { + rv := objc.Call[MutableMovieTrack](mc, objc.Sel("alloc")) + return rv +} + +func MutableMovieTrack_Alloc() MutableMovieTrack { + return MutableMovieTrackClass.Alloc() +} + +func (mc _MutableMovieTrackClass) New() MutableMovieTrack { + rv := objc.Call[MutableMovieTrack](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableMovieTrack() MutableMovieTrack { + return MutableMovieTrackClass.New() +} + +func (m_ MutableMovieTrack) Init() MutableMovieTrack { + rv := objc.Call[MutableMovieTrack](m_, objc.Sel("init")) + return rv +} + +// Removes a specific type of track association between two tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1389620-removetrackassociationtotrack?language=objc +func (m_ MutableMovieTrack) RemoveTrackAssociationToTrackType(movieTrack IMovieTrack, trackAssociationType TrackAssociationType) { + objc.Call[objc.Void](m_, objc.Sel("removeTrackAssociationToTrack:type:"), objc.Ptr(movieTrack), trackAssociationType) +} + +// Creates a specific type of track association between two tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390163-addtrackassociationtotrack?language=objc +func (m_ MutableMovieTrack) AddTrackAssociationToTrackType(movieTrack IMovieTrack, trackAssociationType TrackAssociationType) { + objc.Call[objc.Void](m_, objc.Sel("addTrackAssociationToTrack:type:"), objc.Ptr(movieTrack), trackAssociationType) +} + +// Inserts a reference to a media time range into a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1638038-insertmediatimerange?language=objc +func (m_ MutableMovieTrack) InsertMediaTimeRangeIntoTimeRange(mediaTimeRange coremedia.TimeRange, trackTimeRange coremedia.TimeRange) bool { + rv := objc.Call[bool](m_, objc.Sel("insertMediaTimeRange:intoTimeRange:"), mediaTimeRange, trackTimeRange) + return rv +} + +// Removes the specified time range from a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1385962-removetimerange?language=objc +func (m_ MutableMovieTrack) RemoveTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("removeTimeRange:"), timeRange) +} + +// Appends sample data to a media file and adds sample references for the added data to a track’s media sample tables. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1638041-appendsamplebuffer?language=objc +func (m_ MutableMovieTrack) AppendSampleBufferDecodeTimePresentationTimeError(sampleBuffer coremedia.SampleBufferRef, outDecodeTime *coremedia.Time, outPresentationTime *coremedia.Time, outError foundation.IError) bool { + rv := objc.Call[bool](m_, objc.Sel("appendSampleBuffer:decodeTime:presentationTime:error:"), sampleBuffer, outDecodeTime, outPresentationTime, objc.Ptr(outError)) + return rv +} + +// Inserts a portion of an asset track into the target movie. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1387665-inserttimerange?language=objc +func (m_ MutableMovieTrack) InsertTimeRangeOfTrackAtTimeCopySampleDataError(timeRange coremedia.TimeRange, track IAssetTrack, startTime coremedia.Time, copySampleData bool, outError foundation.IError) bool { + rv := objc.Call[bool](m_, objc.Sel("insertTimeRange:ofTrack:atTime:copySampleData:error:"), timeRange, objc.Ptr(track), startTime, copySampleData, objc.Ptr(outError)) + return rv +} + +// Replaces the track’s format description with a new format description. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/2876160-replaceformatdescription?language=objc +func (m_ MutableMovieTrack) ReplaceFormatDescriptionWithFormatDescription(formatDescription coremedia.FormatDescriptionRef, newFormatDescription coremedia.FormatDescriptionRef) { + objc.Call[objc.Void](m_, objc.Sel("replaceFormatDescription:withFormatDescription:"), formatDescription, newFormatDescription) +} + +// Changes the duration of a time range in a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1388618-scaletimerange?language=objc +func (m_ MutableMovieTrack) ScaleTimeRangeToDuration(timeRange coremedia.TimeRange, duration coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("scaleTimeRange:toDuration:"), timeRange, duration) +} + +// Adds an empty time range to a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1389441-insertemptytimerange?language=objc +func (m_ MutableMovieTrack) InsertEmptyTimeRange(timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("insertEmptyTimeRange:"), timeRange) +} + +// The layer level for the visual media of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1387655-layer?language=objc +func (m_ MutableMovieTrack) Layer() int { + rv := objc.Call[int](m_, objc.Sel("layer")) + return rv +} + +// The layer level for the visual media of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1387655-layer?language=objc +func (m_ MutableMovieTrack) SetLayer(value int) { + objc.Call[objc.Void](m_, objc.Sel("setLayer:"), value) +} + +// The maximum size to use for each chunk of sample data written to the file for file types that support media chunk duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390149-preferredmediachunksize?language=objc +func (m_ MutableMovieTrack) PreferredMediaChunkSize() int { + rv := objc.Call[int](m_, objc.Sel("preferredMediaChunkSize")) + return rv +} + +// The maximum size to use for each chunk of sample data written to the file for file types that support media chunk duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390149-preferredmediachunksize?language=objc +func (m_ MutableMovieTrack) SetPreferredMediaChunkSize(value int) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredMediaChunkSize:"), value) +} + +// An IETF BCP 47 language identifier that identifies the language tag associated with the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1389056-extendedlanguagetag?language=objc +func (m_ MutableMovieTrack) SetExtendedLanguageTag(value string) { + objc.Call[objc.Void](m_, objc.Sel("setExtendedLanguageTag:"), value) +} + +// The production aperture dimensions of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390108-productionaperturedimensions?language=objc +func (m_ MutableMovieTrack) ProductionApertureDimensions() coregraphics.Size { + rv := objc.Call[coregraphics.Size](m_, objc.Sel("productionApertureDimensions")) + return rv +} + +// The production aperture dimensions of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390108-productionaperturedimensions?language=objc +func (m_ MutableMovieTrack) SetProductionApertureDimensions(value coregraphics.Size) { + objc.Call[objc.Void](m_, objc.Sel("setProductionApertureDimensions:"), value) +} + +// A Boolean value that indicates whether a track is in a modified state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390201-modified?language=objc +func (m_ MutableMovieTrack) IsModified() bool { + rv := objc.Call[bool](m_, objc.Sel("isModified")) + return rv +} + +// A Boolean value that indicates whether a track is in a modified state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390201-modified?language=objc +func (m_ MutableMovieTrack) SetModified(value bool) { + objc.Call[objc.Void](m_, objc.Sel("setModified:"), value) +} + +// The boundary for media chunk alignment for file types that support media chunk alignment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390504-preferredmediachunkalignment?language=objc +func (m_ MutableMovieTrack) PreferredMediaChunkAlignment() int { + rv := objc.Call[int](m_, objc.Sel("preferredMediaChunkAlignment")) + return rv +} + +// The boundary for media chunk alignment for file types that support media chunk alignment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390504-preferredmediachunkalignment?language=objc +func (m_ MutableMovieTrack) SetPreferredMediaChunkAlignment(value int) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredMediaChunkAlignment:"), value) +} + +// The preferred volume for the audible medata data of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390391-preferredvolume?language=objc +func (m_ MutableMovieTrack) SetPreferredVolume(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredVolume:"), value) +} + +// A number that identifies the track as a member of a particular alternate group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1387206-alternategroupid?language=objc +func (m_ MutableMovieTrack) SetAlternateGroupID(value int) { + objc.Call[objc.Void](m_, objc.Sel("setAlternateGroupID:"), value) +} + +// An array of metadata stored by the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390023-metadata?language=objc +func (m_ MutableMovieTrack) SetMetadata(value []IMetadataItem) { + objc.Call[objc.Void](m_, objc.Sel("setMetadata:"), value) +} + +// The base URL for sample references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1385583-samplereferencebaseurl?language=objc +func (m_ MutableMovieTrack) SampleReferenceBaseURL() foundation.URL { + rv := objc.Call[foundation.URL](m_, objc.Sel("sampleReferenceBaseURL")) + return rv +} + +// The base URL for sample references. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1385583-samplereferencebaseurl?language=objc +func (m_ MutableMovieTrack) SetSampleReferenceBaseURL(value foundation.IURL) { + objc.Call[objc.Void](m_, objc.Sel("setSampleReferenceBaseURL:"), objc.Ptr(value)) +} + +// A storage container for the media data to be added to a track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1386532-mediadatastorage?language=objc +func (m_ MutableMovieTrack) SetMediaDataStorage(value IMediaDataStorage) { + objc.Call[objc.Void](m_, objc.Sel("setMediaDataStorage:"), objc.Ptr(value)) +} + +// The clean aperture dimension of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1386454-cleanaperturedimensions?language=objc +func (m_ MutableMovieTrack) CleanApertureDimensions() coregraphics.Size { + rv := objc.Call[coregraphics.Size](m_, objc.Sel("cleanApertureDimensions")) + return rv +} + +// The clean aperture dimension of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1386454-cleanaperturedimensions?language=objc +func (m_ MutableMovieTrack) SetCleanApertureDimensions(value coregraphics.Size) { + objc.Call[objc.Void](m_, objc.Sel("setCleanApertureDimensions:"), value) +} + +// The dimensions used to display the visual media data for the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1385900-naturalsize?language=objc +func (m_ MutableMovieTrack) SetNaturalSize(value coregraphics.Size) { + objc.Call[objc.Void](m_, objc.Sel("setNaturalSize:"), value) +} + +// The encoded pixels dimensions of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1389417-encodedpixelsdimensions?language=objc +func (m_ MutableMovieTrack) EncodedPixelsDimensions() coregraphics.Size { + rv := objc.Call[coregraphics.Size](m_, objc.Sel("encodedPixelsDimensions")) + return rv +} + +// The encoded pixels dimensions of the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1389417-encodedpixelsdimensions?language=objc +func (m_ MutableMovieTrack) SetEncodedPixelsDimensions(value coregraphics.Size) { + objc.Call[objc.Void](m_, objc.Sel("setEncodedPixelsDimensions:"), value) +} + +// The maximum duration to use for each chunk of sample data written to the file for file types that support media chunk duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390292-preferredmediachunkduration?language=objc +func (m_ MutableMovieTrack) PreferredMediaChunkDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](m_, objc.Sel("preferredMediaChunkDuration")) + return rv +} + +// The maximum duration to use for each chunk of sample data written to the file for file types that support media chunk duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1390292-preferredmediachunkduration?language=objc +func (m_ MutableMovieTrack) SetPreferredMediaChunkDuration(value coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredMediaChunkDuration:"), value) +} + +// A Boolean value that indicates whether a track contains protected content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1389542-hasprotectedcontent?language=objc +func (m_ MutableMovieTrack) HasProtectedContent() bool { + rv := objc.Call[bool](m_, objc.Sel("hasProtectedContent")) + return rv +} + +// A ISO 639-2/T language code that indicates the language associated with the track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1389736-languagecode?language=objc +func (m_ MutableMovieTrack) SetLanguageCode(value string) { + objc.Call[objc.Void](m_, objc.Sel("setLanguageCode:"), value) +} + +// A Boolean value that indicates whether the track is enabled by default for presentation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1386340-enabled?language=objc +func (m_ MutableMovieTrack) SetEnabled(value bool) { + objc.Call[objc.Void](m_, objc.Sel("setEnabled:"), value) +} + +// The time scale for tracks that contain the moov atom. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1388055-timescale?language=objc +func (m_ MutableMovieTrack) Timescale() coremedia.TimeScale { + rv := objc.Call[coremedia.TimeScale](m_, objc.Sel("timescale")) + return rv +} + +// The time scale for tracks that contain the moov atom. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1388055-timescale?language=objc +func (m_ MutableMovieTrack) SetTimescale(value coremedia.TimeScale) { + objc.Call[objc.Void](m_, objc.Sel("setTimescale:"), value) +} + +// The transform performed on the visual media data of the track for display purposes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablemovietrack/1386593-preferredtransform?language=objc +func (m_ MutableMovieTrack) SetPreferredTransform(value coregraphics.AffineTransform) { + objc.Call[objc.Void](m_, objc.Sel("setPreferredTransform:"), value) +} diff --git a/macos/avfoundation/mutable_timed_metadata_group.gen.go b/macos/avfoundation/mutable_timed_metadata_group.gen.go new file mode 100644 index 00000000..265b949d --- /dev/null +++ b/macos/avfoundation/mutable_timed_metadata_group.gen.go @@ -0,0 +1,103 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableTimedMetadataGroup] class. +var MutableTimedMetadataGroupClass = _MutableTimedMetadataGroupClass{objc.GetClass("AVMutableTimedMetadataGroup")} + +type _MutableTimedMetadataGroupClass struct { + objc.Class +} + +// An interface definition for the [MutableTimedMetadataGroup] class. +type IMutableTimedMetadataGroup interface { + ITimedMetadataGroup + SetItems(value []IMetadataItem) + SetTimeRange(value coremedia.TimeRange) +} + +// A mutable collection of metadata items that are valid for use during a specific time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutabletimedmetadatagroup?language=objc +type MutableTimedMetadataGroup struct { + TimedMetadataGroup +} + +func MutableTimedMetadataGroupFrom(ptr unsafe.Pointer) MutableTimedMetadataGroup { + return MutableTimedMetadataGroup{ + TimedMetadataGroup: TimedMetadataGroupFrom(ptr), + } +} + +func (mc _MutableTimedMetadataGroupClass) Alloc() MutableTimedMetadataGroup { + rv := objc.Call[MutableTimedMetadataGroup](mc, objc.Sel("alloc")) + return rv +} + +func MutableTimedMetadataGroup_Alloc() MutableTimedMetadataGroup { + return MutableTimedMetadataGroupClass.Alloc() +} + +func (mc _MutableTimedMetadataGroupClass) New() MutableTimedMetadataGroup { + rv := objc.Call[MutableTimedMetadataGroup](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableTimedMetadataGroup() MutableTimedMetadataGroup { + return MutableTimedMetadataGroupClass.New() +} + +func (m_ MutableTimedMetadataGroup) Init() MutableTimedMetadataGroup { + rv := objc.Call[MutableTimedMetadataGroup](m_, objc.Sel("init")) + return rv +} + +func (m_ MutableTimedMetadataGroup) InitWithSampleBuffer(sampleBuffer coremedia.SampleBufferRef) MutableTimedMetadataGroup { + rv := objc.Call[MutableTimedMetadataGroup](m_, objc.Sel("initWithSampleBuffer:"), sampleBuffer) + return rv +} + +// Creates a timed metadata group with a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup/1387128-initwithsamplebuffer?language=objc +func NewMutableTimedMetadataGroupWithSampleBuffer(sampleBuffer coremedia.SampleBufferRef) MutableTimedMetadataGroup { + instance := MutableTimedMetadataGroupClass.Alloc().InitWithSampleBuffer(sampleBuffer) + instance.Autorelease() + return instance +} + +func (m_ MutableTimedMetadataGroup) InitWithItemsTimeRange(items []IMetadataItem, timeRange coremedia.TimeRange) MutableTimedMetadataGroup { + rv := objc.Call[MutableTimedMetadataGroup](m_, objc.Sel("initWithItems:timeRange:"), items, timeRange) + return rv +} + +// Creates a timed metadata group initialized with the given metadata items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup/1389632-initwithitems?language=objc +func NewMutableTimedMetadataGroupWithItemsTimeRange(items []IMetadataItem, timeRange coremedia.TimeRange) MutableTimedMetadataGroup { + instance := MutableTimedMetadataGroupClass.Alloc().InitWithItemsTimeRange(items, timeRange) + instance.Autorelease() + return instance +} + +// An array of metadata items in the timed metadata group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutabletimedmetadatagroup/1386481-items?language=objc +func (m_ MutableTimedMetadataGroup) SetItems(value []IMetadataItem) { + objc.Call[objc.Void](m_, objc.Sel("setItems:"), value) +} + +// The time range of the timed metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutabletimedmetadatagroup/1387595-timerange?language=objc +func (m_ MutableTimedMetadataGroup) SetTimeRange(value coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("setTimeRange:"), value) +} diff --git a/macos/avfoundation/mutable_video_composition.gen.go b/macos/avfoundation/mutable_video_composition.gen.go new file mode 100644 index 00000000..ee6337d0 --- /dev/null +++ b/macos/avfoundation/mutable_video_composition.gen.go @@ -0,0 +1,164 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableVideoComposition] class. +var MutableVideoCompositionClass = _MutableVideoCompositionClass{objc.GetClass("AVMutableVideoComposition")} + +type _MutableVideoCompositionClass struct { + objc.Class +} + +// An interface definition for the [MutableVideoComposition] class. +type IMutableVideoComposition interface { + IVideoComposition + SetColorPrimaries(value string) + SetColorYCbCrMatrix(value string) + SetCustomVideoCompositorClass(value objc.IClass) + SetFrameDuration(value coremedia.Time) + SetInstructions(value []objc.IObject) + SetSourceSampleDataTrackIDs(value []foundation.INumber) + SetAnimationTool(value IVideoCompositionCoreAnimationTool) + SetColorTransferFunction(value string) + SetSourceTrackIDForFrameTiming(value objc.IObject) + SetRenderSize(value coregraphics.Size) + SetRenderScale(value float64) +} + +// A mutable video composition subclass. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition?language=objc +type MutableVideoComposition struct { + VideoComposition +} + +func MutableVideoCompositionFrom(ptr unsafe.Pointer) MutableVideoComposition { + return MutableVideoComposition{ + VideoComposition: VideoCompositionFrom(ptr), + } +} + +func (mc _MutableVideoCompositionClass) Alloc() MutableVideoComposition { + rv := objc.Call[MutableVideoComposition](mc, objc.Sel("alloc")) + return rv +} + +func MutableVideoComposition_Alloc() MutableVideoComposition { + return MutableVideoCompositionClass.Alloc() +} + +func (mc _MutableVideoCompositionClass) New() MutableVideoComposition { + rv := objc.Call[MutableVideoComposition](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableVideoComposition() MutableVideoComposition { + return MutableVideoCompositionClass.New() +} + +func (m_ MutableVideoComposition) Init() MutableVideoComposition { + rv := objc.Call[MutableVideoComposition](m_, objc.Sel("init")) + return rv +} + +// Creates a new mutable video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1519720-videocomposition?language=objc +func (mc _MutableVideoCompositionClass) VideoComposition() MutableVideoComposition { + rv := objc.Call[MutableVideoComposition](mc, objc.Sel("videoComposition")) + return rv +} + +// Creates a new mutable video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1519720-videocomposition?language=objc +func MutableVideoComposition_VideoComposition() MutableVideoComposition { + return MutableVideoCompositionClass.VideoComposition() +} + +// The color primaries used for video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1643234-colorprimaries?language=objc +func (m_ MutableVideoComposition) SetColorPrimaries(value string) { + objc.Call[objc.Void](m_, objc.Sel("setColorPrimaries:"), value) +} + +// The YCbCr matrix used for video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1643231-colorycbcrmatrix?language=objc +func (m_ MutableVideoComposition) SetColorYCbCrMatrix(value string) { + objc.Call[objc.Void](m_, objc.Sel("setColorYCbCrMatrix:"), value) +} + +// The custom compositor class to use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1390649-customvideocompositorclass?language=objc +func (m_ MutableVideoComposition) SetCustomVideoCompositorClass(value objc.IClass) { + objc.Call[objc.Void](m_, objc.Sel("setCustomVideoCompositorClass:"), objc.Ptr(value)) +} + +// A time interval for which the video composition should render composed video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1390059-frameduration?language=objc +func (m_ MutableVideoComposition) SetFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setFrameDuration:"), value) +} + +// The video composition instructions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1385815-instructions?language=objc +func (m_ MutableVideoComposition) SetInstructions(value []objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setInstructions:"), value) +} + +// The identifiers of source sample data tracks in the composition that the compositor requires to compose frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/3750316-sourcesampledatatrackids?language=objc +func (m_ MutableVideoComposition) SetSourceSampleDataTrackIDs(value []foundation.INumber) { + objc.Call[objc.Void](m_, objc.Sel("setSourceSampleDataTrackIDs:"), value) +} + +// A video composition tool to use with Core Animation in offline rendering. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1390395-animationtool?language=objc +func (m_ MutableVideoComposition) SetAnimationTool(value IVideoCompositionCoreAnimationTool) { + objc.Call[objc.Void](m_, objc.Sel("setAnimationTool:"), objc.Ptr(value)) +} + +// The transfer function used for video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1643237-colortransferfunction?language=objc +func (m_ MutableVideoComposition) SetColorTransferFunction(value string) { + objc.Call[objc.Void](m_, objc.Sel("setColorTransferFunction:"), value) +} + +// An identifier of the source track from which the video composition derives frame timing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/2873799-sourcetrackidforframetiming?language=objc +func (m_ MutableVideoComposition) SetSourceTrackIDForFrameTiming(value objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setSourceTrackIDForFrameTiming:"), objc.Ptr(value)) +} + +// The size at which the video composition should render. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1386365-rendersize?language=objc +func (m_ MutableVideoComposition) SetRenderSize(value coregraphics.Size) { + objc.Call[objc.Void](m_, objc.Sel("setRenderSize:"), value) +} + +// The scale at which the video composition should render. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocomposition/1615787-renderscale?language=objc +func (m_ MutableVideoComposition) SetRenderScale(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setRenderScale:"), value) +} diff --git a/macos/avfoundation/mutable_video_composition_instruction.gen.go b/macos/avfoundation/mutable_video_composition_instruction.gen.go new file mode 100644 index 00000000..b7516e33 --- /dev/null +++ b/macos/avfoundation/mutable_video_composition_instruction.gen.go @@ -0,0 +1,113 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableVideoCompositionInstruction] class. +var MutableVideoCompositionInstructionClass = _MutableVideoCompositionInstructionClass{objc.GetClass("AVMutableVideoCompositionInstruction")} + +type _MutableVideoCompositionInstructionClass struct { + objc.Class +} + +// An interface definition for the [MutableVideoCompositionInstruction] class. +type IMutableVideoCompositionInstruction interface { + IVideoCompositionInstruction + SetRequiredSourceSampleDataTrackIDs(value []foundation.INumber) + SetLayerInstructions(value []IVideoCompositionLayerInstruction) + SetBackgroundColor(value coregraphics.ColorRef) + SetTimeRange(value coremedia.TimeRange) + SetEnablePostProcessing(value bool) +} + +// A mutable video composition instruction subclass. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositioninstruction?language=objc +type MutableVideoCompositionInstruction struct { + VideoCompositionInstruction +} + +func MutableVideoCompositionInstructionFrom(ptr unsafe.Pointer) MutableVideoCompositionInstruction { + return MutableVideoCompositionInstruction{ + VideoCompositionInstruction: VideoCompositionInstructionFrom(ptr), + } +} + +func (mc _MutableVideoCompositionInstructionClass) VideoCompositionInstruction() MutableVideoCompositionInstruction { + rv := objc.Call[MutableVideoCompositionInstruction](mc, objc.Sel("videoCompositionInstruction")) + return rv +} + +// Returns a new mutable video composition instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositioninstruction/1519701-videocompositioninstruction?language=objc +func MutableVideoCompositionInstruction_VideoCompositionInstruction() MutableVideoCompositionInstruction { + return MutableVideoCompositionInstructionClass.VideoCompositionInstruction() +} + +func (mc _MutableVideoCompositionInstructionClass) Alloc() MutableVideoCompositionInstruction { + rv := objc.Call[MutableVideoCompositionInstruction](mc, objc.Sel("alloc")) + return rv +} + +func MutableVideoCompositionInstruction_Alloc() MutableVideoCompositionInstruction { + return MutableVideoCompositionInstructionClass.Alloc() +} + +func (mc _MutableVideoCompositionInstructionClass) New() MutableVideoCompositionInstruction { + rv := objc.Call[MutableVideoCompositionInstruction](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableVideoCompositionInstruction() MutableVideoCompositionInstruction { + return MutableVideoCompositionInstructionClass.New() +} + +func (m_ MutableVideoCompositionInstruction) Init() MutableVideoCompositionInstruction { + rv := objc.Call[MutableVideoCompositionInstruction](m_, objc.Sel("init")) + return rv +} + +// The track identifiers of source sample data that the compositor requires to compose frames for the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositioninstruction/3750317-requiredsourcesampledatatrackids?language=objc +func (m_ MutableVideoCompositionInstruction) SetRequiredSourceSampleDataTrackIDs(value []foundation.INumber) { + objc.Call[objc.Void](m_, objc.Sel("setRequiredSourceSampleDataTrackIDs:"), value) +} + +// Instructions that specify how to layer and compose video frames from source tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositioninstruction/1388912-layerinstructions?language=objc +func (m_ MutableVideoCompositionInstruction) SetLayerInstructions(value []IVideoCompositionLayerInstruction) { + objc.Call[objc.Void](m_, objc.Sel("setLayerInstructions:"), value) +} + +// The background color of the composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositioninstruction/1390236-backgroundcolor?language=objc +func (m_ MutableVideoCompositionInstruction) SetBackgroundColor(value coregraphics.ColorRef) { + objc.Call[objc.Void](m_, objc.Sel("setBackgroundColor:"), value) +} + +// The time range to which the instruction applies. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositioninstruction/1390418-timerange?language=objc +func (m_ MutableVideoCompositionInstruction) SetTimeRange(value coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("setTimeRange:"), value) +} + +// A Boolean value that indicates whether the instruction requires post processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositioninstruction/1385876-enablepostprocessing?language=objc +func (m_ MutableVideoCompositionInstruction) SetEnablePostProcessing(value bool) { + objc.Call[objc.Void](m_, objc.Sel("setEnablePostProcessing:"), value) +} diff --git a/macos/avfoundation/mutable_video_composition_layer_instruction.gen.go b/macos/avfoundation/mutable_video_composition_layer_instruction.gen.go new file mode 100644 index 00000000..02a4f9f3 --- /dev/null +++ b/macos/avfoundation/mutable_video_composition_layer_instruction.gen.go @@ -0,0 +1,128 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MutableVideoCompositionLayerInstruction] class. +var MutableVideoCompositionLayerInstructionClass = _MutableVideoCompositionLayerInstructionClass{objc.GetClass("AVMutableVideoCompositionLayerInstruction")} + +type _MutableVideoCompositionLayerInstructionClass struct { + objc.Class +} + +// An interface definition for the [MutableVideoCompositionLayerInstruction] class. +type IMutableVideoCompositionLayerInstruction interface { + IVideoCompositionLayerInstruction + SetCropRectangleRampFromStartCropRectangleToEndCropRectangleTimeRange(startCropRectangle coregraphics.Rect, endCropRectangle coregraphics.Rect, timeRange coremedia.TimeRange) + SetOpacityRampFromStartOpacityToEndOpacityTimeRange(startOpacity float64, endOpacity float64, timeRange coremedia.TimeRange) + SetCropRectangleAtTime(cropRectangle coregraphics.Rect, time coremedia.Time) + SetOpacityAtTime(opacity float64, time coremedia.Time) + SetTransformRampFromStartTransformToEndTransformTimeRange(startTransform coregraphics.AffineTransform, endTransform coregraphics.AffineTransform, timeRange coremedia.TimeRange) + SetTransformAtTime(transform coregraphics.AffineTransform, time coremedia.Time) + SetTrackID(value objc.IObject) +} + +// An object used to modify the transform, cropping, and opacity ramps applied to a given track in a mutable composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction?language=objc +type MutableVideoCompositionLayerInstruction struct { + VideoCompositionLayerInstruction +} + +func MutableVideoCompositionLayerInstructionFrom(ptr unsafe.Pointer) MutableVideoCompositionLayerInstruction { + return MutableVideoCompositionLayerInstruction{ + VideoCompositionLayerInstruction: VideoCompositionLayerInstructionFrom(ptr), + } +} + +func (mc _MutableVideoCompositionLayerInstructionClass) VideoCompositionLayerInstruction() MutableVideoCompositionLayerInstruction { + rv := objc.Call[MutableVideoCompositionLayerInstruction](mc, objc.Sel("videoCompositionLayerInstruction")) + return rv +} + +// Returns a new mutable video composition layer instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1519717-videocompositionlayerinstruction?language=objc +func MutableVideoCompositionLayerInstruction_VideoCompositionLayerInstruction() MutableVideoCompositionLayerInstruction { + return MutableVideoCompositionLayerInstructionClass.VideoCompositionLayerInstruction() +} + +func (mc _MutableVideoCompositionLayerInstructionClass) Alloc() MutableVideoCompositionLayerInstruction { + rv := objc.Call[MutableVideoCompositionLayerInstruction](mc, objc.Sel("alloc")) + return rv +} + +func MutableVideoCompositionLayerInstruction_Alloc() MutableVideoCompositionLayerInstruction { + return MutableVideoCompositionLayerInstructionClass.Alloc() +} + +func (mc _MutableVideoCompositionLayerInstructionClass) New() MutableVideoCompositionLayerInstruction { + rv := objc.Call[MutableVideoCompositionLayerInstruction](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMutableVideoCompositionLayerInstruction() MutableVideoCompositionLayerInstruction { + return MutableVideoCompositionLayerInstructionClass.New() +} + +func (m_ MutableVideoCompositionLayerInstruction) Init() MutableVideoCompositionLayerInstruction { + rv := objc.Call[MutableVideoCompositionLayerInstruction](m_, objc.Sel("init")) + return rv +} + +// Sets a crop rectangle ramp to apply during the specified time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1385677-setcroprectanglerampfromstartcro?language=objc +func (m_ MutableVideoCompositionLayerInstruction) SetCropRectangleRampFromStartCropRectangleToEndCropRectangleTimeRange(startCropRectangle coregraphics.Rect, endCropRectangle coregraphics.Rect, timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("setCropRectangleRampFromStartCropRectangle:toEndCropRectangle:timeRange:"), startCropRectangle, endCropRectangle, timeRange) +} + +// Sets an opacity ramp to apply during a specified time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1387532-setopacityrampfromstartopacity?language=objc +func (m_ MutableVideoCompositionLayerInstruction) SetOpacityRampFromStartOpacityToEndOpacityTimeRange(startOpacity float64, endOpacity float64, timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("setOpacityRampFromStartOpacity:toEndOpacity:timeRange:"), startOpacity, endOpacity, timeRange) +} + +// Sets the crop rectangle value at a time within the time range of the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1387402-setcroprectangle?language=objc +func (m_ MutableVideoCompositionLayerInstruction) SetCropRectangleAtTime(cropRectangle coregraphics.Rect, time coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setCropRectangle:atTime:"), cropRectangle, time) +} + +// Sets the opacity value at a specific time within the time range of the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1390758-setopacity?language=objc +func (m_ MutableVideoCompositionLayerInstruction) SetOpacityAtTime(opacity float64, time coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setOpacity:atTime:"), opacity, time) +} + +// Sets a transform ramp to apply during a given time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1388192-settransformrampfromstarttransfo?language=objc +func (m_ MutableVideoCompositionLayerInstruction) SetTransformRampFromStartTransformToEndTransformTimeRange(startTransform coregraphics.AffineTransform, endTransform coregraphics.AffineTransform, timeRange coremedia.TimeRange) { + objc.Call[objc.Void](m_, objc.Sel("setTransformRampFromStartTransform:toEndTransform:timeRange:"), startTransform, endTransform, timeRange) +} + +// Sets the transform value at a time within the time range of the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1390899-settransform?language=objc +func (m_ MutableVideoCompositionLayerInstruction) SetTransformAtTime(transform coregraphics.AffineTransform, time coremedia.Time) { + objc.Call[objc.Void](m_, objc.Sel("setTransform:atTime:"), transform, time) +} + +// The track identifier of the source track to which the compositor applies the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avmutablevideocompositionlayerinstruction/1387222-trackid?language=objc +func (m_ MutableVideoCompositionLayerInstruction) SetTrackID(value objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("setTrackID:"), objc.Ptr(value)) +} diff --git a/macos/avfoundation/output_settings_assistant.gen.go b/macos/avfoundation/output_settings_assistant.gen.go new file mode 100644 index 00000000..189cab43 --- /dev/null +++ b/macos/avfoundation/output_settings_assistant.gen.go @@ -0,0 +1,181 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [OutputSettingsAssistant] class. +var OutputSettingsAssistantClass = _OutputSettingsAssistantClass{objc.GetClass("AVOutputSettingsAssistant")} + +type _OutputSettingsAssistantClass struct { + objc.Class +} + +// An interface definition for the [OutputSettingsAssistant] class. +type IOutputSettingsAssistant interface { + objc.IObject + SourceVideoFormat() coremedia.VideoFormatDescriptionRef + SetSourceVideoFormat(value coremedia.VideoFormatDescriptionRef) + SourceVideoMinFrameDuration() coremedia.Time + SetSourceVideoMinFrameDuration(value coremedia.Time) + SourceVideoAverageFrameDuration() coremedia.Time + SetSourceVideoAverageFrameDuration(value coremedia.Time) + VideoSettings() map[string]objc.Object + AudioSettings() map[string]objc.Object + OutputFileType() FileType + SourceAudioFormat() coremedia.AudioFormatDescriptionRef + SetSourceAudioFormat(value coremedia.AudioFormatDescriptionRef) +} + +// An object that builds audio and video output settings dictionaries. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant?language=objc +type OutputSettingsAssistant struct { + objc.Object +} + +func OutputSettingsAssistantFrom(ptr unsafe.Pointer) OutputSettingsAssistant { + return OutputSettingsAssistant{ + Object: objc.ObjectFrom(ptr), + } +} + +func (oc _OutputSettingsAssistantClass) OutputSettingsAssistantWithPreset(presetIdentifier OutputSettingsPreset) OutputSettingsAssistant { + rv := objc.Call[OutputSettingsAssistant](oc, objc.Sel("outputSettingsAssistantWithPreset:"), presetIdentifier) + return rv +} + +// Returns a new output settings assistant for a preset configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1387909-outputsettingsassistantwithprese?language=objc +func OutputSettingsAssistant_OutputSettingsAssistantWithPreset(presetIdentifier OutputSettingsPreset) OutputSettingsAssistant { + return OutputSettingsAssistantClass.OutputSettingsAssistantWithPreset(presetIdentifier) +} + +func (oc _OutputSettingsAssistantClass) Alloc() OutputSettingsAssistant { + rv := objc.Call[OutputSettingsAssistant](oc, objc.Sel("alloc")) + return rv +} + +func OutputSettingsAssistant_Alloc() OutputSettingsAssistant { + return OutputSettingsAssistantClass.Alloc() +} + +func (oc _OutputSettingsAssistantClass) New() OutputSettingsAssistant { + rv := objc.Call[OutputSettingsAssistant](oc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewOutputSettingsAssistant() OutputSettingsAssistant { + return OutputSettingsAssistantClass.New() +} + +func (o_ OutputSettingsAssistant) Init() OutputSettingsAssistant { + rv := objc.Call[OutputSettingsAssistant](o_, objc.Sel("init")) + return rv +} + +// Returns an array of preset values to use to initialize an output settings assistant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1388118-availableoutputsettingspresets?language=objc +func (oc _OutputSettingsAssistantClass) AvailableOutputSettingsPresets() []OutputSettingsPreset { + rv := objc.Call[[]OutputSettingsPreset](oc, objc.Sel("availableOutputSettingsPresets")) + return rv +} + +// Returns an array of preset values to use to initialize an output settings assistant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1388118-availableoutputsettingspresets?language=objc +func OutputSettingsAssistant_AvailableOutputSettingsPresets() []OutputSettingsPreset { + return OutputSettingsAssistantClass.AvailableOutputSettingsPresets() +} + +// The format of the source video data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1387885-sourcevideoformat?language=objc +func (o_ OutputSettingsAssistant) SourceVideoFormat() coremedia.VideoFormatDescriptionRef { + rv := objc.Call[coremedia.VideoFormatDescriptionRef](o_, objc.Sel("sourceVideoFormat")) + return rv +} + +// The format of the source video data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1387885-sourcevideoformat?language=objc +func (o_ OutputSettingsAssistant) SetSourceVideoFormat(value coremedia.VideoFormatDescriptionRef) { + objc.Call[objc.Void](o_, objc.Sel("setSourceVideoFormat:"), value) +} + +// A time value that describes the minimum frame duration of the video data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1386812-sourcevideominframeduration?language=objc +func (o_ OutputSettingsAssistant) SourceVideoMinFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](o_, objc.Sel("sourceVideoMinFrameDuration")) + return rv +} + +// A time value that describes the minimum frame duration of the video data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1386812-sourcevideominframeduration?language=objc +func (o_ OutputSettingsAssistant) SetSourceVideoMinFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](o_, objc.Sel("setSourceVideoMinFrameDuration:"), value) +} + +// A time value that describes the average frame duration of the video data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1387414-sourcevideoaverageframeduration?language=objc +func (o_ OutputSettingsAssistant) SourceVideoAverageFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](o_, objc.Sel("sourceVideoAverageFrameDuration")) + return rv +} + +// A time value that describes the average frame duration of the video data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1387414-sourcevideoaverageframeduration?language=objc +func (o_ OutputSettingsAssistant) SetSourceVideoAverageFrameDuration(value coremedia.Time) { + objc.Call[objc.Void](o_, objc.Sel("setSourceVideoAverageFrameDuration:"), value) +} + +// A video settings dictionary. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1386880-videosettings?language=objc +func (o_ OutputSettingsAssistant) VideoSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](o_, objc.Sel("videoSettings")) + return rv +} + +// An audio settings dictionary. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1386233-audiosettings?language=objc +func (o_ OutputSettingsAssistant) AudioSettings() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](o_, objc.Sel("audioSettings")) + return rv +} + +// A uniform type identifier (UTI) that indicates the type of file to write. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1390842-outputfiletype?language=objc +func (o_ OutputSettingsAssistant) OutputFileType() FileType { + rv := objc.Call[FileType](o_, objc.Sel("outputFileType")) + return rv +} + +// The format of the source audio data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1390673-sourceaudioformat?language=objc +func (o_ OutputSettingsAssistant) SourceAudioFormat() coremedia.AudioFormatDescriptionRef { + rv := objc.Call[coremedia.AudioFormatDescriptionRef](o_, objc.Sel("sourceAudioFormat")) + return rv +} + +// The format of the source audio data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant/1390673-sourceaudioformat?language=objc +func (o_ OutputSettingsAssistant) SetSourceAudioFormat(value coremedia.AudioFormatDescriptionRef) { + objc.Call[objc.Void](o_, objc.Sel("setSourceAudioFormat:"), value) +} diff --git a/macos/avfoundation/persistable_content_key_request.gen.go b/macos/avfoundation/persistable_content_key_request.gen.go new file mode 100644 index 00000000..c62b0928 --- /dev/null +++ b/macos/avfoundation/persistable_content_key_request.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PersistableContentKeyRequest] class. +var PersistableContentKeyRequestClass = _PersistableContentKeyRequestClass{objc.GetClass("AVPersistableContentKeyRequest")} + +type _PersistableContentKeyRequestClass struct { + objc.Class +} + +// An interface definition for the [PersistableContentKeyRequest] class. +type IPersistableContentKeyRequest interface { + IContentKeyRequest + PersistableContentKeyFromKeyVendorResponseOptionsError(keyVendorResponse []byte, options map[string]objc.IObject, outError foundation.IError) []byte +} + +// An object that encapsulates information about a persistable content decryption key request issued from a content key session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avpersistablecontentkeyrequest?language=objc +type PersistableContentKeyRequest struct { + ContentKeyRequest +} + +func PersistableContentKeyRequestFrom(ptr unsafe.Pointer) PersistableContentKeyRequest { + return PersistableContentKeyRequest{ + ContentKeyRequest: ContentKeyRequestFrom(ptr), + } +} + +func (pc _PersistableContentKeyRequestClass) Alloc() PersistableContentKeyRequest { + rv := objc.Call[PersistableContentKeyRequest](pc, objc.Sel("alloc")) + return rv +} + +func PersistableContentKeyRequest_Alloc() PersistableContentKeyRequest { + return PersistableContentKeyRequestClass.Alloc() +} + +func (pc _PersistableContentKeyRequestClass) New() PersistableContentKeyRequest { + rv := objc.Call[PersistableContentKeyRequest](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPersistableContentKeyRequest() PersistableContentKeyRequest { + return PersistableContentKeyRequestClass.New() +} + +func (p_ PersistableContentKeyRequest) Init() PersistableContentKeyRequest { + rv := objc.Call[PersistableContentKeyRequest](p_, objc.Sel("init")) + return rv +} + +// Creates a persistable content key from the content key context data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avpersistablecontentkeyrequest/2799188-persistablecontentkeyfromkeyvend?language=objc +func (p_ PersistableContentKeyRequest) PersistableContentKeyFromKeyVendorResponseOptionsError(keyVendorResponse []byte, options map[string]objc.IObject, outError foundation.IError) []byte { + rv := objc.Call[[]byte](p_, objc.Sel("persistableContentKeyFromKeyVendorResponse:options:error:"), keyVendorResponse, options, objc.Ptr(outError)) + return rv +} diff --git a/macos/avfoundation/playback_coordinator.gen.go b/macos/avfoundation/playback_coordinator.gen.go new file mode 100644 index 00000000..55048e4f --- /dev/null +++ b/macos/avfoundation/playback_coordinator.gen.go @@ -0,0 +1,146 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlaybackCoordinator] class. +var PlaybackCoordinatorClass = _PlaybackCoordinatorClass{objc.GetClass("AVPlaybackCoordinator")} + +type _PlaybackCoordinatorClass struct { + objc.Class +} + +// An interface definition for the [PlaybackCoordinator] class. +type IPlaybackCoordinator interface { + objc.IObject + ExpectedItemTimeAtHostTime(hostClockTime coremedia.Time) coremedia.Time + SetParticipantLimitForWaitingOutSuspensionsWithReason(participantLimit int, reason CoordinatedPlaybackSuspensionReason) + BeginSuspensionForReason(suspensionReason CoordinatedPlaybackSuspensionReason) CoordinatedPlaybackSuspension + ParticipantLimitForWaitingOutSuspensionsWithReason(reason CoordinatedPlaybackSuspensionReason) int + PauseSnapsToMediaTimeOfOriginator() bool + SetPauseSnapsToMediaTimeOfOriginator(value bool) + OtherParticipants() []CoordinatedPlaybackParticipant + SuspensionReasons() []CoordinatedPlaybackSuspensionReason + SuspensionReasonsThatTriggerWaiting() []CoordinatedPlaybackSuspensionReason + SetSuspensionReasonsThatTriggerWaiting(value []CoordinatedPlaybackSuspensionReason) +} + +// An object that coordinates the playback of players in a connected group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator?language=objc +type PlaybackCoordinator struct { + objc.Object +} + +func PlaybackCoordinatorFrom(ptr unsafe.Pointer) PlaybackCoordinator { + return PlaybackCoordinator{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlaybackCoordinatorClass) Alloc() PlaybackCoordinator { + rv := objc.Call[PlaybackCoordinator](pc, objc.Sel("alloc")) + return rv +} + +func PlaybackCoordinator_Alloc() PlaybackCoordinator { + return PlaybackCoordinatorClass.Alloc() +} + +func (pc _PlaybackCoordinatorClass) New() PlaybackCoordinator { + rv := objc.Call[PlaybackCoordinator](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlaybackCoordinator() PlaybackCoordinator { + return PlaybackCoordinatorClass.New() +} + +func (p_ PlaybackCoordinator) Init() PlaybackCoordinator { + rv := objc.Call[PlaybackCoordinator](p_, objc.Sel("init")) + return rv +} + +// Returns a time in the current item’s timeline that the coordinator expects to play at the specified host time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750285-expecteditemtimeathosttime?language=objc +func (p_ PlaybackCoordinator) ExpectedItemTimeAtHostTime(hostClockTime coremedia.Time) coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("expectedItemTimeAtHostTime:"), hostClockTime) + return rv +} + +// Sets a limit on the number of partipants that a group may contain before the coordinator stops waiting on suspensions that occur for a particular reason. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750289-setparticipantlimit?language=objc +func (p_ PlaybackCoordinator) SetParticipantLimitForWaitingOutSuspensionsWithReason(participantLimit int, reason CoordinatedPlaybackSuspensionReason) { + objc.Call[objc.Void](p_, objc.Sel("setParticipantLimit:forWaitingOutSuspensionsWithReason:"), participantLimit, reason) +} + +// Tells the coordinator to stop sending playback commands temporarily when the playback object disconnects from the group activity. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750284-beginsuspensionforreason?language=objc +func (p_ PlaybackCoordinator) BeginSuspensionForReason(suspensionReason CoordinatedPlaybackSuspensionReason) CoordinatedPlaybackSuspension { + rv := objc.Call[CoordinatedPlaybackSuspension](p_, objc.Sel("beginSuspensionForReason:"), suspensionReason) + return rv +} + +// Returns the limit on the number of partipants that a group may contain before the coordinator stops waiting on suspensions that occur for a particular reason. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750287-participantlimitforwaitingoutsus?language=objc +func (p_ PlaybackCoordinator) ParticipantLimitForWaitingOutSuspensionsWithReason(reason CoordinatedPlaybackSuspensionReason) int { + rv := objc.Call[int](p_, objc.Sel("participantLimitForWaitingOutSuspensionsWithReason:"), reason) + return rv +} + +// A Boolean value that indicates whether participants mirror the originator’s stop time when they pause. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750288-pausesnapstomediatimeoforiginato?language=objc +func (p_ PlaybackCoordinator) PauseSnapsToMediaTimeOfOriginator() bool { + rv := objc.Call[bool](p_, objc.Sel("pauseSnapsToMediaTimeOfOriginator")) + return rv +} + +// A Boolean value that indicates whether participants mirror the originator’s stop time when they pause. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750288-pausesnapstomediatimeoforiginato?language=objc +func (p_ PlaybackCoordinator) SetPauseSnapsToMediaTimeOfOriginator(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setPauseSnapsToMediaTimeOfOriginator:"), value) +} + +// The identifiers of the other participants in a group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750286-otherparticipants?language=objc +func (p_ PlaybackCoordinator) OtherParticipants() []CoordinatedPlaybackParticipant { + rv := objc.Call[[]CoordinatedPlaybackParticipant](p_, objc.Sel("otherParticipants")) + return rv +} + +// The reasons a coordinator is currently unable to participate in a group playback activity. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750290-suspensionreasons?language=objc +func (p_ PlaybackCoordinator) SuspensionReasons() []CoordinatedPlaybackSuspensionReason { + rv := objc.Call[[]CoordinatedPlaybackSuspensionReason](p_, objc.Sel("suspensionReasons")) + return rv +} + +// The reasons that cause a coordinator to suspend playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750291-suspensionreasonsthattriggerwait?language=objc +func (p_ PlaybackCoordinator) SuspensionReasonsThatTriggerWaiting() []CoordinatedPlaybackSuspensionReason { + rv := objc.Call[[]CoordinatedPlaybackSuspensionReason](p_, objc.Sel("suspensionReasonsThatTriggerWaiting")) + return rv +} + +// The reasons that cause a coordinator to suspend playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinator/3750291-suspensionreasonsthattriggerwait?language=objc +func (p_ PlaybackCoordinator) SetSuspensionReasonsThatTriggerWaiting(value []CoordinatedPlaybackSuspensionReason) { + objc.Call[objc.Void](p_, objc.Sel("setSuspensionReasonsThatTriggerWaiting:"), value) +} diff --git a/macos/avfoundation/playback_coordinator_playback_control_delegate.gen.go b/macos/avfoundation/playback_coordinator_playback_control_delegate.gen.go new file mode 100644 index 00000000..01fc0c0a --- /dev/null +++ b/macos/avfoundation/playback_coordinator_playback_control_delegate.gen.go @@ -0,0 +1,55 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the method to implement to respond to playback commands from the playback coordinator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinatorplaybackcontroldelegate?language=objc +type PPlaybackCoordinatorPlaybackControlDelegate interface { + // optional + PlaybackCoordinatorDidIssuePlayCommandCompletionHandler(coordinator DelegatingPlaybackCoordinator, playCommand DelegatingPlaybackCoordinatorPlayCommand, completionHandler func()) + HasPlaybackCoordinatorDidIssuePlayCommandCompletionHandler() bool +} + +// A delegate implementation builder for the [PPlaybackCoordinatorPlaybackControlDelegate] protocol. +type PlaybackCoordinatorPlaybackControlDelegate struct { + _PlaybackCoordinatorDidIssuePlayCommandCompletionHandler func(coordinator DelegatingPlaybackCoordinator, playCommand DelegatingPlaybackCoordinatorPlayCommand, completionHandler func()) +} + +func (di *PlaybackCoordinatorPlaybackControlDelegate) HasPlaybackCoordinatorDidIssuePlayCommandCompletionHandler() bool { + return di._PlaybackCoordinatorDidIssuePlayCommandCompletionHandler != nil +} + +// Tells the delegate to match the playback rate to that of the group when the rate is nonzero. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinatorplaybackcontroldelegate/3750296-playbackcoordinator?language=objc +func (di *PlaybackCoordinatorPlaybackControlDelegate) SetPlaybackCoordinatorDidIssuePlayCommandCompletionHandler(f func(coordinator DelegatingPlaybackCoordinator, playCommand DelegatingPlaybackCoordinatorPlayCommand, completionHandler func())) { + di._PlaybackCoordinatorDidIssuePlayCommandCompletionHandler = f +} + +// Tells the delegate to match the playback rate to that of the group when the rate is nonzero. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinatorplaybackcontroldelegate/3750296-playbackcoordinator?language=objc +func (di *PlaybackCoordinatorPlaybackControlDelegate) PlaybackCoordinatorDidIssuePlayCommandCompletionHandler(coordinator DelegatingPlaybackCoordinator, playCommand DelegatingPlaybackCoordinatorPlayCommand, completionHandler func()) { + di._PlaybackCoordinatorDidIssuePlayCommandCompletionHandler(coordinator, playCommand, completionHandler) +} + +// A concrete type wrapper for the [PPlaybackCoordinatorPlaybackControlDelegate] protocol. +type PlaybackCoordinatorPlaybackControlDelegateWrapper struct { + objc.Object +} + +func (p_ PlaybackCoordinatorPlaybackControlDelegateWrapper) HasPlaybackCoordinatorDidIssuePlayCommandCompletionHandler() bool { + return p_.RespondsToSelector(objc.Sel("playbackCoordinator:didIssuePlayCommand:completionHandler:")) +} + +// Tells the delegate to match the playback rate to that of the group when the rate is nonzero. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplaybackcoordinatorplaybackcontroldelegate/3750296-playbackcoordinator?language=objc +func (p_ PlaybackCoordinatorPlaybackControlDelegateWrapper) PlaybackCoordinatorDidIssuePlayCommandCompletionHandler(coordinator IDelegatingPlaybackCoordinator, playCommand IDelegatingPlaybackCoordinatorPlayCommand, completionHandler func()) { + objc.Call[objc.Void](p_, objc.Sel("playbackCoordinator:didIssuePlayCommand:completionHandler:"), objc.Ptr(coordinator), objc.Ptr(playCommand), completionHandler) +} diff --git a/macos/avfoundation/player.gen.go b/macos/avfoundation/player.gen.go new file mode 100644 index 00000000..44c8963e --- /dev/null +++ b/macos/avfoundation/player.gen.go @@ -0,0 +1,528 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Player] class. +var PlayerClass = _PlayerClass{objc.GetClass("AVPlayer")} + +type _PlayerClass struct { + objc.Class +} + +// An interface definition for the [Player] class. +type IPlayer interface { + objc.IObject + MediaSelectionCriteriaForMediaCharacteristic(mediaCharacteristic MediaCharacteristic) PlayerMediaSelectionCriteria + SeekToDate(date foundation.IDate) + PlayImmediatelyAtRate(rate float64) + RemoveTimeObserver(observer objc.IObject) + SetRateTimeAtHostTime(rate float64, itemTime coremedia.Time, hostClockTime coremedia.Time) + ReplaceCurrentItemWithPlayerItem(item IPlayerItem) + CancelPendingPrerolls() + AddBoundaryTimeObserverForTimesQueueUsingBlock(times []foundation.IValue, queue dispatch.Queue, block func()) objc.Object + AddPeriodicTimeObserverForIntervalQueueUsingBlock(interval coremedia.Time, queue dispatch.Queue, block func(time coremedia.Time)) objc.Object + SeekToTimeToleranceBeforeToleranceAfter(time coremedia.Time, toleranceBefore coremedia.Time, toleranceAfter coremedia.Time) + SetMediaSelectionCriteriaForMediaCharacteristic(criteria IPlayerMediaSelectionCriteria, mediaCharacteristic MediaCharacteristic) + Pause() + Play() + PrerollAtRateCompletionHandler(rate float64, completionHandler func(finished bool)) + CurrentTime() coremedia.Time + SourceClock() coremedia.ClockRef + SetSourceClock(value coremedia.ClockRef) + AudiovisualBackgroundPlaybackPolicy() PlayerAudiovisualBackgroundPlaybackPolicy + SetAudiovisualBackgroundPlaybackPolicy(value PlayerAudiovisualBackgroundPlaybackPolicy) + Volume() float64 + SetVolume(value float64) + Error() foundation.Error + OutputObscuredDueToInsufficientExternalProtection() bool + PreferredVideoDecoderGPURegistryID() uint64 + SetPreferredVideoDecoderGPURegistryID(value uint64) + Rate() float64 + SetRate(value float64) + IsMuted() bool + SetMuted(value bool) + ReasonForWaitingToPlay() PlayerWaitingReason + PlaybackCoordinator() PlayerPlaybackCoordinator + CurrentItem() PlayerItem + AudioOutputDeviceUniqueID() string + SetAudioOutputDeviceUniqueID(value string) + TimeControlStatus() PlayerTimeControlStatus + IsExternalPlaybackActive() bool + ActionAtItemEnd() PlayerActionAtItemEnd + SetActionAtItemEnd(value PlayerActionAtItemEnd) + AllowsExternalPlayback() bool + SetAllowsExternalPlayback(value bool) + AppliesMediaSelectionCriteriaAutomatically() bool + SetAppliesMediaSelectionCriteriaAutomatically(value bool) + PreventsDisplaySleepDuringVideoPlayback() bool + SetPreventsDisplaySleepDuringVideoPlayback(value bool) + Status() PlayerStatus + AutomaticallyWaitsToMinimizeStalling() bool + SetAutomaticallyWaitsToMinimizeStalling(value bool) +} + +// An object that provides the interface to control the player’s transport behavior. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer?language=objc +type Player struct { + objc.Object +} + +func PlayerFrom(ptr unsafe.Pointer) Player { + return Player{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerClass) PlayerWithPlayerItem(item IPlayerItem) Player { + rv := objc.Call[Player](pc, objc.Sel("playerWithPlayerItem:"), objc.Ptr(item)) + return rv +} + +// Returns a new player initialized to play the specified player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1538390-playerwithplayeritem?language=objc +func Player_PlayerWithPlayerItem(item IPlayerItem) Player { + return PlayerClass.PlayerWithPlayerItem(item) +} + +func (p_ Player) InitWithURL(URL foundation.IURL) Player { + rv := objc.Call[Player](p_, objc.Sel("initWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates a new player to play a single audiovisual resource referenced by a given URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1385706-initwithurl?language=objc +func NewPlayerWithURL(URL foundation.IURL) Player { + instance := PlayerClass.Alloc().InitWithURL(URL) + instance.Autorelease() + return instance +} + +func (p_ Player) InitWithPlayerItem(item IPlayerItem) Player { + rv := objc.Call[Player](p_, objc.Sel("initWithPlayerItem:"), objc.Ptr(item)) + return rv +} + +// Creates a new player to play the specified player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387104-initwithplayeritem?language=objc +func NewPlayerWithPlayerItem(item IPlayerItem) Player { + instance := PlayerClass.Alloc().InitWithPlayerItem(item) + instance.Autorelease() + return instance +} + +func (pc _PlayerClass) PlayerWithURL(URL foundation.IURL) Player { + rv := objc.Call[Player](pc, objc.Sel("playerWithURL:"), objc.Ptr(URL)) + return rv +} + +// Returns a new player to play a single audiovisual resource referenced by a given URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1538409-playerwithurl?language=objc +func Player_PlayerWithURL(URL foundation.IURL) Player { + return PlayerClass.PlayerWithURL(URL) +} + +func (pc _PlayerClass) Alloc() Player { + rv := objc.Call[Player](pc, objc.Sel("alloc")) + return rv +} + +func Player_Alloc() Player { + return PlayerClass.Alloc() +} + +func (pc _PlayerClass) New() Player { + rv := objc.Call[Player](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayer() Player { + return PlayerClass.New() +} + +func (p_ Player) Init() Player { + rv := objc.Call[Player](p_, objc.Sel("init")) + return rv +} + +// Returns the automatic selection criteria for media items with the specified media characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387825-mediaselectioncriteriaformediach?language=objc +func (p_ Player) MediaSelectionCriteriaForMediaCharacteristic(mediaCharacteristic MediaCharacteristic) PlayerMediaSelectionCriteria { + rv := objc.Call[PlayerMediaSelectionCriteria](p_, objc.Sel("mediaSelectionCriteriaForMediaCharacteristic:"), mediaCharacteristic) + return rv +} + +// Requests that the player seek to a specified date. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1386114-seektodate?language=objc +func (p_ Player) SeekToDate(date foundation.IDate) { + objc.Call[objc.Void](p_, objc.Sel("seekToDate:"), objc.Ptr(date)) +} + +// Plays the available media data immediately, at the specified rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1643480-playimmediatelyatrate?language=objc +func (p_ Player) PlayImmediatelyAtRate(rate float64) { + objc.Call[objc.Void](p_, objc.Sel("playImmediatelyAtRate:"), rate) +} + +// Cancels a previously registered periodic or boundary time observer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387552-removetimeobserver?language=objc +func (p_ Player) RemoveTimeObserver(observer objc.IObject) { + objc.Call[objc.Void](p_, objc.Sel("removeTimeObserver:"), observer) +} + +// Synchronizes the playback rate and time of the current item with an external source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1386591-setrate?language=objc +func (p_ Player) SetRateTimeAtHostTime(rate float64, itemTime coremedia.Time, hostClockTime coremedia.Time) { + objc.Call[objc.Void](p_, objc.Sel("setRate:time:atHostTime:"), rate, itemTime, hostClockTime) +} + +// Replaces the current item with a new item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1390806-replacecurrentitemwithplayeritem?language=objc +func (p_ Player) ReplaceCurrentItemWithPlayerItem(item IPlayerItem) { + objc.Call[objc.Void](p_, objc.Sel("replaceCurrentItemWithPlayerItem:"), objc.Ptr(item)) +} + +// Cancels any pending preroll requests and invokes the corresponding completion handlers, if present. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1388260-cancelpendingprerolls?language=objc +func (p_ Player) CancelPendingPrerolls() { + objc.Call[objc.Void](p_, objc.Sel("cancelPendingPrerolls")) +} + +// Requests the invocation of a block when specified times are traversed during normal playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1388027-addboundarytimeobserverfortimes?language=objc +func (p_ Player) AddBoundaryTimeObserverForTimesQueueUsingBlock(times []foundation.IValue, queue dispatch.Queue, block func()) objc.Object { + rv := objc.Call[objc.Object](p_, objc.Sel("addBoundaryTimeObserverForTimes:queue:usingBlock:"), times, queue, block) + return rv +} + +// Requests the periodic invocation of a given block during playback to report changing time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1385829-addperiodictimeobserverforinterv?language=objc +func (p_ Player) AddPeriodicTimeObserverForIntervalQueueUsingBlock(interval coremedia.Time, queue dispatch.Queue, block func(time coremedia.Time)) objc.Object { + rv := objc.Call[objc.Object](p_, objc.Sel("addPeriodicTimeObserverForInterval:queue:usingBlock:"), interval, queue, block) + return rv +} + +// Requests that the player seek to a specified time with the amount of accuracy specified by the time tolerance values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387741-seektotime?language=objc +func (p_ Player) SeekToTimeToleranceBeforeToleranceAfter(time coremedia.Time, toleranceBefore coremedia.Time, toleranceAfter coremedia.Time) { + objc.Call[objc.Void](p_, objc.Sel("seekToTime:toleranceBefore:toleranceAfter:"), time, toleranceBefore, toleranceAfter) +} + +// Applies automatic selection criteria for media that has the specified media characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1390563-setmediaselectioncriteria?language=objc +func (p_ Player) SetMediaSelectionCriteriaForMediaCharacteristic(criteria IPlayerMediaSelectionCriteria, mediaCharacteristic MediaCharacteristic) { + objc.Call[objc.Void](p_, objc.Sel("setMediaSelectionCriteria:forMediaCharacteristic:"), objc.Ptr(criteria), mediaCharacteristic) +} + +// Pauses playback of the current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387895-pause?language=objc +func (p_ Player) Pause() { + objc.Call[objc.Void](p_, objc.Sel("pause")) +} + +// Begins playback of the current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1386726-play?language=objc +func (p_ Player) Play() { + objc.Call[objc.Void](p_, objc.Sel("play")) +} + +// Begins loading media data to prime the media pipelines for playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1389712-prerollatrate?language=objc +func (p_ Player) PrerollAtRateCompletionHandler(rate float64, completionHandler func(finished bool)) { + objc.Call[objc.Void](p_, objc.Sel("prerollAtRate:completionHandler:"), rate, completionHandler) +} + +// Returns the current time of the current player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1390404-currenttime?language=objc +func (p_ Player) CurrentTime() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("currentTime")) + return rv +} + +// A clock the player uses for item time bases. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/3746583-sourceclock?language=objc +func (p_ Player) SourceClock() coremedia.ClockRef { + rv := objc.Call[coremedia.ClockRef](p_, objc.Sel("sourceClock")) + return rv +} + +// A clock the player uses for item time bases. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/3746583-sourceclock?language=objc +func (p_ Player) SetSourceClock(value coremedia.ClockRef) { + objc.Call[objc.Void](p_, objc.Sel("setSourceClock:"), value) +} + +// A policy that determines how playback of audiovisual media continues when the app transitions to the background. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/3787548-audiovisualbackgroundplaybackpol?language=objc +func (p_ Player) AudiovisualBackgroundPlaybackPolicy() PlayerAudiovisualBackgroundPlaybackPolicy { + rv := objc.Call[PlayerAudiovisualBackgroundPlaybackPolicy](p_, objc.Sel("audiovisualBackgroundPlaybackPolicy")) + return rv +} + +// A policy that determines how playback of audiovisual media continues when the app transitions to the background. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/3787548-audiovisualbackgroundplaybackpol?language=objc +func (p_ Player) SetAudiovisualBackgroundPlaybackPolicy(value PlayerAudiovisualBackgroundPlaybackPolicy) { + objc.Call[objc.Void](p_, objc.Sel("setAudiovisualBackgroundPlaybackPolicy:"), value) +} + +// The audio playback volume for the player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1390127-volume?language=objc +func (p_ Player) Volume() float64 { + rv := objc.Call[float64](p_, objc.Sel("volume")) + return rv +} + +// The audio playback volume for the player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1390127-volume?language=objc +func (p_ Player) SetVolume(value float64) { + objc.Call[objc.Void](p_, objc.Sel("setVolume:"), value) +} + +// An error that caused a failure. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387764-error?language=objc +func (p_ Player) Error() foundation.Error { + rv := objc.Call[foundation.Error](p_, objc.Sel("error")) + return rv +} + +// A Boolean value that indicates whether output is being obscured because of insufficient external protection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1624254-outputobscuredduetoinsufficiente?language=objc +func (p_ Player) OutputObscuredDueToInsufficientExternalProtection() bool { + rv := objc.Call[bool](p_, objc.Sel("outputObscuredDueToInsufficientExternalProtection")) + return rv +} + +// The registry identifier for the GPU used for video decoding. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/2942616-preferredvideodecodergpuregistry?language=objc +func (p_ Player) PreferredVideoDecoderGPURegistryID() uint64 { + rv := objc.Call[uint64](p_, objc.Sel("preferredVideoDecoderGPURegistryID")) + return rv +} + +// The registry identifier for the GPU used for video decoding. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/2942616-preferredvideodecodergpuregistry?language=objc +func (p_ Player) SetPreferredVideoDecoderGPURegistryID(value uint64) { + objc.Call[objc.Void](p_, objc.Sel("setPreferredVideoDecoderGPURegistryID:"), value) +} + +// The current playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1388846-rate?language=objc +func (p_ Player) Rate() float64 { + rv := objc.Call[float64](p_, objc.Sel("rate")) + return rv +} + +// The current playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1388846-rate?language=objc +func (p_ Player) SetRate(value float64) { + objc.Call[objc.Void](p_, objc.Sel("setRate:"), value) +} + +// A Boolean value that indicates whether the audio output of the player is muted. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387544-muted?language=objc +func (p_ Player) IsMuted() bool { + rv := objc.Call[bool](p_, objc.Sel("isMuted")) + return rv +} + +// A Boolean value that indicates whether the audio output of the player is muted. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387544-muted?language=objc +func (p_ Player) SetMuted(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setMuted:"), value) +} + +// The reason the player is currently waiting for playback to begin or resume. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1643486-reasonforwaitingtoplay?language=objc +func (p_ Player) ReasonForWaitingToPlay() PlayerWaitingReason { + rv := objc.Call[PlayerWaitingReason](p_, objc.Sel("reasonForWaitingToPlay")) + return rv +} + +// The playback coordinator for the player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/3750305-playbackcoordinator?language=objc +func (p_ Player) PlaybackCoordinator() PlayerPlaybackCoordinator { + rv := objc.Call[PlayerPlaybackCoordinator](p_, objc.Sel("playbackCoordinator")) + return rv +} + +// The item for which the player is currently controlling playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387569-currentitem?language=objc +func (p_ Player) CurrentItem() PlayerItem { + rv := objc.Call[PlayerItem](p_, objc.Sel("currentItem")) + return rv +} + +// Specifies the unique ID of the Core Audio output device used to play audio. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1390717-audiooutputdeviceuniqueid?language=objc +func (p_ Player) AudioOutputDeviceUniqueID() string { + rv := objc.Call[string](p_, objc.Sel("audioOutputDeviceUniqueID")) + return rv +} + +// Specifies the unique ID of the Core Audio output device used to play audio. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1390717-audiooutputdeviceuniqueid?language=objc +func (p_ Player) SetAudioOutputDeviceUniqueID(value string) { + objc.Call[objc.Void](p_, objc.Sel("setAudioOutputDeviceUniqueID:"), value) +} + +// A value that indicates whether playback is in progress, paused indefinitely, or waiting for network conditions to improve. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1643485-timecontrolstatus?language=objc +func (p_ Player) TimeControlStatus() PlayerTimeControlStatus { + rv := objc.Call[PlayerTimeControlStatus](p_, objc.Sel("timeControlStatus")) + return rv +} + +// A Boolean value that indicates whether the player is currently playing video in external playback mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1388982-externalplaybackactive?language=objc +func (p_ Player) IsExternalPlaybackActive() bool { + rv := objc.Call[bool](p_, objc.Sel("isExternalPlaybackActive")) + return rv +} + +// The action to perform when the current player item has finished playing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387376-actionatitemend?language=objc +func (p_ Player) ActionAtItemEnd() PlayerActionAtItemEnd { + rv := objc.Call[PlayerActionAtItemEnd](p_, objc.Sel("actionAtItemEnd")) + return rv +} + +// The action to perform when the current player item has finished playing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387376-actionatitemend?language=objc +func (p_ Player) SetActionAtItemEnd(value PlayerActionAtItemEnd) { + objc.Call[objc.Void](p_, objc.Sel("setActionAtItemEnd:"), value) +} + +// A Boolean value that indicates whether the player allows switching to external playback mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387441-allowsexternalplayback?language=objc +func (p_ Player) AllowsExternalPlayback() bool { + rv := objc.Call[bool](p_, objc.Sel("allowsExternalPlayback")) + return rv +} + +// A Boolean value that indicates whether the player allows switching to external playback mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387441-allowsexternalplayback?language=objc +func (p_ Player) SetAllowsExternalPlayback(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setAllowsExternalPlayback:"), value) +} + +// A Boolean value that indicates whether the current device can present content to an HDR display. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/3365978-eligibleforhdrplayback?language=objc +func (pc _PlayerClass) EligibleForHDRPlayback() bool { + rv := objc.Call[bool](pc, objc.Sel("eligibleForHDRPlayback")) + return rv +} + +// A Boolean value that indicates whether the current device can present content to an HDR display. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/3365978-eligibleforhdrplayback?language=objc +func Player_EligibleForHDRPlayback() bool { + return PlayerClass.EligibleForHDRPlayback() +} + +// A Boolean value that indicates whether the receiver should apply the current selection criteria automatically to player items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387178-appliesmediaselectioncriteriaaut?language=objc +func (p_ Player) AppliesMediaSelectionCriteriaAutomatically() bool { + rv := objc.Call[bool](p_, objc.Sel("appliesMediaSelectionCriteriaAutomatically")) + return rv +} + +// A Boolean value that indicates whether the receiver should apply the current selection criteria automatically to player items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387178-appliesmediaselectioncriteriaaut?language=objc +func (p_ Player) SetAppliesMediaSelectionCriteriaAutomatically(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setAppliesMediaSelectionCriteriaAutomatically:"), value) +} + +// A Boolean value that indicates whether video playback prevents display and device sleep. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/2990522-preventsdisplaysleepduringvideop?language=objc +func (p_ Player) PreventsDisplaySleepDuringVideoPlayback() bool { + rv := objc.Call[bool](p_, objc.Sel("preventsDisplaySleepDuringVideoPlayback")) + return rv +} + +// A Boolean value that indicates whether video playback prevents display and device sleep. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/2990522-preventsdisplaysleepduringvideop?language=objc +func (p_ Player) SetPreventsDisplaySleepDuringVideoPlayback(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setPreventsDisplaySleepDuringVideoPlayback:"), value) +} + +// A value that indicates the readiness of a player object for playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1388096-status?language=objc +func (p_ Player) Status() PlayerStatus { + rv := objc.Call[PlayerStatus](p_, objc.Sel("status")) + return rv +} + +// A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1643482-automaticallywaitstominimizestal?language=objc +func (p_ Player) AutomaticallyWaitsToMinimizeStalling() bool { + rv := objc.Call[bool](p_, objc.Sel("automaticallyWaitsToMinimizeStalling")) + return rv +} + +// A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1643482-automaticallywaitstominimizestal?language=objc +func (p_ Player) SetAutomaticallyWaitsToMinimizeStalling(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setAutomaticallyWaitsToMinimizeStalling:"), value) +} diff --git a/macos/avfoundation/player_interstitial_event.gen.go b/macos/avfoundation/player_interstitial_event.gen.go new file mode 100644 index 00000000..e22c1969 --- /dev/null +++ b/macos/avfoundation/player_interstitial_event.gen.go @@ -0,0 +1,141 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerInterstitialEvent] class. +var PlayerInterstitialEventClass = _PlayerInterstitialEventClass{objc.GetClass("AVPlayerInterstitialEvent")} + +type _PlayerInterstitialEventClass struct { + objc.Class +} + +// An interface definition for the [PlayerInterstitialEvent] class. +type IPlayerInterstitialEvent interface { + objc.IObject + Restrictions() PlayerInterstitialEventRestrictions + Date() foundation.Date + PrimaryItem() PlayerItem + TemplateItems() []PlayerItem + UserDefinedAttributes() foundation.Dictionary + Time() coremedia.Time + PlayoutLimit() coremedia.Time + ResumptionOffset() coremedia.Time + Identifier() string +} + +// An object that provides instructions for how a player presents interstitial content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent?language=objc +type PlayerInterstitialEvent struct { + objc.Object +} + +func PlayerInterstitialEventFrom(ptr unsafe.Pointer) PlayerInterstitialEvent { + return PlayerInterstitialEvent{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerInterstitialEventClass) Alloc() PlayerInterstitialEvent { + rv := objc.Call[PlayerInterstitialEvent](pc, objc.Sel("alloc")) + return rv +} + +func PlayerInterstitialEvent_Alloc() PlayerInterstitialEvent { + return PlayerInterstitialEventClass.Alloc() +} + +func (pc _PlayerInterstitialEventClass) New() PlayerInterstitialEvent { + rv := objc.Call[PlayerInterstitialEvent](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerInterstitialEvent() PlayerInterstitialEvent { + return PlayerInterstitialEventClass.New() +} + +func (p_ PlayerInterstitialEvent) Init() PlayerInterstitialEvent { + rv := objc.Call[PlayerInterstitialEvent](p_, objc.Sel("init")) + return rv +} + +// The restrictions the event imposes on the playback of interstitial content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3726119-restrictions?language=objc +func (p_ PlayerInterstitialEvent) Restrictions() PlayerInterstitialEventRestrictions { + rv := objc.Call[PlayerInterstitialEventRestrictions](p_, objc.Sel("restrictions")) + return rv +} + +// A date within the date range of the primary content that playback of interstitial content begins. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3726112-date?language=objc +func (p_ PlayerInterstitialEvent) Date() foundation.Date { + rv := objc.Call[foundation.Date](p_, objc.Sel("date")) + return rv +} + +// The player item that represents the primary content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3726118-primaryitem?language=objc +func (p_ PlayerInterstitialEvent) PrimaryItem() PlayerItem { + rv := objc.Call[PlayerItem](p_, objc.Sel("primaryItem")) + return rv +} + +// An array of player item configurations to use as templates for player items that play interstitial content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3726121-templateitems?language=objc +func (p_ PlayerInterstitialEvent) TemplateItems() []PlayerItem { + rv := objc.Call[[]PlayerItem](p_, objc.Sel("templateItems")) + return rv +} + +// Attributes of the event that the vendor or app defines. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3820994-userdefinedattributes?language=objc +func (p_ PlayerInterstitialEvent) UserDefinedAttributes() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](p_, objc.Sel("userDefinedAttributes")) + return rv +} + +// A time within the timeline of the primary content that playback of interstitial content begins. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3726122-time?language=objc +func (p_ PlayerInterstitialEvent) Time() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("time")) + return rv +} + +// The time offset at which playback of the interstitial ends. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3746588-playoutlimit?language=objc +func (p_ PlayerInterstitialEvent) PlayoutLimit() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("playoutLimit")) + return rv +} + +// A time offset at which playback of primary content resumes after interstitial content finishes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3726120-resumptionoffset?language=objc +func (p_ PlayerInterstitialEvent) ResumptionOffset() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("resumptionOffset")) + return rv +} + +// An identifier for the event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialevent/3746585-identifier?language=objc +func (p_ PlayerInterstitialEvent) Identifier() string { + rv := objc.Call[string](p_, objc.Sel("identifier")) + return rv +} diff --git a/macos/avfoundation/player_interstitial_event_controller.gen.go b/macos/avfoundation/player_interstitial_event_controller.gen.go new file mode 100644 index 00000000..8368c628 --- /dev/null +++ b/macos/avfoundation/player_interstitial_event_controller.gen.go @@ -0,0 +1,113 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerInterstitialEventController] class. +var PlayerInterstitialEventControllerClass = _PlayerInterstitialEventControllerClass{objc.GetClass("AVPlayerInterstitialEventController")} + +type _PlayerInterstitialEventControllerClass struct { + objc.Class +} + +// An interface definition for the [PlayerInterstitialEventController] class. +type IPlayerInterstitialEventController interface { + IPlayerInterstitialEventMonitor + CancelCurrentEventWithResumptionOffset(resumptionOffset coremedia.Time) + SetEvents(value []IPlayerInterstitialEvent) +} + +// An object that schedules interstitial events for items played by the primary player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventcontroller?language=objc +type PlayerInterstitialEventController struct { + PlayerInterstitialEventMonitor +} + +func PlayerInterstitialEventControllerFrom(ptr unsafe.Pointer) PlayerInterstitialEventController { + return PlayerInterstitialEventController{ + PlayerInterstitialEventMonitor: PlayerInterstitialEventMonitorFrom(ptr), + } +} + +func (p_ PlayerInterstitialEventController) InitWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventController { + rv := objc.Call[PlayerInterstitialEventController](p_, objc.Sel("initWithPrimaryPlayer:"), objc.Ptr(primaryPlayer)) + return rv +} + +// Creates an event controller with a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventcontroller/3726126-initwithprimaryplayer?language=objc +func NewPlayerInterstitialEventControllerWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventController { + instance := PlayerInterstitialEventControllerClass.Alloc().InitWithPrimaryPlayer(primaryPlayer) + instance.Autorelease() + return instance +} + +func (pc _PlayerInterstitialEventControllerClass) InterstitialEventControllerWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventController { + rv := objc.Call[PlayerInterstitialEventController](pc, objc.Sel("interstitialEventControllerWithPrimaryPlayer:"), objc.Ptr(primaryPlayer)) + return rv +} + +// A convenience initializer that creates an event controller with a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventcontroller/3726127-interstitialeventcontrollerwithp?language=objc +func PlayerInterstitialEventController_InterstitialEventControllerWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventController { + return PlayerInterstitialEventControllerClass.InterstitialEventControllerWithPrimaryPlayer(primaryPlayer) +} + +func (pc _PlayerInterstitialEventControllerClass) Alloc() PlayerInterstitialEventController { + rv := objc.Call[PlayerInterstitialEventController](pc, objc.Sel("alloc")) + return rv +} + +func PlayerInterstitialEventController_Alloc() PlayerInterstitialEventController { + return PlayerInterstitialEventControllerClass.Alloc() +} + +func (pc _PlayerInterstitialEventControllerClass) New() PlayerInterstitialEventController { + rv := objc.Call[PlayerInterstitialEventController](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerInterstitialEventController() PlayerInterstitialEventController { + return PlayerInterstitialEventControllerClass.New() +} + +func (p_ PlayerInterstitialEventController) Init() PlayerInterstitialEventController { + rv := objc.Call[PlayerInterstitialEventController](p_, objc.Sel("init")) + return rv +} + +func (pc _PlayerInterstitialEventControllerClass) InterstitialEventMonitorWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventController { + rv := objc.Call[PlayerInterstitialEventController](pc, objc.Sel("interstitialEventMonitorWithPrimaryPlayer:"), objc.Ptr(primaryPlayer)) + return rv +} + +// A convenience initializer that creates an observer with a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor/3800566-interstitialeventmonitorwithprim?language=objc +func PlayerInterstitialEventController_InterstitialEventMonitorWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventController { + return PlayerInterstitialEventControllerClass.InterstitialEventMonitorWithPrimaryPlayer(primaryPlayer) +} + +// Cancels the playback of all currently playing and scheduled interstitial events, and resumes playback of primary content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventcontroller/3726124-cancelcurrenteventwithresumption?language=objc +func (p_ PlayerInterstitialEventController) CancelCurrentEventWithResumptionOffset(resumptionOffset coremedia.Time) { + objc.Call[objc.Void](p_, objc.Sel("cancelCurrentEventWithResumptionOffset:"), resumptionOffset) +} + +// The current schedule of interstitial events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventcontroller/3726125-events?language=objc +func (p_ PlayerInterstitialEventController) SetEvents(value []IPlayerInterstitialEvent) { + objc.Call[objc.Void](p_, objc.Sel("setEvents:"), value) +} diff --git a/macos/avfoundation/player_interstitial_event_monitor.gen.go b/macos/avfoundation/player_interstitial_event_monitor.gen.go new file mode 100644 index 00000000..e6e409b4 --- /dev/null +++ b/macos/avfoundation/player_interstitial_event_monitor.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerInterstitialEventMonitor] class. +var PlayerInterstitialEventMonitorClass = _PlayerInterstitialEventMonitorClass{objc.GetClass("AVPlayerInterstitialEventMonitor")} + +type _PlayerInterstitialEventMonitorClass struct { + objc.Class +} + +// An interface definition for the [PlayerInterstitialEventMonitor] class. +type IPlayerInterstitialEventMonitor interface { + objc.IObject + CurrentEvent() PlayerInterstitialEvent + Events() []PlayerInterstitialEvent + PrimaryPlayer() Player + InterstitialPlayer() QueuePlayer +} + +// An object that monitors the scheduling and progress of interstitial events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor?language=objc +type PlayerInterstitialEventMonitor struct { + objc.Object +} + +func PlayerInterstitialEventMonitorFrom(ptr unsafe.Pointer) PlayerInterstitialEventMonitor { + return PlayerInterstitialEventMonitor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (p_ PlayerInterstitialEventMonitor) InitWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventMonitor { + rv := objc.Call[PlayerInterstitialEventMonitor](p_, objc.Sel("initWithPrimaryPlayer:"), objc.Ptr(primaryPlayer)) + return rv +} + +// Creates an observer with a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor/3800565-initwithprimaryplayer?language=objc +func NewPlayerInterstitialEventMonitorWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventMonitor { + instance := PlayerInterstitialEventMonitorClass.Alloc().InitWithPrimaryPlayer(primaryPlayer) + instance.Autorelease() + return instance +} + +func (pc _PlayerInterstitialEventMonitorClass) InterstitialEventMonitorWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventMonitor { + rv := objc.Call[PlayerInterstitialEventMonitor](pc, objc.Sel("interstitialEventMonitorWithPrimaryPlayer:"), objc.Ptr(primaryPlayer)) + return rv +} + +// A convenience initializer that creates an observer with a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor/3800566-interstitialeventmonitorwithprim?language=objc +func PlayerInterstitialEventMonitor_InterstitialEventMonitorWithPrimaryPlayer(primaryPlayer IPlayer) PlayerInterstitialEventMonitor { + return PlayerInterstitialEventMonitorClass.InterstitialEventMonitorWithPrimaryPlayer(primaryPlayer) +} + +func (pc _PlayerInterstitialEventMonitorClass) Alloc() PlayerInterstitialEventMonitor { + rv := objc.Call[PlayerInterstitialEventMonitor](pc, objc.Sel("alloc")) + return rv +} + +func PlayerInterstitialEventMonitor_Alloc() PlayerInterstitialEventMonitor { + return PlayerInterstitialEventMonitorClass.Alloc() +} + +func (pc _PlayerInterstitialEventMonitorClass) New() PlayerInterstitialEventMonitor { + rv := objc.Call[PlayerInterstitialEventMonitor](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerInterstitialEventMonitor() PlayerInterstitialEventMonitor { + return PlayerInterstitialEventMonitorClass.New() +} + +func (p_ PlayerInterstitialEventMonitor) Init() PlayerInterstitialEventMonitor { + rv := objc.Call[PlayerInterstitialEventMonitor](p_, objc.Sel("init")) + return rv +} + +// The current interstitial event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor/3800563-currentevent?language=objc +func (p_ PlayerInterstitialEventMonitor) CurrentEvent() PlayerInterstitialEvent { + rv := objc.Call[PlayerInterstitialEvent](p_, objc.Sel("currentEvent")) + return rv +} + +// The schedule of interstitial events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor/3800564-events?language=objc +func (p_ PlayerInterstitialEventMonitor) Events() []PlayerInterstitialEvent { + rv := objc.Call[[]PlayerInterstitialEvent](p_, objc.Sel("events")) + return rv +} + +// An object that plays primary content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor/3800568-primaryplayer?language=objc +func (p_ PlayerInterstitialEventMonitor) PrimaryPlayer() Player { + rv := objc.Call[Player](p_, objc.Sel("primaryPlayer")) + return rv +} + +// An object that plays interstitial content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerinterstitialeventmonitor/3800567-interstitialplayer?language=objc +func (p_ PlayerInterstitialEventMonitor) InterstitialPlayer() QueuePlayer { + rv := objc.Call[QueuePlayer](p_, objc.Sel("interstitialPlayer")) + return rv +} diff --git a/macos/avfoundation/player_item.gen.go b/macos/avfoundation/player_item.gen.go new file mode 100644 index 00000000..a59ace07 --- /dev/null +++ b/macos/avfoundation/player_item.gen.go @@ -0,0 +1,875 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItem] class. +var PlayerItemClass = _PlayerItemClass{objc.GetClass("AVPlayerItem")} + +type _PlayerItemClass struct { + objc.Class +} + +// An interface definition for the [PlayerItem] class. +type IPlayerItem interface { + objc.IObject + SelectMediaOptionAutomaticallyInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) + ErrorLog() PlayerItemErrorLog + CancelPendingSeeks() + Copy() objc.Object + RemoveMediaDataCollector(collector IPlayerItemMediaDataCollector) + CurrentDate() foundation.Date + AddOutput(output IPlayerItemOutput) + AddMediaDataCollector(collector IPlayerItemMediaDataCollector) + CancelContentAuthorizationRequest() + StepByCount(stepCount int) + RemoveOutput(output IPlayerItemOutput) + RequestContentAuthorizationAsynchronouslyWithTimeoutIntervalCompletionHandler(timeoutInterval foundation.TimeInterval, handler func()) + SelectMediaOptionInMediaSelectionGroup(mediaSelectionOption IMediaSelectionOption, mediaSelectionGroup IMediaSelectionGroup) + CopyWithZone(zone unsafe.Pointer) objc.Object + AccessLog() PlayerItemAccessLog + CurrentTime() coremedia.Time + AllowedAudioSpatializationFormats() AudioSpatializationFormats + SetAllowedAudioSpatializationFormats(value AudioSpatializationFormats) + CanPlayFastReverse() bool + CanStepForward() bool + Error() foundation.Error + Tracks() []PlayerItemTrack + CanPlaySlowReverse() bool + IsPlaybackBufferEmpty() bool + VideoComposition() VideoComposition + SetVideoComposition(value IVideoComposition) + IsAuthorizationRequiredForPlayback() bool + CanPlayReverse() bool + IsPlaybackLikelyToKeepUp() bool + AudioTimePitchAlgorithm() AudioTimePitchAlgorithm + SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) + ForwardPlaybackEndTime() coremedia.Time + SetForwardPlaybackEndTime(value coremedia.Time) + TextStyleRules() []TextStyleRule + SetTextStyleRules(value []ITextStyleRule) + PreferredPeakBitRateForExpensiveNetworks() float64 + SetPreferredPeakBitRateForExpensiveNetworks(value float64) + PreferredPeakBitRate() float64 + SetPreferredPeakBitRate(value float64) + VideoApertureMode() VideoApertureMode + SetVideoApertureMode(value VideoApertureMode) + TemplatePlayerItem() PlayerItem + ReversePlaybackEndTime() coremedia.Time + SetReversePlaybackEndTime(value coremedia.Time) + Outputs() []PlayerItemOutput + Timebase() coremedia.TimebaseRef + RecommendedTimeOffsetFromLive() coremedia.Time + CanUseNetworkResourcesForLiveStreamingWhilePaused() bool + SetCanUseNetworkResourcesForLiveStreamingWhilePaused(value bool) + CanStepBackward() bool + ContentAuthorizationRequestStatus() ContentAuthorizationStatus + CustomVideoCompositor() VideoCompositingWrapper + PresentationSize() coregraphics.Size + ConfiguredTimeOffsetFromLive() coremedia.Time + SetConfiguredTimeOffsetFromLive(value coremedia.Time) + SeekingWaitsForVideoCompositionRendering() bool + SetSeekingWaitsForVideoCompositionRendering(value bool) + LoadedTimeRanges() []foundation.Value + AppliesPerFrameHDRDisplayMetadata() bool + SetAppliesPerFrameHDRDisplayMetadata(value bool) + CurrentMediaSelection() MediaSelection + AutomaticallyHandlesInterstitialEvents() bool + SetAutomaticallyHandlesInterstitialEvents(value bool) + AutomaticallyPreservesTimeOffsetFromLive() bool + SetAutomaticallyPreservesTimeOffsetFromLive(value bool) + IsApplicationAuthorizedForPlayback() bool + PreferredMaximumResolutionForExpensiveNetworks() coregraphics.Size + SetPreferredMaximumResolutionForExpensiveNetworks(value coregraphics.Size) + IsPlaybackBufferFull() bool + IsContentAuthorizedForPlayback() bool + AudioMix() AudioMix + SetAudioMix(value IAudioMix) + SeekableTimeRanges() []foundation.Value + PreferredMaximumResolution() coregraphics.Size + SetPreferredMaximumResolution(value coregraphics.Size) + VariantPreferences() VariantPreferences + SetVariantPreferences(value VariantPreferences) + CanPlaySlowForward() bool + AutomaticallyLoadedAssetKeys() []string + Duration() coremedia.Time + PreferredForwardBufferDuration() foundation.TimeInterval + SetPreferredForwardBufferDuration(value foundation.TimeInterval) + Status() PlayerItemStatus + MediaDataCollectors() []PlayerItemMediaDataCollector + StartsOnFirstEligibleVariant() bool + SetStartsOnFirstEligibleVariant(value bool) + Asset() Asset + CanPlayFastForward() bool +} + +// An object that models the timing and presentation state of an asset during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem?language=objc +type PlayerItem struct { + objc.Object +} + +func PlayerItemFrom(ptr unsafe.Pointer) PlayerItem { + return PlayerItem{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemClass) PlayerItemWithAsset(asset IAsset) PlayerItem { + rv := objc.Call[PlayerItem](pc, objc.Sel("playerItemWithAsset:"), objc.Ptr(asset)) + return rv +} + +// Returns a new player item for a specified asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1588087-playeritemwithasset?language=objc +func PlayerItem_PlayerItemWithAsset(asset IAsset) PlayerItem { + return PlayerItemClass.PlayerItemWithAsset(asset) +} + +func (p_ PlayerItem) InitWithURL(URL foundation.IURL) PlayerItem { + rv := objc.Call[PlayerItem](p_, objc.Sel("initWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates a player item with a specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1387558-initwithurl?language=objc +func NewPlayerItemWithURL(URL foundation.IURL) PlayerItem { + instance := PlayerItemClass.Alloc().InitWithURL(URL) + instance.Autorelease() + return instance +} + +func (pc _PlayerItemClass) PlayerItemWithURL(URL foundation.IURL) PlayerItem { + rv := objc.Call[PlayerItem](pc, objc.Sel("playerItemWithURL:"), objc.Ptr(URL)) + return rv +} + +// Returns a new player item with a specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1588089-playeritemwithurl?language=objc +func PlayerItem_PlayerItemWithURL(URL foundation.IURL) PlayerItem { + return PlayerItemClass.PlayerItemWithURL(URL) +} + +func (p_ PlayerItem) InitWithAsset(asset IAsset) PlayerItem { + rv := objc.Call[PlayerItem](p_, objc.Sel("initWithAsset:"), objc.Ptr(asset)) + return rv +} + +// Creates a player item for a specified asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1390707-initwithasset?language=objc +func NewPlayerItemWithAsset(asset IAsset) PlayerItem { + instance := PlayerItemClass.Alloc().InitWithAsset(asset) + instance.Autorelease() + return instance +} + +func (pc _PlayerItemClass) Alloc() PlayerItem { + rv := objc.Call[PlayerItem](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItem_Alloc() PlayerItem { + return PlayerItemClass.Alloc() +} + +func (pc _PlayerItemClass) New() PlayerItem { + rv := objc.Call[PlayerItem](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItem() PlayerItem { + return PlayerItemClass.New() +} + +func (p_ PlayerItem) Init() PlayerItem { + rv := objc.Call[PlayerItem](p_, objc.Sel("init")) + return rv +} + +// Selects the media option in the specified media selection group that best matches the receiver’s automatic selection criteria. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388268-selectmediaoptionautomaticallyin?language=objc +func (p_ PlayerItem) SelectMediaOptionAutomaticallyInMediaSelectionGroup(mediaSelectionGroup IMediaSelectionGroup) { + objc.Call[objc.Void](p_, objc.Sel("selectMediaOptionAutomaticallyInMediaSelectionGroup:"), objc.Ptr(mediaSelectionGroup)) +} + +// Returns an object that represents a snapshot of the error log. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1387573-errorlog?language=objc +func (p_ PlayerItem) ErrorLog() PlayerItemErrorLog { + rv := objc.Call[PlayerItemErrorLog](p_, objc.Sel("errorLog")) + return rv +} + +// Cancels any pending seek requests and invokes the corresponding completion handlers if present. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388316-cancelpendingseeks?language=objc +func (p_ PlayerItem) CancelPendingSeeks() { + objc.Call[objc.Void](p_, objc.Sel("cancelPendingSeeks")) +} + +// Creates a copy of the object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3861797-copy?language=objc +func (p_ PlayerItem) Copy() objc.Object { + rv := objc.Call[objc.Object](p_, objc.Sel("copy")) + rv.Autorelease() + return rv +} + +// Removes the specified media data collector from the player item’s collection of media collectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1624163-removemediadatacollector?language=objc +func (p_ PlayerItem) RemoveMediaDataCollector(collector IPlayerItemMediaDataCollector) { + objc.Call[objc.Void](p_, objc.Sel("removeMediaDataCollector:"), objc.Ptr(collector)) +} + +// Returns the current time of the item as a date. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1386188-currentdate?language=objc +func (p_ PlayerItem) CurrentDate() foundation.Date { + rv := objc.Call[foundation.Date](p_, objc.Sel("currentDate")) + return rv +} + +// Adds the specified player item output object to the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389782-addoutput?language=objc +func (p_ PlayerItem) AddOutput(output IPlayerItemOutput) { + objc.Call[objc.Void](p_, objc.Sel("addOutput:"), objc.Ptr(output)) +} + +// Adds the specified media data collector to the player item’s collection of media collectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1624164-addmediadatacollector?language=objc +func (p_ PlayerItem) AddMediaDataCollector(collector IPlayerItemMediaDataCollector) { + objc.Call[objc.Void](p_, objc.Sel("addMediaDataCollector:"), objc.Ptr(collector)) +} + +// Cancels the currently outstanding content authorization request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1387726-cancelcontentauthorizationreques?language=objc +func (p_ PlayerItem) CancelContentAuthorizationRequest() { + objc.Call[objc.Void](p_, objc.Sel("cancelContentAuthorizationRequest")) +} + +// Moves the player item’s current time forward or backward by a specified number of steps. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1387968-stepbycount?language=objc +func (p_ PlayerItem) StepByCount(stepCount int) { + objc.Call[objc.Void](p_, objc.Sel("stepByCount:"), stepCount) +} + +// Removes the specified player item output object from the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388756-removeoutput?language=objc +func (p_ PlayerItem) RemoveOutput(output IPlayerItemOutput) { + objc.Call[objc.Void](p_, objc.Sel("removeOutput:"), objc.Ptr(output)) +} + +// Presents the user the opportunity to authorize the content for playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1390600-requestcontentauthorizationasync?language=objc +func (p_ PlayerItem) RequestContentAuthorizationAsynchronouslyWithTimeoutIntervalCompletionHandler(timeoutInterval foundation.TimeInterval, handler func()) { + objc.Call[objc.Void](p_, objc.Sel("requestContentAuthorizationAsynchronouslyWithTimeoutInterval:completionHandler:"), timeoutInterval, handler) +} + +// Selects a media option in a given media selection group and deselects all other options in that group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389610-selectmediaoption?language=objc +func (p_ PlayerItem) SelectMediaOptionInMediaSelectionGroup(mediaSelectionOption IMediaSelectionOption, mediaSelectionGroup IMediaSelectionGroup) { + objc.Call[objc.Void](p_, objc.Sel("selectMediaOption:inMediaSelectionGroup:"), objc.Ptr(mediaSelectionOption), objc.Ptr(mediaSelectionGroup)) +} + +// Creates a copy of the object with the specified zone. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3861798-copywithzone?language=objc +func (p_ PlayerItem) CopyWithZone(zone unsafe.Pointer) objc.Object { + rv := objc.Call[objc.Object](p_, objc.Sel("copyWithZone:"), zone) + return rv +} + +// Returns an object that represents a snapshot of the network access log. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388499-accesslog?language=objc +func (p_ PlayerItem) AccessLog() PlayerItemAccessLog { + rv := objc.Call[PlayerItemAccessLog](p_, objc.Sel("accessLog")) + return rv +} + +// Returns the current time of the item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1387230-currenttime?language=objc +func (p_ PlayerItem) CurrentTime() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("currentTime")) + return rv +} + +// The source audio channel layouts the player item supports for spatialization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3601108-allowedaudiospatializationformat?language=objc +func (p_ PlayerItem) AllowedAudioSpatializationFormats() AudioSpatializationFormats { + rv := objc.Call[AudioSpatializationFormats](p_, objc.Sel("allowedAudioSpatializationFormats")) + return rv +} + +// The source audio channel layouts the player item supports for spatialization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3601108-allowedaudiospatializationformat?language=objc +func (p_ PlayerItem) SetAllowedAudioSpatializationFormats(value AudioSpatializationFormats) { + objc.Call[objc.Void](p_, objc.Sel("setAllowedAudioSpatializationFormats:"), value) +} + +// A Boolean value that indicates whether the item can be quickly reversed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1390493-canplayfastreverse?language=objc +func (p_ PlayerItem) CanPlayFastReverse() bool { + rv := objc.Call[bool](p_, objc.Sel("canPlayFastReverse")) + return rv +} + +// A Boolean value that indicates whether the item supports stepping forward. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389656-canstepforward?language=objc +func (p_ PlayerItem) CanStepForward() bool { + rv := objc.Call[bool](p_, objc.Sel("canStepForward")) + return rv +} + +// The error that caused the player item to fail. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389185-error?language=objc +func (p_ PlayerItem) Error() foundation.Error { + rv := objc.Call[foundation.Error](p_, objc.Sel("error")) + return rv +} + +// An array of player item track objects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1386361-tracks?language=objc +func (p_ PlayerItem) Tracks() []PlayerItemTrack { + rv := objc.Call[[]PlayerItemTrack](p_, objc.Sel("tracks")) + return rv +} + +// A Boolean value that indicates whether the item can play slowly backward. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1390598-canplayslowreverse?language=objc +func (p_ PlayerItem) CanPlaySlowReverse() bool { + rv := objc.Call[bool](p_, objc.Sel("canPlaySlowReverse")) + return rv +} + +// A Boolean value that indicates whether playback has consumed all buffered media and that playback will stall or end. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1386960-playbackbufferempty?language=objc +func (p_ PlayerItem) IsPlaybackBufferEmpty() bool { + rv := objc.Call[bool](p_, objc.Sel("isPlaybackBufferEmpty")) + return rv +} + +// The video composition settings to be applied during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388818-videocomposition?language=objc +func (p_ PlayerItem) VideoComposition() VideoComposition { + rv := objc.Call[VideoComposition](p_, objc.Sel("videoComposition")) + return rv +} + +// The video composition settings to be applied during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388818-videocomposition?language=objc +func (p_ PlayerItem) SetVideoComposition(value IVideoComposition) { + objc.Call[objc.Void](p_, objc.Sel("setVideoComposition:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether authorization is required to play the content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1386106-authorizationrequiredforplayback?language=objc +func (p_ PlayerItem) IsAuthorizationRequiredForPlayback() bool { + rv := objc.Call[bool](p_, objc.Sel("isAuthorizationRequiredForPlayback")) + return rv +} + +// A Boolean value that indicates whether the item can play in reverse. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1385591-canplayreverse?language=objc +func (p_ PlayerItem) CanPlayReverse() bool { + rv := objc.Call[bool](p_, objc.Sel("canPlayReverse")) + return rv +} + +// A Boolean value that indicates whether the item will likely play through without stalling. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1390348-playbacklikelytokeepup?language=objc +func (p_ PlayerItem) IsPlaybackLikelyToKeepUp() bool { + rv := objc.Call[bool](p_, objc.Sel("isPlaybackLikelyToKeepUp")) + return rv +} + +// The processing algorithm used to manage audio pitch for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1385855-audiotimepitchalgorithm?language=objc +func (p_ PlayerItem) AudioTimePitchAlgorithm() AudioTimePitchAlgorithm { + rv := objc.Call[AudioTimePitchAlgorithm](p_, objc.Sel("audioTimePitchAlgorithm")) + return rv +} + +// The processing algorithm used to manage audio pitch for scaled audio edits. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1385855-audiotimepitchalgorithm?language=objc +func (p_ PlayerItem) SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) { + objc.Call[objc.Void](p_, objc.Sel("setAudioTimePitchAlgorithm:"), value) +} + +// The time at which forward playback ends. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1385622-forwardplaybackendtime?language=objc +func (p_ PlayerItem) ForwardPlaybackEndTime() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("forwardPlaybackEndTime")) + return rv +} + +// The time at which forward playback ends. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1385622-forwardplaybackendtime?language=objc +func (p_ PlayerItem) SetForwardPlaybackEndTime(value coremedia.Time) { + objc.Call[objc.Void](p_, objc.Sel("setForwardPlaybackEndTime:"), value) +} + +// An array of text style rules that specify the formatting and presentation of Web Video Text Tracks (WebVTT) subtitles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389681-textstylerules?language=objc +func (p_ PlayerItem) TextStyleRules() []TextStyleRule { + rv := objc.Call[[]TextStyleRule](p_, objc.Sel("textStyleRules")) + return rv +} + +// An array of text style rules that specify the formatting and presentation of Web Video Text Tracks (WebVTT) subtitles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389681-textstylerules?language=objc +func (p_ PlayerItem) SetTextStyleRules(value []ITextStyleRule) { + objc.Call[objc.Void](p_, objc.Sel("setTextStyleRules:"), value) +} + +// A limit of network bandwidth consumption by the item when connecting over expensive networks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3746589-preferredpeakbitrateforexpensive?language=objc +func (p_ PlayerItem) PreferredPeakBitRateForExpensiveNetworks() float64 { + rv := objc.Call[float64](p_, objc.Sel("preferredPeakBitRateForExpensiveNetworks")) + return rv +} + +// A limit of network bandwidth consumption by the item when connecting over expensive networks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3746589-preferredpeakbitrateforexpensive?language=objc +func (p_ PlayerItem) SetPreferredPeakBitRateForExpensiveNetworks(value float64) { + objc.Call[objc.Void](p_, objc.Sel("setPreferredPeakBitRateForExpensiveNetworks:"), value) +} + +// The desired limit, in bits per second, of network bandwidth consumption for this item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388541-preferredpeakbitrate?language=objc +func (p_ PlayerItem) PreferredPeakBitRate() float64 { + rv := objc.Call[float64](p_, objc.Sel("preferredPeakBitRate")) + return rv +} + +// The desired limit, in bits per second, of network bandwidth consumption for this item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388541-preferredpeakbitrate?language=objc +func (p_ PlayerItem) SetPreferredPeakBitRate(value float64) { + objc.Call[objc.Void](p_, objc.Sel("setPreferredPeakBitRate:"), value) +} + +// The video aperture mode to apply during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/2868499-videoaperturemode?language=objc +func (p_ PlayerItem) VideoApertureMode() VideoApertureMode { + rv := objc.Call[VideoApertureMode](p_, objc.Sel("videoApertureMode")) + return rv +} + +// The video aperture mode to apply during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/2868499-videoaperturemode?language=objc +func (p_ PlayerItem) SetVideoApertureMode(value VideoApertureMode) { + objc.Call[objc.Void](p_, objc.Sel("setVideoApertureMode:"), value) +} + +// The template player item that initializes this instance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3726147-templateplayeritem?language=objc +func (p_ PlayerItem) TemplatePlayerItem() PlayerItem { + rv := objc.Call[PlayerItem](p_, objc.Sel("templatePlayerItem")) + return rv +} + +// The time at which reverse playback ends. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388438-reverseplaybackendtime?language=objc +func (p_ PlayerItem) ReversePlaybackEndTime() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("reversePlaybackEndTime")) + return rv +} + +// The time at which reverse playback ends. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388438-reverseplaybackendtime?language=objc +func (p_ PlayerItem) SetReversePlaybackEndTime(value coremedia.Time) { + objc.Call[objc.Void](p_, objc.Sel("setReversePlaybackEndTime:"), value) +} + +// An array of outputs associated with the player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389090-outputs?language=objc +func (p_ PlayerItem) Outputs() []PlayerItemOutput { + rv := objc.Call[[]PlayerItemOutput](p_, objc.Sel("outputs")) + return rv +} + +// The timebase information for the item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1387605-timebase?language=objc +func (p_ PlayerItem) Timebase() coremedia.TimebaseRef { + rv := objc.Call[coremedia.TimebaseRef](p_, objc.Sel("timebase")) + return rv +} + +// A recommended time offset from the live time based on observed network conditions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3227883-recommendedtimeoffsetfromlive?language=objc +func (p_ PlayerItem) RecommendedTimeOffsetFromLive() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("recommendedTimeOffsetFromLive")) + return rv +} + +// A Boolean value that indicates whether the player item can use network resources to keep the playback state up to date while paused. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388752-canusenetworkresourcesforlivestr?language=objc +func (p_ PlayerItem) CanUseNetworkResourcesForLiveStreamingWhilePaused() bool { + rv := objc.Call[bool](p_, objc.Sel("canUseNetworkResourcesForLiveStreamingWhilePaused")) + return rv +} + +// A Boolean value that indicates whether the player item can use network resources to keep the playback state up to date while paused. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388752-canusenetworkresourcesforlivestr?language=objc +func (p_ PlayerItem) SetCanUseNetworkResourcesForLiveStreamingWhilePaused(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setCanUseNetworkResourcesForLiveStreamingWhilePaused:"), value) +} + +// A Boolean value that indicates whether the item supports stepping backward. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1386796-canstepbackward?language=objc +func (p_ PlayerItem) CanStepBackward() bool { + rv := objc.Call[bool](p_, objc.Sel("canStepBackward")) + return rv +} + +// The status of the most recent content authorization request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389746-contentauthorizationrequeststatu?language=objc +func (p_ PlayerItem) ContentAuthorizationRequestStatus() ContentAuthorizationStatus { + rv := objc.Call[ContentAuthorizationStatus](p_, objc.Sel("contentAuthorizationRequestStatus")) + return rv +} + +// The custom video compositor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1390669-customvideocompositor?language=objc +func (p_ PlayerItem) CustomVideoCompositor() VideoCompositingWrapper { + rv := objc.Call[VideoCompositingWrapper](p_, objc.Sel("customVideoCompositor")) + return rv +} + +// The size at which the visual portion of the item is presented by the player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388962-presentationsize?language=objc +func (p_ PlayerItem) PresentationSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](p_, objc.Sel("presentationSize")) + return rv +} + +// A time value that indicates the offset from the live time to start playback, or resume playback after a seek to positive infinity. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3227882-configuredtimeoffsetfromlive?language=objc +func (p_ PlayerItem) ConfiguredTimeOffsetFromLive() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("configuredTimeOffsetFromLive")) + return rv +} + +// A time value that indicates the offset from the live time to start playback, or resume playback after a seek to positive infinity. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3227882-configuredtimeoffsetfromlive?language=objc +func (p_ PlayerItem) SetConfiguredTimeOffsetFromLive(value coremedia.Time) { + objc.Call[objc.Void](p_, objc.Sel("setConfiguredTimeOffsetFromLive:"), value) +} + +// A Boolean value that indicates whether the item’s timing follows the displayed video frame when seeking with a video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1385726-seekingwaitsforvideocompositionr?language=objc +func (p_ PlayerItem) SeekingWaitsForVideoCompositionRendering() bool { + rv := objc.Call[bool](p_, objc.Sel("seekingWaitsForVideoCompositionRendering")) + return rv +} + +// A Boolean value that indicates whether the item’s timing follows the displayed video frame when seeking with a video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1385726-seekingwaitsforvideocompositionr?language=objc +func (p_ PlayerItem) SetSeekingWaitsForVideoCompositionRendering(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setSeekingWaitsForVideoCompositionRendering:"), value) +} + +// An array of time ranges indicating media data that is readily available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389953-loadedtimeranges?language=objc +func (p_ PlayerItem) LoadedTimeRanges() []foundation.Value { + rv := objc.Call[[]foundation.Value](p_, objc.Sel("loadedTimeRanges")) + return rv +} + +// A Boolean value that indicates whether the player item applies per-frame HDR display metadata during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3656127-appliesperframehdrdisplaymetadat?language=objc +func (p_ PlayerItem) AppliesPerFrameHDRDisplayMetadata() bool { + rv := objc.Call[bool](p_, objc.Sel("appliesPerFrameHDRDisplayMetadata")) + return rv +} + +// A Boolean value that indicates whether the player item applies per-frame HDR display metadata during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3656127-appliesperframehdrdisplaymetadat?language=objc +func (p_ PlayerItem) SetAppliesPerFrameHDRDisplayMetadata(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setAppliesPerFrameHDRDisplayMetadata:"), value) +} + +// The current media selections for each of the receiver's media selection groups. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1386519-currentmediaselection?language=objc +func (p_ PlayerItem) CurrentMediaSelection() MediaSelection { + rv := objc.Call[MediaSelection](p_, objc.Sel("currentMediaSelection")) + return rv +} + +// A Boolean value that indicates whether the player item automatically plays interstitial events according to server-side directives. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3726146-automaticallyhandlesinterstitial?language=objc +func (p_ PlayerItem) AutomaticallyHandlesInterstitialEvents() bool { + rv := objc.Call[bool](p_, objc.Sel("automaticallyHandlesInterstitialEvents")) + return rv +} + +// A Boolean value that indicates whether the player item automatically plays interstitial events according to server-side directives. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3726146-automaticallyhandlesinterstitial?language=objc +func (p_ PlayerItem) SetAutomaticallyHandlesInterstitialEvents(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setAutomaticallyHandlesInterstitialEvents:"), value) +} + +// A Boolean value that indicates whether the player preserves its time offset from the live time after a buffering operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3229855-automaticallypreservestimeoffset?language=objc +func (p_ PlayerItem) AutomaticallyPreservesTimeOffsetFromLive() bool { + rv := objc.Call[bool](p_, objc.Sel("automaticallyPreservesTimeOffsetFromLive")) + return rv +} + +// A Boolean value that indicates whether the player preserves its time offset from the live time after a buffering operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3229855-automaticallypreservestimeoffset?language=objc +func (p_ PlayerItem) SetAutomaticallyPreservesTimeOffsetFromLive(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setAutomaticallyPreservesTimeOffsetFromLive:"), value) +} + +// A Boolean value that indicates whether the application can be used to play the content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389929-applicationauthorizedforplayback?language=objc +func (p_ PlayerItem) IsApplicationAuthorizedForPlayback() bool { + rv := objc.Call[bool](p_, objc.Sel("isApplicationAuthorizedForPlayback")) + return rv +} + +// An upper limit on the resolution of video to download when connecting over expensive networks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3750308-preferredmaximumresolutionforexp?language=objc +func (p_ PlayerItem) PreferredMaximumResolutionForExpensiveNetworks() coregraphics.Size { + rv := objc.Call[coregraphics.Size](p_, objc.Sel("preferredMaximumResolutionForExpensiveNetworks")) + return rv +} + +// An upper limit on the resolution of video to download when connecting over expensive networks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3750308-preferredmaximumresolutionforexp?language=objc +func (p_ PlayerItem) SetPreferredMaximumResolutionForExpensiveNetworks(value coregraphics.Size) { + objc.Call[objc.Void](p_, objc.Sel("setPreferredMaximumResolutionForExpensiveNetworks:"), value) +} + +// A Boolean value that indicates whether the internal media buffer is full and that further I/O is suspended. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388852-playbackbufferfull?language=objc +func (p_ PlayerItem) IsPlaybackBufferFull() bool { + rv := objc.Call[bool](p_, objc.Sel("isPlaybackBufferFull")) + return rv +} + +// A Boolean value that indicates whether the content has been authorized by the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388458-contentauthorizedforplayback?language=objc +func (p_ PlayerItem) IsContentAuthorizedForPlayback() bool { + rv := objc.Call[bool](p_, objc.Sel("isContentAuthorizedForPlayback")) + return rv +} + +// The audio mix parameters to be applied during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388037-audiomix?language=objc +func (p_ PlayerItem) AudioMix() AudioMix { + rv := objc.Call[AudioMix](p_, objc.Sel("audioMix")) + return rv +} + +// The audio mix parameters to be applied during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388037-audiomix?language=objc +func (p_ PlayerItem) SetAudioMix(value IAudioMix) { + objc.Call[objc.Void](p_, objc.Sel("setAudioMix:"), objc.Ptr(value)) +} + +// An array of time ranges within which it is possible to seek. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1386155-seekabletimeranges?language=objc +func (p_ PlayerItem) SeekableTimeRanges() []foundation.Value { + rv := objc.Call[[]foundation.Value](p_, objc.Sel("seekableTimeRanges")) + return rv +} + +// The desired maximum resolution of a video that is to be downloaded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/2867324-preferredmaximumresolution?language=objc +func (p_ PlayerItem) PreferredMaximumResolution() coregraphics.Size { + rv := objc.Call[coregraphics.Size](p_, objc.Sel("preferredMaximumResolution")) + return rv +} + +// The desired maximum resolution of a video that is to be downloaded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/2867324-preferredmaximumresolution?language=objc +func (p_ PlayerItem) SetPreferredMaximumResolution(value coregraphics.Size) { + objc.Call[objc.Void](p_, objc.Sel("setPreferredMaximumResolution:"), value) +} + +// The preferences the player item uses when selecting variant playlists. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3726149-variantpreferences?language=objc +func (p_ PlayerItem) VariantPreferences() VariantPreferences { + rv := objc.Call[VariantPreferences](p_, objc.Sel("variantPreferences")) + return rv +} + +// The preferences the player item uses when selecting variant playlists. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3726149-variantpreferences?language=objc +func (p_ PlayerItem) SetVariantPreferences(value VariantPreferences) { + objc.Call[objc.Void](p_, objc.Sel("setVariantPreferences:"), value) +} + +// A Boolean value that indicates whether the item can play slower than normal. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388078-canplayslowforward?language=objc +func (p_ PlayerItem) CanPlaySlowForward() bool { + rv := objc.Call[bool](p_, objc.Sel("canPlaySlowForward")) + return rv +} + +// The array of asset keys to be automatically loaded before the player item is ready to play. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388633-automaticallyloadedassetkeys?language=objc +func (p_ PlayerItem) AutomaticallyLoadedAssetKeys() []string { + rv := objc.Call[[]string](p_, objc.Sel("automaticallyLoadedAssetKeys")) + return rv +} + +// The duration of the item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389386-duration?language=objc +func (p_ PlayerItem) Duration() coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("duration")) + return rv +} + +// The duration the player should buffer media from the network ahead of the playhead to guard against playback disruption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1643630-preferredforwardbufferduration?language=objc +func (p_ PlayerItem) PreferredForwardBufferDuration() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("preferredForwardBufferDuration")) + return rv +} + +// The duration the player should buffer media from the network ahead of the playhead to guard against playback disruption. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1643630-preferredforwardbufferduration?language=objc +func (p_ PlayerItem) SetPreferredForwardBufferDuration(value foundation.TimeInterval) { + objc.Call[objc.Void](p_, objc.Sel("setPreferredForwardBufferDuration:"), value) +} + +// The status of the player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389493-status?language=objc +func (p_ PlayerItem) Status() PlayerItemStatus { + rv := objc.Call[PlayerItemStatus](p_, objc.Sel("status")) + return rv +} + +// The collection of associated media data collectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1624161-mediadatacollectors?language=objc +func (p_ PlayerItem) MediaDataCollectors() []PlayerItemMediaDataCollector { + rv := objc.Call[[]PlayerItemMediaDataCollector](p_, objc.Sel("mediaDataCollectors")) + return rv +} + +// A Boolean value that indicates whether playback starts with the first eligible variant that appears in the stream’s main playlist. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3579514-startsonfirsteligiblevariant?language=objc +func (p_ PlayerItem) StartsOnFirstEligibleVariant() bool { + rv := objc.Call[bool](p_, objc.Sel("startsOnFirstEligibleVariant")) + return rv +} + +// A Boolean value that indicates whether playback starts with the first eligible variant that appears in the stream’s main playlist. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/3579514-startsonfirsteligiblevariant?language=objc +func (p_ PlayerItem) SetStartsOnFirstEligibleVariant(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setStartsOnFirstEligibleVariant:"), value) +} + +// The asset provided during initialization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1388177-asset?language=objc +func (p_ PlayerItem) Asset() Asset { + rv := objc.Call[Asset](p_, objc.Sel("asset")) + return rv +} + +// A Boolean value that indicates whether the item can be fast forwarded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritem/1389096-canplayfastforward?language=objc +func (p_ PlayerItem) CanPlayFastForward() bool { + rv := objc.Call[bool](p_, objc.Sel("canPlayFastForward")) + return rv +} diff --git a/macos/avfoundation/player_item_access_log.gen.go b/macos/avfoundation/player_item_access_log.gen.go new file mode 100644 index 00000000..6ceca01c --- /dev/null +++ b/macos/avfoundation/player_item_access_log.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemAccessLog] class. +var PlayerItemAccessLogClass = _PlayerItemAccessLogClass{objc.GetClass("AVPlayerItemAccessLog")} + +type _PlayerItemAccessLogClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemAccessLog] class. +type IPlayerItemAccessLog interface { + objc.IObject + ExtendedLogData() []byte + Events() []PlayerItemAccessLogEvent + ExtendedLogDataStringEncoding() foundation.StringEncoding +} + +// An object used to retrieve the access log associated with a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslog?language=objc +type PlayerItemAccessLog struct { + objc.Object +} + +func PlayerItemAccessLogFrom(ptr unsafe.Pointer) PlayerItemAccessLog { + return PlayerItemAccessLog{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemAccessLogClass) Alloc() PlayerItemAccessLog { + rv := objc.Call[PlayerItemAccessLog](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemAccessLog_Alloc() PlayerItemAccessLog { + return PlayerItemAccessLogClass.Alloc() +} + +func (pc _PlayerItemAccessLogClass) New() PlayerItemAccessLog { + rv := objc.Call[PlayerItemAccessLog](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemAccessLog() PlayerItemAccessLog { + return PlayerItemAccessLogClass.New() +} + +func (p_ PlayerItemAccessLog) Init() PlayerItemAccessLog { + rv := objc.Call[PlayerItemAccessLog](p_, objc.Sel("init")) + return rv +} + +// Returns a serialized representation of the access log in the Extended Log File Format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslog/1386892-extendedlogdata?language=objc +func (p_ PlayerItemAccessLog) ExtendedLogData() []byte { + rv := objc.Call[[]byte](p_, objc.Sel("extendedLogData")) + return rv +} + +// A chronologically ordered array of player item access log events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslog/1387406-events?language=objc +func (p_ PlayerItemAccessLog) Events() []PlayerItemAccessLogEvent { + rv := objc.Call[[]PlayerItemAccessLogEvent](p_, objc.Sel("events")) + return rv +} + +// The string encoding of the extended log data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslog/1390863-extendedlogdatastringencoding?language=objc +func (p_ PlayerItemAccessLog) ExtendedLogDataStringEncoding() foundation.StringEncoding { + rv := objc.Call[foundation.StringEncoding](p_, objc.Sel("extendedLogDataStringEncoding")) + return rv +} diff --git a/macos/avfoundation/player_item_access_log_event.gen.go b/macos/avfoundation/player_item_access_log_event.gen.go new file mode 100644 index 00000000..050652ab --- /dev/null +++ b/macos/avfoundation/player_item_access_log_event.gen.go @@ -0,0 +1,275 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemAccessLogEvent] class. +var PlayerItemAccessLogEventClass = _PlayerItemAccessLogEventClass{objc.GetClass("AVPlayerItemAccessLogEvent")} + +type _PlayerItemAccessLogEventClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemAccessLogEvent] class. +type IPlayerItemAccessLogEvent interface { + objc.IObject + AverageAudioBitrate() float64 + NumberOfMediaRequests() int + TransferDuration() foundation.TimeInterval + URI() string + NumberOfDroppedVideoFrames() int + NumberOfServerAddressChanges() int + ObservedBitrate() float64 + ServerAddress() string + AverageVideoBitrate() float64 + NumberOfBytesTransferred() int64 + PlaybackType() string + IndicatedBitrate() float64 + DownloadOverdue() int + IndicatedAverageBitrate() float64 + SwitchBitrate() float64 + PlaybackStartDate() foundation.Date + ObservedBitrateStandardDeviation() float64 + DurationWatched() foundation.TimeInterval + StartupTime() foundation.TimeInterval + PlaybackStartOffset() foundation.TimeInterval + MediaRequestsWWAN() int + NumberOfStalls() int + SegmentsDownloadedDuration() foundation.TimeInterval + PlaybackSessionID() string +} + +// A single entry in a player item's access log. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent?language=objc +type PlayerItemAccessLogEvent struct { + objc.Object +} + +func PlayerItemAccessLogEventFrom(ptr unsafe.Pointer) PlayerItemAccessLogEvent { + return PlayerItemAccessLogEvent{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemAccessLogEventClass) Alloc() PlayerItemAccessLogEvent { + rv := objc.Call[PlayerItemAccessLogEvent](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemAccessLogEvent_Alloc() PlayerItemAccessLogEvent { + return PlayerItemAccessLogEventClass.Alloc() +} + +func (pc _PlayerItemAccessLogEventClass) New() PlayerItemAccessLogEvent { + rv := objc.Call[PlayerItemAccessLogEvent](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemAccessLogEvent() PlayerItemAccessLogEvent { + return PlayerItemAccessLogEventClass.New() +} + +func (p_ PlayerItemAccessLogEvent) Init() PlayerItemAccessLogEvent { + rv := objc.Call[PlayerItemAccessLogEvent](p_, objc.Sel("init")) + return rv +} + +// The audio track’s average bit rate, in bits per second. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1643590-averageaudiobitrate?language=objc +func (p_ PlayerItemAccessLogEvent) AverageAudioBitrate() float64 { + rv := objc.Call[float64](p_, objc.Sel("averageAudioBitrate")) + return rv +} + +// The number of media read requests from the server to this client. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388357-numberofmediarequests?language=objc +func (p_ PlayerItemAccessLogEvent) NumberOfMediaRequests() int { + rv := objc.Call[int](p_, objc.Sel("numberOfMediaRequests")) + return rv +} + +// The accumulated duration, in seconds, of active network transfer of bytes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1387370-transferduration?language=objc +func (p_ PlayerItemAccessLogEvent) TransferDuration() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("transferDuration")) + return rv +} + +// The URI of the playback item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388643-uri?language=objc +func (p_ PlayerItemAccessLogEvent) URI() string { + rv := objc.Call[string](p_, objc.Sel("URI")) + return rv +} + +// The total number of dropped video frames [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388647-numberofdroppedvideoframes?language=objc +func (p_ PlayerItemAccessLogEvent) NumberOfDroppedVideoFrames() int { + rv := objc.Call[int](p_, objc.Sel("numberOfDroppedVideoFrames")) + return rv +} + +// A count of changes to the server address over the last uninterrupted period of playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388076-numberofserveraddresschanges?language=objc +func (p_ PlayerItemAccessLogEvent) NumberOfServerAddressChanges() int { + rv := objc.Call[int](p_, objc.Sel("numberOfServerAddressChanges")) + return rv +} + +// The empirical throughput, in bits per second, across all media downloaded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1390804-observedbitrate?language=objc +func (p_ PlayerItemAccessLogEvent) ObservedBitrate() float64 { + rv := objc.Call[float64](p_, objc.Sel("observedBitrate")) + return rv +} + +// The IP address of the server that was the source of the last delivered media segment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1390315-serveraddress?language=objc +func (p_ PlayerItemAccessLogEvent) ServerAddress() string { + rv := objc.Call[string](p_, objc.Sel("serverAddress")) + return rv +} + +// The video track’s average bit rate, in bits per second. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1643592-averagevideobitrate?language=objc +func (p_ PlayerItemAccessLogEvent) AverageVideoBitrate() float64 { + rv := objc.Call[float64](p_, objc.Sel("averageVideoBitrate")) + return rv +} + +// The accumulated number of bytes transferred by the item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1387305-numberofbytestransferred?language=objc +func (p_ PlayerItemAccessLogEvent) NumberOfBytesTransferred() int64 { + rv := objc.Call[int64](p_, objc.Sel("numberOfBytesTransferred")) + return rv +} + +// The playback type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1387218-playbacktype?language=objc +func (p_ PlayerItemAccessLogEvent) PlaybackType() string { + rv := objc.Call[string](p_, objc.Sel("playbackType")) + return rv +} + +// The throughput, in bits per second, required to play the stream, as advertised by the server. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388123-indicatedbitrate?language=objc +func (p_ PlayerItemAccessLogEvent) IndicatedBitrate() float64 { + rv := objc.Call[float64](p_, objc.Sel("indicatedBitrate")) + return rv +} + +// The total number of times that downloading the segments took too long. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1389213-downloadoverdue?language=objc +func (p_ PlayerItemAccessLogEvent) DownloadOverdue() int { + rv := objc.Call[int](p_, objc.Sel("downloadOverdue")) + return rv +} + +// The average throughput, in bits per second, required to play the stream, as advertised by the server. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1872546-indicatedaveragebitrate?language=objc +func (p_ PlayerItemAccessLogEvent) IndicatedAverageBitrate() float64 { + rv := objc.Call[float64](p_, objc.Sel("indicatedAverageBitrate")) + return rv +} + +// The bandwidth value that causes a switch, up or down, in the item's quality being played. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1390645-switchbitrate?language=objc +func (p_ PlayerItemAccessLogEvent) SwitchBitrate() float64 { + rv := objc.Call[float64](p_, objc.Sel("switchBitrate")) + return rv +} + +// The date and time at which playback began for this event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1390502-playbackstartdate?language=objc +func (p_ PlayerItemAccessLogEvent) PlaybackStartDate() foundation.Date { + rv := objc.Call[foundation.Date](p_, objc.Sel("playbackStartDate")) + return rv +} + +// The standard deviation of the observed segment download bit rates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1386094-observedbitratestandarddeviation?language=objc +func (p_ PlayerItemAccessLogEvent) ObservedBitrateStandardDeviation() float64 { + rv := objc.Call[float64](p_, objc.Sel("observedBitrateStandardDeviation")) + return rv +} + +// The accumulated duration, in seconds, of the media played. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388200-durationwatched?language=objc +func (p_ PlayerItemAccessLogEvent) DurationWatched() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("durationWatched")) + return rv +} + +// The accumulated duration, in seconds, until the player item is ready to play. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1389138-startuptime?language=objc +func (p_ PlayerItemAccessLogEvent) StartupTime() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("startupTime")) + return rv +} + +// The offset, in seconds, in the playlist where the last uninterrupted period of playback began. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1385922-playbackstartoffset?language=objc +func (p_ PlayerItemAccessLogEvent) PlaybackStartOffset() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("playbackStartOffset")) + return rv +} + +// The number of network read requests over a WWAN. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388549-mediarequestswwan?language=objc +func (p_ PlayerItemAccessLogEvent) MediaRequestsWWAN() int { + rv := objc.Call[int](p_, objc.Sel("mediaRequestsWWAN")) + return rv +} + +// The total number of playback stalls encountered. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1387712-numberofstalls?language=objc +func (p_ PlayerItemAccessLogEvent) NumberOfStalls() int { + rv := objc.Call[int](p_, objc.Sel("numberOfStalls")) + return rv +} + +// The accumulated duration, in seconds, of the media segments downloaded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388147-segmentsdownloadedduration?language=objc +func (p_ PlayerItemAccessLogEvent) SegmentsDownloadedDuration() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("segmentsDownloadedDuration")) + return rv +} + +// A GUID that identifies the playback session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemaccesslogevent/1388462-playbacksessionid?language=objc +func (p_ PlayerItemAccessLogEvent) PlaybackSessionID() string { + rv := objc.Call[string](p_, objc.Sel("playbackSessionID")) + return rv +} diff --git a/macos/avfoundation/player_item_error_log.gen.go b/macos/avfoundation/player_item_error_log.gen.go new file mode 100644 index 00000000..3253d33f --- /dev/null +++ b/macos/avfoundation/player_item_error_log.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemErrorLog] class. +var PlayerItemErrorLogClass = _PlayerItemErrorLogClass{objc.GetClass("AVPlayerItemErrorLog")} + +type _PlayerItemErrorLogClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemErrorLog] class. +type IPlayerItemErrorLog interface { + objc.IObject + ExtendedLogData() []byte + Events() []PlayerItemErrorLogEvent + ExtendedLogDataStringEncoding() foundation.StringEncoding +} + +// The error log associated with a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlog?language=objc +type PlayerItemErrorLog struct { + objc.Object +} + +func PlayerItemErrorLogFrom(ptr unsafe.Pointer) PlayerItemErrorLog { + return PlayerItemErrorLog{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemErrorLogClass) Alloc() PlayerItemErrorLog { + rv := objc.Call[PlayerItemErrorLog](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemErrorLog_Alloc() PlayerItemErrorLog { + return PlayerItemErrorLogClass.Alloc() +} + +func (pc _PlayerItemErrorLogClass) New() PlayerItemErrorLog { + rv := objc.Call[PlayerItemErrorLog](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemErrorLog() PlayerItemErrorLog { + return PlayerItemErrorLogClass.New() +} + +func (p_ PlayerItemErrorLog) Init() PlayerItemErrorLog { + rv := objc.Call[PlayerItemErrorLog](p_, objc.Sel("init")) + return rv +} + +// Returns a serialized representation of the error log in the Extended Log File Format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlog/1389100-extendedlogdata?language=objc +func (p_ PlayerItemErrorLog) ExtendedLogData() []byte { + rv := objc.Call[[]byte](p_, objc.Sel("extendedLogData")) + return rv +} + +// A chronologically ordered array of player item error log event objects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlog/1387637-events?language=objc +func (p_ PlayerItemErrorLog) Events() []PlayerItemErrorLogEvent { + rv := objc.Call[[]PlayerItemErrorLogEvent](p_, objc.Sel("events")) + return rv +} + +// The string encoding of the extended log data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlog/1387271-extendedlogdatastringencoding?language=objc +func (p_ PlayerItemErrorLog) ExtendedLogDataStringEncoding() foundation.StringEncoding { + rv := objc.Call[foundation.StringEncoding](p_, objc.Sel("extendedLogDataStringEncoding")) + return rv +} diff --git a/macos/avfoundation/player_item_error_log_event.gen.go b/macos/avfoundation/player_item_error_log_event.gen.go new file mode 100644 index 00000000..6edcef17 --- /dev/null +++ b/macos/avfoundation/player_item_error_log_event.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemErrorLogEvent] class. +var PlayerItemErrorLogEventClass = _PlayerItemErrorLogEventClass{objc.GetClass("AVPlayerItemErrorLogEvent")} + +type _PlayerItemErrorLogEventClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemErrorLogEvent] class. +type IPlayerItemErrorLogEvent interface { + objc.IObject + Date() foundation.Date + ErrorStatusCode() int + URI() string + ServerAddress() string + ErrorComment() string + PlaybackSessionID() string + ErrorDomain() string +} + +// A single item in a player item’s error log. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent?language=objc +type PlayerItemErrorLogEvent struct { + objc.Object +} + +func PlayerItemErrorLogEventFrom(ptr unsafe.Pointer) PlayerItemErrorLogEvent { + return PlayerItemErrorLogEvent{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemErrorLogEventClass) Alloc() PlayerItemErrorLogEvent { + rv := objc.Call[PlayerItemErrorLogEvent](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemErrorLogEvent_Alloc() PlayerItemErrorLogEvent { + return PlayerItemErrorLogEventClass.Alloc() +} + +func (pc _PlayerItemErrorLogEventClass) New() PlayerItemErrorLogEvent { + rv := objc.Call[PlayerItemErrorLogEvent](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemErrorLogEvent() PlayerItemErrorLogEvent { + return PlayerItemErrorLogEventClass.New() +} + +func (p_ PlayerItemErrorLogEvent) Init() PlayerItemErrorLogEvent { + rv := objc.Call[PlayerItemErrorLogEvent](p_, objc.Sel("init")) + return rv +} + +// The date and time when the error occurred. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent/1388416-date?language=objc +func (p_ PlayerItemErrorLogEvent) Date() foundation.Date { + rv := objc.Call[foundation.Date](p_, objc.Sel("date")) + return rv +} + +// A unique error code identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent/1387875-errorstatuscode?language=objc +func (p_ PlayerItemErrorLogEvent) ErrorStatusCode() int { + rv := objc.Call[int](p_, objc.Sel("errorStatusCode")) + return rv +} + +// The URI of the playback item that had an error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent/1389302-uri?language=objc +func (p_ PlayerItemErrorLogEvent) URI() string { + rv := objc.Call[string](p_, objc.Sel("URI")) + return rv +} + +// The IP address of the server that was the source of the error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent/1385797-serveraddress?language=objc +func (p_ PlayerItemErrorLogEvent) ServerAddress() string { + rv := objc.Call[string](p_, objc.Sel("serverAddress")) + return rv +} + +// A description of the error encountered [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent/1388011-errorcomment?language=objc +func (p_ PlayerItemErrorLogEvent) ErrorComment() string { + rv := objc.Call[string](p_, objc.Sel("errorComment")) + return rv +} + +// A GUID that identifies the playback session that had an error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent/1385934-playbacksessionid?language=objc +func (p_ PlayerItemErrorLogEvent) PlaybackSessionID() string { + rv := objc.Call[string](p_, objc.Sel("playbackSessionID")) + return rv +} + +// The domain of the error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemerrorlogevent/1388603-errordomain?language=objc +func (p_ PlayerItemErrorLogEvent) ErrorDomain() string { + rv := objc.Call[string](p_, objc.Sel("errorDomain")) + return rv +} diff --git a/macos/avfoundation/player_item_legible_output.gen.go b/macos/avfoundation/player_item_legible_output.gen.go new file mode 100644 index 00000000..b6786259 --- /dev/null +++ b/macos/avfoundation/player_item_legible_output.gen.go @@ -0,0 +1,143 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemLegibleOutput] class. +var PlayerItemLegibleOutputClass = _PlayerItemLegibleOutputClass{objc.GetClass("AVPlayerItemLegibleOutput")} + +type _PlayerItemLegibleOutputClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemLegibleOutput] class. +type IPlayerItemLegibleOutput interface { + IPlayerItemOutput + SetDelegateQueue(delegate PPlayerItemLegibleOutputPushDelegate, delegateQueue dispatch.Queue) + SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) + AdvanceIntervalForDelegateInvocation() foundation.TimeInterval + SetAdvanceIntervalForDelegateInvocation(value foundation.TimeInterval) + Delegate() PlayerItemLegibleOutputPushDelegateWrapper + TextStylingResolution() PlayerItemLegibleOutputTextStylingResolution + SetTextStylingResolution(value PlayerItemLegibleOutputTextStylingResolution) + DelegateQueue() dispatch.Queue +} + +// An object that vends attributed strings for media with a legible characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput?language=objc +type PlayerItemLegibleOutput struct { + PlayerItemOutput +} + +func PlayerItemLegibleOutputFrom(ptr unsafe.Pointer) PlayerItemLegibleOutput { + return PlayerItemLegibleOutput{ + PlayerItemOutput: PlayerItemOutputFrom(ptr), + } +} + +func (p_ PlayerItemLegibleOutput) InitWithMediaSubtypesForNativeRepresentation(subtypes []foundation.INumber) PlayerItemLegibleOutput { + rv := objc.Call[PlayerItemLegibleOutput](p_, objc.Sel("initWithMediaSubtypesForNativeRepresentation:"), subtypes) + return rv +} + +// Creates an initialized legible-output object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1390500-initwithmediasubtypesfornativere?language=objc +func NewPlayerItemLegibleOutputWithMediaSubtypesForNativeRepresentation(subtypes []foundation.INumber) PlayerItemLegibleOutput { + instance := PlayerItemLegibleOutputClass.Alloc().InitWithMediaSubtypesForNativeRepresentation(subtypes) + instance.Autorelease() + return instance +} + +func (pc _PlayerItemLegibleOutputClass) Alloc() PlayerItemLegibleOutput { + rv := objc.Call[PlayerItemLegibleOutput](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemLegibleOutput_Alloc() PlayerItemLegibleOutput { + return PlayerItemLegibleOutputClass.Alloc() +} + +func (pc _PlayerItemLegibleOutputClass) New() PlayerItemLegibleOutput { + rv := objc.Call[PlayerItemLegibleOutput](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemLegibleOutput() PlayerItemLegibleOutput { + return PlayerItemLegibleOutputClass.New() +} + +func (p_ PlayerItemLegibleOutput) Init() PlayerItemLegibleOutput { + rv := objc.Call[PlayerItemLegibleOutput](p_, objc.Sel("init")) + return rv +} + +// Sets the receiver's delegate and a dispatch queue on which the delegate is called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1386204-setdelegate?language=objc +func (p_ PlayerItemLegibleOutput) SetDelegateQueue(delegate PPlayerItemLegibleOutputPushDelegate, delegateQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVPlayerItemLegibleOutputPushDelegate", delegate) + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), po0, delegateQueue) +} + +// Sets the receiver's delegate and a dispatch queue on which the delegate is called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1386204-setdelegate?language=objc +func (p_ PlayerItemLegibleOutput) SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) { + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), objc.Ptr(delegateObject), delegateQueue) +} + +// The time interval, in seconds, that a player item legible output object messages its delegate earlier than normal. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1388098-advanceintervalfordelegateinvoca?language=objc +func (p_ PlayerItemLegibleOutput) AdvanceIntervalForDelegateInvocation() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("advanceIntervalForDelegateInvocation")) + return rv +} + +// The time interval, in seconds, that a player item legible output object messages its delegate earlier than normal. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1388098-advanceintervalfordelegateinvoca?language=objc +func (p_ PlayerItemLegibleOutput) SetAdvanceIntervalForDelegateInvocation(value foundation.TimeInterval) { + objc.Call[objc.Void](p_, objc.Sel("setAdvanceIntervalForDelegateInvocation:"), value) +} + +// The delegate of the output class. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1387877-delegate?language=objc +func (p_ PlayerItemLegibleOutput) Delegate() PlayerItemLegibleOutputPushDelegateWrapper { + rv := objc.Call[PlayerItemLegibleOutputPushDelegateWrapper](p_, objc.Sel("delegate")) + return rv +} + +// A string identifier indicating the degree of text styling to be applied to attributed strings vended by the object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1385803-textstylingresolution?language=objc +func (p_ PlayerItemLegibleOutput) TextStylingResolution() PlayerItemLegibleOutputTextStylingResolution { + rv := objc.Call[PlayerItemLegibleOutputTextStylingResolution](p_, objc.Sel("textStylingResolution")) + return rv +} + +// A string identifier indicating the degree of text styling to be applied to attributed strings vended by the object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1385803-textstylingresolution?language=objc +func (p_ PlayerItemLegibleOutput) SetTextStylingResolution(value PlayerItemLegibleOutputTextStylingResolution) { + objc.Call[objc.Void](p_, objc.Sel("setTextStylingResolution:"), value) +} + +// The dispatch queue on which the delegate is called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutput/1386275-delegatequeue?language=objc +func (p_ PlayerItemLegibleOutput) DelegateQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](p_, objc.Sel("delegateQueue")) + return rv +} diff --git a/macos/avfoundation/player_item_legible_output_push_delegate.gen.go b/macos/avfoundation/player_item_legible_output_push_delegate.gen.go new file mode 100644 index 00000000..2e2fba8e --- /dev/null +++ b/macos/avfoundation/player_item_legible_output_push_delegate.gen.go @@ -0,0 +1,57 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Methods you can implement to provide alternative attributed-string output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutputpushdelegate?language=objc +type PPlayerItemLegibleOutputPushDelegate interface { + // optional + LegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime(output PlayerItemLegibleOutput, strings []foundation.AttributedString, nativeSamples []objc.Object, itemTime coremedia.Time) + HasLegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime() bool +} + +// A delegate implementation builder for the [PPlayerItemLegibleOutputPushDelegate] protocol. +type PlayerItemLegibleOutputPushDelegate struct { + _LegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime func(output PlayerItemLegibleOutput, strings []foundation.AttributedString, nativeSamples []objc.Object, itemTime coremedia.Time) +} + +func (di *PlayerItemLegibleOutputPushDelegate) HasLegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime() bool { + return di._LegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime != nil +} + +// Asks the delegate to process the delivery of new textual samples. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutputpushdelegate/1386790-legibleoutput?language=objc +func (di *PlayerItemLegibleOutputPushDelegate) SetLegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime(f func(output PlayerItemLegibleOutput, strings []foundation.AttributedString, nativeSamples []objc.Object, itemTime coremedia.Time)) { + di._LegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime = f +} + +// Asks the delegate to process the delivery of new textual samples. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutputpushdelegate/1386790-legibleoutput?language=objc +func (di *PlayerItemLegibleOutputPushDelegate) LegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime(output PlayerItemLegibleOutput, strings []foundation.AttributedString, nativeSamples []objc.Object, itemTime coremedia.Time) { + di._LegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime(output, strings, nativeSamples, itemTime) +} + +// A concrete type wrapper for the [PPlayerItemLegibleOutputPushDelegate] protocol. +type PlayerItemLegibleOutputPushDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerItemLegibleOutputPushDelegateWrapper) HasLegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime() bool { + return p_.RespondsToSelector(objc.Sel("legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:")) +} + +// Asks the delegate to process the delivery of new textual samples. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemlegibleoutputpushdelegate/1386790-legibleoutput?language=objc +func (p_ PlayerItemLegibleOutputPushDelegateWrapper) LegibleOutputDidOutputAttributedStringsNativeSampleBuffersForItemTime(output IPlayerItemLegibleOutput, strings []foundation.IAttributedString, nativeSamples []objc.IObject, itemTime coremedia.Time) { + objc.Call[objc.Void](p_, objc.Sel("legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:"), objc.Ptr(output), strings, nativeSamples, itemTime) +} diff --git a/macos/avfoundation/player_item_media_data_collector.gen.go b/macos/avfoundation/player_item_media_data_collector.gen.go new file mode 100644 index 00000000..3fe0c338 --- /dev/null +++ b/macos/avfoundation/player_item_media_data_collector.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemMediaDataCollector] class. +var PlayerItemMediaDataCollectorClass = _PlayerItemMediaDataCollectorClass{objc.GetClass("AVPlayerItemMediaDataCollector")} + +type _PlayerItemMediaDataCollectorClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemMediaDataCollector] class. +type IPlayerItemMediaDataCollector interface { + objc.IObject +} + +// The abstract base for media data collectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmediadatacollector?language=objc +type PlayerItemMediaDataCollector struct { + objc.Object +} + +func PlayerItemMediaDataCollectorFrom(ptr unsafe.Pointer) PlayerItemMediaDataCollector { + return PlayerItemMediaDataCollector{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemMediaDataCollectorClass) Alloc() PlayerItemMediaDataCollector { + rv := objc.Call[PlayerItemMediaDataCollector](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemMediaDataCollector_Alloc() PlayerItemMediaDataCollector { + return PlayerItemMediaDataCollectorClass.Alloc() +} + +func (pc _PlayerItemMediaDataCollectorClass) New() PlayerItemMediaDataCollector { + rv := objc.Call[PlayerItemMediaDataCollector](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemMediaDataCollector() PlayerItemMediaDataCollector { + return PlayerItemMediaDataCollectorClass.New() +} + +func (p_ PlayerItemMediaDataCollector) Init() PlayerItemMediaDataCollector { + rv := objc.Call[PlayerItemMediaDataCollector](p_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/player_item_metadata_collector.gen.go b/macos/avfoundation/player_item_metadata_collector.gen.go new file mode 100644 index 00000000..b8f7bbb8 --- /dev/null +++ b/macos/avfoundation/player_item_metadata_collector.gen.go @@ -0,0 +1,108 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemMetadataCollector] class. +var PlayerItemMetadataCollectorClass = _PlayerItemMetadataCollectorClass{objc.GetClass("AVPlayerItemMetadataCollector")} + +type _PlayerItemMetadataCollectorClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemMetadataCollector] class. +type IPlayerItemMetadataCollector interface { + IPlayerItemMediaDataCollector + SetDelegateQueue(delegate PPlayerItemMetadataCollectorPushDelegate, delegateQueue dispatch.Queue) + SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) + Delegate() PlayerItemMetadataCollectorPushDelegateWrapper + DelegateQueue() dispatch.Queue +} + +// An object used to capture the date range metadata defined for an HTTP Live Streaming asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollector?language=objc +type PlayerItemMetadataCollector struct { + PlayerItemMediaDataCollector +} + +func PlayerItemMetadataCollectorFrom(ptr unsafe.Pointer) PlayerItemMetadataCollector { + return PlayerItemMetadataCollector{ + PlayerItemMediaDataCollector: PlayerItemMediaDataCollectorFrom(ptr), + } +} + +func (p_ PlayerItemMetadataCollector) InitWithIdentifiersClassifyingLabels(identifiers []string, classifyingLabels []string) PlayerItemMetadataCollector { + rv := objc.Call[PlayerItemMetadataCollector](p_, objc.Sel("initWithIdentifiers:classifyingLabels:"), identifiers, classifyingLabels) + return rv +} + +// Creates a metadata collector to access a stream’s metadata groups matching the specified array of identifiers and classifying labels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollector/1617191-initwithidentifiers?language=objc +func NewPlayerItemMetadataCollectorWithIdentifiersClassifyingLabels(identifiers []string, classifyingLabels []string) PlayerItemMetadataCollector { + instance := PlayerItemMetadataCollectorClass.Alloc().InitWithIdentifiersClassifyingLabels(identifiers, classifyingLabels) + instance.Autorelease() + return instance +} + +func (pc _PlayerItemMetadataCollectorClass) Alloc() PlayerItemMetadataCollector { + rv := objc.Call[PlayerItemMetadataCollector](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemMetadataCollector_Alloc() PlayerItemMetadataCollector { + return PlayerItemMetadataCollectorClass.Alloc() +} + +func (pc _PlayerItemMetadataCollectorClass) New() PlayerItemMetadataCollector { + rv := objc.Call[PlayerItemMetadataCollector](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemMetadataCollector() PlayerItemMetadataCollector { + return PlayerItemMetadataCollectorClass.New() +} + +func (p_ PlayerItemMetadataCollector) Init() PlayerItemMetadataCollector { + rv := objc.Call[PlayerItemMetadataCollector](p_, objc.Sel("init")) + return rv +} + +// Sets the delegate and a dispatch queue on which the delegate will be called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollector/1617195-setdelegate?language=objc +func (p_ PlayerItemMetadataCollector) SetDelegateQueue(delegate PPlayerItemMetadataCollectorPushDelegate, delegateQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVPlayerItemMetadataCollectorPushDelegate", delegate) + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), po0, delegateQueue) +} + +// Sets the delegate and a dispatch queue on which the delegate will be called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollector/1617195-setdelegate?language=objc +func (p_ PlayerItemMetadataCollector) SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) { + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), objc.Ptr(delegateObject), delegateQueue) +} + +// Accesses the metadata collector’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollector/1617196-delegate?language=objc +func (p_ PlayerItemMetadataCollector) Delegate() PlayerItemMetadataCollectorPushDelegateWrapper { + rv := objc.Call[PlayerItemMetadataCollectorPushDelegateWrapper](p_, objc.Sel("delegate")) + return rv +} + +// The dispatch queue on which the delegate’s methods are called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollector/1617192-delegatequeue?language=objc +func (p_ PlayerItemMetadataCollector) DelegateQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](p_, objc.Sel("delegateQueue")) + return rv +} diff --git a/macos/avfoundation/player_item_metadata_collector_push_delegate.gen.go b/macos/avfoundation/player_item_metadata_collector_push_delegate.gen.go new file mode 100644 index 00000000..41d2ee33 --- /dev/null +++ b/macos/avfoundation/player_item_metadata_collector_push_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol you implement to receive metadata callbacks from a player item metadata collector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollectorpushdelegate?language=objc +type PPlayerItemMetadataCollectorPushDelegate interface { + // optional + MetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups(metadataCollector PlayerItemMetadataCollector, metadataGroups []DateRangeMetadataGroup, indexesOfNewGroups foundation.IndexSet, indexesOfModifiedGroups foundation.IndexSet) + HasMetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups() bool +} + +// A delegate implementation builder for the [PPlayerItemMetadataCollectorPushDelegate] protocol. +type PlayerItemMetadataCollectorPushDelegate struct { + _MetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups func(metadataCollector PlayerItemMetadataCollector, metadataGroups []DateRangeMetadataGroup, indexesOfNewGroups foundation.IndexSet, indexesOfModifiedGroups foundation.IndexSet) +} + +func (di *PlayerItemMetadataCollectorPushDelegate) HasMetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups() bool { + return di._MetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups != nil +} + +// Tells the delegate the collected metadata group information has changed and needs to be updated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollectorpushdelegate/1617190-metadatacollector?language=objc +func (di *PlayerItemMetadataCollectorPushDelegate) SetMetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups(f func(metadataCollector PlayerItemMetadataCollector, metadataGroups []DateRangeMetadataGroup, indexesOfNewGroups foundation.IndexSet, indexesOfModifiedGroups foundation.IndexSet)) { + di._MetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups = f +} + +// Tells the delegate the collected metadata group information has changed and needs to be updated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollectorpushdelegate/1617190-metadatacollector?language=objc +func (di *PlayerItemMetadataCollectorPushDelegate) MetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups(metadataCollector PlayerItemMetadataCollector, metadataGroups []DateRangeMetadataGroup, indexesOfNewGroups foundation.IndexSet, indexesOfModifiedGroups foundation.IndexSet) { + di._MetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups(metadataCollector, metadataGroups, indexesOfNewGroups, indexesOfModifiedGroups) +} + +// A concrete type wrapper for the [PPlayerItemMetadataCollectorPushDelegate] protocol. +type PlayerItemMetadataCollectorPushDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerItemMetadataCollectorPushDelegateWrapper) HasMetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups() bool { + return p_.RespondsToSelector(objc.Sel("metadataCollector:didCollectDateRangeMetadataGroups:indexesOfNewGroups:indexesOfModifiedGroups:")) +} + +// Tells the delegate the collected metadata group information has changed and needs to be updated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadatacollectorpushdelegate/1617190-metadatacollector?language=objc +func (p_ PlayerItemMetadataCollectorPushDelegateWrapper) MetadataCollectorDidCollectDateRangeMetadataGroupsIndexesOfNewGroupsIndexesOfModifiedGroups(metadataCollector IPlayerItemMetadataCollector, metadataGroups []IDateRangeMetadataGroup, indexesOfNewGroups foundation.IIndexSet, indexesOfModifiedGroups foundation.IIndexSet) { + objc.Call[objc.Void](p_, objc.Sel("metadataCollector:didCollectDateRangeMetadataGroups:indexesOfNewGroups:indexesOfModifiedGroups:"), objc.Ptr(metadataCollector), metadataGroups, objc.Ptr(indexesOfNewGroups), objc.Ptr(indexesOfModifiedGroups)) +} diff --git a/macos/avfoundation/player_item_metadata_output.gen.go b/macos/avfoundation/player_item_metadata_output.gen.go new file mode 100644 index 00000000..96d821ad --- /dev/null +++ b/macos/avfoundation/player_item_metadata_output.gen.go @@ -0,0 +1,126 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemMetadataOutput] class. +var PlayerItemMetadataOutputClass = _PlayerItemMetadataOutputClass{objc.GetClass("AVPlayerItemMetadataOutput")} + +type _PlayerItemMetadataOutputClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemMetadataOutput] class. +type IPlayerItemMetadataOutput interface { + IPlayerItemOutput + SetDelegateQueue(delegate PPlayerItemMetadataOutputPushDelegate, delegateQueue dispatch.Queue) + SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) + AdvanceIntervalForDelegateInvocation() foundation.TimeInterval + SetAdvanceIntervalForDelegateInvocation(value foundation.TimeInterval) + Delegate() PlayerItemMetadataOutputPushDelegateWrapper + DelegateQueue() dispatch.Queue +} + +// An object that vends collections of metadata items that a player item’s tracks carry. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput?language=objc +type PlayerItemMetadataOutput struct { + PlayerItemOutput +} + +func PlayerItemMetadataOutputFrom(ptr unsafe.Pointer) PlayerItemMetadataOutput { + return PlayerItemMetadataOutput{ + PlayerItemOutput: PlayerItemOutputFrom(ptr), + } +} + +func (p_ PlayerItemMetadataOutput) InitWithIdentifiers(identifiers []string) PlayerItemMetadataOutput { + rv := objc.Call[PlayerItemMetadataOutput](p_, objc.Sel("initWithIdentifiers:"), identifiers) + return rv +} + +// Creates an instance of AVPlayerItemMetadataOutput. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput/1390205-initwithidentifiers?language=objc +func NewPlayerItemMetadataOutputWithIdentifiers(identifiers []string) PlayerItemMetadataOutput { + instance := PlayerItemMetadataOutputClass.Alloc().InitWithIdentifiers(identifiers) + instance.Autorelease() + return instance +} + +func (pc _PlayerItemMetadataOutputClass) Alloc() PlayerItemMetadataOutput { + rv := objc.Call[PlayerItemMetadataOutput](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemMetadataOutput_Alloc() PlayerItemMetadataOutput { + return PlayerItemMetadataOutputClass.Alloc() +} + +func (pc _PlayerItemMetadataOutputClass) New() PlayerItemMetadataOutput { + rv := objc.Call[PlayerItemMetadataOutput](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemMetadataOutput() PlayerItemMetadataOutput { + return PlayerItemMetadataOutputClass.New() +} + +func (p_ PlayerItemMetadataOutput) Init() PlayerItemMetadataOutput { + rv := objc.Call[PlayerItemMetadataOutput](p_, objc.Sel("init")) + return rv +} + +// Sets the delegate and a dispatch queue on which the delegate is called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput/1385728-setdelegate?language=objc +func (p_ PlayerItemMetadataOutput) SetDelegateQueue(delegate PPlayerItemMetadataOutputPushDelegate, delegateQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVPlayerItemMetadataOutputPushDelegate", delegate) + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), po0, delegateQueue) +} + +// Sets the delegate and a dispatch queue on which the delegate is called. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput/1385728-setdelegate?language=objc +func (p_ PlayerItemMetadataOutput) SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) { + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), objc.Ptr(delegateObject), delegateQueue) +} + +// The time interval, in seconds, the player item metadata output object messages its delegate earlier than normal. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput/1387372-advanceintervalfordelegateinvoca?language=objc +func (p_ PlayerItemMetadataOutput) AdvanceIntervalForDelegateInvocation() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](p_, objc.Sel("advanceIntervalForDelegateInvocation")) + return rv +} + +// The time interval, in seconds, the player item metadata output object messages its delegate earlier than normal. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput/1387372-advanceintervalfordelegateinvoca?language=objc +func (p_ PlayerItemMetadataOutput) SetAdvanceIntervalForDelegateInvocation(value foundation.TimeInterval) { + objc.Call[objc.Void](p_, objc.Sel("setAdvanceIntervalForDelegateInvocation:"), value) +} + +// The delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput/1387200-delegate?language=objc +func (p_ PlayerItemMetadataOutput) Delegate() PlayerItemMetadataOutputPushDelegateWrapper { + rv := objc.Call[PlayerItemMetadataOutputPushDelegateWrapper](p_, objc.Sel("delegate")) + return rv +} + +// The dispatch queue on which messages are sent to the delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutput/1387265-delegatequeue?language=objc +func (p_ PlayerItemMetadataOutput) DelegateQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](p_, objc.Sel("delegateQueue")) + return rv +} diff --git a/macos/avfoundation/player_item_metadata_output_push_delegate.gen.go b/macos/avfoundation/player_item_metadata_output_push_delegate.gen.go new file mode 100644 index 00000000..6206abcb --- /dev/null +++ b/macos/avfoundation/player_item_metadata_output_push_delegate.gen.go @@ -0,0 +1,55 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// Methods you can implement to provide additional metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutputpushdelegate?language=objc +type PPlayerItemMetadataOutputPushDelegate interface { + // optional + MetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack(output PlayerItemMetadataOutput, groups []TimedMetadataGroup, track PlayerItemTrack) + HasMetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack() bool +} + +// A delegate implementation builder for the [PPlayerItemMetadataOutputPushDelegate] protocol. +type PlayerItemMetadataOutputPushDelegate struct { + _MetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack func(output PlayerItemMetadataOutput, groups []TimedMetadataGroup, track PlayerItemTrack) +} + +func (di *PlayerItemMetadataOutputPushDelegate) HasMetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack() bool { + return di._MetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack != nil +} + +// Tells the delegate a new collection of metadata items is available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutputpushdelegate/1388071-metadataoutput?language=objc +func (di *PlayerItemMetadataOutputPushDelegate) SetMetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack(f func(output PlayerItemMetadataOutput, groups []TimedMetadataGroup, track PlayerItemTrack)) { + di._MetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack = f +} + +// Tells the delegate a new collection of metadata items is available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutputpushdelegate/1388071-metadataoutput?language=objc +func (di *PlayerItemMetadataOutputPushDelegate) MetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack(output PlayerItemMetadataOutput, groups []TimedMetadataGroup, track PlayerItemTrack) { + di._MetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack(output, groups, track) +} + +// A concrete type wrapper for the [PPlayerItemMetadataOutputPushDelegate] protocol. +type PlayerItemMetadataOutputPushDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerItemMetadataOutputPushDelegateWrapper) HasMetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack() bool { + return p_.RespondsToSelector(objc.Sel("metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:")) +} + +// Tells the delegate a new collection of metadata items is available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemmetadataoutputpushdelegate/1388071-metadataoutput?language=objc +func (p_ PlayerItemMetadataOutputPushDelegateWrapper) MetadataOutputDidOutputTimedMetadataGroupsFromPlayerItemTrack(output IPlayerItemMetadataOutput, groups []ITimedMetadataGroup, track IPlayerItemTrack) { + objc.Call[objc.Void](p_, objc.Sel("metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:"), objc.Ptr(output), groups, objc.Ptr(track)) +} diff --git a/macos/avfoundation/player_item_output.gen.go b/macos/avfoundation/player_item_output.gen.go new file mode 100644 index 00000000..9b172b0f --- /dev/null +++ b/macos/avfoundation/player_item_output.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corefoundation" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemOutput] class. +var PlayerItemOutputClass = _PlayerItemOutputClass{objc.GetClass("AVPlayerItemOutput")} + +type _PlayerItemOutputClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemOutput] class. +type IPlayerItemOutput interface { + objc.IObject + ItemTimeForCVTimeStamp(timestamp corevideo.TimeStamp) coremedia.Time + ItemTimeForHostTime(hostTimeInSeconds corefoundation.TimeInterval) coremedia.Time + ItemTimeForMachAbsoluteTime(machAbsoluteTime int64) coremedia.Time + SuppressesPlayerRendering() bool + SetSuppressesPlayerRendering(value bool) +} + +// An abstract class that defines the common interface to output media data from a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutput?language=objc +type PlayerItemOutput struct { + objc.Object +} + +func PlayerItemOutputFrom(ptr unsafe.Pointer) PlayerItemOutput { + return PlayerItemOutput{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemOutputClass) Alloc() PlayerItemOutput { + rv := objc.Call[PlayerItemOutput](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemOutput_Alloc() PlayerItemOutput { + return PlayerItemOutputClass.Alloc() +} + +func (pc _PlayerItemOutputClass) New() PlayerItemOutput { + rv := objc.Call[PlayerItemOutput](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemOutput() PlayerItemOutput { + return PlayerItemOutputClass.New() +} + +func (p_ PlayerItemOutput) Init() PlayerItemOutput { + rv := objc.Call[PlayerItemOutput](p_, objc.Sel("init")) + return rv +} + +// Converts a Core Video timestamp to the item’s timebase. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutput/1388333-itemtimeforcvtimestamp?language=objc +func (p_ PlayerItemOutput) ItemTimeForCVTimeStamp(timestamp corevideo.TimeStamp) coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("itemTimeForCVTimeStamp:"), timestamp) + return rv +} + +// Converts a host time, specified in seconds, to the item’s timebase. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutput/1386538-itemtimeforhosttime?language=objc +func (p_ PlayerItemOutput) ItemTimeForHostTime(hostTimeInSeconds corefoundation.TimeInterval) coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("itemTimeForHostTime:"), hostTimeInSeconds) + return rv +} + +// Converts a Mach host time to the item’s timebase. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutput/1386962-itemtimeformachabsolutetime?language=objc +func (p_ PlayerItemOutput) ItemTimeForMachAbsoluteTime(machAbsoluteTime int64) coremedia.Time { + rv := objc.Call[coremedia.Time](p_, objc.Sel("itemTimeForMachAbsoluteTime:"), machAbsoluteTime) + return rv +} + +// A Boolean value that indicates whether the player object renders the receiver’s output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutput/1386133-suppressesplayerrendering?language=objc +func (p_ PlayerItemOutput) SuppressesPlayerRendering() bool { + rv := objc.Call[bool](p_, objc.Sel("suppressesPlayerRendering")) + return rv +} + +// A Boolean value that indicates whether the player object renders the receiver’s output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutput/1386133-suppressesplayerrendering?language=objc +func (p_ PlayerItemOutput) SetSuppressesPlayerRendering(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setSuppressesPlayerRendering:"), value) +} diff --git a/macos/avfoundation/player_item_output_pull_delegate.gen.go b/macos/avfoundation/player_item_output_pull_delegate.gen.go new file mode 100644 index 00000000..88131157 --- /dev/null +++ b/macos/avfoundation/player_item_output_pull_delegate.gen.go @@ -0,0 +1,88 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// Methods you can implement to respond to pixel buffer changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpulldelegate?language=objc +type PPlayerItemOutputPullDelegate interface { + // optional + OutputSequenceWasFlushed(output PlayerItemOutput) + HasOutputSequenceWasFlushed() bool + + // optional + OutputMediaDataWillChange(sender PlayerItemOutput) + HasOutputMediaDataWillChange() bool +} + +// A delegate implementation builder for the [PPlayerItemOutputPullDelegate] protocol. +type PlayerItemOutputPullDelegate struct { + _OutputSequenceWasFlushed func(output PlayerItemOutput) + _OutputMediaDataWillChange func(sender PlayerItemOutput) +} + +func (di *PlayerItemOutputPullDelegate) HasOutputSequenceWasFlushed() bool { + return di._OutputSequenceWasFlushed != nil +} + +// Tells the delegate that a new sample sequence is commencing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpulldelegate/1387279-outputsequencewasflushed?language=objc +func (di *PlayerItemOutputPullDelegate) SetOutputSequenceWasFlushed(f func(output PlayerItemOutput)) { + di._OutputSequenceWasFlushed = f +} + +// Tells the delegate that a new sample sequence is commencing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpulldelegate/1387279-outputsequencewasflushed?language=objc +func (di *PlayerItemOutputPullDelegate) OutputSequenceWasFlushed(output PlayerItemOutput) { + di._OutputSequenceWasFlushed(output) +} +func (di *PlayerItemOutputPullDelegate) HasOutputMediaDataWillChange() bool { + return di._OutputMediaDataWillChange != nil +} + +// Tells the delegate that new samples are about to arrive. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpulldelegate/1387498-outputmediadatawillchange?language=objc +func (di *PlayerItemOutputPullDelegate) SetOutputMediaDataWillChange(f func(sender PlayerItemOutput)) { + di._OutputMediaDataWillChange = f +} + +// Tells the delegate that new samples are about to arrive. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpulldelegate/1387498-outputmediadatawillchange?language=objc +func (di *PlayerItemOutputPullDelegate) OutputMediaDataWillChange(sender PlayerItemOutput) { + di._OutputMediaDataWillChange(sender) +} + +// A concrete type wrapper for the [PPlayerItemOutputPullDelegate] protocol. +type PlayerItemOutputPullDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerItemOutputPullDelegateWrapper) HasOutputSequenceWasFlushed() bool { + return p_.RespondsToSelector(objc.Sel("outputSequenceWasFlushed:")) +} + +// Tells the delegate that a new sample sequence is commencing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpulldelegate/1387279-outputsequencewasflushed?language=objc +func (p_ PlayerItemOutputPullDelegateWrapper) OutputSequenceWasFlushed(output IPlayerItemOutput) { + objc.Call[objc.Void](p_, objc.Sel("outputSequenceWasFlushed:"), objc.Ptr(output)) +} + +func (p_ PlayerItemOutputPullDelegateWrapper) HasOutputMediaDataWillChange() bool { + return p_.RespondsToSelector(objc.Sel("outputMediaDataWillChange:")) +} + +// Tells the delegate that new samples are about to arrive. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpulldelegate/1387498-outputmediadatawillchange?language=objc +func (p_ PlayerItemOutputPullDelegateWrapper) OutputMediaDataWillChange(sender IPlayerItemOutput) { + objc.Call[objc.Void](p_, objc.Sel("outputMediaDataWillChange:"), objc.Ptr(sender)) +} diff --git a/macos/avfoundation/player_item_output_push_delegate.gen.go b/macos/avfoundation/player_item_output_push_delegate.gen.go new file mode 100644 index 00000000..4a209d18 --- /dev/null +++ b/macos/avfoundation/player_item_output_push_delegate.gen.go @@ -0,0 +1,55 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods to implement to respond to changes in the media data sequence. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpushdelegate?language=objc +type PPlayerItemOutputPushDelegate interface { + // optional + OutputSequenceWasFlushed(output PlayerItemOutput) + HasOutputSequenceWasFlushed() bool +} + +// A delegate implementation builder for the [PPlayerItemOutputPushDelegate] protocol. +type PlayerItemOutputPushDelegate struct { + _OutputSequenceWasFlushed func(output PlayerItemOutput) +} + +func (di *PlayerItemOutputPushDelegate) HasOutputSequenceWasFlushed() bool { + return di._OutputSequenceWasFlushed != nil +} + +// Tells the delegate that the output is starting a new sequence of media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpushdelegate/1390224-outputsequencewasflushed?language=objc +func (di *PlayerItemOutputPushDelegate) SetOutputSequenceWasFlushed(f func(output PlayerItemOutput)) { + di._OutputSequenceWasFlushed = f +} + +// Tells the delegate that the output is starting a new sequence of media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpushdelegate/1390224-outputsequencewasflushed?language=objc +func (di *PlayerItemOutputPushDelegate) OutputSequenceWasFlushed(output PlayerItemOutput) { + di._OutputSequenceWasFlushed(output) +} + +// A concrete type wrapper for the [PPlayerItemOutputPushDelegate] protocol. +type PlayerItemOutputPushDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerItemOutputPushDelegateWrapper) HasOutputSequenceWasFlushed() bool { + return p_.RespondsToSelector(objc.Sel("outputSequenceWasFlushed:")) +} + +// Tells the delegate that the output is starting a new sequence of media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemoutputpushdelegate/1390224-outputsequencewasflushed?language=objc +func (p_ PlayerItemOutputPushDelegateWrapper) OutputSequenceWasFlushed(output IPlayerItemOutput) { + objc.Call[objc.Void](p_, objc.Sel("outputSequenceWasFlushed:"), objc.Ptr(output)) +} diff --git a/macos/avfoundation/player_item_track.gen.go b/macos/avfoundation/player_item_track.gen.go new file mode 100644 index 00000000..cb2e6dd3 --- /dev/null +++ b/macos/avfoundation/player_item_track.gen.go @@ -0,0 +1,110 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemTrack] class. +var PlayerItemTrackClass = _PlayerItemTrackClass{objc.GetClass("AVPlayerItemTrack")} + +type _PlayerItemTrackClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemTrack] class. +type IPlayerItemTrack interface { + objc.IObject + VideoFieldMode() string + SetVideoFieldMode(value string) + CurrentVideoFrameRate() float64 + IsEnabled() bool + SetEnabled(value bool) + AssetTrack() AssetTrack +} + +// An object that represents the presentation state of an asset track during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemtrack?language=objc +type PlayerItemTrack struct { + objc.Object +} + +func PlayerItemTrackFrom(ptr unsafe.Pointer) PlayerItemTrack { + return PlayerItemTrack{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerItemTrackClass) Alloc() PlayerItemTrack { + rv := objc.Call[PlayerItemTrack](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemTrack_Alloc() PlayerItemTrack { + return PlayerItemTrackClass.Alloc() +} + +func (pc _PlayerItemTrackClass) New() PlayerItemTrack { + rv := objc.Call[PlayerItemTrack](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemTrack() PlayerItemTrack { + return PlayerItemTrackClass.New() +} + +func (p_ PlayerItemTrack) Init() PlayerItemTrack { + rv := objc.Call[PlayerItemTrack](p_, objc.Sel("init")) + return rv +} + +// A mode that specifies the handling of video frames that contain multiple fields. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemtrack/1388045-videofieldmode?language=objc +func (p_ PlayerItemTrack) VideoFieldMode() string { + rv := objc.Call[string](p_, objc.Sel("videoFieldMode")) + return rv +} + +// A mode that specifies the handling of video frames that contain multiple fields. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemtrack/1388045-videofieldmode?language=objc +func (p_ PlayerItemTrack) SetVideoFieldMode(value string) { + objc.Call[objc.Void](p_, objc.Sel("setVideoFieldMode:"), value) +} + +// The current frame rate of the video track as it plays. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemtrack/1388956-currentvideoframerate?language=objc +func (p_ PlayerItemTrack) CurrentVideoFrameRate() float64 { + rv := objc.Call[float64](p_, objc.Sel("currentVideoFrameRate")) + return rv +} + +// A Boolean value that indicates whether the player item presents the track’s media during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemtrack/1387062-enabled?language=objc +func (p_ PlayerItemTrack) IsEnabled() bool { + rv := objc.Call[bool](p_, objc.Sel("isEnabled")) + return rv +} + +// A Boolean value that indicates whether the player item presents the track’s media during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemtrack/1387062-enabled?language=objc +func (p_ PlayerItemTrack) SetEnabled(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setEnabled:"), value) +} + +// An asset track that provides the media for the player item track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemtrack/1390701-assettrack?language=objc +func (p_ PlayerItemTrack) AssetTrack() AssetTrack { + rv := objc.Call[AssetTrack](p_, objc.Sel("assetTrack")) + return rv +} diff --git a/macos/avfoundation/player_item_video_output.gen.go b/macos/avfoundation/player_item_video_output.gen.go new file mode 100644 index 00000000..d879e6f4 --- /dev/null +++ b/macos/avfoundation/player_item_video_output.gen.go @@ -0,0 +1,151 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerItemVideoOutput] class. +var PlayerItemVideoOutputClass = _PlayerItemVideoOutputClass{objc.GetClass("AVPlayerItemVideoOutput")} + +type _PlayerItemVideoOutputClass struct { + objc.Class +} + +// An interface definition for the [PlayerItemVideoOutput] class. +type IPlayerItemVideoOutput interface { + IPlayerItemOutput + SetDelegateQueue(delegate PPlayerItemOutputPullDelegate, delegateQueue dispatch.Queue) + SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) + CopyPixelBufferForItemTimeItemTimeForDisplay(itemTime coremedia.Time, outItemTimeForDisplay *coremedia.Time) corevideo.PixelBufferRef + RequestNotificationOfMediaDataChangeWithAdvanceInterval(interval foundation.TimeInterval) + HasNewPixelBufferForItemTime(itemTime coremedia.Time) bool + Delegate() PlayerItemOutputPullDelegateWrapper + DelegateQueue() dispatch.Queue +} + +// An object that outputs video frames from a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput?language=objc +type PlayerItemVideoOutput struct { + PlayerItemOutput +} + +func PlayerItemVideoOutputFrom(ptr unsafe.Pointer) PlayerItemVideoOutput { + return PlayerItemVideoOutput{ + PlayerItemOutput: PlayerItemOutputFrom(ptr), + } +} + +func (p_ PlayerItemVideoOutput) InitWithOutputSettings(outputSettings map[string]objc.IObject) PlayerItemVideoOutput { + rv := objc.Call[PlayerItemVideoOutput](p_, objc.Sel("initWithOutputSettings:"), outputSettings) + return rv +} + +// Creates a video output object initialized with the specified output settings. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1643270-initwithoutputsettings?language=objc +func NewPlayerItemVideoOutputWithOutputSettings(outputSettings map[string]objc.IObject) PlayerItemVideoOutput { + instance := PlayerItemVideoOutputClass.Alloc().InitWithOutputSettings(outputSettings) + instance.Autorelease() + return instance +} + +func (p_ PlayerItemVideoOutput) InitWithPixelBufferAttributes(pixelBufferAttributes map[string]objc.IObject) PlayerItemVideoOutput { + rv := objc.Call[PlayerItemVideoOutput](p_, objc.Sel("initWithPixelBufferAttributes:"), pixelBufferAttributes) + return rv +} + +// Creates a video output object using the specified pixel buffer attributes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1389231-initwithpixelbufferattributes?language=objc +func NewPlayerItemVideoOutputWithPixelBufferAttributes(pixelBufferAttributes map[string]objc.IObject) PlayerItemVideoOutput { + instance := PlayerItemVideoOutputClass.Alloc().InitWithPixelBufferAttributes(pixelBufferAttributes) + instance.Autorelease() + return instance +} + +func (pc _PlayerItemVideoOutputClass) Alloc() PlayerItemVideoOutput { + rv := objc.Call[PlayerItemVideoOutput](pc, objc.Sel("alloc")) + return rv +} + +func PlayerItemVideoOutput_Alloc() PlayerItemVideoOutput { + return PlayerItemVideoOutputClass.Alloc() +} + +func (pc _PlayerItemVideoOutputClass) New() PlayerItemVideoOutput { + rv := objc.Call[PlayerItemVideoOutput](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerItemVideoOutput() PlayerItemVideoOutput { + return PlayerItemVideoOutputClass.New() +} + +func (p_ PlayerItemVideoOutput) Init() PlayerItemVideoOutput { + rv := objc.Call[PlayerItemVideoOutput](p_, objc.Sel("init")) + return rv +} + +// Sets the delegate and dispatch queue for the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1386824-setdelegate?language=objc +func (p_ PlayerItemVideoOutput) SetDelegateQueue(delegate PPlayerItemOutputPullDelegate, delegateQueue dispatch.Queue) { + po0 := objc.WrapAsProtocol("AVPlayerItemOutputPullDelegate", delegate) + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), po0, delegateQueue) +} + +// Sets the delegate and dispatch queue for the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1386824-setdelegate?language=objc +func (p_ PlayerItemVideoOutput) SetDelegateObjectQueue(delegateObject objc.IObject, delegateQueue dispatch.Queue) { + objc.Call[objc.Void](p_, objc.Sel("setDelegate:queue:"), objc.Ptr(delegateObject), delegateQueue) +} + +// Retrieves an image that is appropriate for display at the specified item time, and marks the image as acquired. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1386148-copypixelbufferforitemtime?language=objc +func (p_ PlayerItemVideoOutput) CopyPixelBufferForItemTimeItemTimeForDisplay(itemTime coremedia.Time, outItemTimeForDisplay *coremedia.Time) corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](p_, objc.Sel("copyPixelBufferForItemTime:itemTimeForDisplay:"), itemTime, outItemTimeForDisplay) + return rv +} + +// Tells the receiver that the video out put client is entering a quiescent state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1386046-requestnotificationofmediadatach?language=objc +func (p_ PlayerItemVideoOutput) RequestNotificationOfMediaDataChangeWithAdvanceInterval(interval foundation.TimeInterval) { + objc.Call[objc.Void](p_, objc.Sel("requestNotificationOfMediaDataChangeWithAdvanceInterval:"), interval) +} + +// Returns a Boolean value that indicates whether video output is available for the specified item time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1386444-hasnewpixelbufferforitemtime?language=objc +func (p_ PlayerItemVideoOutput) HasNewPixelBufferForItemTime(itemTime coremedia.Time) bool { + rv := objc.Call[bool](p_, objc.Sel("hasNewPixelBufferForItemTime:"), itemTime) + return rv +} + +// The delegate for the video output object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1385827-delegate?language=objc +func (p_ PlayerItemVideoOutput) Delegate() PlayerItemOutputPullDelegateWrapper { + rv := objc.Call[PlayerItemOutputPullDelegateWrapper](p_, objc.Sel("delegate")) + return rv +} + +// The dispatch queue on which to call delegate methods. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayeritemvideooutput/1388108-delegatequeue?language=objc +func (p_ PlayerItemVideoOutput) DelegateQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](p_, objc.Sel("delegateQueue")) + return rv +} diff --git a/macos/avfoundation/player_layer.gen.go b/macos/avfoundation/player_layer.gen.go new file mode 100644 index 00000000..1ac91459 --- /dev/null +++ b/macos/avfoundation/player_layer.gen.go @@ -0,0 +1,198 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerLayer] class. +var PlayerLayerClass = _PlayerLayerClass{objc.GetClass("AVPlayerLayer")} + +type _PlayerLayerClass struct { + objc.Class +} + +// An interface definition for the [PlayerLayer] class. +type IPlayerLayer interface { + quartzcore.ILayer + VideoGravity() LayerVideoGravity + SetVideoGravity(value LayerVideoGravity) + PixelBufferAttributes() map[string]objc.Object + SetPixelBufferAttributes(value map[string]objc.IObject) + Player() Player + SetPlayer(value IPlayer) + IsReadyForDisplay() bool + VideoRect() coregraphics.Rect +} + +// An object that presents the visual contents of a player object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer?language=objc +type PlayerLayer struct { + quartzcore.Layer +} + +func PlayerLayerFrom(ptr unsafe.Pointer) PlayerLayer { + return PlayerLayer{ + Layer: quartzcore.LayerFrom(ptr), + } +} + +func (pc _PlayerLayerClass) Alloc() PlayerLayer { + rv := objc.Call[PlayerLayer](pc, objc.Sel("alloc")) + return rv +} + +func PlayerLayer_Alloc() PlayerLayer { + return PlayerLayerClass.Alloc() +} + +func (pc _PlayerLayerClass) New() PlayerLayer { + rv := objc.Call[PlayerLayer](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerLayer() PlayerLayer { + return PlayerLayerClass.New() +} + +func (p_ PlayerLayer) Init() PlayerLayer { + rv := objc.Call[PlayerLayer](p_, objc.Sel("init")) + return rv +} + +func (pc _PlayerLayerClass) Layer() PlayerLayer { + rv := objc.Call[PlayerLayer](pc, objc.Sel("layer")) + return rv +} + +// Creates and returns an instance of the layer object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410793-layer?language=objc +func PlayerLayer_Layer() PlayerLayer { + return PlayerLayerClass.Layer() +} + +func (p_ PlayerLayer) InitWithLayer(layer objc.IObject) PlayerLayer { + rv := objc.Call[PlayerLayer](p_, objc.Sel("initWithLayer:"), layer) + return rv +} + +// Override to copy or initialize custom fields of the specified layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410842-initwithlayer?language=objc +func NewPlayerLayerWithLayer(layer objc.IObject) PlayerLayer { + instance := PlayerLayerClass.Alloc().InitWithLayer(layer) + instance.Autorelease() + return instance +} + +func (p_ PlayerLayer) ModelLayer() PlayerLayer { + rv := objc.Call[PlayerLayer](p_, objc.Sel("modelLayer")) + return rv +} + +// Returns the model layer object associated with the receiver, if any. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410853-modellayer?language=objc +func PlayerLayer_ModelLayer() PlayerLayer { + instance := PlayerLayerClass.Alloc().ModelLayer() + instance.Autorelease() + return instance +} + +func (p_ PlayerLayer) PresentationLayer() PlayerLayer { + rv := objc.Call[PlayerLayer](p_, objc.Sel("presentationLayer")) + return rv +} + +// Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410744-presentationlayer?language=objc +func PlayerLayer_PresentationLayer() PlayerLayer { + instance := PlayerLayerClass.Alloc().PresentationLayer() + instance.Autorelease() + return instance +} + +// Creates a layer object to present the visual contents of a player’s current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1389308-playerlayerwithplayer?language=objc +func (pc _PlayerLayerClass) PlayerLayerWithPlayer(player IPlayer) PlayerLayer { + rv := objc.Call[PlayerLayer](pc, objc.Sel("playerLayerWithPlayer:"), objc.Ptr(player)) + return rv +} + +// Creates a layer object to present the visual contents of a player’s current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1389308-playerlayerwithplayer?language=objc +func PlayerLayer_PlayerLayerWithPlayer(player IPlayer) PlayerLayer { + return PlayerLayerClass.PlayerLayerWithPlayer(player) +} + +// A value that specifies how the layer displays the player’s visual content within the layer’s bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1388915-videogravity?language=objc +func (p_ PlayerLayer) VideoGravity() LayerVideoGravity { + rv := objc.Call[LayerVideoGravity](p_, objc.Sel("videoGravity")) + return rv +} + +// A value that specifies how the layer displays the player’s visual content within the layer’s bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1388915-videogravity?language=objc +func (p_ PlayerLayer) SetVideoGravity(value LayerVideoGravity) { + objc.Call[objc.Void](p_, objc.Sel("setVideoGravity:"), value) +} + +// The attributes of the visual output that displays in the player layer during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1390055-pixelbufferattributes?language=objc +func (p_ PlayerLayer) PixelBufferAttributes() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](p_, objc.Sel("pixelBufferAttributes")) + return rv +} + +// The attributes of the visual output that displays in the player layer during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1390055-pixelbufferattributes?language=objc +func (p_ PlayerLayer) SetPixelBufferAttributes(value map[string]objc.IObject) { + objc.Call[objc.Void](p_, objc.Sel("setPixelBufferAttributes:"), value) +} + +// The player whose visual content the layer displays. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1390434-player?language=objc +func (p_ PlayerLayer) Player() Player { + rv := objc.Call[Player](p_, objc.Sel("player")) + return rv +} + +// The player whose visual content the layer displays. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1390434-player?language=objc +func (p_ PlayerLayer) SetPlayer(value IPlayer) { + objc.Call[objc.Void](p_, objc.Sel("setPlayer:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether the first video frame of the player’s current item is ready for display. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1389748-readyfordisplay?language=objc +func (p_ PlayerLayer) IsReadyForDisplay() bool { + rv := objc.Call[bool](p_, objc.Sel("isReadyForDisplay")) + return rv +} + +// The current size and position of the video image that displays within the layer’s bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlayer/1385745-videorect?language=objc +func (p_ PlayerLayer) VideoRect() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](p_, objc.Sel("videoRect")) + return rv +} diff --git a/macos/avfoundation/player_looper.gen.go b/macos/avfoundation/player_looper.gen.go new file mode 100644 index 00000000..d6431c02 --- /dev/null +++ b/macos/avfoundation/player_looper.gen.go @@ -0,0 +1,130 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerLooper] class. +var PlayerLooperClass = _PlayerLooperClass{objc.GetClass("AVPlayerLooper")} + +type _PlayerLooperClass struct { + objc.Class +} + +// An interface definition for the [PlayerLooper] class. +type IPlayerLooper interface { + objc.IObject + DisableLooping() + Error() foundation.Error + LoopCount() int + Status() PlayerLooperStatus + LoopingPlayerItems() []PlayerItem +} + +// An object that loops media content using a queue player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper?language=objc +type PlayerLooper struct { + objc.Object +} + +func PlayerLooperFrom(ptr unsafe.Pointer) PlayerLooper { + return PlayerLooper{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlayerLooperClass) PlayerLooperWithPlayerTemplateItem(player IQueuePlayer, itemToLoop IPlayerItem) PlayerLooper { + rv := objc.Call[PlayerLooper](pc, objc.Sel("playerLooperWithPlayer:templateItem:"), objc.Ptr(player), objc.Ptr(itemToLoop)) + return rv +} + +// Creates a player looper that continuously plays the full duration of a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper/1643625-playerlooperwithplayer?language=objc +func PlayerLooper_PlayerLooperWithPlayerTemplateItem(player IQueuePlayer, itemToLoop IPlayerItem) PlayerLooper { + return PlayerLooperClass.PlayerLooperWithPlayerTemplateItem(player, itemToLoop) +} + +func (p_ PlayerLooper) InitWithPlayerTemplateItemTimeRange(player IQueuePlayer, itemToLoop IPlayerItem, loopRange coremedia.TimeRange) PlayerLooper { + rv := objc.Call[PlayerLooper](p_, objc.Sel("initWithPlayer:templateItem:timeRange:"), objc.Ptr(player), objc.Ptr(itemToLoop), loopRange) + return rv +} + +// Creates a player looper that continuously plays the specified time range of a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper/1643626-initwithplayer?language=objc +func NewPlayerLooperWithPlayerTemplateItemTimeRange(player IQueuePlayer, itemToLoop IPlayerItem, loopRange coremedia.TimeRange) PlayerLooper { + instance := PlayerLooperClass.Alloc().InitWithPlayerTemplateItemTimeRange(player, itemToLoop, loopRange) + instance.Autorelease() + return instance +} + +func (pc _PlayerLooperClass) Alloc() PlayerLooper { + rv := objc.Call[PlayerLooper](pc, objc.Sel("alloc")) + return rv +} + +func PlayerLooper_Alloc() PlayerLooper { + return PlayerLooperClass.Alloc() +} + +func (pc _PlayerLooperClass) New() PlayerLooper { + rv := objc.Call[PlayerLooper](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerLooper() PlayerLooper { + return PlayerLooperClass.New() +} + +func (p_ PlayerLooper) Init() PlayerLooper { + rv := objc.Call[PlayerLooper](p_, objc.Sel("init")) + return rv +} + +// Disables looping for the player queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper/1643629-disablelooping?language=objc +func (p_ PlayerLooper) DisableLooping() { + objc.Call[objc.Void](p_, objc.Sel("disableLooping")) +} + +// An error that describes the reason looping failed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper/2177064-error?language=objc +func (p_ PlayerLooper) Error() foundation.Error { + rv := objc.Call[foundation.Error](p_, objc.Sel("error")) + return rv +} + +// The number of times the object played the media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper/1643648-loopcount?language=objc +func (p_ PlayerLooper) LoopCount() int { + rv := objc.Call[int](p_, objc.Sel("loopCount")) + return rv +} + +// A status that indicates the object’s ability to loop playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper/2177060-status?language=objc +func (p_ PlayerLooper) Status() PlayerLooperStatus { + rv := objc.Call[PlayerLooperStatus](p_, objc.Sel("status")) + return rv +} + +// An array containing replicas of the template player item used to accomplish the looping. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerlooper/1643631-loopingplayeritems?language=objc +func (p_ PlayerLooper) LoopingPlayerItems() []PlayerItem { + rv := objc.Call[[]PlayerItem](p_, objc.Sel("loopingPlayerItems")) + return rv +} diff --git a/macos/avfoundation/player_media_selection_criteria.gen.go b/macos/avfoundation/player_media_selection_criteria.gen.go new file mode 100644 index 00000000..ce6e70b1 --- /dev/null +++ b/macos/avfoundation/player_media_selection_criteria.gen.go @@ -0,0 +1,113 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerMediaSelectionCriteria] class. +var PlayerMediaSelectionCriteriaClass = _PlayerMediaSelectionCriteriaClass{objc.GetClass("AVPlayerMediaSelectionCriteria")} + +type _PlayerMediaSelectionCriteriaClass struct { + objc.Class +} + +// An interface definition for the [PlayerMediaSelectionCriteria] class. +type IPlayerMediaSelectionCriteria interface { + objc.IObject + PreferredLanguages() []string + PrincipalMediaCharacteristics() []MediaCharacteristic + PreferredMediaCharacteristics() []MediaCharacteristic +} + +// An object that specifies the preferred languages and media characteristics for a player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayermediaselectioncriteria?language=objc +type PlayerMediaSelectionCriteria struct { + objc.Object +} + +func PlayerMediaSelectionCriteriaFrom(ptr unsafe.Pointer) PlayerMediaSelectionCriteria { + return PlayerMediaSelectionCriteria{ + Object: objc.ObjectFrom(ptr), + } +} + +func (p_ PlayerMediaSelectionCriteria) InitWithPreferredLanguagesPreferredMediaCharacteristics(preferredLanguages []string, preferredMediaCharacteristics []MediaCharacteristic) PlayerMediaSelectionCriteria { + rv := objc.Call[PlayerMediaSelectionCriteria](p_, objc.Sel("initWithPreferredLanguages:preferredMediaCharacteristics:"), preferredLanguages, preferredMediaCharacteristics) + return rv +} + +// Creates media selection criteria with the preferred languages and media characteristics. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayermediaselectioncriteria/1387627-initwithpreferredlanguages?language=objc +func NewPlayerMediaSelectionCriteriaWithPreferredLanguagesPreferredMediaCharacteristics(preferredLanguages []string, preferredMediaCharacteristics []MediaCharacteristic) PlayerMediaSelectionCriteria { + instance := PlayerMediaSelectionCriteriaClass.Alloc().InitWithPreferredLanguagesPreferredMediaCharacteristics(preferredLanguages, preferredMediaCharacteristics) + instance.Autorelease() + return instance +} + +func (p_ PlayerMediaSelectionCriteria) InitWithPrincipalMediaCharacteristicsPreferredLanguagesPreferredMediaCharacteristics(principalMediaCharacteristics []MediaCharacteristic, preferredLanguages []string, preferredMediaCharacteristics []MediaCharacteristic) PlayerMediaSelectionCriteria { + rv := objc.Call[PlayerMediaSelectionCriteria](p_, objc.Sel("initWithPrincipalMediaCharacteristics:preferredLanguages:preferredMediaCharacteristics:"), principalMediaCharacteristics, preferredLanguages, preferredMediaCharacteristics) + return rv +} + +// Creates media selection criteria with the principal media characteristics, and preferred languages and media characteristics. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayermediaselectioncriteria/3042657-initwithprincipalmediacharacteri?language=objc +func NewPlayerMediaSelectionCriteriaWithPrincipalMediaCharacteristicsPreferredLanguagesPreferredMediaCharacteristics(principalMediaCharacteristics []MediaCharacteristic, preferredLanguages []string, preferredMediaCharacteristics []MediaCharacteristic) PlayerMediaSelectionCriteria { + instance := PlayerMediaSelectionCriteriaClass.Alloc().InitWithPrincipalMediaCharacteristicsPreferredLanguagesPreferredMediaCharacteristics(principalMediaCharacteristics, preferredLanguages, preferredMediaCharacteristics) + instance.Autorelease() + return instance +} + +func (pc _PlayerMediaSelectionCriteriaClass) Alloc() PlayerMediaSelectionCriteria { + rv := objc.Call[PlayerMediaSelectionCriteria](pc, objc.Sel("alloc")) + return rv +} + +func PlayerMediaSelectionCriteria_Alloc() PlayerMediaSelectionCriteria { + return PlayerMediaSelectionCriteriaClass.Alloc() +} + +func (pc _PlayerMediaSelectionCriteriaClass) New() PlayerMediaSelectionCriteria { + rv := objc.Call[PlayerMediaSelectionCriteria](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerMediaSelectionCriteria() PlayerMediaSelectionCriteria { + return PlayerMediaSelectionCriteriaClass.New() +} + +func (p_ PlayerMediaSelectionCriteria) Init() PlayerMediaSelectionCriteria { + rv := objc.Call[PlayerMediaSelectionCriteria](p_, objc.Sel("init")) + return rv +} + +// An array of language identifiers in preferred order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayermediaselectioncriteria/1388559-preferredlanguages?language=objc +func (p_ PlayerMediaSelectionCriteria) PreferredLanguages() []string { + rv := objc.Call[[]string](p_, objc.Sel("preferredLanguages")) + return rv +} + +// An array of media characteristics that are essential to select when choosing media with a particular characteristic. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayermediaselectioncriteria/3042658-principalmediacharacteristics?language=objc +func (p_ PlayerMediaSelectionCriteria) PrincipalMediaCharacteristics() []MediaCharacteristic { + rv := objc.Call[[]MediaCharacteristic](p_, objc.Sel("principalMediaCharacteristics")) + return rv +} + +// An array of media characteristics in preferred order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayermediaselectioncriteria/1385734-preferredmediacharacteristics?language=objc +func (p_ PlayerMediaSelectionCriteria) PreferredMediaCharacteristics() []MediaCharacteristic { + rv := objc.Call[[]MediaCharacteristic](p_, objc.Sel("preferredMediaCharacteristics")) + return rv +} diff --git a/macos/avfoundation/player_playback_coordinator.gen.go b/macos/avfoundation/player_playback_coordinator.gen.go new file mode 100644 index 00000000..a08b8acf --- /dev/null +++ b/macos/avfoundation/player_playback_coordinator.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerPlaybackCoordinator] class. +var PlayerPlaybackCoordinatorClass = _PlayerPlaybackCoordinatorClass{objc.GetClass("AVPlayerPlaybackCoordinator")} + +type _PlayerPlaybackCoordinatorClass struct { + objc.Class +} + +// An interface definition for the [PlayerPlaybackCoordinator] class. +type IPlayerPlaybackCoordinator interface { + IPlaybackCoordinator + Player() Player + Delegate() PlayerPlaybackCoordinatorDelegateWrapper + SetDelegate(value PPlayerPlaybackCoordinatorDelegate) + SetDelegateObject(valueObject objc.IObject) +} + +// A playback coordinator subclass that coordinates the playback of player objects in a connected group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinator?language=objc +type PlayerPlaybackCoordinator struct { + PlaybackCoordinator +} + +func PlayerPlaybackCoordinatorFrom(ptr unsafe.Pointer) PlayerPlaybackCoordinator { + return PlayerPlaybackCoordinator{ + PlaybackCoordinator: PlaybackCoordinatorFrom(ptr), + } +} + +func (pc _PlayerPlaybackCoordinatorClass) Alloc() PlayerPlaybackCoordinator { + rv := objc.Call[PlayerPlaybackCoordinator](pc, objc.Sel("alloc")) + return rv +} + +func PlayerPlaybackCoordinator_Alloc() PlayerPlaybackCoordinator { + return PlayerPlaybackCoordinatorClass.Alloc() +} + +func (pc _PlayerPlaybackCoordinatorClass) New() PlayerPlaybackCoordinator { + rv := objc.Call[PlayerPlaybackCoordinator](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerPlaybackCoordinator() PlayerPlaybackCoordinator { + return PlayerPlaybackCoordinatorClass.New() +} + +func (p_ PlayerPlaybackCoordinator) Init() PlayerPlaybackCoordinator { + rv := objc.Call[PlayerPlaybackCoordinator](p_, objc.Sel("init")) + return rv +} + +// A player that participates in coordinated playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinator/3750302-player?language=objc +func (p_ PlayerPlaybackCoordinator) Player() Player { + rv := objc.Call[Player](p_, objc.Sel("player")) + return rv +} + +// A delegate object for the playback coordinator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinator/3750301-delegate?language=objc +func (p_ PlayerPlaybackCoordinator) Delegate() PlayerPlaybackCoordinatorDelegateWrapper { + rv := objc.Call[PlayerPlaybackCoordinatorDelegateWrapper](p_, objc.Sel("delegate")) + return rv +} + +// A delegate object for the playback coordinator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinator/3750301-delegate?language=objc +func (p_ PlayerPlaybackCoordinator) SetDelegate(value PPlayerPlaybackCoordinatorDelegate) { + po0 := objc.WrapAsProtocol("AVPlayerPlaybackCoordinatorDelegate", value) + objc.SetAssociatedObject(p_, objc.AssociationKey("setDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](p_, objc.Sel("setDelegate:"), po0) +} + +// A delegate object for the playback coordinator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinator/3750301-delegate?language=objc +func (p_ PlayerPlaybackCoordinator) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](p_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} diff --git a/macos/avfoundation/player_playback_coordinator_delegate.gen.go b/macos/avfoundation/player_playback_coordinator_delegate.gen.go new file mode 100644 index 00000000..395c5e1a --- /dev/null +++ b/macos/avfoundation/player_playback_coordinator_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods to implement to participate in playback coordination. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinatordelegate?language=objc +type PPlayerPlaybackCoordinatorDelegate interface { + // optional + PlaybackCoordinatorIdentifierForPlayerItem(coordinator PlayerPlaybackCoordinator, playerItem PlayerItem) string + HasPlaybackCoordinatorIdentifierForPlayerItem() bool +} + +// A delegate implementation builder for the [PPlayerPlaybackCoordinatorDelegate] protocol. +type PlayerPlaybackCoordinatorDelegate struct { + _PlaybackCoordinatorIdentifierForPlayerItem func(coordinator PlayerPlaybackCoordinator, playerItem PlayerItem) string +} + +func (di *PlayerPlaybackCoordinatorDelegate) HasPlaybackCoordinatorIdentifierForPlayerItem() bool { + return di._PlaybackCoordinatorIdentifierForPlayerItem != nil +} + +// Returns an identifier for a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinatordelegate/3750304-playbackcoordinator?language=objc +func (di *PlayerPlaybackCoordinatorDelegate) SetPlaybackCoordinatorIdentifierForPlayerItem(f func(coordinator PlayerPlaybackCoordinator, playerItem PlayerItem) string) { + di._PlaybackCoordinatorIdentifierForPlayerItem = f +} + +// Returns an identifier for a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinatordelegate/3750304-playbackcoordinator?language=objc +func (di *PlayerPlaybackCoordinatorDelegate) PlaybackCoordinatorIdentifierForPlayerItem(coordinator PlayerPlaybackCoordinator, playerItem PlayerItem) string { + return di._PlaybackCoordinatorIdentifierForPlayerItem(coordinator, playerItem) +} + +// A concrete type wrapper for the [PPlayerPlaybackCoordinatorDelegate] protocol. +type PlayerPlaybackCoordinatorDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerPlaybackCoordinatorDelegateWrapper) HasPlaybackCoordinatorIdentifierForPlayerItem() bool { + return p_.RespondsToSelector(objc.Sel("playbackCoordinator:identifierForPlayerItem:")) +} + +// Returns an identifier for a player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayerplaybackcoordinatordelegate/3750304-playbackcoordinator?language=objc +func (p_ PlayerPlaybackCoordinatorDelegateWrapper) PlaybackCoordinatorIdentifierForPlayerItem(coordinator IPlayerPlaybackCoordinator, playerItem IPlayerItem) string { + rv := objc.Call[string](p_, objc.Sel("playbackCoordinator:identifierForPlayerItem:"), objc.Ptr(coordinator), objc.Ptr(playerItem)) + return rv +} diff --git a/macos/avfoundation/portrait_effects_matte.gen.go b/macos/avfoundation/portrait_effects_matte.gen.go new file mode 100644 index 00000000..54e07945 --- /dev/null +++ b/macos/avfoundation/portrait_effects_matte.gen.go @@ -0,0 +1,128 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/imageio" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PortraitEffectsMatte] class. +var PortraitEffectsMatteClass = _PortraitEffectsMatteClass{objc.GetClass("AVPortraitEffectsMatte")} + +type _PortraitEffectsMatteClass struct { + objc.Class +} + +// An interface definition for the [PortraitEffectsMatte] class. +type IPortraitEffectsMatte interface { + objc.IObject + DictionaryRepresentationForAuxiliaryDataType(outAuxDataType string) foundation.Dictionary + PixelFormatType() uint + MattingImage() corevideo.PixelBufferRef +} + +// An auxiliary image used to separate foreground from background with high resolution. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avportraiteffectsmatte?language=objc +type PortraitEffectsMatte struct { + objc.Object +} + +func PortraitEffectsMatteFrom(ptr unsafe.Pointer) PortraitEffectsMatte { + return PortraitEffectsMatte{ + Object: objc.ObjectFrom(ptr), + } +} + +func (p_ PortraitEffectsMatte) PortraitEffectsMatteByReplacingPortraitEffectsMatteWithPixelBufferError(pixelBuffer corevideo.PixelBufferRef, outError foundation.IError) PortraitEffectsMatte { + rv := objc.Call[PortraitEffectsMatte](p_, objc.Sel("portraitEffectsMatteByReplacingPortraitEffectsMatteWithPixelBuffer:error:"), pixelBuffer, objc.Ptr(outError)) + return rv +} + +// Returns a portrait effects matte by wrapping the replacement pixel buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avportraiteffectsmatte/2976124-portraiteffectsmattebyreplacingp?language=objc +func PortraitEffectsMatte_PortraitEffectsMatteByReplacingPortraitEffectsMatteWithPixelBufferError(pixelBuffer corevideo.PixelBufferRef, outError foundation.IError) PortraitEffectsMatte { + instance := PortraitEffectsMatteClass.Alloc().PortraitEffectsMatteByReplacingPortraitEffectsMatteWithPixelBufferError(pixelBuffer, outError) + instance.Autorelease() + return instance +} + +func (p_ PortraitEffectsMatte) PortraitEffectsMatteByApplyingExifOrientation(exifOrientation imageio.ImagePropertyOrientation) PortraitEffectsMatte { + rv := objc.Call[PortraitEffectsMatte](p_, objc.Sel("portraitEffectsMatteByApplyingExifOrientation:"), exifOrientation) + return rv +} + +// Returns a derivative portrait effects matte after applying the specified EXIF orientation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avportraiteffectsmatte/2976123-portraiteffectsmattebyapplyingex?language=objc +func PortraitEffectsMatte_PortraitEffectsMatteByApplyingExifOrientation(exifOrientation imageio.ImagePropertyOrientation) PortraitEffectsMatte { + instance := PortraitEffectsMatteClass.Alloc().PortraitEffectsMatteByApplyingExifOrientation(exifOrientation) + instance.Autorelease() + return instance +} + +func (pc _PortraitEffectsMatteClass) PortraitEffectsMatteFromDictionaryRepresentationError(imageSourceAuxDataInfoDictionary foundation.Dictionary, outError foundation.IError) PortraitEffectsMatte { + rv := objc.Call[PortraitEffectsMatte](pc, objc.Sel("portraitEffectsMatteFromDictionaryRepresentation:error:"), imageSourceAuxDataInfoDictionary, objc.Ptr(outError)) + return rv +} + +// Initializes a portrait effects matte instance from auxiliary image information in an image file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avportraiteffectsmatte/2976125-portraiteffectsmattefromdictiona?language=objc +func PortraitEffectsMatte_PortraitEffectsMatteFromDictionaryRepresentationError(imageSourceAuxDataInfoDictionary foundation.Dictionary, outError foundation.IError) PortraitEffectsMatte { + return PortraitEffectsMatteClass.PortraitEffectsMatteFromDictionaryRepresentationError(imageSourceAuxDataInfoDictionary, outError) +} + +func (pc _PortraitEffectsMatteClass) Alloc() PortraitEffectsMatte { + rv := objc.Call[PortraitEffectsMatte](pc, objc.Sel("alloc")) + return rv +} + +func PortraitEffectsMatte_Alloc() PortraitEffectsMatte { + return PortraitEffectsMatteClass.Alloc() +} + +func (pc _PortraitEffectsMatteClass) New() PortraitEffectsMatte { + rv := objc.Call[PortraitEffectsMatte](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPortraitEffectsMatte() PortraitEffectsMatte { + return PortraitEffectsMatteClass.New() +} + +func (p_ PortraitEffectsMatte) Init() PortraitEffectsMatte { + rv := objc.Call[PortraitEffectsMatte](p_, objc.Sel("init")) + return rv +} + +// A dictionary of primitive map information used for writing an image file with a portrait effects matte. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avportraiteffectsmatte/2976120-dictionaryrepresentationforauxil?language=objc +func (p_ PortraitEffectsMatte) DictionaryRepresentationForAuxiliaryDataType(outAuxDataType string) foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](p_, objc.Sel("dictionaryRepresentationForAuxiliaryDataType:"), outAuxDataType) + return rv +} + +// The pixel format type of this portrait effects matte's internal image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avportraiteffectsmatte/2976122-pixelformattype?language=objc +func (p_ PortraitEffectsMatte) PixelFormatType() uint { + rv := objc.Call[uint](p_, objc.Sel("pixelFormatType")) + return rv +} + +// The portrait effects matte's internal image, formatted as a pixel buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avportraiteffectsmatte/2976121-mattingimage?language=objc +func (p_ PortraitEffectsMatte) MattingImage() corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](p_, objc.Sel("mattingImage")) + return rv +} diff --git a/macos/avfoundation/protocols.gen.m b/macos/avfoundation/protocols.gen.m new file mode 100644 index 00000000..dd66583a --- /dev/null +++ b/macos/avfoundation/protocols.gen.m @@ -0,0 +1,30 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "AVFoundation/AVFoundation.h" + +void importAVFoundationProtocols() { + id o; + o = @protocol(AVAssetDownloadDelegate); + o = @protocol(AVAssetReaderCaptionValidationHandling); + o = @protocol(AVAssetResourceLoaderDelegate); + o = @protocol(AVAssetWriterDelegate); + o = @protocol(AVAsynchronousKeyValueLoading); + o = @protocol(AVCaptureAudioDataOutputSampleBufferDelegate); + o = @protocol(AVCaptureFileOutputDelegate); + o = @protocol(AVCaptureFileOutputRecordingDelegate); + o = @protocol(AVCapturePhotoCaptureDelegate); + o = @protocol(AVCaptureVideoDataOutputSampleBufferDelegate); + o = @protocol(AVContentKeyRecipient); + o = @protocol(AVContentKeySessionDelegate); + o = @protocol(AVFragmentMinding); + o = @protocol(AVPlaybackCoordinatorPlaybackControlDelegate); + o = @protocol(AVPlayerItemLegibleOutputPushDelegate); + o = @protocol(AVPlayerItemMetadataCollectorPushDelegate); + o = @protocol(AVPlayerItemMetadataOutputPushDelegate); + o = @protocol(AVPlayerItemOutputPullDelegate); + o = @protocol(AVPlayerItemOutputPushDelegate); + o = @protocol(AVPlayerPlaybackCoordinatorDelegate); + o = @protocol(AVQueuedSampleBufferRendering); + o = @protocol(AVVideoCompositing); + o = @protocol(AVVideoCompositionValidationHandling); +} diff --git a/macos/avfoundation/queue_player.gen.go b/macos/avfoundation/queue_player.gen.go new file mode 100644 index 00000000..4547e2cf --- /dev/null +++ b/macos/avfoundation/queue_player.gen.go @@ -0,0 +1,182 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [QueuePlayer] class. +var QueuePlayerClass = _QueuePlayerClass{objc.GetClass("AVQueuePlayer")} + +type _QueuePlayerClass struct { + objc.Class +} + +// An interface definition for the [QueuePlayer] class. +type IQueuePlayer interface { + IPlayer + Items() []PlayerItem + RemoveAllItems() + RemoveItem(item IPlayerItem) + InitWithItems(items []IPlayerItem) QueuePlayer + CanInsertItemAfterItem(item IPlayerItem, afterItem IPlayerItem) bool + AdvanceToNextItem() + InsertItemAfterItem(item IPlayerItem, afterItem IPlayerItem) +} + +// An object that plays a sequence of player items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer?language=objc +type QueuePlayer struct { + Player +} + +func QueuePlayerFrom(ptr unsafe.Pointer) QueuePlayer { + return QueuePlayer{ + Player: PlayerFrom(ptr), + } +} + +func (qc _QueuePlayerClass) QueuePlayerWithItems(items []IPlayerItem) QueuePlayer { + rv := objc.Call[QueuePlayer](qc, objc.Sel("queuePlayerWithItems:"), items) + return rv +} + +// Returns an object that plays a queue of items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1538384-queueplayerwithitems?language=objc +func QueuePlayer_QueuePlayerWithItems(items []IPlayerItem) QueuePlayer { + return QueuePlayerClass.QueuePlayerWithItems(items) +} + +func (qc _QueuePlayerClass) Alloc() QueuePlayer { + rv := objc.Call[QueuePlayer](qc, objc.Sel("alloc")) + return rv +} + +func QueuePlayer_Alloc() QueuePlayer { + return QueuePlayerClass.Alloc() +} + +func (qc _QueuePlayerClass) New() QueuePlayer { + rv := objc.Call[QueuePlayer](qc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewQueuePlayer() QueuePlayer { + return QueuePlayerClass.New() +} + +func (q_ QueuePlayer) Init() QueuePlayer { + rv := objc.Call[QueuePlayer](q_, objc.Sel("init")) + return rv +} + +func (qc _QueuePlayerClass) PlayerWithPlayerItem(item IPlayerItem) QueuePlayer { + rv := objc.Call[QueuePlayer](qc, objc.Sel("playerWithPlayerItem:"), objc.Ptr(item)) + return rv +} + +// Returns a new player initialized to play the specified player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1538390-playerwithplayeritem?language=objc +func QueuePlayer_PlayerWithPlayerItem(item IPlayerItem) QueuePlayer { + return QueuePlayerClass.PlayerWithPlayerItem(item) +} + +func (q_ QueuePlayer) InitWithURL(URL foundation.IURL) QueuePlayer { + rv := objc.Call[QueuePlayer](q_, objc.Sel("initWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates a new player to play a single audiovisual resource referenced by a given URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1385706-initwithurl?language=objc +func NewQueuePlayerWithURL(URL foundation.IURL) QueuePlayer { + instance := QueuePlayerClass.Alloc().InitWithURL(URL) + instance.Autorelease() + return instance +} + +func (q_ QueuePlayer) InitWithPlayerItem(item IPlayerItem) QueuePlayer { + rv := objc.Call[QueuePlayer](q_, objc.Sel("initWithPlayerItem:"), objc.Ptr(item)) + return rv +} + +// Creates a new player to play the specified player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1387104-initwithplayeritem?language=objc +func NewQueuePlayerWithPlayerItem(item IPlayerItem) QueuePlayer { + instance := QueuePlayerClass.Alloc().InitWithPlayerItem(item) + instance.Autorelease() + return instance +} + +func (qc _QueuePlayerClass) PlayerWithURL(URL foundation.IURL) QueuePlayer { + rv := objc.Call[QueuePlayer](qc, objc.Sel("playerWithURL:"), objc.Ptr(URL)) + return rv +} + +// Returns a new player to play a single audiovisual resource referenced by a given URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avplayer/1538409-playerwithurl?language=objc +func QueuePlayer_PlayerWithURL(URL foundation.IURL) QueuePlayer { + return QueuePlayerClass.PlayerWithURL(URL) +} + +// Returns an array of the currently enqueued items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1390539-items?language=objc +func (q_ QueuePlayer) Items() []PlayerItem { + rv := objc.Call[[]PlayerItem](q_, objc.Sel("items")) + return rv +} + +// Removes all player items from the queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1385788-removeallitems?language=objc +func (q_ QueuePlayer) RemoveAllItems() { + objc.Call[objc.Void](q_, objc.Sel("removeAllItems")) +} + +// Removes a given player item from the queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1387400-removeitem?language=objc +func (q_ QueuePlayer) RemoveItem(item IPlayerItem) { + objc.Call[objc.Void](q_, objc.Sel("removeItem:"), objc.Ptr(item)) +} + +// Creates an object that plays a queue of items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1389345-initwithitems?language=objc +func (q_ QueuePlayer) InitWithItems(items []IPlayerItem) QueuePlayer { + rv := objc.Call[QueuePlayer](q_, objc.Sel("initWithItems:"), items) + return rv +} + +// Returns a Boolean value that indicates whether you can insert a player item into the player’s queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1387289-caninsertitem?language=objc +func (q_ QueuePlayer) CanInsertItemAfterItem(item IPlayerItem, afterItem IPlayerItem) bool { + rv := objc.Call[bool](q_, objc.Sel("canInsertItem:afterItem:"), objc.Ptr(item), objc.Ptr(afterItem)) + return rv +} + +// Ends playback of the current item and starts playback of the next item in the player’s queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1389318-advancetonextitem?language=objc +func (q_ QueuePlayer) AdvanceToNextItem() { + objc.Call[objc.Void](q_, objc.Sel("advanceToNextItem")) +} + +// Inserts a player item after another player item in the queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueueplayer/1388543-insertitem?language=objc +func (q_ QueuePlayer) InsertItemAfterItem(item IPlayerItem, afterItem IPlayerItem) { + objc.Call[objc.Void](q_, objc.Sel("insertItem:afterItem:"), objc.Ptr(item), objc.Ptr(afterItem)) +} diff --git a/macos/avfoundation/queued_sample_buffer_rendering.gen.go b/macos/avfoundation/queued_sample_buffer_rendering.gen.go new file mode 100644 index 00000000..ce8c8ec7 --- /dev/null +++ b/macos/avfoundation/queued_sample_buffer_rendering.gen.go @@ -0,0 +1,127 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// Methods you can implement to enqueue sample buffers for presentation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering?language=objc +type PQueuedSampleBufferRendering interface { + // optional + StopRequestingMediaData() + HasStopRequestingMediaData() bool + + // optional + RequestMediaDataWhenReadyOnQueueUsingBlock(queue dispatch.Queue, block func()) + HasRequestMediaDataWhenReadyOnQueueUsingBlock() bool + + // optional + Flush() + HasFlush() bool + + // optional + EnqueueSampleBuffer(sampleBuffer coremedia.SampleBufferRef) + HasEnqueueSampleBuffer() bool + + // optional + IsReadyForMoreMediaData() bool + HasIsReadyForMoreMediaData() bool + + // optional + Timebase() coremedia.TimebaseRef + HasTimebase() bool + + // optional + HasSufficientMediaDataForReliablePlaybackStart() bool + HasHasSufficientMediaDataForReliablePlaybackStart() bool +} + +// A concrete type wrapper for the [PQueuedSampleBufferRendering] protocol. +type QueuedSampleBufferRenderingWrapper struct { + objc.Object +} + +func (q_ QueuedSampleBufferRenderingWrapper) HasStopRequestingMediaData() bool { + return q_.RespondsToSelector(objc.Sel("stopRequestingMediaData")) +} + +// Cancels any current requestMediaDataWhenReadyOnQueue:usingBlock: call. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering/2867642-stoprequestingmediadata?language=objc +func (q_ QueuedSampleBufferRenderingWrapper) StopRequestingMediaData() { + objc.Call[objc.Void](q_, objc.Sel("stopRequestingMediaData")) +} + +func (q_ QueuedSampleBufferRenderingWrapper) HasRequestMediaDataWhenReadyOnQueueUsingBlock() bool { + return q_.RespondsToSelector(objc.Sel("requestMediaDataWhenReadyOnQueue:usingBlock:")) +} + +// Tells the target to invoke a client-supplied block in order to gather sample buffers for playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering/2867643-requestmediadatawhenreadyonqueue?language=objc +func (q_ QueuedSampleBufferRenderingWrapper) RequestMediaDataWhenReadyOnQueueUsingBlock(queue dispatch.Queue, block func()) { + objc.Call[objc.Void](q_, objc.Sel("requestMediaDataWhenReadyOnQueue:usingBlock:"), queue, block) +} + +func (q_ QueuedSampleBufferRenderingWrapper) HasFlush() bool { + return q_.RespondsToSelector(objc.Sel("flush")) +} + +// Discards all pending enqueued sample buffers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering/2867639-flush?language=objc +func (q_ QueuedSampleBufferRenderingWrapper) Flush() { + objc.Call[objc.Void](q_, objc.Sel("flush")) +} + +func (q_ QueuedSampleBufferRenderingWrapper) HasEnqueueSampleBuffer() bool { + return q_.RespondsToSelector(objc.Sel("enqueueSampleBuffer:")) +} + +// Sends a sample buffer to the queue for rendering. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering/2867641-enqueuesamplebuffer?language=objc +func (q_ QueuedSampleBufferRenderingWrapper) EnqueueSampleBuffer(sampleBuffer coremedia.SampleBufferRef) { + objc.Call[objc.Void](q_, objc.Sel("enqueueSampleBuffer:"), sampleBuffer) +} + +func (q_ QueuedSampleBufferRenderingWrapper) HasIsReadyForMoreMediaData() bool { + return q_.RespondsToSelector(objc.Sel("isReadyForMoreMediaData")) +} + +// A Boolean value that indicates whether the receiver is able to accept more sample buffers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering/2867638-readyformoremediadata?language=objc +func (q_ QueuedSampleBufferRenderingWrapper) IsReadyForMoreMediaData() bool { + rv := objc.Call[bool](q_, objc.Sel("isReadyForMoreMediaData")) + return rv +} + +func (q_ QueuedSampleBufferRenderingWrapper) HasTimebase() bool { + return q_.RespondsToSelector(objc.Sel("timebase")) +} + +// The timebase for a renderer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering/2867640-timebase?language=objc +func (q_ QueuedSampleBufferRenderingWrapper) Timebase() coremedia.TimebaseRef { + rv := objc.Call[coremedia.TimebaseRef](q_, objc.Sel("timebase")) + return rv +} + +func (q_ QueuedSampleBufferRenderingWrapper) HasHasSufficientMediaDataForReliablePlaybackStart() bool { + return q_.RespondsToSelector(objc.Sel("hasSufficientMediaDataForReliablePlaybackStart")) +} + +// A Boolean value that indicates whether the enqued media meets the required preroll level for reliable playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avqueuedsamplebufferrendering/3726153-hassufficientmediadataforreliabl?language=objc +func (q_ QueuedSampleBufferRenderingWrapper) HasSufficientMediaDataForReliablePlaybackStart() bool { + rv := objc.Call[bool](q_, objc.Sel("hasSufficientMediaDataForReliablePlaybackStart")) + return rv +} diff --git a/macos/avfoundation/route_detector.gen.go b/macos/avfoundation/route_detector.gen.go new file mode 100644 index 00000000..6590338b --- /dev/null +++ b/macos/avfoundation/route_detector.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RouteDetector] class. +var RouteDetectorClass = _RouteDetectorClass{objc.GetClass("AVRouteDetector")} + +type _RouteDetectorClass struct { + objc.Class +} + +// An interface definition for the [RouteDetector] class. +type IRouteDetector interface { + objc.IObject + MultipleRoutesDetected() bool + IsRouteDetectionEnabled() bool + SetRouteDetectionEnabled(value bool) +} + +// An object that detects available media playback routes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avroutedetector?language=objc +type RouteDetector struct { + objc.Object +} + +func RouteDetectorFrom(ptr unsafe.Pointer) RouteDetector { + return RouteDetector{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RouteDetectorClass) Alloc() RouteDetector { + rv := objc.Call[RouteDetector](rc, objc.Sel("alloc")) + return rv +} + +func RouteDetector_Alloc() RouteDetector { + return RouteDetectorClass.Alloc() +} + +func (rc _RouteDetectorClass) New() RouteDetector { + rv := objc.Call[RouteDetector](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRouteDetector() RouteDetector { + return RouteDetectorClass.New() +} + +func (r_ RouteDetector) Init() RouteDetector { + rv := objc.Call[RouteDetector](r_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the object detects more than one playback route. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avroutedetector/2915760-multipleroutesdetected?language=objc +func (r_ RouteDetector) MultipleRoutesDetected() bool { + rv := objc.Call[bool](r_, objc.Sel("multipleRoutesDetected")) + return rv +} + +// A Boolean value that indicates whether route detection is in an enabled state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avroutedetector/2915762-routedetectionenabled?language=objc +func (r_ RouteDetector) IsRouteDetectionEnabled() bool { + rv := objc.Call[bool](r_, objc.Sel("isRouteDetectionEnabled")) + return rv +} + +// A Boolean value that indicates whether route detection is in an enabled state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avroutedetector/2915762-routedetectionenabled?language=objc +func (r_ RouteDetector) SetRouteDetectionEnabled(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setRouteDetectionEnabled:"), value) +} diff --git a/macos/avfoundation/sample_buffer_audio_renderer.gen.go b/macos/avfoundation/sample_buffer_audio_renderer.gen.go new file mode 100644 index 00000000..2f33613a --- /dev/null +++ b/macos/avfoundation/sample_buffer_audio_renderer.gen.go @@ -0,0 +1,171 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SampleBufferAudioRenderer] class. +var SampleBufferAudioRendererClass = _SampleBufferAudioRendererClass{objc.GetClass("AVSampleBufferAudioRenderer")} + +type _SampleBufferAudioRendererClass struct { + objc.Class +} + +// An interface definition for the [SampleBufferAudioRenderer] class. +type ISampleBufferAudioRenderer interface { + objc.IObject + FlushFromSourceTimeCompletionHandler(time coremedia.Time, completionHandler func(flushSucceeded bool)) + AllowedAudioSpatializationFormats() AudioSpatializationFormats + SetAllowedAudioSpatializationFormats(value AudioSpatializationFormats) + Volume() float64 + SetVolume(value float64) + Error() foundation.Error + AudioTimePitchAlgorithm() AudioTimePitchAlgorithm + SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) + IsMuted() bool + SetMuted(value bool) + AudioOutputDeviceUniqueID() string + SetAudioOutputDeviceUniqueID(value string) + Status() QueuedSampleBufferRenderingStatus +} + +// An object used to decompress audio and play compressed or uncompressed audio. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer?language=objc +type SampleBufferAudioRenderer struct { + objc.Object +} + +func SampleBufferAudioRendererFrom(ptr unsafe.Pointer) SampleBufferAudioRenderer { + return SampleBufferAudioRenderer{ + Object: objc.ObjectFrom(ptr), + } +} + +func (sc _SampleBufferAudioRendererClass) Alloc() SampleBufferAudioRenderer { + rv := objc.Call[SampleBufferAudioRenderer](sc, objc.Sel("alloc")) + return rv +} + +func SampleBufferAudioRenderer_Alloc() SampleBufferAudioRenderer { + return SampleBufferAudioRendererClass.Alloc() +} + +func (sc _SampleBufferAudioRendererClass) New() SampleBufferAudioRenderer { + rv := objc.Call[SampleBufferAudioRenderer](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSampleBufferAudioRenderer() SampleBufferAudioRenderer { + return SampleBufferAudioRendererClass.New() +} + +func (s_ SampleBufferAudioRenderer) Init() SampleBufferAudioRenderer { + rv := objc.Call[SampleBufferAudioRenderer](s_, objc.Sel("init")) + return rv +} + +// Flushes queued sample buffers with presentation time stamps later than or equal to the specified time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866181-flushfromsourcetime?language=objc +func (s_ SampleBufferAudioRenderer) FlushFromSourceTimeCompletionHandler(time coremedia.Time, completionHandler func(flushSucceeded bool)) { + objc.Call[objc.Void](s_, objc.Sel("flushFromSourceTime:completionHandler:"), time, completionHandler) +} + +// The source audio channel layouts the audio renderer supports for spatialization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/3750310-allowedaudiospatializationformat?language=objc +func (s_ SampleBufferAudioRenderer) AllowedAudioSpatializationFormats() AudioSpatializationFormats { + rv := objc.Call[AudioSpatializationFormats](s_, objc.Sel("allowedAudioSpatializationFormats")) + return rv +} + +// The source audio channel layouts the audio renderer supports for spatialization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/3750310-allowedaudiospatializationformat?language=objc +func (s_ SampleBufferAudioRenderer) SetAllowedAudioSpatializationFormats(value AudioSpatializationFormats) { + objc.Call[objc.Void](s_, objc.Sel("setAllowedAudioSpatializationFormats:"), value) +} + +// The current audio volume for the audio renderer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866179-volume?language=objc +func (s_ SampleBufferAudioRenderer) Volume() float64 { + rv := objc.Call[float64](s_, objc.Sel("volume")) + return rv +} + +// The current audio volume for the audio renderer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866179-volume?language=objc +func (s_ SampleBufferAudioRenderer) SetVolume(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setVolume:"), value) +} + +// The error that caused the renderer to no longer render sample buffers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866178-error?language=objc +func (s_ SampleBufferAudioRenderer) Error() foundation.Error { + rv := objc.Call[foundation.Error](s_, objc.Sel("error")) + return rv +} + +// The processing algorithm used to manage audio pitch at different rates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866180-audiotimepitchalgorithm?language=objc +func (s_ SampleBufferAudioRenderer) AudioTimePitchAlgorithm() AudioTimePitchAlgorithm { + rv := objc.Call[AudioTimePitchAlgorithm](s_, objc.Sel("audioTimePitchAlgorithm")) + return rv +} + +// The processing algorithm used to manage audio pitch at different rates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866180-audiotimepitchalgorithm?language=objc +func (s_ SampleBufferAudioRenderer) SetAudioTimePitchAlgorithm(value AudioTimePitchAlgorithm) { + objc.Call[objc.Void](s_, objc.Sel("setAudioTimePitchAlgorithm:"), value) +} + +// A Boolean value that indicates whether audio for the renderer is in a muted state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866177-muted?language=objc +func (s_ SampleBufferAudioRenderer) IsMuted() bool { + rv := objc.Call[bool](s_, objc.Sel("isMuted")) + return rv +} + +// A Boolean value that indicates whether audio for the renderer is in a muted state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866177-muted?language=objc +func (s_ SampleBufferAudioRenderer) SetMuted(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setMuted:"), value) +} + +// The unique identifier of the output device used to play audio. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866182-audiooutputdeviceuniqueid?language=objc +func (s_ SampleBufferAudioRenderer) AudioOutputDeviceUniqueID() string { + rv := objc.Call[string](s_, objc.Sel("audioOutputDeviceUniqueID")) + return rv +} + +// The unique identifier of the output device used to play audio. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866182-audiooutputdeviceuniqueid?language=objc +func (s_ SampleBufferAudioRenderer) SetAudioOutputDeviceUniqueID(value string) { + objc.Call[objc.Void](s_, objc.Sel("setAudioOutputDeviceUniqueID:"), value) +} + +// The status of the audio renderer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferaudiorenderer/2866183-status?language=objc +func (s_ SampleBufferAudioRenderer) Status() QueuedSampleBufferRenderingStatus { + rv := objc.Call[QueuedSampleBufferRenderingStatus](s_, objc.Sel("status")) + return rv +} diff --git a/macos/avfoundation/sample_buffer_display_layer.gen.go b/macos/avfoundation/sample_buffer_display_layer.gen.go new file mode 100644 index 00000000..c3b037cd --- /dev/null +++ b/macos/avfoundation/sample_buffer_display_layer.gen.go @@ -0,0 +1,191 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SampleBufferDisplayLayer] class. +var SampleBufferDisplayLayerClass = _SampleBufferDisplayLayerClass{objc.GetClass("AVSampleBufferDisplayLayer")} + +type _SampleBufferDisplayLayerClass struct { + objc.Class +} + +// An interface definition for the [SampleBufferDisplayLayer] class. +type ISampleBufferDisplayLayer interface { + quartzcore.ILayer + VideoGravity() LayerVideoGravity + SetVideoGravity(value LayerVideoGravity) + OutputObscuredDueToInsufficientExternalProtection() bool + ControlTimebase() coremedia.TimebaseRef + SetControlTimebase(value coremedia.TimebaseRef) + PreventsCapture() bool + SetPreventsCapture(value bool) + PreventsDisplaySleepDuringVideoPlayback() bool + SetPreventsDisplaySleepDuringVideoPlayback(value bool) +} + +// An object that displays compressed or uncompressed video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer?language=objc +type SampleBufferDisplayLayer struct { + quartzcore.Layer +} + +func SampleBufferDisplayLayerFrom(ptr unsafe.Pointer) SampleBufferDisplayLayer { + return SampleBufferDisplayLayer{ + Layer: quartzcore.LayerFrom(ptr), + } +} + +func (sc _SampleBufferDisplayLayerClass) Alloc() SampleBufferDisplayLayer { + rv := objc.Call[SampleBufferDisplayLayer](sc, objc.Sel("alloc")) + return rv +} + +func SampleBufferDisplayLayer_Alloc() SampleBufferDisplayLayer { + return SampleBufferDisplayLayerClass.Alloc() +} + +func (sc _SampleBufferDisplayLayerClass) New() SampleBufferDisplayLayer { + rv := objc.Call[SampleBufferDisplayLayer](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSampleBufferDisplayLayer() SampleBufferDisplayLayer { + return SampleBufferDisplayLayerClass.New() +} + +func (s_ SampleBufferDisplayLayer) Init() SampleBufferDisplayLayer { + rv := objc.Call[SampleBufferDisplayLayer](s_, objc.Sel("init")) + return rv +} + +func (sc _SampleBufferDisplayLayerClass) Layer() SampleBufferDisplayLayer { + rv := objc.Call[SampleBufferDisplayLayer](sc, objc.Sel("layer")) + return rv +} + +// Creates and returns an instance of the layer object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410793-layer?language=objc +func SampleBufferDisplayLayer_Layer() SampleBufferDisplayLayer { + return SampleBufferDisplayLayerClass.Layer() +} + +func (s_ SampleBufferDisplayLayer) InitWithLayer(layer objc.IObject) SampleBufferDisplayLayer { + rv := objc.Call[SampleBufferDisplayLayer](s_, objc.Sel("initWithLayer:"), layer) + return rv +} + +// Override to copy or initialize custom fields of the specified layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410842-initwithlayer?language=objc +func NewSampleBufferDisplayLayerWithLayer(layer objc.IObject) SampleBufferDisplayLayer { + instance := SampleBufferDisplayLayerClass.Alloc().InitWithLayer(layer) + instance.Autorelease() + return instance +} + +func (s_ SampleBufferDisplayLayer) ModelLayer() SampleBufferDisplayLayer { + rv := objc.Call[SampleBufferDisplayLayer](s_, objc.Sel("modelLayer")) + return rv +} + +// Returns the model layer object associated with the receiver, if any. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410853-modellayer?language=objc +func SampleBufferDisplayLayer_ModelLayer() SampleBufferDisplayLayer { + instance := SampleBufferDisplayLayerClass.Alloc().ModelLayer() + instance.Autorelease() + return instance +} + +func (s_ SampleBufferDisplayLayer) PresentationLayer() SampleBufferDisplayLayer { + rv := objc.Call[SampleBufferDisplayLayer](s_, objc.Sel("presentationLayer")) + return rv +} + +// Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410744-presentationlayer?language=objc +func SampleBufferDisplayLayer_PresentationLayer() SampleBufferDisplayLayer { + instance := SampleBufferDisplayLayerClass.Alloc().PresentationLayer() + instance.Autorelease() + return instance +} + +// A string defining how the video is displayed within the bounds rect of a sample buffer display layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/1387625-videogravity?language=objc +func (s_ SampleBufferDisplayLayer) VideoGravity() LayerVideoGravity { + rv := objc.Call[LayerVideoGravity](s_, objc.Sel("videoGravity")) + return rv +} + +// A string defining how the video is displayed within the bounds rect of a sample buffer display layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/1387625-videogravity?language=objc +func (s_ SampleBufferDisplayLayer) SetVideoGravity(value LayerVideoGravity) { + objc.Call[objc.Void](s_, objc.Sel("setVideoGravity:"), value) +} + +// A Boolean value that indicates whether the system obscures decoded output due to insufficient external protection on the current device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/3726154-outputobscuredduetoinsufficiente?language=objc +func (s_ SampleBufferDisplayLayer) OutputObscuredDueToInsufficientExternalProtection() bool { + rv := objc.Call[bool](s_, objc.Sel("outputObscuredDueToInsufficientExternalProtection")) + return rv +} + +// The layer's control timebase, which governs how timestamps are interpreted. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/1390569-controltimebase?language=objc +func (s_ SampleBufferDisplayLayer) ControlTimebase() coremedia.TimebaseRef { + rv := objc.Call[coremedia.TimebaseRef](s_, objc.Sel("controlTimebase")) + return rv +} + +// The layer's control timebase, which governs how timestamps are interpreted. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/1390569-controltimebase?language=objc +func (s_ SampleBufferDisplayLayer) SetControlTimebase(value coremedia.TimebaseRef) { + objc.Call[objc.Void](s_, objc.Sel("setControlTimebase:"), value) +} + +// A Boolean value that indicates whether the layer protects against screen capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/3081651-preventscapture?language=objc +func (s_ SampleBufferDisplayLayer) PreventsCapture() bool { + rv := objc.Call[bool](s_, objc.Sel("preventsCapture")) + return rv +} + +// A Boolean value that indicates whether the layer protects against screen capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/3081651-preventscapture?language=objc +func (s_ SampleBufferDisplayLayer) SetPreventsCapture(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setPreventsCapture:"), value) +} + +// A Boolean value that indicates whether the layer prevents the system from sleeping during video playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/3088800-preventsdisplaysleepduringvideop?language=objc +func (s_ SampleBufferDisplayLayer) PreventsDisplaySleepDuringVideoPlayback() bool { + rv := objc.Call[bool](s_, objc.Sel("preventsDisplaySleepDuringVideoPlayback")) + return rv +} + +// A Boolean value that indicates whether the layer prevents the system from sleeping during video playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer/3088800-preventsdisplaysleepduringvideop?language=objc +func (s_ SampleBufferDisplayLayer) SetPreventsDisplaySleepDuringVideoPlayback(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setPreventsDisplaySleepDuringVideoPlayback:"), value) +} diff --git a/macos/avfoundation/sample_buffer_generator.gen.go b/macos/avfoundation/sample_buffer_generator.gen.go new file mode 100644 index 00000000..bed47b5e --- /dev/null +++ b/macos/avfoundation/sample_buffer_generator.gen.go @@ -0,0 +1,88 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SampleBufferGenerator] class. +var SampleBufferGeneratorClass = _SampleBufferGeneratorClass{objc.GetClass("AVSampleBufferGenerator")} + +type _SampleBufferGeneratorClass struct { + objc.Class +} + +// An interface definition for the [SampleBufferGenerator] class. +type ISampleBufferGenerator interface { + objc.IObject +} + +// An object that creates sample buffers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebuffergenerator?language=objc +type SampleBufferGenerator struct { + objc.Object +} + +func SampleBufferGeneratorFrom(ptr unsafe.Pointer) SampleBufferGenerator { + return SampleBufferGenerator{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ SampleBufferGenerator) InitWithAssetTimebase(asset IAsset, timebase coremedia.TimebaseRef) SampleBufferGenerator { + rv := objc.Call[SampleBufferGenerator](s_, objc.Sel("initWithAsset:timebase:"), objc.Ptr(asset), timebase) + return rv +} + +// Creates a new sample buffer generator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebuffergenerator/1387477-initwithasset?language=objc +func NewSampleBufferGeneratorWithAssetTimebase(asset IAsset, timebase coremedia.TimebaseRef) SampleBufferGenerator { + instance := SampleBufferGeneratorClass.Alloc().InitWithAssetTimebase(asset, timebase) + instance.Autorelease() + return instance +} + +func (sc _SampleBufferGeneratorClass) Alloc() SampleBufferGenerator { + rv := objc.Call[SampleBufferGenerator](sc, objc.Sel("alloc")) + return rv +} + +func SampleBufferGenerator_Alloc() SampleBufferGenerator { + return SampleBufferGeneratorClass.Alloc() +} + +func (sc _SampleBufferGeneratorClass) New() SampleBufferGenerator { + rv := objc.Call[SampleBufferGenerator](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSampleBufferGenerator() SampleBufferGenerator { + return SampleBufferGeneratorClass.New() +} + +func (s_ SampleBufferGenerator) Init() SampleBufferGenerator { + rv := objc.Call[SampleBufferGenerator](s_, objc.Sel("init")) + return rv +} + +// Notifies the sample buffer generator when data is ready for the sample buffer reference or an error has occurred. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebuffergenerator/1387295-notifyofdatareadyforsamplebuffer?language=objc +func (sc _SampleBufferGeneratorClass) NotifyOfDataReadyForSampleBufferCompletionHandler(sbuf coremedia.SampleBufferRef, completionHandler func(dataReady bool, error foundation.Error)) { + objc.Call[objc.Void](sc, objc.Sel("notifyOfDataReadyForSampleBuffer:completionHandler:"), sbuf, completionHandler) +} + +// Notifies the sample buffer generator when data is ready for the sample buffer reference or an error has occurred. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebuffergenerator/1387295-notifyofdatareadyforsamplebuffer?language=objc +func SampleBufferGenerator_NotifyOfDataReadyForSampleBufferCompletionHandler(sbuf coremedia.SampleBufferRef, completionHandler func(dataReady bool, error foundation.Error)) { + SampleBufferGeneratorClass.NotifyOfDataReadyForSampleBufferCompletionHandler(sbuf, completionHandler) +} diff --git a/macos/avfoundation/sample_buffer_render_synchronizer.gen.go b/macos/avfoundation/sample_buffer_render_synchronizer.gen.go new file mode 100644 index 00000000..18a07808 --- /dev/null +++ b/macos/avfoundation/sample_buffer_render_synchronizer.gen.go @@ -0,0 +1,190 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SampleBufferRenderSynchronizer] class. +var SampleBufferRenderSynchronizerClass = _SampleBufferRenderSynchronizerClass{objc.GetClass("AVSampleBufferRenderSynchronizer")} + +type _SampleBufferRenderSynchronizerClass struct { + objc.Class +} + +// An interface definition for the [SampleBufferRenderSynchronizer] class. +type ISampleBufferRenderSynchronizer interface { + objc.IObject + RemoveTimeObserver(observer objc.IObject) + SetRateTimeAtHostTime(rate float64, time coremedia.Time, hostTime coremedia.Time) + AddBoundaryTimeObserverForTimesQueueUsingBlock(times []foundation.IValue, queue dispatch.Queue, block func()) objc.Object + AddPeriodicTimeObserverForIntervalQueueUsingBlock(interval coremedia.Time, queue dispatch.Queue, block func(time coremedia.Time)) objc.Object + RemoveRendererAtTimeCompletionHandler(renderer PQueuedSampleBufferRendering, time coremedia.Time, completionHandler func(didRemoveRenderer bool)) + RemoveRendererObjectAtTimeCompletionHandler(rendererObject objc.IObject, time coremedia.Time, completionHandler func(didRemoveRenderer bool)) + AddRenderer(renderer PQueuedSampleBufferRendering) + AddRendererObject(rendererObject objc.IObject) + CurrentTime() coremedia.Time + DelaysRateChangeUntilHasSufficientMediaData() bool + SetDelaysRateChangeUntilHasSufficientMediaData(value bool) + Rate() float64 + SetRate(value float64) + Timebase() coremedia.TimebaseRef + Renderers() []QueuedSampleBufferRenderingWrapper +} + +// An object used to synchronize multiple queued sample buffers to a single timeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer?language=objc +type SampleBufferRenderSynchronizer struct { + objc.Object +} + +func SampleBufferRenderSynchronizerFrom(ptr unsafe.Pointer) SampleBufferRenderSynchronizer { + return SampleBufferRenderSynchronizer{ + Object: objc.ObjectFrom(ptr), + } +} + +func (sc _SampleBufferRenderSynchronizerClass) Alloc() SampleBufferRenderSynchronizer { + rv := objc.Call[SampleBufferRenderSynchronizer](sc, objc.Sel("alloc")) + return rv +} + +func SampleBufferRenderSynchronizer_Alloc() SampleBufferRenderSynchronizer { + return SampleBufferRenderSynchronizerClass.Alloc() +} + +func (sc _SampleBufferRenderSynchronizerClass) New() SampleBufferRenderSynchronizer { + rv := objc.Call[SampleBufferRenderSynchronizer](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSampleBufferRenderSynchronizer() SampleBufferRenderSynchronizer { + return SampleBufferRenderSynchronizerClass.New() +} + +func (s_ SampleBufferRenderSynchronizer) Init() SampleBufferRenderSynchronizer { + rv := objc.Call[SampleBufferRenderSynchronizer](s_, objc.Sel("init")) + return rv +} + +// Cancels the specified time observer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867829-removetimeobserver?language=objc +func (s_ SampleBufferRenderSynchronizer) RemoveTimeObserver(observer objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("removeTimeObserver:"), observer) +} + +// Sets the playback rate and the relationship between the current time and host time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/3726157-setrate?language=objc +func (s_ SampleBufferRenderSynchronizer) SetRateTimeAtHostTime(rate float64, time coremedia.Time, hostTime coremedia.Time) { + objc.Call[objc.Void](s_, objc.Sel("setRate:time:atHostTime:"), rate, time, hostTime) +} + +// Requests invocation of a block when specified times are traversed during normal rendering. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867824-addboundarytimeobserverfortimes?language=objc +func (s_ SampleBufferRenderSynchronizer) AddBoundaryTimeObserverForTimesQueueUsingBlock(times []foundation.IValue, queue dispatch.Queue, block func()) objc.Object { + rv := objc.Call[objc.Object](s_, objc.Sel("addBoundaryTimeObserverForTimes:queue:usingBlock:"), times, queue, block) + return rv +} + +// Requests invocation of a block during rendering at specified time intervals. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867825-addperiodictimeobserverforinterv?language=objc +func (s_ SampleBufferRenderSynchronizer) AddPeriodicTimeObserverForIntervalQueueUsingBlock(interval coremedia.Time, queue dispatch.Queue, block func(time coremedia.Time)) objc.Object { + rv := objc.Call[objc.Object](s_, objc.Sel("addPeriodicTimeObserverForInterval:queue:usingBlock:"), interval, queue, block) + return rv +} + +// Removes a renderer from the synchronizer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867826-removerenderer?language=objc +func (s_ SampleBufferRenderSynchronizer) RemoveRendererAtTimeCompletionHandler(renderer PQueuedSampleBufferRendering, time coremedia.Time, completionHandler func(didRemoveRenderer bool)) { + po0 := objc.WrapAsProtocol("AVQueuedSampleBufferRendering", renderer) + objc.Call[objc.Void](s_, objc.Sel("removeRenderer:atTime:completionHandler:"), po0, time, completionHandler) +} + +// Removes a renderer from the synchronizer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867826-removerenderer?language=objc +func (s_ SampleBufferRenderSynchronizer) RemoveRendererObjectAtTimeCompletionHandler(rendererObject objc.IObject, time coremedia.Time, completionHandler func(didRemoveRenderer bool)) { + objc.Call[objc.Void](s_, objc.Sel("removeRenderer:atTime:completionHandler:"), objc.Ptr(rendererObject), time, completionHandler) +} + +// Adds a renderer to the list of renderers under the synchronizer's control. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867828-addrenderer?language=objc +func (s_ SampleBufferRenderSynchronizer) AddRenderer(renderer PQueuedSampleBufferRendering) { + po0 := objc.WrapAsProtocol("AVQueuedSampleBufferRendering", renderer) + objc.Call[objc.Void](s_, objc.Sel("addRenderer:"), po0) +} + +// Adds a renderer to the list of renderers under the synchronizer's control. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867828-addrenderer?language=objc +func (s_ SampleBufferRenderSynchronizer) AddRendererObject(rendererObject objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("addRenderer:"), objc.Ptr(rendererObject)) +} + +// Returns the current time of the synchronizer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/3022467-currenttime?language=objc +func (s_ SampleBufferRenderSynchronizer) CurrentTime() coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("currentTime")) + return rv +} + +// A Boolean value that Indicates whether the playback should start immediately on rate change requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/3726156-delaysratechangeuntilhassufficie?language=objc +func (s_ SampleBufferRenderSynchronizer) DelaysRateChangeUntilHasSufficientMediaData() bool { + rv := objc.Call[bool](s_, objc.Sel("delaysRateChangeUntilHasSufficientMediaData")) + return rv +} + +// A Boolean value that Indicates whether the playback should start immediately on rate change requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/3726156-delaysratechangeuntilhassufficie?language=objc +func (s_ SampleBufferRenderSynchronizer) SetDelaysRateChangeUntilHasSufficientMediaData(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setDelaysRateChangeUntilHasSufficientMediaData:"), value) +} + +// The current playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867823-rate?language=objc +func (s_ SampleBufferRenderSynchronizer) Rate() float64 { + rv := objc.Call[float64](s_, objc.Sel("rate")) + return rv +} + +// The current playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867823-rate?language=objc +func (s_ SampleBufferRenderSynchronizer) SetRate(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setRate:"), value) +} + +// The synchronizer’s rendering timebase which determines how it interprets timestamps. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867822-timebase?language=objc +func (s_ SampleBufferRenderSynchronizer) Timebase() coremedia.TimebaseRef { + rv := objc.Call[coremedia.TimebaseRef](s_, objc.Sel("timebase")) + return rv +} + +// An array of queued sample buffer renderers currently attached to the synchronizer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrendersynchronizer/2867827-renderers?language=objc +func (s_ SampleBufferRenderSynchronizer) Renderers() []QueuedSampleBufferRenderingWrapper { + rv := objc.Call[[]QueuedSampleBufferRenderingWrapper](s_, objc.Sel("renderers")) + return rv +} diff --git a/macos/avfoundation/sample_buffer_request.gen.go b/macos/avfoundation/sample_buffer_request.gen.go new file mode 100644 index 00000000..711b9364 --- /dev/null +++ b/macos/avfoundation/sample_buffer_request.gen.go @@ -0,0 +1,184 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SampleBufferRequest] class. +var SampleBufferRequestClass = _SampleBufferRequestClass{objc.GetClass("AVSampleBufferRequest")} + +type _SampleBufferRequestClass struct { + objc.Class +} + +// An interface definition for the [SampleBufferRequest] class. +type ISampleBufferRequest interface { + objc.IObject + Direction() SampleBufferRequestDirection + SetDirection(value SampleBufferRequestDirection) + LimitCursor() SampleCursor + SetLimitCursor(value ISampleCursor) + PreferredMinSampleCount() int + SetPreferredMinSampleCount(value int) + MaxSampleCount() int + SetMaxSampleCount(value int) + OverrideTime() coremedia.Time + SetOverrideTime(value coremedia.Time) + Mode() SampleBufferRequestMode + SetMode(value SampleBufferRequestMode) + StartCursor() SampleCursor +} + +// An object that describes a sample buffer creation request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest?language=objc +type SampleBufferRequest struct { + objc.Object +} + +func SampleBufferRequestFrom(ptr unsafe.Pointer) SampleBufferRequest { + return SampleBufferRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ SampleBufferRequest) InitWithStartCursor(startCursor ISampleCursor) SampleBufferRequest { + rv := objc.Call[SampleBufferRequest](s_, objc.Sel("initWithStartCursor:"), objc.Ptr(startCursor)) + return rv +} + +// Creates a newly allocated sample buffer request with the specified sample cursor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1387449-initwithstartcursor?language=objc +func NewSampleBufferRequestWithStartCursor(startCursor ISampleCursor) SampleBufferRequest { + instance := SampleBufferRequestClass.Alloc().InitWithStartCursor(startCursor) + instance.Autorelease() + return instance +} + +func (sc _SampleBufferRequestClass) Alloc() SampleBufferRequest { + rv := objc.Call[SampleBufferRequest](sc, objc.Sel("alloc")) + return rv +} + +func SampleBufferRequest_Alloc() SampleBufferRequest { + return SampleBufferRequestClass.Alloc() +} + +func (sc _SampleBufferRequestClass) New() SampleBufferRequest { + rv := objc.Call[SampleBufferRequest](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSampleBufferRequest() SampleBufferRequest { + return SampleBufferRequestClass.New() +} + +func (s_ SampleBufferRequest) Init() SampleBufferRequest { + rv := objc.Call[SampleBufferRequest](s_, objc.Sel("init")) + return rv +} + +// The buffer sample direction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1386442-direction?language=objc +func (s_ SampleBufferRequest) Direction() SampleBufferRequestDirection { + rv := objc.Call[SampleBufferRequestDirection](s_, objc.Sel("direction")) + return rv +} + +// The buffer sample direction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1386442-direction?language=objc +func (s_ SampleBufferRequest) SetDirection(value SampleBufferRequestDirection) { + objc.Call[objc.Void](s_, objc.Sel("setDirection:"), value) +} + +// The limiting position for sample loading. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1387466-limitcursor?language=objc +func (s_ SampleBufferRequest) LimitCursor() SampleCursor { + rv := objc.Call[SampleCursor](s_, objc.Sel("limitCursor")) + return rv +} + +// The limiting position for sample loading. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1387466-limitcursor?language=objc +func (s_ SampleBufferRequest) SetLimitCursor(value ISampleCursor) { + objc.Call[objc.Void](s_, objc.Sel("setLimitCursor:"), objc.Ptr(value)) +} + +// The preferred minimum number of samples to load. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1386251-preferredminsamplecount?language=objc +func (s_ SampleBufferRequest) PreferredMinSampleCount() int { + rv := objc.Call[int](s_, objc.Sel("preferredMinSampleCount")) + return rv +} + +// The preferred minimum number of samples to load. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1386251-preferredminsamplecount?language=objc +func (s_ SampleBufferRequest) SetPreferredMinSampleCount(value int) { + objc.Call[objc.Void](s_, objc.Sel("setPreferredMinSampleCount:"), value) +} + +// The maximum number of samples to load. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1385645-maxsamplecount?language=objc +func (s_ SampleBufferRequest) MaxSampleCount() int { + rv := objc.Call[int](s_, objc.Sel("maxSampleCount")) + return rv +} + +// The maximum number of samples to load. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1385645-maxsamplecount?language=objc +func (s_ SampleBufferRequest) SetMaxSampleCount(value int) { + objc.Call[objc.Void](s_, objc.Sel("setMaxSampleCount:"), value) +} + +// The deadline for sample data and output PTS for the sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1385790-overridetime?language=objc +func (s_ SampleBufferRequest) OverrideTime() coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("overrideTime")) + return rv +} + +// The deadline for sample data and output PTS for the sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1385790-overridetime?language=objc +func (s_ SampleBufferRequest) SetOverrideTime(value coremedia.Time) { + objc.Call[objc.Void](s_, objc.Sel("setOverrideTime:"), value) +} + +// The sample buffer request mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1387463-mode?language=objc +func (s_ SampleBufferRequest) Mode() SampleBufferRequestMode { + rv := objc.Call[SampleBufferRequestMode](s_, objc.Sel("mode")) + return rv +} + +// The sample buffer request mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1387463-mode?language=objc +func (s_ SampleBufferRequest) SetMode(value SampleBufferRequestMode) { + objc.Call[objc.Void](s_, objc.Sel("setMode:"), value) +} + +// The starting cursor position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplebufferrequest/1387398-startcursor?language=objc +func (s_ SampleBufferRequest) StartCursor() SampleCursor { + rv := objc.Call[SampleCursor](s_, objc.Sel("startCursor")) + return rv +} diff --git a/macos/avfoundation/sample_cursor.gen.go b/macos/avfoundation/sample_cursor.gen.go new file mode 100644 index 00000000..49a500a3 --- /dev/null +++ b/macos/avfoundation/sample_cursor.gen.go @@ -0,0 +1,249 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SampleCursor] class. +var SampleCursorClass = _SampleCursorClass{objc.GetClass("AVSampleCursor")} + +type _SampleCursorClass struct { + objc.Class +} + +// An interface definition for the [SampleCursor] class. +type ISampleCursor interface { + objc.IObject + StepInPresentationOrderByCount(stepCount int64) int64 + StepInDecodeOrderByCount(stepCount int64) int64 + SamplesWithLaterDecodeTimeStampsMayHaveEarlierPresentationTimeStampsThanCursor(cursor ISampleCursor) bool + StepByDecodeTimeWasPinned(deltaDecodeTime coremedia.Time, outWasPinned *bool) coremedia.Time + ComparePositionInDecodeOrderWithPositionOfCursor(cursor ISampleCursor) foundation.ComparisonResult + CopyCurrentSampleFormatDescription() coremedia.FormatDescriptionRef + StepByPresentationTimeWasPinned(deltaPresentationTime coremedia.Time, outWasPinned *bool) coremedia.Time + SamplesWithEarlierDecodeTimeStampsMayHaveLaterPresentationTimeStampsThanCursor(cursor ISampleCursor) bool + CurrentChunkStorageRange() SampleCursorStorageRange + DecodeTimeStamp() coremedia.Time + CurrentSampleSyncInfo() SampleCursorSyncInfo + CurrentChunkInfo() SampleCursorChunkInfo + CurrentSampleDuration() coremedia.Time + SamplesRequiredForDecoderRefresh() int + CurrentSampleStorageRange() SampleCursorStorageRange + PresentationTimeStamp() coremedia.Time + CurrentSampleDependencyInfo() SampleCursorDependencyInfo + CurrentSampleDependencyAttachments() foundation.Dictionary + CurrentSampleIndexInChunk() int64 + CurrentSampleAudioDependencyInfo() SampleCursorAudioDependencyInfo + CurrentChunkStorageURL() foundation.URL +} + +// An object that provides information about the media sample at the cursor’s current position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor?language=objc +type SampleCursor struct { + objc.Object +} + +func SampleCursorFrom(ptr unsafe.Pointer) SampleCursor { + return SampleCursor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (sc _SampleCursorClass) Alloc() SampleCursor { + rv := objc.Call[SampleCursor](sc, objc.Sel("alloc")) + return rv +} + +func SampleCursor_Alloc() SampleCursor { + return SampleCursorClass.Alloc() +} + +func (sc _SampleCursorClass) New() SampleCursor { + rv := objc.Call[SampleCursor](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSampleCursor() SampleCursor { + return SampleCursorClass.New() +} + +func (s_ SampleCursor) Init() SampleCursor { + rv := objc.Call[SampleCursor](s_, objc.Sel("init")) + return rv +} + +// Moves the cursor a given number of samples in presentation order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1388834-stepinpresentationorderbycount?language=objc +func (s_ SampleCursor) StepInPresentationOrderByCount(stepCount int64) int64 { + rv := objc.Call[int64](s_, objc.Sel("stepInPresentationOrderByCount:"), stepCount) + return rv +} + +// Moves the cursor a given number of samples in decode order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1389606-stepindecodeorderbycount?language=objc +func (s_ SampleCursor) StepInDecodeOrderByCount(stepCount int64) int64 { + rv := objc.Call[int64](s_, objc.Sel("stepInDecodeOrderByCount:"), stepCount) + return rv +} + +// Determines whether a sample later in decode order can have a presentation timestamp earlier than that of the specified sample cursor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1390029-sampleswithlaterdecodetimestamps?language=objc +func (s_ SampleCursor) SamplesWithLaterDecodeTimeStampsMayHaveEarlierPresentationTimeStampsThanCursor(cursor ISampleCursor) bool { + rv := objc.Call[bool](s_, objc.Sel("samplesWithLaterDecodeTimeStampsMayHaveEarlierPresentationTimeStampsThanCursor:"), objc.Ptr(cursor)) + return rv +} + +// Moves the cursor by a given delta time on the decode timeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1389152-stepbydecodetime?language=objc +func (s_ SampleCursor) StepByDecodeTimeWasPinned(deltaDecodeTime coremedia.Time, outWasPinned *bool) coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("stepByDecodeTime:wasPinned:"), deltaDecodeTime, outWasPinned) + return rv +} + +// Compares the relative positions of two sample cursors and returns their relative positions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1390608-comparepositionindecodeorderwith?language=objc +func (s_ SampleCursor) ComparePositionInDecodeOrderWithPositionOfCursor(cursor ISampleCursor) foundation.ComparisonResult { + rv := objc.Call[foundation.ComparisonResult](s_, objc.Sel("comparePositionInDecodeOrderWithPositionOfCursor:"), objc.Ptr(cursor)) + return rv +} + +// Returns the format description of the sample at the cursor’s current position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1390703-copycurrentsampleformatdescripti?language=objc +func (s_ SampleCursor) CopyCurrentSampleFormatDescription() coremedia.FormatDescriptionRef { + rv := objc.Call[coremedia.FormatDescriptionRef](s_, objc.Sel("copyCurrentSampleFormatDescription")) + return rv +} + +// Moves the cursor by a given delta time on the presentation timeline. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1387680-stepbypresentationtime?language=objc +func (s_ SampleCursor) StepByPresentationTimeWasPinned(deltaPresentationTime coremedia.Time, outWasPinned *bool) coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("stepByPresentationTime:wasPinned:"), deltaPresentationTime, outWasPinned) + return rv +} + +// Determines whether a sample earlier in decode order can have a presentation timestamp later than that of the specified sample cursor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1386558-sampleswithearlierdecodetimestam?language=objc +func (s_ SampleCursor) SamplesWithEarlierDecodeTimeStampsMayHaveLaterPresentationTimeStampsThanCursor(cursor ISampleCursor) bool { + rv := objc.Call[bool](s_, objc.Sel("samplesWithEarlierDecodeTimeStampsMayHaveLaterPresentationTimeStampsThanCursor:"), objc.Ptr(cursor)) + return rv +} + +// The sample range in the storage container to load together with the current sample as a chunk. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1390385-currentchunkstoragerange?language=objc +func (s_ SampleCursor) CurrentChunkStorageRange() SampleCursorStorageRange { + rv := objc.Call[SampleCursorStorageRange](s_, objc.Sel("currentChunkStorageRange")) + return rv +} + +// The decode timestamp of the sample at the current position of the cursor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1388412-decodetimestamp?language=objc +func (s_ SampleCursor) DecodeTimeStamp() coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("decodeTimeStamp")) + return rv +} + +// The synchronization information for the current sample for consideration when resynchronizing a decoder. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1390776-currentsamplesyncinfo?language=objc +func (s_ SampleCursor) CurrentSampleSyncInfo() SampleCursorSyncInfo { + rv := objc.Call[SampleCursorSyncInfo](s_, objc.Sel("currentSampleSyncInfo")) + return rv +} + +// A value that provides information about the chunk of samples to which the current sample belongs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1387481-currentchunkinfo?language=objc +func (s_ SampleCursor) CurrentChunkInfo() SampleCursorChunkInfo { + rv := objc.Call[SampleCursorChunkInfo](s_, objc.Sel("currentChunkInfo")) + return rv +} + +// The decode duration of the sample at the cursor’s current position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1389833-currentsampleduration?language=objc +func (s_ SampleCursor) CurrentSampleDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("currentSampleDuration")) + return rv +} + +// The number of samples prior to the current sample, in decode order, the decoder requires to achieve a coherent output at the current decode time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1386446-samplesrequiredfordecoderrefresh?language=objc +func (s_ SampleCursor) SamplesRequiredForDecoderRefresh() int { + rv := objc.Call[int](s_, objc.Sel("samplesRequiredForDecoderRefresh")) + return rv +} + +// The offset and length of the current sample in the current chunk storage URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1386359-currentsamplestoragerange?language=objc +func (s_ SampleCursor) CurrentSampleStorageRange() SampleCursorStorageRange { + rv := objc.Call[SampleCursorStorageRange](s_, objc.Sel("currentSampleStorageRange")) + return rv +} + +// The presentation timestamp of the sample at the current position of the cursor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1389740-presentationtimestamp?language=objc +func (s_ SampleCursor) PresentationTimeStamp() coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("presentationTimeStamp")) + return rv +} + +// The dependency information that describes relationships between a media sample and other media samples in the same sample sequence. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1390766-currentsampledependencyinfo?language=objc +func (s_ SampleCursor) CurrentSampleDependencyInfo() SampleCursorDependencyInfo { + rv := objc.Call[SampleCursorDependencyInfo](s_, objc.Sel("currentSampleDependencyInfo")) + return rv +} + +// A dictionary of dependency-related sample buffer attachments. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/3752983-currentsampledependencyattachmen?language=objc +func (s_ SampleCursor) CurrentSampleDependencyAttachments() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](s_, objc.Sel("currentSampleDependencyAttachments")) + return rv +} + +// The index of the current sample within the chunk to which it belongs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1387806-currentsampleindexinchunk?language=objc +func (s_ SampleCursor) CurrentSampleIndexInChunk() int64 { + rv := objc.Call[int64](s_, objc.Sel("currentSampleIndexInChunk")) + return rv +} + +// The independent decodability information for the audio sample. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/3131266-currentsampleaudiodependencyinfo?language=objc +func (s_ SampleCursor) CurrentSampleAudioDependencyInfo() SampleCursorAudioDependencyInfo { + rv := objc.Call[SampleCursorAudioDependencyInfo](s_, objc.Sel("currentSampleAudioDependencyInfo")) + return rv +} + +// The URL of the storage container of the current sample and other samples to load in the same operation as a chunk. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsamplecursor/1388328-currentchunkstorageurl?language=objc +func (s_ SampleCursor) CurrentChunkStorageURL() foundation.URL { + rv := objc.Call[foundation.URL](s_, objc.Sel("currentChunkStorageURL")) + return rv +} diff --git a/macos/avfoundation/semantic_segmentation_matte.gen.go b/macos/avfoundation/semantic_segmentation_matte.gen.go new file mode 100644 index 00000000..9438b646 --- /dev/null +++ b/macos/avfoundation/semantic_segmentation_matte.gen.go @@ -0,0 +1,138 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corefoundation" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/imageio" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SemanticSegmentationMatte] class. +var SemanticSegmentationMatteClass = _SemanticSegmentationMatteClass{objc.GetClass("AVSemanticSegmentationMatte")} + +type _SemanticSegmentationMatteClass struct { + objc.Class +} + +// An interface definition for the [SemanticSegmentationMatte] class. +type ISemanticSegmentationMatte interface { + objc.IObject + DictionaryRepresentationForAuxiliaryDataType(outAuxDataType string) foundation.Dictionary + MatteType() SemanticSegmentationMatteType + PixelFormatType() uint + MattingImage() corevideo.PixelBufferRef +} + +// An object that wraps a matting image for a particular semantic segmentation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte?language=objc +type SemanticSegmentationMatte struct { + objc.Object +} + +func SemanticSegmentationMatteFrom(ptr unsafe.Pointer) SemanticSegmentationMatte { + return SemanticSegmentationMatte{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ SemanticSegmentationMatte) SemanticSegmentationMatteByApplyingExifOrientation(exifOrientation imageio.ImagePropertyOrientation) SemanticSegmentationMatte { + rv := objc.Call[SemanticSegmentationMatte](s_, objc.Sel("semanticSegmentationMatteByApplyingExifOrientation:"), exifOrientation) + return rv +} + +// Returns a new semantic segmentation matte instance with the specified Exif orientation applied. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte/3152122-semanticsegmentationmattebyapply?language=objc +func SemanticSegmentationMatte_SemanticSegmentationMatteByApplyingExifOrientation(exifOrientation imageio.ImagePropertyOrientation) SemanticSegmentationMatte { + instance := SemanticSegmentationMatteClass.Alloc().SemanticSegmentationMatteByApplyingExifOrientation(exifOrientation) + instance.Autorelease() + return instance +} + +func (s_ SemanticSegmentationMatte) SemanticSegmentationMatteByReplacingSemanticSegmentationMatteWithPixelBufferError(pixelBuffer corevideo.PixelBufferRef, outError foundation.IError) SemanticSegmentationMatte { + rv := objc.Call[SemanticSegmentationMatte](s_, objc.Sel("semanticSegmentationMatteByReplacingSemanticSegmentationMatteWithPixelBuffer:error:"), pixelBuffer, objc.Ptr(outError)) + return rv +} + +// Returns a semantic segmentation matte instance that wraps the replacement pixel buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte/3152123-semanticsegmentationmattebyrepla?language=objc +func SemanticSegmentationMatte_SemanticSegmentationMatteByReplacingSemanticSegmentationMatteWithPixelBufferError(pixelBuffer corevideo.PixelBufferRef, outError foundation.IError) SemanticSegmentationMatte { + instance := SemanticSegmentationMatteClass.Alloc().SemanticSegmentationMatteByReplacingSemanticSegmentationMatteWithPixelBufferError(pixelBuffer, outError) + instance.Autorelease() + return instance +} + +func (sc _SemanticSegmentationMatteClass) SemanticSegmentationMatteFromImageSourceAuxiliaryDataTypeDictionaryRepresentationError(imageSourceAuxiliaryDataType corefoundation.StringRef, imageSourceAuxiliaryDataInfoDictionary foundation.Dictionary, outError foundation.IError) SemanticSegmentationMatte { + rv := objc.Call[SemanticSegmentationMatte](sc, objc.Sel("semanticSegmentationMatteFromImageSourceAuxiliaryDataType:dictionaryRepresentation:error:"), imageSourceAuxiliaryDataType, imageSourceAuxiliaryDataInfoDictionary, objc.Ptr(outError)) + return rv +} + +// Returns a new semantic segmentation matte instance from auxiliary image information in an image file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte/3152124-semanticsegmentationmattefromima?language=objc +func SemanticSegmentationMatte_SemanticSegmentationMatteFromImageSourceAuxiliaryDataTypeDictionaryRepresentationError(imageSourceAuxiliaryDataType corefoundation.StringRef, imageSourceAuxiliaryDataInfoDictionary foundation.Dictionary, outError foundation.IError) SemanticSegmentationMatte { + return SemanticSegmentationMatteClass.SemanticSegmentationMatteFromImageSourceAuxiliaryDataTypeDictionaryRepresentationError(imageSourceAuxiliaryDataType, imageSourceAuxiliaryDataInfoDictionary, outError) +} + +func (sc _SemanticSegmentationMatteClass) Alloc() SemanticSegmentationMatte { + rv := objc.Call[SemanticSegmentationMatte](sc, objc.Sel("alloc")) + return rv +} + +func SemanticSegmentationMatte_Alloc() SemanticSegmentationMatte { + return SemanticSegmentationMatteClass.Alloc() +} + +func (sc _SemanticSegmentationMatteClass) New() SemanticSegmentationMatte { + rv := objc.Call[SemanticSegmentationMatte](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSemanticSegmentationMatte() SemanticSegmentationMatte { + return SemanticSegmentationMatteClass.New() +} + +func (s_ SemanticSegmentationMatte) Init() SemanticSegmentationMatte { + rv := objc.Call[SemanticSegmentationMatte](s_, objc.Sel("init")) + return rv +} + +// Returns a dictionary of primitive map information to use when writing an image file with a semantic segmentation matte. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte/3152118-dictionaryrepresentationforauxil?language=objc +func (s_ SemanticSegmentationMatte) DictionaryRepresentationForAuxiliaryDataType(outAuxDataType string) foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](s_, objc.Sel("dictionaryRepresentationForAuxiliaryDataType:"), outAuxDataType) + return rv +} + +// The semantic segmentation matte image type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte/3152119-mattetype?language=objc +func (s_ SemanticSegmentationMatte) MatteType() SemanticSegmentationMatteType { + rv := objc.Call[SemanticSegmentationMatteType](s_, objc.Sel("matteType")) + return rv +} + +// The pixel format type for this object’s internal matting image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte/3152121-pixelformattype?language=objc +func (s_ SemanticSegmentationMatte) PixelFormatType() uint { + rv := objc.Call[uint](s_, objc.Sel("pixelFormatType")) + return rv +} + +// The semantic segmentation matte’s internal image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsemanticsegmentationmatte/3152120-mattingimage?language=objc +func (s_ SemanticSegmentationMatte) MattingImage() corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](s_, objc.Sel("mattingImage")) + return rv +} diff --git a/macos/avfoundation/synchronized_layer.gen.go b/macos/avfoundation/synchronized_layer.gen.go new file mode 100644 index 00000000..e52c70a5 --- /dev/null +++ b/macos/avfoundation/synchronized_layer.gen.go @@ -0,0 +1,145 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SynchronizedLayer] class. +var SynchronizedLayerClass = _SynchronizedLayerClass{objc.GetClass("AVSynchronizedLayer")} + +type _SynchronizedLayerClass struct { + objc.Class +} + +// An interface definition for the [SynchronizedLayer] class. +type ISynchronizedLayer interface { + quartzcore.ILayer + PlayerItem() PlayerItem + SetPlayerItem(value IPlayerItem) +} + +// A Core Animation layer that derives its timing from a player item so that you can synchronize layer animations with media playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer?language=objc +type SynchronizedLayer struct { + quartzcore.Layer +} + +func SynchronizedLayerFrom(ptr unsafe.Pointer) SynchronizedLayer { + return SynchronizedLayer{ + Layer: quartzcore.LayerFrom(ptr), + } +} + +func (sc _SynchronizedLayerClass) Alloc() SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](sc, objc.Sel("alloc")) + return rv +} + +func SynchronizedLayer_Alloc() SynchronizedLayer { + return SynchronizedLayerClass.Alloc() +} + +func (sc _SynchronizedLayerClass) New() SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSynchronizedLayer() SynchronizedLayer { + return SynchronizedLayerClass.New() +} + +func (s_ SynchronizedLayer) Init() SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](s_, objc.Sel("init")) + return rv +} + +func (sc _SynchronizedLayerClass) Layer() SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](sc, objc.Sel("layer")) + return rv +} + +// Creates and returns an instance of the layer object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410793-layer?language=objc +func SynchronizedLayer_Layer() SynchronizedLayer { + return SynchronizedLayerClass.Layer() +} + +func (s_ SynchronizedLayer) InitWithLayer(layer objc.IObject) SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](s_, objc.Sel("initWithLayer:"), layer) + return rv +} + +// Override to copy or initialize custom fields of the specified layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410842-initwithlayer?language=objc +func NewSynchronizedLayerWithLayer(layer objc.IObject) SynchronizedLayer { + instance := SynchronizedLayerClass.Alloc().InitWithLayer(layer) + instance.Autorelease() + return instance +} + +func (s_ SynchronizedLayer) ModelLayer() SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](s_, objc.Sel("modelLayer")) + return rv +} + +// Returns the model layer object associated with the receiver, if any. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410853-modellayer?language=objc +func SynchronizedLayer_ModelLayer() SynchronizedLayer { + instance := SynchronizedLayerClass.Alloc().ModelLayer() + instance.Autorelease() + return instance +} + +func (s_ SynchronizedLayer) PresentationLayer() SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](s_, objc.Sel("presentationLayer")) + return rv +} + +// Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410744-presentationlayer?language=objc +func SynchronizedLayer_PresentationLayer() SynchronizedLayer { + instance := SynchronizedLayerClass.Alloc().PresentationLayer() + instance.Autorelease() + return instance +} + +// Creates a new synchronized layer with timing synchronized with a given player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer/1388781-synchronizedlayerwithplayeritem?language=objc +func (sc _SynchronizedLayerClass) SynchronizedLayerWithPlayerItem(playerItem IPlayerItem) SynchronizedLayer { + rv := objc.Call[SynchronizedLayer](sc, objc.Sel("synchronizedLayerWithPlayerItem:"), objc.Ptr(playerItem)) + return rv +} + +// Creates a new synchronized layer with timing synchronized with a given player item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer/1388781-synchronizedlayerwithplayeritem?language=objc +func SynchronizedLayer_SynchronizedLayerWithPlayerItem(playerItem IPlayerItem) SynchronizedLayer { + return SynchronizedLayerClass.SynchronizedLayerWithPlayerItem(playerItem) +} + +// The player item to which the timing of the layer is synchronized. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer/1385679-playeritem?language=objc +func (s_ SynchronizedLayer) PlayerItem() PlayerItem { + rv := objc.Call[PlayerItem](s_, objc.Sel("playerItem")) + return rv +} + +// The player item to which the timing of the layer is synchronized. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer/1385679-playeritem?language=objc +func (s_ SynchronizedLayer) SetPlayerItem(value IPlayerItem) { + objc.Call[objc.Void](s_, objc.Sel("setPlayerItem:"), objc.Ptr(value)) +} diff --git a/macos/avfoundation/text_style_rule.gen.go b/macos/avfoundation/text_style_rule.gen.go new file mode 100644 index 00000000..a8278ec6 --- /dev/null +++ b/macos/avfoundation/text_style_rule.gen.go @@ -0,0 +1,135 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TextStyleRule] class. +var TextStyleRuleClass = _TextStyleRuleClass{objc.GetClass("AVTextStyleRule")} + +type _TextStyleRuleClass struct { + objc.Class +} + +// An interface definition for the [TextStyleRule] class. +type ITextStyleRule interface { + objc.IObject + TextSelector() string + TextMarkupAttributes() map[string]objc.Object +} + +// An object that represents the text styling rules to apply to a media item’s textual content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule?language=objc +type TextStyleRule struct { + objc.Object +} + +func TextStyleRuleFrom(ptr unsafe.Pointer) TextStyleRule { + return TextStyleRule{ + Object: objc.ObjectFrom(ptr), + } +} + +func (t_ TextStyleRule) InitWithTextMarkupAttributes(textMarkupAttributes map[string]objc.IObject) TextStyleRule { + rv := objc.Call[TextStyleRule](t_, objc.Sel("initWithTextMarkupAttributes:"), textMarkupAttributes) + return rv +} + +// Creates a text style rule object with the specified style attributes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1385849-initwithtextmarkupattributes?language=objc +func NewTextStyleRuleWithTextMarkupAttributes(textMarkupAttributes map[string]objc.IObject) TextStyleRule { + instance := TextStyleRuleClass.Alloc().InitWithTextMarkupAttributes(textMarkupAttributes) + instance.Autorelease() + return instance +} + +func (tc _TextStyleRuleClass) Alloc() TextStyleRule { + rv := objc.Call[TextStyleRule](tc, objc.Sel("alloc")) + return rv +} + +func TextStyleRule_Alloc() TextStyleRule { + return TextStyleRuleClass.Alloc() +} + +func (tc _TextStyleRuleClass) New() TextStyleRule { + rv := objc.Call[TextStyleRule](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTextStyleRule() TextStyleRule { + return TextStyleRuleClass.New() +} + +func (t_ TextStyleRule) Init() TextStyleRule { + rv := objc.Call[TextStyleRule](t_, objc.Sel("init")) + return rv +} + +// Creates a new text style rule object using the style attributes in the specified dictionary. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1584360-textstylerulewithtextmarkupattri?language=objc +func (tc _TextStyleRuleClass) TextStyleRuleWithTextMarkupAttributes(textMarkupAttributes map[string]objc.IObject) TextStyleRule { + rv := objc.Call[TextStyleRule](tc, objc.Sel("textStyleRuleWithTextMarkupAttributes:"), textMarkupAttributes) + return rv +} + +// Creates a new text style rule object using the style attributes in the specified dictionary. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1584360-textstylerulewithtextmarkupattri?language=objc +func TextStyleRule_TextStyleRuleWithTextMarkupAttributes(textMarkupAttributes map[string]objc.IObject) TextStyleRule { + return TextStyleRuleClass.TextStyleRuleWithTextMarkupAttributes(textMarkupAttributes) +} + +// Converts one or more text style rules into a serializable property list object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1387970-propertylistfortextstylerules?language=objc +func (tc _TextStyleRuleClass) PropertyListForTextStyleRules(textStyleRules []ITextStyleRule) objc.Object { + rv := objc.Call[objc.Object](tc, objc.Sel("propertyListForTextStyleRules:"), textStyleRules) + return rv +} + +// Converts one or more text style rules into a serializable property list object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1387970-propertylistfortextstylerules?language=objc +func TextStyleRule_PropertyListForTextStyleRules(textStyleRules []ITextStyleRule) objc.Object { + return TextStyleRuleClass.PropertyListForTextStyleRules(textStyleRules) +} + +// Creates an array of text style rule objects from the specified property-list object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1387802-textstylerulesfrompropertylist?language=objc +func (tc _TextStyleRuleClass) TextStyleRulesFromPropertyList(plist objc.IObject) []TextStyleRule { + rv := objc.Call[[]TextStyleRule](tc, objc.Sel("textStyleRulesFromPropertyList:"), plist) + return rv +} + +// Creates an array of text style rule objects from the specified property-list object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1387802-textstylerulesfrompropertylist?language=objc +func TextStyleRule_TextStyleRulesFromPropertyList(plist objc.IObject) []TextStyleRule { + return TextStyleRuleClass.TextStyleRulesFromPropertyList(plist) +} + +// A string that identifies the text to which the attributes should apply. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1389451-textselector?language=objc +func (t_ TextStyleRule) TextSelector() string { + rv := objc.Call[string](t_, objc.Sel("textSelector")) + return rv +} + +// A dictionary of text style attributes to apply to the text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtextstylerule/1387945-textmarkupattributes?language=objc +func (t_ TextStyleRule) TextMarkupAttributes() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](t_, objc.Sel("textMarkupAttributes")) + return rv +} diff --git a/macos/avfoundation/timed_metadata_group.gen.go b/macos/avfoundation/timed_metadata_group.gen.go new file mode 100644 index 00000000..0c873984 --- /dev/null +++ b/macos/avfoundation/timed_metadata_group.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TimedMetadataGroup] class. +var TimedMetadataGroupClass = _TimedMetadataGroupClass{objc.GetClass("AVTimedMetadataGroup")} + +type _TimedMetadataGroupClass struct { + objc.Class +} + +// An interface definition for the [TimedMetadataGroup] class. +type ITimedMetadataGroup interface { + IMetadataGroup + CopyFormatDescription() coremedia.MetadataFormatDescriptionRef + TimeRange() coremedia.TimeRange +} + +// A collection of metadata items that are valid for use during a specific time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup?language=objc +type TimedMetadataGroup struct { + MetadataGroup +} + +func TimedMetadataGroupFrom(ptr unsafe.Pointer) TimedMetadataGroup { + return TimedMetadataGroup{ + MetadataGroup: MetadataGroupFrom(ptr), + } +} + +func (t_ TimedMetadataGroup) InitWithSampleBuffer(sampleBuffer coremedia.SampleBufferRef) TimedMetadataGroup { + rv := objc.Call[TimedMetadataGroup](t_, objc.Sel("initWithSampleBuffer:"), sampleBuffer) + return rv +} + +// Creates a timed metadata group with a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup/1387128-initwithsamplebuffer?language=objc +func NewTimedMetadataGroupWithSampleBuffer(sampleBuffer coremedia.SampleBufferRef) TimedMetadataGroup { + instance := TimedMetadataGroupClass.Alloc().InitWithSampleBuffer(sampleBuffer) + instance.Autorelease() + return instance +} + +func (t_ TimedMetadataGroup) InitWithItemsTimeRange(items []IMetadataItem, timeRange coremedia.TimeRange) TimedMetadataGroup { + rv := objc.Call[TimedMetadataGroup](t_, objc.Sel("initWithItems:timeRange:"), items, timeRange) + return rv +} + +// Creates a timed metadata group initialized with the given metadata items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup/1389632-initwithitems?language=objc +func NewTimedMetadataGroupWithItemsTimeRange(items []IMetadataItem, timeRange coremedia.TimeRange) TimedMetadataGroup { + instance := TimedMetadataGroupClass.Alloc().InitWithItemsTimeRange(items, timeRange) + instance.Autorelease() + return instance +} + +func (tc _TimedMetadataGroupClass) Alloc() TimedMetadataGroup { + rv := objc.Call[TimedMetadataGroup](tc, objc.Sel("alloc")) + return rv +} + +func TimedMetadataGroup_Alloc() TimedMetadataGroup { + return TimedMetadataGroupClass.Alloc() +} + +func (tc _TimedMetadataGroupClass) New() TimedMetadataGroup { + rv := objc.Call[TimedMetadataGroup](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTimedMetadataGroup() TimedMetadataGroup { + return TimedMetadataGroupClass.New() +} + +func (t_ TimedMetadataGroup) Init() TimedMetadataGroup { + rv := objc.Call[TimedMetadataGroup](t_, objc.Sel("init")) + return rv +} + +// Creates a format description based on the receiver's items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup/1389461-copyformatdescription?language=objc +func (t_ TimedMetadataGroup) CopyFormatDescription() coremedia.MetadataFormatDescriptionRef { + rv := objc.Call[coremedia.MetadataFormatDescriptionRef](t_, objc.Sel("copyFormatDescription")) + return rv +} + +// The time range for the timed metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup/1387992-timerange?language=objc +func (t_ TimedMetadataGroup) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](t_, objc.Sel("timeRange")) + return rv +} diff --git a/macos/avfoundation/url_asset.gen.go b/macos/avfoundation/url_asset.gen.go new file mode 100644 index 00000000..cc423cdb --- /dev/null +++ b/macos/avfoundation/url_asset.gen.go @@ -0,0 +1,195 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [URLAsset] class. +var URLAssetClass = _URLAssetClass{objc.GetClass("AVURLAsset")} + +type _URLAssetClass struct { + objc.Class +} + +// An interface definition for the [URLAsset] class. +type IURLAsset interface { + IAsset + FindCompatibleTrackForCompositionTrackCompletionHandler(compositionTrack ICompositionTrack, completionHandler func(arg0 AssetTrack, arg1 foundation.Error)) + ResourceLoader() AssetResourceLoader + MayRequireContentKeysForMediaDataProcessing() bool + URL() foundation.URL + AssetCache() AssetCache + Variants() []AssetVariant +} + +// An asset that represents media at a local or remote URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset?language=objc +type URLAsset struct { + Asset +} + +func URLAssetFrom(ptr unsafe.Pointer) URLAsset { + return URLAsset{ + Asset: AssetFrom(ptr), + } +} + +func (uc _URLAssetClass) URLAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) URLAsset { + rv := objc.Call[URLAsset](uc, objc.Sel("URLAssetWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Returns an asset that models the media resource found at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1508727-urlassetwithurl?language=objc +func URLAsset_URLAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) URLAsset { + return URLAssetClass.URLAssetWithURLOptions(URL, options) +} + +func (u_ URLAsset) InitWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) URLAsset { + rv := objc.Call[URLAsset](u_, objc.Sel("initWithURL:options:"), objc.Ptr(URL), options) + return rv +} + +// Creates an asset that models the media resource at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1385698-initwithurl?language=objc +func NewURLAssetWithURLOptions(URL foundation.IURL, options map[string]objc.IObject) URLAsset { + instance := URLAssetClass.Alloc().InitWithURLOptions(URL, options) + instance.Autorelease() + return instance +} + +func (uc _URLAssetClass) Alloc() URLAsset { + rv := objc.Call[URLAsset](uc, objc.Sel("alloc")) + return rv +} + +func URLAsset_Alloc() URLAsset { + return URLAssetClass.Alloc() +} + +func (uc _URLAssetClass) New() URLAsset { + rv := objc.Call[URLAsset](uc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewURLAsset() URLAsset { + return URLAssetClass.New() +} + +func (u_ URLAsset) Init() URLAsset { + rv := objc.Call[URLAsset](u_, objc.Sel("init")) + return rv +} + +func (uc _URLAssetClass) AssetWithURL(URL foundation.IURL) URLAsset { + rv := objc.Call[URLAsset](uc, objc.Sel("assetWithURL:"), objc.Ptr(URL)) + return rv +} + +// Creates an asset that models the media at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avasset/1389943-assetwithurl?language=objc +func URLAsset_AssetWithURL(URL foundation.IURL) URLAsset { + return URLAssetClass.AssetWithURL(URL) +} + +// Returns an array of the file types the asset supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1386800-audiovisualtypes?language=objc +func (uc _URLAssetClass) AudiovisualTypes() []FileType { + rv := objc.Call[[]FileType](uc, objc.Sel("audiovisualTypes")) + return rv +} + +// Returns an array of the file types the asset supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1386800-audiovisualtypes?language=objc +func URLAsset_AudiovisualTypes() []FileType { + return URLAssetClass.AudiovisualTypes() +} + +// Returns a Boolean value that indicates whether the asset is playable with the specified codecs and container type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1387142-isplayableextendedmimetype?language=objc +func (uc _URLAssetClass) IsPlayableExtendedMIMEType(extendedMIMEType string) bool { + rv := objc.Call[bool](uc, objc.Sel("isPlayableExtendedMIMEType:"), extendedMIMEType) + return rv +} + +// Returns a Boolean value that indicates whether the asset is playable with the specified codecs and container type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1387142-isplayableextendedmimetype?language=objc +func URLAsset_IsPlayableExtendedMIMEType(extendedMIMEType string) bool { + return URLAssetClass.IsPlayableExtendedMIMEType(extendedMIMEType) +} + +// Returns an array of the MIME types the asset supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1390006-audiovisualmimetypes?language=objc +func (uc _URLAssetClass) AudiovisualMIMETypes() []string { + rv := objc.Call[[]string](uc, objc.Sel("audiovisualMIMETypes")) + return rv +} + +// Returns an array of the MIME types the asset supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1390006-audiovisualmimetypes?language=objc +func URLAsset_AudiovisualMIMETypes() []string { + return URLAssetClass.AudiovisualMIMETypes() +} + +// Loads an asset track from which you can insert any time range into the composition track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/3746535-findcompatibletrackforcompositio?language=objc +func (u_ URLAsset) FindCompatibleTrackForCompositionTrackCompletionHandler(compositionTrack ICompositionTrack, completionHandler func(arg0 AssetTrack, arg1 foundation.Error)) { + objc.Call[objc.Void](u_, objc.Sel("findCompatibleTrackForCompositionTrack:completionHandler:"), objc.Ptr(compositionTrack), completionHandler) +} + +// The resource loader for the asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1389118-resourceloader?language=objc +func (u_ URLAsset) ResourceLoader() AssetResourceLoader { + rv := objc.Call[AssetResourceLoader](u_, objc.Sel("resourceLoader")) + return rv +} + +// A Boolean value that indicates whether you can add this asset as a content key recipient to a content key session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/2806807-mayrequirecontentkeysformediadat?language=objc +func (u_ URLAsset) MayRequireContentKeysForMediaDataProcessing() bool { + rv := objc.Call[bool](u_, objc.Sel("mayRequireContentKeysForMediaDataProcessing")) + return rv +} + +// A URL to the asset’s media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1388127-url?language=objc +func (u_ URLAsset) URL() foundation.URL { + rv := objc.Call[foundation.URL](u_, objc.Sel("URL")) + return rv +} + +// The asset’s associated asset cache, if it exists. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/1823714-assetcache?language=objc +func (u_ URLAsset) AssetCache() AssetCache { + rv := objc.Call[AssetCache](u_, objc.Sel("assetCache")) + return rv +} + +// An array of variants that an asset contains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avurlasset/3746536-variants?language=objc +func (u_ URLAsset) Variants() []AssetVariant { + rv := objc.Call[[]AssetVariant](u_, objc.Sel("variants")) + return rv +} diff --git a/macos/avfoundation/video_compositing.gen.go b/macos/avfoundation/video_compositing.gen.go new file mode 100644 index 00000000..6e92b9e7 --- /dev/null +++ b/macos/avfoundation/video_compositing.gen.go @@ -0,0 +1,172 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods custom video compositors must implement. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing?language=objc +type PVideoCompositing interface { + // optional + RenderContextChanged(newRenderContext VideoCompositionRenderContext) + HasRenderContextChanged() bool + + // optional + AnticipateRenderingUsingHint(renderHint VideoCompositionRenderHint) + HasAnticipateRenderingUsingHint() bool + + // optional + PrerollForRenderingUsingHint(renderHint VideoCompositionRenderHint) + HasPrerollForRenderingUsingHint() bool + + // optional + CancelAllPendingVideoCompositionRequests() + HasCancelAllPendingVideoCompositionRequests() bool + + // optional + StartVideoCompositionRequest(asyncVideoCompositionRequest AsynchronousVideoCompositionRequest) + HasStartVideoCompositionRequest() bool + + // optional + SupportsHDRSourceFrames() bool + HasSupportsHDRSourceFrames() bool + + // optional + SupportsWideColorSourceFrames() bool + HasSupportsWideColorSourceFrames() bool + + // optional + RequiredPixelBufferAttributesForRenderContext() map[string]objc.IObject + HasRequiredPixelBufferAttributesForRenderContext() bool + + // optional + CanConformColorOfSourceFrames() bool + HasCanConformColorOfSourceFrames() bool + + // optional + SourcePixelBufferAttributes() map[string]objc.IObject + HasSourcePixelBufferAttributes() bool +} + +// A concrete type wrapper for the [PVideoCompositing] protocol. +type VideoCompositingWrapper struct { + objc.Object +} + +func (v_ VideoCompositingWrapper) HasRenderContextChanged() bool { + return v_.RespondsToSelector(objc.Sel("renderContextChanged:")) +} + +// Tells the compositor that the composition changed render contexts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/1390363-rendercontextchanged?language=objc +func (v_ VideoCompositingWrapper) RenderContextChanged(newRenderContext IVideoCompositionRenderContext) { + objc.Call[objc.Void](v_, objc.Sel("renderContextChanged:"), objc.Ptr(newRenderContext)) +} + +func (v_ VideoCompositingWrapper) HasAnticipateRenderingUsingHint() bool { + return v_.RespondsToSelector(objc.Sel("anticipateRenderingUsingHint:")) +} + +// Informs a custom video compositor about upcoming rendering requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/3227885-anticipaterenderingusinghint?language=objc +func (v_ VideoCompositingWrapper) AnticipateRenderingUsingHint(renderHint IVideoCompositionRenderHint) { + objc.Call[objc.Void](v_, objc.Sel("anticipateRenderingUsingHint:"), objc.Ptr(renderHint)) +} + +func (v_ VideoCompositingWrapper) HasPrerollForRenderingUsingHint() bool { + return v_.RespondsToSelector(objc.Sel("prerollForRenderingUsingHint:")) +} + +// Tells a custom video compositor to perform any work in the prerolling phase. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/3227886-prerollforrenderingusinghint?language=objc +func (v_ VideoCompositingWrapper) PrerollForRenderingUsingHint(renderHint IVideoCompositionRenderHint) { + objc.Call[objc.Void](v_, objc.Sel("prerollForRenderingUsingHint:"), objc.Ptr(renderHint)) +} + +func (v_ VideoCompositingWrapper) HasCancelAllPendingVideoCompositionRequests() bool { + return v_.RespondsToSelector(objc.Sel("cancelAllPendingVideoCompositionRequests")) +} + +// Directs a custom video compositor object to cancel or finish all pending video composition requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/1390659-cancelallpendingvideocomposition?language=objc +func (v_ VideoCompositingWrapper) CancelAllPendingVideoCompositionRequests() { + objc.Call[objc.Void](v_, objc.Sel("cancelAllPendingVideoCompositionRequests")) +} + +func (v_ VideoCompositingWrapper) HasStartVideoCompositionRequest() bool { + return v_.RespondsToSelector(objc.Sel("startVideoCompositionRequest:")) +} + +// Directs a custom video compositor object to create a new pixel buffer composed asynchronously from a collection of sources. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/1388894-startvideocompositionrequest?language=objc +func (v_ VideoCompositingWrapper) StartVideoCompositionRequest(asyncVideoCompositionRequest IAsynchronousVideoCompositionRequest) { + objc.Call[objc.Void](v_, objc.Sel("startVideoCompositionRequest:"), objc.Ptr(asyncVideoCompositionRequest)) +} + +func (v_ VideoCompositingWrapper) HasSupportsHDRSourceFrames() bool { + return v_.RespondsToSelector(objc.Sel("supportsHDRSourceFrames")) +} + +// A Boolean value that indicates whether the compositor handles source frames that contain high dynamic range (HDR) properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/3626026-supportshdrsourceframes?language=objc +func (v_ VideoCompositingWrapper) SupportsHDRSourceFrames() bool { + rv := objc.Call[bool](v_, objc.Sel("supportsHDRSourceFrames")) + return rv +} + +func (v_ VideoCompositingWrapper) HasSupportsWideColorSourceFrames() bool { + return v_.RespondsToSelector(objc.Sel("supportsWideColorSourceFrames")) +} + +// A Boolean value that indicates whether the compositor handles source frames that contains wide color properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/1643657-supportswidecolorsourceframes?language=objc +func (v_ VideoCompositingWrapper) SupportsWideColorSourceFrames() bool { + rv := objc.Call[bool](v_, objc.Sel("supportsWideColorSourceFrames")) + return rv +} + +func (v_ VideoCompositingWrapper) HasRequiredPixelBufferAttributesForRenderContext() bool { + return v_.RespondsToSelector(objc.Sel("requiredPixelBufferAttributesForRenderContext")) +} + +// The pixel buffer attributes that the compositor requires for pixel buffers that it creates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/1386414-requiredpixelbufferattributesfor?language=objc +func (v_ VideoCompositingWrapper) RequiredPixelBufferAttributesForRenderContext() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](v_, objc.Sel("requiredPixelBufferAttributesForRenderContext")) + return rv +} + +func (v_ VideoCompositingWrapper) HasCanConformColorOfSourceFrames() bool { + return v_.RespondsToSelector(objc.Sel("canConformColorOfSourceFrames")) +} + +// A Boolean value that indicates whether the compositor conforms the color space of source frames to the composition color space. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/3750314-canconformcolorofsourceframes?language=objc +func (v_ VideoCompositingWrapper) CanConformColorOfSourceFrames() bool { + rv := objc.Call[bool](v_, objc.Sel("canConformColorOfSourceFrames")) + return rv +} + +func (v_ VideoCompositingWrapper) HasSourcePixelBufferAttributes() bool { + return v_.RespondsToSelector(objc.Sel("sourcePixelBufferAttributes")) +} + +// The pixel buffer attributes that the compositor accepts for source frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositing/1388610-sourcepixelbufferattributes?language=objc +func (v_ VideoCompositingWrapper) SourcePixelBufferAttributes() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](v_, objc.Sel("sourcePixelBufferAttributes")) + return rv +} diff --git a/macos/avfoundation/video_composition.gen.go b/macos/avfoundation/video_composition.gen.go new file mode 100644 index 00000000..d5d6a283 --- /dev/null +++ b/macos/avfoundation/video_composition.gen.go @@ -0,0 +1,160 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoComposition] class. +var VideoCompositionClass = _VideoCompositionClass{objc.GetClass("AVVideoComposition")} + +type _VideoCompositionClass struct { + objc.Class +} + +// An interface definition for the [VideoComposition] class. +type IVideoComposition interface { + objc.IObject + ColorPrimaries() string + ColorYCbCrMatrix() string + CustomVideoCompositorClass() objc.Class + FrameDuration() coremedia.Time + Instructions() []objc.Object + SourceSampleDataTrackIDs() []foundation.Number + AnimationTool() VideoCompositionCoreAnimationTool + ColorTransferFunction() string + SourceTrackIDForFrameTiming() objc.Object + RenderSize() coregraphics.Size + RenderScale() float64 +} + +// An object that describes how to compose video frames at particular points in time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition?language=objc +type VideoComposition struct { + objc.Object +} + +func VideoCompositionFrom(ptr unsafe.Pointer) VideoComposition { + return VideoComposition{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoCompositionClass) Alloc() VideoComposition { + rv := objc.Call[VideoComposition](vc, objc.Sel("alloc")) + return rv +} + +func VideoComposition_Alloc() VideoComposition { + return VideoCompositionClass.Alloc() +} + +func (vc _VideoCompositionClass) New() VideoComposition { + rv := objc.Call[VideoComposition](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoComposition() VideoComposition { + return VideoCompositionClass.New() +} + +func (v_ VideoComposition) Init() VideoComposition { + rv := objc.Call[VideoComposition](v_, objc.Sel("init")) + return rv +} + +// The color primaries used for video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1643235-colorprimaries?language=objc +func (v_ VideoComposition) ColorPrimaries() string { + rv := objc.Call[string](v_, objc.Sel("colorPrimaries")) + return rv +} + +// The YCbCr matrix used for video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1643236-colorycbcrmatrix?language=objc +func (v_ VideoComposition) ColorYCbCrMatrix() string { + rv := objc.Call[string](v_, objc.Sel("colorYCbCrMatrix")) + return rv +} + +// A custom compositor class to use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1389622-customvideocompositorclass?language=objc +func (v_ VideoComposition) CustomVideoCompositorClass() objc.Class { + rv := objc.Call[objc.Class](v_, objc.Sel("customVideoCompositorClass")) + return rv +} + +// A time interval for which the video composition should render composed video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1388013-frameduration?language=objc +func (v_ VideoComposition) FrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](v_, objc.Sel("frameDuration")) + return rv +} + +// The video composition instructions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1389211-instructions?language=objc +func (v_ VideoComposition) Instructions() []objc.Object { + rv := objc.Call[[]objc.Object](v_, objc.Sel("instructions")) + return rv +} + +// The identifiers of source sample data tracks in the composition that the compositor requires to compose frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/3750318-sourcesampledatatrackids?language=objc +func (v_ VideoComposition) SourceSampleDataTrackIDs() []foundation.Number { + rv := objc.Call[[]foundation.Number](v_, objc.Sel("sourceSampleDataTrackIDs")) + return rv +} + +// A video composition tool to use with Core Animation in offline rendering. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1387030-animationtool?language=objc +func (v_ VideoComposition) AnimationTool() VideoCompositionCoreAnimationTool { + rv := objc.Call[VideoCompositionCoreAnimationTool](v_, objc.Sel("animationTool")) + return rv +} + +// The transfer function used for video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1643230-colortransferfunction?language=objc +func (v_ VideoComposition) ColorTransferFunction() string { + rv := objc.Call[string](v_, objc.Sel("colorTransferFunction")) + return rv +} + +// An identifier of the source track from which the video composition derives frame timing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/2873798-sourcetrackidforframetiming?language=objc +func (v_ VideoComposition) SourceTrackIDForFrameTiming() objc.Object { + rv := objc.Call[objc.Object](v_, objc.Sel("sourceTrackIDForFrameTiming")) + return rv +} + +// The size at which the video composition should render. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1388705-rendersize?language=objc +func (v_ VideoComposition) RenderSize() coregraphics.Size { + rv := objc.Call[coregraphics.Size](v_, objc.Sel("renderSize")) + return rv +} + +// The scale at which the video composition should render. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocomposition/1615786-renderscale?language=objc +func (v_ VideoComposition) RenderScale() float64 { + rv := objc.Call[float64](v_, objc.Sel("renderScale")) + return rv +} diff --git a/macos/avfoundation/video_composition_core_animation_tool.gen.go b/macos/avfoundation/video_composition_core_animation_tool.gen.go new file mode 100644 index 00000000..e0fa75c4 --- /dev/null +++ b/macos/avfoundation/video_composition_core_animation_tool.gen.go @@ -0,0 +1,71 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoCompositionCoreAnimationTool] class. +var VideoCompositionCoreAnimationToolClass = _VideoCompositionCoreAnimationToolClass{objc.GetClass("AVVideoCompositionCoreAnimationTool")} + +type _VideoCompositionCoreAnimationToolClass struct { + objc.Class +} + +// An interface definition for the [VideoCompositionCoreAnimationTool] class. +type IVideoCompositionCoreAnimationTool interface { + objc.IObject +} + +// An object used to incorporate Core Animation into a video composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioncoreanimationtool?language=objc +type VideoCompositionCoreAnimationTool struct { + objc.Object +} + +func VideoCompositionCoreAnimationToolFrom(ptr unsafe.Pointer) VideoCompositionCoreAnimationTool { + return VideoCompositionCoreAnimationTool{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoCompositionCoreAnimationToolClass) VideoCompositionCoreAnimationToolWithPostProcessingAsVideoLayerInLayer(videoLayer quartzcore.ILayer, animationLayer quartzcore.ILayer) VideoCompositionCoreAnimationTool { + rv := objc.Call[VideoCompositionCoreAnimationTool](vc, objc.Sel("videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:inLayer:"), objc.Ptr(videoLayer), objc.Ptr(animationLayer)) + return rv +} + +// Composes the composited video frame with a Core Animation layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioncoreanimationtool/1389594-videocompositioncoreanimationtoo?language=objc +func VideoCompositionCoreAnimationTool_VideoCompositionCoreAnimationToolWithPostProcessingAsVideoLayerInLayer(videoLayer quartzcore.ILayer, animationLayer quartzcore.ILayer) VideoCompositionCoreAnimationTool { + return VideoCompositionCoreAnimationToolClass.VideoCompositionCoreAnimationToolWithPostProcessingAsVideoLayerInLayer(videoLayer, animationLayer) +} + +func (vc _VideoCompositionCoreAnimationToolClass) Alloc() VideoCompositionCoreAnimationTool { + rv := objc.Call[VideoCompositionCoreAnimationTool](vc, objc.Sel("alloc")) + return rv +} + +func VideoCompositionCoreAnimationTool_Alloc() VideoCompositionCoreAnimationTool { + return VideoCompositionCoreAnimationToolClass.Alloc() +} + +func (vc _VideoCompositionCoreAnimationToolClass) New() VideoCompositionCoreAnimationTool { + rv := objc.Call[VideoCompositionCoreAnimationTool](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoCompositionCoreAnimationTool() VideoCompositionCoreAnimationTool { + return VideoCompositionCoreAnimationToolClass.New() +} + +func (v_ VideoCompositionCoreAnimationTool) Init() VideoCompositionCoreAnimationTool { + rv := objc.Call[VideoCompositionCoreAnimationTool](v_, objc.Sel("init")) + return rv +} diff --git a/macos/avfoundation/video_composition_instruction.gen.go b/macos/avfoundation/video_composition_instruction.gen.go new file mode 100644 index 00000000..467123d9 --- /dev/null +++ b/macos/avfoundation/video_composition_instruction.gen.go @@ -0,0 +1,133 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoCompositionInstruction] class. +var VideoCompositionInstructionClass = _VideoCompositionInstructionClass{objc.GetClass("AVVideoCompositionInstruction")} + +type _VideoCompositionInstructionClass struct { + objc.Class +} + +// An interface definition for the [VideoCompositionInstruction] class. +type IVideoCompositionInstruction interface { + objc.IObject + RequiredSourceSampleDataTrackIDs() []foundation.Number + LayerInstructions() []VideoCompositionLayerInstruction + RequiredSourceTrackIDs() []foundation.Value + PassthroughTrackID() objc.Object + BackgroundColor() coregraphics.ColorRef + TimeRange() coremedia.TimeRange + EnablePostProcessing() bool + ContainsTweening() bool +} + +// An operation that a compositor performs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction?language=objc +type VideoCompositionInstruction struct { + objc.Object +} + +func VideoCompositionInstructionFrom(ptr unsafe.Pointer) VideoCompositionInstruction { + return VideoCompositionInstruction{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoCompositionInstructionClass) Alloc() VideoCompositionInstruction { + rv := objc.Call[VideoCompositionInstruction](vc, objc.Sel("alloc")) + return rv +} + +func VideoCompositionInstruction_Alloc() VideoCompositionInstruction { + return VideoCompositionInstructionClass.Alloc() +} + +func (vc _VideoCompositionInstructionClass) New() VideoCompositionInstruction { + rv := objc.Call[VideoCompositionInstruction](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoCompositionInstruction() VideoCompositionInstruction { + return VideoCompositionInstructionClass.New() +} + +func (v_ VideoCompositionInstruction) Init() VideoCompositionInstruction { + rv := objc.Call[VideoCompositionInstruction](v_, objc.Sel("init")) + return rv +} + +// The identifiers of source sample data tracks that the compositor requires to compose frames for the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction/3750319-requiredsourcesampledatatrackids?language=objc +func (v_ VideoCompositionInstruction) RequiredSourceSampleDataTrackIDs() []foundation.Number { + rv := objc.Call[[]foundation.Number](v_, objc.Sel("requiredSourceSampleDataTrackIDs")) + return rv +} + +// Instructions that specify how to layer and compose video frames from source tracks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction/1389689-layerinstructions?language=objc +func (v_ VideoCompositionInstruction) LayerInstructions() []VideoCompositionLayerInstruction { + rv := objc.Call[[]VideoCompositionLayerInstruction](v_, objc.Sel("layerInstructions")) + return rv +} + +// The identifiers of source video tracks that the compositor requires to compose frames for the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction/1390913-requiredsourcetrackids?language=objc +func (v_ VideoCompositionInstruction) RequiredSourceTrackIDs() []foundation.Value { + rv := objc.Call[[]foundation.Value](v_, objc.Sel("requiredSourceTrackIDs")) + return rv +} + +// The track identifier from an instruction source frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction/1387657-passthroughtrackid?language=objc +func (v_ VideoCompositionInstruction) PassthroughTrackID() objc.Object { + rv := objc.Call[objc.Object](v_, objc.Sel("passthroughTrackID")) + return rv +} + +// The background color of the composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction/1389384-backgroundcolor?language=objc +func (v_ VideoCompositionInstruction) BackgroundColor() coregraphics.ColorRef { + rv := objc.Call[coregraphics.ColorRef](v_, objc.Sel("backgroundColor")) + return rv +} + +// The time range to which the instruction applies. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction/1387857-timerange?language=objc +func (v_ VideoCompositionInstruction) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](v_, objc.Sel("timeRange")) + return rv +} + +// A Boolean value that indicates whether the instruction requires post processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositioninstruction/1388697-enablepostprocessing?language=objc +func (v_ VideoCompositionInstruction) EnablePostProcessing() bool { + rv := objc.Call[bool](v_, objc.Sel("enablePostProcessing")) + return rv +} + +// A Boolean value that indicates whether the composition contains tweening. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/1386654-avvideocompositioninstruction/1389376-containstweening?language=objc +func (v_ VideoCompositionInstruction) ContainsTweening() bool { + rv := objc.Call[bool](v_, objc.Sel("containsTweening")) + return rv +} diff --git a/macos/avfoundation/video_composition_layer_instruction.gen.go b/macos/avfoundation/video_composition_layer_instruction.gen.go new file mode 100644 index 00000000..2ac67e09 --- /dev/null +++ b/macos/avfoundation/video_composition_layer_instruction.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoCompositionLayerInstruction] class. +var VideoCompositionLayerInstructionClass = _VideoCompositionLayerInstructionClass{objc.GetClass("AVVideoCompositionLayerInstruction")} + +type _VideoCompositionLayerInstructionClass struct { + objc.Class +} + +// An interface definition for the [VideoCompositionLayerInstruction] class. +type IVideoCompositionLayerInstruction interface { + objc.IObject + GetCropRectangleRampForTimeStartCropRectangleEndCropRectangleTimeRange(time coremedia.Time, startCropRectangle *coregraphics.Rect, endCropRectangle *coregraphics.Rect, timeRange *coremedia.TimeRange) bool + GetOpacityRampForTimeStartOpacityEndOpacityTimeRange(time coremedia.Time, startOpacity *float64, endOpacity *float64, timeRange *coremedia.TimeRange) bool + GetTransformRampForTimeStartTransformEndTransformTimeRange(time coremedia.Time, startTransform *coregraphics.AffineTransform, endTransform *coregraphics.AffineTransform, timeRange *coremedia.TimeRange) bool + TrackID() objc.Object +} + +// An object used to modify the transform, cropping, and opacity ramps applied to a given track in a composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionlayerinstruction?language=objc +type VideoCompositionLayerInstruction struct { + objc.Object +} + +func VideoCompositionLayerInstructionFrom(ptr unsafe.Pointer) VideoCompositionLayerInstruction { + return VideoCompositionLayerInstruction{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoCompositionLayerInstructionClass) Alloc() VideoCompositionLayerInstruction { + rv := objc.Call[VideoCompositionLayerInstruction](vc, objc.Sel("alloc")) + return rv +} + +func VideoCompositionLayerInstruction_Alloc() VideoCompositionLayerInstruction { + return VideoCompositionLayerInstructionClass.Alloc() +} + +func (vc _VideoCompositionLayerInstructionClass) New() VideoCompositionLayerInstruction { + rv := objc.Call[VideoCompositionLayerInstruction](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoCompositionLayerInstruction() VideoCompositionLayerInstruction { + return VideoCompositionLayerInstructionClass.New() +} + +func (v_ VideoCompositionLayerInstruction) Init() VideoCompositionLayerInstruction { + rv := objc.Call[VideoCompositionLayerInstruction](v_, objc.Sel("init")) + return rv +} + +// Obtains the crop rectangle ramp that includes the specified time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionlayerinstruction/1387998-getcroprectanglerampfortime?language=objc +func (v_ VideoCompositionLayerInstruction) GetCropRectangleRampForTimeStartCropRectangleEndCropRectangleTimeRange(time coremedia.Time, startCropRectangle *coregraphics.Rect, endCropRectangle *coregraphics.Rect, timeRange *coremedia.TimeRange) bool { + rv := objc.Call[bool](v_, objc.Sel("getCropRectangleRampForTime:startCropRectangle:endCropRectangle:timeRange:"), time, startCropRectangle, endCropRectangle, timeRange) + return rv +} + +// Obtains the opacity ramp that includes a specified time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionlayerinstruction/1388471-getopacityrampfortime?language=objc +func (v_ VideoCompositionLayerInstruction) GetOpacityRampForTimeStartOpacityEndOpacityTimeRange(time coremedia.Time, startOpacity *float64, endOpacity *float64, timeRange *coremedia.TimeRange) bool { + rv := objc.Call[bool](v_, objc.Sel("getOpacityRampForTime:startOpacity:endOpacity:timeRange:"), time, startOpacity, endOpacity, timeRange) + return rv +} + +// Obtains the transform ramp that includes a specified time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionlayerinstruction/1387257-gettransformrampfortime?language=objc +func (v_ VideoCompositionLayerInstruction) GetTransformRampForTimeStartTransformEndTransformTimeRange(time coremedia.Time, startTransform *coregraphics.AffineTransform, endTransform *coregraphics.AffineTransform, timeRange *coremedia.TimeRange) bool { + rv := objc.Call[bool](v_, objc.Sel("getTransformRampForTime:startTransform:endTransform:timeRange:"), time, startTransform, endTransform, timeRange) + return rv +} + +// The track identifier of the source track to which the compositor will apply the instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionlayerinstruction/1390240-trackid?language=objc +func (v_ VideoCompositionLayerInstruction) TrackID() objc.Object { + rv := objc.Call[objc.Object](v_, objc.Sel("trackID")) + return rv +} diff --git a/macos/avfoundation/video_composition_render_context.gen.go b/macos/avfoundation/video_composition_render_context.gen.go new file mode 100644 index 00000000..b8c89892 --- /dev/null +++ b/macos/avfoundation/video_composition_render_context.gen.go @@ -0,0 +1,132 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoCompositionRenderContext] class. +var VideoCompositionRenderContextClass = _VideoCompositionRenderContextClass{objc.GetClass("AVVideoCompositionRenderContext")} + +type _VideoCompositionRenderContextClass struct { + objc.Class +} + +// An interface definition for the [VideoCompositionRenderContext] class. +type IVideoCompositionRenderContext interface { + objc.IObject + NewPixelBuffer() corevideo.PixelBufferRef + HighQualityRendering() bool + VideoComposition() VideoComposition + RenderTransform() coregraphics.AffineTransform + PixelAspectRatio() PixelAspectRatio + EdgeWidths() EdgeWidths + RenderScale() float64 + Size() coregraphics.Size +} + +// An object that defines the context in which custom compositors render pixel buffers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext?language=objc +type VideoCompositionRenderContext struct { + objc.Object +} + +func VideoCompositionRenderContextFrom(ptr unsafe.Pointer) VideoCompositionRenderContext { + return VideoCompositionRenderContext{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoCompositionRenderContextClass) Alloc() VideoCompositionRenderContext { + rv := objc.Call[VideoCompositionRenderContext](vc, objc.Sel("alloc")) + return rv +} + +func VideoCompositionRenderContext_Alloc() VideoCompositionRenderContext { + return VideoCompositionRenderContextClass.Alloc() +} + +func (vc _VideoCompositionRenderContextClass) New() VideoCompositionRenderContext { + rv := objc.Call[VideoCompositionRenderContext](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoCompositionRenderContext() VideoCompositionRenderContext { + return VideoCompositionRenderContextClass.New() +} + +func (v_ VideoCompositionRenderContext) Init() VideoCompositionRenderContext { + rv := objc.Call[VideoCompositionRenderContext](v_, objc.Sel("init")) + return rv +} + +// Returns a pixel buffer to use for rendering. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1386802-newpixelbuffer?language=objc +func (v_ VideoCompositionRenderContext) NewPixelBuffer() corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](v_, objc.Sel("newPixelBuffer")) + return rv +} + +// The rendering quality to use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1388758-highqualityrendering?language=objc +func (v_ VideoCompositionRenderContext) HighQualityRendering() bool { + rv := objc.Call[bool](v_, objc.Sel("highQualityRendering")) + return rv +} + +// The video composition being rendered. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1390647-videocomposition?language=objc +func (v_ VideoCompositionRenderContext) VideoComposition() VideoComposition { + rv := objc.Call[VideoComposition](v_, objc.Sel("videoComposition")) + return rv +} + +// A transform to apply to the source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1389831-rendertransform?language=objc +func (v_ VideoCompositionRenderContext) RenderTransform() coregraphics.AffineTransform { + rv := objc.Call[coregraphics.AffineTransform](v_, objc.Sel("renderTransform")) + return rv +} + +// The pixel aspect ratio for rendered frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1389800-pixelaspectratio?language=objc +func (v_ VideoCompositionRenderContext) PixelAspectRatio() PixelAspectRatio { + rv := objc.Call[PixelAspectRatio](v_, objc.Sel("pixelAspectRatio")) + return rv +} + +// The width of the edge processing region on the left, top, right, and bottom edges, in pixels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1387026-edgewidths?language=objc +func (v_ VideoCompositionRenderContext) EdgeWidths() EdgeWidths { + rv := objc.Call[EdgeWidths](v_, objc.Sel("edgeWidths")) + return rv +} + +// A scaling ratio that is applied when rendering frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1387408-renderscale?language=objc +func (v_ VideoCompositionRenderContext) RenderScale() float64 { + rv := objc.Call[float64](v_, objc.Sel("renderScale")) + return rv +} + +// The width and height for the rendering frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrendercontext/1389718-size?language=objc +func (v_ VideoCompositionRenderContext) Size() coregraphics.Size { + rv := objc.Call[coregraphics.Size](v_, objc.Sel("size")) + return rv +} diff --git a/macos/avfoundation/video_composition_render_hint.gen.go b/macos/avfoundation/video_composition_render_hint.gen.go new file mode 100644 index 00000000..19404322 --- /dev/null +++ b/macos/avfoundation/video_composition_render_hint.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoCompositionRenderHint] class. +var VideoCompositionRenderHintClass = _VideoCompositionRenderHintClass{objc.GetClass("AVVideoCompositionRenderHint")} + +type _VideoCompositionRenderHintClass struct { + objc.Class +} + +// An interface definition for the [VideoCompositionRenderHint] class. +type IVideoCompositionRenderHint interface { + objc.IObject + StartCompositionTime() coremedia.Time + EndCompositionTime() coremedia.Time +} + +// Information about upcoming composition requests, such as composition start time and end time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrenderhint?language=objc +type VideoCompositionRenderHint struct { + objc.Object +} + +func VideoCompositionRenderHintFrom(ptr unsafe.Pointer) VideoCompositionRenderHint { + return VideoCompositionRenderHint{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoCompositionRenderHintClass) Alloc() VideoCompositionRenderHint { + rv := objc.Call[VideoCompositionRenderHint](vc, objc.Sel("alloc")) + return rv +} + +func VideoCompositionRenderHint_Alloc() VideoCompositionRenderHint { + return VideoCompositionRenderHintClass.Alloc() +} + +func (vc _VideoCompositionRenderHintClass) New() VideoCompositionRenderHint { + rv := objc.Call[VideoCompositionRenderHint](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoCompositionRenderHint() VideoCompositionRenderHint { + return VideoCompositionRenderHintClass.New() +} + +func (v_ VideoCompositionRenderHint) Init() VideoCompositionRenderHint { + rv := objc.Call[VideoCompositionRenderHint](v_, objc.Sel("init")) + return rv +} + +// The start time of the upcoming composition requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrenderhint/3227889-startcompositiontime?language=objc +func (v_ VideoCompositionRenderHint) StartCompositionTime() coremedia.Time { + rv := objc.Call[coremedia.Time](v_, objc.Sel("startCompositionTime")) + return rv +} + +// The end time of the upcoming composition requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionrenderhint/3227888-endcompositiontime?language=objc +func (v_ VideoCompositionRenderHint) EndCompositionTime() coremedia.Time { + rv := objc.Call[coremedia.Time](v_, objc.Sel("endCompositionTime")) + return rv +} diff --git a/macos/avfoundation/video_composition_validation_handling.gen.go b/macos/avfoundation/video_composition_validation_handling.gen.go new file mode 100644 index 00000000..b35cfae8 --- /dev/null +++ b/macos/avfoundation/video_composition_validation_handling.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avfoundation + +import ( + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// Methods you can implement to indicate whether validation of a video composition should continue after specific errors are found. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionvalidationhandling?language=objc +type PVideoCompositionValidationHandling interface { + // optional + VideoCompositionShouldContinueValidatingAfterFindingEmptyTimeRange(videoComposition VideoComposition, timeRange coremedia.TimeRange) bool + HasVideoCompositionShouldContinueValidatingAfterFindingEmptyTimeRange() bool +} + +// A concrete type wrapper for the [PVideoCompositionValidationHandling] protocol. +type VideoCompositionValidationHandlingWrapper struct { + objc.Object +} + +func (v_ VideoCompositionValidationHandlingWrapper) HasVideoCompositionShouldContinueValidatingAfterFindingEmptyTimeRange() bool { + return v_.RespondsToSelector(objc.Sel("videoComposition:shouldContinueValidatingAfterFindingEmptyTimeRange:")) +} + +// Reports a time range that has no corresponding video composition instruction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avfoundation/avvideocompositionvalidationhandling/1388620-videocomposition?language=objc +func (v_ VideoCompositionValidationHandlingWrapper) VideoCompositionShouldContinueValidatingAfterFindingEmptyTimeRange(videoComposition IVideoComposition, timeRange coremedia.TimeRange) bool { + rv := objc.Call[bool](v_, objc.Sel("videoComposition:shouldContinueValidatingAfterFindingEmptyTimeRange:"), objc.Ptr(videoComposition), timeRange) + return rv +} diff --git a/macos/avkit/capture_view.gen.go b/macos/avkit/capture_view.gen.go new file mode 100644 index 00000000..fcde35d3 --- /dev/null +++ b/macos/avkit/capture_view.gen.go @@ -0,0 +1,162 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/avfoundation" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CaptureView] class. +var CaptureViewClass = _CaptureViewClass{objc.GetClass("AVCaptureView")} + +type _CaptureViewClass struct { + objc.Class +} + +// An interface definition for the [CaptureView] class. +type ICaptureView interface { + appkit.IView + SetSessionShowVideoPreviewShowAudioPreview(session avfoundation.ICaptureSession, showVideoPreview bool, showAudioPreview bool) + VideoGravity() avfoundation.LayerVideoGravity + SetVideoGravity(value avfoundation.LayerVideoGravity) + Session() avfoundation.CaptureSession + FileOutput() avfoundation.CaptureFileOutput + Delegate() CaptureViewDelegateWrapper + SetDelegate(value PCaptureViewDelegate) + SetDelegateObject(valueObject objc.IObject) + ControlsStyle() CaptureViewControlsStyle + SetControlsStyle(value CaptureViewControlsStyle) +} + +// A view that displays standard user interface controls for capturing media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview?language=objc +type CaptureView struct { + appkit.View +} + +func CaptureViewFrom(ptr unsafe.Pointer) CaptureView { + return CaptureView{ + View: appkit.ViewFrom(ptr), + } +} + +func (cc _CaptureViewClass) Alloc() CaptureView { + rv := objc.Call[CaptureView](cc, objc.Sel("alloc")) + return rv +} + +func CaptureView_Alloc() CaptureView { + return CaptureViewClass.Alloc() +} + +func (cc _CaptureViewClass) New() CaptureView { + rv := objc.Call[CaptureView](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCaptureView() CaptureView { + return CaptureViewClass.New() +} + +func (c_ CaptureView) Init() CaptureView { + rv := objc.Call[CaptureView](c_, objc.Sel("init")) + return rv +} + +func (c_ CaptureView) InitWithFrame(frameRect foundation.Rect) CaptureView { + rv := objc.Call[CaptureView](c_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewCaptureViewWithFrame(frameRect foundation.Rect) CaptureView { + instance := CaptureViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// Sets the view’s capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519163-setsession?language=objc +func (c_ CaptureView) SetSessionShowVideoPreviewShowAudioPreview(session avfoundation.ICaptureSession, showVideoPreview bool, showAudioPreview bool) { + objc.Call[objc.Void](c_, objc.Sel("setSession:showVideoPreview:showAudioPreview:"), objc.Ptr(session), showVideoPreview, showAudioPreview) +} + +// A string value that defines how the capture view displays video within its bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519134-videogravity?language=objc +func (c_ CaptureView) VideoGravity() avfoundation.LayerVideoGravity { + rv := objc.Call[avfoundation.LayerVideoGravity](c_, objc.Sel("videoGravity")) + return rv +} + +// A string value that defines how the capture view displays video within its bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519134-videogravity?language=objc +func (c_ CaptureView) SetVideoGravity(value avfoundation.LayerVideoGravity) { + objc.Call[objc.Void](c_, objc.Sel("setVideoGravity:"), value) +} + +// The view’s associated capture session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519186-session?language=objc +func (c_ CaptureView) Session() avfoundation.CaptureSession { + rv := objc.Call[avfoundation.CaptureSession](c_, objc.Sel("session")) + return rv +} + +// The capture file output used to record media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519149-fileoutput?language=objc +func (c_ CaptureView) FileOutput() avfoundation.CaptureFileOutput { + rv := objc.Call[avfoundation.CaptureFileOutput](c_, objc.Sel("fileOutput")) + return rv +} + +// The capture view’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519144-delegate?language=objc +func (c_ CaptureView) Delegate() CaptureViewDelegateWrapper { + rv := objc.Call[CaptureViewDelegateWrapper](c_, objc.Sel("delegate")) + return rv +} + +// The capture view’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519144-delegate?language=objc +func (c_ CaptureView) SetDelegate(value PCaptureViewDelegate) { + po0 := objc.WrapAsProtocol("AVCaptureViewDelegate", value) + objc.SetAssociatedObject(c_, objc.AssociationKey("setDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), po0) +} + +// The capture view’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519144-delegate?language=objc +func (c_ CaptureView) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// The style of the capture controls presented by the view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519147-controlsstyle?language=objc +func (c_ CaptureView) ControlsStyle() CaptureViewControlsStyle { + rv := objc.Call[CaptureViewControlsStyle](c_, objc.Sel("controlsStyle")) + return rv +} + +// The style of the capture controls presented by the view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureview/1519147-controlsstyle?language=objc +func (c_ CaptureView) SetControlsStyle(value CaptureViewControlsStyle) { + objc.Call[objc.Void](c_, objc.Sel("setControlsStyle:"), value) +} diff --git a/macos/avkit/capture_view_delegate.gen.go b/macos/avkit/capture_view_delegate.gen.go new file mode 100644 index 00000000..abd07633 --- /dev/null +++ b/macos/avkit/capture_view_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "github.com/progrium/macdriver/macos/avfoundation" + "github.com/progrium/macdriver/objc" +) + +// The protocol that defines the methods you can implement to respond to capture view events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureviewdelegate?language=objc +type PCaptureViewDelegate interface { + // optional + CaptureViewStartRecordingToFileOutput(captureView CaptureView, fileOutput avfoundation.CaptureFileOutput) + HasCaptureViewStartRecordingToFileOutput() bool +} + +// A delegate implementation builder for the [PCaptureViewDelegate] protocol. +type CaptureViewDelegate struct { + _CaptureViewStartRecordingToFileOutput func(captureView CaptureView, fileOutput avfoundation.CaptureFileOutput) +} + +func (di *CaptureViewDelegate) HasCaptureViewStartRecordingToFileOutput() bool { + return di._CaptureViewStartRecordingToFileOutput != nil +} + +// Tells the delegate that the user has made a request to start a new recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureviewdelegate/1519138-captureview?language=objc +func (di *CaptureViewDelegate) SetCaptureViewStartRecordingToFileOutput(f func(captureView CaptureView, fileOutput avfoundation.CaptureFileOutput)) { + di._CaptureViewStartRecordingToFileOutput = f +} + +// Tells the delegate that the user has made a request to start a new recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureviewdelegate/1519138-captureview?language=objc +func (di *CaptureViewDelegate) CaptureViewStartRecordingToFileOutput(captureView CaptureView, fileOutput avfoundation.CaptureFileOutput) { + di._CaptureViewStartRecordingToFileOutput(captureView, fileOutput) +} + +// A concrete type wrapper for the [PCaptureViewDelegate] protocol. +type CaptureViewDelegateWrapper struct { + objc.Object +} + +func (c_ CaptureViewDelegateWrapper) HasCaptureViewStartRecordingToFileOutput() bool { + return c_.RespondsToSelector(objc.Sel("captureView:startRecordingToFileOutput:")) +} + +// Tells the delegate that the user has made a request to start a new recording. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureviewdelegate/1519138-captureview?language=objc +func (c_ CaptureViewDelegateWrapper) CaptureViewStartRecordingToFileOutput(captureView ICaptureView, fileOutput avfoundation.ICaptureFileOutput) { + objc.Call[objc.Void](c_, objc.Sel("captureView:startRecordingToFileOutput:"), objc.Ptr(captureView), objc.Ptr(fileOutput)) +} diff --git a/macos/avkit/doc.gen.go b/macos/avkit/doc.gen.go new file mode 100644 index 00000000..b2a75a52 --- /dev/null +++ b/macos/avkit/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Create user interfaces for media playback, complete with transport controls, chapter navigation, picture-in-picture support, and display of subtitles and closed captions. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/avkit?language=objc +package avkit diff --git a/macos/avkit/enumtypes.gen.go b/macos/avkit/enumtypes.gen.go new file mode 100644 index 00000000..5046f280 --- /dev/null +++ b/macos/avkit/enumtypes.gen.go @@ -0,0 +1,50 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +// Constants that describe the capture view’s supported controls styles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avcaptureviewcontrolsstyle?language=objc +type CaptureViewControlsStyle int + +const ( + CaptureViewControlsStyleDefault CaptureViewControlsStyle = 0 + CaptureViewControlsStyleFloating CaptureViewControlsStyle = 1 + CaptureViewControlsStyleInline CaptureViewControlsStyle = 0 + CaptureViewControlsStyleInlineDeviceSelection CaptureViewControlsStyle = 2 +) + +// Constants that indicate which user interface controls the view displays. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewcontrolsstyle?language=objc +type PlayerViewControlsStyle int + +const ( + PlayerViewControlsStyleDefault PlayerViewControlsStyle = 1 + PlayerViewControlsStyleFloating PlayerViewControlsStyle = 2 + PlayerViewControlsStyleInline PlayerViewControlsStyle = 1 + PlayerViewControlsStyleMinimal PlayerViewControlsStyle = 3 + PlayerViewControlsStyleNone PlayerViewControlsStyle = 0 +) + +// Constants that specify an action a user takes when trimming media in a player view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewtrimresult?language=objc +type PlayerViewTrimResult int + +const ( + PlayerViewTrimCancelButton PlayerViewTrimResult = 1 + PlayerViewTrimOKButton PlayerViewTrimResult = 0 +) + +// Constants that describe the available button states. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewbuttonstate?language=objc +type RoutePickerViewButtonState int + +const ( + RoutePickerViewButtonStateActive RoutePickerViewButtonState = 2 + RoutePickerViewButtonStateActiveHighlighted RoutePickerViewButtonState = 3 + RoutePickerViewButtonStateNormal RoutePickerViewButtonState = 0 + RoutePickerViewButtonStateNormalHighlighted RoutePickerViewButtonState = 1 +) diff --git a/macos/avkit/picture_in_picture_controller.gen.go b/macos/avkit/picture_in_picture_controller.gen.go new file mode 100644 index 00000000..0907955e --- /dev/null +++ b/macos/avkit/picture_in_picture_controller.gen.go @@ -0,0 +1,254 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/avfoundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PictureInPictureController] class. +var PictureInPictureControllerClass = _PictureInPictureControllerClass{objc.GetClass("AVPictureInPictureController")} + +type _PictureInPictureControllerClass struct { + objc.Class +} + +// An interface definition for the [PictureInPictureController] class. +type IPictureInPictureController interface { + objc.IObject + StopPictureInPicture() + InvalidatePlaybackState() + StartPictureInPicture() + IsPictureInPictureSuspended() bool + RequiresLinearPlayback() bool + SetRequiresLinearPlayback(value bool) + Delegate() PictureInPictureControllerDelegateWrapper + SetDelegate(value PPictureInPictureControllerDelegate) + SetDelegateObject(valueObject objc.IObject) + IsPictureInPictureActive() bool + PlayerLayer() avfoundation.PlayerLayer + IsPictureInPicturePossible() bool + ContentSource() PictureInPictureControllerContentSource + SetContentSource(value IPictureInPictureControllerContentSource) +} + +// A controller that responds to user-initiated Picture in Picture playback of video in a floating, resizable window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller?language=objc +type PictureInPictureController struct { + objc.Object +} + +func PictureInPictureControllerFrom(ptr unsafe.Pointer) PictureInPictureController { + return PictureInPictureController{ + Object: objc.ObjectFrom(ptr), + } +} + +func (p_ PictureInPictureController) InitWithPlayerLayer(playerLayer avfoundation.IPlayerLayer) PictureInPictureController { + rv := objc.Call[PictureInPictureController](p_, objc.Sel("initWithPlayerLayer:"), objc.Ptr(playerLayer)) + return rv +} + +// Creates a Picture in Picture controller with a player layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614707-initwithplayerlayer?language=objc +func NewPictureInPictureControllerWithPlayerLayer(playerLayer avfoundation.IPlayerLayer) PictureInPictureController { + instance := PictureInPictureControllerClass.Alloc().InitWithPlayerLayer(playerLayer) + instance.Autorelease() + return instance +} + +func (p_ PictureInPictureController) InitWithContentSource(contentSource IPictureInPictureControllerContentSource) PictureInPictureController { + rv := objc.Call[PictureInPictureController](p_, objc.Sel("initWithContentSource:"), objc.Ptr(contentSource)) + return rv +} + +// Creates a Picture in Picture controller with a content source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3750324-initwithcontentsource?language=objc +func NewPictureInPictureControllerWithContentSource(contentSource IPictureInPictureControllerContentSource) PictureInPictureController { + instance := PictureInPictureControllerClass.Alloc().InitWithContentSource(contentSource) + instance.Autorelease() + return instance +} + +func (pc _PictureInPictureControllerClass) Alloc() PictureInPictureController { + rv := objc.Call[PictureInPictureController](pc, objc.Sel("alloc")) + return rv +} + +func PictureInPictureController_Alloc() PictureInPictureController { + return PictureInPictureControllerClass.Alloc() +} + +func (pc _PictureInPictureControllerClass) New() PictureInPictureController { + rv := objc.Call[PictureInPictureController](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPictureInPictureController() PictureInPictureController { + return PictureInPictureControllerClass.New() +} + +func (p_ PictureInPictureController) Init() PictureInPictureController { + rv := objc.Call[PictureInPictureController](p_, objc.Sel("init")) + return rv +} + +// Returns a Boolean value that indicates whether the current device supports Picture in Picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614693-ispictureinpicturesupported?language=objc +func (pc _PictureInPictureControllerClass) IsPictureInPictureSupported() bool { + rv := objc.Call[bool](pc, objc.Sel("isPictureInPictureSupported")) + return rv +} + +// Returns a Boolean value that indicates whether the current device supports Picture in Picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614693-ispictureinpicturesupported?language=objc +func PictureInPictureController_IsPictureInPictureSupported() bool { + return PictureInPictureControllerClass.IsPictureInPictureSupported() +} + +// Stops Picture in Picture, if active. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614701-stoppictureinpicture?language=objc +func (p_ PictureInPictureController) StopPictureInPicture() { + objc.Call[objc.Void](p_, objc.Sel("stopPictureInPicture")) +} + +// Invalidates the controller’s current playback state and fetches the updated state from the sample buffer playback delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3750328-invalidateplaybackstate?language=objc +func (p_ PictureInPictureController) InvalidatePlaybackState() { + objc.Call[objc.Void](p_, objc.Sel("invalidatePlaybackState")) +} + +// Starts Picture in Picture, if possible. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614687-startpictureinpicture?language=objc +func (p_ PictureInPictureController) StartPictureInPicture() { + objc.Call[objc.Void](p_, objc.Sel("startPictureInPicture")) +} + +// A Boolean value that indicates whether the system suspends the controller’s Picture in Picture window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614689-pictureinpicturesuspended?language=objc +func (p_ PictureInPictureController) IsPictureInPictureSuspended() bool { + rv := objc.Call[bool](p_, objc.Sel("isPictureInPictureSuspended")) + return rv +} + +// A Boolean value that determines whether the controller allows the user to skip media content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3566335-requireslinearplayback?language=objc +func (p_ PictureInPictureController) RequiresLinearPlayback() bool { + rv := objc.Call[bool](p_, objc.Sel("requiresLinearPlayback")) + return rv +} + +// A Boolean value that determines whether the controller allows the user to skip media content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3566335-requireslinearplayback?language=objc +func (p_ PictureInPictureController) SetRequiresLinearPlayback(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setRequiresLinearPlayback:"), value) +} + +// A delegate object for a Picture in Picture controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614709-delegate?language=objc +func (p_ PictureInPictureController) Delegate() PictureInPictureControllerDelegateWrapper { + rv := objc.Call[PictureInPictureControllerDelegateWrapper](p_, objc.Sel("delegate")) + return rv +} + +// A delegate object for a Picture in Picture controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614709-delegate?language=objc +func (p_ PictureInPictureController) SetDelegate(value PPictureInPictureControllerDelegate) { + po0 := objc.WrapAsProtocol("AVPictureInPictureControllerDelegate", value) + objc.SetAssociatedObject(p_, objc.AssociationKey("setDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](p_, objc.Sel("setDelegate:"), po0) +} + +// A delegate object for a Picture in Picture controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614709-delegate?language=objc +func (p_ PictureInPictureController) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](p_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// A system-default template image for the button that starts Picture in Picture in your app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3172686-pictureinpicturebuttonstartimage?language=objc +func (pc _PictureInPictureControllerClass) PictureInPictureButtonStartImage() appkit.Image { + rv := objc.Call[appkit.Image](pc, objc.Sel("pictureInPictureButtonStartImage")) + return rv +} + +// A system-default template image for the button that starts Picture in Picture in your app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3172686-pictureinpicturebuttonstartimage?language=objc +func PictureInPictureController_PictureInPictureButtonStartImage() appkit.Image { + return PictureInPictureControllerClass.PictureInPictureButtonStartImage() +} + +// A Boolean value that indicates whether the Picture in Picture window is onscreen. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614720-pictureinpictureactive?language=objc +func (p_ PictureInPictureController) IsPictureInPictureActive() bool { + rv := objc.Call[bool](p_, objc.Sel("isPictureInPictureActive")) + return rv +} + +// The layer that displays the video content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614706-playerlayer?language=objc +func (p_ PictureInPictureController) PlayerLayer() avfoundation.PlayerLayer { + rv := objc.Call[avfoundation.PlayerLayer](p_, objc.Sel("playerLayer")) + return rv +} + +// A system-default template image for the button that stops Picture in Picture in your app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3172687-pictureinpicturebuttonstopimage?language=objc +func (pc _PictureInPictureControllerClass) PictureInPictureButtonStopImage() appkit.Image { + rv := objc.Call[appkit.Image](pc, objc.Sel("pictureInPictureButtonStopImage")) + return rv +} + +// A system-default template image for the button that stops Picture in Picture in your app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3172687-pictureinpicturebuttonstopimage?language=objc +func PictureInPictureController_PictureInPictureButtonStopImage() appkit.Image { + return PictureInPictureControllerClass.PictureInPictureButtonStopImage() +} + +// A Boolean value that indicates whether Picture in Picture playback is currently possible. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614691-pictureinpicturepossible?language=objc +func (p_ PictureInPictureController) IsPictureInPicturePossible() bool { + rv := objc.Call[bool](p_, objc.Sel("isPictureInPicturePossible")) + return rv +} + +// The source of the controller’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3750323-contentsource?language=objc +func (p_ PictureInPictureController) ContentSource() PictureInPictureControllerContentSource { + rv := objc.Call[PictureInPictureControllerContentSource](p_, objc.Sel("contentSource")) + return rv +} + +// The source of the controller’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/3750323-contentsource?language=objc +func (p_ PictureInPictureController) SetContentSource(value IPictureInPictureControllerContentSource) { + objc.Call[objc.Void](p_, objc.Sel("setContentSource:"), objc.Ptr(value)) +} diff --git a/macos/avkit/picture_in_picture_controller_content_source.gen.go b/macos/avkit/picture_in_picture_controller_content_source.gen.go new file mode 100644 index 00000000..0d9193aa --- /dev/null +++ b/macos/avkit/picture_in_picture_controller_content_source.gen.go @@ -0,0 +1,115 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/avfoundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PictureInPictureControllerContentSource] class. +var PictureInPictureControllerContentSourceClass = _PictureInPictureControllerContentSourceClass{objc.GetClass("AVPictureInPictureControllerContentSource")} + +type _PictureInPictureControllerContentSourceClass struct { + objc.Class +} + +// An interface definition for the [PictureInPictureControllerContentSource] class. +type IPictureInPictureControllerContentSource interface { + objc.IObject + SampleBufferDisplayLayer() avfoundation.SampleBufferDisplayLayer + PlayerLayer() avfoundation.PlayerLayer + SampleBufferPlaybackDelegate() PictureInPictureSampleBufferPlaybackDelegateWrapper +} + +// An object that represents the source of the content to present in Picture in Picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollercontentsource?language=objc +type PictureInPictureControllerContentSource struct { + objc.Object +} + +func PictureInPictureControllerContentSourceFrom(ptr unsafe.Pointer) PictureInPictureControllerContentSource { + return PictureInPictureControllerContentSource{ + Object: objc.ObjectFrom(ptr), + } +} + +func (p_ PictureInPictureControllerContentSource) InitWithPlayerLayer(playerLayer avfoundation.IPlayerLayer) PictureInPictureControllerContentSource { + rv := objc.Call[PictureInPictureControllerContentSource](p_, objc.Sel("initWithPlayerLayer:"), objc.Ptr(playerLayer)) + return rv +} + +// Creates a content source with a player layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollercontentsource/3750326-initwithplayerlayer?language=objc +func NewPictureInPictureControllerContentSourceWithPlayerLayer(playerLayer avfoundation.IPlayerLayer) PictureInPictureControllerContentSource { + instance := PictureInPictureControllerContentSourceClass.Alloc().InitWithPlayerLayer(playerLayer) + instance.Autorelease() + return instance +} + +func (p_ PictureInPictureControllerContentSource) InitWithSampleBufferDisplayLayerPlaybackDelegate(sampleBufferDisplayLayer avfoundation.ISampleBufferDisplayLayer, playbackDelegate PPictureInPictureSampleBufferPlaybackDelegate) PictureInPictureControllerContentSource { + po1 := objc.WrapAsProtocol("AVPictureInPictureSampleBufferPlaybackDelegate", playbackDelegate) + rv := objc.Call[PictureInPictureControllerContentSource](p_, objc.Sel("initWithSampleBufferDisplayLayer:playbackDelegate:"), objc.Ptr(sampleBufferDisplayLayer), po1) + return rv +} + +// Creates a content source with a sample buffer display layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollercontentsource/3750329-initwithsamplebufferdisplaylayer?language=objc +func NewPictureInPictureControllerContentSourceWithSampleBufferDisplayLayerPlaybackDelegate(sampleBufferDisplayLayer avfoundation.ISampleBufferDisplayLayer, playbackDelegate PPictureInPictureSampleBufferPlaybackDelegate) PictureInPictureControllerContentSource { + instance := PictureInPictureControllerContentSourceClass.Alloc().InitWithSampleBufferDisplayLayerPlaybackDelegate(sampleBufferDisplayLayer, playbackDelegate) + instance.Autorelease() + return instance +} + +func (pc _PictureInPictureControllerContentSourceClass) Alloc() PictureInPictureControllerContentSource { + rv := objc.Call[PictureInPictureControllerContentSource](pc, objc.Sel("alloc")) + return rv +} + +func PictureInPictureControllerContentSource_Alloc() PictureInPictureControllerContentSource { + return PictureInPictureControllerContentSourceClass.Alloc() +} + +func (pc _PictureInPictureControllerContentSourceClass) New() PictureInPictureControllerContentSource { + rv := objc.Call[PictureInPictureControllerContentSource](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPictureInPictureControllerContentSource() PictureInPictureControllerContentSource { + return PictureInPictureControllerContentSourceClass.New() +} + +func (p_ PictureInPictureControllerContentSource) Init() PictureInPictureControllerContentSource { + rv := objc.Call[PictureInPictureControllerContentSource](p_, objc.Sel("init")) + return rv +} + +// The presenting sample buffer display layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollercontentsource/3750330-samplebufferdisplaylayer?language=objc +func (p_ PictureInPictureControllerContentSource) SampleBufferDisplayLayer() avfoundation.SampleBufferDisplayLayer { + rv := objc.Call[avfoundation.SampleBufferDisplayLayer](p_, objc.Sel("sampleBufferDisplayLayer")) + return rv +} + +// The presenting player layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollercontentsource/3750327-playerlayer?language=objc +func (p_ PictureInPictureControllerContentSource) PlayerLayer() avfoundation.PlayerLayer { + rv := objc.Call[avfoundation.PlayerLayer](p_, objc.Sel("playerLayer")) + return rv +} + +// A delegate object that responds to sample buffer playback events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollercontentsource/3750331-samplebufferplaybackdelegate?language=objc +func (p_ PictureInPictureControllerContentSource) SampleBufferPlaybackDelegate() PictureInPictureSampleBufferPlaybackDelegateWrapper { + rv := objc.Call[PictureInPictureSampleBufferPlaybackDelegateWrapper](p_, objc.Sel("sampleBufferPlaybackDelegate")) + return rv +} diff --git a/macos/avkit/picture_in_picture_controller_delegate.gen.go b/macos/avkit/picture_in_picture_controller_delegate.gen.go new file mode 100644 index 00000000..62b5c4e3 --- /dev/null +++ b/macos/avkit/picture_in_picture_controller_delegate.gen.go @@ -0,0 +1,155 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol to adopt to respond to Picture in Picture events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate?language=objc +type PPictureInPictureControllerDelegate interface { + // optional + PictureInPictureControllerDidStartPictureInPicture(pictureInPictureController PictureInPictureController) + HasPictureInPictureControllerDidStartPictureInPicture() bool + + // optional + PictureInPictureControllerDidStopPictureInPicture(pictureInPictureController PictureInPictureController) + HasPictureInPictureControllerDidStopPictureInPicture() bool + + // optional + PictureInPictureControllerWillStopPictureInPicture(pictureInPictureController PictureInPictureController) + HasPictureInPictureControllerWillStopPictureInPicture() bool + + // optional + PictureInPictureControllerFailedToStartPictureInPictureWithError(pictureInPictureController PictureInPictureController, error foundation.Error) + HasPictureInPictureControllerFailedToStartPictureInPictureWithError() bool +} + +// A delegate implementation builder for the [PPictureInPictureControllerDelegate] protocol. +type PictureInPictureControllerDelegate struct { + _PictureInPictureControllerDidStartPictureInPicture func(pictureInPictureController PictureInPictureController) + _PictureInPictureControllerDidStopPictureInPicture func(pictureInPictureController PictureInPictureController) + _PictureInPictureControllerWillStopPictureInPicture func(pictureInPictureController PictureInPictureController) + _PictureInPictureControllerFailedToStartPictureInPictureWithError func(pictureInPictureController PictureInPictureController, error foundation.Error) +} + +func (di *PictureInPictureControllerDelegate) HasPictureInPictureControllerDidStartPictureInPicture() bool { + return di._PictureInPictureControllerDidStartPictureInPicture != nil +} + +// Tells the delegate that Picture in Picture started. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614695-pictureinpicturecontrollerdidsta?language=objc +func (di *PictureInPictureControllerDelegate) SetPictureInPictureControllerDidStartPictureInPicture(f func(pictureInPictureController PictureInPictureController)) { + di._PictureInPictureControllerDidStartPictureInPicture = f +} + +// Tells the delegate that Picture in Picture started. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614695-pictureinpicturecontrollerdidsta?language=objc +func (di *PictureInPictureControllerDelegate) PictureInPictureControllerDidStartPictureInPicture(pictureInPictureController PictureInPictureController) { + di._PictureInPictureControllerDidStartPictureInPicture(pictureInPictureController) +} +func (di *PictureInPictureControllerDelegate) HasPictureInPictureControllerDidStopPictureInPicture() bool { + return di._PictureInPictureControllerDidStopPictureInPicture != nil +} + +// Tells the delegate that Picture in Picture stopped. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614717-pictureinpicturecontrollerdidsto?language=objc +func (di *PictureInPictureControllerDelegate) SetPictureInPictureControllerDidStopPictureInPicture(f func(pictureInPictureController PictureInPictureController)) { + di._PictureInPictureControllerDidStopPictureInPicture = f +} + +// Tells the delegate that Picture in Picture stopped. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614717-pictureinpicturecontrollerdidsto?language=objc +func (di *PictureInPictureControllerDelegate) PictureInPictureControllerDidStopPictureInPicture(pictureInPictureController PictureInPictureController) { + di._PictureInPictureControllerDidStopPictureInPicture(pictureInPictureController) +} +func (di *PictureInPictureControllerDelegate) HasPictureInPictureControllerWillStopPictureInPicture() bool { + return di._PictureInPictureControllerWillStopPictureInPicture != nil +} + +// Tells the delegate that Picture in Picture is about to stop. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614719-pictureinpicturecontrollerwillst?language=objc +func (di *PictureInPictureControllerDelegate) SetPictureInPictureControllerWillStopPictureInPicture(f func(pictureInPictureController PictureInPictureController)) { + di._PictureInPictureControllerWillStopPictureInPicture = f +} + +// Tells the delegate that Picture in Picture is about to stop. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614719-pictureinpicturecontrollerwillst?language=objc +func (di *PictureInPictureControllerDelegate) PictureInPictureControllerWillStopPictureInPicture(pictureInPictureController PictureInPictureController) { + di._PictureInPictureControllerWillStopPictureInPicture(pictureInPictureController) +} +func (di *PictureInPictureControllerDelegate) HasPictureInPictureControllerFailedToStartPictureInPictureWithError() bool { + return di._PictureInPictureControllerFailedToStartPictureInPictureWithError != nil +} + +// Tells the delegate that Picture in Picture failed to start. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614697-pictureinpicturecontroller?language=objc +func (di *PictureInPictureControllerDelegate) SetPictureInPictureControllerFailedToStartPictureInPictureWithError(f func(pictureInPictureController PictureInPictureController, error foundation.Error)) { + di._PictureInPictureControllerFailedToStartPictureInPictureWithError = f +} + +// Tells the delegate that Picture in Picture failed to start. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614697-pictureinpicturecontroller?language=objc +func (di *PictureInPictureControllerDelegate) PictureInPictureControllerFailedToStartPictureInPictureWithError(pictureInPictureController PictureInPictureController, error foundation.Error) { + di._PictureInPictureControllerFailedToStartPictureInPictureWithError(pictureInPictureController, error) +} + +// A concrete type wrapper for the [PPictureInPictureControllerDelegate] protocol. +type PictureInPictureControllerDelegateWrapper struct { + objc.Object +} + +func (p_ PictureInPictureControllerDelegateWrapper) HasPictureInPictureControllerDidStartPictureInPicture() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureControllerDidStartPictureInPicture:")) +} + +// Tells the delegate that Picture in Picture started. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614695-pictureinpicturecontrollerdidsta?language=objc +func (p_ PictureInPictureControllerDelegateWrapper) PictureInPictureControllerDidStartPictureInPicture(pictureInPictureController IPictureInPictureController) { + objc.Call[objc.Void](p_, objc.Sel("pictureInPictureControllerDidStartPictureInPicture:"), objc.Ptr(pictureInPictureController)) +} + +func (p_ PictureInPictureControllerDelegateWrapper) HasPictureInPictureControllerDidStopPictureInPicture() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureControllerDidStopPictureInPicture:")) +} + +// Tells the delegate that Picture in Picture stopped. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614717-pictureinpicturecontrollerdidsto?language=objc +func (p_ PictureInPictureControllerDelegateWrapper) PictureInPictureControllerDidStopPictureInPicture(pictureInPictureController IPictureInPictureController) { + objc.Call[objc.Void](p_, objc.Sel("pictureInPictureControllerDidStopPictureInPicture:"), objc.Ptr(pictureInPictureController)) +} + +func (p_ PictureInPictureControllerDelegateWrapper) HasPictureInPictureControllerWillStopPictureInPicture() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureControllerWillStopPictureInPicture:")) +} + +// Tells the delegate that Picture in Picture is about to stop. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614719-pictureinpicturecontrollerwillst?language=objc +func (p_ PictureInPictureControllerDelegateWrapper) PictureInPictureControllerWillStopPictureInPicture(pictureInPictureController IPictureInPictureController) { + objc.Call[objc.Void](p_, objc.Sel("pictureInPictureControllerWillStopPictureInPicture:"), objc.Ptr(pictureInPictureController)) +} + +func (p_ PictureInPictureControllerDelegateWrapper) HasPictureInPictureControllerFailedToStartPictureInPictureWithError() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureController:failedToStartPictureInPictureWithError:")) +} + +// Tells the delegate that Picture in Picture failed to start. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate/1614697-pictureinpicturecontroller?language=objc +func (p_ PictureInPictureControllerDelegateWrapper) PictureInPictureControllerFailedToStartPictureInPictureWithError(pictureInPictureController IPictureInPictureController, error foundation.IError) { + objc.Call[objc.Void](p_, objc.Sel("pictureInPictureController:failedToStartPictureInPictureWithError:"), objc.Ptr(pictureInPictureController), objc.Ptr(error)) +} diff --git a/macos/avkit/picture_in_picture_sample_buffer_playback_delegate.gen.go b/macos/avkit/picture_in_picture_sample_buffer_playback_delegate.gen.go new file mode 100644 index 00000000..2541dd89 --- /dev/null +++ b/macos/avkit/picture_in_picture_sample_buffer_playback_delegate.gen.go @@ -0,0 +1,158 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// A protocol for controlling playback from a sample buffer display layer in Picture in Picture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate?language=objc +type PPictureInPictureSampleBufferPlaybackDelegate interface { + // optional + PictureInPictureControllerShouldProhibitBackgroundAudioPlayback(pictureInPictureController PictureInPictureController) bool + HasPictureInPictureControllerShouldProhibitBackgroundAudioPlayback() bool + + // optional + PictureInPictureControllerIsPlaybackPaused(pictureInPictureController PictureInPictureController) bool + HasPictureInPictureControllerIsPlaybackPaused() bool + + // optional + PictureInPictureControllerTimeRangeForPlayback(pictureInPictureController PictureInPictureController) coremedia.TimeRange + HasPictureInPictureControllerTimeRangeForPlayback() bool + + // optional + PictureInPictureControllerSetPlaying(pictureInPictureController PictureInPictureController, playing bool) + HasPictureInPictureControllerSetPlaying() bool +} + +// A delegate implementation builder for the [PPictureInPictureSampleBufferPlaybackDelegate] protocol. +type PictureInPictureSampleBufferPlaybackDelegate struct { + _PictureInPictureControllerShouldProhibitBackgroundAudioPlayback func(pictureInPictureController PictureInPictureController) bool + _PictureInPictureControllerIsPlaybackPaused func(pictureInPictureController PictureInPictureController) bool + _PictureInPictureControllerTimeRangeForPlayback func(pictureInPictureController PictureInPictureController) coremedia.TimeRange + _PictureInPictureControllerSetPlaying func(pictureInPictureController PictureInPictureController, playing bool) +} + +func (di *PictureInPictureSampleBufferPlaybackDelegate) HasPictureInPictureControllerShouldProhibitBackgroundAudioPlayback() bool { + return di._PictureInPictureControllerShouldProhibitBackgroundAudioPlayback != nil +} + +// Asks the delegate whether to always prohibit background audio playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3857563-pictureinpicturecontrollershould?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) SetPictureInPictureControllerShouldProhibitBackgroundAudioPlayback(f func(pictureInPictureController PictureInPictureController) bool) { + di._PictureInPictureControllerShouldProhibitBackgroundAudioPlayback = f +} + +// Asks the delegate whether to always prohibit background audio playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3857563-pictureinpicturecontrollershould?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) PictureInPictureControllerShouldProhibitBackgroundAudioPlayback(pictureInPictureController PictureInPictureController) bool { + return di._PictureInPictureControllerShouldProhibitBackgroundAudioPlayback(pictureInPictureController) +} +func (di *PictureInPictureSampleBufferPlaybackDelegate) HasPictureInPictureControllerIsPlaybackPaused() bool { + return di._PictureInPictureControllerIsPlaybackPaused != nil +} + +// Asks delegate to indicate whether the playback UI reflects a playing or paused state, regardless of the current playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750336-pictureinpicturecontrollerisplay?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) SetPictureInPictureControllerIsPlaybackPaused(f func(pictureInPictureController PictureInPictureController) bool) { + di._PictureInPictureControllerIsPlaybackPaused = f +} + +// Asks delegate to indicate whether the playback UI reflects a playing or paused state, regardless of the current playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750336-pictureinpicturecontrollerisplay?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) PictureInPictureControllerIsPlaybackPaused(pictureInPictureController PictureInPictureController) bool { + return di._PictureInPictureControllerIsPlaybackPaused(pictureInPictureController) +} +func (di *PictureInPictureSampleBufferPlaybackDelegate) HasPictureInPictureControllerTimeRangeForPlayback() bool { + return di._PictureInPictureControllerTimeRangeForPlayback != nil +} + +// Asks the delegate for the current playable time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750337-pictureinpicturecontrollertimera?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) SetPictureInPictureControllerTimeRangeForPlayback(f func(pictureInPictureController PictureInPictureController) coremedia.TimeRange) { + di._PictureInPictureControllerTimeRangeForPlayback = f +} + +// Asks the delegate for the current playable time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750337-pictureinpicturecontrollertimera?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) PictureInPictureControllerTimeRangeForPlayback(pictureInPictureController PictureInPictureController) coremedia.TimeRange { + return di._PictureInPictureControllerTimeRangeForPlayback(pictureInPictureController) +} +func (di *PictureInPictureSampleBufferPlaybackDelegate) HasPictureInPictureControllerSetPlaying() bool { + return di._PictureInPictureControllerSetPlaying != nil +} + +// Tells the delegate that the user requested to begin or pause playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750334-pictureinpicturecontroller?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) SetPictureInPictureControllerSetPlaying(f func(pictureInPictureController PictureInPictureController, playing bool)) { + di._PictureInPictureControllerSetPlaying = f +} + +// Tells the delegate that the user requested to begin or pause playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750334-pictureinpicturecontroller?language=objc +func (di *PictureInPictureSampleBufferPlaybackDelegate) PictureInPictureControllerSetPlaying(pictureInPictureController PictureInPictureController, playing bool) { + di._PictureInPictureControllerSetPlaying(pictureInPictureController, playing) +} + +// A concrete type wrapper for the [PPictureInPictureSampleBufferPlaybackDelegate] protocol. +type PictureInPictureSampleBufferPlaybackDelegateWrapper struct { + objc.Object +} + +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) HasPictureInPictureControllerShouldProhibitBackgroundAudioPlayback() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureControllerShouldProhibitBackgroundAudioPlayback:")) +} + +// Asks the delegate whether to always prohibit background audio playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3857563-pictureinpicturecontrollershould?language=objc +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) PictureInPictureControllerShouldProhibitBackgroundAudioPlayback(pictureInPictureController IPictureInPictureController) bool { + rv := objc.Call[bool](p_, objc.Sel("pictureInPictureControllerShouldProhibitBackgroundAudioPlayback:"), objc.Ptr(pictureInPictureController)) + return rv +} + +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) HasPictureInPictureControllerIsPlaybackPaused() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureControllerIsPlaybackPaused:")) +} + +// Asks delegate to indicate whether the playback UI reflects a playing or paused state, regardless of the current playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750336-pictureinpicturecontrollerisplay?language=objc +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) PictureInPictureControllerIsPlaybackPaused(pictureInPictureController IPictureInPictureController) bool { + rv := objc.Call[bool](p_, objc.Sel("pictureInPictureControllerIsPlaybackPaused:"), objc.Ptr(pictureInPictureController)) + return rv +} + +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) HasPictureInPictureControllerTimeRangeForPlayback() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureControllerTimeRangeForPlayback:")) +} + +// Asks the delegate for the current playable time range. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750337-pictureinpicturecontrollertimera?language=objc +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) PictureInPictureControllerTimeRangeForPlayback(pictureInPictureController IPictureInPictureController) coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](p_, objc.Sel("pictureInPictureControllerTimeRangeForPlayback:"), objc.Ptr(pictureInPictureController)) + return rv +} + +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) HasPictureInPictureControllerSetPlaying() bool { + return p_.RespondsToSelector(objc.Sel("pictureInPictureController:setPlaying:")) +} + +// Tells the delegate that the user requested to begin or pause playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avpictureinpicturesamplebufferplaybackdelegate/3750334-pictureinpicturecontroller?language=objc +func (p_ PictureInPictureSampleBufferPlaybackDelegateWrapper) PictureInPictureControllerSetPlaying(pictureInPictureController IPictureInPictureController, playing bool) { + objc.Call[objc.Void](p_, objc.Sel("pictureInPictureController:setPlaying:"), objc.Ptr(pictureInPictureController), playing) +} diff --git a/macos/avkit/player_view.gen.go b/macos/avkit/player_view.gen.go new file mode 100644 index 00000000..58ae2ea0 --- /dev/null +++ b/macos/avkit/player_view.gen.go @@ -0,0 +1,351 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/avfoundation" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlayerView] class. +var PlayerViewClass = _PlayerViewClass{objc.GetClass("AVPlayerView")} + +type _PlayerViewClass struct { + objc.Class +} + +// An interface definition for the [PlayerView] class. +type IPlayerView interface { + appkit.IView + BeginTrimmingWithCompletionHandler(handler func(result PlayerViewTrimResult)) + FlashChapterNumberChapterTitle(chapterNumber uint, chapterTitle string) + VideoGravity() avfoundation.LayerVideoGravity + SetVideoGravity(value avfoundation.LayerVideoGravity) + ShowsFrameSteppingButtons() bool + SetShowsFrameSteppingButtons(value bool) + VideoBounds() foundation.Rect + ContentOverlayView() appkit.View + Player() avfoundation.Player + SetPlayer(value avfoundation.IPlayer) + ShowsSharingServiceButton() bool + SetShowsSharingServiceButton(value bool) + Delegate() PlayerViewDelegateWrapper + SetDelegate(value PPlayerViewDelegate) + SetDelegateObject(valueObject objc.IObject) + IsReadyForDisplay() bool + ShowsTimecodes() bool + SetShowsTimecodes(value bool) + AllowsPictureInPicturePlayback() bool + SetAllowsPictureInPicturePlayback(value bool) + ActionPopUpButtonMenu() appkit.Menu + SetActionPopUpButtonMenu(value appkit.IMenu) + UpdatesNowPlayingInfoCenter() bool + SetUpdatesNowPlayingInfoCenter(value bool) + CanBeginTrimming() bool + ControlsStyle() PlayerViewControlsStyle + SetControlsStyle(value PlayerViewControlsStyle) + PictureInPictureDelegate() PlayerViewPictureInPictureDelegateWrapper + SetPictureInPictureDelegate(value PPlayerViewPictureInPictureDelegate) + SetPictureInPictureDelegateObject(valueObject objc.IObject) + ShowsFullScreenToggleButton() bool + SetShowsFullScreenToggleButton(value bool) +} + +// A view that displays content from a player and presents a native user interface to control playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview?language=objc +type PlayerView struct { + appkit.View +} + +func PlayerViewFrom(ptr unsafe.Pointer) PlayerView { + return PlayerView{ + View: appkit.ViewFrom(ptr), + } +} + +func (pc _PlayerViewClass) Alloc() PlayerView { + rv := objc.Call[PlayerView](pc, objc.Sel("alloc")) + return rv +} + +func PlayerView_Alloc() PlayerView { + return PlayerViewClass.Alloc() +} + +func (pc _PlayerViewClass) New() PlayerView { + rv := objc.Call[PlayerView](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlayerView() PlayerView { + return PlayerViewClass.New() +} + +func (p_ PlayerView) Init() PlayerView { + rv := objc.Call[PlayerView](p_, objc.Sel("init")) + return rv +} + +func (p_ PlayerView) InitWithFrame(frameRect foundation.Rect) PlayerView { + rv := objc.Call[PlayerView](p_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewPlayerViewWithFrame(frameRect foundation.Rect) PlayerView { + instance := PlayerViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// Puts the player view into trimming mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416570-begintrimmingwithcompletionhandl?language=objc +func (p_ PlayerView) BeginTrimmingWithCompletionHandler(handler func(result PlayerViewTrimResult)) { + objc.Call[objc.Void](p_, objc.Sel("beginTrimmingWithCompletionHandler:"), handler) +} + +// Displays the chapter number and title in the player view for a brief moment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416547-flashchapternumber?language=objc +func (p_ PlayerView) FlashChapterNumberChapterTitle(chapterNumber uint, chapterTitle string) { + objc.Call[objc.Void](p_, objc.Sel("flashChapterNumber:chapterTitle:"), chapterNumber, chapterTitle) +} + +// A value that determines how the player view displays video content within its bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416559-videogravity?language=objc +func (p_ PlayerView) VideoGravity() avfoundation.LayerVideoGravity { + rv := objc.Call[avfoundation.LayerVideoGravity](p_, objc.Sel("videoGravity")) + return rv +} + +// A value that determines how the player view displays video content within its bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416559-videogravity?language=objc +func (p_ PlayerView) SetVideoGravity(value avfoundation.LayerVideoGravity) { + objc.Call[objc.Void](p_, objc.Sel("setVideoGravity:"), value) +} + +// A Boolean value that determines whether the player view displays frame stepping buttons. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416567-showsframesteppingbuttons?language=objc +func (p_ PlayerView) ShowsFrameSteppingButtons() bool { + rv := objc.Call[bool](p_, objc.Sel("showsFrameSteppingButtons")) + return rv +} + +// A Boolean value that determines whether the player view displays frame stepping buttons. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416567-showsframesteppingbuttons?language=objc +func (p_ PlayerView) SetShowsFrameSteppingButtons(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setShowsFrameSteppingButtons:"), value) +} + +// The current size and position of the video image that displays within the player view’s bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416549-videobounds?language=objc +func (p_ PlayerView) VideoBounds() foundation.Rect { + rv := objc.Call[foundation.Rect](p_, objc.Sel("videoBounds")) + return rv +} + +// A view that adds additional custom views between the video content and the controls. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416573-contentoverlayview?language=objc +func (p_ PlayerView) ContentOverlayView() appkit.View { + rv := objc.Call[appkit.View](p_, objc.Sel("contentOverlayView")) + return rv +} + +// The player instance that provides the media content for the view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416539-player?language=objc +func (p_ PlayerView) Player() avfoundation.Player { + rv := objc.Call[avfoundation.Player](p_, objc.Sel("player")) + return rv +} + +// The player instance that provides the media content for the view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416539-player?language=objc +func (p_ PlayerView) SetPlayer(value avfoundation.IPlayer) { + objc.Call[objc.Void](p_, objc.Sel("setPlayer:"), objc.Ptr(value)) +} + +// A Boolean value that determines whether the player view displays a sharing service button. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416558-showssharingservicebutton?language=objc +func (p_ PlayerView) ShowsSharingServiceButton() bool { + rv := objc.Call[bool](p_, objc.Sel("showsSharingServiceButton")) + return rv +} + +// A Boolean value that determines whether the player view displays a sharing service button. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416558-showssharingservicebutton?language=objc +func (p_ PlayerView) SetShowsSharingServiceButton(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setShowsSharingServiceButton:"), value) +} + +// The player view’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3752984-delegate?language=objc +func (p_ PlayerView) Delegate() PlayerViewDelegateWrapper { + rv := objc.Call[PlayerViewDelegateWrapper](p_, objc.Sel("delegate")) + return rv +} + +// The player view’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3752984-delegate?language=objc +func (p_ PlayerView) SetDelegate(value PPlayerViewDelegate) { + po0 := objc.WrapAsProtocol("AVPlayerViewDelegate", value) + objc.SetAssociatedObject(p_, objc.AssociationKey("setDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](p_, objc.Sel("setDelegate:"), po0) +} + +// The player view’s delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3752984-delegate?language=objc +func (p_ PlayerView) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](p_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// A Boolean value that indicates whether the current player item’s first video frame is ready for display. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416556-readyfordisplay?language=objc +func (p_ PlayerView) IsReadyForDisplay() bool { + rv := objc.Call[bool](p_, objc.Sel("isReadyForDisplay")) + return rv +} + +// A Boolean value that determines whether the player view displays timecodes, if available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3174919-showstimecodes?language=objc +func (p_ PlayerView) ShowsTimecodes() bool { + rv := objc.Call[bool](p_, objc.Sel("showsTimecodes")) + return rv +} + +// A Boolean value that determines whether the player view displays timecodes, if available. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3174919-showstimecodes?language=objc +func (p_ PlayerView) SetShowsTimecodes(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setShowsTimecodes:"), value) +} + +// A Boolean value that determines whether the player view allows Picture in Picture playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3172688-allowspictureinpictureplayback?language=objc +func (p_ PlayerView) AllowsPictureInPicturePlayback() bool { + rv := objc.Call[bool](p_, objc.Sel("allowsPictureInPicturePlayback")) + return rv +} + +// A Boolean value that determines whether the player view allows Picture in Picture playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3172688-allowspictureinpictureplayback?language=objc +func (p_ PlayerView) SetAllowsPictureInPicturePlayback(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setAllowsPictureInPicturePlayback:"), value) +} + +// An action pop-up button menu that the player view displays. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416543-actionpopupbuttonmenu?language=objc +func (p_ PlayerView) ActionPopUpButtonMenu() appkit.Menu { + rv := objc.Call[appkit.Menu](p_, objc.Sel("actionPopUpButtonMenu")) + return rv +} + +// An action pop-up button menu that the player view displays. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416543-actionpopupbuttonmenu?language=objc +func (p_ PlayerView) SetActionPopUpButtonMenu(value appkit.IMenu) { + objc.Call[objc.Void](p_, objc.Sel("setActionPopUpButtonMenu:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether the player view controller updates the Now Playing info center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/2876219-updatesnowplayinginfocenter?language=objc +func (p_ PlayerView) UpdatesNowPlayingInfoCenter() bool { + rv := objc.Call[bool](p_, objc.Sel("updatesNowPlayingInfoCenter")) + return rv +} + +// A Boolean value that indicates whether the player view controller updates the Now Playing info center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/2876219-updatesnowplayinginfocenter?language=objc +func (p_ PlayerView) SetUpdatesNowPlayingInfoCenter(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setUpdatesNowPlayingInfoCenter:"), value) +} + +// A Boolean value that indicates whether the player view can begin trimming. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416545-canbegintrimming?language=objc +func (p_ PlayerView) CanBeginTrimming() bool { + rv := objc.Call[bool](p_, objc.Sel("canBeginTrimming")) + return rv +} + +// The player view’s controls style. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416565-controlsstyle?language=objc +func (p_ PlayerView) ControlsStyle() PlayerViewControlsStyle { + rv := objc.Call[PlayerViewControlsStyle](p_, objc.Sel("controlsStyle")) + return rv +} + +// The player view’s controls style. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416565-controlsstyle?language=objc +func (p_ PlayerView) SetControlsStyle(value PlayerViewControlsStyle) { + objc.Call[objc.Void](p_, objc.Sel("setControlsStyle:"), value) +} + +// The Picture in Picture delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3172689-pictureinpicturedelegate?language=objc +func (p_ PlayerView) PictureInPictureDelegate() PlayerViewPictureInPictureDelegateWrapper { + rv := objc.Call[PlayerViewPictureInPictureDelegateWrapper](p_, objc.Sel("pictureInPictureDelegate")) + return rv +} + +// The Picture in Picture delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3172689-pictureinpicturedelegate?language=objc +func (p_ PlayerView) SetPictureInPictureDelegate(value PPlayerViewPictureInPictureDelegate) { + po0 := objc.WrapAsProtocol("AVPlayerViewPictureInPictureDelegate", value) + objc.SetAssociatedObject(p_, objc.AssociationKey("setPictureInPictureDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](p_, objc.Sel("setPictureInPictureDelegate:"), po0) +} + +// The Picture in Picture delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/3172689-pictureinpicturedelegate?language=objc +func (p_ PlayerView) SetPictureInPictureDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](p_, objc.Sel("setPictureInPictureDelegate:"), objc.Ptr(valueObject)) +} + +// A Boolean value that determines whether the player view displays a full-screen toggle button. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416561-showsfullscreentogglebutton?language=objc +func (p_ PlayerView) ShowsFullScreenToggleButton() bool { + rv := objc.Call[bool](p_, objc.Sel("showsFullScreenToggleButton")) + return rv +} + +// A Boolean value that determines whether the player view displays a full-screen toggle button. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerview/1416561-showsfullscreentogglebutton?language=objc +func (p_ PlayerView) SetShowsFullScreenToggleButton(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setShowsFullScreenToggleButton:"), value) +} diff --git a/macos/avkit/player_view_delegate.gen.go b/macos/avkit/player_view_delegate.gen.go new file mode 100644 index 00000000..d75e2a67 --- /dev/null +++ b/macos/avkit/player_view_delegate.gen.go @@ -0,0 +1,187 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods to implement to participate in the player view’s full-screen presentation life cycle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate?language=objc +type PPlayerViewDelegate interface { + // optional + PlayerViewWillEnterFullScreen(playerView PlayerView) + HasPlayerViewWillEnterFullScreen() bool + + // optional + PlayerViewDidEnterFullScreen(playerView PlayerView) + HasPlayerViewDidEnterFullScreen() bool + + // optional + PlayerViewWillExitFullScreen(playerView PlayerView) + HasPlayerViewWillExitFullScreen() bool + + // optional + PlayerViewDidExitFullScreen(playerView PlayerView) + HasPlayerViewDidExitFullScreen() bool + + // optional + PlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler(playerView PlayerView, completionHandler func(restored bool)) + HasPlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler() bool +} + +// A delegate implementation builder for the [PPlayerViewDelegate] protocol. +type PlayerViewDelegate struct { + _PlayerViewWillEnterFullScreen func(playerView PlayerView) + _PlayerViewDidEnterFullScreen func(playerView PlayerView) + _PlayerViewWillExitFullScreen func(playerView PlayerView) + _PlayerViewDidExitFullScreen func(playerView PlayerView) + _PlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler func(playerView PlayerView, completionHandler func(restored bool)) +} + +func (di *PlayerViewDelegate) HasPlayerViewWillEnterFullScreen() bool { + return di._PlayerViewWillEnterFullScreen != nil +} + +// Tells the delegate that the player view is about to enter full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752989-playerviewwillenterfullscreen?language=objc +func (di *PlayerViewDelegate) SetPlayerViewWillEnterFullScreen(f func(playerView PlayerView)) { + di._PlayerViewWillEnterFullScreen = f +} + +// Tells the delegate that the player view is about to enter full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752989-playerviewwillenterfullscreen?language=objc +func (di *PlayerViewDelegate) PlayerViewWillEnterFullScreen(playerView PlayerView) { + di._PlayerViewWillEnterFullScreen(playerView) +} +func (di *PlayerViewDelegate) HasPlayerViewDidEnterFullScreen() bool { + return di._PlayerViewDidEnterFullScreen != nil +} + +// Tells the delegate that the player view entered full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752987-playerviewdidenterfullscreen?language=objc +func (di *PlayerViewDelegate) SetPlayerViewDidEnterFullScreen(f func(playerView PlayerView)) { + di._PlayerViewDidEnterFullScreen = f +} + +// Tells the delegate that the player view entered full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752987-playerviewdidenterfullscreen?language=objc +func (di *PlayerViewDelegate) PlayerViewDidEnterFullScreen(playerView PlayerView) { + di._PlayerViewDidEnterFullScreen(playerView) +} +func (di *PlayerViewDelegate) HasPlayerViewWillExitFullScreen() bool { + return di._PlayerViewWillExitFullScreen != nil +} + +// Tells the delegate that the player view is about to exit full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752990-playerviewwillexitfullscreen?language=objc +func (di *PlayerViewDelegate) SetPlayerViewWillExitFullScreen(f func(playerView PlayerView)) { + di._PlayerViewWillExitFullScreen = f +} + +// Tells the delegate that the player view is about to exit full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752990-playerviewwillexitfullscreen?language=objc +func (di *PlayerViewDelegate) PlayerViewWillExitFullScreen(playerView PlayerView) { + di._PlayerViewWillExitFullScreen(playerView) +} +func (di *PlayerViewDelegate) HasPlayerViewDidExitFullScreen() bool { + return di._PlayerViewDidExitFullScreen != nil +} + +// Tells the delegate that the player view exited full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752988-playerviewdidexitfullscreen?language=objc +func (di *PlayerViewDelegate) SetPlayerViewDidExitFullScreen(f func(playerView PlayerView)) { + di._PlayerViewDidExitFullScreen = f +} + +// Tells the delegate that the player view exited full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752988-playerviewdidexitfullscreen?language=objc +func (di *PlayerViewDelegate) PlayerViewDidExitFullScreen(playerView PlayerView) { + di._PlayerViewDidExitFullScreen(playerView) +} +func (di *PlayerViewDelegate) HasPlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler() bool { + return di._PlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler != nil +} + +// Tells the delegate to restore the app’s user interface when exiting full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752986-playerview?language=objc +func (di *PlayerViewDelegate) SetPlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler(f func(playerView PlayerView, completionHandler func(restored bool))) { + di._PlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler = f +} + +// Tells the delegate to restore the app’s user interface when exiting full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752986-playerview?language=objc +func (di *PlayerViewDelegate) PlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler(playerView PlayerView, completionHandler func(restored bool)) { + di._PlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler(playerView, completionHandler) +} + +// A concrete type wrapper for the [PPlayerViewDelegate] protocol. +type PlayerViewDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerViewDelegateWrapper) HasPlayerViewWillEnterFullScreen() bool { + return p_.RespondsToSelector(objc.Sel("playerViewWillEnterFullScreen:")) +} + +// Tells the delegate that the player view is about to enter full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752989-playerviewwillenterfullscreen?language=objc +func (p_ PlayerViewDelegateWrapper) PlayerViewWillEnterFullScreen(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewWillEnterFullScreen:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewDelegateWrapper) HasPlayerViewDidEnterFullScreen() bool { + return p_.RespondsToSelector(objc.Sel("playerViewDidEnterFullScreen:")) +} + +// Tells the delegate that the player view entered full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752987-playerviewdidenterfullscreen?language=objc +func (p_ PlayerViewDelegateWrapper) PlayerViewDidEnterFullScreen(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewDidEnterFullScreen:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewDelegateWrapper) HasPlayerViewWillExitFullScreen() bool { + return p_.RespondsToSelector(objc.Sel("playerViewWillExitFullScreen:")) +} + +// Tells the delegate that the player view is about to exit full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752990-playerviewwillexitfullscreen?language=objc +func (p_ PlayerViewDelegateWrapper) PlayerViewWillExitFullScreen(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewWillExitFullScreen:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewDelegateWrapper) HasPlayerViewDidExitFullScreen() bool { + return p_.RespondsToSelector(objc.Sel("playerViewDidExitFullScreen:")) +} + +// Tells the delegate that the player view exited full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752988-playerviewdidexitfullscreen?language=objc +func (p_ PlayerViewDelegateWrapper) PlayerViewDidExitFullScreen(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewDidExitFullScreen:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewDelegateWrapper) HasPlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler() bool { + return p_.RespondsToSelector(objc.Sel("playerView:restoreUserInterfaceForFullScreenExitWithCompletionHandler:")) +} + +// Tells the delegate to restore the app’s user interface when exiting full-screen mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewdelegate/3752986-playerview?language=objc +func (p_ PlayerViewDelegateWrapper) PlayerViewRestoreUserInterfaceForFullScreenExitWithCompletionHandler(playerView IPlayerView, completionHandler func(restored bool)) { + objc.Call[objc.Void](p_, objc.Sel("playerView:restoreUserInterfaceForFullScreenExitWithCompletionHandler:"), objc.Ptr(playerView), completionHandler) +} diff --git a/macos/avkit/player_view_picture_in_picture_delegate.gen.go b/macos/avkit/player_view_picture_in_picture_delegate.gen.go new file mode 100644 index 00000000..aa404c35 --- /dev/null +++ b/macos/avkit/player_view_picture_in_picture_delegate.gen.go @@ -0,0 +1,221 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods to implement to respond to Picture in Picture playback events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate?language=objc +type PPlayerViewPictureInPictureDelegate interface { + // optional + PlayerViewWillStartPictureInPicture(playerView PlayerView) + HasPlayerViewWillStartPictureInPicture() bool + + // optional + PlayerViewDidStopPictureInPicture(playerView PlayerView) + HasPlayerViewDidStopPictureInPicture() bool + + // optional + PlayerViewDidStartPictureInPicture(playerView PlayerView) + HasPlayerViewDidStartPictureInPicture() bool + + // optional + PlayerViewShouldAutomaticallyDismissAtPictureInPictureStart(playerView PlayerView) bool + HasPlayerViewShouldAutomaticallyDismissAtPictureInPictureStart() bool + + // optional + PlayerViewWillStopPictureInPicture(playerView PlayerView) + HasPlayerViewWillStopPictureInPicture() bool + + // optional + PlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler(playerView PlayerView, completionHandler func(restored bool)) + HasPlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler() bool +} + +// A delegate implementation builder for the [PPlayerViewPictureInPictureDelegate] protocol. +type PlayerViewPictureInPictureDelegate struct { + _PlayerViewWillStartPictureInPicture func(playerView PlayerView) + _PlayerViewDidStopPictureInPicture func(playerView PlayerView) + _PlayerViewDidStartPictureInPicture func(playerView PlayerView) + _PlayerViewShouldAutomaticallyDismissAtPictureInPictureStart func(playerView PlayerView) bool + _PlayerViewWillStopPictureInPicture func(playerView PlayerView) + _PlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler func(playerView PlayerView, completionHandler func(restored bool)) +} + +func (di *PlayerViewPictureInPictureDelegate) HasPlayerViewWillStartPictureInPicture() bool { + return di._PlayerViewWillStartPictureInPicture != nil +} + +// Tells the delegate that Picture in Picture playback is about to start. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172696-playerviewwillstartpictureinpict?language=objc +func (di *PlayerViewPictureInPictureDelegate) SetPlayerViewWillStartPictureInPicture(f func(playerView PlayerView)) { + di._PlayerViewWillStartPictureInPicture = f +} + +// Tells the delegate that Picture in Picture playback is about to start. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172696-playerviewwillstartpictureinpict?language=objc +func (di *PlayerViewPictureInPictureDelegate) PlayerViewWillStartPictureInPicture(playerView PlayerView) { + di._PlayerViewWillStartPictureInPicture(playerView) +} +func (di *PlayerViewPictureInPictureDelegate) HasPlayerViewDidStopPictureInPicture() bool { + return di._PlayerViewDidStopPictureInPicture != nil +} + +// Tells the delegate that Picture in Picture playback stopped. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172694-playerviewdidstoppictureinpictur?language=objc +func (di *PlayerViewPictureInPictureDelegate) SetPlayerViewDidStopPictureInPicture(f func(playerView PlayerView)) { + di._PlayerViewDidStopPictureInPicture = f +} + +// Tells the delegate that Picture in Picture playback stopped. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172694-playerviewdidstoppictureinpictur?language=objc +func (di *PlayerViewPictureInPictureDelegate) PlayerViewDidStopPictureInPicture(playerView PlayerView) { + di._PlayerViewDidStopPictureInPicture(playerView) +} +func (di *PlayerViewPictureInPictureDelegate) HasPlayerViewDidStartPictureInPicture() bool { + return di._PlayerViewDidStartPictureInPicture != nil +} + +// Tells the delegate that Picture in Picture playback started. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172693-playerviewdidstartpictureinpictu?language=objc +func (di *PlayerViewPictureInPictureDelegate) SetPlayerViewDidStartPictureInPicture(f func(playerView PlayerView)) { + di._PlayerViewDidStartPictureInPicture = f +} + +// Tells the delegate that Picture in Picture playback started. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172693-playerviewdidstartpictureinpictu?language=objc +func (di *PlayerViewPictureInPictureDelegate) PlayerViewDidStartPictureInPicture(playerView PlayerView) { + di._PlayerViewDidStartPictureInPicture(playerView) +} +func (di *PlayerViewPictureInPictureDelegate) HasPlayerViewShouldAutomaticallyDismissAtPictureInPictureStart() bool { + return di._PlayerViewShouldAutomaticallyDismissAtPictureInPictureStart != nil +} + +// Asks the delegate if the player view should miniaturize when Picture in Picture starts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172695-playerviewshouldautomaticallydis?language=objc +func (di *PlayerViewPictureInPictureDelegate) SetPlayerViewShouldAutomaticallyDismissAtPictureInPictureStart(f func(playerView PlayerView) bool) { + di._PlayerViewShouldAutomaticallyDismissAtPictureInPictureStart = f +} + +// Asks the delegate if the player view should miniaturize when Picture in Picture starts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172695-playerviewshouldautomaticallydis?language=objc +func (di *PlayerViewPictureInPictureDelegate) PlayerViewShouldAutomaticallyDismissAtPictureInPictureStart(playerView PlayerView) bool { + return di._PlayerViewShouldAutomaticallyDismissAtPictureInPictureStart(playerView) +} +func (di *PlayerViewPictureInPictureDelegate) HasPlayerViewWillStopPictureInPicture() bool { + return di._PlayerViewWillStopPictureInPicture != nil +} + +// Tells the delegate that Picture in Picture playback is about to stop. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172697-playerviewwillstoppictureinpictu?language=objc +func (di *PlayerViewPictureInPictureDelegate) SetPlayerViewWillStopPictureInPicture(f func(playerView PlayerView)) { + di._PlayerViewWillStopPictureInPicture = f +} + +// Tells the delegate that Picture in Picture playback is about to stop. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172697-playerviewwillstoppictureinpictu?language=objc +func (di *PlayerViewPictureInPictureDelegate) PlayerViewWillStopPictureInPicture(playerView PlayerView) { + di._PlayerViewWillStopPictureInPicture(playerView) +} +func (di *PlayerViewPictureInPictureDelegate) HasPlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler() bool { + return di._PlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler != nil +} + +// Tells the delegate to restore the user interface before Picture in Picture playback stops. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172692-playerview?language=objc +func (di *PlayerViewPictureInPictureDelegate) SetPlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler(f func(playerView PlayerView, completionHandler func(restored bool))) { + di._PlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler = f +} + +// Tells the delegate to restore the user interface before Picture in Picture playback stops. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172692-playerview?language=objc +func (di *PlayerViewPictureInPictureDelegate) PlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler(playerView PlayerView, completionHandler func(restored bool)) { + di._PlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler(playerView, completionHandler) +} + +// A concrete type wrapper for the [PPlayerViewPictureInPictureDelegate] protocol. +type PlayerViewPictureInPictureDelegateWrapper struct { + objc.Object +} + +func (p_ PlayerViewPictureInPictureDelegateWrapper) HasPlayerViewWillStartPictureInPicture() bool { + return p_.RespondsToSelector(objc.Sel("playerViewWillStartPictureInPicture:")) +} + +// Tells the delegate that Picture in Picture playback is about to start. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172696-playerviewwillstartpictureinpict?language=objc +func (p_ PlayerViewPictureInPictureDelegateWrapper) PlayerViewWillStartPictureInPicture(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewWillStartPictureInPicture:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewPictureInPictureDelegateWrapper) HasPlayerViewDidStopPictureInPicture() bool { + return p_.RespondsToSelector(objc.Sel("playerViewDidStopPictureInPicture:")) +} + +// Tells the delegate that Picture in Picture playback stopped. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172694-playerviewdidstoppictureinpictur?language=objc +func (p_ PlayerViewPictureInPictureDelegateWrapper) PlayerViewDidStopPictureInPicture(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewDidStopPictureInPicture:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewPictureInPictureDelegateWrapper) HasPlayerViewDidStartPictureInPicture() bool { + return p_.RespondsToSelector(objc.Sel("playerViewDidStartPictureInPicture:")) +} + +// Tells the delegate that Picture in Picture playback started. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172693-playerviewdidstartpictureinpictu?language=objc +func (p_ PlayerViewPictureInPictureDelegateWrapper) PlayerViewDidStartPictureInPicture(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewDidStartPictureInPicture:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewPictureInPictureDelegateWrapper) HasPlayerViewShouldAutomaticallyDismissAtPictureInPictureStart() bool { + return p_.RespondsToSelector(objc.Sel("playerViewShouldAutomaticallyDismissAtPictureInPictureStart:")) +} + +// Asks the delegate if the player view should miniaturize when Picture in Picture starts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172695-playerviewshouldautomaticallydis?language=objc +func (p_ PlayerViewPictureInPictureDelegateWrapper) PlayerViewShouldAutomaticallyDismissAtPictureInPictureStart(playerView IPlayerView) bool { + rv := objc.Call[bool](p_, objc.Sel("playerViewShouldAutomaticallyDismissAtPictureInPictureStart:"), objc.Ptr(playerView)) + return rv +} + +func (p_ PlayerViewPictureInPictureDelegateWrapper) HasPlayerViewWillStopPictureInPicture() bool { + return p_.RespondsToSelector(objc.Sel("playerViewWillStopPictureInPicture:")) +} + +// Tells the delegate that Picture in Picture playback is about to stop. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172697-playerviewwillstoppictureinpictu?language=objc +func (p_ PlayerViewPictureInPictureDelegateWrapper) PlayerViewWillStopPictureInPicture(playerView IPlayerView) { + objc.Call[objc.Void](p_, objc.Sel("playerViewWillStopPictureInPicture:"), objc.Ptr(playerView)) +} + +func (p_ PlayerViewPictureInPictureDelegateWrapper) HasPlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler() bool { + return p_.RespondsToSelector(objc.Sel("playerView:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:")) +} + +// Tells the delegate to restore the user interface before Picture in Picture playback stops. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avplayerviewpictureinpicturedelegate/3172692-playerview?language=objc +func (p_ PlayerViewPictureInPictureDelegateWrapper) PlayerViewRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler(playerView IPlayerView, completionHandler func(restored bool)) { + objc.Call[objc.Void](p_, objc.Sel("playerView:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:"), objc.Ptr(playerView), completionHandler) +} diff --git a/macos/avkit/protocols.gen.m b/macos/avkit/protocols.gen.m new file mode 100644 index 00000000..2a73419f --- /dev/null +++ b/macos/avkit/protocols.gen.m @@ -0,0 +1,13 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "AVKit/AVKit.h" + +void importAVKitProtocols() { + id o; + o = @protocol(AVCaptureViewDelegate); + o = @protocol(AVPictureInPictureControllerDelegate); + o = @protocol(AVPictureInPictureSampleBufferPlaybackDelegate); + o = @protocol(AVPlayerViewDelegate); + o = @protocol(AVPlayerViewPictureInPictureDelegate); + o = @protocol(AVRoutePickerViewDelegate); +} diff --git a/macos/avkit/route_picker_view.gen.go b/macos/avkit/route_picker_view.gen.go new file mode 100644 index 00000000..45b56f09 --- /dev/null +++ b/macos/avkit/route_picker_view.gen.go @@ -0,0 +1,153 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/avfoundation" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RoutePickerView] class. +var RoutePickerViewClass = _RoutePickerViewClass{objc.GetClass("AVRoutePickerView")} + +type _RoutePickerViewClass struct { + objc.Class +} + +// An interface definition for the [RoutePickerView] class. +type IRoutePickerView interface { + appkit.IView + SetRoutePickerButtonColorForState(color appkit.IColor, state RoutePickerViewButtonState) + RoutePickerButtonColorForState(state RoutePickerViewButtonState) appkit.Color + Player() avfoundation.Player + SetPlayer(value avfoundation.IPlayer) + Delegate() RoutePickerViewDelegateWrapper + SetDelegate(value PRoutePickerViewDelegate) + SetDelegateObject(valueObject objc.IObject) + IsRoutePickerButtonBordered() bool + SetRoutePickerButtonBordered(value bool) +} + +// A view that presents a list of nearby media receivers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview?language=objc +type RoutePickerView struct { + appkit.View +} + +func RoutePickerViewFrom(ptr unsafe.Pointer) RoutePickerView { + return RoutePickerView{ + View: appkit.ViewFrom(ptr), + } +} + +func (rc _RoutePickerViewClass) Alloc() RoutePickerView { + rv := objc.Call[RoutePickerView](rc, objc.Sel("alloc")) + return rv +} + +func RoutePickerView_Alloc() RoutePickerView { + return RoutePickerViewClass.Alloc() +} + +func (rc _RoutePickerViewClass) New() RoutePickerView { + rv := objc.Call[RoutePickerView](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRoutePickerView() RoutePickerView { + return RoutePickerViewClass.New() +} + +func (r_ RoutePickerView) Init() RoutePickerView { + rv := objc.Call[RoutePickerView](r_, objc.Sel("init")) + return rv +} + +func (r_ RoutePickerView) InitWithFrame(frameRect foundation.Rect) RoutePickerView { + rv := objc.Call[RoutePickerView](r_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewRoutePickerViewWithFrame(frameRect foundation.Rect) RoutePickerView { + instance := RoutePickerViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// Sets the route picker button color for the specified state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/2915792-setroutepickerbuttoncolor?language=objc +func (r_ RoutePickerView) SetRoutePickerButtonColorForState(color appkit.IColor, state RoutePickerViewButtonState) { + objc.Call[objc.Void](r_, objc.Sel("setRoutePickerButtonColor:forState:"), objc.Ptr(color), state) +} + +// Returns the color of the picker button for the specified state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/2915793-routepickerbuttoncolorforstate?language=objc +func (r_ RoutePickerView) RoutePickerButtonColorForState(state RoutePickerViewButtonState) appkit.Color { + rv := objc.Call[appkit.Color](r_, objc.Sel("routePickerButtonColorForState:"), state) + return rv +} + +// The player object to perform routing operations for. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/3201361-player?language=objc +func (r_ RoutePickerView) Player() avfoundation.Player { + rv := objc.Call[avfoundation.Player](r_, objc.Sel("player")) + return rv +} + +// The player object to perform routing operations for. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/3201361-player?language=objc +func (r_ RoutePickerView) SetPlayer(value avfoundation.IPlayer) { + objc.Call[objc.Void](r_, objc.Sel("setPlayer:"), objc.Ptr(value)) +} + +// The delegate object for the route picker. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/2915799-delegate?language=objc +func (r_ RoutePickerView) Delegate() RoutePickerViewDelegateWrapper { + rv := objc.Call[RoutePickerViewDelegateWrapper](r_, objc.Sel("delegate")) + return rv +} + +// The delegate object for the route picker. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/2915799-delegate?language=objc +func (r_ RoutePickerView) SetDelegate(value PRoutePickerViewDelegate) { + po0 := objc.WrapAsProtocol("AVRoutePickerViewDelegate", value) + objc.SetAssociatedObject(r_, objc.AssociationKey("setDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](r_, objc.Sel("setDelegate:"), po0) +} + +// The delegate object for the route picker. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/2915799-delegate?language=objc +func (r_ RoutePickerView) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](r_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// A Boolean value that indicates whether the route picker button has a border. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/2915795-routepickerbuttonbordered?language=objc +func (r_ RoutePickerView) IsRoutePickerButtonBordered() bool { + rv := objc.Call[bool](r_, objc.Sel("isRoutePickerButtonBordered")) + return rv +} + +// A Boolean value that indicates whether the route picker button has a border. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerview/2915795-routepickerbuttonbordered?language=objc +func (r_ RoutePickerView) SetRoutePickerButtonBordered(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setRoutePickerButtonBordered:"), value) +} diff --git a/macos/avkit/route_picker_view_delegate.gen.go b/macos/avkit/route_picker_view_delegate.gen.go new file mode 100644 index 00000000..b07025e3 --- /dev/null +++ b/macos/avkit/route_picker_view_delegate.gen.go @@ -0,0 +1,88 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package avkit + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods to adopt to respond to route picker view presentation events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewdelegate?language=objc +type PRoutePickerViewDelegate interface { + // optional + RoutePickerViewWillBeginPresentingRoutes(routePickerView RoutePickerView) + HasRoutePickerViewWillBeginPresentingRoutes() bool + + // optional + RoutePickerViewDidEndPresentingRoutes(routePickerView RoutePickerView) + HasRoutePickerViewDidEndPresentingRoutes() bool +} + +// A delegate implementation builder for the [PRoutePickerViewDelegate] protocol. +type RoutePickerViewDelegate struct { + _RoutePickerViewWillBeginPresentingRoutes func(routePickerView RoutePickerView) + _RoutePickerViewDidEndPresentingRoutes func(routePickerView RoutePickerView) +} + +func (di *RoutePickerViewDelegate) HasRoutePickerViewWillBeginPresentingRoutes() bool { + return di._RoutePickerViewWillBeginPresentingRoutes != nil +} + +// Tells the delegate that the route picker view is about to begin presenting routes to the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewdelegate/2915788-routepickerviewwillbeginpresenti?language=objc +func (di *RoutePickerViewDelegate) SetRoutePickerViewWillBeginPresentingRoutes(f func(routePickerView RoutePickerView)) { + di._RoutePickerViewWillBeginPresentingRoutes = f +} + +// Tells the delegate that the route picker view is about to begin presenting routes to the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewdelegate/2915788-routepickerviewwillbeginpresenti?language=objc +func (di *RoutePickerViewDelegate) RoutePickerViewWillBeginPresentingRoutes(routePickerView RoutePickerView) { + di._RoutePickerViewWillBeginPresentingRoutes(routePickerView) +} +func (di *RoutePickerViewDelegate) HasRoutePickerViewDidEndPresentingRoutes() bool { + return di._RoutePickerViewDidEndPresentingRoutes != nil +} + +// Tells the delegate when the route picker view finishes presenting routes to the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewdelegate/2915796-routepickerviewdidendpresentingr?language=objc +func (di *RoutePickerViewDelegate) SetRoutePickerViewDidEndPresentingRoutes(f func(routePickerView RoutePickerView)) { + di._RoutePickerViewDidEndPresentingRoutes = f +} + +// Tells the delegate when the route picker view finishes presenting routes to the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewdelegate/2915796-routepickerviewdidendpresentingr?language=objc +func (di *RoutePickerViewDelegate) RoutePickerViewDidEndPresentingRoutes(routePickerView RoutePickerView) { + di._RoutePickerViewDidEndPresentingRoutes(routePickerView) +} + +// A concrete type wrapper for the [PRoutePickerViewDelegate] protocol. +type RoutePickerViewDelegateWrapper struct { + objc.Object +} + +func (r_ RoutePickerViewDelegateWrapper) HasRoutePickerViewWillBeginPresentingRoutes() bool { + return r_.RespondsToSelector(objc.Sel("routePickerViewWillBeginPresentingRoutes:")) +} + +// Tells the delegate that the route picker view is about to begin presenting routes to the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewdelegate/2915788-routepickerviewwillbeginpresenti?language=objc +func (r_ RoutePickerViewDelegateWrapper) RoutePickerViewWillBeginPresentingRoutes(routePickerView IRoutePickerView) { + objc.Call[objc.Void](r_, objc.Sel("routePickerViewWillBeginPresentingRoutes:"), objc.Ptr(routePickerView)) +} + +func (r_ RoutePickerViewDelegateWrapper) HasRoutePickerViewDidEndPresentingRoutes() bool { + return r_.RespondsToSelector(objc.Sel("routePickerViewDidEndPresentingRoutes:")) +} + +// Tells the delegate when the route picker view finishes presenting routes to the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/avkit/avroutepickerviewdelegate/2915796-routepickerviewdidendpresentingr?language=objc +func (r_ RoutePickerViewDelegateWrapper) RoutePickerViewDidEndPresentingRoutes(routePickerView IRoutePickerView) { + objc.Call[objc.Void](r_, objc.Sel("routePickerViewDidEndPresentingRoutes:"), objc.Ptr(routePickerView)) +} diff --git a/macos/cloudkit/location_sort_descriptor.gen.go b/macos/cloudkit/location_sort_descriptor.gen.go index db02396c..42e39f58 100644 --- a/macos/cloudkit/location_sort_descriptor.gen.go +++ b/macos/cloudkit/location_sort_descriptor.gen.go @@ -5,7 +5,6 @@ package cloudkit import ( "unsafe" - "github.com/progrium/macdriver/macos/corelocation" "github.com/progrium/macdriver/macos/foundation" "github.com/progrium/macdriver/objc" ) @@ -20,7 +19,7 @@ type _LocationSortDescriptorClass struct { // An interface definition for the [LocationSortDescriptor] class. type ILocationSortDescriptor interface { foundation.ISortDescriptor - RelativeLocation() corelocation.Location + RelativeLocation() objc.Object } // An object for sorting records that contain location data. [Full Topic] @@ -36,7 +35,7 @@ func LocationSortDescriptorFrom(ptr unsafe.Pointer) LocationSortDescriptor { } } -func (l_ LocationSortDescriptor) InitWithKeyRelativeLocation(key string, relativeLocation corelocation.ILocation) LocationSortDescriptor { +func (l_ LocationSortDescriptor) InitWithKeyRelativeLocation(key string, relativeLocation objc.IObject) LocationSortDescriptor { rv := objc.Call[LocationSortDescriptor](l_, objc.Sel("initWithKey:relativeLocation:"), key, objc.Ptr(relativeLocation)) return rv } @@ -44,7 +43,7 @@ func (l_ LocationSortDescriptor) InitWithKeyRelativeLocation(key string, relativ // Creates a location sort descriptor using the specified key and relative location. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/cloudkit/cklocationsortdescriptor/1515071-initwithkey?language=objc -func NewLocationSortDescriptorWithKeyRelativeLocation(key string, relativeLocation corelocation.ILocation) LocationSortDescriptor { +func NewLocationSortDescriptorWithKeyRelativeLocation(key string, relativeLocation objc.IObject) LocationSortDescriptor { instance := LocationSortDescriptorClass.Alloc().InitWithKeyRelativeLocation(key, relativeLocation) instance.Autorelease() return instance @@ -103,7 +102,7 @@ func NewLocationSortDescriptorWithKeyAscending(key string, ascending bool) Locat // The reference location for sorting records. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/cloudkit/cklocationsortdescriptor/1514915-relativelocation?language=objc -func (l_ LocationSortDescriptor) RelativeLocation() corelocation.Location { - rv := objc.Call[corelocation.Location](l_, objc.Sel("relativeLocation")) +func (l_ LocationSortDescriptor) RelativeLocation() objc.Object { + rv := objc.Call[objc.Object](l_, objc.Sel("relativeLocation")) return rv } diff --git a/macos/contactsui/contact_picker.gen.go b/macos/contactsui/contact_picker.gen.go new file mode 100644 index 00000000..2fc9f0e5 --- /dev/null +++ b/macos/contactsui/contact_picker.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package contactsui + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContactPicker] class. +var ContactPickerClass = _ContactPickerClass{objc.GetClass("CNContactPicker")} + +type _ContactPickerClass struct { + objc.Class +} + +// An interface definition for the [ContactPicker] class. +type IContactPicker interface { + objc.IObject + Close() + ShowRelativeToRectOfViewPreferredEdge(positioningRect foundation.Rect, positioningView appkit.IView, preferredEdge foundation.RectEdge) + Delegate() ContactPickerDelegateWrapper + SetDelegate(value PContactPickerDelegate) + SetDelegateObject(valueObject objc.IObject) + DisplayedKeys() []string + SetDisplayedKeys(value []string) +} + +// A popover-based interface for selecting a contact. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker?language=objc +type ContactPicker struct { + objc.Object +} + +func ContactPickerFrom(ptr unsafe.Pointer) ContactPicker { + return ContactPicker{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _ContactPickerClass) Alloc() ContactPicker { + rv := objc.Call[ContactPicker](cc, objc.Sel("alloc")) + return rv +} + +func ContactPicker_Alloc() ContactPicker { + return ContactPickerClass.Alloc() +} + +func (cc _ContactPickerClass) New() ContactPicker { + rv := objc.Call[ContactPicker](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContactPicker() ContactPicker { + return ContactPickerClass.New() +} + +func (c_ ContactPicker) Init() ContactPicker { + rv := objc.Call[ContactPicker](c_, objc.Sel("init")) + return rv +} + +// Closes the popover. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker/1522592-close?language=objc +func (c_ ContactPicker) Close() { + objc.Call[objc.Void](c_, objc.Sel("close")) +} + +// Shows the picker popover anchored to the specified view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker/1522591-showrelativetorect?language=objc +func (c_ ContactPicker) ShowRelativeToRectOfViewPreferredEdge(positioningRect foundation.Rect, positioningView appkit.IView, preferredEdge foundation.RectEdge) { + objc.Call[objc.Void](c_, objc.Sel("showRelativeToRect:ofView:preferredEdge:"), positioningRect, objc.Ptr(positioningView), preferredEdge) +} + +// The picker delegate to be notified when the user chooses a contact. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker/1522588-delegate?language=objc +func (c_ ContactPicker) Delegate() ContactPickerDelegateWrapper { + rv := objc.Call[ContactPickerDelegateWrapper](c_, objc.Sel("delegate")) + return rv +} + +// The picker delegate to be notified when the user chooses a contact. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker/1522588-delegate?language=objc +func (c_ ContactPicker) SetDelegate(value PContactPickerDelegate) { + po0 := objc.WrapAsProtocol("CNContactPickerDelegate", value) + objc.SetAssociatedObject(c_, objc.AssociationKey("setDelegate"), po0, objc.ASSOCIATION_RETAIN) + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), po0) +} + +// The picker delegate to be notified when the user chooses a contact. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker/1522588-delegate?language=objc +func (c_ ContactPicker) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// The keys to be displayed when a contact is expanded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker/1522585-displayedkeys?language=objc +func (c_ ContactPicker) DisplayedKeys() []string { + rv := objc.Call[[]string](c_, objc.Sel("displayedKeys")) + return rv +} + +// The keys to be displayed when a contact is expanded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpicker/1522585-displayedkeys?language=objc +func (c_ ContactPicker) SetDisplayedKeys(value []string) { + objc.Call[objc.Void](c_, objc.Sel("setDisplayedKeys:"), value) +} diff --git a/macos/contactsui/contact_picker_delegate.gen.go b/macos/contactsui/contact_picker_delegate.gen.go new file mode 100644 index 00000000..840c547a --- /dev/null +++ b/macos/contactsui/contact_picker_delegate.gen.go @@ -0,0 +1,88 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package contactsui + +import ( + "github.com/progrium/macdriver/objc" +) + +// The methods that you implement to respond to contact-picker user events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpickerdelegate?language=objc +type PContactPickerDelegate interface { + // optional + ContactPickerDidClose(picker ContactPicker) + HasContactPickerDidClose() bool + + // optional + ContactPickerWillClose(picker ContactPicker) + HasContactPickerWillClose() bool +} + +// A delegate implementation builder for the [PContactPickerDelegate] protocol. +type ContactPickerDelegate struct { + _ContactPickerDidClose func(picker ContactPicker) + _ContactPickerWillClose func(picker ContactPicker) +} + +func (di *ContactPickerDelegate) HasContactPickerDidClose() bool { + return di._ContactPickerDidClose != nil +} + +// In macOS, called when the contact picker’s popover has closed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpickerdelegate/1522584-contactpickerdidclose?language=objc +func (di *ContactPickerDelegate) SetContactPickerDidClose(f func(picker ContactPicker)) { + di._ContactPickerDidClose = f +} + +// In macOS, called when the contact picker’s popover has closed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpickerdelegate/1522584-contactpickerdidclose?language=objc +func (di *ContactPickerDelegate) ContactPickerDidClose(picker ContactPicker) { + di._ContactPickerDidClose(picker) +} +func (di *ContactPickerDelegate) HasContactPickerWillClose() bool { + return di._ContactPickerWillClose != nil +} + +// In macOS, called when the contact picker’s popover is about to close. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpickerdelegate/1522594-contactpickerwillclose?language=objc +func (di *ContactPickerDelegate) SetContactPickerWillClose(f func(picker ContactPicker)) { + di._ContactPickerWillClose = f +} + +// In macOS, called when the contact picker’s popover is about to close. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpickerdelegate/1522594-contactpickerwillclose?language=objc +func (di *ContactPickerDelegate) ContactPickerWillClose(picker ContactPicker) { + di._ContactPickerWillClose(picker) +} + +// A concrete type wrapper for the [PContactPickerDelegate] protocol. +type ContactPickerDelegateWrapper struct { + objc.Object +} + +func (c_ ContactPickerDelegateWrapper) HasContactPickerDidClose() bool { + return c_.RespondsToSelector(objc.Sel("contactPickerDidClose:")) +} + +// In macOS, called when the contact picker’s popover has closed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpickerdelegate/1522584-contactpickerdidclose?language=objc +func (c_ ContactPickerDelegateWrapper) ContactPickerDidClose(picker IContactPicker) { + objc.Call[objc.Void](c_, objc.Sel("contactPickerDidClose:"), objc.Ptr(picker)) +} + +func (c_ ContactPickerDelegateWrapper) HasContactPickerWillClose() bool { + return c_.RespondsToSelector(objc.Sel("contactPickerWillClose:")) +} + +// In macOS, called when the contact picker’s popover is about to close. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactpickerdelegate/1522594-contactpickerwillclose?language=objc +func (c_ ContactPickerDelegateWrapper) ContactPickerWillClose(picker IContactPicker) { + objc.Call[objc.Void](c_, objc.Sel("contactPickerWillClose:"), objc.Ptr(picker)) +} diff --git a/macos/contactsui/contact_view_controller.gen.go b/macos/contactsui/contact_view_controller.gen.go new file mode 100644 index 00000000..a1df14cc --- /dev/null +++ b/macos/contactsui/contact_view_controller.gen.go @@ -0,0 +1,99 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package contactsui + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/contacts" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContactViewController] class. +var ContactViewControllerClass = _ContactViewControllerClass{objc.GetClass("CNContactViewController")} + +type _ContactViewControllerClass struct { + objc.Class +} + +// An interface definition for the [ContactViewController] class. +type IContactViewController interface { + appkit.IViewController + Contact() contacts.Contact +} + +// A view controller that displays a new, unknown, or existing contact. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactviewcontroller?language=objc +type ContactViewController struct { + appkit.ViewController +} + +func ContactViewControllerFrom(ptr unsafe.Pointer) ContactViewController { + return ContactViewController{ + ViewController: appkit.ViewControllerFrom(ptr), + } +} + +func (cc _ContactViewControllerClass) Alloc() ContactViewController { + rv := objc.Call[ContactViewController](cc, objc.Sel("alloc")) + return rv +} + +func ContactViewController_Alloc() ContactViewController { + return ContactViewControllerClass.Alloc() +} + +func (cc _ContactViewControllerClass) New() ContactViewController { + rv := objc.Call[ContactViewController](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContactViewController() ContactViewController { + return ContactViewControllerClass.New() +} + +func (c_ ContactViewController) Init() ContactViewController { + rv := objc.Call[ContactViewController](c_, objc.Sel("init")) + return rv +} + +func (c_ ContactViewController) InitWithNibNameBundle(nibNameOrNil appkit.NibName, nibBundleOrNil foundation.IBundle) ContactViewController { + rv := objc.Call[ContactViewController](c_, objc.Sel("initWithNibName:bundle:"), nibNameOrNil, objc.Ptr(nibBundleOrNil)) + return rv +} + +// Returns a view controller object initialized to the nib file in the specified bundle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsviewcontroller/1434481-initwithnibname?language=objc +func NewContactViewControllerWithNibNameBundle(nibNameOrNil appkit.NibName, nibBundleOrNil foundation.IBundle) ContactViewController { + instance := ContactViewControllerClass.Alloc().InitWithNibNameBundle(nibNameOrNil, nibBundleOrNil) + instance.Autorelease() + return instance +} + +// Returns the descriptor for all the keys that must be fetched on the contact before setting it on the view controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactviewcontroller/1550990-descriptorforrequiredkeys?language=objc +func (cc _ContactViewControllerClass) DescriptorForRequiredKeys() objc.Object { + rv := objc.Call[objc.Object](cc, objc.Sel("descriptorForRequiredKeys")) + return rv +} + +// Returns the descriptor for all the keys that must be fetched on the contact before setting it on the view controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactviewcontroller/1550990-descriptorforrequiredkeys?language=objc +func ContactViewController_DescriptorForRequiredKeys() objc.Object { + return ContactViewControllerClass.DescriptorForRequiredKeys() +} + +// The contact being displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/contactsui/cncontactviewcontroller/1522596-contact?language=objc +func (c_ ContactViewController) Contact() contacts.Contact { + rv := objc.Call[contacts.Contact](c_, objc.Sel("contact")) + return rv +} diff --git a/macos/contactsui/doc.gen.go b/macos/contactsui/doc.gen.go new file mode 100644 index 00000000..45e800d9 --- /dev/null +++ b/macos/contactsui/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Display information about users’ contacts in a graphical interface. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/contactsui?language=objc +package contactsui diff --git a/macos/contactsui/protocols.gen.m b/macos/contactsui/protocols.gen.m new file mode 100644 index 00000000..22722688 --- /dev/null +++ b/macos/contactsui/protocols.gen.m @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "ContactsUI/ContactsUI.h" + +void importContactsUIProtocols() { + id o; + o = @protocol(CNContactPickerDelegate); +} diff --git a/macos/coreaudio/aliastypes.gen.go b/macos/coreaudio/aliastypes.gen.go new file mode 100644 index 00000000..0a8c477a --- /dev/null +++ b/macos/coreaudio/aliastypes.gen.go @@ -0,0 +1,54 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coreaudio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coreaudiotypes" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiostreampropertylistenerproc?language=objc +type StreamPropertyListenerProc = func(inStream StreamID, inChannel uint32, inPropertyID DevicePropertyID, inClientData unsafe.Pointer) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiohardwarepropertylistenerproc?language=objc +type HardwarePropertyListenerProc = func(inPropertyID HardwarePropertyID, inClientData unsafe.Pointer) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioobjectpropertylistenerproc?language=objc +type ObjectPropertyListenerProc = func(inObjectID ObjectID, inNumberAddresses uint32, inAddresses *ObjectPropertyAddress, inClientData unsafe.Pointer) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodriverplugindevicepropertychangedproc?language=objc +type DriverPlugInDevicePropertyChangedProc = func(inDevice DeviceID, inChannel uint32, isInput bool, inPropertyID DevicePropertyID) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodeviceioblock?language=objc +type DeviceIOBlock = func(inNow *coreaudiotypes.TimeStamp, inInputData *coreaudiotypes.BufferList, inInputTime *coreaudiotypes.TimeStamp, outOutputData *coreaudiotypes.BufferList, inOutputTime *coreaudiotypes.TimeStamp) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodriverpluginstreampropertychangedproc?language=objc +type DriverPlugInStreamPropertyChangedProc = func(inDevice DeviceID, inIOAudioStream unsafe.Pointer, inChannel uint32, inPropertyID DevicePropertyID) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodeviceioproc?language=objc +type DeviceIOProc = func(inDevice ObjectID, inNow *coreaudiotypes.TimeStamp, inInputData *coreaudiotypes.BufferList, inInputTime *coreaudiotypes.TimeStamp, outOutputData *coreaudiotypes.BufferList, inOutputTime *coreaudiotypes.TimeStamp, inClientData unsafe.Pointer) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioobjectpropertylistenerblock?language=objc +type ObjectPropertyListenerBlock = func(inNumberAddresses uint32, inAddresses *ObjectPropertyAddress) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodevicepropertylistenerproc?language=objc +type DevicePropertyListenerProc = func(inDevice DeviceID, inChannel uint32, isInput bool, inPropertyID DevicePropertyID, inClientData unsafe.Pointer) uint diff --git a/macos/coreaudio/coreaudio_structs.go b/macos/coreaudio/coreaudio_structs.go new file mode 100644 index 00000000..a08e2ccc --- /dev/null +++ b/macos/coreaudio/coreaudio_structs.go @@ -0,0 +1,4 @@ +package coreaudio + +// TODO +type ObjectPropertyAddress struct{} diff --git a/macos/coreaudio/doc.gen.go b/macos/coreaudio/doc.gen.go new file mode 100644 index 00000000..d32be34f --- /dev/null +++ b/macos/coreaudio/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Use the Core Audio framework to interact with device’s audio hardware. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/coreaudio?language=objc +package coreaudio diff --git a/macos/coreaudio/enumtypes.gen.go b/macos/coreaudio/enumtypes.gen.go new file mode 100644 index 00000000..ba36dd50 --- /dev/null +++ b/macos/coreaudio/enumtypes.gen.go @@ -0,0 +1,97 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coreaudio + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioclassid?language=objc +type ClassID uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodeviceclockalgorithmselector?language=objc +type DeviceClockAlgorithmSelector uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodeviceid?language=objc +type DeviceID ObjectID + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiodevicepropertyid?language=objc +type DevicePropertyID ObjectPropertySelector + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiohardwarepowerhint?language=objc +type HardwarePowerHint uint32 + +const ( + KHardwarePowerHintFavorSavingPower HardwarePowerHint = 1 + KHardwarePowerHintNone HardwarePowerHint = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiohardwarepropertyid?language=objc +type HardwarePropertyID ObjectPropertySelector + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiolevelcontroltransferfunction?language=objc +type LevelControlTransferFunction uint32 + +const ( + KLevelControlTranferFunction10Over1 LevelControlTransferFunction = 13 + KLevelControlTranferFunction11Over1 LevelControlTransferFunction = 14 + KLevelControlTranferFunction12Over1 LevelControlTransferFunction = 15 + KLevelControlTranferFunction1Over2 LevelControlTransferFunction = 2 + KLevelControlTranferFunction1Over3 LevelControlTransferFunction = 1 + KLevelControlTranferFunction2Over1 LevelControlTransferFunction = 5 + KLevelControlTranferFunction3Over1 LevelControlTransferFunction = 6 + KLevelControlTranferFunction3Over2 LevelControlTransferFunction = 4 + KLevelControlTranferFunction3Over4 LevelControlTransferFunction = 3 + KLevelControlTranferFunction4Over1 LevelControlTransferFunction = 7 + KLevelControlTranferFunction5Over1 LevelControlTransferFunction = 8 + KLevelControlTranferFunction6Over1 LevelControlTransferFunction = 9 + KLevelControlTranferFunction7Over1 LevelControlTransferFunction = 10 + KLevelControlTranferFunction8Over1 LevelControlTransferFunction = 11 + KLevelControlTranferFunction9Over1 LevelControlTransferFunction = 12 + KLevelControlTranferFunctionLinear LevelControlTransferFunction = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioobjectid?language=objc +type ObjectID uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioobjectpropertyelement?language=objc +type ObjectPropertyElement uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioobjectpropertyscope?language=objc +type ObjectPropertyScope uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioobjectpropertyselector?language=objc +type ObjectPropertySelector uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioserverplugincustompropertydatatype?language=objc +type ServerPlugInCustomPropertyDataType uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audioserverpluginiooperation?language=objc +type ServerPlugInIOOperation uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudio/audiostreamid?language=objc +type StreamID ObjectID diff --git a/macos/coreaudio/protocols.gen.m b/macos/coreaudio/protocols.gen.m new file mode 100644 index 00000000..7276ea2f --- /dev/null +++ b/macos/coreaudio/protocols.gen.m @@ -0,0 +1,7 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "CoreAudio/CoreAudio.h" + +void importCoreAudioProtocols() { + id o; +} diff --git a/macos/coreaudiotypes/coreaudiotypes_structs.go b/macos/coreaudiotypes/coreaudiotypes_structs.go new file mode 100644 index 00000000..d4244996 --- /dev/null +++ b/macos/coreaudiotypes/coreaudiotypes_structs.go @@ -0,0 +1,5 @@ +package coreaudiotypes + +// TODO +type BufferList struct{} +type TimeStamp struct{} diff --git a/macos/coreaudiotypes/doc.gen.go b/macos/coreaudiotypes/doc.gen.go new file mode 100644 index 00000000..1a8e8af4 --- /dev/null +++ b/macos/coreaudiotypes/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Use specialized data types to interact with audio streams, complex buffers, and audiovisual timestamps. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/coreaudiotypes?language=objc +package coreaudiotypes diff --git a/macos/coreaudiotypes/enumtypes.gen.go b/macos/coreaudiotypes/enumtypes.gen.go new file mode 100644 index 00000000..2f2be37b --- /dev/null +++ b/macos/coreaudiotypes/enumtypes.gen.go @@ -0,0 +1,194 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coreaudiotypes + +// An integer type for audio operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/avaudiointeger?language=objc +type AudioInteger int32 + +// Codes that describe error conditions that may occur when performing audio session operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/avaudiosessionerrorcode?language=objc +type AudioSessionErrorCode AudioInteger + +const ( + AudioSessionErrorCodeBadParam AudioSessionErrorCode = -50 + AudioSessionErrorCodeCannotInterruptOthers AudioSessionErrorCode = 560557684 + AudioSessionErrorCodeCannotStartPlaying AudioSessionErrorCode = 561015905 + AudioSessionErrorCodeCannotStartRecording AudioSessionErrorCode = 561145187 + AudioSessionErrorCodeExpiredSession AudioSessionErrorCode = 561210739 + AudioSessionErrorCodeIncompatibleCategory AudioSessionErrorCode = 560161140 + AudioSessionErrorCodeIsBusy AudioSessionErrorCode = 560030580 + AudioSessionErrorCodeMediaServicesFailed AudioSessionErrorCode = 1836282486 + AudioSessionErrorCodeMissingEntitlement AudioSessionErrorCode = 1701737535 + AudioSessionErrorCodeNone AudioSessionErrorCode = 0 + AudioSessionErrorCodeResourceNotAvailable AudioSessionErrorCode = 561145203 + AudioSessionErrorCodeSessionNotActive AudioSessionErrorCode = 1768841571 + AudioSessionErrorCodeSiriIsRecording AudioSessionErrorCode = 1936290409 + AudioSessionErrorCodeUnspecified AudioSessionErrorCode = 2003329396 +) + +// An unsigned integer type for audio operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/avaudiouinteger?language=objc +type AudioUInteger int32 + +// The supported channel bitmaps to use when defining channel layouts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiochannelbitmap?language=objc +type ChannelBitmap uint32 + +const ( + KChannelBit_Center ChannelBitmap = 4 + KChannelBit_CenterSurround ChannelBitmap = 256 + KChannelBit_CenterTopFront ChannelBitmap = 8192 + KChannelBit_CenterTopMiddle ChannelBitmap = 2048 + KChannelBit_CenterTopRear ChannelBitmap = 33554432 + KChannelBit_LFEScreen ChannelBitmap = 8 + KChannelBit_Left ChannelBitmap = 1 + KChannelBit_LeftCenter ChannelBitmap = 64 + KChannelBit_LeftSurround ChannelBitmap = 16 + KChannelBit_LeftSurroundDirect ChannelBitmap = 512 + KChannelBit_LeftTopFront ChannelBitmap = 4096 + KChannelBit_LeftTopMiddle ChannelBitmap = 2097152 + KChannelBit_LeftTopRear ChannelBitmap = 16777216 + KChannelBit_Right ChannelBitmap = 2 + KChannelBit_RightCenter ChannelBitmap = 128 + KChannelBit_RightSurround ChannelBitmap = 32 + KChannelBit_RightSurroundDirect ChannelBitmap = 1024 + KChannelBit_RightTopFront ChannelBitmap = 16384 + KChannelBit_RightTopMiddle ChannelBitmap = 8388608 + KChannelBit_RightTopRear ChannelBitmap = 67108864 + KChannelBit_TopBackCenter ChannelBitmap = 65536 + KChannelBit_TopBackLeft ChannelBitmap = 32768 + KChannelBit_TopBackRight ChannelBitmap = 131072 + KChannelBit_TopCenterSurround ChannelBitmap = 2048 + KChannelBit_VerticalHeightCenter ChannelBitmap = 8192 + KChannelBit_VerticalHeightLeft ChannelBitmap = 4096 + KChannelBit_VerticalHeightRight ChannelBitmap = 16384 +) + +// Indexes the fields of the mCoordinates array in an AudioChannelDescription structure. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiochannelcoordinateindex?language=objc +type ChannelCoordinateIndex uint32 + +const ( + KChannelCoordinates_Azimuth ChannelCoordinateIndex = 0 + KChannelCoordinates_BackFront ChannelCoordinateIndex = 1 + KChannelCoordinates_Distance ChannelCoordinateIndex = 2 + KChannelCoordinates_DownUp ChannelCoordinateIndex = 2 + KChannelCoordinates_Elevation ChannelCoordinateIndex = 1 + KChannelCoordinates_LeftRight ChannelCoordinateIndex = 0 +) + +// Constants that define the audio channel flags of an audio channel description. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiochannelflags?language=objc +type ChannelFlags uint32 + +const ( + KChannelFlags_AllOff ChannelFlags = 0 + KChannelFlags_Meters ChannelFlags = 4 + KChannelFlags_RectangularCoordinates ChannelFlags = 1 + KChannelFlags_SphericalCoordinates ChannelFlags = 2 +) + +// Identifies how an audio data channel is to be used. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiochannellabel?language=objc +type ChannelLabel uint32 + +// Identifies a previously-defined channel layout. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiochannellayouttag?language=objc +type ChannelLayoutTag uint32 + +// A type definition for audio format flags. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audioformatflags?language=objc +type FormatFlags uint32 + +// A type definition for audio format identifiers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audioformatid?language=objc +type FormatID uint32 + +// The canonical audio data sample type for input and output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiosampletype?language=objc +type SampleType int16 + +// A unique identifier of an audio session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiosessionid?language=objc +type SessionID uint32 + +// A structure that represents flags for a timestamp. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiotimestampflags?language=objc +type TimeStampFlags uint32 + +const ( + KTimeStampHostTimeValid TimeStampFlags = 2 + KTimeStampNothingValid TimeStampFlags = 0 + KTimeStampRateScalarValid TimeStampFlags = 4 + KTimeStampSMPTETimeValid TimeStampFlags = 16 + KTimeStampSampleHostTimeValid TimeStampFlags = 3 + KTimeStampSampleTimeValid TimeStampFlags = 1 + KTimeStampWordClockTimeValid TimeStampFlags = 8 +) + +// The canonical audio data sample type for audio processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/audiounitsampletype?language=objc +type UnitSampleType int32 + +// Constants that define the type of MPEG-4 audio data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/mpeg4objectid?language=objc +type MPEG4ObjectID int32 + +const ( + kMPEG4Object_AAC_LC MPEG4ObjectID = 2 + kMPEG4Object_AAC_LTP MPEG4ObjectID = 4 + kMPEG4Object_AAC_Main MPEG4ObjectID = 1 + kMPEG4Object_AAC_SBR MPEG4ObjectID = 5 + kMPEG4Object_AAC_SSR MPEG4ObjectID = 3 + kMPEG4Object_AAC_Scalable MPEG4ObjectID = 6 + kMPEG4Object_CELP MPEG4ObjectID = 8 + kMPEG4Object_HVXC MPEG4ObjectID = 9 + kMPEG4Object_TwinVQ MPEG4ObjectID = 7 +) + +// A structure that defines SMPTE time flags. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/smptetimeflags?language=objc +type SMPTETimeFlags uint32 + +const ( + kSMPTETimeRunning SMPTETimeFlags = 2 + kSMPTETimeUnknown SMPTETimeFlags = 0 + kSMPTETimeValid SMPTETimeFlags = 1 +) + +// Constants that define SMPTE time types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coreaudiotypes/smptetimetype?language=objc +type SMPTETimeType uint32 + +const ( + kSMPTETimeType2398 SMPTETimeType = 11 + kSMPTETimeType24 SMPTETimeType = 0 + kSMPTETimeType25 SMPTETimeType = 1 + kSMPTETimeType2997 SMPTETimeType = 4 + kSMPTETimeType2997Drop SMPTETimeType = 5 + kSMPTETimeType30 SMPTETimeType = 3 + kSMPTETimeType30Drop SMPTETimeType = 2 + kSMPTETimeType50 SMPTETimeType = 10 + kSMPTETimeType5994 SMPTETimeType = 7 + kSMPTETimeType5994Drop SMPTETimeType = 9 + kSMPTETimeType60 SMPTETimeType = 6 + kSMPTETimeType60Drop SMPTETimeType = 8 +) diff --git a/macos/coreaudiotypes/protocols.gen.m b/macos/coreaudiotypes/protocols.gen.m new file mode 100644 index 00000000..41f82f0c --- /dev/null +++ b/macos/coreaudiotypes/protocols.gen.m @@ -0,0 +1,7 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "CoreAudio/CoreAudioTypes.h" + +void importCoreAudioTypesProtocols() { + id o; +} diff --git a/macos/coredata/core_data_core_spotlight_delegate.gen.go b/macos/coredata/core_data_core_spotlight_delegate.gen.go index fc028f84..2f55a374 100644 --- a/macos/coredata/core_data_core_spotlight_delegate.gen.go +++ b/macos/coredata/core_data_core_spotlight_delegate.gen.go @@ -5,7 +5,6 @@ package coredata import ( "unsafe" - "github.com/progrium/macdriver/macos/corespotlight" "github.com/progrium/macdriver/macos/foundation" "github.com/progrium/macdriver/objc" ) @@ -21,8 +20,8 @@ type _CoreDataCoreSpotlightDelegateClass struct { type ICoreDataCoreSpotlightDelegate interface { objc.IObject StartSpotlightIndexing() - SearchableIndexReindexAllSearchableItemsWithAcknowledgementHandler(searchableIndex corespotlight.ISearchableIndex, acknowledgementHandler func()) - AttributeSetForObject(object IManagedObject) corespotlight.SearchableItemAttributeSet + SearchableIndexReindexAllSearchableItemsWithAcknowledgementHandler(searchableIndex objc.IObject, acknowledgementHandler func()) + AttributeSetForObject(object IManagedObject) objc.Object DomainIdentifier() string StopSpotlightIndexing() DeleteSpotlightIndexWithCompletionHandler(completionHandler func(error foundation.Error)) @@ -91,15 +90,15 @@ func (c_ CoreDataCoreSpotlightDelegate) StartSpotlightIndexing() { // Reindexes all searchable items and clears any local state. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/coredata/nscoredatacorespotlightdelegate/2897201-searchableindex?language=objc -func (c_ CoreDataCoreSpotlightDelegate) SearchableIndexReindexAllSearchableItemsWithAcknowledgementHandler(searchableIndex corespotlight.ISearchableIndex, acknowledgementHandler func()) { +func (c_ CoreDataCoreSpotlightDelegate) SearchableIndexReindexAllSearchableItemsWithAcknowledgementHandler(searchableIndex objc.IObject, acknowledgementHandler func()) { objc.Call[objc.Void](c_, objc.Sel("searchableIndex:reindexAllSearchableItemsWithAcknowledgementHandler:"), objc.Ptr(searchableIndex), acknowledgementHandler) } // Returns the searchable attributes for the specified managed object. [Full Topic] // // [Full Topic]: https://developer.apple.com/documentation/coredata/nscoredatacorespotlightdelegate/2897197-attributesetforobject?language=objc -func (c_ CoreDataCoreSpotlightDelegate) AttributeSetForObject(object IManagedObject) corespotlight.SearchableItemAttributeSet { - rv := objc.Call[corespotlight.SearchableItemAttributeSet](c_, objc.Sel("attributeSetForObject:"), objc.Ptr(object)) +func (c_ CoreDataCoreSpotlightDelegate) AttributeSetForObject(object IManagedObject) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("attributeSetForObject:"), objc.Ptr(object)) return rv } diff --git a/macos/corefoundation/corefoundation_structs.go b/macos/corefoundation/corefoundation_structs.go index aed788f8..bfbdb3c4 100644 --- a/macos/corefoundation/corefoundation_structs.go +++ b/macos/corefoundation/corefoundation_structs.go @@ -24,3 +24,4 @@ type WriteStreamRef = unsafe.Pointer type FileDescriptorRef = unsafe.Pointer type PlugInInstanceRef = unsafe.Pointer type UUIDRef = unsafe.Pointer +type ArrayRef = unsafe.Pointer diff --git a/macos/coregraphics/coregraphics_structs.go b/macos/coregraphics/coregraphics_structs.go index f5b1fd30..9055e277 100644 --- a/macos/coregraphics/coregraphics_structs.go +++ b/macos/coregraphics/coregraphics_structs.go @@ -14,6 +14,7 @@ import ( type PathElement struct{} type ScreenUpdateMoveDelta struct{} +type ColorConversionInfoRef unsafe.Pointer type DisplayStreamUpdateRef unsafe.Pointer type AffineTransform struct { diff --git a/macos/coremedia/aliastypes.gen.go b/macos/coremedia/aliastypes.gen.go new file mode 100644 index 00000000..1a956443 --- /dev/null +++ b/macos/coremedia/aliastypes.gen.go @@ -0,0 +1,89 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremedia + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corefoundation" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffergetbooleanhandler?language=objc +type BufferGetBooleanHandler = func(buf BufferRef) bool + +// A block the system calls to make the sample buffer ready for use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmsamplebuffermakedatareadyhandler?language=objc +type SampleBufferMakeDataReadyHandler = func(sbuf SampleBufferRef) uint + +// Callback that returns a Boolean value from a CMBuffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffergetbooleancallback?language=objc +type BufferGetBooleanCallback = func(buf BufferRef, refcon unsafe.Pointer) bool + +// A callback for the system to invoke when a trigger condition becomes true. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbufferqueuetriggercallback?language=objc +type BufferQueueTriggerCallback = func(triggerRefcon unsafe.Pointer, triggerToken unsafe.Pointer) + +// Client callback called by CMSampleBufferInvalidate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmsamplebufferinvalidatehandler?language=objc +type SampleBufferInvalidateHandler = func(sbuf SampleBufferRef) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffergetsizehandler?language=objc +type BufferGetSizeHandler = func(buf BufferRef) uint + +// Client callback called by CMSampleBufferInvalidate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmsamplebufferinvalidatecallback?language=objc +type SampleBufferInvalidateCallback = func(sbuf SampleBufferRef, invalidateRefCon uint64) + +// A type alias for a callback that tests whether a buffer is in a valid state to add to a queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffervalidationcallback?language=objc +type BufferValidationCallback = func(queue BufferQueueRef, buf BufferRef, validationRefCon unsafe.Pointer) uint + +// A client callback that returns a size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffergetsizecallback?language=objc +type BufferGetSizeCallback = func(buf BufferRef, refcon unsafe.Pointer) uint + +// Client callback called by CMSampleBufferMakeDataReady. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmsamplebuffermakedatareadycallback?language=objc +type SampleBufferMakeDataReadyCallback = func(sbuf SampleBufferRef, makeDataReadyRefcon unsafe.Pointer) uint + +// A type alias for a trigger handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbufferqueuetriggerhandler?language=objc +type BufferQueueTriggerHandler = func(triggerToken unsafe.Pointer) + +// Callback that returns a CMTime from a CMBuffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffergettimecallback?language=objc +type BufferGetTimeCallback = func(buf BufferRef, refcon unsafe.Pointer) Time + +// A type alias for a handler that tests whether a buffer is in a valid state to add to a queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffervalidationhandler?language=objc +type BufferValidationHandler = func(queue BufferQueueRef, buf BufferRef) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffergettimehandler?language=objc +type BufferGetTimeHandler = func(buf BufferRef) Time + +// Callback that compares one CMBuffer with another. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffercomparecallback?language=objc +type BufferCompareCallback = func(buf1 BufferRef, buf2 BufferRef, refcon unsafe.Pointer) corefoundation.ComparisonResult + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbuffercomparehandler?language=objc +type BufferCompareHandler = func(buf1 BufferRef, buf2 BufferRef) corefoundation.ComparisonResult diff --git a/macos/coremedia/coremedia_structs.go b/macos/coremedia/coremedia_structs.go index 1d9df1c2..220d8c96 100644 --- a/macos/coremedia/coremedia_structs.go +++ b/macos/coremedia/coremedia_structs.go @@ -6,7 +6,14 @@ import "unsafe" type TimeMapping struct{} type TimeRange struct{} type Time struct{} +type VideoDimensions struct{} type SampleBufferRef unsafe.Pointer type BufferRef unsafe.Pointer type BufferQueueRef unsafe.Pointer +type FormatDescriptionRef unsafe.Pointer +type MetadataFormatDescriptionRef unsafe.Pointer +type ClockRef unsafe.Pointer +type TimebaseRef unsafe.Pointer +type VideoFormatDescriptionRef unsafe.Pointer +type AudioFormatDescriptionRef unsafe.Pointer diff --git a/macos/coremedia/doc.gen.go b/macos/coremedia/doc.gen.go new file mode 100644 index 00000000..91fee23d --- /dev/null +++ b/macos/coremedia/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Represent time-based audio-visual assets with essential data types. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/coremedia?language=objc +package coremedia diff --git a/macos/coremedia/enumtypes.gen.go b/macos/coremedia/enumtypes.gen.go new file mode 100644 index 00000000..f3d1b6d4 --- /dev/null +++ b/macos/coremedia/enumtypes.gen.go @@ -0,0 +1,114 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremedia + +import "github.com/progrium/macdriver/macos/corefoundation" + +// A type for mask bits that represent parts of an audio format description. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmaudioformatdescriptionmask?language=objc +type AudioFormatDescriptionMask uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbaseclassversion?language=objc +type BaseClassVersion uint + +// A type for parameters that contain block buffer feature and control flags. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmblockbufferflags?language=objc +type BlockBufferFlags uint32 + +// A type to specify conditions to associate with a buffer queue trigger. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmbufferqueuetriggercondition?language=objc +type BufferQueueTriggerCondition int32 + +// A closed caption format type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmclosedcaptionformattype?language=objc +type ClosedCaptionFormatType uint + +// A datatype that represents an item count. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmitemcount?language=objc +type ItemCount corefoundation.Index + +// A datatype that represents an item index. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmitemindex?language=objc +type ItemIndex corefoundation.Index + +// A pixel format type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmpixelformattype?language=objc +type PixelFormatType uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmstructversion?language=objc +type StructVersion uint + +// An integer value that describes the display mode flags for text media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtextdisplayflags?language=objc +type TextDisplayFlags uint32 + +// A text format type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtextformattype?language=objc +type TextFormatType uint + +// An integer value that describes the justification modes for text media. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtextjustificationvalue?language=objc +type TextJustificationValue int8 + +// An epoch for a time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtimeepoch?language=objc +type TimeEpoch int64 + +// A structure that defines the flags for a time value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtimeflags?language=objc +type TimeFlags uint32 + +const ( + kCMTimeFlags_HasBeenRounded TimeFlags = 2 + kCMTimeFlags_ImpliedValueFlagsMask TimeFlags = 28 + kCMTimeFlags_Indefinite TimeFlags = 16 + kCMTimeFlags_NegativeInfinity TimeFlags = 8 + kCMTimeFlags_PositiveInfinity TimeFlags = 4 + kCMTimeFlags_Valid TimeFlags = 1 +) + +// An enumeration of rounding methods to use when performing time calculations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtimeroundingmethod?language=objc +type TimeRoundingMethod uint32 + +const ( + kCMTimeRoundingMethod_Default TimeRoundingMethod = 1 + kCMTimeRoundingMethod_QuickTime TimeRoundingMethod = 4 + kCMTimeRoundingMethod_RoundAwayFromZero TimeRoundingMethod = 3 + kCMTimeRoundingMethod_RoundHalfAwayFromZero TimeRoundingMethod = 1 + kCMTimeRoundingMethod_RoundTowardNegativeInfinity TimeRoundingMethod = 6 + kCMTimeRoundingMethod_RoundTowardPositiveInfinity TimeRoundingMethod = 5 + kCMTimeRoundingMethod_RoundTowardZero TimeRoundingMethod = 2 +) + +// An integer timescale. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtimescale?language=objc +type TimeScale int32 + +// An integer time value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmtimevalue?language=objc +type TimeValue int64 + +// A video codec type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremedia/cmvideocodectype?language=objc +type VideoCodecType uint diff --git a/macos/coremedia/protocols.gen.m b/macos/coremedia/protocols.gen.m new file mode 100644 index 00000000..be6c2918 --- /dev/null +++ b/macos/coremedia/protocols.gen.m @@ -0,0 +1,7 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "CoreMedia/CoreMedia.h" + +void importCoreMediaProtocols() { + id o; +} diff --git a/macos/coremediaio/aliastypes.gen.go b/macos/coremediaio/aliastypes.gen.go new file mode 100644 index 00000000..ce790589 --- /dev/null +++ b/macos/coremediaio/aliastypes.gen.go @@ -0,0 +1,22 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiostreamscheduledoutputnotificationproc?language=objc +type StreamScheduledOutputNotificationProc = func(sequenceNumberOfBufferThatWasOutput uint64, outputHostTime uint64, scheduledOutputNotificationRefCon unsafe.Pointer) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiodevicegetsmptetimeproc?language=objc +type DeviceGetSMPTETimeProc = func(refCon unsafe.Pointer, frameNumber *uint64, isDropFrame *bool, tolerance *uint32) uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiodevicestreamqueuealteredproc?language=objc +type DeviceStreamQueueAlteredProc = func(streamID StreamID, token unsafe.Pointer, refCon unsafe.Pointer) diff --git a/macos/coremediaio/doc.gen.go b/macos/coremediaio/doc.gen.go new file mode 100644 index 00000000..60013562 --- /dev/null +++ b/macos/coremediaio/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Securely support custom camera devices in macOS. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/coremediaio?language=objc +package coremediaio diff --git a/macos/coremediaio/enumtypes.gen.go b/macos/coremediaio/enumtypes.gen.go new file mode 100644 index 00000000..127f411b --- /dev/null +++ b/macos/coremediaio/enumtypes.gen.go @@ -0,0 +1,73 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioclassid?language=objc +type ClassID uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiocontrolid?language=objc +type ControlID ObjectID + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiodeviceid?language=objc +type DeviceID ObjectID + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiodevicepropertyid?language=objc +type DevicePropertyID ObjectPropertySelector + +// A structure that defines the properties that providers, devices, and streams support. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproperty?language=objc +type ExtensionProperty string + +// Constants that indicate the clock type of a stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamclocktype?language=objc +type ExtensionStreamClockType int + +// Constants that define the data-flow direction of the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamdirection?language=objc +type ExtensionStreamDirection int + +// Constants that specify the types of discontinuities that can occur in a media stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamdiscontinuityflags?language=objc +type ExtensionStreamDiscontinuityFlags uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiohardwarepropertyid?language=objc +type HardwarePropertyID ObjectPropertySelector + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioobjectid?language=objc +type ObjectID uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioobjectpropertyelement?language=objc +type ObjectPropertyElement uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioobjectpropertyscope?language=objc +type ObjectPropertyScope uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioobjectpropertyselector?language=objc +type ObjectPropertySelector uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmiostreamid?language=objc +type StreamID ObjectID diff --git a/macos/coremediaio/extension_client.gen.go b/macos/coremediaio/extension_client.gen.go new file mode 100644 index 00000000..5acb51ec --- /dev/null +++ b/macos/coremediaio/extension_client.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionClient] class. +var ExtensionClientClass = _ExtensionClientClass{objc.GetClass("CMIOExtensionClient")} + +type _ExtensionClientClass struct { + objc.Class +} + +// An interface definition for the [ExtensionClient] class. +type IExtensionClient interface { + objc.IObject + ClientID() foundation.UUID +} + +// An object that represents a client of the extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionclient?language=objc +type ExtensionClient struct { + objc.Object +} + +func ExtensionClientFrom(ptr unsafe.Pointer) ExtensionClient { + return ExtensionClient{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExtensionClientClass) Alloc() ExtensionClient { + rv := objc.Call[ExtensionClient](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionClient_Alloc() ExtensionClient { + return ExtensionClientClass.Alloc() +} + +func (ec _ExtensionClientClass) New() ExtensionClient { + rv := objc.Call[ExtensionClient](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionClient() ExtensionClient { + return ExtensionClientClass.New() +} + +func (e_ ExtensionClient) Init() ExtensionClient { + rv := objc.Call[ExtensionClient](e_, objc.Sel("init")) + return rv +} + +// A unique client identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionclient/3915852-clientid?language=objc +func (e_ ExtensionClient) ClientID() foundation.UUID { + rv := objc.Call[foundation.UUID](e_, objc.Sel("clientID")) + return rv +} diff --git a/macos/coremediaio/extension_device.gen.go b/macos/coremediaio/extension_device.gen.go new file mode 100644 index 00000000..e7f86064 --- /dev/null +++ b/macos/coremediaio/extension_device.gen.go @@ -0,0 +1,130 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionDevice] class. +var ExtensionDeviceClass = _ExtensionDeviceClass{objc.GetClass("CMIOExtensionDevice")} + +type _ExtensionDeviceClass struct { + objc.Class +} + +// An interface definition for the [ExtensionDevice] class. +type IExtensionDevice interface { + objc.IObject + NotifyPropertiesChanged(propertyStates map[ExtensionProperty]IExtensionPropertyState) + RemoveStreamError(stream IExtensionStream, outError foundation.IError) bool + AddStreamError(stream IExtensionStream, outError foundation.IError) bool + DeviceID() foundation.UUID + Streams() []ExtensionStream + Source() ExtensionDeviceSourceWrapper + LocalizedName() string + LegacyDeviceID() string +} + +// An object that represents a physical or virtual device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice?language=objc +type ExtensionDevice struct { + objc.Object +} + +func ExtensionDeviceFrom(ptr unsafe.Pointer) ExtensionDevice { + return ExtensionDevice{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExtensionDeviceClass) Alloc() ExtensionDevice { + rv := objc.Call[ExtensionDevice](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionDevice_Alloc() ExtensionDevice { + return ExtensionDeviceClass.Alloc() +} + +func (ec _ExtensionDeviceClass) New() ExtensionDevice { + rv := objc.Call[ExtensionDevice](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionDevice() ExtensionDevice { + return ExtensionDeviceClass.New() +} + +func (e_ ExtensionDevice) Init() ExtensionDevice { + rv := objc.Call[ExtensionDevice](e_, objc.Sel("init")) + return rv +} + +// Notifies clients of property changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915834-notifypropertieschanged?language=objc +func (e_ ExtensionDevice) NotifyPropertiesChanged(propertyStates map[ExtensionProperty]IExtensionPropertyState) { + objc.Call[objc.Void](e_, objc.Sel("notifyPropertiesChanged:"), propertyStates) +} + +// Removes a stream from the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915835-removestream?language=objc +func (e_ ExtensionDevice) RemoveStreamError(stream IExtensionStream, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("removeStream:error:"), objc.Ptr(stream), objc.Ptr(outError)) + return rv +} + +// Adds a stream to a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915826-addstream?language=objc +func (e_ ExtensionDevice) AddStreamError(stream IExtensionStream, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("addStream:error:"), objc.Ptr(stream), objc.Ptr(outError)) + return rv +} + +// A universally unique device identifier value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915827-deviceid?language=objc +func (e_ ExtensionDevice) DeviceID() foundation.UUID { + rv := objc.Call[foundation.UUID](e_, objc.Sel("deviceID")) + return rv +} + +// An array of media streams attached to this device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915837-streams?language=objc +func (e_ ExtensionDevice) Streams() []ExtensionStream { + rv := objc.Call[[]ExtensionStream](e_, objc.Sel("streams")) + return rv +} + +// A source object for a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915836-source?language=objc +func (e_ ExtensionDevice) Source() ExtensionDeviceSourceWrapper { + rv := objc.Call[ExtensionDeviceSourceWrapper](e_, objc.Sel("source")) + return rv +} + +// A localized name for a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915833-localizedname?language=objc +func (e_ ExtensionDevice) LocalizedName() string { + rv := objc.Call[string](e_, objc.Sel("localizedName")) + return rv +} + +// A legacy device identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevice/3915832-legacydeviceid?language=objc +func (e_ ExtensionDevice) LegacyDeviceID() string { + rv := objc.Call[string](e_, objc.Sel("legacyDeviceID")) + return rv +} diff --git a/macos/coremediaio/extension_device_properties.gen.go b/macos/coremediaio/extension_device_properties.gen.go new file mode 100644 index 00000000..917a599a --- /dev/null +++ b/macos/coremediaio/extension_device_properties.gen.go @@ -0,0 +1,178 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionDeviceProperties] class. +var ExtensionDevicePropertiesClass = _ExtensionDevicePropertiesClass{objc.GetClass("CMIOExtensionDeviceProperties")} + +type _ExtensionDevicePropertiesClass struct { + objc.Class +} + +// An interface definition for the [ExtensionDeviceProperties] class. +type IExtensionDeviceProperties interface { + objc.IObject + SetPropertyStateForProperty(propertyState IExtensionPropertyState, property ExtensionProperty) + Model() string + SetModel(value string) + TransportType() foundation.Number + SetTransportType(value foundation.INumber) + LinkedCoreAudioDeviceUID() string + SetLinkedCoreAudioDeviceUID(value string) + Suspended() foundation.Number + SetSuspended(value foundation.INumber) + PropertiesDictionary() map[ExtensionProperty]ExtensionPropertyState + SetPropertiesDictionary(value map[ExtensionProperty]IExtensionPropertyState) +} + +// An object that defines the properties of a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties?language=objc +type ExtensionDeviceProperties struct { + objc.Object +} + +func ExtensionDevicePropertiesFrom(ptr unsafe.Pointer) ExtensionDeviceProperties { + return ExtensionDeviceProperties{ + Object: objc.ObjectFrom(ptr), + } +} + +func (e_ ExtensionDeviceProperties) InitWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionDeviceProperties { + rv := objc.Call[ExtensionDeviceProperties](e_, objc.Sel("initWithDictionary:"), propertiesDictionary) + return rv +} + +// Creates a properties object with a dictionary of property states. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915840-initwithdictionary?language=objc +func NewExtensionDevicePropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionDeviceProperties { + instance := ExtensionDevicePropertiesClass.Alloc().InitWithDictionary(propertiesDictionary) + instance.Autorelease() + return instance +} + +func (ec _ExtensionDevicePropertiesClass) DevicePropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionDeviceProperties { + rv := objc.Call[ExtensionDeviceProperties](ec, objc.Sel("devicePropertiesWithDictionary:"), propertiesDictionary) + return rv +} + +// Returns a new properties object with a dictionary of property states. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915839-devicepropertieswithdictionary?language=objc +func ExtensionDeviceProperties_DevicePropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionDeviceProperties { + return ExtensionDevicePropertiesClass.DevicePropertiesWithDictionary(propertiesDictionary) +} + +func (ec _ExtensionDevicePropertiesClass) Alloc() ExtensionDeviceProperties { + rv := objc.Call[ExtensionDeviceProperties](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionDeviceProperties_Alloc() ExtensionDeviceProperties { + return ExtensionDevicePropertiesClass.Alloc() +} + +func (ec _ExtensionDevicePropertiesClass) New() ExtensionDeviceProperties { + rv := objc.Call[ExtensionDeviceProperties](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionDeviceProperties() ExtensionDeviceProperties { + return ExtensionDevicePropertiesClass.New() +} + +func (e_ ExtensionDeviceProperties) Init() ExtensionDeviceProperties { + rv := objc.Call[ExtensionDeviceProperties](e_, objc.Sel("init")) + return rv +} + +// Sets the value of a device property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915844-setpropertystate?language=objc +func (e_ ExtensionDeviceProperties) SetPropertyStateForProperty(propertyState IExtensionPropertyState, property ExtensionProperty) { + objc.Call[objc.Void](e_, objc.Sel("setPropertyState:forProperty:"), objc.Ptr(propertyState), property) +} + +// A device model string. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915842-model?language=objc +func (e_ ExtensionDeviceProperties) Model() string { + rv := objc.Call[string](e_, objc.Sel("model")) + return rv +} + +// A device model string. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915842-model?language=objc +func (e_ ExtensionDeviceProperties) SetModel(value string) { + objc.Call[objc.Void](e_, objc.Sel("setModel:"), value) +} + +// The transport type of the device, such as USB or HDMI. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915846-transporttype?language=objc +func (e_ ExtensionDeviceProperties) TransportType() foundation.Number { + rv := objc.Call[foundation.Number](e_, objc.Sel("transportType")) + return rv +} + +// The transport type of the device, such as USB or HDMI. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915846-transporttype?language=objc +func (e_ ExtensionDeviceProperties) SetTransportType(value foundation.INumber) { + objc.Call[objc.Void](e_, objc.Sel("setTransportType:"), objc.Ptr(value)) +} + +// A universal identifier of the audio device linked to this device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915841-linkedcoreaudiodeviceuid?language=objc +func (e_ ExtensionDeviceProperties) LinkedCoreAudioDeviceUID() string { + rv := objc.Call[string](e_, objc.Sel("linkedCoreAudioDeviceUID")) + return rv +} + +// A universal identifier of the audio device linked to this device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915841-linkedcoreaudiodeviceuid?language=objc +func (e_ ExtensionDeviceProperties) SetLinkedCoreAudioDeviceUID(value string) { + objc.Call[objc.Void](e_, objc.Sel("setLinkedCoreAudioDeviceUID:"), value) +} + +// A Boolean value that indicates whether the device is in a suspended state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915845-suspended?language=objc +func (e_ ExtensionDeviceProperties) Suspended() foundation.Number { + rv := objc.Call[foundation.Number](e_, objc.Sel("suspended")) + return rv +} + +// A Boolean value that indicates whether the device is in a suspended state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915845-suspended?language=objc +func (e_ ExtensionDeviceProperties) SetSuspended(value foundation.INumber) { + objc.Call[objc.Void](e_, objc.Sel("setSuspended:"), objc.Ptr(value)) +} + +// A dictionary of properties for a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915843-propertiesdictionary?language=objc +func (e_ ExtensionDeviceProperties) PropertiesDictionary() map[ExtensionProperty]ExtensionPropertyState { + rv := objc.Call[map[ExtensionProperty]ExtensionPropertyState](e_, objc.Sel("propertiesDictionary")) + return rv +} + +// A dictionary of properties for a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondeviceproperties/3915843-propertiesdictionary?language=objc +func (e_ ExtensionDeviceProperties) SetPropertiesDictionary(value map[ExtensionProperty]IExtensionPropertyState) { + objc.Call[objc.Void](e_, objc.Sel("setPropertiesDictionary:"), value) +} diff --git a/macos/coremediaio/extension_device_source.gen.go b/macos/coremediaio/extension_device_source.gen.go new file mode 100644 index 00000000..66e199ff --- /dev/null +++ b/macos/coremediaio/extension_device_source.gen.go @@ -0,0 +1,66 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol for objects that act as device sources. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevicesource?language=objc +type PExtensionDeviceSource interface { + // optional + SetDevicePropertiesError(deviceProperties ExtensionDeviceProperties, outError foundation.Error) bool + HasSetDevicePropertiesError() bool + + // optional + DevicePropertiesForPropertiesError(properties foundation.Set, outError foundation.Error) IExtensionDeviceProperties + HasDevicePropertiesForPropertiesError() bool + + // optional + AvailableProperties() foundation.ISet + HasAvailableProperties() bool +} + +// A concrete type wrapper for the [PExtensionDeviceSource] protocol. +type ExtensionDeviceSourceWrapper struct { + objc.Object +} + +func (e_ ExtensionDeviceSourceWrapper) HasSetDevicePropertiesError() bool { + return e_.RespondsToSelector(objc.Sel("setDeviceProperties:error:")) +} + +// Sets the state of device properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevicesource/3915850-setdeviceproperties?language=objc +func (e_ ExtensionDeviceSourceWrapper) SetDevicePropertiesError(deviceProperties IExtensionDeviceProperties, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("setDeviceProperties:error:"), objc.Ptr(deviceProperties), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionDeviceSourceWrapper) HasDevicePropertiesForPropertiesError() bool { + return e_.RespondsToSelector(objc.Sel("devicePropertiesForProperties:error:")) +} + +// Retrieves the state of device properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevicesource/3915849-devicepropertiesforproperties?language=objc +func (e_ ExtensionDeviceSourceWrapper) DevicePropertiesForPropertiesError(properties foundation.ISet, outError foundation.IError) ExtensionDeviceProperties { + rv := objc.Call[ExtensionDeviceProperties](e_, objc.Sel("devicePropertiesForProperties:error:"), objc.Ptr(properties), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionDeviceSourceWrapper) HasAvailableProperties() bool { + return e_.RespondsToSelector(objc.Sel("availableProperties")) +} + +// A set of available properties that a device provides. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensiondevicesource/3915848-availableproperties?language=objc +func (e_ ExtensionDeviceSourceWrapper) AvailableProperties() foundation.Set { + rv := objc.Call[foundation.Set](e_, objc.Sel("availableProperties")) + return rv +} diff --git a/macos/coremediaio/extension_property_attributes.gen.go b/macos/coremediaio/extension_property_attributes.gen.go new file mode 100644 index 00000000..b7fa95e8 --- /dev/null +++ b/macos/coremediaio/extension_property_attributes.gen.go @@ -0,0 +1,135 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionPropertyAttributes] class. +var ExtensionPropertyAttributesClass = _ExtensionPropertyAttributesClass{objc.GetClass("CMIOExtensionPropertyAttributes")} + +type _ExtensionPropertyAttributesClass struct { + objc.Class +} + +// An interface definition for the [ExtensionPropertyAttributes] class. +type IExtensionPropertyAttributes interface { + objc.IObject + IsReadOnly() bool + ValidValues() []objc.Object + MinValue() objc.Object + MaxValue() objc.Object +} + +// An object that describes the attributes of a property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes?language=objc +type ExtensionPropertyAttributes struct { + objc.Object +} + +func ExtensionPropertyAttributesFrom(ptr unsafe.Pointer) ExtensionPropertyAttributes { + return ExtensionPropertyAttributes{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExtensionPropertyAttributesClass) PropertyAttributesWithMinValueMaxValueValidValuesReadOnly(minValue objc.IObject, maxValue objc.IObject, validValues []objc.IObject, readOnly bool) ExtensionPropertyAttributes { + rv := objc.Call[ExtensionPropertyAttributes](ec, objc.Sel("propertyAttributesWithMinValue:maxValue:validValues:readOnly:"), objc.Ptr(minValue), objc.Ptr(maxValue), validValues, readOnly) + return rv +} + +// Returns a new property attributes object with the specified configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915859-propertyattributeswithminvalue?language=objc +func ExtensionPropertyAttributes_PropertyAttributesWithMinValueMaxValueValidValuesReadOnly(minValue objc.IObject, maxValue objc.IObject, validValues []objc.IObject, readOnly bool) ExtensionPropertyAttributes { + return ExtensionPropertyAttributesClass.PropertyAttributesWithMinValueMaxValueValidValuesReadOnly(minValue, maxValue, validValues, readOnly) +} + +func (e_ ExtensionPropertyAttributes) InitWithMinValueMaxValueValidValuesReadOnly(minValue objc.IObject, maxValue objc.IObject, validValues []objc.IObject, readOnly bool) ExtensionPropertyAttributes { + rv := objc.Call[ExtensionPropertyAttributes](e_, objc.Sel("initWithMinValue:maxValue:validValues:readOnly:"), objc.Ptr(minValue), objc.Ptr(maxValue), validValues, readOnly) + return rv +} + +// Creates a property attributes object with the specified configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915856-initwithminvalue?language=objc +func NewExtensionPropertyAttributesWithMinValueMaxValueValidValuesReadOnly(minValue objc.IObject, maxValue objc.IObject, validValues []objc.IObject, readOnly bool) ExtensionPropertyAttributes { + instance := ExtensionPropertyAttributesClass.Alloc().InitWithMinValueMaxValueValidValuesReadOnly(minValue, maxValue, validValues, readOnly) + instance.Autorelease() + return instance +} + +func (ec _ExtensionPropertyAttributesClass) Alloc() ExtensionPropertyAttributes { + rv := objc.Call[ExtensionPropertyAttributes](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionPropertyAttributes_Alloc() ExtensionPropertyAttributes { + return ExtensionPropertyAttributesClass.Alloc() +} + +func (ec _ExtensionPropertyAttributesClass) New() ExtensionPropertyAttributes { + rv := objc.Call[ExtensionPropertyAttributes](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionPropertyAttributes() ExtensionPropertyAttributes { + return ExtensionPropertyAttributesClass.New() +} + +func (e_ ExtensionPropertyAttributes) Init() ExtensionPropertyAttributes { + rv := objc.Call[ExtensionPropertyAttributes](e_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether a property is read-only. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915860-readonly?language=objc +func (e_ ExtensionPropertyAttributes) IsReadOnly() bool { + rv := objc.Call[bool](e_, objc.Sel("isReadOnly")) + return rv +} + +// An array of discrete values that this property supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915862-validvalues?language=objc +func (e_ ExtensionPropertyAttributes) ValidValues() []objc.Object { + rv := objc.Call[[]objc.Object](e_, objc.Sel("validValues")) + return rv +} + +// The minimum value a property supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915858-minvalue?language=objc +func (e_ ExtensionPropertyAttributes) MinValue() objc.Object { + rv := objc.Call[objc.Object](e_, objc.Sel("minValue")) + return rv +} + +// A class property for a read-only property attribute. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915861-readonlypropertyattribute?language=objc +func (ec _ExtensionPropertyAttributesClass) ReadOnlyPropertyAttribute() ExtensionPropertyAttributes { + rv := objc.Call[ExtensionPropertyAttributes](ec, objc.Sel("readOnlyPropertyAttribute")) + return rv +} + +// A class property for a read-only property attribute. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915861-readonlypropertyattribute?language=objc +func ExtensionPropertyAttributes_ReadOnlyPropertyAttribute() ExtensionPropertyAttributes { + return ExtensionPropertyAttributesClass.ReadOnlyPropertyAttribute() +} + +// The maximum value a property supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertyattributes/3915857-maxvalue?language=objc +func (e_ ExtensionPropertyAttributes) MaxValue() objc.Object { + rv := objc.Call[objc.Object](e_, objc.Sel("maxValue")) + return rv +} diff --git a/macos/coremediaio/extension_property_state.gen.go b/macos/coremediaio/extension_property_state.gen.go new file mode 100644 index 00000000..6e70e189 --- /dev/null +++ b/macos/coremediaio/extension_property_state.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionPropertyState] class. +var ExtensionPropertyStateClass = _ExtensionPropertyStateClass{objc.GetClass("CMIOExtensionPropertyState")} + +type _ExtensionPropertyStateClass struct { + objc.Class +} + +// An interface definition for the [ExtensionPropertyState] class. +type IExtensionPropertyState interface { + objc.IObject + Value() objc.Object + Attributes() ExtensionPropertyAttributes +} + +// An object that describes the state of a property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystate?language=objc +type ExtensionPropertyState struct { + objc.Object +} + +func ExtensionPropertyStateFrom(ptr unsafe.Pointer) ExtensionPropertyState { + return ExtensionPropertyState{ + Object: objc.ObjectFrom(ptr), + } +} + +func (e_ ExtensionPropertyState) InitWithValueAttributes(value objc.IObject, attributes IExtensionPropertyAttributes) ExtensionPropertyState { + rv := objc.Call[ExtensionPropertyState](e_, objc.Sel("initWithValue:attributes:"), objc.Ptr(value), objc.Ptr(attributes)) + return rv +} + +// Creates a property state with a value and attributes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystate/3915872-initwithvalue?language=objc +func NewExtensionPropertyStateWithValueAttributes(value objc.IObject, attributes IExtensionPropertyAttributes) ExtensionPropertyState { + instance := ExtensionPropertyStateClass.Alloc().InitWithValueAttributes(value, attributes) + instance.Autorelease() + return instance +} + +func (ec _ExtensionPropertyStateClass) PropertyStateWithValue(value objc.IObject) ExtensionPropertyState { + rv := objc.Call[ExtensionPropertyState](ec, objc.Sel("propertyStateWithValue:"), objc.Ptr(value)) + return rv +} + +// Returns a new property state with a value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystate/3915873-propertystatewithvalue?language=objc +func ExtensionPropertyState_PropertyStateWithValue(value objc.IObject) ExtensionPropertyState { + return ExtensionPropertyStateClass.PropertyStateWithValue(value) +} + +func (ec _ExtensionPropertyStateClass) Alloc() ExtensionPropertyState { + rv := objc.Call[ExtensionPropertyState](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionPropertyState_Alloc() ExtensionPropertyState { + return ExtensionPropertyStateClass.Alloc() +} + +func (ec _ExtensionPropertyStateClass) New() ExtensionPropertyState { + rv := objc.Call[ExtensionPropertyState](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionPropertyState() ExtensionPropertyState { + return ExtensionPropertyStateClass.New() +} + +func (e_ ExtensionPropertyState) Init() ExtensionPropertyState { + rv := objc.Call[ExtensionPropertyState](e_, objc.Sel("init")) + return rv +} + +// The value for a property state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystate/3915875-value?language=objc +func (e_ ExtensionPropertyState) Value() objc.Object { + rv := objc.Call[objc.Object](e_, objc.Sel("value")) + return rv +} + +// The attributes for a property state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionpropertystate/3915870-attributes?language=objc +func (e_ ExtensionPropertyState) Attributes() ExtensionPropertyAttributes { + rv := objc.Call[ExtensionPropertyAttributes](e_, objc.Sel("attributes")) + return rv +} diff --git a/macos/coremediaio/extension_provider.gen.go b/macos/coremediaio/extension_provider.gen.go new file mode 100644 index 00000000..49072d19 --- /dev/null +++ b/macos/coremediaio/extension_provider.gen.go @@ -0,0 +1,164 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/dispatch" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionProvider] class. +var ExtensionProviderClass = _ExtensionProviderClass{objc.GetClass("CMIOExtensionProvider")} + +type _ExtensionProviderClass struct { + objc.Class +} + +// An interface definition for the [ExtensionProvider] class. +type IExtensionProvider interface { + objc.IObject + NotifyPropertiesChanged(propertyStates map[ExtensionProperty]IExtensionPropertyState) + AddDeviceError(device IExtensionDevice, outError foundation.IError) bool + RemoveDeviceError(device IExtensionDevice, outError foundation.IError) bool + Source() ExtensionProviderSourceWrapper + ConnectedClients() []ExtensionClient + ClientQueue() dispatch.Queue + Devices() []ExtensionDevice +} + +// An object that manages device connections for a provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider?language=objc +type ExtensionProvider struct { + objc.Object +} + +func ExtensionProviderFrom(ptr unsafe.Pointer) ExtensionProvider { + return ExtensionProvider{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExtensionProviderClass) ProviderWithSourceClientQueue(source PExtensionProviderSource, clientQueue dispatch.Queue) ExtensionProvider { + po0 := objc.WrapAsProtocol("CMIOExtensionProviderSource", source) + rv := objc.Call[ExtensionProvider](ec, objc.Sel("providerWithSource:clientQueue:"), po0, clientQueue) + return rv +} + +// Returns a new extension provider with the specified source and dispatch queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915912-providerwithsource?language=objc +func ExtensionProvider_ProviderWithSourceClientQueue(source PExtensionProviderSource, clientQueue dispatch.Queue) ExtensionProvider { + return ExtensionProviderClass.ProviderWithSourceClientQueue(source, clientQueue) +} + +func (e_ ExtensionProvider) InitWithSourceClientQueue(source PExtensionProviderSource, clientQueue dispatch.Queue) ExtensionProvider { + po0 := objc.WrapAsProtocol("CMIOExtensionProviderSource", source) + rv := objc.Call[ExtensionProvider](e_, objc.Sel("initWithSource:clientQueue:"), po0, clientQueue) + return rv +} + +// Creates an extension provider with the specified source and dispatch queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915910-initwithsource?language=objc +func NewExtensionProviderWithSourceClientQueue(source PExtensionProviderSource, clientQueue dispatch.Queue) ExtensionProvider { + instance := ExtensionProviderClass.Alloc().InitWithSourceClientQueue(source, clientQueue) + instance.Autorelease() + return instance +} + +func (ec _ExtensionProviderClass) Alloc() ExtensionProvider { + rv := objc.Call[ExtensionProvider](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionProvider_Alloc() ExtensionProvider { + return ExtensionProviderClass.Alloc() +} + +func (ec _ExtensionProviderClass) New() ExtensionProvider { + rv := objc.Call[ExtensionProvider](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionProvider() ExtensionProvider { + return ExtensionProviderClass.New() +} + +func (e_ ExtensionProvider) Init() ExtensionProvider { + rv := objc.Call[ExtensionProvider](e_, objc.Sel("init")) + return rv +} + +// Notifies connected clients of device property changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915911-notifypropertieschanged?language=objc +func (e_ ExtensionProvider) NotifyPropertiesChanged(propertyStates map[ExtensionProperty]IExtensionPropertyState) { + objc.Call[objc.Void](e_, objc.Sel("notifyPropertiesChanged:"), propertyStates) +} + +// Starts the system extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915915-startservicewithprovider?language=objc +func (ec _ExtensionProviderClass) StartServiceWithProvider(provider IExtensionProvider) { + objc.Call[objc.Void](ec, objc.Sel("startServiceWithProvider:"), objc.Ptr(provider)) +} + +// Starts the system extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915915-startservicewithprovider?language=objc +func ExtensionProvider_StartServiceWithProvider(provider IExtensionProvider) { + ExtensionProviderClass.StartServiceWithProvider(provider) +} + +// Adds a device to a provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915906-adddevice?language=objc +func (e_ ExtensionProvider) AddDeviceError(device IExtensionDevice, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("addDevice:error:"), objc.Ptr(device), objc.Ptr(outError)) + return rv +} + +// Removes a device from a provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915913-removedevice?language=objc +func (e_ ExtensionProvider) RemoveDeviceError(device IExtensionDevice, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("removeDevice:error:"), objc.Ptr(device), objc.Ptr(outError)) + return rv +} + +// The source for the provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915914-source?language=objc +func (e_ ExtensionProvider) Source() ExtensionProviderSourceWrapper { + rv := objc.Call[ExtensionProviderSourceWrapper](e_, objc.Sel("source")) + return rv +} + +// An array of connected clients. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915908-connectedclients?language=objc +func (e_ ExtensionProvider) ConnectedClients() []ExtensionClient { + rv := objc.Call[[]ExtensionClient](e_, objc.Sel("connectedClients")) + return rv +} + +// The dispatch queue on which the system performs client operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915907-clientqueue?language=objc +func (e_ ExtensionProvider) ClientQueue() dispatch.Queue { + rv := objc.Call[dispatch.Queue](e_, objc.Sel("clientQueue")) + return rv +} + +// An array of connected devices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovider/3915909-devices?language=objc +func (e_ ExtensionProvider) Devices() []ExtensionDevice { + rv := objc.Call[[]ExtensionDevice](e_, objc.Sel("devices")) + return rv +} diff --git a/macos/coremediaio/extension_provider_properties.gen.go b/macos/coremediaio/extension_provider_properties.gen.go new file mode 100644 index 00000000..f2d9c0b1 --- /dev/null +++ b/macos/coremediaio/extension_provider_properties.gen.go @@ -0,0 +1,143 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionProviderProperties] class. +var ExtensionProviderPropertiesClass = _ExtensionProviderPropertiesClass{objc.GetClass("CMIOExtensionProviderProperties")} + +type _ExtensionProviderPropertiesClass struct { + objc.Class +} + +// An interface definition for the [ExtensionProviderProperties] class. +type IExtensionProviderProperties interface { + objc.IObject + SetPropertyStateForProperty(propertyState IExtensionPropertyState, property ExtensionProperty) + Name() string + SetName(value string) + Manufacturer() string + SetManufacturer(value string) + PropertiesDictionary() map[ExtensionProperty]ExtensionPropertyState + SetPropertiesDictionary(value map[ExtensionProperty]IExtensionPropertyState) +} + +// An object that manages the properties of an extension provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties?language=objc +type ExtensionProviderProperties struct { + objc.Object +} + +func ExtensionProviderPropertiesFrom(ptr unsafe.Pointer) ExtensionProviderProperties { + return ExtensionProviderProperties{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExtensionProviderPropertiesClass) ProviderPropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionProviderProperties { + rv := objc.Call[ExtensionProviderProperties](ec, objc.Sel("providerPropertiesWithDictionary:"), propertiesDictionary) + return rv +} + +// Returns a new provider properties object with the specified properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915921-providerpropertieswithdictionary?language=objc +func ExtensionProviderProperties_ProviderPropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionProviderProperties { + return ExtensionProviderPropertiesClass.ProviderPropertiesWithDictionary(propertiesDictionary) +} + +func (e_ ExtensionProviderProperties) InitWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionProviderProperties { + rv := objc.Call[ExtensionProviderProperties](e_, objc.Sel("initWithDictionary:"), propertiesDictionary) + return rv +} + +// Creates a provider properties object with the specified properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915917-initwithdictionary?language=objc +func NewExtensionProviderPropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionProviderProperties { + instance := ExtensionProviderPropertiesClass.Alloc().InitWithDictionary(propertiesDictionary) + instance.Autorelease() + return instance +} + +func (ec _ExtensionProviderPropertiesClass) Alloc() ExtensionProviderProperties { + rv := objc.Call[ExtensionProviderProperties](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionProviderProperties_Alloc() ExtensionProviderProperties { + return ExtensionProviderPropertiesClass.Alloc() +} + +func (ec _ExtensionProviderPropertiesClass) New() ExtensionProviderProperties { + rv := objc.Call[ExtensionProviderProperties](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionProviderProperties() ExtensionProviderProperties { + return ExtensionProviderPropertiesClass.New() +} + +func (e_ ExtensionProviderProperties) Init() ExtensionProviderProperties { + rv := objc.Call[ExtensionProviderProperties](e_, objc.Sel("init")) + return rv +} + +// Sets a state value for the specified property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915922-setpropertystate?language=objc +func (e_ ExtensionProviderProperties) SetPropertyStateForProperty(propertyState IExtensionPropertyState, property ExtensionProperty) { + objc.Call[objc.Void](e_, objc.Sel("setPropertyState:forProperty:"), objc.Ptr(propertyState), property) +} + +// The provider name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915919-name?language=objc +func (e_ ExtensionProviderProperties) Name() string { + rv := objc.Call[string](e_, objc.Sel("name")) + return rv +} + +// The provider name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915919-name?language=objc +func (e_ ExtensionProviderProperties) SetName(value string) { + objc.Call[objc.Void](e_, objc.Sel("setName:"), value) +} + +// The provider manufacturer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915918-manufacturer?language=objc +func (e_ ExtensionProviderProperties) Manufacturer() string { + rv := objc.Call[string](e_, objc.Sel("manufacturer")) + return rv +} + +// The provider manufacturer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915918-manufacturer?language=objc +func (e_ ExtensionProviderProperties) SetManufacturer(value string) { + objc.Call[objc.Void](e_, objc.Sel("setManufacturer:"), value) +} + +// A dictionary of properties for a provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915920-propertiesdictionary?language=objc +func (e_ ExtensionProviderProperties) PropertiesDictionary() map[ExtensionProperty]ExtensionPropertyState { + rv := objc.Call[map[ExtensionProperty]ExtensionPropertyState](e_, objc.Sel("propertiesDictionary")) + return rv +} + +// A dictionary of properties for a provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionproviderproperties/3915920-propertiesdictionary?language=objc +func (e_ ExtensionProviderProperties) SetPropertiesDictionary(value map[ExtensionProperty]IExtensionPropertyState) { + objc.Call[objc.Void](e_, objc.Sel("setPropertiesDictionary:"), value) +} diff --git a/macos/coremediaio/extension_provider_source.gen.go b/macos/coremediaio/extension_provider_source.gen.go new file mode 100644 index 00000000..9a47fd57 --- /dev/null +++ b/macos/coremediaio/extension_provider_source.gen.go @@ -0,0 +1,97 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol for objects that act as provider sources. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovidersource?language=objc +type PExtensionProviderSource interface { + // optional + SetProviderPropertiesError(providerProperties ExtensionProviderProperties, outError foundation.Error) bool + HasSetProviderPropertiesError() bool + + // optional + ProviderPropertiesForPropertiesError(properties foundation.Set, outError foundation.Error) IExtensionProviderProperties + HasProviderPropertiesForPropertiesError() bool + + // optional + ConnectClientError(client ExtensionClient, outError foundation.Error) bool + HasConnectClientError() bool + + // optional + DisconnectClient(client ExtensionClient) + HasDisconnectClient() bool + + // optional + AvailableProperties() foundation.ISet + HasAvailableProperties() bool +} + +// A concrete type wrapper for the [PExtensionProviderSource] protocol. +type ExtensionProviderSourceWrapper struct { + objc.Object +} + +func (e_ ExtensionProviderSourceWrapper) HasSetProviderPropertiesError() bool { + return e_.RespondsToSelector(objc.Sel("setProviderProperties:error:")) +} + +// Set the state of provider properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovidersource/3915928-setproviderproperties?language=objc +func (e_ ExtensionProviderSourceWrapper) SetProviderPropertiesError(providerProperties IExtensionProviderProperties, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("setProviderProperties:error:"), objc.Ptr(providerProperties), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionProviderSourceWrapper) HasProviderPropertiesForPropertiesError() bool { + return e_.RespondsToSelector(objc.Sel("providerPropertiesForProperties:error:")) +} + +// Gets the state of provider properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovidersource/3915927-providerpropertiesforproperties?language=objc +func (e_ ExtensionProviderSourceWrapper) ProviderPropertiesForPropertiesError(properties foundation.ISet, outError foundation.IError) ExtensionProviderProperties { + rv := objc.Call[ExtensionProviderProperties](e_, objc.Sel("providerPropertiesForProperties:error:"), objc.Ptr(properties), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionProviderSourceWrapper) HasConnectClientError() bool { + return e_.RespondsToSelector(objc.Sel("connectClient:error:")) +} + +// Connects a client to a source’s provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovidersource/3915925-connectclient?language=objc +func (e_ ExtensionProviderSourceWrapper) ConnectClientError(client IExtensionClient, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("connectClient:error:"), objc.Ptr(client), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionProviderSourceWrapper) HasDisconnectClient() bool { + return e_.RespondsToSelector(objc.Sel("disconnectClient:")) +} + +// Disconnects a client from a source’s provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovidersource/3915926-disconnectclient?language=objc +func (e_ ExtensionProviderSourceWrapper) DisconnectClient(client IExtensionClient) { + objc.Call[objc.Void](e_, objc.Sel("disconnectClient:"), objc.Ptr(client)) +} + +func (e_ ExtensionProviderSourceWrapper) HasAvailableProperties() bool { + return e_.RespondsToSelector(objc.Sel("availableProperties")) +} + +// A set of available properties for a provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionprovidersource/3915924-availableproperties?language=objc +func (e_ ExtensionProviderSourceWrapper) AvailableProperties() foundation.Set { + rv := objc.Call[foundation.Set](e_, objc.Sel("availableProperties")) + return rv +} diff --git a/macos/coremediaio/extension_scheduled_output.gen.go b/macos/coremediaio/extension_scheduled_output.gen.go new file mode 100644 index 00000000..4e3c0548 --- /dev/null +++ b/macos/coremediaio/extension_scheduled_output.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionScheduledOutput] class. +var ExtensionScheduledOutputClass = _ExtensionScheduledOutputClass{objc.GetClass("CMIOExtensionScheduledOutput")} + +type _ExtensionScheduledOutputClass struct { + objc.Class +} + +// An interface definition for the [ExtensionScheduledOutput] class. +type IExtensionScheduledOutput interface { + objc.IObject + HostTimeInNanoseconds() uint64 + SequenceNumber() uint64 +} + +// An object that represents scheduled output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionscheduledoutput?language=objc +type ExtensionScheduledOutput struct { + objc.Object +} + +func ExtensionScheduledOutputFrom(ptr unsafe.Pointer) ExtensionScheduledOutput { + return ExtensionScheduledOutput{ + Object: objc.ObjectFrom(ptr), + } +} + +func (e_ ExtensionScheduledOutput) InitWithSequenceNumberHostTimeInNanoseconds(sequenceNumber uint64, hostTimeInNanoseconds uint64) ExtensionScheduledOutput { + rv := objc.Call[ExtensionScheduledOutput](e_, objc.Sel("initWithSequenceNumber:hostTimeInNanoseconds:"), sequenceNumber, hostTimeInNanoseconds) + return rv +} + +// Creates a scheduled output object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionscheduledoutput/3915885-initwithsequencenumber?language=objc +func NewExtensionScheduledOutputWithSequenceNumberHostTimeInNanoseconds(sequenceNumber uint64, hostTimeInNanoseconds uint64) ExtensionScheduledOutput { + instance := ExtensionScheduledOutputClass.Alloc().InitWithSequenceNumberHostTimeInNanoseconds(sequenceNumber, hostTimeInNanoseconds) + instance.Autorelease() + return instance +} + +func (ec _ExtensionScheduledOutputClass) ScheduledOutputWithSequenceNumberHostTimeInNanoseconds(sequenceNumber uint64, hostTimeInNanoseconds uint64) ExtensionScheduledOutput { + rv := objc.Call[ExtensionScheduledOutput](ec, objc.Sel("scheduledOutputWithSequenceNumber:hostTimeInNanoseconds:"), sequenceNumber, hostTimeInNanoseconds) + return rv +} + +// Returns a new scheduled output object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionscheduledoutput/3915886-scheduledoutputwithsequencenumbe?language=objc +func ExtensionScheduledOutput_ScheduledOutputWithSequenceNumberHostTimeInNanoseconds(sequenceNumber uint64, hostTimeInNanoseconds uint64) ExtensionScheduledOutput { + return ExtensionScheduledOutputClass.ScheduledOutputWithSequenceNumberHostTimeInNanoseconds(sequenceNumber, hostTimeInNanoseconds) +} + +func (ec _ExtensionScheduledOutputClass) Alloc() ExtensionScheduledOutput { + rv := objc.Call[ExtensionScheduledOutput](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionScheduledOutput_Alloc() ExtensionScheduledOutput { + return ExtensionScheduledOutputClass.Alloc() +} + +func (ec _ExtensionScheduledOutputClass) New() ExtensionScheduledOutput { + rv := objc.Call[ExtensionScheduledOutput](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionScheduledOutput() ExtensionScheduledOutput { + return ExtensionScheduledOutputClass.New() +} + +func (e_ ExtensionScheduledOutput) Init() ExtensionScheduledOutput { + rv := objc.Call[ExtensionScheduledOutput](e_, objc.Sel("init")) + return rv +} + +// The host time in nanoseconds when the buffer was output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionscheduledoutput/3915884-hosttimeinnanoseconds?language=objc +func (e_ ExtensionScheduledOutput) HostTimeInNanoseconds() uint64 { + rv := objc.Call[uint64](e_, objc.Sel("hostTimeInNanoseconds")) + return rv +} + +// The buffer sequence number that was output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionscheduledoutput/3915887-sequencenumber?language=objc +func (e_ ExtensionScheduledOutput) SequenceNumber() uint64 { + rv := objc.Call[uint64](e_, objc.Sel("sequenceNumber")) + return rv +} diff --git a/macos/coremediaio/extension_stream.gen.go b/macos/coremediaio/extension_stream.gen.go new file mode 100644 index 00000000..c7faf072 --- /dev/null +++ b/macos/coremediaio/extension_stream.gen.go @@ -0,0 +1,183 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionStream] class. +var ExtensionStreamClass = _ExtensionStreamClass{objc.GetClass("CMIOExtensionStream")} + +type _ExtensionStreamClass struct { + objc.Class +} + +// An interface definition for the [ExtensionStream] class. +type IExtensionStream interface { + objc.IObject + NotifyPropertiesChanged(propertyStates map[ExtensionProperty]IExtensionPropertyState) + NotifyScheduledOutputChanged(scheduledOutput IExtensionScheduledOutput) + SendSampleBufferDiscontinuityHostTimeInNanoseconds(sampleBuffer coremedia.SampleBufferRef, discontinuity ExtensionStreamDiscontinuityFlags, hostTimeInNanoseconds uint64) + ConsumeSampleBufferFromClientCompletionHandler(client IExtensionClient, completionHandler func(sampleBuffer coremedia.SampleBufferRef, sampleBufferSequenceNumber uint64, discontinuity ExtensionStreamDiscontinuityFlags, hasMoreSampleBuffers bool, error foundation.Error)) + StreamID() foundation.UUID + Direction() ExtensionStreamDirection + Source() ExtensionStreamSourceWrapper + LocalizedName() string + ClockType() ExtensionStreamClockType + CustomClockConfiguration() ExtensionStreamCustomClockConfiguration + StreamingClients() []ExtensionClient +} + +// An object that represents a stream of media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream?language=objc +type ExtensionStream struct { + objc.Object +} + +func ExtensionStreamFrom(ptr unsafe.Pointer) ExtensionStream { + return ExtensionStream{ + Object: objc.ObjectFrom(ptr), + } +} + +func (e_ ExtensionStream) InitWithLocalizedNameStreamIDDirectionClockTypeSource(localizedName string, streamID foundation.IUUID, direction ExtensionStreamDirection, clockType ExtensionStreamClockType, source PExtensionStreamSource) ExtensionStream { + po4 := objc.WrapAsProtocol("CMIOExtensionStreamSource", source) + rv := objc.Call[ExtensionStream](e_, objc.Sel("initWithLocalizedName:streamID:direction:clockType:source:"), localizedName, objc.Ptr(streamID), direction, clockType, po4) + return rv +} + +// Creates a stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915934-initwithlocalizedname?language=objc +func NewExtensionStreamWithLocalizedNameStreamIDDirectionClockTypeSource(localizedName string, streamID foundation.IUUID, direction ExtensionStreamDirection, clockType ExtensionStreamClockType, source PExtensionStreamSource) ExtensionStream { + instance := ExtensionStreamClass.Alloc().InitWithLocalizedNameStreamIDDirectionClockTypeSource(localizedName, streamID, direction, clockType, source) + instance.Autorelease() + return instance +} + +func (ec _ExtensionStreamClass) StreamWithLocalizedNameStreamIDDirectionClockTypeSource(localizedName string, streamID foundation.IUUID, direction ExtensionStreamDirection, clockType ExtensionStreamClockType, source PExtensionStreamSource) ExtensionStream { + po4 := objc.WrapAsProtocol("CMIOExtensionStreamSource", source) + rv := objc.Call[ExtensionStream](ec, objc.Sel("streamWithLocalizedName:streamID:direction:clockType:source:"), localizedName, objc.Ptr(streamID), direction, clockType, po4) + return rv +} + +// Returns a new stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915942-streamwithlocalizedname?language=objc +func ExtensionStream_StreamWithLocalizedNameStreamIDDirectionClockTypeSource(localizedName string, streamID foundation.IUUID, direction ExtensionStreamDirection, clockType ExtensionStreamClockType, source PExtensionStreamSource) ExtensionStream { + return ExtensionStreamClass.StreamWithLocalizedNameStreamIDDirectionClockTypeSource(localizedName, streamID, direction, clockType, source) +} + +func (ec _ExtensionStreamClass) Alloc() ExtensionStream { + rv := objc.Call[ExtensionStream](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionStream_Alloc() ExtensionStream { + return ExtensionStreamClass.Alloc() +} + +func (ec _ExtensionStreamClass) New() ExtensionStream { + rv := objc.Call[ExtensionStream](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionStream() ExtensionStream { + return ExtensionStreamClass.New() +} + +func (e_ ExtensionStream) Init() ExtensionStream { + rv := objc.Call[ExtensionStream](e_, objc.Sel("init")) + return rv +} + +// Notifies clients about stream property changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915937-notifypropertieschanged?language=objc +func (e_ ExtensionStream) NotifyPropertiesChanged(propertyStates map[ExtensionProperty]IExtensionPropertyState) { + objc.Call[objc.Void](e_, objc.Sel("notifyPropertiesChanged:"), propertyStates) +} + +// Notifies clients when a particular buffer is output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915938-notifyscheduledoutputchanged?language=objc +func (e_ ExtensionStream) NotifyScheduledOutputChanged(scheduledOutput IExtensionScheduledOutput) { + objc.Call[objc.Void](e_, objc.Sel("notifyScheduledOutputChanged:"), objc.Ptr(scheduledOutput)) +} + +// Sends a media sample to stream client. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915939-sendsamplebuffer?language=objc +func (e_ ExtensionStream) SendSampleBufferDiscontinuityHostTimeInNanoseconds(sampleBuffer coremedia.SampleBufferRef, discontinuity ExtensionStreamDiscontinuityFlags, hostTimeInNanoseconds uint64) { + objc.Call[objc.Void](e_, objc.Sel("sendSampleBuffer:discontinuity:hostTimeInNanoseconds:"), sampleBuffer, discontinuity, hostTimeInNanoseconds) +} + +// Consumes a sample buffer from a client. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915931-consumesamplebufferfromclient?language=objc +func (e_ ExtensionStream) ConsumeSampleBufferFromClientCompletionHandler(client IExtensionClient, completionHandler func(sampleBuffer coremedia.SampleBufferRef, sampleBufferSequenceNumber uint64, discontinuity ExtensionStreamDiscontinuityFlags, hasMoreSampleBuffers bool, error foundation.Error)) { + objc.Call[objc.Void](e_, objc.Sel("consumeSampleBufferFromClient:completionHandler:"), objc.Ptr(client), completionHandler) +} + +// A universally unique identifier for the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915941-streamid?language=objc +func (e_ ExtensionStream) StreamID() foundation.UUID { + rv := objc.Call[foundation.UUID](e_, objc.Sel("streamID")) + return rv +} + +// The data-flow direction of the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915933-direction?language=objc +func (e_ ExtensionStream) Direction() ExtensionStreamDirection { + rv := objc.Call[ExtensionStreamDirection](e_, objc.Sel("direction")) + return rv +} + +// The source object for the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915940-source?language=objc +func (e_ ExtensionStream) Source() ExtensionStreamSourceWrapper { + rv := objc.Call[ExtensionStreamSourceWrapper](e_, objc.Sel("source")) + return rv +} + +// A localized name for the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915936-localizedname?language=objc +func (e_ ExtensionStream) LocalizedName() string { + rv := objc.Call[string](e_, objc.Sel("localizedName")) + return rv +} + +// A clock type for the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915930-clocktype?language=objc +func (e_ ExtensionStream) ClockType() ExtensionStreamClockType { + rv := objc.Call[ExtensionStreamClockType](e_, objc.Sel("clockType")) + return rv +} + +// An optional custom clock configuration for a stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915932-customclockconfiguration?language=objc +func (e_ ExtensionStream) CustomClockConfiguration() ExtensionStreamCustomClockConfiguration { + rv := objc.Call[ExtensionStreamCustomClockConfiguration](e_, objc.Sel("customClockConfiguration")) + return rv +} + +// An array of clients of the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstream/3915944-streamingclients?language=objc +func (e_ ExtensionStream) StreamingClients() []ExtensionClient { + rv := objc.Call[[]ExtensionClient](e_, objc.Sel("streamingClients")) + return rv +} diff --git a/macos/coremediaio/extension_stream_custom_clock_configuration.gen.go b/macos/coremediaio/extension_stream_custom_clock_configuration.gen.go new file mode 100644 index 00000000..7de2fa47 --- /dev/null +++ b/macos/coremediaio/extension_stream_custom_clock_configuration.gen.go @@ -0,0 +1,131 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionStreamCustomClockConfiguration] class. +var ExtensionStreamCustomClockConfigurationClass = _ExtensionStreamCustomClockConfigurationClass{objc.GetClass("CMIOExtensionStreamCustomClockConfiguration")} + +type _ExtensionStreamCustomClockConfigurationClass struct { + objc.Class +} + +// An interface definition for the [ExtensionStreamCustomClockConfiguration] class. +type IExtensionStreamCustomClockConfiguration interface { + objc.IObject + NumberOfEventsForRateSmoothing() uint32 + NumberOfAveragesForRateSmoothing() uint32 + SourceIdentifier() foundation.UUID + GetTimeCallMinimumInterval() coremedia.Time + ClockName() string +} + +// An object that describes the parameters to create a custom clock on the host side. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration?language=objc +type ExtensionStreamCustomClockConfiguration struct { + objc.Object +} + +func ExtensionStreamCustomClockConfigurationFrom(ptr unsafe.Pointer) ExtensionStreamCustomClockConfiguration { + return ExtensionStreamCustomClockConfiguration{ + Object: objc.ObjectFrom(ptr), + } +} + +func (e_ ExtensionStreamCustomClockConfiguration) InitWithClockNameSourceIdentifierGetTimeCallMinimumIntervalNumberOfEventsForRateSmoothingNumberOfAveragesForRateSmoothing(clockName string, sourceIdentifier foundation.IUUID, getTimeCallMinimumInterval coremedia.Time, numberOfEventsForRateSmoothing uint32, numberOfAveragesForRateSmoothing uint32) ExtensionStreamCustomClockConfiguration { + rv := objc.Call[ExtensionStreamCustomClockConfiguration](e_, objc.Sel("initWithClockName:sourceIdentifier:getTimeCallMinimumInterval:numberOfEventsForRateSmoothing:numberOfAveragesForRateSmoothing:"), clockName, objc.Ptr(sourceIdentifier), getTimeCallMinimumInterval, numberOfEventsForRateSmoothing, numberOfAveragesForRateSmoothing) + return rv +} + +// Creates a custom clock configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration/3915892-initwithclockname?language=objc +func NewExtensionStreamCustomClockConfigurationWithClockNameSourceIdentifierGetTimeCallMinimumIntervalNumberOfEventsForRateSmoothingNumberOfAveragesForRateSmoothing(clockName string, sourceIdentifier foundation.IUUID, getTimeCallMinimumInterval coremedia.Time, numberOfEventsForRateSmoothing uint32, numberOfAveragesForRateSmoothing uint32) ExtensionStreamCustomClockConfiguration { + instance := ExtensionStreamCustomClockConfigurationClass.Alloc().InitWithClockNameSourceIdentifierGetTimeCallMinimumIntervalNumberOfEventsForRateSmoothingNumberOfAveragesForRateSmoothing(clockName, sourceIdentifier, getTimeCallMinimumInterval, numberOfEventsForRateSmoothing, numberOfAveragesForRateSmoothing) + instance.Autorelease() + return instance +} + +func (ec _ExtensionStreamCustomClockConfigurationClass) CustomClockConfigurationWithClockNameSourceIdentifierGetTimeCallMinimumIntervalNumberOfEventsForRateSmoothingNumberOfAveragesForRateSmoothing(clockName string, sourceIdentifier foundation.IUUID, getTimeCallMinimumInterval coremedia.Time, numberOfEventsForRateSmoothing uint32, numberOfAveragesForRateSmoothing uint32) ExtensionStreamCustomClockConfiguration { + rv := objc.Call[ExtensionStreamCustomClockConfiguration](ec, objc.Sel("customClockConfigurationWithClockName:sourceIdentifier:getTimeCallMinimumInterval:numberOfEventsForRateSmoothing:numberOfAveragesForRateSmoothing:"), clockName, objc.Ptr(sourceIdentifier), getTimeCallMinimumInterval, numberOfEventsForRateSmoothing, numberOfAveragesForRateSmoothing) + return rv +} + +// Returns a new a custom clock configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration/3915890-customclockconfigurationwithcloc?language=objc +func ExtensionStreamCustomClockConfiguration_CustomClockConfigurationWithClockNameSourceIdentifierGetTimeCallMinimumIntervalNumberOfEventsForRateSmoothingNumberOfAveragesForRateSmoothing(clockName string, sourceIdentifier foundation.IUUID, getTimeCallMinimumInterval coremedia.Time, numberOfEventsForRateSmoothing uint32, numberOfAveragesForRateSmoothing uint32) ExtensionStreamCustomClockConfiguration { + return ExtensionStreamCustomClockConfigurationClass.CustomClockConfigurationWithClockNameSourceIdentifierGetTimeCallMinimumIntervalNumberOfEventsForRateSmoothingNumberOfAveragesForRateSmoothing(clockName, sourceIdentifier, getTimeCallMinimumInterval, numberOfEventsForRateSmoothing, numberOfAveragesForRateSmoothing) +} + +func (ec _ExtensionStreamCustomClockConfigurationClass) Alloc() ExtensionStreamCustomClockConfiguration { + rv := objc.Call[ExtensionStreamCustomClockConfiguration](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionStreamCustomClockConfiguration_Alloc() ExtensionStreamCustomClockConfiguration { + return ExtensionStreamCustomClockConfigurationClass.Alloc() +} + +func (ec _ExtensionStreamCustomClockConfigurationClass) New() ExtensionStreamCustomClockConfiguration { + rv := objc.Call[ExtensionStreamCustomClockConfiguration](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionStreamCustomClockConfiguration() ExtensionStreamCustomClockConfiguration { + return ExtensionStreamCustomClockConfigurationClass.New() +} + +func (e_ ExtensionStreamCustomClockConfiguration) Init() ExtensionStreamCustomClockConfiguration { + rv := objc.Call[ExtensionStreamCustomClockConfiguration](e_, objc.Sel("init")) + return rv +} + +// The number of events to use for rate smoothing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration/3915894-numberofeventsforratesmoothing?language=objc +func (e_ ExtensionStreamCustomClockConfiguration) NumberOfEventsForRateSmoothing() uint32 { + rv := objc.Call[uint32](e_, objc.Sel("numberOfEventsForRateSmoothing")) + return rv +} + +// The number of averages to use for rate smoothing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration/3915893-numberofaveragesforratesmoothing?language=objc +func (e_ ExtensionStreamCustomClockConfiguration) NumberOfAveragesForRateSmoothing() uint32 { + rv := objc.Call[uint32](e_, objc.Sel("numberOfAveragesForRateSmoothing")) + return rv +} + +// A universally unique identifier for the clock. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration/3915895-sourceidentifier?language=objc +func (e_ ExtensionStreamCustomClockConfiguration) SourceIdentifier() foundation.UUID { + rv := objc.Call[foundation.UUID](e_, objc.Sel("sourceIdentifier")) + return rv +} + +// A minimum call time interval for the clock. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration/3915891-gettimecallminimuminterval?language=objc +func (e_ ExtensionStreamCustomClockConfiguration) GetTimeCallMinimumInterval() coremedia.Time { + rv := objc.Call[coremedia.Time](e_, objc.Sel("getTimeCallMinimumInterval")) + return rv +} + +// The name of the clock. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamcustomclockconfiguration/3915889-clockname?language=objc +func (e_ ExtensionStreamCustomClockConfiguration) ClockName() string { + rv := objc.Call[string](e_, objc.Sel("clockName")) + return rv +} diff --git a/macos/coremediaio/extension_stream_format.gen.go b/macos/coremediaio/extension_stream_format.gen.go new file mode 100644 index 00000000..6a0cc9b6 --- /dev/null +++ b/macos/coremediaio/extension_stream_format.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionStreamFormat] class. +var ExtensionStreamFormatClass = _ExtensionStreamFormatClass{objc.GetClass("CMIOExtensionStreamFormat")} + +type _ExtensionStreamFormatClass struct { + objc.Class +} + +// An interface definition for the [ExtensionStreamFormat] class. +type IExtensionStreamFormat interface { + objc.IObject + MaxFrameDuration() coremedia.Time + MinFrameDuration() coremedia.Time + FormatDescription() coremedia.FormatDescriptionRef + ValidFrameDurations() []foundation.Dictionary +} + +// An object that describes the format of a media stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat?language=objc +type ExtensionStreamFormat struct { + objc.Object +} + +func ExtensionStreamFormatFrom(ptr unsafe.Pointer) ExtensionStreamFormat { + return ExtensionStreamFormat{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExtensionStreamFormatClass) StreamFormatWithFormatDescriptionMaxFrameDurationMinFrameDurationValidFrameDurations(formatDescription coremedia.FormatDescriptionRef, maxFrameDuration coremedia.Time, minFrameDuration coremedia.Time, validFrameDurations []foundation.Dictionary) ExtensionStreamFormat { + rv := objc.Call[ExtensionStreamFormat](ec, objc.Sel("streamFormatWithFormatDescription:maxFrameDuration:minFrameDuration:validFrameDurations:"), formatDescription, maxFrameDuration, minFrameDuration, validFrameDurations) + return rv +} + +// Returns a new stream format with a format description and frame durations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat/3915901-streamformatwithformatdescriptio?language=objc +func ExtensionStreamFormat_StreamFormatWithFormatDescriptionMaxFrameDurationMinFrameDurationValidFrameDurations(formatDescription coremedia.FormatDescriptionRef, maxFrameDuration coremedia.Time, minFrameDuration coremedia.Time, validFrameDurations []foundation.Dictionary) ExtensionStreamFormat { + return ExtensionStreamFormatClass.StreamFormatWithFormatDescriptionMaxFrameDurationMinFrameDurationValidFrameDurations(formatDescription, maxFrameDuration, minFrameDuration, validFrameDurations) +} + +func (e_ ExtensionStreamFormat) InitWithFormatDescriptionMaxFrameDurationMinFrameDurationValidFrameDurations(formatDescription coremedia.FormatDescriptionRef, maxFrameDuration coremedia.Time, minFrameDuration coremedia.Time, validFrameDurations []foundation.Dictionary) ExtensionStreamFormat { + rv := objc.Call[ExtensionStreamFormat](e_, objc.Sel("initWithFormatDescription:maxFrameDuration:minFrameDuration:validFrameDurations:"), formatDescription, maxFrameDuration, minFrameDuration, validFrameDurations) + return rv +} + +// Creates a stream format with a format description and frame durations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat/3915898-initwithformatdescription?language=objc +func NewExtensionStreamFormatWithFormatDescriptionMaxFrameDurationMinFrameDurationValidFrameDurations(formatDescription coremedia.FormatDescriptionRef, maxFrameDuration coremedia.Time, minFrameDuration coremedia.Time, validFrameDurations []foundation.Dictionary) ExtensionStreamFormat { + instance := ExtensionStreamFormatClass.Alloc().InitWithFormatDescriptionMaxFrameDurationMinFrameDurationValidFrameDurations(formatDescription, maxFrameDuration, minFrameDuration, validFrameDurations) + instance.Autorelease() + return instance +} + +func (ec _ExtensionStreamFormatClass) Alloc() ExtensionStreamFormat { + rv := objc.Call[ExtensionStreamFormat](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionStreamFormat_Alloc() ExtensionStreamFormat { + return ExtensionStreamFormatClass.Alloc() +} + +func (ec _ExtensionStreamFormatClass) New() ExtensionStreamFormat { + rv := objc.Call[ExtensionStreamFormat](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionStreamFormat() ExtensionStreamFormat { + return ExtensionStreamFormatClass.New() +} + +func (e_ ExtensionStreamFormat) Init() ExtensionStreamFormat { + rv := objc.Call[ExtensionStreamFormat](e_, objc.Sel("init")) + return rv +} + +// The maximum duration a stream supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat/3915899-maxframeduration?language=objc +func (e_ ExtensionStreamFormat) MaxFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](e_, objc.Sel("maxFrameDuration")) + return rv +} + +// The minimum frame duration a stream supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat/3915900-minframeduration?language=objc +func (e_ ExtensionStreamFormat) MinFrameDuration() coremedia.Time { + rv := objc.Call[coremedia.Time](e_, objc.Sel("minFrameDuration")) + return rv +} + +// A description of the format of the stream’s media samples. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat/3915897-formatdescription?language=objc +func (e_ ExtensionStreamFormat) FormatDescription() coremedia.FormatDescriptionRef { + rv := objc.Call[coremedia.FormatDescriptionRef](e_, objc.Sel("formatDescription")) + return rv +} + +// An array of frame durations the stream supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamformat/3915902-validframedurations?language=objc +func (e_ ExtensionStreamFormat) ValidFrameDurations() []foundation.Dictionary { + rv := objc.Call[[]foundation.Dictionary](e_, objc.Sel("validFrameDurations")) + return rv +} diff --git a/macos/coremediaio/extension_stream_properties.gen.go b/macos/coremediaio/extension_stream_properties.gen.go new file mode 100644 index 00000000..48478d58 --- /dev/null +++ b/macos/coremediaio/extension_stream_properties.gen.go @@ -0,0 +1,229 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExtensionStreamProperties] class. +var ExtensionStreamPropertiesClass = _ExtensionStreamPropertiesClass{objc.GetClass("CMIOExtensionStreamProperties")} + +type _ExtensionStreamPropertiesClass struct { + objc.Class +} + +// An interface definition for the [ExtensionStreamProperties] class. +type IExtensionStreamProperties interface { + objc.IObject + SetPropertyStateForProperty(propertyState IExtensionPropertyState, property ExtensionProperty) + MaxFrameDuration() foundation.Dictionary + SetMaxFrameDuration(value foundation.Dictionary) + SinkBufferUnderrunCount() foundation.Number + SetSinkBufferUnderrunCount(value foundation.INumber) + SinkBuffersRequiredForStartup() foundation.Number + SetSinkBuffersRequiredForStartup(value foundation.INumber) + ActiveFormatIndex() foundation.Number + SetActiveFormatIndex(value foundation.INumber) + FrameDuration() foundation.Dictionary + SetFrameDuration(value foundation.Dictionary) + SinkEndOfData() foundation.Number + SetSinkEndOfData(value foundation.INumber) + SinkBufferQueueSize() foundation.Number + SetSinkBufferQueueSize(value foundation.INumber) + PropertiesDictionary() map[ExtensionProperty]ExtensionPropertyState + SetPropertiesDictionary(value map[ExtensionProperty]IExtensionPropertyState) +} + +// An object that describes the properties of an extension stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties?language=objc +type ExtensionStreamProperties struct { + objc.Object +} + +func ExtensionStreamPropertiesFrom(ptr unsafe.Pointer) ExtensionStreamProperties { + return ExtensionStreamProperties{ + Object: objc.ObjectFrom(ptr), + } +} + +func (e_ ExtensionStreamProperties) InitWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionStreamProperties { + rv := objc.Call[ExtensionStreamProperties](e_, objc.Sel("initWithDictionary:"), propertiesDictionary) + return rv +} + +// Creates a properties object that provides the specified properties and default states. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915960-initwithdictionary?language=objc +func NewExtensionStreamPropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionStreamProperties { + instance := ExtensionStreamPropertiesClass.Alloc().InitWithDictionary(propertiesDictionary) + instance.Autorelease() + return instance +} + +func (ec _ExtensionStreamPropertiesClass) StreamPropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionStreamProperties { + rv := objc.Call[ExtensionStreamProperties](ec, objc.Sel("streamPropertiesWithDictionary:"), propertiesDictionary) + return rv +} + +// Returns a new properties object that provides the specified properties and default states. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915968-streampropertieswithdictionary?language=objc +func ExtensionStreamProperties_StreamPropertiesWithDictionary(propertiesDictionary map[ExtensionProperty]IExtensionPropertyState) ExtensionStreamProperties { + return ExtensionStreamPropertiesClass.StreamPropertiesWithDictionary(propertiesDictionary) +} + +func (ec _ExtensionStreamPropertiesClass) Alloc() ExtensionStreamProperties { + rv := objc.Call[ExtensionStreamProperties](ec, objc.Sel("alloc")) + return rv +} + +func ExtensionStreamProperties_Alloc() ExtensionStreamProperties { + return ExtensionStreamPropertiesClass.Alloc() +} + +func (ec _ExtensionStreamPropertiesClass) New() ExtensionStreamProperties { + rv := objc.Call[ExtensionStreamProperties](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExtensionStreamProperties() ExtensionStreamProperties { + return ExtensionStreamPropertiesClass.New() +} + +func (e_ ExtensionStreamProperties) Init() ExtensionStreamProperties { + rv := objc.Call[ExtensionStreamProperties](e_, objc.Sel("init")) + return rv +} + +// Sets the state of the specified property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915963-setpropertystate?language=objc +func (e_ ExtensionStreamProperties) SetPropertyStateForProperty(propertyState IExtensionPropertyState, property ExtensionProperty) { + objc.Call[objc.Void](e_, objc.Sel("setPropertyState:forProperty:"), objc.Ptr(propertyState), property) +} + +// The maximum duration of a frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915961-maxframeduration?language=objc +func (e_ ExtensionStreamProperties) MaxFrameDuration() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](e_, objc.Sel("maxFrameDuration")) + return rv +} + +// The maximum duration of a frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915961-maxframeduration?language=objc +func (e_ ExtensionStreamProperties) SetMaxFrameDuration(value foundation.Dictionary) { + objc.Call[objc.Void](e_, objc.Sel("setMaxFrameDuration:"), value) +} + +// The buffer underrun count. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915965-sinkbufferunderruncount?language=objc +func (e_ ExtensionStreamProperties) SinkBufferUnderrunCount() foundation.Number { + rv := objc.Call[foundation.Number](e_, objc.Sel("sinkBufferUnderrunCount")) + return rv +} + +// The buffer underrun count. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915965-sinkbufferunderruncount?language=objc +func (e_ ExtensionStreamProperties) SetSinkBufferUnderrunCount(value foundation.INumber) { + objc.Call[objc.Void](e_, objc.Sel("setSinkBufferUnderrunCount:"), objc.Ptr(value)) +} + +// The number of buffers the stream requires for startup. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915966-sinkbuffersrequiredforstartup?language=objc +func (e_ ExtensionStreamProperties) SinkBuffersRequiredForStartup() foundation.Number { + rv := objc.Call[foundation.Number](e_, objc.Sel("sinkBuffersRequiredForStartup")) + return rv +} + +// The number of buffers the stream requires for startup. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915966-sinkbuffersrequiredforstartup?language=objc +func (e_ ExtensionStreamProperties) SetSinkBuffersRequiredForStartup(value foundation.INumber) { + objc.Call[objc.Void](e_, objc.Sel("setSinkBuffersRequiredForStartup:"), objc.Ptr(value)) +} + +// The index of the active format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915958-activeformatindex?language=objc +func (e_ ExtensionStreamProperties) ActiveFormatIndex() foundation.Number { + rv := objc.Call[foundation.Number](e_, objc.Sel("activeFormatIndex")) + return rv +} + +// The index of the active format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915958-activeformatindex?language=objc +func (e_ ExtensionStreamProperties) SetActiveFormatIndex(value foundation.INumber) { + objc.Call[objc.Void](e_, objc.Sel("setActiveFormatIndex:"), objc.Ptr(value)) +} + +// A dictionary representation of a frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915959-frameduration?language=objc +func (e_ ExtensionStreamProperties) FrameDuration() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](e_, objc.Sel("frameDuration")) + return rv +} + +// A dictionary representation of a frame duration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915959-frameduration?language=objc +func (e_ ExtensionStreamProperties) SetFrameDuration(value foundation.Dictionary) { + objc.Call[objc.Void](e_, objc.Sel("setFrameDuration:"), value) +} + +// A value that indicates whether the stream has reached its end. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915967-sinkendofdata?language=objc +func (e_ ExtensionStreamProperties) SinkEndOfData() foundation.Number { + rv := objc.Call[foundation.Number](e_, objc.Sel("sinkEndOfData")) + return rv +} + +// A value that indicates whether the stream has reached its end. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915967-sinkendofdata?language=objc +func (e_ ExtensionStreamProperties) SetSinkEndOfData(value foundation.INumber) { + objc.Call[objc.Void](e_, objc.Sel("setSinkEndOfData:"), objc.Ptr(value)) +} + +// The buffer queue size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915964-sinkbufferqueuesize?language=objc +func (e_ ExtensionStreamProperties) SinkBufferQueueSize() foundation.Number { + rv := objc.Call[foundation.Number](e_, objc.Sel("sinkBufferQueueSize")) + return rv +} + +// The buffer queue size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915964-sinkbufferqueuesize?language=objc +func (e_ ExtensionStreamProperties) SetSinkBufferQueueSize(value foundation.INumber) { + objc.Call[objc.Void](e_, objc.Sel("setSinkBufferQueueSize:"), objc.Ptr(value)) +} + +// A dictionary representation of the property state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915962-propertiesdictionary?language=objc +func (e_ ExtensionStreamProperties) PropertiesDictionary() map[ExtensionProperty]ExtensionPropertyState { + rv := objc.Call[map[ExtensionProperty]ExtensionPropertyState](e_, objc.Sel("propertiesDictionary")) + return rv +} + +// A dictionary representation of the property state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamproperties/3915962-propertiesdictionary?language=objc +func (e_ ExtensionStreamProperties) SetPropertiesDictionary(value map[ExtensionProperty]IExtensionPropertyState) { + objc.Call[objc.Void](e_, objc.Sel("setPropertiesDictionary:"), value) +} diff --git a/macos/coremediaio/extension_stream_source.gen.go b/macos/coremediaio/extension_stream_source.gen.go new file mode 100644 index 00000000..9d75f0e9 --- /dev/null +++ b/macos/coremediaio/extension_stream_source.gen.go @@ -0,0 +1,130 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremediaio + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol for objects that act as stream sources. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource?language=objc +type PExtensionStreamSource interface { + // optional + AuthorizedToStartStreamForClient(client ExtensionClient) bool + HasAuthorizedToStartStreamForClient() bool + + // optional + StopStreamAndReturnError(outError foundation.Error) bool + HasStopStreamAndReturnError() bool + + // optional + StreamPropertiesForPropertiesError(properties foundation.Set, outError foundation.Error) IExtensionStreamProperties + HasStreamPropertiesForPropertiesError() bool + + // optional + SetStreamPropertiesError(streamProperties ExtensionStreamProperties, outError foundation.Error) bool + HasSetStreamPropertiesError() bool + + // optional + StartStreamAndReturnError(outError foundation.Error) bool + HasStartStreamAndReturnError() bool + + // optional + Formats() []IExtensionStreamFormat + HasFormats() bool + + // optional + AvailableProperties() foundation.ISet + HasAvailableProperties() bool +} + +// A concrete type wrapper for the [PExtensionStreamSource] protocol. +type ExtensionStreamSourceWrapper struct { + objc.Object +} + +func (e_ ExtensionStreamSourceWrapper) HasAuthorizedToStartStreamForClient() bool { + return e_.RespondsToSelector(objc.Sel("authorizedToStartStreamForClient:")) +} + +// Determines whether to authorize an app to use this stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource/3915970-authorizedtostartstreamforclient?language=objc +func (e_ ExtensionStreamSourceWrapper) AuthorizedToStartStreamForClient(client IExtensionClient) bool { + rv := objc.Call[bool](e_, objc.Sel("authorizedToStartStreamForClient:"), objc.Ptr(client)) + return rv +} + +func (e_ ExtensionStreamSourceWrapper) HasStopStreamAndReturnError() bool { + return e_.RespondsToSelector(objc.Sel("stopStreamAndReturnError:")) +} + +// Stops the stream of media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource/3915975-stopstreamandreturnerror?language=objc +func (e_ ExtensionStreamSourceWrapper) StopStreamAndReturnError(outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("stopStreamAndReturnError:"), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionStreamSourceWrapper) HasStreamPropertiesForPropertiesError() bool { + return e_.RespondsToSelector(objc.Sel("streamPropertiesForProperties:error:")) +} + +// Gets the states of specified properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource/3915976-streampropertiesforproperties?language=objc +func (e_ ExtensionStreamSourceWrapper) StreamPropertiesForPropertiesError(properties foundation.ISet, outError foundation.IError) ExtensionStreamProperties { + rv := objc.Call[ExtensionStreamProperties](e_, objc.Sel("streamPropertiesForProperties:error:"), objc.Ptr(properties), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionStreamSourceWrapper) HasSetStreamPropertiesError() bool { + return e_.RespondsToSelector(objc.Sel("setStreamProperties:error:")) +} + +// Sets the property state of a stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource/3915973-setstreamproperties?language=objc +func (e_ ExtensionStreamSourceWrapper) SetStreamPropertiesError(streamProperties IExtensionStreamProperties, outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("setStreamProperties:error:"), objc.Ptr(streamProperties), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionStreamSourceWrapper) HasStartStreamAndReturnError() bool { + return e_.RespondsToSelector(objc.Sel("startStreamAndReturnError:")) +} + +// Starts the stream of media data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource/3915974-startstreamandreturnerror?language=objc +func (e_ ExtensionStreamSourceWrapper) StartStreamAndReturnError(outError foundation.IError) bool { + rv := objc.Call[bool](e_, objc.Sel("startStreamAndReturnError:"), objc.Ptr(outError)) + return rv +} + +func (e_ ExtensionStreamSourceWrapper) HasFormats() bool { + return e_.RespondsToSelector(objc.Sel("formats")) +} + +// An array of formats that a stream supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource/3915972-formats?language=objc +func (e_ ExtensionStreamSourceWrapper) Formats() []ExtensionStreamFormat { + rv := objc.Call[[]ExtensionStreamFormat](e_, objc.Sel("formats")) + return rv +} + +func (e_ ExtensionStreamSourceWrapper) HasAvailableProperties() bool { + return e_.RespondsToSelector(objc.Sel("availableProperties")) +} + +// A set of properties available for the stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremediaio/cmioextensionstreamsource/3915971-availableproperties?language=objc +func (e_ ExtensionStreamSourceWrapper) AvailableProperties() foundation.Set { + rv := objc.Call[foundation.Set](e_, objc.Sel("availableProperties")) + return rv +} diff --git a/macos/coremidi/aliastypes.gen.go b/macos/coremidi/aliastypes.gen.go new file mode 100644 index 00000000..793e2450 --- /dev/null +++ b/macos/coremidi/aliastypes.gen.go @@ -0,0 +1,64 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" +) + +// A block the system calls to indicate it has enabled or disabled a profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofilechangedblock?language=objc +type CIProfileChangedBlock = func(session CISession, channel ChannelNumber, profile CIProfile, enabled bool) + +// A block the system calls when a MIDI-CI node discovery request completes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoveryresponseblock?language=objc +type CIDiscoveryResponseBlock = func(discoveredNodes []CIDiscoveredNode) + +// A function the system calls after it has completed sending a System Exclusive (SysEx) event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicompletionproc?language=objc +type CompletionProc = func(request *SysexSendRequest) + +// A block the system calls when a MIDI-CI session disconnects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisessiondisconnectblock?language=objc +type CISessionDisconnectBlock = func(session CISession, error foundation.Error) + +// A block the system calls when a MIDI-CI session or responder receives profile-specific data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofilespecificdatablock?language=objc +type CIProfileSpecificDataBlock = func(session CISession, channel ChannelNumber, profile CIProfile, profileSpecificData []byte) + +// A block receiving MIDI input that includes the incoming messages and a refCon to identify the source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midireceiveblock?language=objc +type ReceiveBlock = func(evtlist *EventList, srcConnRefCon unsafe.Pointer) + +// A block receiving MIDI input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midireadblock?language=objc +type ReadBlock = func(pktlist *PacketList, srcConnRefCon unsafe.Pointer) + +// A function receiving MIDI input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midireadproc?language=objc +type ReadProc = func(pktlist *PacketList, readProcRefCon unsafe.Pointer, srcConnRefCon unsafe.Pointer) + +// A callback block for notifying clients of state changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinotifyblock?language=objc +type NotifyBlock = func(message *Notification) + +// A callback function for notifying clients of state changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinotifyproc?language=objc +type NotifyProc = func(message *Notification, refCon unsafe.Pointer) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midieventvisitor?language=objc +type EventVisitor = func(context unsafe.Pointer, timeStamp TimeStamp, message UniversalMessage) diff --git a/macos/coremidi/ci_device_info.gen.go b/macos/coremidi/ci_device_info.gen.go new file mode 100644 index 00000000..3a69c02c --- /dev/null +++ b/macos/coremidi/ci_device_info.gen.go @@ -0,0 +1,117 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CIDeviceInfo] class. +var CIDeviceInfoClass = _CIDeviceInfoClass{objc.GetClass("MIDICIDeviceInfo")} + +type _CIDeviceInfoClass struct { + objc.Class +} + +// An interface definition for the [CIDeviceInfo] class. +type ICIDeviceInfo interface { + objc.IObject + ManufacturerID() []byte + RevisionLevel() []byte + Family() []byte + MidiDestination() EndpointRef + ModelNumber() []byte +} + +// An object that provides basic information about a MIDI-CI device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicideviceinfo?language=objc +type CIDeviceInfo struct { + objc.Object +} + +func CIDeviceInfoFrom(ptr unsafe.Pointer) CIDeviceInfo { + return CIDeviceInfo{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CIDeviceInfo) InitWithDestinationManufacturerFamilyModelRevision(midiDestination EntityRef, manufacturer []byte, family []byte, modelNumber []byte, revisionLevel []byte) CIDeviceInfo { + rv := objc.Call[CIDeviceInfo](c_, objc.Sel("initWithDestination:manufacturer:family:model:revision:"), midiDestination, manufacturer, family, modelNumber, revisionLevel) + return rv +} + +// Creates a new device information instance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicideviceinfo/3580317-initwithdestination?language=objc +func NewCIDeviceInfoWithDestinationManufacturerFamilyModelRevision(midiDestination EntityRef, manufacturer []byte, family []byte, modelNumber []byte, revisionLevel []byte) CIDeviceInfo { + instance := CIDeviceInfoClass.Alloc().InitWithDestinationManufacturerFamilyModelRevision(midiDestination, manufacturer, family, modelNumber, revisionLevel) + instance.Autorelease() + return instance +} + +func (cc _CIDeviceInfoClass) Alloc() CIDeviceInfo { + rv := objc.Call[CIDeviceInfo](cc, objc.Sel("alloc")) + return rv +} + +func CIDeviceInfo_Alloc() CIDeviceInfo { + return CIDeviceInfoClass.Alloc() +} + +func (cc _CIDeviceInfoClass) New() CIDeviceInfo { + rv := objc.Call[CIDeviceInfo](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCIDeviceInfo() CIDeviceInfo { + return CIDeviceInfoClass.New() +} + +func (c_ CIDeviceInfo) Init() CIDeviceInfo { + rv := objc.Call[CIDeviceInfo](c_, objc.Sel("init")) + return rv +} + +// The MIDI System Exclusive (SysEx) ID of the device manufacturer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicideviceinfo/3553237-manufacturerid?language=objc +func (c_ CIDeviceInfo) ManufacturerID() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("manufacturerID")) + return rv +} + +// The revision number of the device model number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicideviceinfo/3553239-revisionlevel?language=objc +func (c_ CIDeviceInfo) RevisionLevel() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("revisionLevel")) + return rv +} + +// The family to which the device belongs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicideviceinfo/3553235-family?language=objc +func (c_ CIDeviceInfo) Family() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("family")) + return rv +} + +// The MIDI destination the device’s MIDI entity uses for capability inquiries. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicideviceinfo/3580318-mididestination?language=objc +func (c_ CIDeviceInfo) MidiDestination() EndpointRef { + rv := objc.Call[EndpointRef](c_, objc.Sel("midiDestination")) + return rv +} + +// The model number of the device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicideviceinfo/3553238-modelnumber?language=objc +func (c_ CIDeviceInfo) ModelNumber() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("modelNumber")) + return rv +} diff --git a/macos/coremidi/ci_discovered_node.gen.go b/macos/coremidi/ci_discovered_node.gen.go new file mode 100644 index 00000000..963d1d9b --- /dev/null +++ b/macos/coremidi/ci_discovered_node.gen.go @@ -0,0 +1,104 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CIDiscoveredNode] class. +var CIDiscoveredNodeClass = _CIDiscoveredNodeClass{objc.GetClass("MIDICIDiscoveredNode")} + +type _CIDiscoveredNodeClass struct { + objc.Class +} + +// An interface definition for the [CIDiscoveredNode] class. +type ICIDiscoveredNode interface { + objc.IObject + SupportsProperties() bool + MaximumSysExSize() foundation.Number + SupportsProfiles() bool + DeviceInfo() CIDeviceInfo + Destination() EntityRef +} + +// A discovered MIDI-CI node that represents a MIDI source and destination that respond to capability inquiries. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverednode?language=objc +type CIDiscoveredNode struct { + objc.Object +} + +func CIDiscoveredNodeFrom(ptr unsafe.Pointer) CIDiscoveredNode { + return CIDiscoveredNode{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CIDiscoveredNodeClass) Alloc() CIDiscoveredNode { + rv := objc.Call[CIDiscoveredNode](cc, objc.Sel("alloc")) + return rv +} + +func CIDiscoveredNode_Alloc() CIDiscoveredNode { + return CIDiscoveredNodeClass.Alloc() +} + +func (cc _CIDiscoveredNodeClass) New() CIDiscoveredNode { + rv := objc.Call[CIDiscoveredNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCIDiscoveredNode() CIDiscoveredNode { + return CIDiscoveredNodeClass.New() +} + +func (c_ CIDiscoveredNode) Init() CIDiscoveredNode { + rv := objc.Call[CIDiscoveredNode](c_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether this node supports MIDI-CI properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverednode/3580324-supportsproperties?language=objc +func (c_ CIDiscoveredNode) SupportsProperties() bool { + rv := objc.Call[bool](c_, objc.Sel("supportsProperties")) + return rv +} + +// The maximum size of a System Exclusive (SysEx) message this node supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverednode/3580322-maximumsysexsize?language=objc +func (c_ CIDiscoveredNode) MaximumSysExSize() foundation.Number { + rv := objc.Call[foundation.Number](c_, objc.Sel("maximumSysExSize")) + return rv +} + +// A Boolean value that indicates whether this node supports MIDI-CI profiles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverednode/3580323-supportsprofiles?language=objc +func (c_ CIDiscoveredNode) SupportsProfiles() bool { + rv := objc.Call[bool](c_, objc.Sel("supportsProfiles")) + return rv +} + +// The available MIDI-CI device information. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverednode/3580321-deviceinfo?language=objc +func (c_ CIDiscoveredNode) DeviceInfo() CIDeviceInfo { + rv := objc.Call[CIDeviceInfo](c_, objc.Sel("deviceInfo")) + return rv +} + +// The node’s MIDI destination. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverednode/3580320-destination?language=objc +func (c_ CIDiscoveredNode) Destination() EntityRef { + rv := objc.Call[EntityRef](c_, objc.Sel("destination")) + return rv +} diff --git a/macos/coremidi/ci_discovery_manager.gen.go b/macos/coremidi/ci_discovery_manager.gen.go new file mode 100644 index 00000000..712aeff4 --- /dev/null +++ b/macos/coremidi/ci_discovery_manager.gen.go @@ -0,0 +1,81 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CIDiscoveryManager] class. +var CIDiscoveryManagerClass = _CIDiscoveryManagerClass{objc.GetClass("MIDICIDiscoveryManager")} + +type _CIDiscoveryManagerClass struct { + objc.Class +} + +// An interface definition for the [CIDiscoveryManager] class. +type ICIDiscoveryManager interface { + objc.IObject + DiscoverWithHandler(completedHandler CIDiscoveryResponseBlock) +} + +// A singleton object that performs systemwide MIDI-CI discovery. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverymanager?language=objc +type CIDiscoveryManager struct { + objc.Object +} + +func CIDiscoveryManagerFrom(ptr unsafe.Pointer) CIDiscoveryManager { + return CIDiscoveryManager{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CIDiscoveryManagerClass) Alloc() CIDiscoveryManager { + rv := objc.Call[CIDiscoveryManager](cc, objc.Sel("alloc")) + return rv +} + +func CIDiscoveryManager_Alloc() CIDiscoveryManager { + return CIDiscoveryManagerClass.Alloc() +} + +func (cc _CIDiscoveryManagerClass) New() CIDiscoveryManager { + rv := objc.Call[CIDiscoveryManager](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCIDiscoveryManager() CIDiscoveryManager { + return CIDiscoveryManagerClass.New() +} + +func (c_ CIDiscoveryManager) Init() CIDiscoveryManager { + rv := objc.Call[CIDiscoveryManager](c_, objc.Sel("init")) + return rv +} + +// Returns the singleton discovery manager instance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverymanager/3553242-sharedinstance?language=objc +func (cc _CIDiscoveryManagerClass) SharedInstance() CIDiscoveryManager { + rv := objc.Call[CIDiscoveryManager](cc, objc.Sel("sharedInstance")) + return rv +} + +// Returns the singleton discovery manager instance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverymanager/3553242-sharedinstance?language=objc +func CIDiscoveryManager_SharedInstance() CIDiscoveryManager { + return CIDiscoveryManagerClass.SharedInstance() +} + +// Discovers the available MIDI-CI nodes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicidiscoverymanager/3553241-discoverwithhandler?language=objc +func (c_ CIDiscoveryManager) DiscoverWithHandler(completedHandler CIDiscoveryResponseBlock) { + objc.Call[objc.Void](c_, objc.Sel("discoverWithHandler:"), completedHandler) +} diff --git a/macos/coremidi/ci_profile.gen.go b/macos/coremidi/ci_profile.gen.go new file mode 100644 index 00000000..f50bcf75 --- /dev/null +++ b/macos/coremidi/ci_profile.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CIProfile] class. +var CIProfileClass = _CIProfileClass{objc.GetClass("MIDICIProfile")} + +type _CIProfileClass struct { + objc.Class +} + +// An interface definition for the [CIProfile] class. +type ICIProfile interface { + objc.IObject + Name() string + ProfileID() []byte +} + +// A mapping of MIDI messages to specific sounds and synthesis behaviors, such as General MIDI, a drawbar organ, and so on. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofile?language=objc +type CIProfile struct { + objc.Object +} + +func CIProfileFrom(ptr unsafe.Pointer) CIProfile { + return CIProfile{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CIProfile) InitWithData(data []byte) CIProfile { + rv := objc.Call[CIProfile](c_, objc.Sel("initWithData:"), data) + return rv +} + +// Creates a MIDI profile for the specified data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofile/3580326-initwithdata?language=objc +func NewCIProfileWithData(data []byte) CIProfile { + instance := CIProfileClass.Alloc().InitWithData(data) + instance.Autorelease() + return instance +} + +func (cc _CIProfileClass) Alloc() CIProfile { + rv := objc.Call[CIProfile](cc, objc.Sel("alloc")) + return rv +} + +func CIProfile_Alloc() CIProfile { + return CIProfileClass.Alloc() +} + +func (cc _CIProfileClass) New() CIProfile { + rv := objc.Call[CIProfile](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCIProfile() CIProfile { + return CIProfileClass.New() +} + +func (c_ CIProfile) Init() CIProfile { + rv := objc.Call[CIProfile](c_, objc.Sel("init")) + return rv +} + +// A string that describes the profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofile/2977105-name?language=objc +func (c_ CIProfile) Name() string { + rv := objc.Call[string](c_, objc.Sel("name")) + return rv +} + +// The unique five-byte profile identifier that represents the profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofile/2977106-profileid?language=objc +func (c_ CIProfile) ProfileID() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("profileID")) + return rv +} diff --git a/macos/coremidi/ci_profile_responder_delegate.gen.go b/macos/coremidi/ci_profile_responder_delegate.gen.go new file mode 100644 index 00000000..3f14856b --- /dev/null +++ b/macos/coremidi/ci_profile_responder_delegate.gen.go @@ -0,0 +1,156 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines the methods to respond to MIDI-CI responder life-cycle events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate?language=objc +type PCIProfileResponderDelegate interface { + // optional + WillSetProfileOnChannelEnabled(aProfile CIProfile, channel ChannelNumber, shouldEnable bool) bool + HasWillSetProfileOnChannelEnabled() bool + + // optional + InitiatorDisconnected(initiatorMUID CIInitiatiorMUID) + HasInitiatorDisconnected() bool + + // optional + HandleDataForProfileOnChannelData(aProfile CIProfile, channel ChannelNumber, inData []byte) + HasHandleDataForProfileOnChannelData() bool + + // optional + ConnectInitiatorWithDeviceInfo(initiatorMUID CIInitiatiorMUID, deviceInfo CIDeviceInfo) bool + HasConnectInitiatorWithDeviceInfo() bool +} + +// A delegate implementation builder for the [PCIProfileResponderDelegate] protocol. +type CIProfileResponderDelegate struct { + _WillSetProfileOnChannelEnabled func(aProfile CIProfile, channel ChannelNumber, shouldEnable bool) bool + _InitiatorDisconnected func(initiatorMUID CIInitiatiorMUID) + _HandleDataForProfileOnChannelData func(aProfile CIProfile, channel ChannelNumber, inData []byte) + _ConnectInitiatorWithDeviceInfo func(initiatorMUID CIInitiatiorMUID, deviceInfo CIDeviceInfo) bool +} + +func (di *CIProfileResponderDelegate) HasWillSetProfileOnChannelEnabled() bool { + return di._WillSetProfileOnChannelEnabled != nil +} + +// Provides an opportunity to perform an action before the system sets the profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580331-willsetprofile?language=objc +func (di *CIProfileResponderDelegate) SetWillSetProfileOnChannelEnabled(f func(aProfile CIProfile, channel ChannelNumber, shouldEnable bool) bool) { + di._WillSetProfileOnChannelEnabled = f +} + +// Provides an opportunity to perform an action before the system sets the profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580331-willsetprofile?language=objc +func (di *CIProfileResponderDelegate) WillSetProfileOnChannelEnabled(aProfile CIProfile, channel ChannelNumber, shouldEnable bool) bool { + return di._WillSetProfileOnChannelEnabled(aProfile, channel, shouldEnable) +} +func (di *CIProfileResponderDelegate) HasInitiatorDisconnected() bool { + return di._InitiatorDisconnected != nil +} + +// Provides an opportunity to perform an action after the system disconnects the initiator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580330-initiatordisconnected?language=objc +func (di *CIProfileResponderDelegate) SetInitiatorDisconnected(f func(initiatorMUID CIInitiatiorMUID)) { + di._InitiatorDisconnected = f +} + +// Provides an opportunity to perform an action after the system disconnects the initiator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580330-initiatordisconnected?language=objc +func (di *CIProfileResponderDelegate) InitiatorDisconnected(initiatorMUID CIInitiatiorMUID) { + di._InitiatorDisconnected(initiatorMUID) +} +func (di *CIProfileResponderDelegate) HasHandleDataForProfileOnChannelData() bool { + return di._HandleDataForProfileOnChannelData != nil +} + +// Processes MIDI data for a profile and channel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580329-handledataforprofile?language=objc +func (di *CIProfileResponderDelegate) SetHandleDataForProfileOnChannelData(f func(aProfile CIProfile, channel ChannelNumber, inData []byte)) { + di._HandleDataForProfileOnChannelData = f +} + +// Processes MIDI data for a profile and channel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580329-handledataforprofile?language=objc +func (di *CIProfileResponderDelegate) HandleDataForProfileOnChannelData(aProfile CIProfile, channel ChannelNumber, inData []byte) { + di._HandleDataForProfileOnChannelData(aProfile, channel, inData) +} +func (di *CIProfileResponderDelegate) HasConnectInitiatorWithDeviceInfo() bool { + return di._ConnectInitiatorWithDeviceInfo != nil +} + +// Enables a MIDI-CI initiator to create a session or reject the connection attempt. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580328-connectinitiator?language=objc +func (di *CIProfileResponderDelegate) SetConnectInitiatorWithDeviceInfo(f func(initiatorMUID CIInitiatiorMUID, deviceInfo CIDeviceInfo) bool) { + di._ConnectInitiatorWithDeviceInfo = f +} + +// Enables a MIDI-CI initiator to create a session or reject the connection attempt. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580328-connectinitiator?language=objc +func (di *CIProfileResponderDelegate) ConnectInitiatorWithDeviceInfo(initiatorMUID CIInitiatiorMUID, deviceInfo CIDeviceInfo) bool { + return di._ConnectInitiatorWithDeviceInfo(initiatorMUID, deviceInfo) +} + +// A concrete type wrapper for the [PCIProfileResponderDelegate] protocol. +type CIProfileResponderDelegateWrapper struct { + objc.Object +} + +func (c_ CIProfileResponderDelegateWrapper) HasWillSetProfileOnChannelEnabled() bool { + return c_.RespondsToSelector(objc.Sel("willSetProfile:onChannel:enabled:")) +} + +// Provides an opportunity to perform an action before the system sets the profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580331-willsetprofile?language=objc +func (c_ CIProfileResponderDelegateWrapper) WillSetProfileOnChannelEnabled(aProfile ICIProfile, channel ChannelNumber, shouldEnable bool) bool { + rv := objc.Call[bool](c_, objc.Sel("willSetProfile:onChannel:enabled:"), objc.Ptr(aProfile), channel, shouldEnable) + return rv +} + +func (c_ CIProfileResponderDelegateWrapper) HasInitiatorDisconnected() bool { + return c_.RespondsToSelector(objc.Sel("initiatorDisconnected:")) +} + +// Provides an opportunity to perform an action after the system disconnects the initiator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580330-initiatordisconnected?language=objc +func (c_ CIProfileResponderDelegateWrapper) InitiatorDisconnected(initiatorMUID CIInitiatiorMUID) { + objc.Call[objc.Void](c_, objc.Sel("initiatorDisconnected:"), initiatorMUID) +} + +func (c_ CIProfileResponderDelegateWrapper) HasHandleDataForProfileOnChannelData() bool { + return c_.RespondsToSelector(objc.Sel("handleDataForProfile:onChannel:data:")) +} + +// Processes MIDI data for a profile and channel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580329-handledataforprofile?language=objc +func (c_ CIProfileResponderDelegateWrapper) HandleDataForProfileOnChannelData(aProfile ICIProfile, channel ChannelNumber, inData []byte) { + objc.Call[objc.Void](c_, objc.Sel("handleDataForProfile:onChannel:data:"), objc.Ptr(aProfile), channel, inData) +} + +func (c_ CIProfileResponderDelegateWrapper) HasConnectInitiatorWithDeviceInfo() bool { + return c_.RespondsToSelector(objc.Sel("connectInitiator:withDeviceInfo:")) +} + +// Enables a MIDI-CI initiator to create a session or reject the connection attempt. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofileresponderdelegate/3580328-connectinitiator?language=objc +func (c_ CIProfileResponderDelegateWrapper) ConnectInitiatorWithDeviceInfo(initiatorMUID CIInitiatiorMUID, deviceInfo ICIDeviceInfo) bool { + rv := objc.Call[bool](c_, objc.Sel("connectInitiator:withDeviceInfo:"), initiatorMUID, objc.Ptr(deviceInfo)) + return rv +} diff --git a/macos/coremidi/ci_profile_state.gen.go b/macos/coremidi/ci_profile_state.gen.go new file mode 100644 index 00000000..382c95fc --- /dev/null +++ b/macos/coremidi/ci_profile_state.gen.go @@ -0,0 +1,99 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CIProfileState] class. +var CIProfileStateClass = _CIProfileStateClass{objc.GetClass("MIDICIProfileState")} + +type _CIProfileStateClass struct { + objc.Class +} + +// An interface definition for the [CIProfileState] class. +type ICIProfileState interface { + objc.IObject + MidiChannel() ChannelNumber + EnabledProfiles() []CIProfile + DisabledProfiles() []CIProfile +} + +// An object that provides the enabled and disabled profiles for a MIDI channel or port on a device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofilestate?language=objc +type CIProfileState struct { + objc.Object +} + +func CIProfileStateFrom(ptr unsafe.Pointer) CIProfileState { + return CIProfileState{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CIProfileState) InitWithChannelEnabledProfilesDisabledProfiles(midiChannelNum ChannelNumber, enabled []ICIProfile, disabled []ICIProfile) CIProfileState { + rv := objc.Call[CIProfileState](c_, objc.Sel("initWithChannel:enabledProfiles:disabledProfiles:"), midiChannelNum, enabled, disabled) + return rv +} + +// Creates a new profile state object for the specified MIDI channel and profiles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofilestate/3553245-initwithchannel?language=objc +func NewCIProfileStateWithChannelEnabledProfilesDisabledProfiles(midiChannelNum ChannelNumber, enabled []ICIProfile, disabled []ICIProfile) CIProfileState { + instance := CIProfileStateClass.Alloc().InitWithChannelEnabledProfilesDisabledProfiles(midiChannelNum, enabled, disabled) + instance.Autorelease() + return instance +} + +func (cc _CIProfileStateClass) Alloc() CIProfileState { + rv := objc.Call[CIProfileState](cc, objc.Sel("alloc")) + return rv +} + +func CIProfileState_Alloc() CIProfileState { + return CIProfileStateClass.Alloc() +} + +func (cc _CIProfileStateClass) New() CIProfileState { + rv := objc.Call[CIProfileState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCIProfileState() CIProfileState { + return CIProfileStateClass.New() +} + +func (c_ CIProfileState) Init() CIProfileState { + rv := objc.Call[CIProfileState](c_, objc.Sel("init")) + return rv +} + +// The MIDI channel to which this state applies. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofilestate/3553246-midichannel?language=objc +func (c_ CIProfileState) MidiChannel() ChannelNumber { + rv := objc.Call[ChannelNumber](c_, objc.Sel("midiChannel")) + return rv +} + +// The object’s enabled profiles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofilestate/2977110-enabledprofiles?language=objc +func (c_ CIProfileState) EnabledProfiles() []CIProfile { + rv := objc.Call[[]CIProfile](c_, objc.Sel("enabledProfiles")) + return rv +} + +// The object’s disabled profiles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciprofilestate/2977109-disabledprofiles?language=objc +func (c_ CIProfileState) DisabledProfiles() []CIProfile { + rv := objc.Call[[]CIProfile](c_, objc.Sel("disabledProfiles")) + return rv +} diff --git a/macos/coremidi/ci_responder.gen.go b/macos/coremidi/ci_responder.gen.go new file mode 100644 index 00000000..b3d316b1 --- /dev/null +++ b/macos/coremidi/ci_responder.gen.go @@ -0,0 +1,136 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CIResponder] class. +var CIResponderClass = _CIResponderClass{objc.GetClass("MIDICIResponder")} + +type _CIResponderClass struct { + objc.Class +} + +// An interface definition for the [CIResponder] class. +type ICIResponder interface { + objc.IObject + NotifyProfileOnChannelIsEnabled(aProfile ICIProfile, channel ChannelNumber, enabledState bool) bool + SendProfileOnChannelProfileData(aProfile ICIProfile, channel ChannelNumber, profileSpecificData []byte) bool + Start() bool + Stop() + Initiators() []CIInitiatiorMUID + DeviceInfo() CIDeviceInfo + ProfileDelegate() CIProfileResponderDelegateWrapper +} + +// An object that responds to MIDI-CI inquiries from an initiator on behalf of a MIDI client, and handles profile and property exchange operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder?language=objc +type CIResponder struct { + objc.Object +} + +func CIResponderFrom(ptr unsafe.Pointer) CIResponder { + return CIResponder{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CIResponder) InitWithDeviceInfoProfileDelegateProfileStatesSupportProperties(deviceInfo ICIDeviceInfo, delegate PCIProfileResponderDelegate, profileList *foundation.Array, propertiesSupported bool) CIResponder { + po1 := objc.WrapAsProtocol("MIDICIProfileResponderDelegate", delegate) + rv := objc.Call[CIResponder](c_, objc.Sel("initWithDeviceInfo:profileDelegate:profileStates:supportProperties:"), objc.Ptr(deviceInfo), po1, profileList, propertiesSupported) + return rv +} + +// Creates a new responder. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3580332-initwithdeviceinfo?language=objc +func NewCIResponderWithDeviceInfoProfileDelegateProfileStatesSupportProperties(deviceInfo ICIDeviceInfo, delegate PCIProfileResponderDelegate, profileList *foundation.Array, propertiesSupported bool) CIResponder { + instance := CIResponderClass.Alloc().InitWithDeviceInfoProfileDelegateProfileStatesSupportProperties(deviceInfo, delegate, profileList, propertiesSupported) + instance.Autorelease() + return instance +} + +func (cc _CIResponderClass) Alloc() CIResponder { + rv := objc.Call[CIResponder](cc, objc.Sel("alloc")) + return rv +} + +func CIResponder_Alloc() CIResponder { + return CIResponderClass.Alloc() +} + +func (cc _CIResponderClass) New() CIResponder { + rv := objc.Call[CIResponder](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCIResponder() CIResponder { + return CIResponderClass.New() +} + +func (c_ CIResponder) Init() CIResponder { + rv := objc.Call[CIResponder](c_, objc.Sel("init")) + return rv +} + +// Enables or disables a profile and notifies all connected initiators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3553257-notifyprofile?language=objc +func (c_ CIResponder) NotifyProfileOnChannelIsEnabled(aProfile ICIProfile, channel ChannelNumber, enabledState bool) bool { + rv := objc.Call[bool](c_, objc.Sel("notifyProfile:onChannel:isEnabled:"), objc.Ptr(aProfile), channel, enabledState) + return rv +} + +// Sends profile-specific data to all connected initiators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3553259-sendprofile?language=objc +func (c_ CIResponder) SendProfileOnChannelProfileData(aProfile ICIProfile, channel ChannelNumber, profileSpecificData []byte) bool { + rv := objc.Call[bool](c_, objc.Sel("sendProfile:onChannel:profileData:"), objc.Ptr(aProfile), channel, profileSpecificData) + return rv +} + +// Starts receiving initiator requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3553260-start?language=objc +func (c_ CIResponder) Start() bool { + rv := objc.Call[bool](c_, objc.Sel("start")) + return rv +} + +// Stops receiving initiator requests and disconnects all connected initiators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3553261-stop?language=objc +func (c_ CIResponder) Stop() { + objc.Call[objc.Void](c_, objc.Sel("stop")) +} + +// An array of initiators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3580333-initiators?language=objc +func (c_ CIResponder) Initiators() []CIInitiatiorMUID { + rv := objc.Call[[]CIInitiatiorMUID](c_, objc.Sel("initiators")) + return rv +} + +// The MIDI-CI device’s information. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3553255-deviceinfo?language=objc +func (c_ CIResponder) DeviceInfo() CIDeviceInfo { + rv := objc.Call[CIDeviceInfo](c_, objc.Sel("deviceInfo")) + return rv +} + +// The profile delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiciresponder/3580334-profiledelegate?language=objc +func (c_ CIResponder) ProfileDelegate() CIProfileResponderDelegateWrapper { + rv := objc.Call[CIProfileResponderDelegateWrapper](c_, objc.Sel("profileDelegate")) + return rv +} diff --git a/macos/coremidi/ci_session.gen.go b/macos/coremidi/ci_session.gen.go new file mode 100644 index 00000000..1639498d --- /dev/null +++ b/macos/coremidi/ci_session.gen.go @@ -0,0 +1,197 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CISession] class. +var CISessionClass = _CISessionClass{objc.GetClass("MIDICISession")} + +type _CISessionClass struct { + objc.Class +} + +// An interface definition for the [CISession] class. +type ICISession interface { + objc.IObject + EnableProfileOnChannelError(profile ICIProfile, channel ChannelNumber, outError foundation.IError) bool + ProfileStateForChannel(channel ChannelNumber) CIProfileState + DisableProfileOnChannelError(profile ICIProfile, channel ChannelNumber, outError foundation.IError) bool + SendProfileOnChannelProfileData(profile ICIProfile, channel ChannelNumber, profileSpecificData []byte) bool + MaxPropertyRequests() foundation.Number + MaxSysExSize() foundation.Number + DeviceInfo() CIDeviceInfo + ProfileChangedCallback() CIProfileChangedBlock + SetProfileChangedCallback(value CIProfileChangedBlock) + SupportsPropertyCapability() bool + MidiDestination() EntityRef + ProfileSpecificDataHandler() CIProfileSpecificDataBlock + SetProfileSpecificDataHandler(value CIProfileSpecificDataBlock) + SupportsProfileCapability() bool +} + +// An object that represents a MIDI-CI session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession?language=objc +type CISession struct { + objc.Object +} + +func CISessionFrom(ptr unsafe.Pointer) CISession { + return CISession{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CISession) InitWithDiscoveredNodeDataReadyHandlerDisconnectHandler(discoveredNode ICIDiscoveredNode, handler func(), disconnectHandler CISessionDisconnectBlock) CISession { + rv := objc.Call[CISession](c_, objc.Sel("initWithDiscoveredNode:dataReadyHandler:disconnectHandler:"), objc.Ptr(discoveredNode), handler, disconnectHandler) + return rv +} + +// Creates a MIDI-CI session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3580335-initwithdiscoverednode?language=objc +func NewCISessionWithDiscoveredNodeDataReadyHandlerDisconnectHandler(discoveredNode ICIDiscoveredNode, handler func(), disconnectHandler CISessionDisconnectBlock) CISession { + instance := CISessionClass.Alloc().InitWithDiscoveredNodeDataReadyHandlerDisconnectHandler(discoveredNode, handler, disconnectHandler) + instance.Autorelease() + return instance +} + +func (cc _CISessionClass) Alloc() CISession { + rv := objc.Call[CISession](cc, objc.Sel("alloc")) + return rv +} + +func CISession_Alloc() CISession { + return CISessionClass.Alloc() +} + +func (cc _CISessionClass) New() CISession { + rv := objc.Call[CISession](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCISession() CISession { + return CISessionClass.New() +} + +func (c_ CISession) Init() CISession { + rv := objc.Call[CISession](c_, objc.Sel("init")) + return rv +} + +// Performs an asynchronous request to enable a profile for a specific MIDI channel number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/2977117-enableprofile?language=objc +func (c_ CISession) EnableProfileOnChannelError(profile ICIProfile, channel ChannelNumber, outError foundation.IError) bool { + rv := objc.Call[bool](c_, objc.Sel("enableProfile:onChannel:error:"), objc.Ptr(profile), channel, objc.Ptr(outError)) + return rv +} + +// Returns the profile state for the specified MIDI channel number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/2977123-profilestateforchannel?language=objc +func (c_ CISession) ProfileStateForChannel(channel ChannelNumber) CIProfileState { + rv := objc.Call[CIProfileState](c_, objc.Sel("profileStateForChannel:"), channel) + return rv +} + +// Performs an asynchronous request to disable a profile for a specific MIDI channel number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/2977116-disableprofile?language=objc +func (c_ CISession) DisableProfileOnChannelError(profile ICIProfile, channel ChannelNumber, outError foundation.IError) bool { + rv := objc.Call[bool](c_, objc.Sel("disableProfile:onChannel:error:"), objc.Ptr(profile), channel, objc.Ptr(outError)) + return rv +} + +// Sends profile-specific data to the MIDI-CI session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3553276-sendprofile?language=objc +func (c_ CISession) SendProfileOnChannelProfileData(profile ICIProfile, channel ChannelNumber, profileSpecificData []byte) bool { + rv := objc.Call[bool](c_, objc.Sel("sendProfile:onChannel:profileData:"), objc.Ptr(profile), channel, profileSpecificData) + return rv +} + +// The maximum number of simultaneous property exchange requests, if supported. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3580336-maxpropertyrequests?language=objc +func (c_ CISession) MaxPropertyRequests() foundation.Number { + rv := objc.Call[foundation.Number](c_, objc.Sel("maxPropertyRequests")) + return rv +} + +// The maximum size of System Exclusive (SysEx) messages. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3580337-maxsysexsize?language=objc +func (c_ CISession) MaxSysExSize() foundation.Number { + rv := objc.Call[foundation.Number](c_, objc.Sel("maxSysExSize")) + return rv +} + +// Information about a MIDI-CI device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3553274-deviceinfo?language=objc +func (c_ CISession) DeviceInfo() CIDeviceInfo { + rv := objc.Call[CIDeviceInfo](c_, objc.Sel("deviceInfo")) + return rv +} + +// An optional block the system calls after it enables or disables a profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/2977122-profilechangedcallback?language=objc +func (c_ CISession) ProfileChangedCallback() CIProfileChangedBlock { + rv := objc.Call[CIProfileChangedBlock](c_, objc.Sel("profileChangedCallback")) + return rv +} + +// An optional block the system calls after it enables or disables a profile. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/2977122-profilechangedcallback?language=objc +func (c_ CISession) SetProfileChangedCallback(value CIProfileChangedBlock) { + objc.Call[objc.Void](c_, objc.Sel("setProfileChangedCallback:"), value) +} + +// A Boolean value that indicates whether the entity supports the MIDI-CI property exchange capability. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/2977127-supportspropertycapability?language=objc +func (c_ CISession) SupportsPropertyCapability() bool { + rv := objc.Call[bool](c_, objc.Sel("supportsPropertyCapability")) + return rv +} + +// The MIDI destination with which the session is communicating. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3580338-mididestination?language=objc +func (c_ CISession) MidiDestination() EntityRef { + rv := objc.Call[EntityRef](c_, objc.Sel("midiDestination")) + return rv +} + +// An optional block the system calls when a device sends profile-specific data to the session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3580339-profilespecificdatahandler?language=objc +func (c_ CISession) ProfileSpecificDataHandler() CIProfileSpecificDataBlock { + rv := objc.Call[CIProfileSpecificDataBlock](c_, objc.Sel("profileSpecificDataHandler")) + return rv +} + +// An optional block the system calls when a device sends profile-specific data to the session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/3580339-profilespecificdatahandler?language=objc +func (c_ CISession) SetProfileSpecificDataHandler(value CIProfileSpecificDataBlock) { + objc.Call[objc.Void](c_, objc.Sel("setProfileSpecificDataHandler:"), value) +} + +// A Boolean value that indicates whether the entity supports the MIDI-CI profile’s capability. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicisession/2977126-supportsprofilecapability?language=objc +func (c_ CISession) SupportsProfileCapability() bool { + rv := objc.Call[bool](c_, objc.Sel("supportsProfileCapability")) + return rv +} diff --git a/macos/coremidi/coremidi_custom.go b/macos/coremidi/coremidi_custom.go new file mode 100644 index 00000000..1809b4b7 --- /dev/null +++ b/macos/coremidi/coremidi_custom.go @@ -0,0 +1,5 @@ +package coremidi + +import "github.com/progrium/macdriver/macos/foundation" + +type CIInitiatiorMUID = foundation.Number diff --git a/macos/coremidi/coremidi_structs.go b/macos/coremidi/coremidi_structs.go new file mode 100644 index 00000000..903872ff --- /dev/null +++ b/macos/coremidi/coremidi_structs.go @@ -0,0 +1,7 @@ +package coremidi + +type SysexSendRequest struct{} +type EventList struct{} +type PacketList struct{} +type Notification struct{} +type UniversalMessage struct{} diff --git a/macos/coremidi/doc.gen.go b/macos/coremidi/doc.gen.go new file mode 100644 index 00000000..9bcfaacf --- /dev/null +++ b/macos/coremidi/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Communicate with MIDI devices such as hardware keyboards and synthesizers. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/coremidi?language=objc +package coremidi diff --git a/macos/coremidi/enumtypes.gen.go b/macos/coremidi/enumtypes.gen.go new file mode 100644 index 00000000..a24d5c60 --- /dev/null +++ b/macos/coremidi/enumtypes.gen.go @@ -0,0 +1,271 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +// MIDI status types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midicvstatus?language=objc +type CVStatus int + +const ( + KCVStatusAssignableControl CVStatus = 3 + KCVStatusAssignablePNC CVStatus = 1 + KCVStatusChannelPressure CVStatus = 13 + KCVStatusControlChange CVStatus = 11 + KCVStatusNoteOff CVStatus = 8 + KCVStatusNoteOn CVStatus = 9 + KCVStatusPerNoteMgmt CVStatus = 15 + KCVStatusPerNotePitchBend CVStatus = 6 + KCVStatusPitchBend CVStatus = 14 + KCVStatusPolyPressure CVStatus = 10 + KCVStatusProgramChange CVStatus = 12 + KCVStatusRegisteredControl CVStatus = 2 + KCVStatusRegisteredPNC CVStatus = 0 + KCVStatusRelAssignableControl CVStatus = 5 + KCVStatusRelRegisteredControl CVStatus = 4 +) + +// MIDI Channel, 0~15 (channels 1 through 16, respectively), or MIDIChannelsWholePort. Per the MIDI-CI specification, this is always a single byte. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midichannelnumber?language=objc +type ChannelNumber uint8 + +const ( + ChannelsWholePort ChannelNumber = 127 +) + +// An object that maintains per-client state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiclientref?language=objc +type ClientRef ObjectRef + +// A list of MIDI devices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/mididevicelistref?language=objc +type DeviceListRef ObjectRef + +// A MIDI device that contains entities. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midideviceref?language=objc +type DeviceRef ObjectRef + +// A MIDI source or destination an entity owns. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiendpointref?language=objc +type EndpointRef ObjectRef + +// An entity that a device owns and that contains endpoints. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midientityref?language=objc +type EntityRef ObjectRef + +// Supported MIDI message types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midimessagetype?language=objc +type MessageType int + +const ( + KMessageTypeChannelVoice1 MessageType = 2 + KMessageTypeChannelVoice2 MessageType = 4 + KMessageTypeData128 MessageType = 5 + KMessageTypeSysEx MessageType = 3 + KMessageTypeSystem MessageType = 1 + KMessageTypeUnknownF MessageType = 15 + KMessageTypeUtility MessageType = 0 +) + +// A 32-bit MIDI message. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midimessage_32?language=objc +type Message_32 uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkconnectionpolicy?language=objc +type NetworkConnectionPolicy uint + +const ( + NetworkConnectionPolicy_Anyone NetworkConnectionPolicy = 2 + NetworkConnectionPolicy_HostsInContactList NetworkConnectionPolicy = 1 + NetworkConnectionPolicy_NoOne NetworkConnectionPolicy = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinoteattribute?language=objc +type NoteAttribute uint8 + +const ( + KNoteAttributeManufacturerSpecific NoteAttribute = 1 + KNoteAttributeNone NoteAttribute = 0 + KNoteAttributePitch NoteAttribute = 3 + KNoteAttributeProfileSpecific NoteAttribute = 2 +) + +// The types of state changes the system supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinotificationmessageid?language=objc +type NotificationMessageID int32 + +const ( + KMsgIOError NotificationMessageID = 7 + KMsgObjectAdded NotificationMessageID = 2 + KMsgObjectRemoved NotificationMessageID = 3 + KMsgPropertyChanged NotificationMessageID = 4 + KMsgSerialPortOwnerChanged NotificationMessageID = 6 + KMsgSetupChanged NotificationMessageID = 1 + KMsgThruConnectionsChanged NotificationMessageID = 5 +) + +// The common base class for many of the framework’s objects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiobjectref?language=objc +type ObjectRef uint32 + +// The MIDI object types that the system supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiobjecttype?language=objc +type ObjectType int32 + +const ( + KObjectType_Destination ObjectType = 3 + KObjectType_Device ObjectType = 0 + KObjectType_Entity ObjectType = 1 + KObjectType_ExternalDestination ObjectType = 19 + KObjectType_ExternalDevice ObjectType = 16 + KObjectType_ExternalEntity ObjectType = 17 + KObjectType_ExternalMask ObjectType = 16 + KObjectType_ExternalSource ObjectType = 18 + KObjectType_Other ObjectType = -1 + KObjectType_Source ObjectType = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midipernotemanagementoptions?language=objc +type PerNoteManagementOptions uint8 + +const ( + KPerNoteManagementDetach PerNoteManagementOptions = 2 + KPerNoteManagementReset PerNoteManagementOptions = 1 +) + +// A MIDI connection that a client maintains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiportref?language=objc +type PortRef ObjectRef + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiprogramchangeoptions?language=objc +type ProgramChangeOptions uint8 + +const ( + KProgramChangeBankValid ProgramChangeOptions = 1 +) + +// Specifies a MIDI protocol variant. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiprotocolid?language=objc +type ProtocolID int32 + +const ( + KProtocol_1_0 ProtocolID = 1 + KProtocol_2_0 ProtocolID = 2 +) + +// A type that represents the global state of the MIDI system, that contains lists of the devices and serial port owners. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midisetupref?language=objc +type SetupRef ObjectRef + +// MIDI System Exclusive (SysEx) types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midisysexstatus?language=objc +type SysExStatus int + +const ( + KSysExStatusComplete SysExStatus = 0 + KSysExStatusContinue SysExStatus = 2 + KSysExStatusEnd SysExStatus = 3 + KSysExStatusMixedDataSetHeader SysExStatus = 8 + KSysExStatusMixedDataSetPayload SysExStatus = 9 + KSysExStatusStart SysExStatus = 1 +) + +// MIDI System status types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midisystemstatus?language=objc +type SystemStatus int + +const ( + KStatusActiveSending SystemStatus = 254 + KStatusActiveSensing SystemStatus = 254 + KStatusContinue SystemStatus = 251 + KStatusEndOfExclusive SystemStatus = 247 + KStatusMTC SystemStatus = 241 + KStatusSongPosPointer SystemStatus = 242 + KStatusSongSelect SystemStatus = 243 + KStatusStart SystemStatus = 250 + KStatusStartOfExclusive SystemStatus = 240 + KStatusStop SystemStatus = 252 + KStatusSystemReset SystemStatus = 255 + KStatusTimingClock SystemStatus = 248 + KStatusTuneRequest SystemStatus = 246 +) + +// An opaque reference to a play-through connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midithruconnectionref?language=objc +type ThruConnectionRef ObjectRef + +// The time on the host clock when the event occurred. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/miditimestamp?language=objc +type TimeStamp uint64 + +// A set of values that indicate how to interpret control numbers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/miditransformcontroltype?language=objc +type TransformControlType uint8 + +const ( + KControlType_14Bit TransformControlType = 1 + KControlType_14BitNRPN TransformControlType = 5 + KControlType_14BitRPN TransformControlType = 3 + KControlType_7Bit TransformControlType = 0 + KControlType_7BitNRPN TransformControlType = 4 + KControlType_7BitRPN TransformControlType = 2 +) + +// Values that specify the type of MIDI transformation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/miditransformtype?language=objc +type TransformType uint16 + +const ( + KTransform_Add TransformType = 8 + KTransform_FilterOut TransformType = 1 + KTransform_MapControl TransformType = 2 + KTransform_MapValue TransformType = 12 + KTransform_MaxValue TransformType = 11 + KTransform_MinValue TransformType = 10 + KTransform_None TransformType = 0 + KTransform_Scale TransformType = 9 +) + +// A MIDI object’s unique identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiuniqueid?language=objc +type UniqueID int32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midiutilitystatus?language=objc +type UtilityStatus int + +const ( + KUtilityStatusJitterReductionClock UtilityStatus = 1 + KUtilityStatusJitterReductionTimestamp UtilityStatus = 2 + KUtilityStatusNOOP UtilityStatus = 0 +) diff --git a/macos/coremidi/network_connection.gen.go b/macos/coremidi/network_connection.gen.go new file mode 100644 index 00000000..531c4373 --- /dev/null +++ b/macos/coremidi/network_connection.gen.go @@ -0,0 +1,79 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NetworkConnection] class. +var NetworkConnectionClass = _NetworkConnectionClass{objc.GetClass("MIDINetworkConnection")} + +type _NetworkConnectionClass struct { + objc.Class +} + +// An interface definition for the [NetworkConnection] class. +type INetworkConnection interface { + objc.IObject + Host() NetworkHost +} + +// An object that connects a session to a host. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkconnection?language=objc +type NetworkConnection struct { + objc.Object +} + +func NetworkConnectionFrom(ptr unsafe.Pointer) NetworkConnection { + return NetworkConnection{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NetworkConnectionClass) ConnectionWithHost(host INetworkHost) NetworkConnection { + rv := objc.Call[NetworkConnection](nc, objc.Sel("connectionWithHost:"), objc.Ptr(host)) + return rv +} + +// Creates a connection to the specified host. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkconnection/1619340-connectionwithhost?language=objc +func NetworkConnection_ConnectionWithHost(host INetworkHost) NetworkConnection { + return NetworkConnectionClass.ConnectionWithHost(host) +} + +func (nc _NetworkConnectionClass) Alloc() NetworkConnection { + rv := objc.Call[NetworkConnection](nc, objc.Sel("alloc")) + return rv +} + +func NetworkConnection_Alloc() NetworkConnection { + return NetworkConnectionClass.Alloc() +} + +func (nc _NetworkConnectionClass) New() NetworkConnection { + rv := objc.Call[NetworkConnection](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNetworkConnection() NetworkConnection { + return NetworkConnectionClass.New() +} + +func (n_ NetworkConnection) Init() NetworkConnection { + rv := objc.Call[NetworkConnection](n_, objc.Sel("init")) + return rv +} + +// The host connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkconnection/1619334-host?language=objc +func (n_ NetworkConnection) Host() NetworkHost { + rv := objc.Call[NetworkHost](n_, objc.Sel("host")) + return rv +} diff --git a/macos/coremidi/network_host.gen.go b/macos/coremidi/network_host.gen.go new file mode 100644 index 00000000..9361e796 --- /dev/null +++ b/macos/coremidi/network_host.gen.go @@ -0,0 +1,125 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NetworkHost] class. +var NetworkHostClass = _NetworkHostClass{objc.GetClass("MIDINetworkHost")} + +type _NetworkHostClass struct { + objc.Class +} + +// An interface definition for the [NetworkHost] class. +type INetworkHost interface { + objc.IObject + HasSameAddressAs(other INetworkHost) bool + Name() string + NetServiceName() string + Address() string + NetServiceDomain() string + Port() uint +} + +// An object that represents the host’s network address. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost?language=objc +type NetworkHost struct { + objc.Object +} + +func NetworkHostFrom(ptr unsafe.Pointer) NetworkHost { + return NetworkHost{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NetworkHostClass) HostWithNameNetService(name string, netService foundation.INetService) NetworkHost { + rv := objc.Call[NetworkHost](nc, objc.Sel("hostWithName:netService:"), name, objc.Ptr(netService)) + return rv +} + +// Creates a host with the specified name and net service. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost/1619371-hostwithname?language=objc +func NetworkHost_HostWithNameNetService(name string, netService foundation.INetService) NetworkHost { + return NetworkHostClass.HostWithNameNetService(name, netService) +} + +func (nc _NetworkHostClass) Alloc() NetworkHost { + rv := objc.Call[NetworkHost](nc, objc.Sel("alloc")) + return rv +} + +func NetworkHost_Alloc() NetworkHost { + return NetworkHostClass.Alloc() +} + +func (nc _NetworkHostClass) New() NetworkHost { + rv := objc.Call[NetworkHost](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNetworkHost() NetworkHost { + return NetworkHostClass.New() +} + +func (n_ NetworkHost) Init() NetworkHost { + rv := objc.Call[NetworkHost](n_, objc.Sel("init")) + return rv +} + +// Compares this host instance with another to see if they share the same address value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost/1619372-hassameaddressas?language=objc +func (n_ NetworkHost) HasSameAddressAs(other INetworkHost) bool { + rv := objc.Call[bool](n_, objc.Sel("hasSameAddressAs:"), objc.Ptr(other)) + return rv +} + +// The host name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost/1619339-name?language=objc +func (n_ NetworkHost) Name() string { + rv := objc.Call[string](n_, objc.Sel("name")) + return rv +} + +// The net service name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost/1619362-netservicename?language=objc +func (n_ NetworkHost) NetServiceName() string { + rv := objc.Call[string](n_, objc.Sel("netServiceName")) + return rv +} + +// The host address. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost/1619353-address?language=objc +func (n_ NetworkHost) Address() string { + rv := objc.Call[string](n_, objc.Sel("address")) + return rv +} + +// The net service domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost/1619344-netservicedomain?language=objc +func (n_ NetworkHost) NetServiceDomain() string { + rv := objc.Call[string](n_, objc.Sel("netServiceDomain")) + return rv +} + +// The host port. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworkhost/1619333-port?language=objc +func (n_ NetworkHost) Port() uint { + rv := objc.Call[uint](n_, objc.Sel("port")) + return rv +} diff --git a/macos/coremidi/network_session.gen.go b/macos/coremidi/network_session.gen.go new file mode 100644 index 00000000..4b56c062 --- /dev/null +++ b/macos/coremidi/network_session.gen.go @@ -0,0 +1,207 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package coremidi + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NetworkSession] class. +var NetworkSessionClass = _NetworkSessionClass{objc.GetClass("MIDINetworkSession")} + +type _NetworkSessionClass struct { + objc.Class +} + +// An interface definition for the [NetworkSession] class. +type INetworkSession interface { + objc.IObject + Connections() foundation.Set + AddConnection(connection INetworkConnection) bool + RemoveConnection(connection INetworkConnection) bool + RemoveContact(contact INetworkHost) bool + DestinationEndpoint() EndpointRef + AddContact(contact INetworkHost) bool + SourceEndpoint() EndpointRef + Contacts() foundation.Set + LocalName() string + NetworkName() string + ConnectionPolicy() NetworkConnectionPolicy + SetConnectionPolicy(value NetworkConnectionPolicy) + NetworkPort() uint + IsEnabled() bool + SetEnabled(value bool) +} + +// An object that represents a pairing of a source and destination. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession?language=objc +type NetworkSession struct { + objc.Object +} + +func NetworkSessionFrom(ptr unsafe.Pointer) NetworkSession { + return NetworkSession{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NetworkSessionClass) Alloc() NetworkSession { + rv := objc.Call[NetworkSession](nc, objc.Sel("alloc")) + return rv +} + +func NetworkSession_Alloc() NetworkSession { + return NetworkSessionClass.Alloc() +} + +func (nc _NetworkSessionClass) New() NetworkSession { + rv := objc.Call[NetworkSession](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNetworkSession() NetworkSession { + return NetworkSessionClass.New() +} + +func (n_ NetworkSession) Init() NetworkSession { + rv := objc.Call[NetworkSession](n_, objc.Sel("init")) + return rv +} + +// Returns the session’s set of MIDI network connections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619366-connections?language=objc +func (n_ NetworkSession) Connections() foundation.Set { + rv := objc.Call[foundation.Set](n_, objc.Sel("connections")) + return rv +} + +// Adds a new connection to this session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619369-addconnection?language=objc +func (n_ NetworkSession) AddConnection(connection INetworkConnection) bool { + rv := objc.Call[bool](n_, objc.Sel("addConnection:"), objc.Ptr(connection)) + return rv +} + +// Returns the default singleton session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619363-defaultsession?language=objc +func (nc _NetworkSessionClass) DefaultSession() NetworkSession { + rv := objc.Call[NetworkSession](nc, objc.Sel("defaultSession")) + return rv +} + +// Returns the default singleton session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619363-defaultsession?language=objc +func NetworkSession_DefaultSession() NetworkSession { + return NetworkSessionClass.DefaultSession() +} + +// Removes a connection from this session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619346-removeconnection?language=objc +func (n_ NetworkSession) RemoveConnection(connection INetworkConnection) bool { + rv := objc.Call[bool](n_, objc.Sel("removeConnection:"), objc.Ptr(connection)) + return rv +} + +// Removes a host as a contact. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619332-removecontact?language=objc +func (n_ NetworkSession) RemoveContact(contact INetworkHost) bool { + rv := objc.Call[bool](n_, objc.Sel("removeContact:"), objc.Ptr(contact)) + return rv +} + +// Returns the session’s destination endpoint. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619367-destinationendpoint?language=objc +func (n_ NetworkSession) DestinationEndpoint() EndpointRef { + rv := objc.Call[EndpointRef](n_, objc.Sel("destinationEndpoint")) + return rv +} + +// Adds a host as a contact. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619361-addcontact?language=objc +func (n_ NetworkSession) AddContact(contact INetworkHost) bool { + rv := objc.Call[bool](n_, objc.Sel("addContact:"), objc.Ptr(contact)) + return rv +} + +// Returns the session’s source endpoint. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619359-sourceendpoint?language=objc +func (n_ NetworkSession) SourceEndpoint() EndpointRef { + rv := objc.Call[EndpointRef](n_, objc.Sel("sourceEndpoint")) + return rv +} + +// Returns the array of network hosts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619335-contacts?language=objc +func (n_ NetworkSession) Contacts() foundation.Set { + rv := objc.Call[foundation.Set](n_, objc.Sel("contacts")) + return rv +} + +// The name of this session’s entity. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619358-localname?language=objc +func (n_ NetworkSession) LocalName() string { + rv := objc.Call[string](n_, objc.Sel("localName")) + return rv +} + +// The name with which this session advertises itself over Bonjour. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619336-networkname?language=objc +func (n_ NetworkSession) NetworkName() string { + rv := objc.Call[string](n_, objc.Sel("networkName")) + return rv +} + +// The policy that determines who can connect to this session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619360-connectionpolicy?language=objc +func (n_ NetworkSession) ConnectionPolicy() NetworkConnectionPolicy { + rv := objc.Call[NetworkConnectionPolicy](n_, objc.Sel("connectionPolicy")) + return rv +} + +// The policy that determines who can connect to this session. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619360-connectionpolicy?language=objc +func (n_ NetworkSession) SetConnectionPolicy(value NetworkConnectionPolicy) { + objc.Call[objc.Void](n_, objc.Sel("setConnectionPolicy:"), value) +} + +// The session’s UDP port. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619373-networkport?language=objc +func (n_ NetworkSession) NetworkPort() uint { + rv := objc.Call[uint](n_, objc.Sel("networkPort")) + return rv +} + +// A Boolean value that determines whether the session is enabled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619368-enabled?language=objc +func (n_ NetworkSession) IsEnabled() bool { + rv := objc.Call[bool](n_, objc.Sel("isEnabled")) + return rv +} + +// A Boolean value that determines whether the session is enabled. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/coremidi/midinetworksession/1619368-enabled?language=objc +func (n_ NetworkSession) SetEnabled(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setEnabled:"), value) +} diff --git a/macos/coremidi/protocols.gen.m b/macos/coremidi/protocols.gen.m new file mode 100644 index 00000000..9dd606c8 --- /dev/null +++ b/macos/coremidi/protocols.gen.m @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "CoreMIDI/CoreMIDI.h" + +void importCoreMIDIProtocols() { + id o; + o = @protocol(MIDICIProfileResponderDelegate); +} diff --git a/macos/corevideo/aliastypes.gen.go b/macos/corevideo/aliastypes.gen.go new file mode 100644 index 00000000..dc6b3869 --- /dev/null +++ b/macos/corevideo/aliastypes.gen.go @@ -0,0 +1,32 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package corevideo + +import ( + "unsafe" +) + +// A type for a display link callback function that the system invokes when it’s time for the app to output a video frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvdisplaylinkoutputcallback?language=objc +type DisplayLinkOutputCallback = func(displayLink DisplayLinkRef, inNow *TimeStamp, inOutputTime *TimeStamp, flagsIn OptionFlags, flagsOut *OptionFlags, displayLinkContext unsafe.Pointer) Return + +// Defines a pointer to a pixel buffer release callback function, which is called when a pixel buffer created by CVPixelBufferCreateWithPlanarBytes is released. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvpixelbufferreleaseplanarbytescallback?language=objc +type PixelBufferReleasePlanarBytesCallback = func(releaseRefCon unsafe.Pointer, dataPtr unsafe.Pointer, dataSize uint, numberOfPlanes uint, planeAddresses unsafe.Pointer) + +// A type that defines a release callback function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvpixelbufferreleasebytescallback?language=objc +type PixelBufferReleaseBytesCallback = func(releaseRefCon unsafe.Pointer, baseAddress unsafe.Pointer) + +// Defines a pointer to a custom extended pixel-fill function, which is called whenever the system needs to pad a buffer holding your custom pixel format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvfillextendedpixelscallback?language=objc +type FillExtendedPixelsCallBack = func(pixelBuffer PixelBufferRef, refCon unsafe.Pointer) bool + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvdisplaylinkoutputhandler?language=objc +type DisplayLinkOutputHandler = func(displayLink DisplayLinkRef, inNow *TimeStamp, inOutputTime *TimeStamp, flagsIn OptionFlags, flagsOut *OptionFlags) Return diff --git a/macos/corevideo/corevideo_structs.go b/macos/corevideo/corevideo_structs.go index dfc6bad0..dddf5dc7 100644 --- a/macos/corevideo/corevideo_structs.go +++ b/macos/corevideo/corevideo_structs.go @@ -5,6 +5,7 @@ import "unsafe" type PixelBufferRef unsafe.Pointer type ImageBufferRef unsafe.Pointer type DisplayLinkRef unsafe.Pointer +type PixelBufferPoolRef unsafe.Pointer // todo type TimeStamp struct{} diff --git a/macos/corevideo/doc.gen.go b/macos/corevideo/doc.gen.go new file mode 100644 index 00000000..a187f2b0 --- /dev/null +++ b/macos/corevideo/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Process digital video, including manipulation of individual frames, using a pipeline-based API and support for both Metal and OpenGL. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/corevideo?language=objc +package corevideo diff --git a/macos/corevideo/enumtypes.gen.go b/macos/corevideo/enumtypes.gen.go new file mode 100644 index 00000000..7fc697fb --- /dev/null +++ b/macos/corevideo/enumtypes.gen.go @@ -0,0 +1,93 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package corevideo + +// The propagation modes of a Core Video buffer attachment. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvattachmentmode?language=objc +type AttachmentMode uint32 + +const ( + KAttachmentMode_ShouldNotPropagate AttachmentMode = 0 + KAttachmentMode_ShouldPropagate AttachmentMode = 1 +) + +// The flags to be used for the display link output callback function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvoptionflags?language=objc +type OptionFlags uint64 + +// The flags to pass to CVPixelBufferLockBaseAddress and CVPixelBufferUnlockBaseAddress. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvpixelbufferlockflags?language=objc +type PixelBufferLockFlags OptionFlags + +const ( + KPixelBufferLock_ReadOnly PixelBufferLockFlags = 1 +) + +// The flags to pass to flush the pool. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvpixelbufferpoolflushflags?language=objc +type PixelBufferPoolFlushFlags OptionFlags + +const ( + KPixelBufferPoolFlushExcessBuffers PixelBufferPoolFlushFlags = 1 +) + +// A Core Video error type return value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvreturn?language=objc +type Return int32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvsmptetimeflags?language=objc +type SMPTETimeFlags uint32 + +const ( + KSMPTETimeRunning SMPTETimeFlags = 2 + KSMPTETimeValid SMPTETimeFlags = 1 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvsmptetimetype?language=objc +type SMPTETimeType uint32 + +const ( + KSMPTETimeType24 SMPTETimeType = 0 + KSMPTETimeType25 SMPTETimeType = 1 + KSMPTETimeType2997 SMPTETimeType = 4 + KSMPTETimeType2997Drop SMPTETimeType = 5 + KSMPTETimeType30 SMPTETimeType = 3 + KSMPTETimeType30Drop SMPTETimeType = 2 + KSMPTETimeType5994 SMPTETimeType = 7 + KSMPTETimeType60 SMPTETimeType = 6 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvtimeflags?language=objc +type TimeFlags int32 + +const ( + KTimeIsIndefinite TimeFlags = 1 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/corevideo/cvtimestampflags?language=objc +type TimeStampFlags uint64 + +const ( + KTimeStampBottomField TimeStampFlags = 131072 + KTimeStampHostTimeValid TimeStampFlags = 2 + KTimeStampIsInterlaced TimeStampFlags = 196608 + KTimeStampRateScalarValid TimeStampFlags = 16 + KTimeStampSMPTETimeValid TimeStampFlags = 4 + KTimeStampTopField TimeStampFlags = 65536 + KTimeStampVideoHostTimeValid TimeStampFlags = 3 + KTimeStampVideoRefreshPeriodValid TimeStampFlags = 8 + KTimeStampVideoTimeValid TimeStampFlags = 1 +) diff --git a/macos/corevideo/protocols.gen.m b/macos/corevideo/protocols.gen.m new file mode 100644 index 00000000..8881c3c6 --- /dev/null +++ b/macos/corevideo/protocols.gen.m @@ -0,0 +1,7 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "CoreVideo/CoreVideo.h" + +void importCoreVideoProtocols() { + id o; +} diff --git a/macos/fileprovider/doc.gen.go b/macos/fileprovider/doc.gen.go new file mode 100644 index 00000000..6c89d04b --- /dev/null +++ b/macos/fileprovider/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// An extension other apps use to access files and folders managed by your app and synced with a remote storage. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/fileprovider?language=objc +package fileprovider diff --git a/macos/fileprovider/enumtypes.gen.go b/macos/fileprovider/enumtypes.gen.go new file mode 100644 index 00000000..fae0bd94 --- /dev/null +++ b/macos/fileprovider/enumtypes.gen.go @@ -0,0 +1,199 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +// Options for creating items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidercreateitemoptions?language=objc +type FileProviderCreateItemOptions uint + +const ( + FileProviderCreateItemDeletionConflicted FileProviderCreateItemOptions = 2 + FileProviderCreateItemMayAlreadyExist FileProviderCreateItemOptions = 1 +) + +// Options for deleting items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdeleteitemoptions?language=objc +type FileProviderDeleteItemOptions uint + +const ( + FileProviderDeleteItemRecursive FileProviderDeleteItemOptions = 1 +) + +// A unique identifier for a file provider's domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainidentifier?language=objc +type FileProviderDomainIdentifier string + +// A mode indicating how the system handles user data when removing a domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainremovalmode?language=objc +type FileProviderDomainRemovalMode int + +const ( + FileProviderDomainRemovalModePreserveDirtyUserData FileProviderDomainRemovalMode = 1 + FileProviderDomainRemovalModePreserveDownloadedUserData FileProviderDomainRemovalMode = 2 + FileProviderDomainRemovalModeRemoveAll FileProviderDomainRemovalMode = 0 +) + +// Modes that modify the system’s behavior while testing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomaintestingmodes?language=objc +type FileProviderDomainTestingModes uint + +const ( + FileProviderDomainTestingModeAlwaysEnabled FileProviderDomainTestingModes = 1 + FileProviderDomainTestingModeInteractive FileProviderDomainTestingModes = 2 +) + +// The error codes for the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidererrorcode?language=objc +type FileProviderErrorCode int + +const ( + FileProviderErrorCannotSynchronize FileProviderErrorCode = -2005 + FileProviderErrorDeletionRejected FileProviderErrorCode = -1006 + FileProviderErrorDirectoryNotEmpty FileProviderErrorCode = -1007 + FileProviderErrorFilenameCollision FileProviderErrorCode = -1001 + FileProviderErrorInsufficientQuota FileProviderErrorCode = -1003 + FileProviderErrorNewerExtensionVersionFound FileProviderErrorCode = -2004 + FileProviderErrorNoSuchItem FileProviderErrorCode = -1005 + FileProviderErrorNonEvictable FileProviderErrorCode = -2008 + FileProviderErrorNonEvictableChildren FileProviderErrorCode = -2006 + FileProviderErrorNotAuthenticated FileProviderErrorCode = -1000 + FileProviderErrorOlderExtensionVersionRunning FileProviderErrorCode = -2003 + FileProviderErrorPageExpired FileProviderErrorCode = -1002 + FileProviderErrorProviderNotFound FileProviderErrorCode = -2001 + FileProviderErrorProviderTranslocated FileProviderErrorCode = -2002 + FileProviderErrorServerUnreachable FileProviderErrorCode = -1004 + FileProviderErrorSyncAnchorExpired FileProviderErrorCode = -1002 + FileProviderErrorUnsyncedEdits FileProviderErrorCode = -2007 +) + +// An identifier for custom actions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderextensionactionidentifier?language=objc +type FileProviderExtensionActionIdentifier string + +// Options for fetching a range of data from a file. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderfetchcontentsoptions?language=objc +type FileProviderFetchContentsOptions uint + +// Flags that define an item’s on-disk properties and its appearance in the user interface. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderfilesystemflags?language=objc +type FileProviderFileSystemFlags uint + +const ( + FileProviderFileSystemHidden FileProviderFileSystemFlags = 8 + FileProviderFileSystemPathExtensionHidden FileProviderFileSystemFlags = 16 + FileProviderFileSystemUserExecutable FileProviderFileSystemFlags = 1 + FileProviderFileSystemUserReadable FileProviderFileSystemFlags = 2 + FileProviderFileSystemUserWritable FileProviderFileSystemFlags = 4 +) + +// An item’s capabilities, which define the actions that the user can perform in the document browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemcapabilities?language=objc +type FileProviderItemCapabilities uint + +const ( + FileProviderItemCapabilitiesAllowsAddingSubItems FileProviderItemCapabilities = 2 + FileProviderItemCapabilitiesAllowsAll FileProviderItemCapabilities = 63 + FileProviderItemCapabilitiesAllowsContentEnumerating FileProviderItemCapabilities = 1 + FileProviderItemCapabilitiesAllowsDeleting FileProviderItemCapabilities = 32 + FileProviderItemCapabilitiesAllowsEvicting FileProviderItemCapabilities = 64 + FileProviderItemCapabilitiesAllowsExcludingFromSync FileProviderItemCapabilities = 128 + FileProviderItemCapabilitiesAllowsReading FileProviderItemCapabilities = 1 + FileProviderItemCapabilitiesAllowsRenaming FileProviderItemCapabilities = 8 + FileProviderItemCapabilitiesAllowsReparenting FileProviderItemCapabilities = 4 + FileProviderItemCapabilitiesAllowsTrashing FileProviderItemCapabilities = 16 + FileProviderItemCapabilitiesAllowsWriting FileProviderItemCapabilities = 2 +) + +// A decoration identifier defined in the File Provider extension’s information property list. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorationidentifier?language=objc +type FileProviderItemDecorationIdentifier string + +// Fields that specify which of the item’s properties have changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemfields?language=objc +type FileProviderItemFields uint + +const ( + FileProviderItemContentModificationDate FileProviderItemFields = 128 + FileProviderItemContents FileProviderItemFields = 1 + FileProviderItemCreationDate FileProviderItemFields = 64 + FileProviderItemExtendedAttributes FileProviderItemFields = 512 + FileProviderItemFavoriteRank FileProviderItemFields = 32 + FileProviderItemFileSystemFlags FileProviderItemFields = 256 + FileProviderItemFilename FileProviderItemFields = 2 + FileProviderItemLastUsedDate FileProviderItemFields = 8 + FileProviderItemParentItemIdentifier FileProviderItemFields = 4 + FileProviderItemTagData FileProviderItemFields = 16 + FileProviderItemTypeAndCreator FileProviderItemFields = 1024 +) + +// A unique identifier for an item managed by the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemidentifier?language=objc +type FileProviderItemIdentifier string + +const ( + FileProviderRootContainerItemIdentifier FileProviderItemIdentifier = "NSFileProviderRootContainerItemIdentifier" + FileProviderTrashContainerItemIdentifier FileProviderItemIdentifier = "NSFileProviderTrashContainerItemIdentifier" + FileProviderWorkingSetContainerItemIdentifier FileProviderItemIdentifier = "NSFileProviderWorkingSetContainerItemIdentifier" +) + +// Options for disconnecting a domain from the extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanagerdisconnectionoptions?language=objc +type FileProviderManagerDisconnectionOptions uint + +const ( + FileProviderManagerDisconnectionOptionsTemporary FileProviderManagerDisconnectionOptions = 1 +) + +// Flags that provides additional information about the provided content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermaterializationflags?language=objc +type FileProviderMaterializationFlags uint + +// Options for modifying items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermodifyitemoptions?language=objc +type FileProviderModifyItemOptions uint + +const ( + FileProviderModifyItemMayAlreadyExist FileProviderModifyItemOptions = 1 +) + +// The location where the operation takes place. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperationside?language=objc +type FileProviderTestingOperationSide uint + +const ( + FileProviderTestingOperationSideDisk FileProviderTestingOperationSide = 0 + FileProviderTestingOperationSideFileProvider FileProviderTestingOperationSide = 1 +) + +// The action that an operation performs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperationtype?language=objc +type FileProviderTestingOperationType int + +const ( + FileProviderTestingOperationTypeChildrenEnumeration FileProviderTestingOperationType = 6 + FileProviderTestingOperationTypeCollisionResolution FileProviderTestingOperationType = 7 + FileProviderTestingOperationTypeContentFetch FileProviderTestingOperationType = 5 + FileProviderTestingOperationTypeCreation FileProviderTestingOperationType = 2 + FileProviderTestingOperationTypeDeletion FileProviderTestingOperationType = 4 + FileProviderTestingOperationTypeIngestion FileProviderTestingOperationType = 0 + FileProviderTestingOperationTypeLookup FileProviderTestingOperationType = 1 + FileProviderTestingOperationTypeModification FileProviderTestingOperationType = 3 +) diff --git a/macos/fileprovider/file_provider_change_observer.gen.go b/macos/fileprovider/file_provider_change_observer.gen.go new file mode 100644 index 00000000..17d8b3e8 --- /dev/null +++ b/macos/fileprovider/file_provider_change_observer.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// An observer that receives changes and deletions during enumeration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderchangeobserver?language=objc +type PFileProviderChangeObserver interface { + // optional + FinishEnumeratingWithError(error foundation.Error) + HasFinishEnumeratingWithError() bool + + // optional + FinishEnumeratingChangesUpToSyncAnchorMoreComing(anchor FileProviderSyncAnchor, moreComing bool) + HasFinishEnumeratingChangesUpToSyncAnchorMoreComing() bool + + // optional + DidUpdateItems(updatedItems []objc.Object) + HasDidUpdateItems() bool + + // optional + DidDeleteItemsWithIdentifiers(deletedItemIdentifiers []FileProviderItemIdentifier) + HasDidDeleteItemsWithIdentifiers() bool + + // optional + SuggestedBatchSize() int + HasSuggestedBatchSize() bool +} + +// A concrete type wrapper for the [PFileProviderChangeObserver] protocol. +type FileProviderChangeObserverWrapper struct { + objc.Object +} + +func (f_ FileProviderChangeObserverWrapper) HasFinishEnumeratingWithError() bool { + return f_.RespondsToSelector(objc.Sel("finishEnumeratingWithError:")) +} + +// Tells the observer that an error occurred during change notification. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderchangeobserver/2879605-finishenumeratingwitherror?language=objc +func (f_ FileProviderChangeObserverWrapper) FinishEnumeratingWithError(error foundation.IError) { + objc.Call[objc.Void](f_, objc.Sel("finishEnumeratingWithError:"), objc.Ptr(error)) +} + +func (f_ FileProviderChangeObserverWrapper) HasFinishEnumeratingChangesUpToSyncAnchorMoreComing() bool { + return f_.RespondsToSelector(objc.Sel("finishEnumeratingChangesUpToSyncAnchor:moreComing:")) +} + +// Tells the observer that all of the changes have been enumerated up to the specified sync anchor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderchangeobserver/2880220-finishenumeratingchangesuptosync?language=objc +func (f_ FileProviderChangeObserverWrapper) FinishEnumeratingChangesUpToSyncAnchorMoreComing(anchor FileProviderSyncAnchor, moreComing bool) { + objc.Call[objc.Void](f_, objc.Sel("finishEnumeratingChangesUpToSyncAnchor:moreComing:"), anchor, moreComing) +} + +func (f_ FileProviderChangeObserverWrapper) HasDidUpdateItems() bool { + return f_.RespondsToSelector(objc.Sel("didUpdateItems:")) +} + +// Tells the observer that the specified items have been updated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderchangeobserver/2879607-didupdateitems?language=objc +func (f_ FileProviderChangeObserverWrapper) DidUpdateItems(updatedItems []objc.IObject) { + objc.Call[objc.Void](f_, objc.Sel("didUpdateItems:"), updatedItems) +} + +func (f_ FileProviderChangeObserverWrapper) HasDidDeleteItemsWithIdentifiers() bool { + return f_.RespondsToSelector(objc.Sel("didDeleteItemsWithIdentifiers:")) +} + +// Tells the observer that the specified items have been deleted. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderchangeobserver/2879604-diddeleteitemswithidentifiers?language=objc +func (f_ FileProviderChangeObserverWrapper) DidDeleteItemsWithIdentifiers(deletedItemIdentifiers []FileProviderItemIdentifier) { + objc.Call[objc.Void](f_, objc.Sel("didDeleteItemsWithIdentifiers:"), deletedItemIdentifiers) +} + +func (f_ FileProviderChangeObserverWrapper) HasSuggestedBatchSize() bool { + return f_.RespondsToSelector(objc.Sel("suggestedBatchSize")) +} + +// The batch size that the system recommends. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderchangeobserver/3656525-suggestedbatchsize?language=objc +func (f_ FileProviderChangeObserverWrapper) SuggestedBatchSize() int { + rv := objc.Call[int](f_, objc.Sel("suggestedBatchSize")) + return rv +} diff --git a/macos/fileprovider/file_provider_custom_action.gen.go b/macos/fileprovider/file_provider_custom_action.gen.go new file mode 100644 index 00000000..cb3462ca --- /dev/null +++ b/macos/fileprovider/file_provider_custom_action.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Support for custom actions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidercustomaction?language=objc +type PFileProviderCustomAction interface { + // optional + PerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler(actionIdentifier FileProviderExtensionActionIdentifier, itemIdentifiers []FileProviderItemIdentifier, completionHandler func(error foundation.Error)) foundation.IProgress + HasPerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler() bool +} + +// A concrete type wrapper for the [PFileProviderCustomAction] protocol. +type FileProviderCustomActionWrapper struct { + objc.Object +} + +func (f_ FileProviderCustomActionWrapper) HasPerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("performActionWithIdentifier:onItemsWithIdentifiers:completionHandler:")) +} + +// Tells the File Provider extension to perform a custom action. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidercustomaction/3553293-performactionwithidentifier?language=objc +func (f_ FileProviderCustomActionWrapper) PerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler(actionIdentifier FileProviderExtensionActionIdentifier, itemIdentifiers []FileProviderItemIdentifier, completionHandler func(error foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("performActionWithIdentifier:onItemsWithIdentifiers:completionHandler:"), actionIdentifier, itemIdentifiers, completionHandler) + return rv +} diff --git a/macos/fileprovider/file_provider_domain.gen.go b/macos/fileprovider/file_provider_domain.gen.go new file mode 100644 index 00000000..d34bf057 --- /dev/null +++ b/macos/fileprovider/file_provider_domain.gen.go @@ -0,0 +1,151 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FileProviderDomain] class. +var FileProviderDomainClass = _FileProviderDomainClass{objc.GetClass("NSFileProviderDomain")} + +type _FileProviderDomainClass struct { + objc.Class +} + +// An interface definition for the [FileProviderDomain] class. +type IFileProviderDomain interface { + objc.IObject + IsHidden() bool + SetHidden(value bool) + UserEnabled() bool + IsDisconnected() bool + TestingModes() FileProviderDomainTestingModes + SetTestingModes(value FileProviderDomainTestingModes) + DisplayName() string + Identifier() FileProviderDomainIdentifier + BackingStoreIdentity() []byte +} + +// A File Provider extension's domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain?language=objc +type FileProviderDomain struct { + objc.Object +} + +func FileProviderDomainFrom(ptr unsafe.Pointer) FileProviderDomain { + return FileProviderDomain{ + Object: objc.ObjectFrom(ptr), + } +} + +func (f_ FileProviderDomain) InitWithIdentifierDisplayName(identifier FileProviderDomainIdentifier, displayName string) FileProviderDomain { + rv := objc.Call[FileProviderDomain](f_, objc.Sel("initWithIdentifier:displayName:"), identifier, displayName) + return rv +} + +// Creates a new file provider domain with the specified identifier and display name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3684871-initwithidentifier?language=objc +func NewFileProviderDomainWithIdentifierDisplayName(identifier FileProviderDomainIdentifier, displayName string) FileProviderDomain { + instance := FileProviderDomainClass.Alloc().InitWithIdentifierDisplayName(identifier, displayName) + instance.Autorelease() + return instance +} + +func (fc _FileProviderDomainClass) Alloc() FileProviderDomain { + rv := objc.Call[FileProviderDomain](fc, objc.Sel("alloc")) + return rv +} + +func FileProviderDomain_Alloc() FileProviderDomain { + return FileProviderDomainClass.Alloc() +} + +func (fc _FileProviderDomainClass) New() FileProviderDomain { + rv := objc.Call[FileProviderDomain](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFileProviderDomain() FileProviderDomain { + return FileProviderDomainClass.New() +} + +func (f_ FileProviderDomain) Init() FileProviderDomain { + rv := objc.Call[FileProviderDomain](f_, objc.Sel("init")) + return rv +} + +// A Boolean value that determines whether the domain is visible to users. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3553283-hidden?language=objc +func (f_ FileProviderDomain) IsHidden() bool { + rv := objc.Call[bool](f_, objc.Sel("isHidden")) + return rv +} + +// A Boolean value that determines whether the domain is visible to users. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3553283-hidden?language=objc +func (f_ FileProviderDomain) SetHidden(value bool) { + objc.Call[objc.Void](f_, objc.Sel("setHidden:"), value) +} + +// A Boolean value that indicates whether the user has enabled or disabled the domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3553284-userenabled?language=objc +func (f_ FileProviderDomain) UserEnabled() bool { + rv := objc.Call[bool](f_, objc.Sel("userEnabled")) + return rv +} + +// A Boolean value indicating that the domain is present, but disconnected from the file extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3294483-disconnected?language=objc +func (f_ FileProviderDomain) IsDisconnected() bool { + rv := objc.Call[bool](f_, objc.Sel("isDisconnected")) + return rv +} + +// A mode that gives the File Provider extension more control over the system’s behavior during testing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3727798-testingmodes?language=objc +func (f_ FileProviderDomain) TestingModes() FileProviderDomainTestingModes { + rv := objc.Call[FileProviderDomainTestingModes](f_, objc.Sel("testingModes")) + return rv +} + +// A mode that gives the File Provider extension more control over the system’s behavior during testing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3727798-testingmodes?language=objc +func (f_ FileProviderDomain) SetTestingModes(value FileProviderDomainTestingModes) { + objc.Call[objc.Void](f_, objc.Sel("setTestingModes:"), value) +} + +// The name of the domain displayed in the user interface. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/2882119-displayname?language=objc +func (f_ FileProviderDomain) DisplayName() string { + rv := objc.Call[string](f_, objc.Sel("displayName")) + return rv +} + +// The domain's unique identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/2882117-identifier?language=objc +func (f_ FileProviderDomain) Identifier() FileProviderDomainIdentifier { + rv := objc.Call[FileProviderDomainIdentifier](f_, objc.Sel("identifier")) + return rv +} + +// A unique identifier for the backing store used by the system. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomain/3852591-backingstoreidentity?language=objc +func (f_ FileProviderDomain) BackingStoreIdentity() []byte { + rv := objc.Call[[]byte](f_, objc.Sel("backingStoreIdentity")) + return rv +} diff --git a/macos/fileprovider/file_provider_domain_state.gen.go b/macos/fileprovider/file_provider_domain_state.gen.go new file mode 100644 index 00000000..3e69db56 --- /dev/null +++ b/macos/fileprovider/file_provider_domain_state.gen.go @@ -0,0 +1,50 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// An object that contains global state data about the domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainstate?language=objc +type PFileProviderDomainState interface { + // optional + UserInfo() foundation.Dictionary + HasUserInfo() bool + + // optional + DomainVersion() IFileProviderDomainVersion + HasDomainVersion() bool +} + +// A concrete type wrapper for the [PFileProviderDomainState] protocol. +type FileProviderDomainStateWrapper struct { + objc.Object +} + +func (f_ FileProviderDomainStateWrapper) HasUserInfo() bool { + return f_.RespondsToSelector(objc.Sel("userInfo")) +} + +// Global state information about the current domain version. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainstate/3727820-userinfo?language=objc +func (f_ FileProviderDomainStateWrapper) UserInfo() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](f_, objc.Sel("userInfo")) + return rv +} + +func (f_ FileProviderDomainStateWrapper) HasDomainVersion() bool { + return f_.RespondsToSelector(objc.Sel("domainVersion")) +} + +// An opaque object that uniquely identifies the domain’s version. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainstate/3727819-domainversion?language=objc +func (f_ FileProviderDomainStateWrapper) DomainVersion() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("domainVersion")) + return rv +} diff --git a/macos/fileprovider/file_provider_domain_version.gen.go b/macos/fileprovider/file_provider_domain_version.gen.go new file mode 100644 index 00000000..0700637d --- /dev/null +++ b/macos/fileprovider/file_provider_domain_version.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FileProviderDomainVersion] class. +var FileProviderDomainVersionClass = _FileProviderDomainVersionClass{objc.GetClass("NSFileProviderDomainVersion")} + +type _FileProviderDomainVersionClass struct { + objc.Class +} + +// An interface definition for the [FileProviderDomainVersion] class. +type IFileProviderDomainVersion interface { + objc.IObject + Next() FileProviderDomainVersion + Compare(otherVersion IFileProviderDomainVersion) foundation.ComparisonResult +} + +// An opaque object that identifies a specific version of a domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainversion?language=objc +type FileProviderDomainVersion struct { + objc.Object +} + +func FileProviderDomainVersionFrom(ptr unsafe.Pointer) FileProviderDomainVersion { + return FileProviderDomainVersion{ + Object: objc.ObjectFrom(ptr), + } +} + +func (fc _FileProviderDomainVersionClass) Alloc() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](fc, objc.Sel("alloc")) + return rv +} + +func FileProviderDomainVersion_Alloc() FileProviderDomainVersion { + return FileProviderDomainVersionClass.Alloc() +} + +func (fc _FileProviderDomainVersionClass) New() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFileProviderDomainVersion() FileProviderDomainVersion { + return FileProviderDomainVersionClass.New() +} + +func (f_ FileProviderDomainVersion) Init() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("init")) + return rv +} + +// Creates a new version that supersedes the current version. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainversion/3727804-next?language=objc +func (f_ FileProviderDomainVersion) Next() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("next")) + return rv +} + +// Compares another domain version with this one. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderdomainversion/3727803-compare?language=objc +func (f_ FileProviderDomainVersion) Compare(otherVersion IFileProviderDomainVersion) foundation.ComparisonResult { + rv := objc.Call[foundation.ComparisonResult](f_, objc.Sel("compare:"), objc.Ptr(otherVersion)) + return rv +} diff --git a/macos/fileprovider/file_provider_enumerating.gen.go b/macos/fileprovider/file_provider_enumerating.gen.go new file mode 100644 index 00000000..d246affa --- /dev/null +++ b/macos/fileprovider/file_provider_enumerating.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Support for enumerating the file provider’s contents. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerating?language=objc +type PFileProviderEnumerating interface { + // optional + EnumeratorForContainerItemIdentifierRequestError(containerItemIdentifier FileProviderItemIdentifier, request FileProviderRequest, error foundation.Error) PFileProviderEnumerator + HasEnumeratorForContainerItemIdentifierRequestError() bool +} + +// A concrete type wrapper for the [PFileProviderEnumerating] protocol. +type FileProviderEnumeratingWrapper struct { + objc.Object +} + +func (f_ FileProviderEnumeratingWrapper) HasEnumeratorForContainerItemIdentifierRequestError() bool { + return f_.RespondsToSelector(objc.Sel("enumeratorForContainerItemIdentifier:request:error:")) +} + +// Tells the file provider to return an enumerator for the provided directory. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerating/3553295-enumeratorforcontaineritemidenti?language=objc +func (f_ FileProviderEnumeratingWrapper) EnumeratorForContainerItemIdentifierRequestError(containerItemIdentifier FileProviderItemIdentifier, request IFileProviderRequest, error foundation.IError) FileProviderEnumeratorWrapper { + rv := objc.Call[FileProviderEnumeratorWrapper](f_, objc.Sel("enumeratorForContainerItemIdentifier:request:error:"), containerItemIdentifier, objc.Ptr(request), objc.Ptr(error)) + return rv +} diff --git a/macos/fileprovider/file_provider_enumeration_observer.gen.go b/macos/fileprovider/file_provider_enumeration_observer.gen.go new file mode 100644 index 00000000..e20fcbcc --- /dev/null +++ b/macos/fileprovider/file_provider_enumeration_observer.gen.go @@ -0,0 +1,79 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// An observer that receives batches of items during enumeration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerationobserver?language=objc +type PFileProviderEnumerationObserver interface { + // optional + FinishEnumeratingWithError(error foundation.Error) + HasFinishEnumeratingWithError() bool + + // optional + DidEnumerateItems(updatedItems []objc.Object) + HasDidEnumerateItems() bool + + // optional + FinishEnumeratingUpToPage(nextPage FileProviderPage) + HasFinishEnumeratingUpToPage() bool + + // optional + SuggestedPageSize() int + HasSuggestedPageSize() bool +} + +// A concrete type wrapper for the [PFileProviderEnumerationObserver] protocol. +type FileProviderEnumerationObserverWrapper struct { + objc.Object +} + +func (f_ FileProviderEnumerationObserverWrapper) HasFinishEnumeratingWithError() bool { + return f_.RespondsToSelector(objc.Sel("finishEnumeratingWithError:")) +} + +// Tells the observer that an error occurred during item enumeration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerationobserver/2879612-finishenumeratingwitherror?language=objc +func (f_ FileProviderEnumerationObserverWrapper) FinishEnumeratingWithError(error foundation.IError) { + objc.Call[objc.Void](f_, objc.Sel("finishEnumeratingWithError:"), objc.Ptr(error)) +} + +func (f_ FileProviderEnumerationObserverWrapper) HasDidEnumerateItems() bool { + return f_.RespondsToSelector(objc.Sel("didEnumerateItems:")) +} + +// Provides a batch of enumerated items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerationobserver/2879615-didenumerateitems?language=objc +func (f_ FileProviderEnumerationObserverWrapper) DidEnumerateItems(updatedItems []objc.IObject) { + objc.Call[objc.Void](f_, objc.Sel("didEnumerateItems:"), updatedItems) +} + +func (f_ FileProviderEnumerationObserverWrapper) HasFinishEnumeratingUpToPage() bool { + return f_.RespondsToSelector(objc.Sel("finishEnumeratingUpToPage:")) +} + +// Tells the observer that all of the items have been enumerated up to the specified page. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerationobserver/2879602-finishenumeratinguptopage?language=objc +func (f_ FileProviderEnumerationObserverWrapper) FinishEnumeratingUpToPage(nextPage FileProviderPage) { + objc.Call[objc.Void](f_, objc.Sel("finishEnumeratingUpToPage:"), nextPage) +} + +func (f_ FileProviderEnumerationObserverWrapper) HasSuggestedPageSize() bool { + return f_.RespondsToSelector(objc.Sel("suggestedPageSize")) +} + +// The page size that the system recommends. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerationobserver/3656526-suggestedpagesize?language=objc +func (f_ FileProviderEnumerationObserverWrapper) SuggestedPageSize() int { + rv := objc.Call[int](f_, objc.Sel("suggestedPageSize")) + return rv +} diff --git a/macos/fileprovider/file_provider_enumerator.gen.go b/macos/fileprovider/file_provider_enumerator.gen.go new file mode 100644 index 00000000..b3562a93 --- /dev/null +++ b/macos/fileprovider/file_provider_enumerator.gen.go @@ -0,0 +1,79 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol for enumerating items and changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerator?language=objc +type PFileProviderEnumerator interface { + // optional + EnumerateChangesForObserverFromSyncAnchor(observer FileProviderChangeObserverWrapper, syncAnchor FileProviderSyncAnchor) + HasEnumerateChangesForObserverFromSyncAnchor() bool + + // optional + EnumerateItemsForObserverStartingAtPage(observer FileProviderEnumerationObserverWrapper, page FileProviderPage) + HasEnumerateItemsForObserverStartingAtPage() bool + + // optional + CurrentSyncAnchorWithCompletionHandler(completionHandler func(currentAnchor FileProviderSyncAnchor)) + HasCurrentSyncAnchorWithCompletionHandler() bool + + // optional + Invalidate() + HasInvalidate() bool +} + +// A concrete type wrapper for the [PFileProviderEnumerator] protocol. +type FileProviderEnumeratorWrapper struct { + objc.Object +} + +func (f_ FileProviderEnumeratorWrapper) HasEnumerateChangesForObserverFromSyncAnchor() bool { + return f_.RespondsToSelector(objc.Sel("enumerateChangesForObserver:fromSyncAnchor:")) +} + +// Requests the next batch of changes after the specified sync anchor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerator/2879608-enumeratechangesforobserver?language=objc +func (f_ FileProviderEnumeratorWrapper) EnumerateChangesForObserverFromSyncAnchor(observer PFileProviderChangeObserver, syncAnchor FileProviderSyncAnchor) { + po0 := objc.WrapAsProtocol("NSFileProviderChangeObserver", observer) + objc.Call[objc.Void](f_, objc.Sel("enumerateChangesForObserver:fromSyncAnchor:"), po0, syncAnchor) +} + +func (f_ FileProviderEnumeratorWrapper) HasEnumerateItemsForObserverStartingAtPage() bool { + return f_.RespondsToSelector(objc.Sel("enumerateItemsForObserver:startingAtPage:")) +} + +// Requests the next batch of items, starting at the specified page. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerator/2879613-enumerateitemsforobserver?language=objc +func (f_ FileProviderEnumeratorWrapper) EnumerateItemsForObserverStartingAtPage(observer PFileProviderEnumerationObserver, page FileProviderPage) { + po0 := objc.WrapAsProtocol("NSFileProviderEnumerationObserver", observer) + objc.Call[objc.Void](f_, objc.Sel("enumerateItemsForObserver:startingAtPage:"), po0, page) +} + +func (f_ FileProviderEnumeratorWrapper) HasCurrentSyncAnchorWithCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("currentSyncAnchorWithCompletionHandler:")) +} + +// Returns the current sync anchor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerator/2890930-currentsyncanchorwithcompletionh?language=objc +func (f_ FileProviderEnumeratorWrapper) CurrentSyncAnchorWithCompletionHandler(completionHandler func(currentAnchor FileProviderSyncAnchor)) { + objc.Call[objc.Void](f_, objc.Sel("currentSyncAnchorWithCompletionHandler:"), completionHandler) +} + +func (f_ FileProviderEnumeratorWrapper) HasInvalidate() bool { + return f_.RespondsToSelector(objc.Sel("invalidate")) +} + +// Stops the enumeration of items and changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderenumerator/2879609-invalidate?language=objc +func (f_ FileProviderEnumeratorWrapper) Invalidate() { + objc.Call[objc.Void](f_, objc.Sel("invalidate")) +} diff --git a/macos/fileprovider/file_provider_incremental_content_fetching.gen.go b/macos/fileprovider/file_provider_incremental_content_fetching.gen.go new file mode 100644 index 00000000..d6ed056d --- /dev/null +++ b/macos/fileprovider/file_provider_incremental_content_fetching.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Support for fetching changes to the item’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderincrementalcontentfetching?language=objc +type PFileProviderIncrementalContentFetching interface { + // optional + FetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler(itemIdentifier FileProviderItemIdentifier, requestedVersion FileProviderItemVersion, existingContents foundation.URL, existingVersion FileProviderItemVersion, request FileProviderRequest, completionHandler func(fileContents foundation.URL, item objc.Object, error foundation.Error)) foundation.IProgress + HasFetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler() bool +} + +// A concrete type wrapper for the [PFileProviderIncrementalContentFetching] protocol. +type FileProviderIncrementalContentFetchingWrapper struct { + objc.Object +} + +func (f_ FileProviderIncrementalContentFetchingWrapper) HasFetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("fetchContentsForItemWithIdentifier:version:usingExistingContentsAtURL:existingVersion:request:completionHandler:")) +} + +// Asks the file provider for an update of the specified item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderincrementalcontentfetching/3553297-fetchcontentsforitemwithidentifi?language=objc +func (f_ FileProviderIncrementalContentFetchingWrapper) FetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler(itemIdentifier FileProviderItemIdentifier, requestedVersion IFileProviderItemVersion, existingContents foundation.IURL, existingVersion IFileProviderItemVersion, request IFileProviderRequest, completionHandler func(fileContents foundation.URL, item objc.Object, error foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("fetchContentsForItemWithIdentifier:version:usingExistingContentsAtURL:existingVersion:request:completionHandler:"), itemIdentifier, objc.Ptr(requestedVersion), objc.Ptr(existingContents), objc.Ptr(existingVersion), objc.Ptr(request), completionHandler) + return rv +} diff --git a/macos/fileprovider/file_provider_item_decorating.gen.go b/macos/fileprovider/file_provider_item_decorating.gen.go new file mode 100644 index 00000000..5f0b72ee --- /dev/null +++ b/macos/fileprovider/file_provider_item_decorating.gen.go @@ -0,0 +1,33 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// Support for decorating items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorating?language=objc +type PFileProviderItemDecorating interface { + // optional + Decorations() []FileProviderItemDecorationIdentifier + HasDecorations() bool +} + +// A concrete type wrapper for the [PFileProviderItemDecorating] protocol. +type FileProviderItemDecoratingWrapper struct { + objc.Object +} + +func (f_ FileProviderItemDecoratingWrapper) HasDecorations() bool { + return f_.RespondsToSelector(objc.Sel("decorations")) +} + +// Asks the item for an array of decorations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorating/3172722-decorations?language=objc +func (f_ FileProviderItemDecoratingWrapper) Decorations() []FileProviderItemDecorationIdentifier { + rv := objc.Call[[]FileProviderItemDecorationIdentifier](f_, objc.Sel("decorations")) + return rv +} diff --git a/macos/fileprovider/file_provider_item_version.gen.go b/macos/fileprovider/file_provider_item_version.gen.go new file mode 100644 index 00000000..02b0c4b1 --- /dev/null +++ b/macos/fileprovider/file_provider_item_version.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FileProviderItemVersion] class. +var FileProviderItemVersionClass = _FileProviderItemVersionClass{objc.GetClass("NSFileProviderItemVersion")} + +type _FileProviderItemVersionClass struct { + objc.Class +} + +// An interface definition for the [FileProviderItemVersion] class. +type IFileProviderItemVersion interface { + objc.IObject + MetadataVersion() []byte + ContentVersion() []byte +} + +// The version of the item’s content and its metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemversion?language=objc +type FileProviderItemVersion struct { + objc.Object +} + +func FileProviderItemVersionFrom(ptr unsafe.Pointer) FileProviderItemVersion { + return FileProviderItemVersion{ + Object: objc.ObjectFrom(ptr), + } +} + +func (f_ FileProviderItemVersion) InitWithContentVersionMetadataVersion(contentVersion []byte, metadataVersion []byte) FileProviderItemVersion { + rv := objc.Call[FileProviderItemVersion](f_, objc.Sel("initWithContentVersion:metadataVersion:"), contentVersion, metadataVersion) + return rv +} + +// Creates a new version object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemversion/3043899-initwithcontentversion?language=objc +func NewFileProviderItemVersionWithContentVersionMetadataVersion(contentVersion []byte, metadataVersion []byte) FileProviderItemVersion { + instance := FileProviderItemVersionClass.Alloc().InitWithContentVersionMetadataVersion(contentVersion, metadataVersion) + instance.Autorelease() + return instance +} + +func (fc _FileProviderItemVersionClass) Alloc() FileProviderItemVersion { + rv := objc.Call[FileProviderItemVersion](fc, objc.Sel("alloc")) + return rv +} + +func FileProviderItemVersion_Alloc() FileProviderItemVersion { + return FileProviderItemVersionClass.Alloc() +} + +func (fc _FileProviderItemVersionClass) New() FileProviderItemVersion { + rv := objc.Call[FileProviderItemVersion](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFileProviderItemVersion() FileProviderItemVersion { + return FileProviderItemVersionClass.New() +} + +func (f_ FileProviderItemVersion) Init() FileProviderItemVersion { + rv := objc.Call[FileProviderItemVersion](f_, objc.Sel("init")) + return rv +} + +// An opaque object used to track versions of the item’s metadata. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemversion/3043900-metadataversion?language=objc +func (f_ FileProviderItemVersion) MetadataVersion() []byte { + rv := objc.Call[[]byte](f_, objc.Sel("metadataVersion")) + return rv +} + +// A Boolean value indicating that this version predates the version returned by the file provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemversion/3869739-beforefirstsynccomponent?language=objc +func (fc _FileProviderItemVersionClass) BeforeFirstSyncComponent() []byte { + rv := objc.Call[[]byte](fc, objc.Sel("beforeFirstSyncComponent")) + return rv +} + +// A Boolean value indicating that this version predates the version returned by the file provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemversion/3869739-beforefirstsynccomponent?language=objc +func FileProviderItemVersion_BeforeFirstSyncComponent() []byte { + return FileProviderItemVersionClass.BeforeFirstSyncComponent() +} + +// An opaque object used to track versions of the item’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideritemversion/3043898-contentversion?language=objc +func (f_ FileProviderItemVersion) ContentVersion() []byte { + rv := objc.Call[[]byte](f_, objc.Sel("contentVersion")) + return rv +} diff --git a/macos/fileprovider/file_provider_manager.gen.go b/macos/fileprovider/file_provider_manager.gen.go new file mode 100644 index 00000000..8ff64349 --- /dev/null +++ b/macos/fileprovider/file_provider_manager.gen.go @@ -0,0 +1,289 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FileProviderManager] class. +var FileProviderManagerClass = _FileProviderManagerClass{objc.GetClass("NSFileProviderManager")} + +type _FileProviderManagerClass struct { + objc.Class +} + +// An interface definition for the [FileProviderManager] class. +type IFileProviderManager interface { + objc.IObject + ReimportItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(error foundation.Error)) + SignalErrorResolvedCompletionHandler(error foundation.IError, completionHandler func(error foundation.Error)) + WaitForStabilizationWithCompletionHandler(completionHandler func(error foundation.Error)) + EvictItemWithIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(error foundation.Error)) + RegisterURLSessionTaskForItemWithIdentifierCompletionHandler(task foundation.IURLSessionTask, identifier FileProviderItemIdentifier, completion func(error foundation.Error)) + DisconnectWithReasonOptionsCompletionHandler(localizedReason string, options FileProviderManagerDisconnectionOptions, completionHandler func(error foundation.Error)) + SignalEnumeratorForContainerItemIdentifierCompletionHandler(containerItemIdentifier FileProviderItemIdentifier, completion func(error foundation.Error)) + ListAvailableTestingOperationsWithError(error foundation.IError) []FileProviderTestingOperationWrapper + WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(error foundation.Error)) + GlobalProgressForKind(kind foundation.ProgressFileOperationKind) foundation.Progress + EnumeratorForMaterializedItems() FileProviderEnumeratorWrapper + GetUserVisibleURLForItemIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(userVisibleFile foundation.URL, error foundation.Error)) + ReconnectWithCompletionHandler(completionHandler func(error foundation.Error)) + TemporaryDirectoryURLWithError(error foundation.IError) foundation.URL + RunTestingOperationsError(operations []PFileProviderTestingOperation, error foundation.IError) foundation.Dictionary + EnumeratorForPendingItems() FileProviderPendingSetEnumeratorWrapper +} + +// A manager object that you use to communicate with the file provider from either your app or your File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager?language=objc +type FileProviderManager struct { + objc.Object +} + +func FileProviderManagerFrom(ptr unsafe.Pointer) FileProviderManager { + return FileProviderManager{ + Object: objc.ObjectFrom(ptr), + } +} + +func (fc _FileProviderManagerClass) ManagerForDomain(domain IFileProviderDomain) FileProviderManager { + rv := objc.Call[FileProviderManager](fc, objc.Sel("managerForDomain:"), objc.Ptr(domain)) + return rv +} + +// Returns a newly created file provider manager for the specified domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2882047-managerfordomain?language=objc +func FileProviderManager_ManagerForDomain(domain IFileProviderDomain) FileProviderManager { + return FileProviderManagerClass.ManagerForDomain(domain) +} + +func (fc _FileProviderManagerClass) Alloc() FileProviderManager { + rv := objc.Call[FileProviderManager](fc, objc.Sel("alloc")) + return rv +} + +func FileProviderManager_Alloc() FileProviderManager { + return FileProviderManagerClass.Alloc() +} + +func (fc _FileProviderManagerClass) New() FileProviderManager { + rv := objc.Call[FileProviderManager](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFileProviderManager() FileProviderManager { + return FileProviderManagerClass.New() +} + +func (f_ FileProviderManager) Init() FileProviderManager { + rv := objc.Call[FileProviderManager](f_, objc.Sel("init")) + return rv +} + +// Tells the system to reimport the item and its content recursively. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3181165-reimportitemsbelowitemwithidenti?language=objc +func (f_ FileProviderManager) ReimportItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("reimportItemsBelowItemWithIdentifier:completionHandler:"), itemIdentifier, completionHandler) +} + +// Indicates a resolved error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3656534-signalerrorresolved?language=objc +func (f_ FileProviderManager) SignalErrorResolvedCompletionHandler(error foundation.IError, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("signalErrorResolved:completionHandler:"), objc.Ptr(error), completionHandler) +} + +// Requests a notification after the domain stabilizes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3567073-waitforstabilizationwithcompleti?language=objc +func (f_ FileProviderManager) WaitForStabilizationWithCompletionHandler(completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("waitForStabilizationWithCompletionHandler:"), completionHandler) +} + +// Returns all of the File Provider extension's domains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2882045-getdomainswithcompletionhandler?language=objc +func (fc _FileProviderManagerClass) GetDomainsWithCompletionHandler(completionHandler func(domains []FileProviderDomain, error foundation.Error)) { + objc.Call[objc.Void](fc, objc.Sel("getDomainsWithCompletionHandler:"), completionHandler) +} + +// Returns all of the File Provider extension's domains. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2882045-getdomainswithcompletionhandler?language=objc +func FileProviderManager_GetDomainsWithCompletionHandler(completionHandler func(domains []FileProviderDomain, error foundation.Error)) { + FileProviderManagerClass.GetDomainsWithCompletionHandler(completionHandler) +} + +// Removes all domains from the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2882044-removealldomainswithcompletionha?language=objc +func (fc _FileProviderManagerClass) RemoveAllDomainsWithCompletionHandler(completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](fc, objc.Sel("removeAllDomainsWithCompletionHandler:"), completionHandler) +} + +// Removes all domains from the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2882044-removealldomainswithcompletionha?language=objc +func FileProviderManager_RemoveAllDomainsWithCompletionHandler(completionHandler func(error foundation.Error)) { + FileProviderManagerClass.RemoveAllDomainsWithCompletionHandler(completionHandler) +} + +// Asks the system to remove an item from its cache. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3191974-evictitemwithidentifier?language=objc +func (f_ FileProviderManager) EvictItemWithIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("evictItemWithIdentifier:completionHandler:"), itemIdentifier, completionHandler) +} + +// Registers the URL session task responsible for the specified item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2890932-registerurlsessiontask?language=objc +func (f_ FileProviderManager) RegisterURLSessionTaskForItemWithIdentifierCompletionHandler(task foundation.IURLSessionTask, identifier FileProviderItemIdentifier, completion func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("registerURLSessionTask:forItemWithIdentifier:completionHandler:"), objc.Ptr(task), identifier, completion) +} + +// Disconnects the domain from the extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3603576-disconnectwithreason?language=objc +func (f_ FileProviderManager) DisconnectWithReasonOptionsCompletionHandler(localizedReason string, options FileProviderManagerDisconnectionOptions, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("disconnectWithReason:options:completionHandler:"), localizedReason, options, completionHandler) +} + +// Alerts the system to changes in the specified folder’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2890931-signalenumeratorforcontaineritem?language=objc +func (f_ FileProviderManager) SignalEnumeratorForContainerItemIdentifierCompletionHandler(containerItemIdentifier FileProviderItemIdentifier, completion func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("signalEnumeratorForContainerItemIdentifier:completionHandler:"), containerItemIdentifier, completion) +} + +// Lists all the operations that are ready for scheduling. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3727823-listavailabletestingoperationswi?language=objc +func (f_ FileProviderManager) ListAvailableTestingOperationsWithError(error foundation.IError) []FileProviderTestingOperationWrapper { + rv := objc.Call[[]FileProviderTestingOperationWrapper](f_, objc.Sel("listAvailableTestingOperationsWithError:"), objc.Ptr(error)) + return rv +} + +// Requests a notification after the system completes all the specified changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3585198-waitforchangesonitemsbelowitemwi?language=objc +func (f_ FileProviderManager) WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("waitForChangesOnItemsBelowItemWithIdentifier:completionHandler:"), itemIdentifier, completionHandler) +} + +// Returns a progress object that tracks either the uploading or downloading of items from the File Provider extension’s remote storage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3731236-globalprogressforkind?language=objc +func (f_ FileProviderManager) GlobalProgressForKind(kind foundation.ProgressFileOperationKind) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("globalProgressForKind:"), kind) + return rv +} + +// Adds a domain to the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2890934-adddomain?language=objc +func (fc _FileProviderManagerClass) AddDomainCompletionHandler(domain IFileProviderDomain, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](fc, objc.Sel("addDomain:completionHandler:"), objc.Ptr(domain), completionHandler) +} + +// Adds a domain to the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2890934-adddomain?language=objc +func FileProviderManager_AddDomainCompletionHandler(domain IFileProviderDomain, completionHandler func(error foundation.Error)) { + FileProviderManagerClass.AddDomainCompletionHandler(domain, completionHandler) +} + +// Returns the identifier and domain for a user-visible URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3074519-getidentifierforuservisiblefilea?language=objc +func (fc _FileProviderManagerClass) GetIdentifierForUserVisibleFileAtURLCompletionHandler(url foundation.IURL, completionHandler func(itemIdentifier FileProviderItemIdentifier, domainIdentifier FileProviderDomainIdentifier, error foundation.Error)) { + objc.Call[objc.Void](fc, objc.Sel("getIdentifierForUserVisibleFileAtURL:completionHandler:"), objc.Ptr(url), completionHandler) +} + +// Returns the identifier and domain for a user-visible URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3074519-getidentifierforuservisiblefilea?language=objc +func FileProviderManager_GetIdentifierForUserVisibleFileAtURLCompletionHandler(url foundation.IURL, completionHandler func(itemIdentifier FileProviderItemIdentifier, domainIdentifier FileProviderDomainIdentifier, error foundation.Error)) { + FileProviderManagerClass.GetIdentifierForUserVisibleFileAtURLCompletionHandler(url, completionHandler) +} + +// Returns an enumerator for all the items the system currently stores on disk. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3181167-enumeratorformaterializeditems?language=objc +func (f_ FileProviderManager) EnumeratorForMaterializedItems() FileProviderEnumeratorWrapper { + rv := objc.Call[FileProviderEnumeratorWrapper](f_, objc.Sel("enumeratorForMaterializedItems")) + return rv +} + +// Creates a new domain that takes ownership of on-disk data that your app previously managed without a file provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3181164-importdomain?language=objc +func (fc _FileProviderManagerClass) ImportDomainFromDirectoryAtURLCompletionHandler(domain IFileProviderDomain, url foundation.IURL, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](fc, objc.Sel("importDomain:fromDirectoryAtURL:completionHandler:"), objc.Ptr(domain), objc.Ptr(url), completionHandler) +} + +// Creates a new domain that takes ownership of on-disk data that your app previously managed without a file provider. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3181164-importdomain?language=objc +func FileProviderManager_ImportDomainFromDirectoryAtURLCompletionHandler(domain IFileProviderDomain, url foundation.IURL, completionHandler func(error foundation.Error)) { + FileProviderManagerClass.ImportDomainFromDirectoryAtURLCompletionHandler(domain, url, completionHandler) +} + +// Returns the user-visible URL for an item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3074520-getuservisibleurlforitemidentifi?language=objc +func (f_ FileProviderManager) GetUserVisibleURLForItemIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(userVisibleFile foundation.URL, error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("getUserVisibleURLForItemIdentifier:completionHandler:"), itemIdentifier, completionHandler) +} + +// Reconnects the domain with the extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3603577-reconnectwithcompletionhandler?language=objc +func (f_ FileProviderManager) ReconnectWithCompletionHandler(completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](f_, objc.Sel("reconnectWithCompletionHandler:"), completionHandler) +} + +// Removes a domain from the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2890933-removedomain?language=objc +func (fc _FileProviderManagerClass) RemoveDomainCompletionHandler(domain IFileProviderDomain, completionHandler func(error foundation.Error)) { + objc.Call[objc.Void](fc, objc.Sel("removeDomain:completionHandler:"), objc.Ptr(domain), completionHandler) +} + +// Removes a domain from the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/2890933-removedomain?language=objc +func FileProviderManager_RemoveDomainCompletionHandler(domain IFileProviderDomain, completionHandler func(error foundation.Error)) { + FileProviderManagerClass.RemoveDomainCompletionHandler(domain, completionHandler) +} + +// Returns the URL of a directory that the File Provider extension can use to temporarily store files before passing them to the system. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3656535-temporarydirectoryurlwitherror?language=objc +func (f_ FileProviderManager) TemporaryDirectoryURLWithError(error foundation.IError) foundation.URL { + rv := objc.Call[foundation.URL](f_, objc.Sel("temporaryDirectoryURLWithError:"), objc.Ptr(error)) + return rv +} + +// Asks the system to schedule and execute the specified operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3727824-runtestingoperations?language=objc +func (f_ FileProviderManager) RunTestingOperationsError(operations []PFileProviderTestingOperation, error foundation.IError) foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](f_, objc.Sel("runTestingOperations:error:"), operations, objc.Ptr(error)) + return rv +} + +// Returns an enumerator for the set of pending items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3727809-enumeratorforpendingitems?language=objc +func (f_ FileProviderManager) EnumeratorForPendingItems() FileProviderPendingSetEnumeratorWrapper { + rv := objc.Call[FileProviderPendingSetEnumeratorWrapper](f_, objc.Sel("enumeratorForPendingItems")) + return rv +} diff --git a/macos/fileprovider/file_provider_partial_content_fetching.gen.go b/macos/fileprovider/file_provider_partial_content_fetching.gen.go new file mode 100644 index 00000000..d710712c --- /dev/null +++ b/macos/fileprovider/file_provider_partial_content_fetching.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Support for fetching part of a file’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderpartialcontentfetching?language=objc +type PFileProviderPartialContentFetching interface { + // optional + FetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler(itemIdentifier FileProviderItemIdentifier, requestedVersion FileProviderItemVersion, request FileProviderRequest, requestedRange foundation.Range, alignment uint, options FileProviderFetchContentsOptions, completionHandler func(fileContents foundation.URL, item objc.Object, retrievedRange foundation.Range, flags FileProviderMaterializationFlags, error foundation.Error)) foundation.IProgress + HasFetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler() bool +} + +// A concrete type wrapper for the [PFileProviderPartialContentFetching] protocol. +type FileProviderPartialContentFetchingWrapper struct { + objc.Object +} + +func (f_ FileProviderPartialContentFetchingWrapper) HasFetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("fetchPartialContentsForItemWithIdentifier:version:request:minimalRange:aligningTo:options:completionHandler:")) +} + +// Tells the file provider to download the requested item from remote storage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderpartialcontentfetching/3923718-fetchpartialcontentsforitemwithi?language=objc +func (f_ FileProviderPartialContentFetchingWrapper) FetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler(itemIdentifier FileProviderItemIdentifier, requestedVersion IFileProviderItemVersion, request IFileProviderRequest, requestedRange foundation.Range, alignment uint, options FileProviderFetchContentsOptions, completionHandler func(fileContents foundation.URL, item objc.Object, retrievedRange foundation.Range, flags FileProviderMaterializationFlags, error foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("fetchPartialContentsForItemWithIdentifier:version:request:minimalRange:aligningTo:options:completionHandler:"), itemIdentifier, objc.Ptr(requestedVersion), objc.Ptr(request), requestedRange, alignment, options, completionHandler) + return rv +} diff --git a/macos/fileprovider/file_provider_pending_set_enumerator.gen.go b/macos/fileprovider/file_provider_pending_set_enumerator.gen.go new file mode 100644 index 00000000..694561dc --- /dev/null +++ b/macos/fileprovider/file_provider_pending_set_enumerator.gen.go @@ -0,0 +1,50 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A protocol for enumerating pending items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderpendingsetenumerator?language=objc +type PFileProviderPendingSetEnumerator interface { + // optional + DomainVersion() IFileProviderDomainVersion + HasDomainVersion() bool + + // optional + RefreshInterval() foundation.TimeInterval + HasRefreshInterval() bool +} + +// A concrete type wrapper for the [PFileProviderPendingSetEnumerator] protocol. +type FileProviderPendingSetEnumeratorWrapper struct { + objc.Object +} + +func (f_ FileProviderPendingSetEnumeratorWrapper) HasDomainVersion() bool { + return f_.RespondsToSelector(objc.Sel("domainVersion")) +} + +// The domain version when the system last refreshed the pending set. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderpendingsetenumerator/3727815-domainversion?language=objc +func (f_ FileProviderPendingSetEnumeratorWrapper) DomainVersion() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("domainVersion")) + return rv +} + +func (f_ FileProviderPendingSetEnumeratorWrapper) HasRefreshInterval() bool { + return f_.RespondsToSelector(objc.Sel("refreshInterval")) +} + +// The amount of time, in seconds, between updates to the pending set. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderpendingsetenumerator/3727816-refreshinterval?language=objc +func (f_ FileProviderPendingSetEnumeratorWrapper) RefreshInterval() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](f_, objc.Sel("refreshInterval")) + return rv +} diff --git a/macos/fileprovider/file_provider_replicated_extension.gen.go b/macos/fileprovider/file_provider_replicated_extension.gen.go new file mode 100644 index 00000000..243c63cf --- /dev/null +++ b/macos/fileprovider/file_provider_replicated_extension.gen.go @@ -0,0 +1,174 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A File Provider extension in which the system replicates the contents on disk. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension?language=objc +type PFileProviderReplicatedExtension interface { + // optional + CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler(itemTemplate objc.Object, fields FileProviderItemFields, url foundation.URL, options FileProviderCreateItemOptions, request FileProviderRequest, completionHandler func(createdItem objc.Object, stillPendingFields FileProviderItemFields, shouldFetchContent bool, error foundation.Error)) foundation.IProgress + HasCreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler() bool + + // optional + ImportDidFinishWithCompletionHandler(completionHandler func()) + HasImportDidFinishWithCompletionHandler() bool + + // optional + MaterializedItemsDidChangeWithCompletionHandler(completionHandler func()) + HasMaterializedItemsDidChangeWithCompletionHandler() bool + + // optional + DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler(identifier FileProviderItemIdentifier, version FileProviderItemVersion, options FileProviderDeleteItemOptions, request FileProviderRequest, completionHandler func(arg0 foundation.Error)) foundation.IProgress + HasDeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler() bool + + // optional + ItemForIdentifierRequestCompletionHandler(identifier FileProviderItemIdentifier, request FileProviderRequest, completionHandler func(arg0 objc.Object, arg1 foundation.Error)) foundation.IProgress + HasItemForIdentifierRequestCompletionHandler() bool + + // optional + InitWithDomain(domain FileProviderDomain) objc.IObject + HasInitWithDomain() bool + + // optional + PendingItemsDidChangeWithCompletionHandler(completionHandler func()) + HasPendingItemsDidChangeWithCompletionHandler() bool + + // optional + Invalidate() + HasInvalidate() bool + + // optional + ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler(item objc.Object, version FileProviderItemVersion, changedFields FileProviderItemFields, newContents foundation.URL, options FileProviderModifyItemOptions, request FileProviderRequest, completionHandler func(item objc.Object, stillPendingFields FileProviderItemFields, shouldFetchContent bool, error foundation.Error)) foundation.IProgress + HasModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler() bool + + // optional + FetchContentsForItemWithIdentifierVersionRequestCompletionHandler(itemIdentifier FileProviderItemIdentifier, requestedVersion FileProviderItemVersion, request FileProviderRequest, completionHandler func(fileContents foundation.URL, item objc.Object, error foundation.Error)) foundation.IProgress + HasFetchContentsForItemWithIdentifierVersionRequestCompletionHandler() bool +} + +// A concrete type wrapper for the [PFileProviderReplicatedExtension] protocol. +type FileProviderReplicatedExtensionWrapper struct { + objc.Object +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasCreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("createItemBasedOnTemplate:fields:contents:options:request:completionHandler:")) +} + +// Tells the file provider to create or import an item based on a template. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3656549-createitembasedontemplate?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler(itemTemplate objc.IObject, fields FileProviderItemFields, url foundation.IURL, options FileProviderCreateItemOptions, request IFileProviderRequest, completionHandler func(createdItem objc.Object, stillPendingFields FileProviderItemFields, shouldFetchContent bool, error foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("createItemBasedOnTemplate:fields:contents:options:request:completionHandler:"), objc.Ptr(itemTemplate), fields, objc.Ptr(url), options, objc.Ptr(request), completionHandler) + return rv +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasImportDidFinishWithCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("importDidFinishWithCompletionHandler:")) +} + +// Tells the File Provider extension that the system finished importing items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3553304-importdidfinishwithcompletionhan?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) ImportDidFinishWithCompletionHandler(completionHandler func()) { + objc.Call[objc.Void](f_, objc.Sel("importDidFinishWithCompletionHandler:"), completionHandler) +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasMaterializedItemsDidChangeWithCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("materializedItemsDidChangeWithCompletionHandler:")) +} + +// Tells the file provider that the set of materialized items changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3553308-materializeditemsdidchangewithco?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) MaterializedItemsDidChangeWithCompletionHandler(completionHandler func()) { + objc.Call[objc.Void](f_, objc.Sel("materializedItemsDidChangeWithCompletionHandler:"), completionHandler) +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasDeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("deleteItemWithIdentifier:baseVersion:options:request:completionHandler:")) +} + +// Tells the file provider to delete an item forever. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3656550-deleteitemwithidentifier?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler(identifier FileProviderItemIdentifier, version IFileProviderItemVersion, options FileProviderDeleteItemOptions, request IFileProviderRequest, completionHandler func(arg0 foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("deleteItemWithIdentifier:baseVersion:options:request:completionHandler:"), identifier, objc.Ptr(version), options, objc.Ptr(request), completionHandler) + return rv +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasItemForIdentifierRequestCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("itemForIdentifier:request:completionHandler:")) +} + +// Asks the file provider for the metadata of the provided item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3656551-itemforidentifier?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) ItemForIdentifierRequestCompletionHandler(identifier FileProviderItemIdentifier, request IFileProviderRequest, completionHandler func(arg0 objc.Object, arg1 foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("itemForIdentifier:request:completionHandler:"), identifier, objc.Ptr(request), completionHandler) + return rv +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasInitWithDomain() bool { + return f_.RespondsToSelector(objc.Sel("initWithDomain:")) +} + +// Creates an instance of the file provider for the specified domain. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3553305-initwithdomain?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) InitWithDomain(domain IFileProviderDomain) objc.Object { + rv := objc.Call[objc.Object](f_, objc.Sel("initWithDomain:"), objc.Ptr(domain)) + return rv +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasPendingItemsDidChangeWithCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("pendingItemsDidChangeWithCompletionHandler:")) +} + +// Tells the file provider extension that the set of pending items has changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3727821-pendingitemsdidchangewithcomplet?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) PendingItemsDidChangeWithCompletionHandler(completionHandler func()) { + objc.Call[objc.Void](f_, objc.Sel("pendingItemsDidChangeWithCompletionHandler:"), completionHandler) +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasInvalidate() bool { + return f_.RespondsToSelector(objc.Sel("invalidate")) +} + +// Tells the file provider to perform any necessary cleanup so that the system can deallocate it. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3553306-invalidate?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) Invalidate() { + objc.Call[objc.Void](f_, objc.Sel("invalidate")) +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("modifyItem:baseVersion:changedFields:contents:options:request:completionHandler:")) +} + +// Tells the file provider that an item’s content or metadata changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3656552-modifyitem?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler(item objc.IObject, version IFileProviderItemVersion, changedFields FileProviderItemFields, newContents foundation.IURL, options FileProviderModifyItemOptions, request IFileProviderRequest, completionHandler func(item objc.Object, stillPendingFields FileProviderItemFields, shouldFetchContent bool, error foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("modifyItem:baseVersion:changedFields:contents:options:request:completionHandler:"), objc.Ptr(item), objc.Ptr(version), changedFields, objc.Ptr(newContents), options, objc.Ptr(request), completionHandler) + return rv +} + +func (f_ FileProviderReplicatedExtensionWrapper) HasFetchContentsForItemWithIdentifierVersionRequestCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("fetchContentsForItemWithIdentifier:version:request:completionHandler:")) +} + +// Tells the file provider to download the requested item from remote storage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension/3553303-fetchcontentsforitemwithidentifi?language=objc +func (f_ FileProviderReplicatedExtensionWrapper) FetchContentsForItemWithIdentifierVersionRequestCompletionHandler(itemIdentifier FileProviderItemIdentifier, requestedVersion IFileProviderItemVersion, request IFileProviderRequest, completionHandler func(fileContents foundation.URL, item objc.Object, error foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("fetchContentsForItemWithIdentifier:version:request:completionHandler:"), itemIdentifier, objc.Ptr(requestedVersion), objc.Ptr(request), completionHandler) + return rv +} diff --git a/macos/fileprovider/file_provider_request.gen.go b/macos/fileprovider/file_provider_request.gen.go new file mode 100644 index 00000000..96e29bb5 --- /dev/null +++ b/macos/fileprovider/file_provider_request.gen.go @@ -0,0 +1,95 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FileProviderRequest] class. +var FileProviderRequestClass = _FileProviderRequestClass{objc.GetClass("NSFileProviderRequest")} + +type _FileProviderRequestClass struct { + objc.Class +} + +// An interface definition for the [FileProviderRequest] class. +type IFileProviderRequest interface { + objc.IObject + IsFileViewerRequest() bool + IsSystemRequest() bool + DomainVersion() FileProviderDomainVersion + RequestingExecutable() foundation.URL +} + +// An object that provides information about the application requesting data from the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderrequest?language=objc +type FileProviderRequest struct { + objc.Object +} + +func FileProviderRequestFrom(ptr unsafe.Pointer) FileProviderRequest { + return FileProviderRequest{ + Object: objc.ObjectFrom(ptr), + } +} + +func (fc _FileProviderRequestClass) Alloc() FileProviderRequest { + rv := objc.Call[FileProviderRequest](fc, objc.Sel("alloc")) + return rv +} + +func FileProviderRequest_Alloc() FileProviderRequest { + return FileProviderRequestClass.Alloc() +} + +func (fc _FileProviderRequestClass) New() FileProviderRequest { + rv := objc.Call[FileProviderRequest](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFileProviderRequest() FileProviderRequest { + return FileProviderRequestClass.New() +} + +func (f_ FileProviderRequest) Init() FileProviderRequest { + rv := objc.Call[FileProviderRequest](f_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the request came from Finder or related system file browsers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderrequest/3656553-isfileviewerrequest?language=objc +func (f_ FileProviderRequest) IsFileViewerRequest() bool { + rv := objc.Call[bool](f_, objc.Sel("isFileViewerRequest")) + return rv +} + +// A Boolean value that indicates whether the request came from a system process. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderrequest/3656554-issystemrequest?language=objc +func (f_ FileProviderRequest) IsSystemRequest() bool { + rv := objc.Call[bool](f_, objc.Sel("isSystemRequest")) + return rv +} + +// The version of the domain for the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderrequest/3727822-domainversion?language=objc +func (f_ FileProviderRequest) DomainVersion() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("domainVersion")) + return rv +} + +// The URL of the requesting executable. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderrequest/3142339-requestingexecutable?language=objc +func (f_ FileProviderRequest) RequestingExecutable() foundation.URL { + rv := objc.Call[foundation.URL](f_, objc.Sel("requestingExecutable")) + return rv +} diff --git a/macos/fileprovider/file_provider_service_source.gen.go b/macos/fileprovider/file_provider_service_source.gen.go new file mode 100644 index 00000000..0acebf1a --- /dev/null +++ b/macos/fileprovider/file_provider_service_source.gen.go @@ -0,0 +1,50 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// A service that provides a custom communication channel between the host app and the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderservicesource?language=objc +type PFileProviderServiceSource interface { + // optional + MakeListenerEndpointAndReturnError(error foundation.Error) foundation.IXPCListenerEndpoint + HasMakeListenerEndpointAndReturnError() bool + + // optional + ServiceName() foundation.FileProviderServiceName + HasServiceName() bool +} + +// A concrete type wrapper for the [PFileProviderServiceSource] protocol. +type FileProviderServiceSourceWrapper struct { + objc.Object +} + +func (f_ FileProviderServiceSourceWrapper) HasMakeListenerEndpointAndReturnError() bool { + return f_.RespondsToSelector(objc.Sel("makeListenerEndpointAndReturnError:")) +} + +// Returns an endpoint object that lets the host app communicate with the File Provider extension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderservicesource/2915876-makelistenerendpointandreturnerr?language=objc +func (f_ FileProviderServiceSourceWrapper) MakeListenerEndpointAndReturnError(error foundation.IError) foundation.XPCListenerEndpoint { + rv := objc.Call[foundation.XPCListenerEndpoint](f_, objc.Sel("makeListenerEndpointAndReturnError:"), objc.Ptr(error)) + return rv +} + +func (f_ FileProviderServiceSourceWrapper) HasServiceName() bool { + return f_.RespondsToSelector(objc.Sel("serviceName")) +} + +// A name that uniquely identifies the service (reverse domain name notation is recommended). [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderservicesource/2915879-servicename?language=objc +func (f_ FileProviderServiceSourceWrapper) ServiceName() foundation.FileProviderServiceName { + rv := objc.Call[foundation.FileProviderServiceName](f_, objc.Sel("serviceName")) + return rv +} diff --git a/macos/fileprovider/file_provider_servicing.gen.go b/macos/fileprovider/file_provider_servicing.gen.go new file mode 100644 index 00000000..0fc0ec5e --- /dev/null +++ b/macos/fileprovider/file_provider_servicing.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Support for providing a custom service source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderservicing?language=objc +type PFileProviderServicing interface { + // optional + SupportedServiceSourcesForItemIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(arg0 []FileProviderServiceSourceWrapper, arg1 foundation.Error)) foundation.IProgress + HasSupportedServiceSourcesForItemIdentifierCompletionHandler() bool +} + +// A concrete type wrapper for the [PFileProviderServicing] protocol. +type FileProviderServicingWrapper struct { + objc.Object +} + +func (f_ FileProviderServicingWrapper) HasSupportedServiceSourcesForItemIdentifierCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("supportedServiceSourcesForItemIdentifier:completionHandler:")) +} + +// Asks the File Provider extension for an array of custom communication channels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderservicing/3553311-supportedservicesourcesforitemid?language=objc +func (f_ FileProviderServicingWrapper) SupportedServiceSourcesForItemIdentifierCompletionHandler(itemIdentifier FileProviderItemIdentifier, completionHandler func(arg0 []FileProviderServiceSourceWrapper, arg1 foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("supportedServiceSourcesForItemIdentifier:completionHandler:"), itemIdentifier, completionHandler) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_children_enumeration.gen.go b/macos/fileprovider/file_provider_testing_children_enumeration.gen.go new file mode 100644 index 00000000..ebcb3d12 --- /dev/null +++ b/macos/fileprovider/file_provider_testing_children_enumeration.gen.go @@ -0,0 +1,49 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that lists a directory’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingchildrenenumeration?language=objc +type PFileProviderTestingChildrenEnumeration interface { + // optional + ItemIdentifier() FileProviderItemIdentifier + HasItemIdentifier() bool + + // optional + Side() FileProviderTestingOperationSide + HasSide() bool +} + +// A concrete type wrapper for the [PFileProviderTestingChildrenEnumeration] protocol. +type FileProviderTestingChildrenEnumerationWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingChildrenEnumerationWrapper) HasItemIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("itemIdentifier")) +} + +// The containing identifier’s unique identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingchildrenenumeration/3727829-itemidentifier?language=objc +func (f_ FileProviderTestingChildrenEnumerationWrapper) ItemIdentifier() FileProviderItemIdentifier { + rv := objc.Call[FileProviderItemIdentifier](f_, objc.Sel("itemIdentifier")) + return rv +} + +func (f_ FileProviderTestingChildrenEnumerationWrapper) HasSide() bool { + return f_.RespondsToSelector(objc.Sel("side")) +} + +// The item’s location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingchildrenenumeration/3727830-side?language=objc +func (f_ FileProviderTestingChildrenEnumerationWrapper) Side() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("side")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_collision_resolution.gen.go b/macos/fileprovider/file_provider_testing_collision_resolution.gen.go new file mode 100644 index 00000000..da398964 --- /dev/null +++ b/macos/fileprovider/file_provider_testing_collision_resolution.gen.go @@ -0,0 +1,49 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that resolves a collision by renaming the new item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcollisionresolution?language=objc +type PFileProviderTestingCollisionResolution interface { + // optional + RenamedItem() objc.IObject + HasRenamedItem() bool + + // optional + Side() FileProviderTestingOperationSide + HasSide() bool +} + +// A concrete type wrapper for the [PFileProviderTestingCollisionResolution] protocol. +type FileProviderTestingCollisionResolutionWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingCollisionResolutionWrapper) HasRenamedItem() bool { + return f_.RespondsToSelector(objc.Sel("renamedItem")) +} + +// A description of the renamed item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcollisionresolution/3736228-renameditem?language=objc +func (f_ FileProviderTestingCollisionResolutionWrapper) RenamedItem() objc.Object { + rv := objc.Call[objc.Object](f_, objc.Sel("renamedItem")) + return rv +} + +func (f_ FileProviderTestingCollisionResolutionWrapper) HasSide() bool { + return f_.RespondsToSelector(objc.Sel("side")) +} + +// The item’s location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcollisionresolution/3736229-side?language=objc +func (f_ FileProviderTestingCollisionResolutionWrapper) Side() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("side")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_content_fetch.gen.go b/macos/fileprovider/file_provider_testing_content_fetch.gen.go new file mode 100644 index 00000000..3f057b73 --- /dev/null +++ b/macos/fileprovider/file_provider_testing_content_fetch.gen.go @@ -0,0 +1,49 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that fetches an item’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcontentfetch?language=objc +type PFileProviderTestingContentFetch interface { + // optional + ItemIdentifier() FileProviderItemIdentifier + HasItemIdentifier() bool + + // optional + Side() FileProviderTestingOperationSide + HasSide() bool +} + +// A concrete type wrapper for the [PFileProviderTestingContentFetch] protocol. +type FileProviderTestingContentFetchWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingContentFetchWrapper) HasItemIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("itemIdentifier")) +} + +// The containing item’s unique identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcontentfetch/3727832-itemidentifier?language=objc +func (f_ FileProviderTestingContentFetchWrapper) ItemIdentifier() FileProviderItemIdentifier { + rv := objc.Call[FileProviderItemIdentifier](f_, objc.Sel("itemIdentifier")) + return rv +} + +func (f_ FileProviderTestingContentFetchWrapper) HasSide() bool { + return f_.RespondsToSelector(objc.Sel("side")) +} + +// The item’s location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcontentfetch/3727833-side?language=objc +func (f_ FileProviderTestingContentFetchWrapper) Side() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("side")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_creation.gen.go b/macos/fileprovider/file_provider_testing_creation.gen.go new file mode 100644 index 00000000..6fc6124c --- /dev/null +++ b/macos/fileprovider/file_provider_testing_creation.gen.go @@ -0,0 +1,65 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that syncs the creation of the source item to the target location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcreation?language=objc +type PFileProviderTestingCreation interface { + // optional + TargetSide() FileProviderTestingOperationSide + HasTargetSide() bool + + // optional + DomainVersion() IFileProviderDomainVersion + HasDomainVersion() bool + + // optional + SourceItem() objc.IObject + HasSourceItem() bool +} + +// A concrete type wrapper for the [PFileProviderTestingCreation] protocol. +type FileProviderTestingCreationWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingCreationWrapper) HasTargetSide() bool { + return f_.RespondsToSelector(objc.Sel("targetSide")) +} + +// The target location for the new item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcreation/3736233-targetside?language=objc +func (f_ FileProviderTestingCreationWrapper) TargetSide() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("targetSide")) + return rv +} + +func (f_ FileProviderTestingCreationWrapper) HasDomainVersion() bool { + return f_.RespondsToSelector(objc.Sel("domainVersion")) +} + +// The domain’s version when the system discovered the item at the source location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcreation/3736231-domainversion?language=objc +func (f_ FileProviderTestingCreationWrapper) DomainVersion() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("domainVersion")) + return rv +} + +func (f_ FileProviderTestingCreationWrapper) HasSourceItem() bool { + return f_.RespondsToSelector(objc.Sel("sourceItem")) +} + +// A description of the item stored at the source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingcreation/3736232-sourceitem?language=objc +func (f_ FileProviderTestingCreationWrapper) SourceItem() objc.Object { + rv := objc.Call[objc.Object](f_, objc.Sel("sourceItem")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_deletion.gen.go b/macos/fileprovider/file_provider_testing_deletion.gen.go new file mode 100644 index 00000000..bf1e8a42 --- /dev/null +++ b/macos/fileprovider/file_provider_testing_deletion.gen.go @@ -0,0 +1,97 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that syncs the deletion of the source item to the target location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingdeletion?language=objc +type PFileProviderTestingDeletion interface { + // optional + TargetSide() FileProviderTestingOperationSide + HasTargetSide() bool + + // optional + TargetItemIdentifier() FileProviderItemIdentifier + HasTargetItemIdentifier() bool + + // optional + DomainVersion() IFileProviderDomainVersion + HasDomainVersion() bool + + // optional + TargetItemBaseVersion() IFileProviderItemVersion + HasTargetItemBaseVersion() bool + + // optional + SourceItemIdentifier() FileProviderItemIdentifier + HasSourceItemIdentifier() bool +} + +// A concrete type wrapper for the [PFileProviderTestingDeletion] protocol. +type FileProviderTestingDeletionWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingDeletionWrapper) HasTargetSide() bool { + return f_.RespondsToSelector(objc.Sel("targetSide")) +} + +// The target location for the delete operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingdeletion/3736239-targetside?language=objc +func (f_ FileProviderTestingDeletionWrapper) TargetSide() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("targetSide")) + return rv +} + +func (f_ FileProviderTestingDeletionWrapper) HasTargetItemIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("targetItemIdentifier")) +} + +// The unique identifier for the target item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingdeletion/3736238-targetitemidentifier?language=objc +func (f_ FileProviderTestingDeletionWrapper) TargetItemIdentifier() FileProviderItemIdentifier { + rv := objc.Call[FileProviderItemIdentifier](f_, objc.Sel("targetItemIdentifier")) + return rv +} + +func (f_ FileProviderTestingDeletionWrapper) HasDomainVersion() bool { + return f_.RespondsToSelector(objc.Sel("domainVersion")) +} + +// The domain’s version when the source location deleted the item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingdeletion/3736235-domainversion?language=objc +func (f_ FileProviderTestingDeletionWrapper) DomainVersion() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("domainVersion")) + return rv +} + +func (f_ FileProviderTestingDeletionWrapper) HasTargetItemBaseVersion() bool { + return f_.RespondsToSelector(objc.Sel("targetItemBaseVersion")) +} + +// The version of the deleted item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingdeletion/3736237-targetitembaseversion?language=objc +func (f_ FileProviderTestingDeletionWrapper) TargetItemBaseVersion() FileProviderItemVersion { + rv := objc.Call[FileProviderItemVersion](f_, objc.Sel("targetItemBaseVersion")) + return rv +} + +func (f_ FileProviderTestingDeletionWrapper) HasSourceItemIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("sourceItemIdentifier")) +} + +// The unique identifier for the source item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingdeletion/3736236-sourceitemidentifier?language=objc +func (f_ FileProviderTestingDeletionWrapper) SourceItemIdentifier() FileProviderItemIdentifier { + rv := objc.Call[FileProviderItemIdentifier](f_, objc.Sel("sourceItemIdentifier")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_ingestion.gen.go b/macos/fileprovider/file_provider_testing_ingestion.gen.go new file mode 100644 index 00000000..b4c3c361 --- /dev/null +++ b/macos/fileprovider/file_provider_testing_ingestion.gen.go @@ -0,0 +1,65 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that alerts the system to either local or remote storage changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingingestion?language=objc +type PFileProviderTestingIngestion interface { + // optional + Item() objc.IObject + HasItem() bool + + // optional + ItemIdentifier() FileProviderItemIdentifier + HasItemIdentifier() bool + + // optional + Side() FileProviderTestingOperationSide + HasSide() bool +} + +// A concrete type wrapper for the [PFileProviderTestingIngestion] protocol. +type FileProviderTestingIngestionWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingIngestionWrapper) HasItem() bool { + return f_.RespondsToSelector(objc.Sel("item")) +} + +// A description of the item that changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingingestion/3727835-item?language=objc +func (f_ FileProviderTestingIngestionWrapper) Item() objc.Object { + rv := objc.Call[objc.Object](f_, objc.Sel("item")) + return rv +} + +func (f_ FileProviderTestingIngestionWrapper) HasItemIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("itemIdentifier")) +} + +// The unique identifier for the item that changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingingestion/3727836-itemidentifier?language=objc +func (f_ FileProviderTestingIngestionWrapper) ItemIdentifier() FileProviderItemIdentifier { + rv := objc.Call[FileProviderItemIdentifier](f_, objc.Sel("itemIdentifier")) + return rv +} + +func (f_ FileProviderTestingIngestionWrapper) HasSide() bool { + return f_.RespondsToSelector(objc.Sel("side")) +} + +// The location where the change occurred. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingingestion/3727837-side?language=objc +func (f_ FileProviderTestingIngestionWrapper) Side() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("side")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_lookup.gen.go b/macos/fileprovider/file_provider_testing_lookup.gen.go new file mode 100644 index 00000000..baa7daca --- /dev/null +++ b/macos/fileprovider/file_provider_testing_lookup.gen.go @@ -0,0 +1,49 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that looks up an item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestinglookup?language=objc +type PFileProviderTestingLookup interface { + // optional + ItemIdentifier() FileProviderItemIdentifier + HasItemIdentifier() bool + + // optional + Side() FileProviderTestingOperationSide + HasSide() bool +} + +// A concrete type wrapper for the [PFileProviderTestingLookup] protocol. +type FileProviderTestingLookupWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingLookupWrapper) HasItemIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("itemIdentifier")) +} + +// The unique identifier for the item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestinglookup/3727839-itemidentifier?language=objc +func (f_ FileProviderTestingLookupWrapper) ItemIdentifier() FileProviderItemIdentifier { + rv := objc.Call[FileProviderItemIdentifier](f_, objc.Sel("itemIdentifier")) + return rv +} + +func (f_ FileProviderTestingLookupWrapper) HasSide() bool { + return f_.RespondsToSelector(objc.Sel("side")) +} + +// The location where the lookup occurs. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestinglookup/3727840-side?language=objc +func (f_ FileProviderTestingLookupWrapper) Side() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("side")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_modification.gen.go b/macos/fileprovider/file_provider_testing_modification.gen.go new file mode 100644 index 00000000..472731dc --- /dev/null +++ b/macos/fileprovider/file_provider_testing_modification.gen.go @@ -0,0 +1,113 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that syncs the modification of the source item to the target location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingmodification?language=objc +type PFileProviderTestingModification interface { + // optional + TargetSide() FileProviderTestingOperationSide + HasTargetSide() bool + + // optional + TargetItemIdentifier() FileProviderItemIdentifier + HasTargetItemIdentifier() bool + + // optional + DomainVersion() IFileProviderDomainVersion + HasDomainVersion() bool + + // optional + TargetItemBaseVersion() IFileProviderItemVersion + HasTargetItemBaseVersion() bool + + // optional + SourceItem() objc.IObject + HasSourceItem() bool + + // optional + ChangedFields() FileProviderItemFields + HasChangedFields() bool +} + +// A concrete type wrapper for the [PFileProviderTestingModification] protocol. +type FileProviderTestingModificationWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingModificationWrapper) HasTargetSide() bool { + return f_.RespondsToSelector(objc.Sel("targetSide")) +} + +// The target location for the modification operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingmodification/3736246-targetside?language=objc +func (f_ FileProviderTestingModificationWrapper) TargetSide() FileProviderTestingOperationSide { + rv := objc.Call[FileProviderTestingOperationSide](f_, objc.Sel("targetSide")) + return rv +} + +func (f_ FileProviderTestingModificationWrapper) HasTargetItemIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("targetItemIdentifier")) +} + +// The unique identifier for the target item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingmodification/3736245-targetitemidentifier?language=objc +func (f_ FileProviderTestingModificationWrapper) TargetItemIdentifier() FileProviderItemIdentifier { + rv := objc.Call[FileProviderItemIdentifier](f_, objc.Sel("targetItemIdentifier")) + return rv +} + +func (f_ FileProviderTestingModificationWrapper) HasDomainVersion() bool { + return f_.RespondsToSelector(objc.Sel("domainVersion")) +} + +// The domain’s version when the change occurred. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingmodification/3736242-domainversion?language=objc +func (f_ FileProviderTestingModificationWrapper) DomainVersion() FileProviderDomainVersion { + rv := objc.Call[FileProviderDomainVersion](f_, objc.Sel("domainVersion")) + return rv +} + +func (f_ FileProviderTestingModificationWrapper) HasTargetItemBaseVersion() bool { + return f_.RespondsToSelector(objc.Sel("targetItemBaseVersion")) +} + +// The version of the changed item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingmodification/3736244-targetitembaseversion?language=objc +func (f_ FileProviderTestingModificationWrapper) TargetItemBaseVersion() FileProviderItemVersion { + rv := objc.Call[FileProviderItemVersion](f_, objc.Sel("targetItemBaseVersion")) + return rv +} + +func (f_ FileProviderTestingModificationWrapper) HasSourceItem() bool { + return f_.RespondsToSelector(objc.Sel("sourceItem")) +} + +// A description of the source item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingmodification/3736243-sourceitem?language=objc +func (f_ FileProviderTestingModificationWrapper) SourceItem() objc.Object { + rv := objc.Call[objc.Object](f_, objc.Sel("sourceItem")) + return rv +} + +func (f_ FileProviderTestingModificationWrapper) HasChangedFields() bool { + return f_.RespondsToSelector(objc.Sel("changedFields")) +} + +// A list of the fields that changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingmodification/3736241-changedfields?language=objc +func (f_ FileProviderTestingModificationWrapper) ChangedFields() FileProviderItemFields { + rv := objc.Call[FileProviderItemFields](f_, objc.Sel("changedFields")) + return rv +} diff --git a/macos/fileprovider/file_provider_testing_operation.gen.go b/macos/fileprovider/file_provider_testing_operation.gen.go new file mode 100644 index 00000000..9fab1237 --- /dev/null +++ b/macos/fileprovider/file_provider_testing_operation.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// An operation that the system can schedule. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation?language=objc +type PFileProviderTestingOperation interface { + // optional + AsModification() PFileProviderTestingModification + HasAsModification() bool + + // optional + AsCreation() PFileProviderTestingCreation + HasAsCreation() bool + + // optional + AsDeletion() PFileProviderTestingDeletion + HasAsDeletion() bool + + // optional + AsLookup() PFileProviderTestingLookup + HasAsLookup() bool + + // optional + AsContentFetch() PFileProviderTestingContentFetch + HasAsContentFetch() bool + + // optional + AsIngestion() PFileProviderTestingIngestion + HasAsIngestion() bool + + // optional + AsCollisionResolution() PFileProviderTestingCollisionResolution + HasAsCollisionResolution() bool + + // optional + AsChildrenEnumeration() PFileProviderTestingChildrenEnumeration + HasAsChildrenEnumeration() bool + + // optional + Type() FileProviderTestingOperationType + HasType() bool +} + +// A concrete type wrapper for the [PFileProviderTestingOperation] protocol. +type FileProviderTestingOperationWrapper struct { + objc.Object +} + +func (f_ FileProviderTestingOperationWrapper) HasAsModification() bool { + return f_.RespondsToSelector(objc.Sel("asModification")) +} + +// Returns the operation if it propagates a change. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736254-asmodification?language=objc +func (f_ FileProviderTestingOperationWrapper) AsModification() FileProviderTestingModificationWrapper { + rv := objc.Call[FileProviderTestingModificationWrapper](f_, objc.Sel("asModification")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasAsCreation() bool { + return f_.RespondsToSelector(objc.Sel("asCreation")) +} + +// Returns the operation if it propagates the creation of an item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736250-ascreation?language=objc +func (f_ FileProviderTestingOperationWrapper) AsCreation() FileProviderTestingCreationWrapper { + rv := objc.Call[FileProviderTestingCreationWrapper](f_, objc.Sel("asCreation")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasAsDeletion() bool { + return f_.RespondsToSelector(objc.Sel("asDeletion")) +} + +// Returns the operation if it propagates the deletion of an item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736251-asdeletion?language=objc +func (f_ FileProviderTestingOperationWrapper) AsDeletion() FileProviderTestingDeletionWrapper { + rv := objc.Call[FileProviderTestingDeletionWrapper](f_, objc.Sel("asDeletion")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasAsLookup() bool { + return f_.RespondsToSelector(objc.Sel("asLookup")) +} + +// Returns the operation if it looks up an item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736253-aslookup?language=objc +func (f_ FileProviderTestingOperationWrapper) AsLookup() FileProviderTestingLookupWrapper { + rv := objc.Call[FileProviderTestingLookupWrapper](f_, objc.Sel("asLookup")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasAsContentFetch() bool { + return f_.RespondsToSelector(objc.Sel("asContentFetch")) +} + +// Returns the operation if it fetches an item’s content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736249-ascontentfetch?language=objc +func (f_ FileProviderTestingOperationWrapper) AsContentFetch() FileProviderTestingContentFetchWrapper { + rv := objc.Call[FileProviderTestingContentFetchWrapper](f_, objc.Sel("asContentFetch")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasAsIngestion() bool { + return f_.RespondsToSelector(objc.Sel("asIngestion")) +} + +// Returns the operation if it alerts the system to changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736252-asingestion?language=objc +func (f_ FileProviderTestingOperationWrapper) AsIngestion() FileProviderTestingIngestionWrapper { + rv := objc.Call[FileProviderTestingIngestionWrapper](f_, objc.Sel("asIngestion")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasAsCollisionResolution() bool { + return f_.RespondsToSelector(objc.Sel("asCollisionResolution")) +} + +// Returns the operation if it resolves a collision by renaming the new item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736248-ascollisionresolution?language=objc +func (f_ FileProviderTestingOperationWrapper) AsCollisionResolution() FileProviderTestingCollisionResolutionWrapper { + rv := objc.Call[FileProviderTestingCollisionResolutionWrapper](f_, objc.Sel("asCollisionResolution")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasAsChildrenEnumeration() bool { + return f_.RespondsToSelector(objc.Sel("asChildrenEnumeration")) +} + +// Returns the operation if it enumerates contained items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736247-aschildrenenumeration?language=objc +func (f_ FileProviderTestingOperationWrapper) AsChildrenEnumeration() FileProviderTestingChildrenEnumerationWrapper { + rv := objc.Call[FileProviderTestingChildrenEnumerationWrapper](f_, objc.Sel("asChildrenEnumeration")) + return rv +} + +func (f_ FileProviderTestingOperationWrapper) HasType() bool { + return f_.RespondsToSelector(objc.Sel("type")) +} + +// The operation’s type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovidertestingoperation/3736255-type?language=objc +func (f_ FileProviderTestingOperationWrapper) Type() FileProviderTestingOperationType { + rv := objc.Call[FileProviderTestingOperationType](f_, objc.Sel("type")) + return rv +} diff --git a/macos/fileprovider/file_provider_thumbnailing.gen.go b/macos/fileprovider/file_provider_thumbnailing.gen.go new file mode 100644 index 00000000..42e0ad34 --- /dev/null +++ b/macos/fileprovider/file_provider_thumbnailing.gen.go @@ -0,0 +1,35 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// Support for item thumbnails. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderthumbnailing?language=objc +type PFileProviderThumbnailing interface { + // optional + FetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler(itemIdentifiers []FileProviderItemIdentifier, size coregraphics.Size, perThumbnailCompletionHandler func(identifier FileProviderItemIdentifier, imageData []byte, error foundation.Error), completionHandler func(error foundation.Error)) foundation.IProgress + HasFetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler() bool +} + +// A concrete type wrapper for the [PFileProviderThumbnailing] protocol. +type FileProviderThumbnailingWrapper struct { + objc.Object +} + +func (f_ FileProviderThumbnailingWrapper) HasFetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler() bool { + return f_.RespondsToSelector(objc.Sel("fetchThumbnailsForItemIdentifiers:requestedSize:perThumbnailCompletionHandler:completionHandler:")) +} + +// Asks the file provider for a thumbnail of the specified items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileproviderthumbnailing/3553313-fetchthumbnailsforitemidentifier?language=objc +func (f_ FileProviderThumbnailingWrapper) FetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler(itemIdentifiers []FileProviderItemIdentifier, size coregraphics.Size, perThumbnailCompletionHandler func(identifier FileProviderItemIdentifier, imageData []byte, error foundation.Error), completionHandler func(error foundation.Error)) foundation.Progress { + rv := objc.Call[foundation.Progress](f_, objc.Sel("fetchThumbnailsForItemIdentifiers:requestedSize:perThumbnailCompletionHandler:completionHandler:"), itemIdentifiers, size, perThumbnailCompletionHandler, completionHandler) + return rv +} diff --git a/macos/fileprovider/file_provider_user_interaction_suppressing.gen.go b/macos/fileprovider/file_provider_user_interaction_suppressing.gen.go new file mode 100644 index 00000000..cd322c0e --- /dev/null +++ b/macos/fileprovider/file_provider_user_interaction_suppressing.gen.go @@ -0,0 +1,48 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package fileprovider + +import ( + "github.com/progrium/macdriver/objc" +) + +// Support for suppressing user-interaction alerts. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideruserinteractionsuppressing?language=objc +type PFileProviderUserInteractionSuppressing interface { + // optional + IsInteractionSuppressedForIdentifier(suppressionIdentifier string) bool + HasIsInteractionSuppressedForIdentifier() bool + + // optional + SetInteractionSuppressedForIdentifier(suppression bool, suppressionIdentifier string) + HasSetInteractionSuppressedForIdentifier() bool +} + +// A concrete type wrapper for the [PFileProviderUserInteractionSuppressing] protocol. +type FileProviderUserInteractionSuppressingWrapper struct { + objc.Object +} + +func (f_ FileProviderUserInteractionSuppressingWrapper) HasIsInteractionSuppressedForIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("isInteractionSuppressedForIdentifier:")) +} + +// Asks the File Provider extension if the user suppressed the specified interaction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideruserinteractionsuppressing/3762902-isinteractionsuppressedforidenti?language=objc +func (f_ FileProviderUserInteractionSuppressingWrapper) IsInteractionSuppressedForIdentifier(suppressionIdentifier string) bool { + rv := objc.Call[bool](f_, objc.Sel("isInteractionSuppressedForIdentifier:"), suppressionIdentifier) + return rv +} + +func (f_ FileProviderUserInteractionSuppressingWrapper) HasSetInteractionSuppressedForIdentifier() bool { + return f_.RespondsToSelector(objc.Sel("setInteractionSuppressed:forIdentifier:")) +} + +// Tells the File Provider extension that the user wants to suppress the user interaction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/fileprovider/nsfileprovideruserinteractionsuppressing/3762903-setinteractionsuppressed?language=objc +func (f_ FileProviderUserInteractionSuppressingWrapper) SetInteractionSuppressedForIdentifier(suppression bool, suppressionIdentifier string) { + objc.Call[objc.Void](f_, objc.Sel("setInteractionSuppressed:forIdentifier:"), suppression, suppressionIdentifier) +} diff --git a/macos/fileprovider/fileprovider_custom.go b/macos/fileprovider/fileprovider_custom.go new file mode 100644 index 00000000..c75fc4f5 --- /dev/null +++ b/macos/fileprovider/fileprovider_custom.go @@ -0,0 +1,6 @@ +package fileprovider + +import "github.com/progrium/macdriver/macos/foundation" + +type FileProviderSyncAnchor = foundation.Data +type FileProviderPage = foundation.Data diff --git a/macos/mediaplayer/change_language_option_command_event.gen.go b/macos/mediaplayer/change_language_option_command_event.gen.go new file mode 100644 index 00000000..b4063027 --- /dev/null +++ b/macos/mediaplayer/change_language_option_command_event.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangeLanguageOptionCommandEvent] class. +var ChangeLanguageOptionCommandEventClass = _ChangeLanguageOptionCommandEventClass{objc.GetClass("MPChangeLanguageOptionCommandEvent")} + +type _ChangeLanguageOptionCommandEventClass struct { + objc.Class +} + +// An interface definition for the [ChangeLanguageOptionCommandEvent] class. +type IChangeLanguageOptionCommandEvent interface { + IRemoteCommandEvent + Setting() ChangeLanguageOptionSetting +} + +// An event requesting a change in the language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangelanguageoptioncommandevent?language=objc +type ChangeLanguageOptionCommandEvent struct { + RemoteCommandEvent +} + +func ChangeLanguageOptionCommandEventFrom(ptr unsafe.Pointer) ChangeLanguageOptionCommandEvent { + return ChangeLanguageOptionCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (cc _ChangeLanguageOptionCommandEventClass) Alloc() ChangeLanguageOptionCommandEvent { + rv := objc.Call[ChangeLanguageOptionCommandEvent](cc, objc.Sel("alloc")) + return rv +} + +func ChangeLanguageOptionCommandEvent_Alloc() ChangeLanguageOptionCommandEvent { + return ChangeLanguageOptionCommandEventClass.Alloc() +} + +func (cc _ChangeLanguageOptionCommandEventClass) New() ChangeLanguageOptionCommandEvent { + rv := objc.Call[ChangeLanguageOptionCommandEvent](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangeLanguageOptionCommandEvent() ChangeLanguageOptionCommandEvent { + return ChangeLanguageOptionCommandEventClass.New() +} + +func (c_ ChangeLanguageOptionCommandEvent) Init() ChangeLanguageOptionCommandEvent { + rv := objc.Call[ChangeLanguageOptionCommandEvent](c_, objc.Sel("init")) + return rv +} + +// The extent of the language setting change. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangelanguageoptioncommandevent/1649697-setting?language=objc +func (c_ ChangeLanguageOptionCommandEvent) Setting() ChangeLanguageOptionSetting { + rv := objc.Call[ChangeLanguageOptionSetting](c_, objc.Sel("setting")) + return rv +} diff --git a/macos/mediaplayer/change_playback_position_command.gen.go b/macos/mediaplayer/change_playback_position_command.gen.go new file mode 100644 index 00000000..b4b5d925 --- /dev/null +++ b/macos/mediaplayer/change_playback_position_command.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangePlaybackPositionCommand] class. +var ChangePlaybackPositionCommandClass = _ChangePlaybackPositionCommandClass{objc.GetClass("MPChangePlaybackPositionCommand")} + +type _ChangePlaybackPositionCommandClass struct { + objc.Class +} + +// An interface definition for the [ChangePlaybackPositionCommand] class. +type IChangePlaybackPositionCommand interface { + IRemoteCommand +} + +// An object that responds to requests to change the current playback position of the playing item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackpositioncommand?language=objc +type ChangePlaybackPositionCommand struct { + RemoteCommand +} + +func ChangePlaybackPositionCommandFrom(ptr unsafe.Pointer) ChangePlaybackPositionCommand { + return ChangePlaybackPositionCommand{ + RemoteCommand: RemoteCommandFrom(ptr), + } +} + +func (cc _ChangePlaybackPositionCommandClass) Alloc() ChangePlaybackPositionCommand { + rv := objc.Call[ChangePlaybackPositionCommand](cc, objc.Sel("alloc")) + return rv +} + +func ChangePlaybackPositionCommand_Alloc() ChangePlaybackPositionCommand { + return ChangePlaybackPositionCommandClass.Alloc() +} + +func (cc _ChangePlaybackPositionCommandClass) New() ChangePlaybackPositionCommand { + rv := objc.Call[ChangePlaybackPositionCommand](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangePlaybackPositionCommand() ChangePlaybackPositionCommand { + return ChangePlaybackPositionCommandClass.New() +} + +func (c_ ChangePlaybackPositionCommand) Init() ChangePlaybackPositionCommand { + rv := objc.Call[ChangePlaybackPositionCommand](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mediaplayer/change_playback_position_command_event.gen.go b/macos/mediaplayer/change_playback_position_command_event.gen.go new file mode 100644 index 00000000..4920a35d --- /dev/null +++ b/macos/mediaplayer/change_playback_position_command_event.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangePlaybackPositionCommandEvent] class. +var ChangePlaybackPositionCommandEventClass = _ChangePlaybackPositionCommandEventClass{objc.GetClass("MPChangePlaybackPositionCommandEvent")} + +type _ChangePlaybackPositionCommandEventClass struct { + objc.Class +} + +// An interface definition for the [ChangePlaybackPositionCommandEvent] class. +type IChangePlaybackPositionCommandEvent interface { + IRemoteCommandEvent + PositionTime() foundation.TimeInterval +} + +// An event requesting a change in the playback position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackpositioncommandevent?language=objc +type ChangePlaybackPositionCommandEvent struct { + RemoteCommandEvent +} + +func ChangePlaybackPositionCommandEventFrom(ptr unsafe.Pointer) ChangePlaybackPositionCommandEvent { + return ChangePlaybackPositionCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (cc _ChangePlaybackPositionCommandEventClass) Alloc() ChangePlaybackPositionCommandEvent { + rv := objc.Call[ChangePlaybackPositionCommandEvent](cc, objc.Sel("alloc")) + return rv +} + +func ChangePlaybackPositionCommandEvent_Alloc() ChangePlaybackPositionCommandEvent { + return ChangePlaybackPositionCommandEventClass.Alloc() +} + +func (cc _ChangePlaybackPositionCommandEventClass) New() ChangePlaybackPositionCommandEvent { + rv := objc.Call[ChangePlaybackPositionCommandEvent](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangePlaybackPositionCommandEvent() ChangePlaybackPositionCommandEvent { + return ChangePlaybackPositionCommandEventClass.New() +} + +func (c_ ChangePlaybackPositionCommandEvent) Init() ChangePlaybackPositionCommandEvent { + rv := objc.Call[ChangePlaybackPositionCommandEvent](c_, objc.Sel("init")) + return rv +} + +// The playback position used when setting the current time of the player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackpositioncommandevent/1616766-positiontime?language=objc +func (c_ ChangePlaybackPositionCommandEvent) PositionTime() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](c_, objc.Sel("positionTime")) + return rv +} diff --git a/macos/mediaplayer/change_playback_rate_command.gen.go b/macos/mediaplayer/change_playback_rate_command.gen.go new file mode 100644 index 00000000..c269a91f --- /dev/null +++ b/macos/mediaplayer/change_playback_rate_command.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangePlaybackRateCommand] class. +var ChangePlaybackRateCommandClass = _ChangePlaybackRateCommandClass{objc.GetClass("MPChangePlaybackRateCommand")} + +type _ChangePlaybackRateCommandClass struct { + objc.Class +} + +// An interface definition for the [ChangePlaybackRateCommand] class. +type IChangePlaybackRateCommand interface { + IRemoteCommand + SupportedPlaybackRates() []foundation.Number + SetSupportedPlaybackRates(value []foundation.INumber) +} + +// An object that responds to requests to change the playback rate of the playing item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackratecommand?language=objc +type ChangePlaybackRateCommand struct { + RemoteCommand +} + +func ChangePlaybackRateCommandFrom(ptr unsafe.Pointer) ChangePlaybackRateCommand { + return ChangePlaybackRateCommand{ + RemoteCommand: RemoteCommandFrom(ptr), + } +} + +func (cc _ChangePlaybackRateCommandClass) Alloc() ChangePlaybackRateCommand { + rv := objc.Call[ChangePlaybackRateCommand](cc, objc.Sel("alloc")) + return rv +} + +func ChangePlaybackRateCommand_Alloc() ChangePlaybackRateCommand { + return ChangePlaybackRateCommandClass.Alloc() +} + +func (cc _ChangePlaybackRateCommandClass) New() ChangePlaybackRateCommand { + rv := objc.Call[ChangePlaybackRateCommand](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangePlaybackRateCommand() ChangePlaybackRateCommand { + return ChangePlaybackRateCommandClass.New() +} + +func (c_ ChangePlaybackRateCommand) Init() ChangePlaybackRateCommand { + rv := objc.Call[ChangePlaybackRateCommand](c_, objc.Sel("init")) + return rv +} + +// The supported playback rates for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackratecommand/1622915-supportedplaybackrates?language=objc +func (c_ ChangePlaybackRateCommand) SupportedPlaybackRates() []foundation.Number { + rv := objc.Call[[]foundation.Number](c_, objc.Sel("supportedPlaybackRates")) + return rv +} + +// The supported playback rates for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackratecommand/1622915-supportedplaybackrates?language=objc +func (c_ ChangePlaybackRateCommand) SetSupportedPlaybackRates(value []foundation.INumber) { + objc.Call[objc.Void](c_, objc.Sel("setSupportedPlaybackRates:"), value) +} diff --git a/macos/mediaplayer/change_playback_rate_command_event.gen.go b/macos/mediaplayer/change_playback_rate_command_event.gen.go new file mode 100644 index 00000000..be294e9c --- /dev/null +++ b/macos/mediaplayer/change_playback_rate_command_event.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangePlaybackRateCommandEvent] class. +var ChangePlaybackRateCommandEventClass = _ChangePlaybackRateCommandEventClass{objc.GetClass("MPChangePlaybackRateCommandEvent")} + +type _ChangePlaybackRateCommandEventClass struct { + objc.Class +} + +// An interface definition for the [ChangePlaybackRateCommandEvent] class. +type IChangePlaybackRateCommandEvent interface { + IRemoteCommandEvent + PlaybackRate() float64 +} + +// An event requesting a change in the playback rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackratecommandevent?language=objc +type ChangePlaybackRateCommandEvent struct { + RemoteCommandEvent +} + +func ChangePlaybackRateCommandEventFrom(ptr unsafe.Pointer) ChangePlaybackRateCommandEvent { + return ChangePlaybackRateCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (cc _ChangePlaybackRateCommandEventClass) Alloc() ChangePlaybackRateCommandEvent { + rv := objc.Call[ChangePlaybackRateCommandEvent](cc, objc.Sel("alloc")) + return rv +} + +func ChangePlaybackRateCommandEvent_Alloc() ChangePlaybackRateCommandEvent { + return ChangePlaybackRateCommandEventClass.Alloc() +} + +func (cc _ChangePlaybackRateCommandEventClass) New() ChangePlaybackRateCommandEvent { + rv := objc.Call[ChangePlaybackRateCommandEvent](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangePlaybackRateCommandEvent() ChangePlaybackRateCommandEvent { + return ChangePlaybackRateCommandEventClass.New() +} + +func (c_ ChangePlaybackRateCommandEvent) Init() ChangePlaybackRateCommandEvent { + rv := objc.Call[ChangePlaybackRateCommandEvent](c_, objc.Sel("init")) + return rv +} + +// The chosen playback rate for the command event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeplaybackratecommandevent/1616782-playbackrate?language=objc +func (c_ ChangePlaybackRateCommandEvent) PlaybackRate() float64 { + rv := objc.Call[float64](c_, objc.Sel("playbackRate")) + return rv +} diff --git a/macos/mediaplayer/change_repeat_mode_command.gen.go b/macos/mediaplayer/change_repeat_mode_command.gen.go new file mode 100644 index 00000000..77f59d0a --- /dev/null +++ b/macos/mediaplayer/change_repeat_mode_command.gen.go @@ -0,0 +1,75 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangeRepeatModeCommand] class. +var ChangeRepeatModeCommandClass = _ChangeRepeatModeCommandClass{objc.GetClass("MPChangeRepeatModeCommand")} + +type _ChangeRepeatModeCommandClass struct { + objc.Class +} + +// An interface definition for the [ChangeRepeatModeCommand] class. +type IChangeRepeatModeCommand interface { + IRemoteCommand + CurrentRepeatType() RepeatType + SetCurrentRepeatType(value RepeatType) +} + +// An object that responds to requests to change the current repeat mode used during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangerepeatmodecommand?language=objc +type ChangeRepeatModeCommand struct { + RemoteCommand +} + +func ChangeRepeatModeCommandFrom(ptr unsafe.Pointer) ChangeRepeatModeCommand { + return ChangeRepeatModeCommand{ + RemoteCommand: RemoteCommandFrom(ptr), + } +} + +func (cc _ChangeRepeatModeCommandClass) Alloc() ChangeRepeatModeCommand { + rv := objc.Call[ChangeRepeatModeCommand](cc, objc.Sel("alloc")) + return rv +} + +func ChangeRepeatModeCommand_Alloc() ChangeRepeatModeCommand { + return ChangeRepeatModeCommandClass.Alloc() +} + +func (cc _ChangeRepeatModeCommandClass) New() ChangeRepeatModeCommand { + rv := objc.Call[ChangeRepeatModeCommand](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangeRepeatModeCommand() ChangeRepeatModeCommand { + return ChangeRepeatModeCommandClass.New() +} + +func (c_ ChangeRepeatModeCommand) Init() ChangeRepeatModeCommand { + rv := objc.Call[ChangeRepeatModeCommand](c_, objc.Sel("init")) + return rv +} + +// The current repeat option for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangerepeatmodecommand/1648342-currentrepeattype?language=objc +func (c_ ChangeRepeatModeCommand) CurrentRepeatType() RepeatType { + rv := objc.Call[RepeatType](c_, objc.Sel("currentRepeatType")) + return rv +} + +// The current repeat option for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangerepeatmodecommand/1648342-currentrepeattype?language=objc +func (c_ ChangeRepeatModeCommand) SetCurrentRepeatType(value RepeatType) { + objc.Call[objc.Void](c_, objc.Sel("setCurrentRepeatType:"), value) +} diff --git a/macos/mediaplayer/change_repeat_mode_command_event.gen.go b/macos/mediaplayer/change_repeat_mode_command_event.gen.go new file mode 100644 index 00000000..5c0dc6fc --- /dev/null +++ b/macos/mediaplayer/change_repeat_mode_command_event.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangeRepeatModeCommandEvent] class. +var ChangeRepeatModeCommandEventClass = _ChangeRepeatModeCommandEventClass{objc.GetClass("MPChangeRepeatModeCommandEvent")} + +type _ChangeRepeatModeCommandEventClass struct { + objc.Class +} + +// An interface definition for the [ChangeRepeatModeCommandEvent] class. +type IChangeRepeatModeCommandEvent interface { + IRemoteCommandEvent + RepeatType() RepeatType + PreservesRepeatMode() bool +} + +// An event requesting a change in the repeat mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangerepeatmodecommandevent?language=objc +type ChangeRepeatModeCommandEvent struct { + RemoteCommandEvent +} + +func ChangeRepeatModeCommandEventFrom(ptr unsafe.Pointer) ChangeRepeatModeCommandEvent { + return ChangeRepeatModeCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (cc _ChangeRepeatModeCommandEventClass) Alloc() ChangeRepeatModeCommandEvent { + rv := objc.Call[ChangeRepeatModeCommandEvent](cc, objc.Sel("alloc")) + return rv +} + +func ChangeRepeatModeCommandEvent_Alloc() ChangeRepeatModeCommandEvent { + return ChangeRepeatModeCommandEventClass.Alloc() +} + +func (cc _ChangeRepeatModeCommandEventClass) New() ChangeRepeatModeCommandEvent { + rv := objc.Call[ChangeRepeatModeCommandEvent](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangeRepeatModeCommandEvent() ChangeRepeatModeCommandEvent { + return ChangeRepeatModeCommandEventClass.New() +} + +func (c_ ChangeRepeatModeCommandEvent) Init() ChangeRepeatModeCommandEvent { + rv := objc.Call[ChangeRepeatModeCommandEvent](c_, objc.Sel("init")) + return rv +} + +// The repeat type used when fulfilling the event request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangerepeatmodecommandevent/1649689-repeattype?language=objc +func (c_ ChangeRepeatModeCommandEvent) RepeatType() RepeatType { + rv := objc.Call[RepeatType](c_, objc.Sel("repeatType")) + return rv +} + +// A Boolean value that indicates whether the chosen repeat mode is preserved between playback sessions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangerepeatmodecommandevent/2097553-preservesrepeatmode?language=objc +func (c_ ChangeRepeatModeCommandEvent) PreservesRepeatMode() bool { + rv := objc.Call[bool](c_, objc.Sel("preservesRepeatMode")) + return rv +} diff --git a/macos/mediaplayer/change_shuffle_mode_command.gen.go b/macos/mediaplayer/change_shuffle_mode_command.gen.go new file mode 100644 index 00000000..317a4780 --- /dev/null +++ b/macos/mediaplayer/change_shuffle_mode_command.gen.go @@ -0,0 +1,75 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangeShuffleModeCommand] class. +var ChangeShuffleModeCommandClass = _ChangeShuffleModeCommandClass{objc.GetClass("MPChangeShuffleModeCommand")} + +type _ChangeShuffleModeCommandClass struct { + objc.Class +} + +// An interface definition for the [ChangeShuffleModeCommand] class. +type IChangeShuffleModeCommand interface { + IRemoteCommand + CurrentShuffleType() ShuffleType + SetCurrentShuffleType(value ShuffleType) +} + +// An object that responds to requests to change the current shuffle mode used during playback. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeshufflemodecommand?language=objc +type ChangeShuffleModeCommand struct { + RemoteCommand +} + +func ChangeShuffleModeCommandFrom(ptr unsafe.Pointer) ChangeShuffleModeCommand { + return ChangeShuffleModeCommand{ + RemoteCommand: RemoteCommandFrom(ptr), + } +} + +func (cc _ChangeShuffleModeCommandClass) Alloc() ChangeShuffleModeCommand { + rv := objc.Call[ChangeShuffleModeCommand](cc, objc.Sel("alloc")) + return rv +} + +func ChangeShuffleModeCommand_Alloc() ChangeShuffleModeCommand { + return ChangeShuffleModeCommandClass.Alloc() +} + +func (cc _ChangeShuffleModeCommandClass) New() ChangeShuffleModeCommand { + rv := objc.Call[ChangeShuffleModeCommand](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangeShuffleModeCommand() ChangeShuffleModeCommand { + return ChangeShuffleModeCommandClass.New() +} + +func (c_ ChangeShuffleModeCommand) Init() ChangeShuffleModeCommand { + rv := objc.Call[ChangeShuffleModeCommand](c_, objc.Sel("init")) + return rv +} + +// The current shuffle mode for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeshufflemodecommand/1648341-currentshuffletype?language=objc +func (c_ ChangeShuffleModeCommand) CurrentShuffleType() ShuffleType { + rv := objc.Call[ShuffleType](c_, objc.Sel("currentShuffleType")) + return rv +} + +// The current shuffle mode for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeshufflemodecommand/1648341-currentshuffletype?language=objc +func (c_ ChangeShuffleModeCommand) SetCurrentShuffleType(value ShuffleType) { + objc.Call[objc.Void](c_, objc.Sel("setCurrentShuffleType:"), value) +} diff --git a/macos/mediaplayer/change_shuffle_mode_command_event.gen.go b/macos/mediaplayer/change_shuffle_mode_command_event.gen.go new file mode 100644 index 00000000..68cff2af --- /dev/null +++ b/macos/mediaplayer/change_shuffle_mode_command_event.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ChangeShuffleModeCommandEvent] class. +var ChangeShuffleModeCommandEventClass = _ChangeShuffleModeCommandEventClass{objc.GetClass("MPChangeShuffleModeCommandEvent")} + +type _ChangeShuffleModeCommandEventClass struct { + objc.Class +} + +// An interface definition for the [ChangeShuffleModeCommandEvent] class. +type IChangeShuffleModeCommandEvent interface { + IRemoteCommandEvent + PreservesShuffleMode() bool + ShuffleType() ShuffleType +} + +// An event requesting a change in the shuffle mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeshufflemodecommandevent?language=objc +type ChangeShuffleModeCommandEvent struct { + RemoteCommandEvent +} + +func ChangeShuffleModeCommandEventFrom(ptr unsafe.Pointer) ChangeShuffleModeCommandEvent { + return ChangeShuffleModeCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (cc _ChangeShuffleModeCommandEventClass) Alloc() ChangeShuffleModeCommandEvent { + rv := objc.Call[ChangeShuffleModeCommandEvent](cc, objc.Sel("alloc")) + return rv +} + +func ChangeShuffleModeCommandEvent_Alloc() ChangeShuffleModeCommandEvent { + return ChangeShuffleModeCommandEventClass.Alloc() +} + +func (cc _ChangeShuffleModeCommandEventClass) New() ChangeShuffleModeCommandEvent { + rv := objc.Call[ChangeShuffleModeCommandEvent](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewChangeShuffleModeCommandEvent() ChangeShuffleModeCommandEvent { + return ChangeShuffleModeCommandEventClass.New() +} + +func (c_ ChangeShuffleModeCommandEvent) Init() ChangeShuffleModeCommandEvent { + rv := objc.Call[ChangeShuffleModeCommandEvent](c_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the shuffle mode is preserved between playback sessions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeshufflemodecommandevent/2097552-preservesshufflemode?language=objc +func (c_ ChangeShuffleModeCommandEvent) PreservesShuffleMode() bool { + rv := objc.Call[bool](c_, objc.Sel("preservesShuffleMode")) + return rv +} + +// The shuffle type used when fulfilling the event request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangeshufflemodecommandevent/1649696-shuffletype?language=objc +func (c_ ChangeShuffleModeCommandEvent) ShuffleType() ShuffleType { + rv := objc.Call[ShuffleType](c_, objc.Sel("shuffleType")) + return rv +} diff --git a/macos/mediaplayer/content_item.gen.go b/macos/mediaplayer/content_item.gen.go new file mode 100644 index 00000000..def6f091 --- /dev/null +++ b/macos/mediaplayer/content_item.gen.go @@ -0,0 +1,217 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContentItem] class. +var ContentItemClass = _ContentItemClass{objc.GetClass("MPContentItem")} + +type _ContentItemClass struct { + objc.Class +} + +// An interface definition for the [ContentItem] class. +type IContentItem interface { + objc.IObject + Subtitle() string + SetSubtitle(value string) + PlaybackProgress() float64 + SetPlaybackProgress(value float64) + Artwork() MediaItemArtwork + SetArtwork(value IMediaItemArtwork) + IsStreamingContent() bool + SetStreamingContent(value bool) + IsContainer() bool + SetContainer(value bool) + Title() string + SetTitle(value string) + IsExplicitContent() bool + SetExplicitContent(value bool) + Identifier() string + IsPlayable() bool + SetPlayable(value bool) +} + +// An object that contains the information for a displayed media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem?language=objc +type ContentItem struct { + objc.Object +} + +func ContentItemFrom(ptr unsafe.Pointer) ContentItem { + return ContentItem{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ ContentItem) InitWithIdentifier(identifier string) ContentItem { + rv := objc.Call[ContentItem](c_, objc.Sel("initWithIdentifier:"), identifier) + return rv +} + +// Sets the identifier for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620152-initwithidentifier?language=objc +func NewContentItemWithIdentifier(identifier string) ContentItem { + instance := ContentItemClass.Alloc().InitWithIdentifier(identifier) + instance.Autorelease() + return instance +} + +func (cc _ContentItemClass) Alloc() ContentItem { + rv := objc.Call[ContentItem](cc, objc.Sel("alloc")) + return rv +} + +func ContentItem_Alloc() ContentItem { + return ContentItemClass.Alloc() +} + +func (cc _ContentItemClass) New() ContentItem { + rv := objc.Call[ContentItem](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContentItem() ContentItem { + return ContentItemClass.New() +} + +func (c_ ContentItem) Init() ContentItem { + rv := objc.Call[ContentItem](c_, objc.Sel("init")) + return rv +} + +// A secondary designator for the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620155-subtitle?language=objc +func (c_ ContentItem) Subtitle() string { + rv := objc.Call[string](c_, objc.Sel("subtitle")) + return rv +} + +// A secondary designator for the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620155-subtitle?language=objc +func (c_ ContentItem) SetSubtitle(value string) { + objc.Call[objc.Void](c_, objc.Sel("setSubtitle:"), value) +} + +// The amount of content played for the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620153-playbackprogress?language=objc +func (c_ ContentItem) PlaybackProgress() float64 { + rv := objc.Call[float64](c_, objc.Sel("playbackProgress")) + return rv +} + +// The amount of content played for the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620153-playbackprogress?language=objc +func (c_ ContentItem) SetPlaybackProgress(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPlaybackProgress:"), value) +} + +// A single image that’s associated with the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620160-artwork?language=objc +func (c_ ContentItem) Artwork() MediaItemArtwork { + rv := objc.Call[MediaItemArtwork](c_, objc.Sel("artwork")) + return rv +} + +// A single image that’s associated with the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620160-artwork?language=objc +func (c_ ContentItem) SetArtwork(value IMediaItemArtwork) { + objc.Call[objc.Void](c_, objc.Sel("setArtwork:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether the content item is streaming content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1771745-streamingcontent?language=objc +func (c_ ContentItem) IsStreamingContent() bool { + rv := objc.Call[bool](c_, objc.Sel("isStreamingContent")) + return rv +} + +// A Boolean value that indicates whether the content item is streaming content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1771745-streamingcontent?language=objc +func (c_ ContentItem) SetStreamingContent(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setStreamingContent:"), value) +} + +// A Boolean value that indicates whether a media item is container of other items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620154-container?language=objc +func (c_ ContentItem) IsContainer() bool { + rv := objc.Call[bool](c_, objc.Sel("isContainer")) + return rv +} + +// A Boolean value that indicates whether a media item is container of other items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620154-container?language=objc +func (c_ ContentItem) SetContainer(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setContainer:"), value) +} + +// The public name of the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620156-title?language=objc +func (c_ ContentItem) Title() string { + rv := objc.Call[string](c_, objc.Sel("title")) + return rv +} + +// The public name of the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620156-title?language=objc +func (c_ ContentItem) SetTitle(value string) { + objc.Call[objc.Void](c_, objc.Sel("setTitle:"), value) +} + +// A Boolean value that indicates whether the media item contains explicit content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1771744-explicitcontent?language=objc +func (c_ ContentItem) IsExplicitContent() bool { + rv := objc.Call[bool](c_, objc.Sel("isExplicitContent")) + return rv +} + +// A Boolean value that indicates whether the media item contains explicit content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1771744-explicitcontent?language=objc +func (c_ ContentItem) SetExplicitContent(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setExplicitContent:"), value) +} + +// The unique identifier for the media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620157-identifier?language=objc +func (c_ ContentItem) Identifier() string { + rv := objc.Call[string](c_, objc.Sel("identifier")) + return rv +} + +// A Boolean value that indicates whether a media item is able to be played. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620158-playable?language=objc +func (c_ ContentItem) IsPlayable() bool { + rv := objc.Call[bool](c_, objc.Sel("isPlayable")) + return rv +} + +// A Boolean value that indicates whether a media item is able to be played. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpcontentitem/1620158-playable?language=objc +func (c_ ContentItem) SetPlayable(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setPlayable:"), value) +} diff --git a/macos/mediaplayer/doc.gen.go b/macos/mediaplayer/doc.gen.go new file mode 100644 index 00000000..c7237532 --- /dev/null +++ b/macos/mediaplayer/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Find and play songs, audio podcasts, audio books, and more from within your app. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/mediaplayer?language=objc +package mediaplayer diff --git a/macos/mediaplayer/enumtypes.gen.go b/macos/mediaplayer/enumtypes.gen.go new file mode 100644 index 00000000..fc58c9a3 --- /dev/null +++ b/macos/mediaplayer/enumtypes.gen.go @@ -0,0 +1,137 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import "math" + +// The states that determine when language option changes take effect. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpchangelanguageoptionsetting?language=objc +type ChangeLanguageOptionSetting int + +const ( + ChangeLanguageOptionSettingNone ChangeLanguageOptionSetting = 0 + ChangeLanguageOptionSettingNowPlayingItemOnly ChangeLanguageOptionSetting = 1 + ChangeLanguageOptionSettingPermanent ChangeLanguageOptionSetting = 2 +) + +// An enumeration that represents error codes for framework operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mperrorcode?language=objc +type ErrorCode int + +const ( + ErrorCancelled ErrorCode = 6 + ErrorCloudServiceCapabilityMissing ErrorCode = 2 + ErrorNetworkConnectionFailed ErrorCode = 3 + ErrorNotFound ErrorCode = 4 + ErrorNotSupported ErrorCode = 5 + ErrorPermissionDenied ErrorCode = 1 + ErrorRequestTimedOut ErrorCode = 7 + ErrorUnknown ErrorCode = 0 +) + +// Defines the type for storing a persistent identifier to a particular entity. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpmediaentitypersistentid?language=objc +type MediaEntityPersistentID uint64 + +// The properties for defining the type for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpmediatype?language=objc +type MediaType uint + +const ( + MediaTypeAny MediaType = math.MaxUint + MediaTypeAnyAudio MediaType = 255 + MediaTypeAnyVideo MediaType = 65280 + MediaTypeAudioBook MediaType = 4 + MediaTypeAudioITunesU MediaType = 8 + MediaTypeHomeVideo MediaType = 8192 + MediaTypeMovie MediaType = 256 + MediaTypeMusic MediaType = 1 + MediaTypeMusicVideo MediaType = 2048 + MediaTypePodcast MediaType = 2 + MediaTypeTVShow MediaType = 512 + MediaTypeVideoITunesU MediaType = 4096 + MediaTypeVideoPodcast MediaType = 1024 +) + +// The language option type to use for the Now Playing item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiontype?language=objc +type NowPlayingInfoLanguageOptionType uint + +const ( + NowPlayingInfoLanguageOptionTypeAudible NowPlayingInfoLanguageOptionType = 0 + NowPlayingInfoLanguageOptionTypeLegible NowPlayingInfoLanguageOptionType = 1 +) + +// The type of media currently playing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfomediatype?language=objc +type NowPlayingInfoMediaType uint + +const ( + NowPlayingInfoMediaTypeAudio NowPlayingInfoMediaType = 1 + NowPlayingInfoMediaTypeNone NowPlayingInfoMediaType = 0 + NowPlayingInfoMediaTypeVideo NowPlayingInfoMediaType = 2 +) + +// The playback state of the app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayingplaybackstate?language=objc +type NowPlayingPlaybackState uint + +const ( + NowPlayingPlaybackStateInterrupted NowPlayingPlaybackState = 4 + NowPlayingPlaybackStatePaused NowPlayingPlaybackState = 2 + NowPlayingPlaybackStatePlaying NowPlayingPlaybackState = 1 + NowPlayingPlaybackStateStopped NowPlayingPlaybackState = 3 + NowPlayingPlaybackStateUnknown NowPlayingPlaybackState = 0 +) + +// Constants indicating the status of a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandhandlerstatus?language=objc +type RemoteCommandHandlerStatus int + +const ( + RemoteCommandHandlerStatusCommandFailed RemoteCommandHandlerStatus = 200 + RemoteCommandHandlerStatusDeviceNotFound RemoteCommandHandlerStatus = 120 + RemoteCommandHandlerStatusNoActionableNowPlayingItem RemoteCommandHandlerStatus = 110 + RemoteCommandHandlerStatusNoSuchContent RemoteCommandHandlerStatus = 100 + RemoteCommandHandlerStatusSuccess RemoteCommandHandlerStatus = 0 +) + +// Indicates which items to play repeatedly. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mprepeattype?language=objc +type RepeatType int + +const ( + RepeatTypeAll RepeatType = 2 + RepeatTypeOff RepeatType = 0 + RepeatTypeOne RepeatType = 1 +) + +// Defines the beginning and ending of seek events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpseekcommandeventtype?language=objc +type SeekCommandEventType uint + +const ( + SeekCommandEventTypeBeginSeeking SeekCommandEventType = 0 + SeekCommandEventTypeEndSeeking SeekCommandEventType = 1 +) + +// Indicates which item types to shuffle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpshuffletype?language=objc +type ShuffleType int + +const ( + ShuffleTypeCollections ShuffleType = 2 + ShuffleTypeItems ShuffleType = 1 + ShuffleTypeOff ShuffleType = 0 +) diff --git a/macos/mediaplayer/feedback_command.gen.go b/macos/mediaplayer/feedback_command.gen.go new file mode 100644 index 00000000..d09d7126 --- /dev/null +++ b/macos/mediaplayer/feedback_command.gen.go @@ -0,0 +1,109 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FeedbackCommand] class. +var FeedbackCommandClass = _FeedbackCommandClass{objc.GetClass("MPFeedbackCommand")} + +type _FeedbackCommandClass struct { + objc.Class +} + +// An interface definition for the [FeedbackCommand] class. +type IFeedbackCommand interface { + IRemoteCommand + IsActive() bool + SetActive(value bool) + LocalizedTitle() string + SetLocalizedTitle(value string) + LocalizedShortTitle() string + SetLocalizedShortTitle(value string) +} + +// An object that reflects the feedback state for the playing item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommand?language=objc +type FeedbackCommand struct { + RemoteCommand +} + +func FeedbackCommandFrom(ptr unsafe.Pointer) FeedbackCommand { + return FeedbackCommand{ + RemoteCommand: RemoteCommandFrom(ptr), + } +} + +func (fc _FeedbackCommandClass) Alloc() FeedbackCommand { + rv := objc.Call[FeedbackCommand](fc, objc.Sel("alloc")) + return rv +} + +func FeedbackCommand_Alloc() FeedbackCommand { + return FeedbackCommandClass.Alloc() +} + +func (fc _FeedbackCommandClass) New() FeedbackCommand { + rv := objc.Call[FeedbackCommand](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFeedbackCommand() FeedbackCommand { + return FeedbackCommandClass.New() +} + +func (f_ FeedbackCommand) Init() FeedbackCommand { + rv := objc.Call[FeedbackCommand](f_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether the feedback’s action is on or off. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommand/1622900-active?language=objc +func (f_ FeedbackCommand) IsActive() bool { + rv := objc.Call[bool](f_, objc.Sel("isActive")) + return rv +} + +// A Boolean value that indicates whether the feedback’s action is on or off. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommand/1622900-active?language=objc +func (f_ FeedbackCommand) SetActive(value bool) { + objc.Call[objc.Void](f_, objc.Sel("setActive:"), value) +} + +// A localized string used to describe the context of a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommand/1622905-localizedtitle?language=objc +func (f_ FeedbackCommand) LocalizedTitle() string { + rv := objc.Call[string](f_, objc.Sel("localizedTitle")) + return rv +} + +// A localized string used to describe the context of a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommand/1622905-localizedtitle?language=objc +func (f_ FeedbackCommand) SetLocalizedTitle(value string) { + objc.Call[objc.Void](f_, objc.Sel("setLocalizedTitle:"), value) +} + +// A shortened version of the string used to describe the context of a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommand/1622916-localizedshorttitle?language=objc +func (f_ FeedbackCommand) LocalizedShortTitle() string { + rv := objc.Call[string](f_, objc.Sel("localizedShortTitle")) + return rv +} + +// A shortened version of the string used to describe the context of a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommand/1622916-localizedshorttitle?language=objc +func (f_ FeedbackCommand) SetLocalizedShortTitle(value string) { + objc.Call[objc.Void](f_, objc.Sel("setLocalizedShortTitle:"), value) +} diff --git a/macos/mediaplayer/feedback_command_event.gen.go b/macos/mediaplayer/feedback_command_event.gen.go new file mode 100644 index 00000000..fef2c231 --- /dev/null +++ b/macos/mediaplayer/feedback_command_event.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FeedbackCommandEvent] class. +var FeedbackCommandEventClass = _FeedbackCommandEventClass{objc.GetClass("MPFeedbackCommandEvent")} + +type _FeedbackCommandEventClass struct { + objc.Class +} + +// An interface definition for the [FeedbackCommandEvent] class. +type IFeedbackCommandEvent interface { + IRemoteCommandEvent + IsNegative() bool +} + +// An event requesting a change in the feedback setting. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommandevent?language=objc +type FeedbackCommandEvent struct { + RemoteCommandEvent +} + +func FeedbackCommandEventFrom(ptr unsafe.Pointer) FeedbackCommandEvent { + return FeedbackCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (fc _FeedbackCommandEventClass) Alloc() FeedbackCommandEvent { + rv := objc.Call[FeedbackCommandEvent](fc, objc.Sel("alloc")) + return rv +} + +func FeedbackCommandEvent_Alloc() FeedbackCommandEvent { + return FeedbackCommandEventClass.Alloc() +} + +func (fc _FeedbackCommandEventClass) New() FeedbackCommandEvent { + rv := objc.Call[FeedbackCommandEvent](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFeedbackCommandEvent() FeedbackCommandEvent { + return FeedbackCommandEventClass.New() +} + +func (f_ FeedbackCommandEvent) Init() FeedbackCommandEvent { + rv := objc.Call[FeedbackCommandEvent](f_, objc.Sel("init")) + return rv +} + +// A Boolean value that indicates whether an app should perform a negative command appropriate to the target. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpfeedbackcommandevent/1616773-negative?language=objc +func (f_ FeedbackCommandEvent) IsNegative() bool { + rv := objc.Call[bool](f_, objc.Sel("isNegative")) + return rv +} diff --git a/macos/mediaplayer/media_item_artwork.gen.go b/macos/mediaplayer/media_item_artwork.gen.go new file mode 100644 index 00000000..1f963e81 --- /dev/null +++ b/macos/mediaplayer/media_item_artwork.gen.go @@ -0,0 +1,101 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MediaItemArtwork] class. +var MediaItemArtworkClass = _MediaItemArtworkClass{objc.GetClass("MPMediaItemArtwork")} + +type _MediaItemArtworkClass struct { + objc.Class +} + +// An interface definition for the [MediaItemArtwork] class. +type IMediaItemArtwork interface { + objc.IObject + ImageWithSize(size coregraphics.Size) appkit.Image + Bounds() coregraphics.Rect + ImageCropRect() coregraphics.Rect +} + +// A graphical image, such as music album cover art, associated with a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpmediaitemartwork?language=objc +type MediaItemArtwork struct { + objc.Object +} + +func MediaItemArtworkFrom(ptr unsafe.Pointer) MediaItemArtwork { + return MediaItemArtwork{ + Object: objc.ObjectFrom(ptr), + } +} + +func (m_ MediaItemArtwork) InitWithBoundsSizeRequestHandler(boundsSize coregraphics.Size, requestHandler func(size coregraphics.Size) appkit.Image) MediaItemArtwork { + rv := objc.Call[MediaItemArtwork](m_, objc.Sel("initWithBoundsSize:requestHandler:"), boundsSize, requestHandler) + return rv +} + +// Creates a new image from existing artwork with the specified bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpmediaitemartwork/1649704-initwithboundssize?language=objc +func NewMediaItemArtworkWithBoundsSizeRequestHandler(boundsSize coregraphics.Size, requestHandler func(size coregraphics.Size) appkit.Image) MediaItemArtwork { + instance := MediaItemArtworkClass.Alloc().InitWithBoundsSizeRequestHandler(boundsSize, requestHandler) + instance.Autorelease() + return instance +} + +func (mc _MediaItemArtworkClass) Alloc() MediaItemArtwork { + rv := objc.Call[MediaItemArtwork](mc, objc.Sel("alloc")) + return rv +} + +func MediaItemArtwork_Alloc() MediaItemArtwork { + return MediaItemArtworkClass.Alloc() +} + +func (mc _MediaItemArtworkClass) New() MediaItemArtwork { + rv := objc.Call[MediaItemArtwork](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMediaItemArtwork() MediaItemArtwork { + return MediaItemArtworkClass.New() +} + +func (m_ MediaItemArtwork) Init() MediaItemArtwork { + rv := objc.Call[MediaItemArtwork](m_, objc.Sel("init")) + return rv +} + +// Returns the artwork image for an item at the given size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpmediaitemartwork/1621736-imagewithsize?language=objc +func (m_ MediaItemArtwork) ImageWithSize(size coregraphics.Size) appkit.Image { + rv := objc.Call[appkit.Image](m_, objc.Sel("imageWithSize:"), size) + return rv +} + +// The maximum size, in points, of the image associated with the media item artwork. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpmediaitemartwork/1621723-bounds?language=objc +func (m_ MediaItemArtwork) Bounds() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](m_, objc.Sel("bounds")) + return rv +} + +// The bounds, in points, of the content area for the full size image associated with the media item artwork. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpmediaitemartwork/1621760-imagecroprect?language=objc +func (m_ MediaItemArtwork) ImageCropRect() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](m_, objc.Sel("imageCropRect")) + return rv +} diff --git a/macos/mediaplayer/mediaplayer.go b/macos/mediaplayer/mediaplayer.go new file mode 100644 index 00000000..95a48740 --- /dev/null +++ b/macos/mediaplayer/mediaplayer.go @@ -0,0 +1,6 @@ +//go:generate go run ../../generate/tools/genmod.go +package mediaplayer + +// #cgo CFLAGS: -x objective-c +// #cgo LDFLAGS: -framework MediaPlayer +import "C" diff --git a/macos/mediaplayer/mediaplayer_custom.go b/macos/mediaplayer/mediaplayer_custom.go new file mode 100644 index 00000000..fb5e20bb --- /dev/null +++ b/macos/mediaplayer/mediaplayer_custom.go @@ -0,0 +1 @@ +package mediaplayer diff --git a/macos/mediaplayer/mediaplayer_test.go b/macos/mediaplayer/mediaplayer_test.go new file mode 100644 index 00000000..96408535 --- /dev/null +++ b/macos/mediaplayer/mediaplayer_test.go @@ -0,0 +1,5 @@ +package mediaplayer + +import "testing" + +func TestMediaPlayerValid(t *testing.T) {} diff --git a/macos/mediaplayer/now_playing_info_center.gen.go b/macos/mediaplayer/now_playing_info_center.gen.go new file mode 100644 index 00000000..04f3c0d9 --- /dev/null +++ b/macos/mediaplayer/now_playing_info_center.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NowPlayingInfoCenter] class. +var NowPlayingInfoCenterClass = _NowPlayingInfoCenterClass{objc.GetClass("MPNowPlayingInfoCenter")} + +type _NowPlayingInfoCenterClass struct { + objc.Class +} + +// An interface definition for the [NowPlayingInfoCenter] class. +type INowPlayingInfoCenter interface { + objc.IObject + PlaybackState() NowPlayingPlaybackState + SetPlaybackState(value NowPlayingPlaybackState) + NowPlayingInfo() map[string]objc.Object + SetNowPlayingInfo(value map[string]objc.IObject) +} + +// An object for setting the Now Playing information for media that your app plays. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter?language=objc +type NowPlayingInfoCenter struct { + objc.Object +} + +func NowPlayingInfoCenterFrom(ptr unsafe.Pointer) NowPlayingInfoCenter { + return NowPlayingInfoCenter{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NowPlayingInfoCenterClass) Alloc() NowPlayingInfoCenter { + rv := objc.Call[NowPlayingInfoCenter](nc, objc.Sel("alloc")) + return rv +} + +func NowPlayingInfoCenter_Alloc() NowPlayingInfoCenter { + return NowPlayingInfoCenterClass.Alloc() +} + +func (nc _NowPlayingInfoCenterClass) New() NowPlayingInfoCenter { + rv := objc.Call[NowPlayingInfoCenter](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNowPlayingInfoCenter() NowPlayingInfoCenter { + return NowPlayingInfoCenterClass.New() +} + +func (n_ NowPlayingInfoCenter) Init() NowPlayingInfoCenter { + rv := objc.Call[NowPlayingInfoCenter](n_, objc.Sel("init")) + return rv +} + +// Returns the singleton Now Playing info center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter/1615899-defaultcenter?language=objc +func (nc _NowPlayingInfoCenterClass) DefaultCenter() NowPlayingInfoCenter { + rv := objc.Call[NowPlayingInfoCenter](nc, objc.Sel("defaultCenter")) + return rv +} + +// Returns the singleton Now Playing info center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter/1615899-defaultcenter?language=objc +func NowPlayingInfoCenter_DefaultCenter() NowPlayingInfoCenter { + return NowPlayingInfoCenterClass.DefaultCenter() +} + +// The current playback state of the app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter/2588243-playbackstate?language=objc +func (n_ NowPlayingInfoCenter) PlaybackState() NowPlayingPlaybackState { + rv := objc.Call[NowPlayingPlaybackState](n_, objc.Sel("playbackState")) + return rv +} + +// The current playback state of the app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter/2588243-playbackstate?language=objc +func (n_ NowPlayingInfoCenter) SetPlaybackState(value NowPlayingPlaybackState) { + objc.Call[objc.Void](n_, objc.Sel("setPlaybackState:"), value) +} + +// The current Now Playing information for the default Now Playing info center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter/1615903-nowplayinginfo?language=objc +func (n_ NowPlayingInfoCenter) NowPlayingInfo() map[string]objc.Object { + rv := objc.Call[map[string]objc.Object](n_, objc.Sel("nowPlayingInfo")) + return rv +} + +// The current Now Playing information for the default Now Playing info center. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter/1615903-nowplayinginfo?language=objc +func (n_ NowPlayingInfoCenter) SetNowPlayingInfo(value map[string]objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setNowPlayingInfo:"), value) +} diff --git a/macos/mediaplayer/now_playing_info_language_option.gen.go b/macos/mediaplayer/now_playing_info_language_option.gen.go new file mode 100644 index 00000000..eb573140 --- /dev/null +++ b/macos/mediaplayer/now_playing_info_language_option.gen.go @@ -0,0 +1,135 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NowPlayingInfoLanguageOption] class. +var NowPlayingInfoLanguageOptionClass = _NowPlayingInfoLanguageOptionClass{objc.GetClass("MPNowPlayingInfoLanguageOption")} + +type _NowPlayingInfoLanguageOptionClass struct { + objc.Class +} + +// An interface definition for the [NowPlayingInfoLanguageOption] class. +type INowPlayingInfoLanguageOption interface { + objc.IObject + IsAutomaticLegibleLanguageOption() bool + IsAutomaticAudibleLanguageOption() bool + LanguageOptionType() NowPlayingInfoLanguageOptionType + LanguageTag() string + LanguageOptionCharacteristics() []string + DisplayName() string + Identifier() string +} + +// A set of interfaces for setting the language option for the Now Playing item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption?language=objc +type NowPlayingInfoLanguageOption struct { + objc.Object +} + +func NowPlayingInfoLanguageOptionFrom(ptr unsafe.Pointer) NowPlayingInfoLanguageOption { + return NowPlayingInfoLanguageOption{ + Object: objc.ObjectFrom(ptr), + } +} + +func (n_ NowPlayingInfoLanguageOption) InitWithTypeLanguageTagCharacteristicsDisplayNameIdentifier(languageOptionType NowPlayingInfoLanguageOptionType, languageTag string, languageOptionCharacteristics []string, displayName string, identifier string) NowPlayingInfoLanguageOption { + rv := objc.Call[NowPlayingInfoLanguageOption](n_, objc.Sel("initWithType:languageTag:characteristics:displayName:identifier:"), languageOptionType, languageTag, languageOptionCharacteristics, displayName, identifier) + return rv +} + +// Creates a single language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623159-initwithtype?language=objc +func NewNowPlayingInfoLanguageOptionWithTypeLanguageTagCharacteristicsDisplayNameIdentifier(languageOptionType NowPlayingInfoLanguageOptionType, languageTag string, languageOptionCharacteristics []string, displayName string, identifier string) NowPlayingInfoLanguageOption { + instance := NowPlayingInfoLanguageOptionClass.Alloc().InitWithTypeLanguageTagCharacteristicsDisplayNameIdentifier(languageOptionType, languageTag, languageOptionCharacteristics, displayName, identifier) + instance.Autorelease() + return instance +} + +func (nc _NowPlayingInfoLanguageOptionClass) Alloc() NowPlayingInfoLanguageOption { + rv := objc.Call[NowPlayingInfoLanguageOption](nc, objc.Sel("alloc")) + return rv +} + +func NowPlayingInfoLanguageOption_Alloc() NowPlayingInfoLanguageOption { + return NowPlayingInfoLanguageOptionClass.Alloc() +} + +func (nc _NowPlayingInfoLanguageOptionClass) New() NowPlayingInfoLanguageOption { + rv := objc.Call[NowPlayingInfoLanguageOption](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNowPlayingInfoLanguageOption() NowPlayingInfoLanguageOption { + return NowPlayingInfoLanguageOptionClass.New() +} + +func (n_ NowPlayingInfoLanguageOption) Init() NowPlayingInfoLanguageOption { + rv := objc.Call[NowPlayingInfoLanguageOption](n_, objc.Sel("init")) + return rv +} + +// Returns a Boolean value that determines whether to use the best legible language option based on the system preferences. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623144-isautomaticlegiblelanguageoption?language=objc +func (n_ NowPlayingInfoLanguageOption) IsAutomaticLegibleLanguageOption() bool { + rv := objc.Call[bool](n_, objc.Sel("isAutomaticLegibleLanguageOption")) + return rv +} + +// Returns a Boolean value that determines whether to use the best audible language option based on the system preferences. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623151-isautomaticaudiblelanguageoption?language=objc +func (n_ NowPlayingInfoLanguageOption) IsAutomaticAudibleLanguageOption() bool { + rv := objc.Call[bool](n_, objc.Sel("isAutomaticAudibleLanguageOption")) + return rv +} + +// The type of language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623153-languageoptiontype?language=objc +func (n_ NowPlayingInfoLanguageOption) LanguageOptionType() NowPlayingInfoLanguageOptionType { + rv := objc.Call[NowPlayingInfoLanguageOptionType](n_, objc.Sel("languageOptionType")) + return rv +} + +// The abbreviated language code for the language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623160-languagetag?language=objc +func (n_ NowPlayingInfoLanguageOption) LanguageTag() string { + rv := objc.Call[string](n_, objc.Sel("languageTag")) + return rv +} + +// The characteristics that describe the content of the language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623152-languageoptioncharacteristics?language=objc +func (n_ NowPlayingInfoLanguageOption) LanguageOptionCharacteristics() []string { + rv := objc.Call[[]string](n_, objc.Sel("languageOptionCharacteristics")) + return rv +} + +// The display name for a language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623145-displayname?language=objc +func (n_ NowPlayingInfoLanguageOption) DisplayName() string { + rv := objc.Call[string](n_, objc.Sel("displayName")) + return rv +} + +// The unique identifier for the language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption/1623135-identifier?language=objc +func (n_ NowPlayingInfoLanguageOption) Identifier() string { + rv := objc.Call[string](n_, objc.Sel("identifier")) + return rv +} diff --git a/macos/mediaplayer/now_playing_info_language_option_group.gen.go b/macos/mediaplayer/now_playing_info_language_option_group.gen.go new file mode 100644 index 00000000..13126d16 --- /dev/null +++ b/macos/mediaplayer/now_playing_info_language_option_group.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NowPlayingInfoLanguageOptionGroup] class. +var NowPlayingInfoLanguageOptionGroupClass = _NowPlayingInfoLanguageOptionGroupClass{objc.GetClass("MPNowPlayingInfoLanguageOptionGroup")} + +type _NowPlayingInfoLanguageOptionGroupClass struct { + objc.Class +} + +// An interface definition for the [NowPlayingInfoLanguageOptionGroup] class. +type INowPlayingInfoLanguageOptionGroup interface { + objc.IObject + AllowEmptySelection() bool +} + +// A grouped set of language options where only a single language option can be active at a time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiongroup?language=objc +type NowPlayingInfoLanguageOptionGroup struct { + objc.Object +} + +func NowPlayingInfoLanguageOptionGroupFrom(ptr unsafe.Pointer) NowPlayingInfoLanguageOptionGroup { + return NowPlayingInfoLanguageOptionGroup{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NowPlayingInfoLanguageOptionGroupClass) Alloc() NowPlayingInfoLanguageOptionGroup { + rv := objc.Call[NowPlayingInfoLanguageOptionGroup](nc, objc.Sel("alloc")) + return rv +} + +func NowPlayingInfoLanguageOptionGroup_Alloc() NowPlayingInfoLanguageOptionGroup { + return NowPlayingInfoLanguageOptionGroupClass.Alloc() +} + +func (nc _NowPlayingInfoLanguageOptionGroupClass) New() NowPlayingInfoLanguageOptionGroup { + rv := objc.Call[NowPlayingInfoLanguageOptionGroup](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNowPlayingInfoLanguageOptionGroup() NowPlayingInfoLanguageOptionGroup { + return NowPlayingInfoLanguageOptionGroupClass.New() +} + +func (n_ NowPlayingInfoLanguageOptionGroup) Init() NowPlayingInfoLanguageOptionGroup { + rv := objc.Call[NowPlayingInfoLanguageOptionGroup](n_, objc.Sel("init")) + return rv +} + +// A Boolean that indicates whether the system requires a selection for the language option group. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiongroup/1623161-allowemptyselection?language=objc +func (n_ NowPlayingInfoLanguageOptionGroup) AllowEmptySelection() bool { + rv := objc.Call[bool](n_, objc.Sel("allowEmptySelection")) + return rv +} diff --git a/macos/mediaplayer/protocols.gen.m b/macos/mediaplayer/protocols.gen.m new file mode 100644 index 00000000..894a65eb --- /dev/null +++ b/macos/mediaplayer/protocols.gen.m @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "MediaPlayer/MediaPlayer.h" + +void importMediaPlayerProtocols() { + id o; + o = @protocol(MPSystemMusicPlayerController); +} diff --git a/macos/mediaplayer/rating_command.gen.go b/macos/mediaplayer/rating_command.gen.go new file mode 100644 index 00000000..4681f191 --- /dev/null +++ b/macos/mediaplayer/rating_command.gen.go @@ -0,0 +1,92 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RatingCommand] class. +var RatingCommandClass = _RatingCommandClass{objc.GetClass("MPRatingCommand")} + +type _RatingCommandClass struct { + objc.Class +} + +// An interface definition for the [RatingCommand] class. +type IRatingCommand interface { + IRemoteCommand + MinimumRating() float64 + SetMinimumRating(value float64) + MaximumRating() float64 + SetMaximumRating(value float64) +} + +// An object that provides a detailed rating for the playing item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpratingcommand?language=objc +type RatingCommand struct { + RemoteCommand +} + +func RatingCommandFrom(ptr unsafe.Pointer) RatingCommand { + return RatingCommand{ + RemoteCommand: RemoteCommandFrom(ptr), + } +} + +func (rc _RatingCommandClass) Alloc() RatingCommand { + rv := objc.Call[RatingCommand](rc, objc.Sel("alloc")) + return rv +} + +func RatingCommand_Alloc() RatingCommand { + return RatingCommandClass.Alloc() +} + +func (rc _RatingCommandClass) New() RatingCommand { + rv := objc.Call[RatingCommand](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRatingCommand() RatingCommand { + return RatingCommandClass.New() +} + +func (r_ RatingCommand) Init() RatingCommand { + rv := objc.Call[RatingCommand](r_, objc.Sel("init")) + return rv +} + +// The minimum rating for a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpratingcommand/1622902-minimumrating?language=objc +func (r_ RatingCommand) MinimumRating() float64 { + rv := objc.Call[float64](r_, objc.Sel("minimumRating")) + return rv +} + +// The minimum rating for a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpratingcommand/1622902-minimumrating?language=objc +func (r_ RatingCommand) SetMinimumRating(value float64) { + objc.Call[objc.Void](r_, objc.Sel("setMinimumRating:"), value) +} + +// The maximum rating for a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpratingcommand/1622898-maximumrating?language=objc +func (r_ RatingCommand) MaximumRating() float64 { + rv := objc.Call[float64](r_, objc.Sel("maximumRating")) + return rv +} + +// The maximum rating for a command. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpratingcommand/1622898-maximumrating?language=objc +func (r_ RatingCommand) SetMaximumRating(value float64) { + objc.Call[objc.Void](r_, objc.Sel("setMaximumRating:"), value) +} diff --git a/macos/mediaplayer/rating_command_event.gen.go b/macos/mediaplayer/rating_command_event.gen.go new file mode 100644 index 00000000..487dd491 --- /dev/null +++ b/macos/mediaplayer/rating_command_event.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RatingCommandEvent] class. +var RatingCommandEventClass = _RatingCommandEventClass{objc.GetClass("MPRatingCommandEvent")} + +type _RatingCommandEventClass struct { + objc.Class +} + +// An interface definition for the [RatingCommandEvent] class. +type IRatingCommandEvent interface { + IRemoteCommandEvent + Rating() float64 +} + +// An event requesting a change in the rating. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpratingcommandevent?language=objc +type RatingCommandEvent struct { + RemoteCommandEvent +} + +func RatingCommandEventFrom(ptr unsafe.Pointer) RatingCommandEvent { + return RatingCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (rc _RatingCommandEventClass) Alloc() RatingCommandEvent { + rv := objc.Call[RatingCommandEvent](rc, objc.Sel("alloc")) + return rv +} + +func RatingCommandEvent_Alloc() RatingCommandEvent { + return RatingCommandEventClass.Alloc() +} + +func (rc _RatingCommandEventClass) New() RatingCommandEvent { + rv := objc.Call[RatingCommandEvent](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRatingCommandEvent() RatingCommandEvent { + return RatingCommandEventClass.New() +} + +func (r_ RatingCommandEvent) Init() RatingCommandEvent { + rv := objc.Call[RatingCommandEvent](r_, objc.Sel("init")) + return rv +} + +// The rating for the command event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpratingcommandevent/1616764-rating?language=objc +func (r_ RatingCommandEvent) Rating() float64 { + rv := objc.Call[float64](r_, objc.Sel("rating")) + return rv +} diff --git a/macos/mediaplayer/remote_command.gen.go b/macos/mediaplayer/remote_command.gen.go new file mode 100644 index 00000000..1d2c69a4 --- /dev/null +++ b/macos/mediaplayer/remote_command.gen.go @@ -0,0 +1,100 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RemoteCommand] class. +var RemoteCommandClass = _RemoteCommandClass{objc.GetClass("MPRemoteCommand")} + +type _RemoteCommandClass struct { + objc.Class +} + +// An interface definition for the [RemoteCommand] class. +type IRemoteCommand interface { + objc.IObject + AddTargetWithHandler(handler func(event RemoteCommandEvent) RemoteCommandHandlerStatus) objc.Object + RemoveTarget(target objc.IObject) + AddTargetAction(target objc.IObject, action objc.Selector) + IsEnabled() bool + SetEnabled(value bool) +} + +// An object that responds to remote command events. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommand?language=objc +type RemoteCommand struct { + objc.Object +} + +func RemoteCommandFrom(ptr unsafe.Pointer) RemoteCommand { + return RemoteCommand{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RemoteCommandClass) Alloc() RemoteCommand { + rv := objc.Call[RemoteCommand](rc, objc.Sel("alloc")) + return rv +} + +func RemoteCommand_Alloc() RemoteCommand { + return RemoteCommandClass.Alloc() +} + +func (rc _RemoteCommandClass) New() RemoteCommand { + rv := objc.Call[RemoteCommand](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRemoteCommand() RemoteCommand { + return RemoteCommandClass.New() +} + +func (r_ RemoteCommand) Init() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("init")) + return rv +} + +// Adds a block to be called when an event is received. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommand/1622910-addtargetwithhandler?language=objc +func (r_ RemoteCommand) AddTargetWithHandler(handler func(event RemoteCommandEvent) RemoteCommandHandlerStatus) objc.Object { + rv := objc.Call[objc.Object](r_, objc.Sel("addTargetWithHandler:"), handler) + return rv +} + +// Removes a target from the remote command object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommand/1622903-removetarget?language=objc +func (r_ RemoteCommand) RemoveTarget(target objc.IObject) { + objc.Call[objc.Void](r_, objc.Sel("removeTarget:"), target) +} + +// Adds a target object to be called when an event is received. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommand/1622895-addtarget?language=objc +func (r_ RemoteCommand) AddTargetAction(target objc.IObject, action objc.Selector) { + objc.Call[objc.Void](r_, objc.Sel("addTarget:action:"), target, action) +} + +// A Boolean value that indicates whether a user can interact with the displayed element. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommand/1622908-enabled?language=objc +func (r_ RemoteCommand) IsEnabled() bool { + rv := objc.Call[bool](r_, objc.Sel("isEnabled")) + return rv +} + +// A Boolean value that indicates whether a user can interact with the displayed element. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommand/1622908-enabled?language=objc +func (r_ RemoteCommand) SetEnabled(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setEnabled:"), value) +} diff --git a/macos/mediaplayer/remote_command_center.gen.go b/macos/mediaplayer/remote_command_center.gen.go new file mode 100644 index 00000000..0e4f1bda --- /dev/null +++ b/macos/mediaplayer/remote_command_center.gen.go @@ -0,0 +1,253 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RemoteCommandCenter] class. +var RemoteCommandCenterClass = _RemoteCommandCenterClass{objc.GetClass("MPRemoteCommandCenter")} + +type _RemoteCommandCenterClass struct { + objc.Class +} + +// An interface definition for the [RemoteCommandCenter] class. +type IRemoteCommandCenter interface { + objc.IObject + PlayCommand() RemoteCommand + SkipBackwardCommand() SkipIntervalCommand + DisableLanguageOptionCommand() RemoteCommand + SkipForwardCommand() SkipIntervalCommand + ChangeRepeatModeCommand() ChangeRepeatModeCommand + LikeCommand() FeedbackCommand + TogglePlayPauseCommand() RemoteCommand + NextTrackCommand() RemoteCommand + ChangePlaybackPositionCommand() ChangePlaybackPositionCommand + BookmarkCommand() FeedbackCommand + ChangePlaybackRateCommand() ChangePlaybackRateCommand + PreviousTrackCommand() RemoteCommand + EnableLanguageOptionCommand() RemoteCommand + ChangeShuffleModeCommand() ChangeShuffleModeCommand + PauseCommand() RemoteCommand + DislikeCommand() FeedbackCommand + StopCommand() RemoteCommand + SeekBackwardCommand() RemoteCommand + SeekForwardCommand() RemoteCommand + RatingCommand() RatingCommand +} + +// An object that responds to remote control events sent by external accessories and system controls. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter?language=objc +type RemoteCommandCenter struct { + objc.Object +} + +func RemoteCommandCenterFrom(ptr unsafe.Pointer) RemoteCommandCenter { + return RemoteCommandCenter{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RemoteCommandCenterClass) Alloc() RemoteCommandCenter { + rv := objc.Call[RemoteCommandCenter](rc, objc.Sel("alloc")) + return rv +} + +func RemoteCommandCenter_Alloc() RemoteCommandCenter { + return RemoteCommandCenterClass.Alloc() +} + +func (rc _RemoteCommandCenterClass) New() RemoteCommandCenter { + rv := objc.Call[RemoteCommandCenter](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRemoteCommandCenter() RemoteCommandCenter { + return RemoteCommandCenterClass.New() +} + +func (r_ RemoteCommandCenter) Init() RemoteCommandCenter { + rv := objc.Call[RemoteCommandCenter](r_, objc.Sel("init")) + return rv +} + +// Returns the shared object you use to access the system’s remote command objects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618994-sharedcommandcenter?language=objc +func (rc _RemoteCommandCenterClass) SharedCommandCenter() RemoteCommandCenter { + rv := objc.Call[RemoteCommandCenter](rc, objc.Sel("sharedCommandCenter")) + return rv +} + +// Returns the shared object you use to access the system’s remote command objects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618994-sharedcommandcenter?language=objc +func RemoteCommandCenter_SharedCommandCenter() RemoteCommandCenter { + return RemoteCommandCenterClass.SharedCommandCenter() +} + +// The command object for starting playback of the current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1619000-playcommand?language=objc +func (r_ RemoteCommandCenter) PlayCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("playCommand")) + return rv +} + +// The command object for playing a previous point in a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618996-skipbackwardcommand?language=objc +func (r_ RemoteCommandCenter) SkipBackwardCommand() SkipIntervalCommand { + rv := objc.Call[SkipIntervalCommand](r_, objc.Sel("skipBackwardCommand")) + return rv +} + +// The command object for disabling a language option [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618988-disablelanguageoptioncommand?language=objc +func (r_ RemoteCommandCenter) DisableLanguageOptionCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("disableLanguageOptionCommand")) + return rv +} + +// The command object for playing a future point in a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618990-skipforwardcommand?language=objc +func (r_ RemoteCommandCenter) SkipForwardCommand() SkipIntervalCommand { + rv := objc.Call[SkipIntervalCommand](r_, objc.Sel("skipForwardCommand")) + return rv +} + +// The command object for changing the repeat mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1649694-changerepeatmodecommand?language=objc +func (r_ RemoteCommandCenter) ChangeRepeatModeCommand() ChangeRepeatModeCommand { + rv := objc.Call[ChangeRepeatModeCommand](r_, objc.Sel("changeRepeatModeCommand")) + return rv +} + +// The command object for indicating that a user likes what is currently playing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618998-likecommand?language=objc +func (r_ RemoteCommandCenter) LikeCommand() FeedbackCommand { + rv := objc.Call[FeedbackCommand](r_, objc.Sel("likeCommand")) + return rv +} + +// The command object for toggling between playing and pausing the current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618992-toggleplaypausecommand?language=objc +func (r_ RemoteCommandCenter) TogglePlayPauseCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("togglePlayPauseCommand")) + return rv +} + +// The command object for selecting the next track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618999-nexttrackcommand?language=objc +func (r_ RemoteCommandCenter) NextTrackCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("nextTrackCommand")) + return rv +} + +// The command object for changing the playback position in a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618997-changeplaybackpositioncommand?language=objc +func (r_ RemoteCommandCenter) ChangePlaybackPositionCommand() ChangePlaybackPositionCommand { + rv := objc.Call[ChangePlaybackPositionCommand](r_, objc.Sel("changePlaybackPositionCommand")) + return rv +} + +// The command object for indicating that a user wants to remember a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1619002-bookmarkcommand?language=objc +func (r_ RemoteCommandCenter) BookmarkCommand() FeedbackCommand { + rv := objc.Call[FeedbackCommand](r_, objc.Sel("bookmarkCommand")) + return rv +} + +// The command object for changing the playback rate of the current media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618991-changeplaybackratecommand?language=objc +func (r_ RemoteCommandCenter) ChangePlaybackRateCommand() ChangePlaybackRateCommand { + rv := objc.Call[ChangePlaybackRateCommand](r_, objc.Sel("changePlaybackRateCommand")) + return rv +} + +// The command object for selecting the previous track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618978-previoustrackcommand?language=objc +func (r_ RemoteCommandCenter) PreviousTrackCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("previousTrackCommand")) + return rv +} + +// The command object for enabling a language option. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618980-enablelanguageoptioncommand?language=objc +func (r_ RemoteCommandCenter) EnableLanguageOptionCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("enableLanguageOptionCommand")) + return rv +} + +// The command object for changing the shuffle mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1649692-changeshufflemodecommand?language=objc +func (r_ RemoteCommandCenter) ChangeShuffleModeCommand() ChangeShuffleModeCommand { + rv := objc.Call[ChangeShuffleModeCommand](r_, objc.Sel("changeShuffleModeCommand")) + return rv +} + +// The command object for pausing playback of the current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618979-pausecommand?language=objc +func (r_ RemoteCommandCenter) PauseCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("pauseCommand")) + return rv +} + +// The command object for indicating that a user dislikes what is currently playing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618995-dislikecommand?language=objc +func (r_ RemoteCommandCenter) DislikeCommand() FeedbackCommand { + rv := objc.Call[FeedbackCommand](r_, objc.Sel("dislikeCommand")) + return rv +} + +// The command object for stopping playback of the current item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618984-stopcommand?language=objc +func (r_ RemoteCommandCenter) StopCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("stopCommand")) + return rv +} + +// The command object for seeking backward through a single media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618982-seekbackwardcommand?language=objc +func (r_ RemoteCommandCenter) SeekBackwardCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("seekBackwardCommand")) + return rv +} + +// The command object for seeking forward through a single media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618981-seekforwardcommand?language=objc +func (r_ RemoteCommandCenter) SeekForwardCommand() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("seekForwardCommand")) + return rv +} + +// The command object for rating a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandcenter/1618986-ratingcommand?language=objc +func (r_ RemoteCommandCenter) RatingCommand() RatingCommand { + rv := objc.Call[RatingCommand](r_, objc.Sel("ratingCommand")) + return rv +} diff --git a/macos/mediaplayer/remote_command_event.gen.go b/macos/mediaplayer/remote_command_event.gen.go new file mode 100644 index 00000000..0b4f545e --- /dev/null +++ b/macos/mediaplayer/remote_command_event.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RemoteCommandEvent] class. +var RemoteCommandEventClass = _RemoteCommandEventClass{objc.GetClass("MPRemoteCommandEvent")} + +type _RemoteCommandEventClass struct { + objc.Class +} + +// An interface definition for the [RemoteCommandEvent] class. +type IRemoteCommandEvent interface { + objc.IObject + Command() RemoteCommand + Timestamp() foundation.TimeInterval +} + +// A description of a command sent by an external media player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandevent?language=objc +type RemoteCommandEvent struct { + objc.Object +} + +func RemoteCommandEventFrom(ptr unsafe.Pointer) RemoteCommandEvent { + return RemoteCommandEvent{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RemoteCommandEventClass) Alloc() RemoteCommandEvent { + rv := objc.Call[RemoteCommandEvent](rc, objc.Sel("alloc")) + return rv +} + +func RemoteCommandEvent_Alloc() RemoteCommandEvent { + return RemoteCommandEventClass.Alloc() +} + +func (rc _RemoteCommandEventClass) New() RemoteCommandEvent { + rv := objc.Call[RemoteCommandEvent](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRemoteCommandEvent() RemoteCommandEvent { + return RemoteCommandEventClass.New() +} + +func (r_ RemoteCommandEvent) Init() RemoteCommandEvent { + rv := objc.Call[RemoteCommandEvent](r_, objc.Sel("init")) + return rv +} + +// The command that sent the event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandevent/1616776-command?language=objc +func (r_ RemoteCommandEvent) Command() RemoteCommand { + rv := objc.Call[RemoteCommand](r_, objc.Sel("command")) + return rv +} + +// The time the event occurred. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpremotecommandevent/1616784-timestamp?language=objc +func (r_ RemoteCommandEvent) Timestamp() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](r_, objc.Sel("timestamp")) + return rv +} diff --git a/macos/mediaplayer/seek_command_event.gen.go b/macos/mediaplayer/seek_command_event.gen.go new file mode 100644 index 00000000..7c275e1c --- /dev/null +++ b/macos/mediaplayer/seek_command_event.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SeekCommandEvent] class. +var SeekCommandEventClass = _SeekCommandEventClass{objc.GetClass("MPSeekCommandEvent")} + +type _SeekCommandEventClass struct { + objc.Class +} + +// An interface definition for the [SeekCommandEvent] class. +type ISeekCommandEvent interface { + IRemoteCommandEvent + Type() SeekCommandEventType +} + +// An event requesting that the player seek to a new position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpseekcommandevent?language=objc +type SeekCommandEvent struct { + RemoteCommandEvent +} + +func SeekCommandEventFrom(ptr unsafe.Pointer) SeekCommandEvent { + return SeekCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (sc _SeekCommandEventClass) Alloc() SeekCommandEvent { + rv := objc.Call[SeekCommandEvent](sc, objc.Sel("alloc")) + return rv +} + +func SeekCommandEvent_Alloc() SeekCommandEvent { + return SeekCommandEventClass.Alloc() +} + +func (sc _SeekCommandEventClass) New() SeekCommandEvent { + rv := objc.Call[SeekCommandEvent](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSeekCommandEvent() SeekCommandEvent { + return SeekCommandEventClass.New() +} + +func (s_ SeekCommandEvent) Init() SeekCommandEvent { + rv := objc.Call[SeekCommandEvent](s_, objc.Sel("init")) + return rv +} + +// The type of seek command event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpseekcommandevent/1616783-type?language=objc +func (s_ SeekCommandEvent) Type() SeekCommandEventType { + rv := objc.Call[SeekCommandEventType](s_, objc.Sel("type")) + return rv +} diff --git a/macos/mediaplayer/skip_interval_command.gen.go b/macos/mediaplayer/skip_interval_command.gen.go new file mode 100644 index 00000000..8796d2f9 --- /dev/null +++ b/macos/mediaplayer/skip_interval_command.gen.go @@ -0,0 +1,76 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SkipIntervalCommand] class. +var SkipIntervalCommandClass = _SkipIntervalCommandClass{objc.GetClass("MPSkipIntervalCommand")} + +type _SkipIntervalCommandClass struct { + objc.Class +} + +// An interface definition for the [SkipIntervalCommand] class. +type ISkipIntervalCommand interface { + IRemoteCommand + PreferredIntervals() []foundation.Number + SetPreferredIntervals(value []foundation.INumber) +} + +// An object that defines the skip intervals for the player. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpskipintervalcommand?language=objc +type SkipIntervalCommand struct { + RemoteCommand +} + +func SkipIntervalCommandFrom(ptr unsafe.Pointer) SkipIntervalCommand { + return SkipIntervalCommand{ + RemoteCommand: RemoteCommandFrom(ptr), + } +} + +func (sc _SkipIntervalCommandClass) Alloc() SkipIntervalCommand { + rv := objc.Call[SkipIntervalCommand](sc, objc.Sel("alloc")) + return rv +} + +func SkipIntervalCommand_Alloc() SkipIntervalCommand { + return SkipIntervalCommandClass.Alloc() +} + +func (sc _SkipIntervalCommandClass) New() SkipIntervalCommand { + rv := objc.Call[SkipIntervalCommand](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSkipIntervalCommand() SkipIntervalCommand { + return SkipIntervalCommandClass.New() +} + +func (s_ SkipIntervalCommand) Init() SkipIntervalCommand { + rv := objc.Call[SkipIntervalCommand](s_, objc.Sel("init")) + return rv +} + +// The available skip intervals, in seconds, for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpskipintervalcommand/1622899-preferredintervals?language=objc +func (s_ SkipIntervalCommand) PreferredIntervals() []foundation.Number { + rv := objc.Call[[]foundation.Number](s_, objc.Sel("preferredIntervals")) + return rv +} + +// The available skip intervals, in seconds, for a media item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpskipintervalcommand/1622899-preferredintervals?language=objc +func (s_ SkipIntervalCommand) SetPreferredIntervals(value []foundation.INumber) { + objc.Call[objc.Void](s_, objc.Sel("setPreferredIntervals:"), value) +} diff --git a/macos/mediaplayer/skip_interval_command_event.gen.go b/macos/mediaplayer/skip_interval_command_event.gen.go new file mode 100644 index 00000000..23c423ea --- /dev/null +++ b/macos/mediaplayer/skip_interval_command_event.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SkipIntervalCommandEvent] class. +var SkipIntervalCommandEventClass = _SkipIntervalCommandEventClass{objc.GetClass("MPSkipIntervalCommandEvent")} + +type _SkipIntervalCommandEventClass struct { + objc.Class +} + +// An interface definition for the [SkipIntervalCommandEvent] class. +type ISkipIntervalCommandEvent interface { + IRemoteCommandEvent + Interval() foundation.TimeInterval +} + +// An event requesting a change in the current skip interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpskipintervalcommandevent?language=objc +type SkipIntervalCommandEvent struct { + RemoteCommandEvent +} + +func SkipIntervalCommandEventFrom(ptr unsafe.Pointer) SkipIntervalCommandEvent { + return SkipIntervalCommandEvent{ + RemoteCommandEvent: RemoteCommandEventFrom(ptr), + } +} + +func (sc _SkipIntervalCommandEventClass) Alloc() SkipIntervalCommandEvent { + rv := objc.Call[SkipIntervalCommandEvent](sc, objc.Sel("alloc")) + return rv +} + +func SkipIntervalCommandEvent_Alloc() SkipIntervalCommandEvent { + return SkipIntervalCommandEventClass.Alloc() +} + +func (sc _SkipIntervalCommandEventClass) New() SkipIntervalCommandEvent { + rv := objc.Call[SkipIntervalCommandEvent](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSkipIntervalCommandEvent() SkipIntervalCommandEvent { + return SkipIntervalCommandEventClass.New() +} + +func (s_ SkipIntervalCommandEvent) Init() SkipIntervalCommandEvent { + rv := objc.Call[SkipIntervalCommandEvent](s_, objc.Sel("init")) + return rv +} + +// The chosen interval, in seconds, for the skip command event. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpskipintervalcommandevent/1616767-interval?language=objc +func (s_ SkipIntervalCommandEvent) Interval() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](s_, objc.Sel("interval")) + return rv +} diff --git a/macos/mediaplayer/system_music_player_controller.gen.go b/macos/mediaplayer/system_music_player_controller.gen.go new file mode 100644 index 00000000..ecfabc6b --- /dev/null +++ b/macos/mediaplayer/system_music_player_controller.gen.go @@ -0,0 +1,18 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mediaplayer + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol for playing videos in the Music app. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/mediaplayer/mpsystemmusicplayercontroller?language=objc +type PSystemMusicPlayerController interface { +} + +// A concrete type wrapper for the [PSystemMusicPlayerController] protocol. +type SystemMusicPlayerControllerWrapper struct { + objc.Object +} diff --git a/macos/metal/metal_structs.go b/macos/metal/metal_structs.go index 7698f559..2e470eb6 100644 --- a/macos/metal/metal_structs.go +++ b/macos/metal/metal_structs.go @@ -4,6 +4,7 @@ type Coordinate2D = SamplePosition // todo type Region struct{} +type Origin struct{} type TextureSwizzleChannels struct{} type Size struct{} type Viewport struct{} diff --git a/macos/mps/acceleration_structure.gen.go b/macos/mps/acceleration_structure.gen.go new file mode 100644 index 00000000..0db4bcb2 --- /dev/null +++ b/macos/mps/acceleration_structure.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AccelerationStructure] class. +var AccelerationStructureClass = _AccelerationStructureClass{objc.GetClass("MPSAccelerationStructure")} + +type _AccelerationStructureClass struct { + objc.Class +} + +// An interface definition for the [AccelerationStructure] class. +type IAccelerationStructure interface { + IKernel +} + +// The base class for data structures that are built over geometry and used to accelerate ray tracing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsaccelerationstructure?language=objc +type AccelerationStructure struct { + Kernel +} + +func AccelerationStructureFrom(ptr unsafe.Pointer) AccelerationStructure { + return AccelerationStructure{ + Kernel: KernelFrom(ptr), + } +} + +func (ac _AccelerationStructureClass) Alloc() AccelerationStructure { + rv := objc.Call[AccelerationStructure](ac, objc.Sel("alloc")) + return rv +} + +func AccelerationStructure_Alloc() AccelerationStructure { + return AccelerationStructureClass.Alloc() +} + +func (ac _AccelerationStructureClass) New() AccelerationStructure { + rv := objc.Call[AccelerationStructure](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAccelerationStructure() AccelerationStructure { + return AccelerationStructureClass.New() +} + +func (a_ AccelerationStructure) Init() AccelerationStructure { + rv := objc.Call[AccelerationStructure](a_, objc.Sel("init")) + return rv +} + +func (a_ AccelerationStructure) InitWithDevice(device metal.PDevice) AccelerationStructure { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[AccelerationStructure](a_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewAccelerationStructureWithDevice(device metal.PDevice) AccelerationStructure { + instance := AccelerationStructureClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (a_ AccelerationStructure) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) AccelerationStructure { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[AccelerationStructure](a_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func AccelerationStructure_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) AccelerationStructure { + instance := AccelerationStructureClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/acceleration_structure_group.gen.go b/macos/mps/acceleration_structure_group.gen.go new file mode 100644 index 00000000..1d63bb1a --- /dev/null +++ b/macos/mps/acceleration_structure_group.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [AccelerationStructureGroup] class. +var AccelerationStructureGroupClass = _AccelerationStructureGroupClass{objc.GetClass("MPSAccelerationStructureGroup")} + +type _AccelerationStructureGroupClass struct { + objc.Class +} + +// An interface definition for the [AccelerationStructureGroup] class. +type IAccelerationStructureGroup interface { + objc.IObject +} + +// A group of acceleration structures. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsaccelerationstructuregroup?language=objc +type AccelerationStructureGroup struct { + objc.Object +} + +func AccelerationStructureGroupFrom(ptr unsafe.Pointer) AccelerationStructureGroup { + return AccelerationStructureGroup{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ac _AccelerationStructureGroupClass) Alloc() AccelerationStructureGroup { + rv := objc.Call[AccelerationStructureGroup](ac, objc.Sel("alloc")) + return rv +} + +func AccelerationStructureGroup_Alloc() AccelerationStructureGroup { + return AccelerationStructureGroupClass.Alloc() +} + +func (ac _AccelerationStructureGroupClass) New() AccelerationStructureGroup { + rv := objc.Call[AccelerationStructureGroup](ac, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewAccelerationStructureGroup() AccelerationStructureGroup { + return AccelerationStructureGroupClass.New() +} + +func (a_ AccelerationStructureGroup) Init() AccelerationStructureGroup { + rv := objc.Call[AccelerationStructureGroup](a_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/aliastypes.gen.go b/macos/mps/aliastypes.gen.go new file mode 100644 index 00000000..fcc9ac9d --- /dev/null +++ b/macos/mps/aliastypes.gen.go @@ -0,0 +1,22 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/macos/foundation" +) + +// A notification when an asynchronous graph execution has finished. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraphcompletionhandler?language=objc +type NNGraphCompletionHandler = func(result Image, error foundation.Error) + +// A block of code that's invoked when an operation on an acceleration structure has completed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsaccelerationstructurecompletionhandler?language=objc +type AccelerationStructureCompletionHandler = func(arg0 AccelerationStructure) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgradientnodeblock?language=objc +type GradientNodeBlock = func(gradientNode NNFilterNode, inferenceNode NNFilterNode, inferenceSource NNImageNode, gradientSource NNImageNode) diff --git a/macos/mps/binary_image_kernel.gen.go b/macos/mps/binary_image_kernel.gen.go new file mode 100644 index 00000000..8ed570fd --- /dev/null +++ b/macos/mps/binary_image_kernel.gen.go @@ -0,0 +1,210 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [BinaryImageKernel] class. +var BinaryImageKernelClass = _BinaryImageKernelClass{objc.GetClass("MPSBinaryImageKernel")} + +type _BinaryImageKernelClass struct { + objc.Class +} + +// An interface definition for the [BinaryImageKernel] class. +type IBinaryImageKernel interface { + IKernel + SecondarySourceRegionForDestinationSize(destinationSize metal.Size) Region + EncodeToCommandBufferPrimaryImageSecondaryImageDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, destinationImage IImage) + EncodeToCommandBufferObjectPrimaryImageSecondaryImageDestinationImage(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, destinationImage IImage) + PrimarySourceRegionForDestinationSize(destinationSize metal.Size) Region + SecondaryEdgeMode() ImageEdgeMode + SetSecondaryEdgeMode(value ImageEdgeMode) + PrimaryEdgeMode() ImageEdgeMode + SetPrimaryEdgeMode(value ImageEdgeMode) + PrimaryOffset() Offset + SetPrimaryOffset(value Offset) + SecondaryOffset() Offset + SetSecondaryOffset(value Offset) + ClipRect() metal.Region + SetClipRect(value metal.Region) +} + +// A kernel that consumes two textures and produces one texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel?language=objc +type BinaryImageKernel struct { + Kernel +} + +func BinaryImageKernelFrom(ptr unsafe.Pointer) BinaryImageKernel { + return BinaryImageKernel{ + Kernel: KernelFrom(ptr), + } +} + +func (b_ BinaryImageKernel) InitWithDevice(device metal.PDevice) BinaryImageKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[BinaryImageKernel](b_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/2866331-initwithdevice?language=objc +func NewBinaryImageKernelWithDevice(device metal.PDevice) BinaryImageKernel { + instance := BinaryImageKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (bc _BinaryImageKernelClass) Alloc() BinaryImageKernel { + rv := objc.Call[BinaryImageKernel](bc, objc.Sel("alloc")) + return rv +} + +func BinaryImageKernel_Alloc() BinaryImageKernel { + return BinaryImageKernelClass.Alloc() +} + +func (bc _BinaryImageKernelClass) New() BinaryImageKernel { + rv := objc.Call[BinaryImageKernel](bc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewBinaryImageKernel() BinaryImageKernel { + return BinaryImageKernelClass.New() +} + +func (b_ BinaryImageKernel) Init() BinaryImageKernel { + rv := objc.Call[BinaryImageKernel](b_, objc.Sel("init")) + return rv +} + +func (b_ BinaryImageKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) BinaryImageKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[BinaryImageKernel](b_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func BinaryImageKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) BinaryImageKernel { + instance := BinaryImageKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Determines the region of the secondary source texture that will be read for an encode operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618838-secondarysourceregionfordestinat?language=objc +func (b_ BinaryImageKernel) SecondarySourceRegionForDestinationSize(destinationSize metal.Size) Region { + rv := objc.Call[Region](b_, objc.Sel("secondarySourceRegionForDestinationSize:"), destinationSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/2866330-encodetocommandbuffer?language=objc +func (b_ BinaryImageKernel) EncodeToCommandBufferPrimaryImageSecondaryImageDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, destinationImage IImage) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](b_, objc.Sel("encodeToCommandBuffer:primaryImage:secondaryImage:destinationImage:"), po0, objc.Ptr(primaryImage), objc.Ptr(secondaryImage), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/2866330-encodetocommandbuffer?language=objc +func (b_ BinaryImageKernel) EncodeToCommandBufferObjectPrimaryImageSecondaryImageDestinationImage(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, destinationImage IImage) { + objc.Call[objc.Void](b_, objc.Sel("encodeToCommandBuffer:primaryImage:secondaryImage:destinationImage:"), objc.Ptr(commandBufferObject), objc.Ptr(primaryImage), objc.Ptr(secondaryImage), objc.Ptr(destinationImage)) +} + +// Determines the region of the primary source texture that will be read for an encode operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618900-primarysourceregionfordestinatio?language=objc +func (b_ BinaryImageKernel) PrimarySourceRegionForDestinationSize(destinationSize metal.Size) Region { + rv := objc.Call[Region](b_, objc.Sel("primarySourceRegionForDestinationSize:"), destinationSize) + return rv +} + +// The edge mode to use when texture reads stray off the edge of the secondary source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618848-secondaryedgemode?language=objc +func (b_ BinaryImageKernel) SecondaryEdgeMode() ImageEdgeMode { + rv := objc.Call[ImageEdgeMode](b_, objc.Sel("secondaryEdgeMode")) + return rv +} + +// The edge mode to use when texture reads stray off the edge of the secondary source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618848-secondaryedgemode?language=objc +func (b_ BinaryImageKernel) SetSecondaryEdgeMode(value ImageEdgeMode) { + objc.Call[objc.Void](b_, objc.Sel("setSecondaryEdgeMode:"), value) +} + +// The edge mode to use when texture reads stray off the edge of the primary source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618782-primaryedgemode?language=objc +func (b_ BinaryImageKernel) PrimaryEdgeMode() ImageEdgeMode { + rv := objc.Call[ImageEdgeMode](b_, objc.Sel("primaryEdgeMode")) + return rv +} + +// The edge mode to use when texture reads stray off the edge of the primary source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618782-primaryedgemode?language=objc +func (b_ BinaryImageKernel) SetPrimaryEdgeMode(value ImageEdgeMode) { + objc.Call[objc.Void](b_, objc.Sel("setPrimaryEdgeMode:"), value) +} + +// The position of the destination clip rectangle origin relative to the primary source buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618880-primaryoffset?language=objc +func (b_ BinaryImageKernel) PrimaryOffset() Offset { + rv := objc.Call[Offset](b_, objc.Sel("primaryOffset")) + return rv +} + +// The position of the destination clip rectangle origin relative to the primary source buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618880-primaryoffset?language=objc +func (b_ BinaryImageKernel) SetPrimaryOffset(value Offset) { + objc.Call[objc.Void](b_, objc.Sel("setPrimaryOffset:"), value) +} + +// The position of the destination clip rectangle origin relative to the secondary source buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618755-secondaryoffset?language=objc +func (b_ BinaryImageKernel) SecondaryOffset() Offset { + rv := objc.Call[Offset](b_, objc.Sel("secondaryOffset")) + return rv +} + +// The position of the destination clip rectangle origin relative to the secondary source buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618755-secondaryoffset?language=objc +func (b_ BinaryImageKernel) SetSecondaryOffset(value Offset) { + objc.Call[objc.Void](b_, objc.Sel("setSecondaryOffset:"), value) +} + +// An optional clip rectangle to use when writing data. Only the pixels in the rectangle will be overwritten. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618879-cliprect?language=objc +func (b_ BinaryImageKernel) ClipRect() metal.Region { + rv := objc.Call[metal.Region](b_, objc.Sel("clipRect")) + return rv +} + +// An optional clip rectangle to use when writing data. Only the pixels in the rectangle will be overwritten. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/1618879-cliprect?language=objc +func (b_ BinaryImageKernel) SetClipRect(value metal.Region) { + objc.Call[objc.Void](b_, objc.Sel("setClipRect:"), value) +} diff --git a/macos/mps/cnn_add.gen.go b/macos/mps/cnn_add.gen.go new file mode 100644 index 00000000..4d9cf7ad --- /dev/null +++ b/macos/mps/cnn_add.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNAdd] class. +var CNNAddClass = _CNNAddClass{objc.GetClass("MPSCNNAdd")} + +type _CNNAddClass struct { + objc.Class +} + +// An interface definition for the [CNNAdd] class. +type ICNNAdd interface { + ICNNArithmetic +} + +// An addition operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnadd?language=objc +type CNNAdd struct { + CNNArithmetic +} + +func CNNAddFrom(ptr unsafe.Pointer) CNNAdd { + return CNNAdd{ + CNNArithmetic: CNNArithmeticFrom(ptr), + } +} + +func (c_ CNNAdd) InitWithDevice(device metal.PDevice) CNNAdd { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNAdd](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnadd/2942501-initwithdevice?language=objc +func NewCNNAddWithDevice(device metal.PDevice) CNNAdd { + instance := CNNAddClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNAddClass) Alloc() CNNAdd { + rv := objc.Call[CNNAdd](cc, objc.Sel("alloc")) + return rv +} + +func CNNAdd_Alloc() CNNAdd { + return CNNAddClass.Alloc() +} + +func (cc _CNNAddClass) New() CNNAdd { + rv := objc.Call[CNNAdd](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNAdd() CNNAdd { + return CNNAddClass.New() +} + +func (c_ CNNAdd) Init() CNNAdd { + rv := objc.Call[CNNAdd](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNAdd) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNAdd { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNAdd](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNAdd_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNAdd { + instance := CNNAddClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_add_gradient.gen.go b/macos/mps/cnn_add_gradient.gen.go new file mode 100644 index 00000000..bec1ef69 --- /dev/null +++ b/macos/mps/cnn_add_gradient.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNAddGradient] class. +var CNNAddGradientClass = _CNNAddGradientClass{objc.GetClass("MPSCNNAddGradient")} + +type _CNNAddGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNAddGradient] class. +type ICNNAddGradient interface { + ICNNArithmeticGradient +} + +// A gradient addition operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnaddgradient?language=objc +type CNNAddGradient struct { + CNNArithmeticGradient +} + +func CNNAddGradientFrom(ptr unsafe.Pointer) CNNAddGradient { + return CNNAddGradient{ + CNNArithmeticGradient: CNNArithmeticGradientFrom(ptr), + } +} + +func (c_ CNNAddGradient) InitWithDeviceIsSecondarySourceFilter(device metal.PDevice, isSecondarySourceFilter bool) CNNAddGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNAddGradient](c_, objc.Sel("initWithDevice:isSecondarySourceFilter:"), po0, isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnaddgradient/2956163-initwithdevice?language=objc +func NewCNNAddGradientWithDeviceIsSecondarySourceFilter(device metal.PDevice, isSecondarySourceFilter bool) CNNAddGradient { + instance := CNNAddGradientClass.Alloc().InitWithDeviceIsSecondarySourceFilter(device, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (cc _CNNAddGradientClass) Alloc() CNNAddGradient { + rv := objc.Call[CNNAddGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNAddGradient_Alloc() CNNAddGradient { + return CNNAddGradientClass.Alloc() +} + +func (cc _CNNAddGradientClass) New() CNNAddGradient { + rv := objc.Call[CNNAddGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNAddGradient() CNNAddGradient { + return CNNAddGradientClass.New() +} + +func (c_ CNNAddGradient) Init() CNNAddGradient { + rv := objc.Call[CNNAddGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNAddGradient) InitWithDevice(device metal.PDevice) CNNAddGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNAddGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNAddGradientWithDevice(device metal.PDevice) CNNAddGradient { + instance := CNNAddGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNAddGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNAddGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNAddGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNAddGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNAddGradient { + instance := CNNAddGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_arithmetic.gen.go b/macos/mps/cnn_arithmetic.gen.go new file mode 100644 index 00000000..c836a567 --- /dev/null +++ b/macos/mps/cnn_arithmetic.gen.go @@ -0,0 +1,244 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNArithmetic] class. +var CNNArithmeticClass = _CNNArithmeticClass{objc.GetClass("MPSCNNArithmetic")} + +type _CNNArithmeticClass struct { + objc.Class +} + +// An interface definition for the [CNNArithmetic] class. +type ICNNArithmetic interface { + ICNNBinaryKernel + EncodeBatchToCommandBufferPrimaryImagesSecondaryImagesDestinationStatesDestinationImages(commandBuffer metal.PCommandBuffer, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationStates *foundation.Array, destinationImages *foundation.Array) + EncodeBatchToCommandBufferObjectPrimaryImagesSecondaryImagesDestinationStatesDestinationImages(commandBufferObject objc.IObject, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationStates *foundation.Array, destinationImages *foundation.Array) + EncodeToCommandBufferPrimaryImageSecondaryImageDestinationStateDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, destinationState ICNNArithmeticGradientState, destinationImage IImage) + EncodeToCommandBufferObjectPrimaryImageSecondaryImageDestinationStateDestinationImage(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, destinationState ICNNArithmeticGradientState, destinationImage IImage) + SecondaryScale() float64 + SetSecondaryScale(value float64) + MaximumValue() float64 + SetMaximumValue(value float64) + PrimaryScale() float64 + SetPrimaryScale(value float64) + MinimumValue() float64 + SetMinimumValue(value float64) + Bias() float64 + SetBias(value float64) + SecondaryStrideInFeatureChannels() uint + SetSecondaryStrideInFeatureChannels(value uint) + PrimaryStrideInFeatureChannels() uint + SetPrimaryStrideInFeatureChannels(value uint) +} + +// The base class for arithmetic operators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic?language=objc +type CNNArithmetic struct { + CNNBinaryKernel +} + +func CNNArithmeticFrom(ptr unsafe.Pointer) CNNArithmetic { + return CNNArithmetic{ + CNNBinaryKernel: CNNBinaryKernelFrom(ptr), + } +} + +func (cc _CNNArithmeticClass) Alloc() CNNArithmetic { + rv := objc.Call[CNNArithmetic](cc, objc.Sel("alloc")) + return rv +} + +func CNNArithmetic_Alloc() CNNArithmetic { + return CNNArithmeticClass.Alloc() +} + +func (cc _CNNArithmeticClass) New() CNNArithmetic { + rv := objc.Call[CNNArithmetic](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNArithmetic() CNNArithmetic { + return CNNArithmeticClass.New() +} + +func (c_ CNNArithmetic) Init() CNNArithmetic { + rv := objc.Call[CNNArithmetic](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNArithmetic) InitWithDevice(device metal.PDevice) CNNArithmetic { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNArithmetic](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865629-initwithdevice?language=objc +func NewCNNArithmeticWithDevice(device metal.PDevice) CNNArithmetic { + instance := CNNArithmeticClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNArithmetic) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNArithmetic { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNArithmetic](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNArithmetic_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNArithmetic { + instance := CNNArithmeticClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2954877-encodebatchtocommandbuffer?language=objc +func (c_ CNNArithmetic) EncodeBatchToCommandBufferPrimaryImagesSecondaryImagesDestinationStatesDestinationImages(commandBuffer metal.PCommandBuffer, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationStates *foundation.Array, destinationImages *foundation.Array) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:primaryImages:secondaryImages:destinationStates:destinationImages:"), po0, primaryImages, secondaryImages, destinationStates, destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2954877-encodebatchtocommandbuffer?language=objc +func (c_ CNNArithmetic) EncodeBatchToCommandBufferObjectPrimaryImagesSecondaryImagesDestinationStatesDestinationImages(commandBufferObject objc.IObject, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationStates *foundation.Array, destinationImages *foundation.Array) { + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:primaryImages:secondaryImages:destinationStates:destinationImages:"), objc.Ptr(commandBufferObject), primaryImages, secondaryImages, destinationStates, destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2954876-encodetocommandbuffer?language=objc +func (c_ CNNArithmetic) EncodeToCommandBufferPrimaryImageSecondaryImageDestinationStateDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, destinationState ICNNArithmeticGradientState, destinationImage IImage) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("encodeToCommandBuffer:primaryImage:secondaryImage:destinationState:destinationImage:"), po0, objc.Ptr(primaryImage), objc.Ptr(secondaryImage), objc.Ptr(destinationState), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2954876-encodetocommandbuffer?language=objc +func (c_ CNNArithmetic) EncodeToCommandBufferObjectPrimaryImageSecondaryImageDestinationStateDestinationImage(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, destinationState ICNNArithmeticGradientState, destinationImage IImage) { + objc.Call[objc.Void](c_, objc.Sel("encodeToCommandBuffer:primaryImage:secondaryImage:destinationState:destinationImage:"), objc.Ptr(commandBufferObject), objc.Ptr(primaryImage), objc.Ptr(secondaryImage), objc.Ptr(destinationState), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942497-secondaryscale?language=objc +func (c_ CNNArithmetic) SecondaryScale() float64 { + rv := objc.Call[float64](c_, objc.Sel("secondaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942497-secondaryscale?language=objc +func (c_ CNNArithmetic) SetSecondaryScale(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942498-maximumvalue?language=objc +func (c_ CNNArithmetic) MaximumValue() float64 { + rv := objc.Call[float64](c_, objc.Sel("maximumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942498-maximumvalue?language=objc +func (c_ CNNArithmetic) SetMaximumValue(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setMaximumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942509-primaryscale?language=objc +func (c_ CNNArithmetic) PrimaryScale() float64 { + rv := objc.Call[float64](c_, objc.Sel("primaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942509-primaryscale?language=objc +func (c_ CNNArithmetic) SetPrimaryScale(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942502-minimumvalue?language=objc +func (c_ CNNArithmetic) MinimumValue() float64 { + rv := objc.Call[float64](c_, objc.Sel("minimumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942502-minimumvalue?language=objc +func (c_ CNNArithmetic) SetMinimumValue(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setMinimumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942499-bias?language=objc +func (c_ CNNArithmetic) Bias() float64 { + rv := objc.Call[float64](c_, objc.Sel("bias")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2942499-bias?language=objc +func (c_ CNNArithmetic) SetBias(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBias:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2947964-secondarystrideinfeaturechannels?language=objc +func (c_ CNNArithmetic) SecondaryStrideInFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryStrideInFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2947964-secondarystrideinfeaturechannels?language=objc +func (c_ CNNArithmetic) SetSecondaryStrideInFeatureChannels(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryStrideInFeatureChannels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2947963-primarystrideinfeaturechannels?language=objc +func (c_ CNNArithmetic) PrimaryStrideInFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("primaryStrideInFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmetic/2947963-primarystrideinfeaturechannels?language=objc +func (c_ CNNArithmetic) SetPrimaryStrideInFeatureChannels(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryStrideInFeatureChannels:"), value) +} diff --git a/macos/mps/cnn_arithmetic_gradient.gen.go b/macos/mps/cnn_arithmetic_gradient.gen.go new file mode 100644 index 00000000..f382f66e --- /dev/null +++ b/macos/mps/cnn_arithmetic_gradient.gen.go @@ -0,0 +1,201 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNArithmeticGradient] class. +var CNNArithmeticGradientClass = _CNNArithmeticGradientClass{objc.GetClass("MPSCNNArithmeticGradient")} + +type _CNNArithmeticGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNArithmeticGradient] class. +type ICNNArithmeticGradient interface { + ICNNGradientKernel + SecondaryScale() float64 + SetSecondaryScale(value float64) + IsSecondarySourceFilter() bool + MaximumValue() float64 + SetMaximumValue(value float64) + PrimaryScale() float64 + SetPrimaryScale(value float64) + MinimumValue() float64 + SetMinimumValue(value float64) + Bias() float64 + SetBias(value float64) + SecondaryStrideInFeatureChannels() uint + SetSecondaryStrideInFeatureChannels(value uint) +} + +// The base class for gradient arithmetic operators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient?language=objc +type CNNArithmeticGradient struct { + CNNGradientKernel +} + +func CNNArithmeticGradientFrom(ptr unsafe.Pointer) CNNArithmeticGradient { + return CNNArithmeticGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (cc _CNNArithmeticGradientClass) Alloc() CNNArithmeticGradient { + rv := objc.Call[CNNArithmeticGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNArithmeticGradient_Alloc() CNNArithmeticGradient { + return CNNArithmeticGradientClass.Alloc() +} + +func (cc _CNNArithmeticGradientClass) New() CNNArithmeticGradient { + rv := objc.Call[CNNArithmeticGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNArithmeticGradient() CNNArithmeticGradient { + return CNNArithmeticGradientClass.New() +} + +func (c_ CNNArithmeticGradient) Init() CNNArithmeticGradient { + rv := objc.Call[CNNArithmeticGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNArithmeticGradient) InitWithDevice(device metal.PDevice) CNNArithmeticGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNArithmeticGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNArithmeticGradientWithDevice(device metal.PDevice) CNNArithmeticGradient { + instance := CNNArithmeticGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNArithmeticGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNArithmeticGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNArithmeticGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNArithmeticGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNArithmeticGradient { + instance := CNNArithmeticGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951856-secondaryscale?language=objc +func (c_ CNNArithmeticGradient) SecondaryScale() float64 { + rv := objc.Call[float64](c_, objc.Sel("secondaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951856-secondaryscale?language=objc +func (c_ CNNArithmeticGradient) SetSecondaryScale(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951852-issecondarysourcefilter?language=objc +func (c_ CNNArithmeticGradient) IsSecondarySourceFilter() bool { + rv := objc.Call[bool](c_, objc.Sel("isSecondarySourceFilter")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951854-maximumvalue?language=objc +func (c_ CNNArithmeticGradient) MaximumValue() float64 { + rv := objc.Call[float64](c_, objc.Sel("maximumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951854-maximumvalue?language=objc +func (c_ CNNArithmeticGradient) SetMaximumValue(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setMaximumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951861-primaryscale?language=objc +func (c_ CNNArithmeticGradient) PrimaryScale() float64 { + rv := objc.Call[float64](c_, objc.Sel("primaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951861-primaryscale?language=objc +func (c_ CNNArithmeticGradient) SetPrimaryScale(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951858-minimumvalue?language=objc +func (c_ CNNArithmeticGradient) MinimumValue() float64 { + rv := objc.Call[float64](c_, objc.Sel("minimumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951858-minimumvalue?language=objc +func (c_ CNNArithmeticGradient) SetMinimumValue(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setMinimumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951855-bias?language=objc +func (c_ CNNArithmeticGradient) Bias() float64 { + rv := objc.Call[float64](c_, objc.Sel("bias")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951855-bias?language=objc +func (c_ CNNArithmeticGradient) SetBias(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBias:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951853-secondarystrideinfeaturechannels?language=objc +func (c_ CNNArithmeticGradient) SecondaryStrideInFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryStrideInFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradient/2951853-secondarystrideinfeaturechannels?language=objc +func (c_ CNNArithmeticGradient) SetSecondaryStrideInFeatureChannels(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryStrideInFeatureChannels:"), value) +} diff --git a/macos/mps/cnn_arithmetic_gradient_state.gen.go b/macos/mps/cnn_arithmetic_gradient_state.gen.go new file mode 100644 index 00000000..a948a0bc --- /dev/null +++ b/macos/mps/cnn_arithmetic_gradient_state.gen.go @@ -0,0 +1,116 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNArithmeticGradientState] class. +var CNNArithmeticGradientStateClass = _CNNArithmeticGradientStateClass{objc.GetClass("MPSCNNArithmeticGradientState")} + +type _CNNArithmeticGradientStateClass struct { + objc.Class +} + +// An interface definition for the [CNNArithmeticGradientState] class. +type ICNNArithmeticGradientState interface { + INNBinaryGradientState +} + +// An object that stores the clamp mask used by gradient arithmetic operators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnarithmeticgradientstate?language=objc +type CNNArithmeticGradientState struct { + NNBinaryGradientState +} + +func CNNArithmeticGradientStateFrom(ptr unsafe.Pointer) CNNArithmeticGradientState { + return CNNArithmeticGradientState{ + NNBinaryGradientState: NNBinaryGradientStateFrom(ptr), + } +} + +func (cc _CNNArithmeticGradientStateClass) Alloc() CNNArithmeticGradientState { + rv := objc.Call[CNNArithmeticGradientState](cc, objc.Sel("alloc")) + return rv +} + +func CNNArithmeticGradientState_Alloc() CNNArithmeticGradientState { + return CNNArithmeticGradientStateClass.Alloc() +} + +func (cc _CNNArithmeticGradientStateClass) New() CNNArithmeticGradientState { + rv := objc.Call[CNNArithmeticGradientState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNArithmeticGradientState() CNNArithmeticGradientState { + return CNNArithmeticGradientStateClass.New() +} + +func (c_ CNNArithmeticGradientState) Init() CNNArithmeticGradientState { + rv := objc.Call[CNNArithmeticGradientState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNArithmeticGradientState) InitWithResources(resources []metal.PResource) CNNArithmeticGradientState { + rv := objc.Call[CNNArithmeticGradientState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNArithmeticGradientStateWithResources(resources []metal.PResource) CNNArithmeticGradientState { + instance := CNNArithmeticGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNArithmeticGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNArithmeticGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNArithmeticGradientState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNArithmeticGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNArithmeticGradientState { + instance := CNNArithmeticGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNArithmeticGradientState) InitWithResource(resource metal.PResource) CNNArithmeticGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNArithmeticGradientState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNArithmeticGradientStateWithResource(resource metal.PResource) CNNArithmeticGradientState { + instance := CNNArithmeticGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNArithmeticGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNArithmeticGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNArithmeticGradientState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNArithmeticGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNArithmeticGradientState { + return CNNArithmeticGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} diff --git a/macos/mps/cnn_batch_normalization.gen.go b/macos/mps/cnn_batch_normalization.gen.go new file mode 100644 index 00000000..1f763f52 --- /dev/null +++ b/macos/mps/cnn_batch_normalization.gen.go @@ -0,0 +1,226 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBatchNormalization] class. +var CNNBatchNormalizationClass = _CNNBatchNormalizationClass{objc.GetClass("MPSCNNBatchNormalization")} + +type _CNNBatchNormalizationClass struct { + objc.Class +} + +// An interface definition for the [CNNBatchNormalization] class. +type ICNNBatchNormalization interface { + ICNNKernel + ReloadMeanAndVarianceFromDataSource() + ReloadGammaAndBetaFromDataSource() + EncodeBatchToCommandBufferSourceImagesBatchNormalizationStateDestinationImages(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState, destinationImages *foundation.Array) + EncodeBatchToCommandBufferObjectSourceImagesBatchNormalizationStateDestinationImages(commandBufferObject objc.IObject, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState, destinationImages *foundation.Array) + ReloadGammaAndBetaWithCommandBufferGammaAndBetaState(commandBuffer metal.PCommandBuffer, gammaAndBetaState ICNNNormalizationGammaAndBetaState) + ReloadGammaAndBetaWithCommandBufferObjectGammaAndBetaState(commandBufferObject objc.IObject, gammaAndBetaState ICNNNormalizationGammaAndBetaState) + ReloadMeanAndVarianceWithCommandBufferMeanAndVarianceState(commandBuffer metal.PCommandBuffer, meanAndVarianceState ICNNNormalizationMeanAndVarianceState) + ReloadMeanAndVarianceWithCommandBufferObjectMeanAndVarianceState(commandBufferObject objc.IObject, meanAndVarianceState ICNNNormalizationMeanAndVarianceState) + EncodeToCommandBufferSourceImageBatchNormalizationStateDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState, destinationImage IImage) + EncodeToCommandBufferObjectSourceImageBatchNormalizationStateDestinationImage(commandBufferObject objc.IObject, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState, destinationImage IImage) + DataSource() CNNBatchNormalizationDataSourceWrapper + Epsilon() float64 + SetEpsilon(value float64) + NumberOfFeatureChannels() uint +} + +// A batch normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization?language=objc +type CNNBatchNormalization struct { + CNNKernel +} + +func CNNBatchNormalizationFrom(ptr unsafe.Pointer) CNNBatchNormalization { + return CNNBatchNormalization{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNBatchNormalization) InitWithDeviceDataSource(device metal.PDevice, dataSource PCNNBatchNormalizationDataSource) CNNBatchNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNBatchNormalizationDataSource", dataSource) + rv := objc.Call[CNNBatchNormalization](c_, objc.Sel("initWithDevice:dataSource:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942600-initwithdevice?language=objc +func NewCNNBatchNormalizationWithDeviceDataSource(device metal.PDevice, dataSource PCNNBatchNormalizationDataSource) CNNBatchNormalization { + instance := CNNBatchNormalizationClass.Alloc().InitWithDeviceDataSource(device, dataSource) + instance.Autorelease() + return instance +} + +func (cc _CNNBatchNormalizationClass) Alloc() CNNBatchNormalization { + rv := objc.Call[CNNBatchNormalization](cc, objc.Sel("alloc")) + return rv +} + +func CNNBatchNormalization_Alloc() CNNBatchNormalization { + return CNNBatchNormalizationClass.Alloc() +} + +func (cc _CNNBatchNormalizationClass) New() CNNBatchNormalization { + rv := objc.Call[CNNBatchNormalization](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBatchNormalization() CNNBatchNormalization { + return CNNBatchNormalizationClass.New() +} + +func (c_ CNNBatchNormalization) Init() CNNBatchNormalization { + rv := objc.Call[CNNBatchNormalization](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBatchNormalization) InitWithDevice(device metal.PDevice) CNNBatchNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalization](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNBatchNormalizationWithDevice(device metal.PDevice) CNNBatchNormalization { + instance := CNNBatchNormalizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNBatchNormalization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalization](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNBatchNormalization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalization { + instance := CNNBatchNormalizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/3002358-reloadmeanandvariancefromdatasou?language=objc +func (c_ CNNBatchNormalization) ReloadMeanAndVarianceFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadMeanAndVarianceFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2976464-reloadgammaandbetafromdatasource?language=objc +func (c_ CNNBatchNormalization) ReloadGammaAndBetaFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942610-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalization) EncodeBatchToCommandBufferSourceImagesBatchNormalizationStateDestinationImages(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState, destinationImages *foundation.Array) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:batchNormalizationState:destinationImages:"), po0, sourceImages, objc.Ptr(batchNormalizationState), destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942610-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalization) EncodeBatchToCommandBufferObjectSourceImagesBatchNormalizationStateDestinationImages(commandBufferObject objc.IObject, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState, destinationImages *foundation.Array) { + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:batchNormalizationState:destinationImages:"), objc.Ptr(commandBufferObject), sourceImages, objc.Ptr(batchNormalizationState), destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2953965-reloadgammaandbetawithcommandbuf?language=objc +func (c_ CNNBatchNormalization) ReloadGammaAndBetaWithCommandBufferGammaAndBetaState(commandBuffer metal.PCommandBuffer, gammaAndBetaState ICNNNormalizationGammaAndBetaState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaWithCommandBuffer:gammaAndBetaState:"), po0, objc.Ptr(gammaAndBetaState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2953965-reloadgammaandbetawithcommandbuf?language=objc +func (c_ CNNBatchNormalization) ReloadGammaAndBetaWithCommandBufferObjectGammaAndBetaState(commandBufferObject objc.IObject, gammaAndBetaState ICNNNormalizationGammaAndBetaState) { + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaWithCommandBuffer:gammaAndBetaState:"), objc.Ptr(commandBufferObject), objc.Ptr(gammaAndBetaState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/3002359-reloadmeanandvariancewithcommand?language=objc +func (c_ CNNBatchNormalization) ReloadMeanAndVarianceWithCommandBufferMeanAndVarianceState(commandBuffer metal.PCommandBuffer, meanAndVarianceState ICNNNormalizationMeanAndVarianceState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadMeanAndVarianceWithCommandBuffer:meanAndVarianceState:"), po0, objc.Ptr(meanAndVarianceState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/3002359-reloadmeanandvariancewithcommand?language=objc +func (c_ CNNBatchNormalization) ReloadMeanAndVarianceWithCommandBufferObjectMeanAndVarianceState(commandBufferObject objc.IObject, meanAndVarianceState ICNNNormalizationMeanAndVarianceState) { + objc.Call[objc.Void](c_, objc.Sel("reloadMeanAndVarianceWithCommandBuffer:meanAndVarianceState:"), objc.Ptr(commandBufferObject), objc.Ptr(meanAndVarianceState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942591-encodetocommandbuffer?language=objc +func (c_ CNNBatchNormalization) EncodeToCommandBufferSourceImageBatchNormalizationStateDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState, destinationImage IImage) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("encodeToCommandBuffer:sourceImage:batchNormalizationState:destinationImage:"), po0, objc.Ptr(sourceImage), objc.Ptr(batchNormalizationState), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942591-encodetocommandbuffer?language=objc +func (c_ CNNBatchNormalization) EncodeToCommandBufferObjectSourceImageBatchNormalizationStateDestinationImage(commandBufferObject objc.IObject, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState, destinationImage IImage) { + objc.Call[objc.Void](c_, objc.Sel("encodeToCommandBuffer:sourceImage:batchNormalizationState:destinationImage:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), objc.Ptr(batchNormalizationState), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2953967-datasource?language=objc +func (c_ CNNBatchNormalization) DataSource() CNNBatchNormalizationDataSourceWrapper { + rv := objc.Call[CNNBatchNormalizationDataSourceWrapper](c_, objc.Sel("dataSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942599-epsilon?language=objc +func (c_ CNNBatchNormalization) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942599-epsilon?language=objc +func (c_ CNNBatchNormalization) SetEpsilon(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setEpsilon:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalization/2942604-numberoffeaturechannels?language=objc +func (c_ CNNBatchNormalization) NumberOfFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfFeatureChannels")) + return rv +} diff --git a/macos/mps/cnn_batch_normalization_data_source.gen.go b/macos/mps/cnn_batch_normalization_data_source.gen.go new file mode 100644 index 00000000..bbf0d519 --- /dev/null +++ b/macos/mps/cnn_batch_normalization_data_source.gen.go @@ -0,0 +1,279 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines methods that a batch normalization state uses to initialize scale factors, bias terms, and batch statistics. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource?language=objc +type PCNNBatchNormalizationDataSource interface { + // optional + UpdateGammaAndBetaWithCommandBufferBatchNormalizationState(commandBuffer metal.CommandBufferWrapper, batchNormalizationState CNNBatchNormalizationState) ICNNNormalizationGammaAndBetaState + HasUpdateGammaAndBetaWithCommandBufferBatchNormalizationState() bool + + // optional + Beta() *float64 + HasBeta() bool + + // optional + Epsilon() float64 + HasEpsilon() bool + + // optional + EncodeWithCoder(aCoder foundation.Coder) + HasEncodeWithCoder() bool + + // optional + UpdateGammaAndBetaWithBatchNormalizationState(batchNormalizationState CNNBatchNormalizationState) bool + HasUpdateGammaAndBetaWithBatchNormalizationState() bool + + // optional + InitWithCoder(aDecoder foundation.Coder) objc.IObject + HasInitWithCoder() bool + + // optional + Gamma() *float64 + HasGamma() bool + + // optional + Purge() + HasPurge() bool + + // optional + UpdateMeanAndVarianceWithBatchNormalizationState(batchNormalizationState CNNBatchNormalizationState) bool + HasUpdateMeanAndVarianceWithBatchNormalizationState() bool + + // optional + Variance() *float64 + HasVariance() bool + + // optional + CopyWithZoneDevice(zone unsafe.Pointer, device metal.DeviceWrapper) objc.IObject + HasCopyWithZoneDevice() bool + + // optional + Load() bool + HasLoad() bool + + // optional + Label() string + HasLabel() bool + + // optional + UpdateMeanAndVarianceWithCommandBufferBatchNormalizationState(commandBuffer metal.CommandBufferWrapper, batchNormalizationState CNNBatchNormalizationState) ICNNNormalizationMeanAndVarianceState + HasUpdateMeanAndVarianceWithCommandBufferBatchNormalizationState() bool + + // optional + Mean() *float64 + HasMean() bool + + // optional + NumberOfFeatureChannels() uint + HasNumberOfFeatureChannels() bool +} + +// A concrete type wrapper for the [PCNNBatchNormalizationDataSource] protocol. +type CNNBatchNormalizationDataSourceWrapper struct { + objc.Object +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasUpdateGammaAndBetaWithCommandBufferBatchNormalizationState() bool { + return c_.RespondsToSelector(objc.Sel("updateGammaAndBetaWithCommandBuffer:batchNormalizationState:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2951891-updategammaandbetawithcommandbuf?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) UpdateGammaAndBetaWithCommandBufferBatchNormalizationState(commandBuffer metal.PCommandBuffer, batchNormalizationState ICNNBatchNormalizationState) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("updateGammaAndBetaWithCommandBuffer:batchNormalizationState:"), po0, objc.Ptr(batchNormalizationState)) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasBeta() bool { + return c_.RespondsToSelector(objc.Sel("beta")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2942586-beta?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Beta() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("beta")) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasEpsilon() bool { + return c_.RespondsToSelector(objc.Sel("epsilon")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2947917-epsilon?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasEncodeWithCoder() bool { + return c_.RespondsToSelector(objc.Sel("encodeWithCoder:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2951882-encodewithcoder?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) EncodeWithCoder(aCoder foundation.ICoder) { + objc.Call[objc.Void](c_, objc.Sel("encodeWithCoder:"), objc.Ptr(aCoder)) +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasUpdateGammaAndBetaWithBatchNormalizationState() bool { + return c_.RespondsToSelector(objc.Sel("updateGammaAndBetaWithBatchNormalizationState:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2953129-updategammaandbetawithbatchnorma?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) UpdateGammaAndBetaWithBatchNormalizationState(batchNormalizationState ICNNBatchNormalizationState) bool { + rv := objc.Call[bool](c_, objc.Sel("updateGammaAndBetaWithBatchNormalizationState:"), objc.Ptr(batchNormalizationState)) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasInitWithCoder() bool { + return c_.RespondsToSelector(objc.Sel("initWithCoder:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2951886-initwithcoder?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) InitWithCoder(aDecoder foundation.ICoder) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("initWithCoder:"), objc.Ptr(aDecoder)) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasGamma() bool { + return c_.RespondsToSelector(objc.Sel("gamma")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2942605-gamma?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Gamma() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("gamma")) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasPurge() bool { + return c_.RespondsToSelector(objc.Sel("purge")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2942607-purge?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Purge() { + objc.Call[objc.Void](c_, objc.Sel("purge")) +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasUpdateMeanAndVarianceWithBatchNormalizationState() bool { + return c_.RespondsToSelector(objc.Sel("updateMeanAndVarianceWithBatchNormalizationState:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/3002360-updatemeanandvariancewithbatchno?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) UpdateMeanAndVarianceWithBatchNormalizationState(batchNormalizationState ICNNBatchNormalizationState) bool { + rv := objc.Call[bool](c_, objc.Sel("updateMeanAndVarianceWithBatchNormalizationState:"), objc.Ptr(batchNormalizationState)) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasVariance() bool { + return c_.RespondsToSelector(objc.Sel("variance")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2942592-variance?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Variance() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("variance")) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasCopyWithZoneDevice() bool { + return c_.RespondsToSelector(objc.Sel("copyWithZone:device:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/3013773-copywithzone?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) objc.Object { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[objc.Object](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasLoad() bool { + return c_.RespondsToSelector(objc.Sel("load")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2942579-load?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Load() bool { + rv := objc.Call[bool](c_, objc.Sel("load")) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasLabel() bool { + return c_.RespondsToSelector(objc.Sel("label")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2953128-label?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Label() string { + rv := objc.Call[string](c_, objc.Sel("label")) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasUpdateMeanAndVarianceWithCommandBufferBatchNormalizationState() bool { + return c_.RespondsToSelector(objc.Sel("updateMeanAndVarianceWithCommandBuffer:batchNormalizationState:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/3002361-updatemeanandvariancewithcommand?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) UpdateMeanAndVarianceWithCommandBufferBatchNormalizationState(commandBuffer metal.PCommandBuffer, batchNormalizationState ICNNBatchNormalizationState) CNNNormalizationMeanAndVarianceState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationMeanAndVarianceState](c_, objc.Sel("updateMeanAndVarianceWithCommandBuffer:batchNormalizationState:"), po0, objc.Ptr(batchNormalizationState)) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasMean() bool { + return c_.RespondsToSelector(objc.Sel("mean")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2942589-mean?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) Mean() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("mean")) + return rv +} + +func (c_ CNNBatchNormalizationDataSourceWrapper) HasNumberOfFeatureChannels() bool { + return c_.RespondsToSelector(objc.Sel("numberOfFeatureChannels")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationdatasource/2942596-numberoffeaturechannels?language=objc +func (c_ CNNBatchNormalizationDataSourceWrapper) NumberOfFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfFeatureChannels")) + return rv +} diff --git a/macos/mps/cnn_batch_normalization_gradient.gen.go b/macos/mps/cnn_batch_normalization_gradient.gen.go new file mode 100644 index 00000000..07717e77 --- /dev/null +++ b/macos/mps/cnn_batch_normalization_gradient.gen.go @@ -0,0 +1,144 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBatchNormalizationGradient] class. +var CNNBatchNormalizationGradientClass = _CNNBatchNormalizationGradientClass{objc.GetClass("MPSCNNBatchNormalizationGradient")} + +type _CNNBatchNormalizationGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNBatchNormalizationGradient] class. +type ICNNBatchNormalizationGradient interface { + ICNNGradientKernel + EncodeBatchToCommandBufferSourceGradientsSourceImagesBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) *foundation.Array + EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesBatchNormalizationState(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) *foundation.Array + EncodeToCommandBufferSourceGradientSourceImageBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceGradient IImage, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState) Image + EncodeToCommandBufferObjectSourceGradientSourceImageBatchNormalizationState(commandBufferObject objc.IObject, sourceGradient IImage, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState) Image +} + +// A gradient batch normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradient?language=objc +type CNNBatchNormalizationGradient struct { + CNNGradientKernel +} + +func CNNBatchNormalizationGradientFrom(ptr unsafe.Pointer) CNNBatchNormalizationGradient { + return CNNBatchNormalizationGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNBatchNormalizationGradient) InitWithDeviceFusedNeuronDescriptor(device metal.PDevice, fusedNeuronDescriptor INNNeuronDescriptor) CNNBatchNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationGradient](c_, objc.Sel("initWithDevice:fusedNeuronDescriptor:"), po0, objc.Ptr(fusedNeuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradient/3019332-initwithdevice?language=objc +func NewCNNBatchNormalizationGradientWithDeviceFusedNeuronDescriptor(device metal.PDevice, fusedNeuronDescriptor INNNeuronDescriptor) CNNBatchNormalizationGradient { + instance := CNNBatchNormalizationGradientClass.Alloc().InitWithDeviceFusedNeuronDescriptor(device, fusedNeuronDescriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNBatchNormalizationGradientClass) Alloc() CNNBatchNormalizationGradient { + rv := objc.Call[CNNBatchNormalizationGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNBatchNormalizationGradient_Alloc() CNNBatchNormalizationGradient { + return CNNBatchNormalizationGradientClass.Alloc() +} + +func (cc _CNNBatchNormalizationGradientClass) New() CNNBatchNormalizationGradient { + rv := objc.Call[CNNBatchNormalizationGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBatchNormalizationGradient() CNNBatchNormalizationGradient { + return CNNBatchNormalizationGradientClass.New() +} + +func (c_ CNNBatchNormalizationGradient) Init() CNNBatchNormalizationGradient { + rv := objc.Call[CNNBatchNormalizationGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBatchNormalizationGradient) InitWithDevice(device metal.PDevice) CNNBatchNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNBatchNormalizationGradientWithDevice(device metal.PDevice) CNNBatchNormalizationGradient { + instance := CNNBatchNormalizationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNBatchNormalizationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalizationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNBatchNormalizationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalizationGradient { + instance := CNNBatchNormalizationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradient/2942590-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalizationGradient) EncodeBatchToCommandBufferSourceGradientsSourceImagesBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:batchNormalizationState:"), po0, sourceGradients, sourceImages, objc.Ptr(batchNormalizationState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradient/2942590-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalizationGradient) EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesBatchNormalizationState(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:batchNormalizationState:"), objc.Ptr(commandBufferObject), sourceGradients, sourceImages, objc.Ptr(batchNormalizationState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradient/2951885-encodetocommandbuffer?language=objc +func (c_ CNNBatchNormalizationGradient) EncodeToCommandBufferSourceGradientSourceImageBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceGradient IImage, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceGradient:sourceImage:batchNormalizationState:"), po0, objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(batchNormalizationState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradient/2951885-encodetocommandbuffer?language=objc +func (c_ CNNBatchNormalizationGradient) EncodeToCommandBufferObjectSourceGradientSourceImageBatchNormalizationState(commandBufferObject objc.IObject, sourceGradient IImage, sourceImage IImage, batchNormalizationState ICNNBatchNormalizationState) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceGradient:sourceImage:batchNormalizationState:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(batchNormalizationState)) + return rv +} diff --git a/macos/mps/cnn_batch_normalization_gradient_node.gen.go b/macos/mps/cnn_batch_normalization_gradient_node.gen.go new file mode 100644 index 00000000..361d81c7 --- /dev/null +++ b/macos/mps/cnn_batch_normalization_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBatchNormalizationGradientNode] class. +var CNNBatchNormalizationGradientNodeClass = _CNNBatchNormalizationGradientNodeClass{objc.GetClass("MPSCNNBatchNormalizationGradientNode")} + +type _CNNBatchNormalizationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNBatchNormalizationGradientNode] class. +type ICNNBatchNormalizationGradientNode interface { + INNGradientFilterNode +} + +// A representation of a gradient batch normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradientnode?language=objc +type CNNBatchNormalizationGradientNode struct { + NNGradientFilterNode +} + +func CNNBatchNormalizationGradientNodeFrom(ptr unsafe.Pointer) CNNBatchNormalizationGradientNode { + return CNNBatchNormalizationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNBatchNormalizationGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNBatchNormalizationGradientNode { + rv := objc.Call[CNNBatchNormalizationGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradientnode/2953939-initwithsourcegradient?language=objc +func NewCNNBatchNormalizationGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNBatchNormalizationGradientNode { + instance := CNNBatchNormalizationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (cc _CNNBatchNormalizationGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNBatchNormalizationGradientNode { + rv := objc.Call[CNNBatchNormalizationGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationgradientnode/2953943-nodewithsourcegradient?language=objc +func CNNBatchNormalizationGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNBatchNormalizationGradientNode { + return CNNBatchNormalizationGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (cc _CNNBatchNormalizationGradientNodeClass) Alloc() CNNBatchNormalizationGradientNode { + rv := objc.Call[CNNBatchNormalizationGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNBatchNormalizationGradientNode_Alloc() CNNBatchNormalizationGradientNode { + return CNNBatchNormalizationGradientNodeClass.Alloc() +} + +func (cc _CNNBatchNormalizationGradientNodeClass) New() CNNBatchNormalizationGradientNode { + rv := objc.Call[CNNBatchNormalizationGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBatchNormalizationGradientNode() CNNBatchNormalizationGradientNode { + return CNNBatchNormalizationGradientNodeClass.New() +} + +func (c_ CNNBatchNormalizationGradientNode) Init() CNNBatchNormalizationGradientNode { + rv := objc.Call[CNNBatchNormalizationGradientNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_batch_normalization_node.gen.go b/macos/mps/cnn_batch_normalization_node.gen.go new file mode 100644 index 00000000..62244f64 --- /dev/null +++ b/macos/mps/cnn_batch_normalization_node.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBatchNormalizationNode] class. +var CNNBatchNormalizationNodeClass = _CNNBatchNormalizationNodeClass{objc.GetClass("MPSCNNBatchNormalizationNode")} + +type _CNNBatchNormalizationNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNBatchNormalizationNode] class. +type ICNNBatchNormalizationNode interface { + INNFilterNode + TrainingStyle() NNTrainingStyle + SetTrainingStyle(value NNTrainingStyle) + Flags() CNNBatchNormalizationFlags + SetFlags(value CNNBatchNormalizationFlags) +} + +// A representation of a batch normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationnode?language=objc +type CNNBatchNormalizationNode struct { + NNFilterNode +} + +func CNNBatchNormalizationNodeFrom(ptr unsafe.Pointer) CNNBatchNormalizationNode { + return CNNBatchNormalizationNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNBatchNormalizationNodeClass) NodeWithSourceDataSource(source INNImageNode, dataSource PCNNBatchNormalizationDataSource) CNNBatchNormalizationNode { + po1 := objc.WrapAsProtocol("MPSCNNBatchNormalizationDataSource", dataSource) + rv := objc.Call[CNNBatchNormalizationNode](cc, objc.Sel("nodeWithSource:dataSource:"), objc.Ptr(source), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationnode/2948033-nodewithsource?language=objc +func CNNBatchNormalizationNode_NodeWithSourceDataSource(source INNImageNode, dataSource PCNNBatchNormalizationDataSource) CNNBatchNormalizationNode { + return CNNBatchNormalizationNodeClass.NodeWithSourceDataSource(source, dataSource) +} + +func (c_ CNNBatchNormalizationNode) InitWithSourceDataSource(source INNImageNode, dataSource PCNNBatchNormalizationDataSource) CNNBatchNormalizationNode { + po1 := objc.WrapAsProtocol("MPSCNNBatchNormalizationDataSource", dataSource) + rv := objc.Call[CNNBatchNormalizationNode](c_, objc.Sel("initWithSource:dataSource:"), objc.Ptr(source), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationnode/2948004-initwithsource?language=objc +func NewCNNBatchNormalizationNodeWithSourceDataSource(source INNImageNode, dataSource PCNNBatchNormalizationDataSource) CNNBatchNormalizationNode { + instance := CNNBatchNormalizationNodeClass.Alloc().InitWithSourceDataSource(source, dataSource) + instance.Autorelease() + return instance +} + +func (cc _CNNBatchNormalizationNodeClass) Alloc() CNNBatchNormalizationNode { + rv := objc.Call[CNNBatchNormalizationNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNBatchNormalizationNode_Alloc() CNNBatchNormalizationNode { + return CNNBatchNormalizationNodeClass.Alloc() +} + +func (cc _CNNBatchNormalizationNodeClass) New() CNNBatchNormalizationNode { + rv := objc.Call[CNNBatchNormalizationNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBatchNormalizationNode() CNNBatchNormalizationNode { + return CNNBatchNormalizationNodeClass.New() +} + +func (c_ CNNBatchNormalizationNode) Init() CNNBatchNormalizationNode { + rv := objc.Call[CNNBatchNormalizationNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationnode/3197821-trainingstyle?language=objc +func (c_ CNNBatchNormalizationNode) TrainingStyle() NNTrainingStyle { + rv := objc.Call[NNTrainingStyle](c_, objc.Sel("trainingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationnode/3197821-trainingstyle?language=objc +func (c_ CNNBatchNormalizationNode) SetTrainingStyle(value NNTrainingStyle) { + objc.Call[objc.Void](c_, objc.Sel("setTrainingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationnode/2953940-flags?language=objc +func (c_ CNNBatchNormalizationNode) Flags() CNNBatchNormalizationFlags { + rv := objc.Call[CNNBatchNormalizationFlags](c_, objc.Sel("flags")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationnode/2953940-flags?language=objc +func (c_ CNNBatchNormalizationNode) SetFlags(value CNNBatchNormalizationFlags) { + objc.Call[objc.Void](c_, objc.Sel("setFlags:"), value) +} diff --git a/macos/mps/cnn_batch_normalization_state.gen.go b/macos/mps/cnn_batch_normalization_state.gen.go new file mode 100644 index 00000000..fe698a10 --- /dev/null +++ b/macos/mps/cnn_batch_normalization_state.gen.go @@ -0,0 +1,187 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBatchNormalizationState] class. +var CNNBatchNormalizationStateClass = _CNNBatchNormalizationStateClass{objc.GetClass("MPSCNNBatchNormalizationState")} + +type _CNNBatchNormalizationStateClass struct { + objc.Class +} + +// An interface definition for the [CNNBatchNormalizationState] class. +type ICNNBatchNormalizationState interface { + INNGradientState + GradientForGamma() metal.BufferWrapper + Beta() metal.BufferWrapper + Gamma() metal.BufferWrapper + GradientForBeta() metal.BufferWrapper + Variance() metal.BufferWrapper + Reset() + Mean() metal.BufferWrapper + BatchNormalization() CNNBatchNormalization +} + +// An object that stores data required to execute batch normalization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate?language=objc +type CNNBatchNormalizationState struct { + NNGradientState +} + +func CNNBatchNormalizationStateFrom(ptr unsafe.Pointer) CNNBatchNormalizationState { + return CNNBatchNormalizationState{ + NNGradientState: NNGradientStateFrom(ptr), + } +} + +func (cc _CNNBatchNormalizationStateClass) Alloc() CNNBatchNormalizationState { + rv := objc.Call[CNNBatchNormalizationState](cc, objc.Sel("alloc")) + return rv +} + +func CNNBatchNormalizationState_Alloc() CNNBatchNormalizationState { + return CNNBatchNormalizationStateClass.Alloc() +} + +func (cc _CNNBatchNormalizationStateClass) New() CNNBatchNormalizationState { + rv := objc.Call[CNNBatchNormalizationState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBatchNormalizationState() CNNBatchNormalizationState { + return CNNBatchNormalizationStateClass.New() +} + +func (c_ CNNBatchNormalizationState) Init() CNNBatchNormalizationState { + rv := objc.Call[CNNBatchNormalizationState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBatchNormalizationState) InitWithResources(resources []metal.PResource) CNNBatchNormalizationState { + rv := objc.Call[CNNBatchNormalizationState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNBatchNormalizationStateWithResources(resources []metal.PResource) CNNBatchNormalizationState { + instance := CNNBatchNormalizationStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNBatchNormalizationState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNBatchNormalizationState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNBatchNormalizationStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNBatchNormalizationState { + instance := CNNBatchNormalizationStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNBatchNormalizationState) InitWithResource(resource metal.PResource) CNNBatchNormalizationState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNBatchNormalizationState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNBatchNormalizationStateWithResource(resource metal.PResource) CNNBatchNormalizationState { + instance := CNNBatchNormalizationStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNBatchNormalizationStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNBatchNormalizationState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNBatchNormalizationState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNBatchNormalizationState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNBatchNormalizationState { + return CNNBatchNormalizationStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2951893-gradientforgamma?language=objc +func (c_ CNNBatchNormalizationState) GradientForGamma() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForGamma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2951888-beta?language=objc +func (c_ CNNBatchNormalizationState) Beta() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2951892-gamma?language=objc +func (c_ CNNBatchNormalizationState) Gamma() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gamma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2951890-gradientforbeta?language=objc +func (c_ CNNBatchNormalizationState) GradientForBeta() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForBeta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2942603-variance?language=objc +func (c_ CNNBatchNormalizationState) Variance() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("variance")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2942587-reset?language=objc +func (c_ CNNBatchNormalizationState) Reset() { + objc.Call[objc.Void](c_, objc.Sel("reset")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2942612-mean?language=objc +func (c_ CNNBatchNormalizationState) Mean() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("mean")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstate/2953969-batchnormalization?language=objc +func (c_ CNNBatchNormalizationState) BatchNormalization() CNNBatchNormalization { + rv := objc.Call[CNNBatchNormalization](c_, objc.Sel("batchNormalization")) + return rv +} diff --git a/macos/mps/cnn_batch_normalization_statistics.gen.go b/macos/mps/cnn_batch_normalization_statistics.gen.go new file mode 100644 index 00000000..68a172a3 --- /dev/null +++ b/macos/mps/cnn_batch_normalization_statistics.gen.go @@ -0,0 +1,108 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBatchNormalizationStatistics] class. +var CNNBatchNormalizationStatisticsClass = _CNNBatchNormalizationStatisticsClass{objc.GetClass("MPSCNNBatchNormalizationStatistics")} + +type _CNNBatchNormalizationStatisticsClass struct { + objc.Class +} + +// An interface definition for the [CNNBatchNormalizationStatistics] class. +type ICNNBatchNormalizationStatistics interface { + ICNNKernel + EncodeBatchToCommandBufferSourceImagesBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) + EncodeBatchToCommandBufferObjectSourceImagesBatchNormalizationState(commandBufferObject objc.IObject, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) +} + +// An object that stores statistics required to execute batch normalization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatistics?language=objc +type CNNBatchNormalizationStatistics struct { + CNNKernel +} + +func CNNBatchNormalizationStatisticsFrom(ptr unsafe.Pointer) CNNBatchNormalizationStatistics { + return CNNBatchNormalizationStatistics{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNBatchNormalizationStatistics) InitWithDevice(device metal.PDevice) CNNBatchNormalizationStatistics { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationStatistics](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatistics/2953968-initwithdevice?language=objc +func NewCNNBatchNormalizationStatisticsWithDevice(device metal.PDevice) CNNBatchNormalizationStatistics { + instance := CNNBatchNormalizationStatisticsClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNBatchNormalizationStatisticsClass) Alloc() CNNBatchNormalizationStatistics { + rv := objc.Call[CNNBatchNormalizationStatistics](cc, objc.Sel("alloc")) + return rv +} + +func CNNBatchNormalizationStatistics_Alloc() CNNBatchNormalizationStatistics { + return CNNBatchNormalizationStatisticsClass.Alloc() +} + +func (cc _CNNBatchNormalizationStatisticsClass) New() CNNBatchNormalizationStatistics { + rv := objc.Call[CNNBatchNormalizationStatistics](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBatchNormalizationStatistics() CNNBatchNormalizationStatistics { + return CNNBatchNormalizationStatisticsClass.New() +} + +func (c_ CNNBatchNormalizationStatistics) Init() CNNBatchNormalizationStatistics { + rv := objc.Call[CNNBatchNormalizationStatistics](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBatchNormalizationStatistics) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalizationStatistics { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationStatistics](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNBatchNormalizationStatistics_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalizationStatistics { + instance := CNNBatchNormalizationStatisticsClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatistics/2942584-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalizationStatistics) EncodeBatchToCommandBufferSourceImagesBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:batchNormalizationState:"), po0, sourceImages, objc.Ptr(batchNormalizationState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatistics/2942584-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalizationStatistics) EncodeBatchToCommandBufferObjectSourceImagesBatchNormalizationState(commandBufferObject objc.IObject, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) { + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:batchNormalizationState:"), objc.Ptr(commandBufferObject), sourceImages, objc.Ptr(batchNormalizationState)) +} diff --git a/macos/mps/cnn_batch_normalization_statistics_gradient.gen.go b/macos/mps/cnn_batch_normalization_statistics_gradient.gen.go new file mode 100644 index 00000000..bf7ab5f7 --- /dev/null +++ b/macos/mps/cnn_batch_normalization_statistics_gradient.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBatchNormalizationStatisticsGradient] class. +var CNNBatchNormalizationStatisticsGradientClass = _CNNBatchNormalizationStatisticsGradientClass{objc.GetClass("MPSCNNBatchNormalizationStatisticsGradient")} + +type _CNNBatchNormalizationStatisticsGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNBatchNormalizationStatisticsGradient] class. +type ICNNBatchNormalizationStatisticsGradient interface { + ICNNGradientKernel + EncodeBatchToCommandBufferSourceGradientsSourceImagesBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) + EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesBatchNormalizationState(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) +} + +// An object that stores the gradient of the loss function with respect to the batch statistics and batch normalization weights. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatisticsgradient?language=objc +type CNNBatchNormalizationStatisticsGradient struct { + CNNGradientKernel +} + +func CNNBatchNormalizationStatisticsGradientFrom(ptr unsafe.Pointer) CNNBatchNormalizationStatisticsGradient { + return CNNBatchNormalizationStatisticsGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNBatchNormalizationStatisticsGradient) InitWithDeviceFusedNeuronDescriptor(device metal.PDevice, fusedNeuronDescriptor INNNeuronDescriptor) CNNBatchNormalizationStatisticsGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationStatisticsGradient](c_, objc.Sel("initWithDevice:fusedNeuronDescriptor:"), po0, objc.Ptr(fusedNeuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatisticsgradient/3013775-initwithdevice?language=objc +func NewCNNBatchNormalizationStatisticsGradientWithDeviceFusedNeuronDescriptor(device metal.PDevice, fusedNeuronDescriptor INNNeuronDescriptor) CNNBatchNormalizationStatisticsGradient { + instance := CNNBatchNormalizationStatisticsGradientClass.Alloc().InitWithDeviceFusedNeuronDescriptor(device, fusedNeuronDescriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNBatchNormalizationStatisticsGradientClass) Alloc() CNNBatchNormalizationStatisticsGradient { + rv := objc.Call[CNNBatchNormalizationStatisticsGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNBatchNormalizationStatisticsGradient_Alloc() CNNBatchNormalizationStatisticsGradient { + return CNNBatchNormalizationStatisticsGradientClass.Alloc() +} + +func (cc _CNNBatchNormalizationStatisticsGradientClass) New() CNNBatchNormalizationStatisticsGradient { + rv := objc.Call[CNNBatchNormalizationStatisticsGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBatchNormalizationStatisticsGradient() CNNBatchNormalizationStatisticsGradient { + return CNNBatchNormalizationStatisticsGradientClass.New() +} + +func (c_ CNNBatchNormalizationStatisticsGradient) Init() CNNBatchNormalizationStatisticsGradient { + rv := objc.Call[CNNBatchNormalizationStatisticsGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBatchNormalizationStatisticsGradient) InitWithDevice(device metal.PDevice) CNNBatchNormalizationStatisticsGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationStatisticsGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNBatchNormalizationStatisticsGradientWithDevice(device metal.PDevice) CNNBatchNormalizationStatisticsGradient { + instance := CNNBatchNormalizationStatisticsGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNBatchNormalizationStatisticsGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalizationStatisticsGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBatchNormalizationStatisticsGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNBatchNormalizationStatisticsGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBatchNormalizationStatisticsGradient { + instance := CNNBatchNormalizationStatisticsGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatisticsgradient/2953964-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalizationStatisticsGradient) EncodeBatchToCommandBufferSourceGradientsSourceImagesBatchNormalizationState(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:batchNormalizationState:"), po0, sourceGradients, sourceImages, objc.Ptr(batchNormalizationState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationstatisticsgradient/2953964-encodebatchtocommandbuffer?language=objc +func (c_ CNNBatchNormalizationStatisticsGradient) EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesBatchNormalizationState(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, batchNormalizationState ICNNBatchNormalizationState) { + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:batchNormalizationState:"), objc.Ptr(commandBufferObject), sourceGradients, sourceImages, objc.Ptr(batchNormalizationState)) +} diff --git a/macos/mps/cnn_binary_convolution.gen.go b/macos/mps/cnn_binary_convolution.gen.go new file mode 100644 index 00000000..6408c7a2 --- /dev/null +++ b/macos/mps/cnn_binary_convolution.gen.go @@ -0,0 +1,124 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBinaryConvolution] class. +var CNNBinaryConvolutionClass = _CNNBinaryConvolutionClass{objc.GetClass("MPSCNNBinaryConvolution")} + +type _CNNBinaryConvolutionClass struct { + objc.Class +} + +// An interface definition for the [CNNBinaryConvolution] class. +type ICNNBinaryConvolution interface { + ICNNKernel + OutputFeatureChannels() uint + InputFeatureChannels() uint +} + +// A convolution kernel with binary weights and an input image using binary approximations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolution?language=objc +type CNNBinaryConvolution struct { + CNNKernel +} + +func CNNBinaryConvolutionFrom(ptr unsafe.Pointer) CNNBinaryConvolution { + return CNNBinaryConvolution{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNBinaryConvolution) InitWithDeviceConvolutionDataScaleValueTypeFlags(device metal.PDevice, convolutionData PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryConvolution { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", convolutionData) + rv := objc.Call[CNNBinaryConvolution](c_, objc.Sel("initWithDevice:convolutionData:scaleValue:type:flags:"), po0, po1, scaleValue, type_, flags) + return rv +} + +// Initializes a binary convolution kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolution/2866981-initwithdevice?language=objc +func NewCNNBinaryConvolutionWithDeviceConvolutionDataScaleValueTypeFlags(device metal.PDevice, convolutionData PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryConvolution { + instance := CNNBinaryConvolutionClass.Alloc().InitWithDeviceConvolutionDataScaleValueTypeFlags(device, convolutionData, scaleValue, type_, flags) + instance.Autorelease() + return instance +} + +func (cc _CNNBinaryConvolutionClass) Alloc() CNNBinaryConvolution { + rv := objc.Call[CNNBinaryConvolution](cc, objc.Sel("alloc")) + return rv +} + +func CNNBinaryConvolution_Alloc() CNNBinaryConvolution { + return CNNBinaryConvolutionClass.Alloc() +} + +func (cc _CNNBinaryConvolutionClass) New() CNNBinaryConvolution { + rv := objc.Call[CNNBinaryConvolution](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBinaryConvolution() CNNBinaryConvolution { + return CNNBinaryConvolutionClass.New() +} + +func (c_ CNNBinaryConvolution) Init() CNNBinaryConvolution { + rv := objc.Call[CNNBinaryConvolution](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBinaryConvolution) InitWithDevice(device metal.PDevice) CNNBinaryConvolution { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBinaryConvolution](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNBinaryConvolutionWithDevice(device metal.PDevice) CNNBinaryConvolution { + instance := CNNBinaryConvolutionClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNBinaryConvolution) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBinaryConvolution { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBinaryConvolution](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNBinaryConvolution_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBinaryConvolution { + instance := CNNBinaryConvolutionClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolution/2866959-outputfeaturechannels?language=objc +func (c_ CNNBinaryConvolution) OutputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("outputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolution/2867126-inputfeaturechannels?language=objc +func (c_ CNNBinaryConvolution) InputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("inputFeatureChannels")) + return rv +} diff --git a/macos/mps/cnn_binary_convolution_node.gen.go b/macos/mps/cnn_binary_convolution_node.gen.go new file mode 100644 index 00000000..4bf73554 --- /dev/null +++ b/macos/mps/cnn_binary_convolution_node.gen.go @@ -0,0 +1,114 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBinaryConvolutionNode] class. +var CNNBinaryConvolutionNodeClass = _CNNBinaryConvolutionNodeClass{objc.GetClass("MPSCNNBinaryConvolutionNode")} + +type _CNNBinaryConvolutionNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNBinaryConvolutionNode] class. +type ICNNBinaryConvolutionNode interface { + ICNNConvolutionNode +} + +// A representation of a convolution kernel with binary weights and an input image using binary approximations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolutionnode?language=objc +type CNNBinaryConvolutionNode struct { + CNNConvolutionNode +} + +func CNNBinaryConvolutionNodeFrom(ptr unsafe.Pointer) CNNBinaryConvolutionNode { + return CNNBinaryConvolutionNode{ + CNNConvolutionNode: CNNConvolutionNodeFrom(ptr), + } +} + +func (cc _CNNBinaryConvolutionNodeClass) NodeWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryConvolutionNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryConvolutionNode](cc, objc.Sel("nodeWithSource:weights:scaleValue:type:flags:"), objc.Ptr(sourceNode), po1, scaleValue, type_, flags) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolutionnode/2866487-nodewithsource?language=objc +func CNNBinaryConvolutionNode_NodeWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryConvolutionNode { + return CNNBinaryConvolutionNodeClass.NodeWithSourceWeightsScaleValueTypeFlags(sourceNode, weights, scaleValue, type_, flags) +} + +func (c_ CNNBinaryConvolutionNode) InitWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryConvolutionNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryConvolutionNode](c_, objc.Sel("initWithSource:weights:scaleValue:type:flags:"), objc.Ptr(sourceNode), po1, scaleValue, type_, flags) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolutionnode/2866509-initwithsource?language=objc +func NewCNNBinaryConvolutionNodeWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryConvolutionNode { + instance := CNNBinaryConvolutionNodeClass.Alloc().InitWithSourceWeightsScaleValueTypeFlags(sourceNode, weights, scaleValue, type_, flags) + instance.Autorelease() + return instance +} + +func (cc _CNNBinaryConvolutionNodeClass) Alloc() CNNBinaryConvolutionNode { + rv := objc.Call[CNNBinaryConvolutionNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNBinaryConvolutionNode_Alloc() CNNBinaryConvolutionNode { + return CNNBinaryConvolutionNodeClass.Alloc() +} + +func (cc _CNNBinaryConvolutionNodeClass) New() CNNBinaryConvolutionNode { + rv := objc.Call[CNNBinaryConvolutionNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBinaryConvolutionNode() CNNBinaryConvolutionNode { + return CNNBinaryConvolutionNodeClass.New() +} + +func (c_ CNNBinaryConvolutionNode) Init() CNNBinaryConvolutionNode { + rv := objc.Call[CNNBinaryConvolutionNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNBinaryConvolutionNodeClass) NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryConvolutionNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryConvolutionNode](cc, objc.Sel("nodeWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866436-nodewithsource?language=objc +func CNNBinaryConvolutionNode_NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryConvolutionNode { + return CNNBinaryConvolutionNodeClass.NodeWithSourceWeights(sourceNode, weights) +} + +func (c_ CNNBinaryConvolutionNode) InitWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryConvolutionNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryConvolutionNode](c_, objc.Sel("initWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866470-initwithsource?language=objc +func NewCNNBinaryConvolutionNodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryConvolutionNode { + instance := CNNBinaryConvolutionNodeClass.Alloc().InitWithSourceWeights(sourceNode, weights) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_binary_fully_connected.gen.go b/macos/mps/cnn_binary_fully_connected.gen.go new file mode 100644 index 00000000..5a23b5c6 --- /dev/null +++ b/macos/mps/cnn_binary_fully_connected.gen.go @@ -0,0 +1,106 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBinaryFullyConnected] class. +var CNNBinaryFullyConnectedClass = _CNNBinaryFullyConnectedClass{objc.GetClass("MPSCNNBinaryFullyConnected")} + +type _CNNBinaryFullyConnectedClass struct { + objc.Class +} + +// An interface definition for the [CNNBinaryFullyConnected] class. +type ICNNBinaryFullyConnected interface { + ICNNBinaryConvolution +} + +// A fully connected convolution layer with binary weights and optionally binarized input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryfullyconnected?language=objc +type CNNBinaryFullyConnected struct { + CNNBinaryConvolution +} + +func CNNBinaryFullyConnectedFrom(ptr unsafe.Pointer) CNNBinaryFullyConnected { + return CNNBinaryFullyConnected{ + CNNBinaryConvolution: CNNBinaryConvolutionFrom(ptr), + } +} + +func (c_ CNNBinaryFullyConnected) InitWithDeviceConvolutionDataScaleValueTypeFlags(device metal.PDevice, convolutionData PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnected { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", convolutionData) + rv := objc.Call[CNNBinaryFullyConnected](c_, objc.Sel("initWithDevice:convolutionData:scaleValue:type:flags:"), po0, po1, scaleValue, type_, flags) + return rv +} + +// Initializes a fully connected convolution layer with binary weights. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryfullyconnected/2867196-initwithdevice?language=objc +func NewCNNBinaryFullyConnectedWithDeviceConvolutionDataScaleValueTypeFlags(device metal.PDevice, convolutionData PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnected { + instance := CNNBinaryFullyConnectedClass.Alloc().InitWithDeviceConvolutionDataScaleValueTypeFlags(device, convolutionData, scaleValue, type_, flags) + instance.Autorelease() + return instance +} + +func (cc _CNNBinaryFullyConnectedClass) Alloc() CNNBinaryFullyConnected { + rv := objc.Call[CNNBinaryFullyConnected](cc, objc.Sel("alloc")) + return rv +} + +func CNNBinaryFullyConnected_Alloc() CNNBinaryFullyConnected { + return CNNBinaryFullyConnectedClass.Alloc() +} + +func (cc _CNNBinaryFullyConnectedClass) New() CNNBinaryFullyConnected { + rv := objc.Call[CNNBinaryFullyConnected](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBinaryFullyConnected() CNNBinaryFullyConnected { + return CNNBinaryFullyConnectedClass.New() +} + +func (c_ CNNBinaryFullyConnected) Init() CNNBinaryFullyConnected { + rv := objc.Call[CNNBinaryFullyConnected](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBinaryFullyConnected) InitWithDevice(device metal.PDevice) CNNBinaryFullyConnected { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBinaryFullyConnected](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNBinaryFullyConnectedWithDevice(device metal.PDevice) CNNBinaryFullyConnected { + instance := CNNBinaryFullyConnectedClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNBinaryFullyConnected) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBinaryFullyConnected { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBinaryFullyConnected](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNBinaryFullyConnected_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBinaryFullyConnected { + instance := CNNBinaryFullyConnectedClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_binary_fully_connected_node.gen.go b/macos/mps/cnn_binary_fully_connected_node.gen.go new file mode 100644 index 00000000..6109f2dc --- /dev/null +++ b/macos/mps/cnn_binary_fully_connected_node.gen.go @@ -0,0 +1,129 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBinaryFullyConnectedNode] class. +var CNNBinaryFullyConnectedNodeClass = _CNNBinaryFullyConnectedNodeClass{objc.GetClass("MPSCNNBinaryFullyConnectedNode")} + +type _CNNBinaryFullyConnectedNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNBinaryFullyConnectedNode] class. +type ICNNBinaryFullyConnectedNode interface { + ICNNBinaryConvolutionNode +} + +// A representation of a fully connected convolution layer with binary weights and optionally binarized input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryfullyconnectednode?language=objc +type CNNBinaryFullyConnectedNode struct { + CNNBinaryConvolutionNode +} + +func CNNBinaryFullyConnectedNodeFrom(ptr unsafe.Pointer) CNNBinaryFullyConnectedNode { + return CNNBinaryFullyConnectedNode{ + CNNBinaryConvolutionNode: CNNBinaryConvolutionNodeFrom(ptr), + } +} + +func (cc _CNNBinaryFullyConnectedNodeClass) NodeWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnectedNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryFullyConnectedNode](cc, objc.Sel("nodeWithSource:weights:scaleValue:type:flags:"), objc.Ptr(sourceNode), po1, scaleValue, type_, flags) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryfullyconnectednode/2866469-nodewithsource?language=objc +func CNNBinaryFullyConnectedNode_NodeWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnectedNode { + return CNNBinaryFullyConnectedNodeClass.NodeWithSourceWeightsScaleValueTypeFlags(sourceNode, weights, scaleValue, type_, flags) +} + +func (c_ CNNBinaryFullyConnectedNode) InitWithSourceWeightsOutputBiasTermsOutputScaleTermsInputBiasTermsInputScaleTermsTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, outputBiasTerms *float64, outputScaleTerms *float64, inputBiasTerms *float64, inputScaleTerms *float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnectedNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryFullyConnectedNode](c_, objc.Sel("initWithSource:weights:outputBiasTerms:outputScaleTerms:inputBiasTerms:inputScaleTerms:type:flags:"), objc.Ptr(sourceNode), po1, outputBiasTerms, outputScaleTerms, inputBiasTerms, inputScaleTerms, type_, flags) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryfullyconnectednode/2942637-initwithsource?language=objc +func NewCNNBinaryFullyConnectedNodeWithSourceWeightsOutputBiasTermsOutputScaleTermsInputBiasTermsInputScaleTermsTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, outputBiasTerms *float64, outputScaleTerms *float64, inputBiasTerms *float64, inputScaleTerms *float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnectedNode { + instance := CNNBinaryFullyConnectedNodeClass.Alloc().InitWithSourceWeightsOutputBiasTermsOutputScaleTermsInputBiasTermsInputScaleTermsTypeFlags(sourceNode, weights, outputBiasTerms, outputScaleTerms, inputBiasTerms, inputScaleTerms, type_, flags) + instance.Autorelease() + return instance +} + +func (cc _CNNBinaryFullyConnectedNodeClass) Alloc() CNNBinaryFullyConnectedNode { + rv := objc.Call[CNNBinaryFullyConnectedNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNBinaryFullyConnectedNode_Alloc() CNNBinaryFullyConnectedNode { + return CNNBinaryFullyConnectedNodeClass.Alloc() +} + +func (cc _CNNBinaryFullyConnectedNodeClass) New() CNNBinaryFullyConnectedNode { + rv := objc.Call[CNNBinaryFullyConnectedNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBinaryFullyConnectedNode() CNNBinaryFullyConnectedNode { + return CNNBinaryFullyConnectedNodeClass.New() +} + +func (c_ CNNBinaryFullyConnectedNode) Init() CNNBinaryFullyConnectedNode { + rv := objc.Call[CNNBinaryFullyConnectedNode](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBinaryFullyConnectedNode) InitWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnectedNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryFullyConnectedNode](c_, objc.Sel("initWithSource:weights:scaleValue:type:flags:"), objc.Ptr(sourceNode), po1, scaleValue, type_, flags) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolutionnode/2866509-initwithsource?language=objc +func NewCNNBinaryFullyConnectedNodeWithSourceWeightsScaleValueTypeFlags(sourceNode INNImageNode, weights PCNNConvolutionDataSource, scaleValue float64, type_ CNNBinaryConvolutionType, flags CNNBinaryConvolutionFlags) CNNBinaryFullyConnectedNode { + instance := CNNBinaryFullyConnectedNodeClass.Alloc().InitWithSourceWeightsScaleValueTypeFlags(sourceNode, weights, scaleValue, type_, flags) + instance.Autorelease() + return instance +} + +func (cc _CNNBinaryFullyConnectedNodeClass) NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryFullyConnectedNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryFullyConnectedNode](cc, objc.Sel("nodeWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866436-nodewithsource?language=objc +func CNNBinaryFullyConnectedNode_NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryFullyConnectedNode { + return CNNBinaryFullyConnectedNodeClass.NodeWithSourceWeights(sourceNode, weights) +} + +func (c_ CNNBinaryFullyConnectedNode) InitWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryFullyConnectedNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNBinaryFullyConnectedNode](c_, objc.Sel("initWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866470-initwithsource?language=objc +func NewCNNBinaryFullyConnectedNodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNBinaryFullyConnectedNode { + instance := CNNBinaryFullyConnectedNodeClass.Alloc().InitWithSourceWeights(sourceNode, weights) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_binary_kernel.gen.go b/macos/mps/cnn_binary_kernel.gen.go new file mode 100644 index 00000000..ac1e8dd6 --- /dev/null +++ b/macos/mps/cnn_binary_kernel.gen.go @@ -0,0 +1,608 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNBinaryKernel] class. +var CNNBinaryKernelClass = _CNNBinaryKernelClass{objc.GetClass("MPSCNNBinaryKernel")} + +type _CNNBinaryKernelClass struct { + objc.Class +} + +// An interface definition for the [CNNBinaryKernel] class. +type ICNNBinaryKernel interface { + IKernel + BatchEncodingStorageSizeForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) uint + TemporaryResultStateForCommandBufferPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) State + TemporaryResultStateForCommandBufferObjectPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) State + ResultStateForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) State + AppendBatchBarrier() bool + TemporaryResultStateBatchForCommandBufferPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + TemporaryResultStateBatchForCommandBufferObjectPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBufferObject objc.IObject, primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + DestinationImageDescriptorForSourceImagesSourceStates(sourceImages []IImage, sourceStates []IState) ImageDescriptor + EncodeBatchToCommandBufferPrimaryImagesSecondaryImagesDestinationImages(commandBuffer metal.PCommandBuffer, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationImages *foundation.Array) + EncodeBatchToCommandBufferObjectPrimaryImagesSecondaryImagesDestinationImages(commandBufferObject objc.IObject, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationImages *foundation.Array) + ResultStateBatchForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + EncodingStorageSizeForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) uint + EncodeToCommandBufferPrimaryImageSecondaryImageDestinationStateDestinationStateIsTemporary(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, outState IState, isTemporary bool) Image + EncodeToCommandBufferObjectPrimaryImageSecondaryImageDestinationStateDestinationStateIsTemporary(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, outState IState, isTemporary bool) Image + IsResultStateReusedAcrossBatch() bool + SecondaryKernelHeight() uint + PrimarySourceFeatureChannelOffset() uint + SetPrimarySourceFeatureChannelOffset(value uint) + IsStateModified() bool + SecondaryEdgeMode() ImageEdgeMode + SetSecondaryEdgeMode(value ImageEdgeMode) + PrimaryKernelHeight() uint + SecondaryStrideInPixelsY() uint + SetSecondaryStrideInPixelsY(value uint) + SecondarySourceFeatureChannelOffset() uint + SetSecondarySourceFeatureChannelOffset(value uint) + SecondaryDilationRateY() uint + PrimaryDilationRateY() uint + SecondaryKernelWidth() uint + PrimaryEdgeMode() ImageEdgeMode + SetPrimaryEdgeMode(value ImageEdgeMode) + PrimaryDilationRateX() uint + Padding() NNPaddingWrapper + SetPadding(value PNNPadding) + SetPaddingObject(valueObject objc.IObject) + SecondarySourceFeatureChannelMaxCount() uint + SetSecondarySourceFeatureChannelMaxCount(value uint) + SecondaryDilationRateX() uint + SecondaryStrideInPixelsX() uint + SetSecondaryStrideInPixelsX(value uint) + PrimarySourceFeatureChannelMaxCount() uint + SetPrimarySourceFeatureChannelMaxCount(value uint) + PrimaryStrideInPixelsY() uint + SetPrimaryStrideInPixelsY(value uint) + PrimaryOffset() Offset + SetPrimaryOffset(value Offset) + PrimaryStrideInPixelsX() uint + SetPrimaryStrideInPixelsX(value uint) + IsBackwards() bool + SecondaryOffset() Offset + SetSecondaryOffset(value Offset) + ClipRect() metal.Region + SetClipRect(value metal.Region) + DestinationImageAllocator() ImageAllocatorWrapper + SetDestinationImageAllocator(value PImageAllocator) + SetDestinationImageAllocatorObject(valueObject objc.IObject) + PrimaryKernelWidth() uint + DestinationFeatureChannelOffset() uint + SetDestinationFeatureChannelOffset(value uint) +} + +// A convolution neural network kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel?language=objc +type CNNBinaryKernel struct { + Kernel +} + +func CNNBinaryKernelFrom(ptr unsafe.Pointer) CNNBinaryKernel { + return CNNBinaryKernel{ + Kernel: KernelFrom(ptr), + } +} + +func (c_ CNNBinaryKernel) InitWithDevice(device metal.PDevice) CNNBinaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBinaryKernel](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865629-initwithdevice?language=objc +func NewCNNBinaryKernelWithDevice(device metal.PDevice) CNNBinaryKernel { + instance := CNNBinaryKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNBinaryKernelClass) Alloc() CNNBinaryKernel { + rv := objc.Call[CNNBinaryKernel](cc, objc.Sel("alloc")) + return rv +} + +func CNNBinaryKernel_Alloc() CNNBinaryKernel { + return CNNBinaryKernelClass.Alloc() +} + +func (cc _CNNBinaryKernelClass) New() CNNBinaryKernel { + rv := objc.Call[CNNBinaryKernel](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNBinaryKernel() CNNBinaryKernel { + return CNNBinaryKernelClass.New() +} + +func (c_ CNNBinaryKernel) Init() CNNBinaryKernel { + rv := objc.Call[CNNBinaryKernel](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNBinaryKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBinaryKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNBinaryKernel](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNBinaryKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNBinaryKernel { + instance := CNNBinaryKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/3237261-batchencodingstoragesizeforprima?language=objc +func (c_ CNNBinaryKernel) BatchEncodingStorageSizeForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) uint { + rv := objc.Call[uint](c_, objc.Sel("batchEncodingStorageSizeForPrimaryImage:secondaryImage:sourceStates:destinationImage:"), primaryImage, secondaryImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947938-temporaryresultstateforcommandbu?language=objc +func (c_ CNNBinaryKernel) TemporaryResultStateForCommandBufferPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) State { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[State](c_, objc.Sel("temporaryResultStateForCommandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:"), po0, objc.Ptr(primaryImage), objc.Ptr(secondaryImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947938-temporaryresultstateforcommandbu?language=objc +func (c_ CNNBinaryKernel) TemporaryResultStateForCommandBufferObjectPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) State { + rv := objc.Call[State](c_, objc.Sel("temporaryResultStateForCommandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:"), objc.Ptr(commandBufferObject), objc.Ptr(primaryImage), objc.Ptr(secondaryImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947935-resultstateforprimaryimage?language=objc +func (c_ CNNBinaryKernel) ResultStateForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) State { + rv := objc.Call[State](c_, objc.Sel("resultStateForPrimaryImage:secondaryImage:sourceStates:destinationImage:"), objc.Ptr(primaryImage), objc.Ptr(secondaryImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942642-appendbatchbarrier?language=objc +func (c_ CNNBinaryKernel) AppendBatchBarrier() bool { + rv := objc.Call[bool](c_, objc.Sel("appendBatchBarrier")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947933-temporaryresultstatebatchforcomm?language=objc +func (c_ CNNBinaryKernel) TemporaryResultStateBatchForCommandBufferPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("temporaryResultStateBatchForCommandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:"), po0, primaryImage, secondaryImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947933-temporaryresultstatebatchforcomm?language=objc +func (c_ CNNBinaryKernel) TemporaryResultStateBatchForCommandBufferObjectPrimaryImageSecondaryImageSourceStatesDestinationImage(commandBufferObject objc.IObject, primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("temporaryResultStateBatchForCommandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:"), objc.Ptr(commandBufferObject), primaryImage, secondaryImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942686-destinationimagedescriptorforsou?language=objc +func (c_ CNNBinaryKernel) DestinationImageDescriptorForSourceImagesSourceStates(sourceImages []IImage, sourceStates []IState) ImageDescriptor { + rv := objc.Call[ImageDescriptor](c_, objc.Sel("destinationImageDescriptorForSourceImages:sourceStates:"), sourceImages, sourceStates) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942670-encodebatchtocommandbuffer?language=objc +func (c_ CNNBinaryKernel) EncodeBatchToCommandBufferPrimaryImagesSecondaryImagesDestinationImages(commandBuffer metal.PCommandBuffer, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationImages *foundation.Array) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:primaryImages:secondaryImages:destinationImages:"), po0, primaryImages, secondaryImages, destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942670-encodebatchtocommandbuffer?language=objc +func (c_ CNNBinaryKernel) EncodeBatchToCommandBufferObjectPrimaryImagesSecondaryImagesDestinationImages(commandBufferObject objc.IObject, primaryImages *foundation.Array, secondaryImages *foundation.Array, destinationImages *foundation.Array) { + objc.Call[objc.Void](c_, objc.Sel("encodeBatchToCommandBuffer:primaryImages:secondaryImages:destinationImages:"), objc.Ptr(commandBufferObject), primaryImages, secondaryImages, destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947930-resultstatebatchforprimaryimage?language=objc +func (c_ CNNBinaryKernel) ResultStateBatchForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage *foundation.Array, secondaryImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("resultStateBatchForPrimaryImage:secondaryImage:sourceStates:destinationImage:"), primaryImage, secondaryImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/3237262-encodingstoragesizeforprimaryima?language=objc +func (c_ CNNBinaryKernel) EncodingStorageSizeForPrimaryImageSecondaryImageSourceStatesDestinationImage(primaryImage IImage, secondaryImage IImage, sourceStates []IState, destinationImage IImage) uint { + rv := objc.Call[uint](c_, objc.Sel("encodingStorageSizeForPrimaryImage:secondaryImage:sourceStates:destinationImage:"), objc.Ptr(primaryImage), objc.Ptr(secondaryImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947936-encodetocommandbuffer?language=objc +func (c_ CNNBinaryKernel) EncodeToCommandBufferPrimaryImageSecondaryImageDestinationStateDestinationStateIsTemporary(commandBuffer metal.PCommandBuffer, primaryImage IImage, secondaryImage IImage, outState IState, isTemporary bool) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:primaryImage:secondaryImage:destinationState:destinationStateIsTemporary:"), po0, objc.Ptr(primaryImage), objc.Ptr(secondaryImage), objc.Ptr(outState), isTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2947936-encodetocommandbuffer?language=objc +func (c_ CNNBinaryKernel) EncodeToCommandBufferObjectPrimaryImageSecondaryImageDestinationStateDestinationStateIsTemporary(commandBufferObject objc.IObject, primaryImage IImage, secondaryImage IImage, outState IState, isTemporary bool) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:primaryImage:secondaryImage:destinationState:destinationStateIsTemporary:"), objc.Ptr(commandBufferObject), objc.Ptr(primaryImage), objc.Ptr(secondaryImage), objc.Ptr(outState), isTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942659-isresultstatereusedacrossbatch?language=objc +func (c_ CNNBinaryKernel) IsResultStateReusedAcrossBatch() bool { + rv := objc.Call[bool](c_, objc.Sel("isResultStateReusedAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942664-secondarykernelheight?language=objc +func (c_ CNNBinaryKernel) SecondaryKernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryKernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942656-primarysourcefeaturechanneloffse?language=objc +func (c_ CNNBinaryKernel) PrimarySourceFeatureChannelOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("primarySourceFeatureChannelOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942656-primarysourcefeaturechanneloffse?language=objc +func (c_ CNNBinaryKernel) SetPrimarySourceFeatureChannelOffset(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPrimarySourceFeatureChannelOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942660-isstatemodified?language=objc +func (c_ CNNBinaryKernel) IsStateModified() bool { + rv := objc.Call[bool](c_, objc.Sel("isStateModified")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865631-secondaryedgemode?language=objc +func (c_ CNNBinaryKernel) SecondaryEdgeMode() ImageEdgeMode { + rv := objc.Call[ImageEdgeMode](c_, objc.Sel("secondaryEdgeMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865631-secondaryedgemode?language=objc +func (c_ CNNBinaryKernel) SetSecondaryEdgeMode(value ImageEdgeMode) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryEdgeMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942648-primarykernelheight?language=objc +func (c_ CNNBinaryKernel) PrimaryKernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("primaryKernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865639-secondarystrideinpixelsy?language=objc +func (c_ CNNBinaryKernel) SecondaryStrideInPixelsY() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryStrideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865639-secondarystrideinpixelsy?language=objc +func (c_ CNNBinaryKernel) SetSecondaryStrideInPixelsY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryStrideInPixelsY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942654-secondarysourcefeaturechanneloff?language=objc +func (c_ CNNBinaryKernel) SecondarySourceFeatureChannelOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("secondarySourceFeatureChannelOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942654-secondarysourcefeaturechanneloff?language=objc +func (c_ CNNBinaryKernel) SetSecondarySourceFeatureChannelOffset(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSecondarySourceFeatureChannelOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942667-secondarydilationratey?language=objc +func (c_ CNNBinaryKernel) SecondaryDilationRateY() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryDilationRateY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942662-primarydilationratey?language=objc +func (c_ CNNBinaryKernel) PrimaryDilationRateY() uint { + rv := objc.Call[uint](c_, objc.Sel("primaryDilationRateY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942658-secondarykernelwidth?language=objc +func (c_ CNNBinaryKernel) SecondaryKernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryKernelWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865646-primaryedgemode?language=objc +func (c_ CNNBinaryKernel) PrimaryEdgeMode() ImageEdgeMode { + rv := objc.Call[ImageEdgeMode](c_, objc.Sel("primaryEdgeMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865646-primaryedgemode?language=objc +func (c_ CNNBinaryKernel) SetPrimaryEdgeMode(value ImageEdgeMode) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryEdgeMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942677-primarydilationratex?language=objc +func (c_ CNNBinaryKernel) PrimaryDilationRateX() uint { + rv := objc.Call[uint](c_, objc.Sel("primaryDilationRateX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865630-padding?language=objc +func (c_ CNNBinaryKernel) Padding() NNPaddingWrapper { + rv := objc.Call[NNPaddingWrapper](c_, objc.Sel("padding")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865630-padding?language=objc +func (c_ CNNBinaryKernel) SetPadding(value PNNPadding) { + po0 := objc.WrapAsProtocol("MPSNNPadding", value) + objc.Call[objc.Void](c_, objc.Sel("setPadding:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865630-padding?language=objc +func (c_ CNNBinaryKernel) SetPaddingObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setPadding:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2951918-secondarysourcefeaturechannelmax?language=objc +func (c_ CNNBinaryKernel) SecondarySourceFeatureChannelMaxCount() uint { + rv := objc.Call[uint](c_, objc.Sel("secondarySourceFeatureChannelMaxCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2951918-secondarysourcefeaturechannelmax?language=objc +func (c_ CNNBinaryKernel) SetSecondarySourceFeatureChannelMaxCount(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSecondarySourceFeatureChannelMaxCount:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942645-secondarydilationratex?language=objc +func (c_ CNNBinaryKernel) SecondaryDilationRateX() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryDilationRateX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865649-secondarystrideinpixelsx?language=objc +func (c_ CNNBinaryKernel) SecondaryStrideInPixelsX() uint { + rv := objc.Call[uint](c_, objc.Sel("secondaryStrideInPixelsX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865649-secondarystrideinpixelsx?language=objc +func (c_ CNNBinaryKernel) SetSecondaryStrideInPixelsX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryStrideInPixelsX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2951919-primarysourcefeaturechannelmaxco?language=objc +func (c_ CNNBinaryKernel) PrimarySourceFeatureChannelMaxCount() uint { + rv := objc.Call[uint](c_, objc.Sel("primarySourceFeatureChannelMaxCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2951919-primarysourcefeaturechannelmaxco?language=objc +func (c_ CNNBinaryKernel) SetPrimarySourceFeatureChannelMaxCount(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPrimarySourceFeatureChannelMaxCount:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865656-primarystrideinpixelsy?language=objc +func (c_ CNNBinaryKernel) PrimaryStrideInPixelsY() uint { + rv := objc.Call[uint](c_, objc.Sel("primaryStrideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865656-primarystrideinpixelsy?language=objc +func (c_ CNNBinaryKernel) SetPrimaryStrideInPixelsY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryStrideInPixelsY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865645-primaryoffset?language=objc +func (c_ CNNBinaryKernel) PrimaryOffset() Offset { + rv := objc.Call[Offset](c_, objc.Sel("primaryOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865645-primaryoffset?language=objc +func (c_ CNNBinaryKernel) SetPrimaryOffset(value Offset) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865658-primarystrideinpixelsx?language=objc +func (c_ CNNBinaryKernel) PrimaryStrideInPixelsX() uint { + rv := objc.Call[uint](c_, objc.Sel("primaryStrideInPixelsX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865658-primarystrideinpixelsx?language=objc +func (c_ CNNBinaryKernel) SetPrimaryStrideInPixelsX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPrimaryStrideInPixelsX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865652-isbackwards?language=objc +func (c_ CNNBinaryKernel) IsBackwards() bool { + rv := objc.Call[bool](c_, objc.Sel("isBackwards")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865628-secondaryoffset?language=objc +func (c_ CNNBinaryKernel) SecondaryOffset() Offset { + rv := objc.Call[Offset](c_, objc.Sel("secondaryOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865628-secondaryoffset?language=objc +func (c_ CNNBinaryKernel) SetSecondaryOffset(value Offset) { + objc.Call[objc.Void](c_, objc.Sel("setSecondaryOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865641-cliprect?language=objc +func (c_ CNNBinaryKernel) ClipRect() metal.Region { + rv := objc.Call[metal.Region](c_, objc.Sel("clipRect")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865641-cliprect?language=objc +func (c_ CNNBinaryKernel) SetClipRect(value metal.Region) { + objc.Call[objc.Void](c_, objc.Sel("setClipRect:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865651-destinationimageallocator?language=objc +func (c_ CNNBinaryKernel) DestinationImageAllocator() ImageAllocatorWrapper { + rv := objc.Call[ImageAllocatorWrapper](c_, objc.Sel("destinationImageAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865651-destinationimageallocator?language=objc +func (c_ CNNBinaryKernel) SetDestinationImageAllocator(value PImageAllocator) { + po0 := objc.WrapAsProtocol("MPSImageAllocator", value) + objc.Call[objc.Void](c_, objc.Sel("setDestinationImageAllocator:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865651-destinationimageallocator?language=objc +func (c_ CNNBinaryKernel) SetDestinationImageAllocatorObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setDestinationImageAllocator:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2942666-primarykernelwidth?language=objc +func (c_ CNNBinaryKernel) PrimaryKernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("primaryKernelWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865643-destinationfeaturechanneloffset?language=objc +func (c_ CNNBinaryKernel) DestinationFeatureChannelOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("destinationFeatureChannelOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865643-destinationfeaturechanneloffset?language=objc +func (c_ CNNBinaryKernel) SetDestinationFeatureChannelOffset(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setDestinationFeatureChannelOffset:"), value) +} diff --git a/macos/mps/cnn_convolution.gen.go b/macos/mps/cnn_convolution.gen.go new file mode 100644 index 00000000..75226532 --- /dev/null +++ b/macos/mps/cnn_convolution.gen.go @@ -0,0 +1,239 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolution] class. +var CNNConvolutionClass = _CNNConvolutionClass{objc.GetClass("MPSCNNConvolution")} + +type _CNNConvolutionClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolution] class. +type ICNNConvolution interface { + ICNNKernel + ReloadWeightsAndBiasesFromDataSource() + ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) + ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) + ExportWeightsAndBiasesWithCommandBufferResultStateCanBeTemporary(commandBuffer metal.PCommandBuffer, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState + ExportWeightsAndBiasesWithCommandBufferObjectResultStateCanBeTemporary(commandBufferObject objc.IObject, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState + DataSource() CNNConvolutionDataSourceWrapper + ChannelMultiplier() uint + OutputFeatureChannels() uint + InputFeatureChannels() uint + Neuron() CNNNeuron + Groups() uint + SubPixelScaleFactor() uint + AccumulatorPrecisionOption() NNConvolutionAccumulatorPrecisionOption + SetAccumulatorPrecisionOption(value NNConvolutionAccumulatorPrecisionOption) + FusedNeuronDescriptor() NNNeuronDescriptor +} + +// A convolution kernel that convolves the input image with a set of filters, with each producing one feature map in the output image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution?language=objc +type CNNConvolution struct { + CNNKernel +} + +func CNNConvolutionFrom(ptr unsafe.Pointer) CNNConvolution { + return CNNConvolution{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNConvolution) InitWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolution { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolution](c_, objc.Sel("initWithDevice:weights:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2867092-initwithdevice?language=objc +func NewCNNConvolutionWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolution { + instance := CNNConvolutionClass.Alloc().InitWithDeviceWeights(device, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionClass) Alloc() CNNConvolution { + rv := objc.Call[CNNConvolution](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolution_Alloc() CNNConvolution { + return CNNConvolutionClass.Alloc() +} + +func (cc _CNNConvolutionClass) New() CNNConvolution { + rv := objc.Call[CNNConvolution](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolution() CNNConvolution { + return CNNConvolutionClass.New() +} + +func (c_ CNNConvolution) Init() CNNConvolution { + rv := objc.Call[CNNConvolution](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolution) InitWithDevice(device metal.PDevice) CNNConvolution { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolution](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNConvolutionWithDevice(device metal.PDevice) CNNConvolution { + instance := CNNConvolutionClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolution) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolution { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolution](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNConvolution_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolution { + instance := CNNConvolutionClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2966657-reloadweightsandbiasesfromdataso?language=objc +func (c_ CNNConvolution) ReloadWeightsAndBiasesFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2953962-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolution) ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), po0, objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2953962-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolution) ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), objc.Ptr(commandBufferObject), objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2953001-exportweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolution) ExportWeightsAndBiasesWithCommandBufferResultStateCanBeTemporary(commandBuffer metal.PCommandBuffer, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("exportWeightsAndBiasesWithCommandBuffer:resultStateCanBeTemporary:"), po0, resultStateCanBeTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2953001-exportweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolution) ExportWeightsAndBiasesWithCommandBufferObjectResultStateCanBeTemporary(commandBufferObject objc.IObject, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState { + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("exportWeightsAndBiasesWithCommandBuffer:resultStateCanBeTemporary:"), objc.Ptr(commandBufferObject), resultStateCanBeTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2953961-datasource?language=objc +func (c_ CNNConvolution) DataSource() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](c_, objc.Sel("dataSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2919729-channelmultiplier?language=objc +func (c_ CNNConvolution) ChannelMultiplier() uint { + rv := objc.Call[uint](c_, objc.Sel("channelMultiplier")) + return rv +} + +// The number of feature channels per pixel in the output image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/1845271-outputfeaturechannels?language=objc +func (c_ CNNConvolution) OutputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("outputFeatureChannels")) + return rv +} + +// The number of feature channels per pixel in the input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/1845268-inputfeaturechannels?language=objc +func (c_ CNNConvolution) InputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("inputFeatureChannels")) + return rv +} + +// The neuron filter to be applied as part of the convolution operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/1845274-neuron?language=objc +func (c_ CNNConvolution) Neuron() CNNNeuron { + rv := objc.Call[CNNNeuron](c_, objc.Sel("neuron")) + return rv +} + +// The number of groups that the input and output channels are divided into. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/1845269-groups?language=objc +func (c_ CNNConvolution) Groups() uint { + rv := objc.Call[uint](c_, objc.Sel("groups")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2873341-subpixelscalefactor?language=objc +func (c_ CNNConvolution) SubPixelScaleFactor() uint { + rv := objc.Call[uint](c_, objc.Sel("subPixelScaleFactor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2942410-accumulatorprecisionoption?language=objc +func (c_ CNNConvolution) AccumulatorPrecisionOption() NNConvolutionAccumulatorPrecisionOption { + rv := objc.Call[NNConvolutionAccumulatorPrecisionOption](c_, objc.Sel("accumulatorPrecisionOption")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/2942410-accumulatorprecisionoption?language=objc +func (c_ CNNConvolution) SetAccumulatorPrecisionOption(value NNConvolutionAccumulatorPrecisionOption) { + objc.Call[objc.Void](c_, objc.Sel("setAccumulatorPrecisionOption:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolution/3013776-fusedneurondescriptor?language=objc +func (c_ CNNConvolution) FusedNeuronDescriptor() NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](c_, objc.Sel("fusedNeuronDescriptor")) + return rv +} diff --git a/macos/mps/cnn_convolution_data_source.gen.go b/macos/mps/cnn_convolution_data_source.gen.go new file mode 100644 index 00000000..763ce869 --- /dev/null +++ b/macos/mps/cnn_convolution_data_source.gen.go @@ -0,0 +1,263 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/kernel" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The protocol that provides convolution filter weights and bias terms. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource?language=objc +type PCNNConvolutionDataSource interface { + // optional + RangesForUInt8Kernel() *kernel.Vector_float2 + HasRangesForUInt8Kernel() bool + + // optional + UpdateWithGradientStateSourceState(gradientState CNNConvolutionGradientState, sourceState CNNConvolutionWeightsAndBiasesState) bool + HasUpdateWithGradientStateSourceState() bool + + // optional + WeightsLayout() CNNConvolutionWeightsLayout + HasWeightsLayout() bool + + // optional + Weights() unsafe.Pointer + HasWeights() bool + + // optional + WeightsQuantizationType() CNNWeightsQuantizationType + HasWeightsQuantizationType() bool + + // optional + LookupTableForUInt8Kernel() *float64 + HasLookupTableForUInt8Kernel() bool + + // optional + BiasTerms() *float64 + HasBiasTerms() bool + + // optional + Purge() + HasPurge() bool + + // optional + DataType() DataType + HasDataType() bool + + // optional + Descriptor() ICNNConvolutionDescriptor + HasDescriptor() bool + + // optional + CopyWithZoneDevice(zone unsafe.Pointer, device metal.DeviceWrapper) objc.IObject + HasCopyWithZoneDevice() bool + + // optional + Load() bool + HasLoad() bool + + // optional + Label() string + HasLabel() bool + + // optional + UpdateWithCommandBufferGradientStateSourceState(commandBuffer metal.CommandBufferWrapper, gradientState CNNConvolutionGradientState, sourceState CNNConvolutionWeightsAndBiasesState) ICNNConvolutionWeightsAndBiasesState + HasUpdateWithCommandBufferGradientStateSourceState() bool + + // optional + KernelWeightsDataType() DataType + HasKernelWeightsDataType() bool +} + +// A concrete type wrapper for the [PCNNConvolutionDataSource] protocol. +type CNNConvolutionDataSourceWrapper struct { + objc.Object +} + +func (c_ CNNConvolutionDataSourceWrapper) HasRangesForUInt8Kernel() bool { + return c_.RespondsToSelector(objc.Sel("rangesForUInt8Kernel")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867145-rangesforuint8kernel?language=objc +func (c_ CNNConvolutionDataSourceWrapper) RangesForUInt8Kernel() *kernel.Vector_float2 { + rv := objc.Call[*kernel.Vector_float2](c_, objc.Sel("rangesForUInt8Kernel")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasUpdateWithGradientStateSourceState() bool { + return c_.RespondsToSelector(objc.Sel("updateWithGradientState:sourceState:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2953009-updatewithgradientstate?language=objc +func (c_ CNNConvolutionDataSourceWrapper) UpdateWithGradientStateSourceState(gradientState ICNNConvolutionGradientState, sourceState ICNNConvolutionWeightsAndBiasesState) bool { + rv := objc.Call[bool](c_, objc.Sel("updateWithGradientState:sourceState:"), objc.Ptr(gradientState), objc.Ptr(sourceState)) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasWeightsLayout() bool { + return c_.RespondsToSelector(objc.Sel("weightsLayout")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/3325840-weightslayout?language=objc +func (c_ CNNConvolutionDataSourceWrapper) WeightsLayout() CNNConvolutionWeightsLayout { + rv := objc.Call[CNNConvolutionWeightsLayout](c_, objc.Sel("weightsLayout")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasWeights() bool { + return c_.RespondsToSelector(objc.Sel("weights")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867187-weights?language=objc +func (c_ CNNConvolutionDataSourceWrapper) Weights() unsafe.Pointer { + rv := objc.Call[unsafe.Pointer](c_, objc.Sel("weights")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasWeightsQuantizationType() bool { + return c_.RespondsToSelector(objc.Sel("weightsQuantizationType")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2976466-weightsquantizationtype?language=objc +func (c_ CNNConvolutionDataSourceWrapper) WeightsQuantizationType() CNNWeightsQuantizationType { + rv := objc.Call[CNNWeightsQuantizationType](c_, objc.Sel("weightsQuantizationType")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasLookupTableForUInt8Kernel() bool { + return c_.RespondsToSelector(objc.Sel("lookupTableForUInt8Kernel")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867186-lookuptableforuint8kernel?language=objc +func (c_ CNNConvolutionDataSourceWrapper) LookupTableForUInt8Kernel() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("lookupTableForUInt8Kernel")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasBiasTerms() bool { + return c_.RespondsToSelector(objc.Sel("biasTerms")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867023-biasterms?language=objc +func (c_ CNNConvolutionDataSourceWrapper) BiasTerms() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("biasTerms")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasPurge() bool { + return c_.RespondsToSelector(objc.Sel("purge")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867134-purge?language=objc +func (c_ CNNConvolutionDataSourceWrapper) Purge() { + objc.Call[objc.Void](c_, objc.Sel("purge")) +} + +func (c_ CNNConvolutionDataSourceWrapper) HasDataType() bool { + return c_.RespondsToSelector(objc.Sel("dataType")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867139-datatype?language=objc +func (c_ CNNConvolutionDataSourceWrapper) DataType() DataType { + rv := objc.Call[DataType](c_, objc.Sel("dataType")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasDescriptor() bool { + return c_.RespondsToSelector(objc.Sel("descriptor")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867050-descriptor?language=objc +func (c_ CNNConvolutionDataSourceWrapper) Descriptor() CNNConvolutionDescriptor { + rv := objc.Call[CNNConvolutionDescriptor](c_, objc.Sel("descriptor")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasCopyWithZoneDevice() bool { + return c_.RespondsToSelector(objc.Sel("copyWithZone:device:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/3013778-copywithzone?language=objc +func (c_ CNNConvolutionDataSourceWrapper) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) objc.Object { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[objc.Object](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasLoad() bool { + return c_.RespondsToSelector(objc.Sel("load")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2867049-load?language=objc +func (c_ CNNConvolutionDataSourceWrapper) Load() bool { + rv := objc.Call[bool](c_, objc.Sel("load")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasLabel() bool { + return c_.RespondsToSelector(objc.Sel("label")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2881197-label?language=objc +func (c_ CNNConvolutionDataSourceWrapper) Label() string { + rv := objc.Call[string](c_, objc.Sel("label")) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasUpdateWithCommandBufferGradientStateSourceState() bool { + return c_.RespondsToSelector(objc.Sel("updateWithCommandBuffer:gradientState:sourceState:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/2953007-updatewithcommandbuffer?language=objc +func (c_ CNNConvolutionDataSourceWrapper) UpdateWithCommandBufferGradientStateSourceState(commandBuffer metal.PCommandBuffer, gradientState ICNNConvolutionGradientState, sourceState ICNNConvolutionWeightsAndBiasesState) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("updateWithCommandBuffer:gradientState:sourceState:"), po0, objc.Ptr(gradientState), objc.Ptr(sourceState)) + return rv +} + +func (c_ CNNConvolutionDataSourceWrapper) HasKernelWeightsDataType() bool { + return c_.RespondsToSelector(objc.Sel("kernelWeightsDataType")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondatasource/3564466-kernelweightsdatatype?language=objc +func (c_ CNNConvolutionDataSourceWrapper) KernelWeightsDataType() DataType { + rv := objc.Call[DataType](c_, objc.Sel("kernelWeightsDataType")) + return rv +} diff --git a/macos/mps/cnn_convolution_descriptor.gen.go b/macos/mps/cnn_convolution_descriptor.gen.go new file mode 100644 index 00000000..92a5eff6 --- /dev/null +++ b/macos/mps/cnn_convolution_descriptor.gen.go @@ -0,0 +1,289 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionDescriptor] class. +var CNNConvolutionDescriptorClass = _CNNConvolutionDescriptorClass{objc.GetClass("MPSCNNConvolutionDescriptor")} + +type _CNNConvolutionDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionDescriptor] class. +type ICNNConvolutionDescriptor interface { + objc.IObject + EncodeWithCoder(aCoder foundation.ICoder) + SetBatchNormalizationParametersForInferenceWithMeanVarianceGammaBetaEpsilon(mean *float64, variance *float64, gamma *float64, beta *float64, epsilon float64) + OutputFeatureChannels() uint + SetOutputFeatureChannels(value uint) + InputFeatureChannels() uint + SetInputFeatureChannels(value uint) + Neuron() CNNNeuron + SetNeuron(value ICNNNeuron) + StrideInPixelsY() uint + SetStrideInPixelsY(value uint) + StrideInPixelsX() uint + SetStrideInPixelsX(value uint) + Groups() uint + SetGroups(value uint) + DilationRateY() uint + SetDilationRateY(value uint) + KernelHeight() uint + SetKernelHeight(value uint) + KernelWidth() uint + SetKernelWidth(value uint) + FusedNeuronDescriptor() NNNeuronDescriptor + SetFusedNeuronDescriptor(value INNNeuronDescriptor) + DilationRateX() uint + SetDilationRateX(value uint) +} + +// A description of the attributes of a convolution kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor?language=objc +type CNNConvolutionDescriptor struct { + objc.Object +} + +func CNNConvolutionDescriptorFrom(ptr unsafe.Pointer) CNNConvolutionDescriptor { + return CNNConvolutionDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CNNConvolutionDescriptorClass) CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth uint, kernelHeight uint, inputFeatureChannels uint, outputFeatureChannels uint) CNNConvolutionDescriptor { + rv := objc.Call[CNNConvolutionDescriptor](cc, objc.Sel("cnnConvolutionDescriptorWithKernelWidth:kernelHeight:inputFeatureChannels:outputFeatureChannels:"), kernelWidth, kernelHeight, inputFeatureChannels, outputFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648813-cnnconvolutiondescriptorwithkern?language=objc +func CNNConvolutionDescriptor_CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth uint, kernelHeight uint, inputFeatureChannels uint, outputFeatureChannels uint) CNNConvolutionDescriptor { + return CNNConvolutionDescriptorClass.CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth, kernelHeight, inputFeatureChannels, outputFeatureChannels) +} + +func (cc _CNNConvolutionDescriptorClass) Alloc() CNNConvolutionDescriptor { + rv := objc.Call[CNNConvolutionDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionDescriptor_Alloc() CNNConvolutionDescriptor { + return CNNConvolutionDescriptorClass.Alloc() +} + +func (cc _CNNConvolutionDescriptorClass) New() CNNConvolutionDescriptor { + rv := objc.Call[CNNConvolutionDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionDescriptor() CNNConvolutionDescriptor { + return CNNConvolutionDescriptorClass.New() +} + +func (c_ CNNConvolutionDescriptor) Init() CNNConvolutionDescriptor { + rv := objc.Call[CNNConvolutionDescriptor](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2866972-encodewithcoder?language=objc +func (c_ CNNConvolutionDescriptor) EncodeWithCoder(aCoder foundation.ICoder) { + objc.Call[objc.Void](c_, objc.Sel("encodeWithCoder:"), objc.Ptr(aCoder)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2867057-setbatchnormalizationparametersf?language=objc +func (c_ CNNConvolutionDescriptor) SetBatchNormalizationParametersForInferenceWithMeanVarianceGammaBetaEpsilon(mean *float64, variance *float64, gamma *float64, beta *float64, epsilon float64) { + objc.Call[objc.Void](c_, objc.Sel("setBatchNormalizationParametersForInferenceWithMean:variance:gamma:beta:epsilon:"), mean, variance, gamma, beta, epsilon) +} + +// The number of feature channels per pixel in the output image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648852-outputfeaturechannels?language=objc +func (c_ CNNConvolutionDescriptor) OutputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("outputFeatureChannels")) + return rv +} + +// The number of feature channels per pixel in the output image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648852-outputfeaturechannels?language=objc +func (c_ CNNConvolutionDescriptor) SetOutputFeatureChannels(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setOutputFeatureChannels:"), value) +} + +// The number of feature channels per pixel in the input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648934-inputfeaturechannels?language=objc +func (c_ CNNConvolutionDescriptor) InputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("inputFeatureChannels")) + return rv +} + +// The number of feature channels per pixel in the input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648934-inputfeaturechannels?language=objc +func (c_ CNNConvolutionDescriptor) SetInputFeatureChannels(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setInputFeatureChannels:"), value) +} + +// The neuron filter to be applied as part of the convolution operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1829442-neuron?language=objc +func (c_ CNNConvolutionDescriptor) Neuron() CNNNeuron { + rv := objc.Call[CNNNeuron](c_, objc.Sel("neuron")) + return rv +} + +// The neuron filter to be applied as part of the convolution operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1829442-neuron?language=objc +func (c_ CNNConvolutionDescriptor) SetNeuron(value ICNNNeuron) { + objc.Call[objc.Void](c_, objc.Sel("setNeuron:"), objc.Ptr(value)) +} + +// The output stride (downsampling factor) in the y dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648847-strideinpixelsy?language=objc +func (c_ CNNConvolutionDescriptor) StrideInPixelsY() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsY")) + return rv +} + +// The output stride (downsampling factor) in the y dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648847-strideinpixelsy?language=objc +func (c_ CNNConvolutionDescriptor) SetStrideInPixelsY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setStrideInPixelsY:"), value) +} + +// The output stride (downsampling factor) in the x dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648908-strideinpixelsx?language=objc +func (c_ CNNConvolutionDescriptor) StrideInPixelsX() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsX")) + return rv +} + +// The output stride (downsampling factor) in the x dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648908-strideinpixelsx?language=objc +func (c_ CNNConvolutionDescriptor) SetStrideInPixelsX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setStrideInPixelsX:"), value) +} + +// The number of groups that the input and output channels are divided into. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648849-groups?language=objc +func (c_ CNNConvolutionDescriptor) Groups() uint { + rv := objc.Call[uint](c_, objc.Sel("groups")) + return rv +} + +// The number of groups that the input and output channels are divided into. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648849-groups?language=objc +func (c_ CNNConvolutionDescriptor) SetGroups(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setGroups:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2881196-dilationratey?language=objc +func (c_ CNNConvolutionDescriptor) DilationRateY() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2881196-dilationratey?language=objc +func (c_ CNNConvolutionDescriptor) SetDilationRateY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setDilationRateY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2867154-supportssecurecoding?language=objc +func (cc _CNNConvolutionDescriptorClass) SupportsSecureCoding() bool { + rv := objc.Call[bool](cc, objc.Sel("supportsSecureCoding")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2867154-supportssecurecoding?language=objc +func CNNConvolutionDescriptor_SupportsSecureCoding() bool { + return CNNConvolutionDescriptorClass.SupportsSecureCoding() +} + +// The height of the kernel window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648904-kernelheight?language=objc +func (c_ CNNConvolutionDescriptor) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// The height of the kernel window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648904-kernelheight?language=objc +func (c_ CNNConvolutionDescriptor) SetKernelHeight(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelHeight:"), value) +} + +// The width of the kernel window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648959-kernelwidth?language=objc +func (c_ CNNConvolutionDescriptor) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} + +// The width of the kernel window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648959-kernelwidth?language=objc +func (c_ CNNConvolutionDescriptor) SetKernelWidth(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelWidth:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2953957-fusedneurondescriptor?language=objc +func (c_ CNNConvolutionDescriptor) FusedNeuronDescriptor() NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](c_, objc.Sel("fusedNeuronDescriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2953957-fusedneurondescriptor?language=objc +func (c_ CNNConvolutionDescriptor) SetFusedNeuronDescriptor(value INNNeuronDescriptor) { + objc.Call[objc.Void](c_, objc.Sel("setFusedNeuronDescriptor:"), objc.Ptr(value)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2881195-dilationratex?language=objc +func (c_ CNNConvolutionDescriptor) DilationRateX() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/2881195-dilationratex?language=objc +func (c_ CNNConvolutionDescriptor) SetDilationRateX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setDilationRateX:"), value) +} diff --git a/macos/mps/cnn_convolution_gradient.gen.go b/macos/mps/cnn_convolution_gradient.gen.go new file mode 100644 index 00000000..7cdf7c75 --- /dev/null +++ b/macos/mps/cnn_convolution_gradient.gen.go @@ -0,0 +1,193 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionGradient] class. +var CNNConvolutionGradientClass = _CNNConvolutionGradientClass{objc.GetClass("MPSCNNConvolutionGradient")} + +type _CNNConvolutionGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionGradient] class. +type ICNNConvolutionGradient interface { + ICNNGradientKernel + ReloadWeightsAndBiasesFromDataSource() + ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) + ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) + DataSource() CNNConvolutionDataSourceWrapper + SourceImageFeatureChannels() uint + ChannelMultiplier() uint + GradientOption() CNNConvolutionGradientOption + SetGradientOption(value CNNConvolutionGradientOption) + SourceGradientFeatureChannels() uint + Groups() uint +} + +// A gradient convolution kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient?language=objc +type CNNConvolutionGradient struct { + CNNGradientKernel +} + +func CNNConvolutionGradientFrom(ptr unsafe.Pointer) CNNConvolutionGradient { + return CNNConvolutionGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNConvolutionGradient) InitWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolutionGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionGradient](c_, objc.Sel("initWithDevice:weights:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2942414-initwithdevice?language=objc +func NewCNNConvolutionGradientWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolutionGradient { + instance := CNNConvolutionGradientClass.Alloc().InitWithDeviceWeights(device, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionGradientClass) Alloc() CNNConvolutionGradient { + rv := objc.Call[CNNConvolutionGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionGradient_Alloc() CNNConvolutionGradient { + return CNNConvolutionGradientClass.Alloc() +} + +func (cc _CNNConvolutionGradientClass) New() CNNConvolutionGradient { + rv := objc.Call[CNNConvolutionGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionGradient() CNNConvolutionGradient { + return CNNConvolutionGradientClass.New() +} + +func (c_ CNNConvolutionGradient) Init() CNNConvolutionGradient { + rv := objc.Call[CNNConvolutionGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolutionGradient) InitWithDevice(device metal.PDevice) CNNConvolutionGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNConvolutionGradientWithDevice(device metal.PDevice) CNNConvolutionGradient { + instance := CNNConvolutionGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolutionGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNConvolutionGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolutionGradient { + instance := CNNConvolutionGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2966659-reloadweightsandbiasesfromdataso?language=objc +func (c_ CNNConvolutionGradient) ReloadWeightsAndBiasesFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2953960-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionGradient) ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), po0, objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2953960-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionGradient) ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), objc.Ptr(commandBufferObject), objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2953959-datasource?language=objc +func (c_ CNNConvolutionGradient) DataSource() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](c_, objc.Sel("dataSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2947882-sourceimagefeaturechannels?language=objc +func (c_ CNNConvolutionGradient) SourceImageFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("sourceImageFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2966658-channelmultiplier?language=objc +func (c_ CNNConvolutionGradient) ChannelMultiplier() uint { + rv := objc.Call[uint](c_, objc.Sel("channelMultiplier")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2942432-gradientoption?language=objc +func (c_ CNNConvolutionGradient) GradientOption() CNNConvolutionGradientOption { + rv := objc.Call[CNNConvolutionGradientOption](c_, objc.Sel("gradientOption")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2942432-gradientoption?language=objc +func (c_ CNNConvolutionGradient) SetGradientOption(value CNNConvolutionGradientOption) { + objc.Call[objc.Void](c_, objc.Sel("setGradientOption:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2947880-sourcegradientfeaturechannels?language=objc +func (c_ CNNConvolutionGradient) SourceGradientFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("sourceGradientFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradient/2942430-groups?language=objc +func (c_ CNNConvolutionGradient) Groups() uint { + rv := objc.Call[uint](c_, objc.Sel("groups")) + return rv +} diff --git a/macos/mps/cnn_convolution_gradient_node.gen.go b/macos/mps/cnn_convolution_gradient_node.gen.go new file mode 100644 index 00000000..deef517c --- /dev/null +++ b/macos/mps/cnn_convolution_gradient_node.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionGradientNode] class. +var CNNConvolutionGradientNodeClass = _CNNConvolutionGradientNodeClass{objc.GetClass("MPSCNNConvolutionGradientNode")} + +type _CNNConvolutionGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionGradientNode] class. +type ICNNConvolutionGradientNode interface { + INNGradientFilterNode +} + +// A representation of a gradient convolution kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientnode?language=objc +type CNNConvolutionGradientNode struct { + NNGradientFilterNode +} + +func CNNConvolutionGradientNodeFrom(ptr unsafe.Pointer) CNNConvolutionGradientNode { + return CNNConvolutionGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNConvolutionGradientNode) InitWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:convolutionGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientnode/2947999-initwithsourcegradient?language=objc +func NewCNNConvolutionGradientNodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionGradientNode { + instance := CNNConvolutionGradientNodeClass.Alloc().InitWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionGradientNodeClass) NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:convolutionGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientnode/2947984-nodewithsourcegradient?language=objc +func CNNConvolutionGradientNode_NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionGradientNode { + return CNNConvolutionGradientNodeClass.NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) +} + +func (cc _CNNConvolutionGradientNodeClass) Alloc() CNNConvolutionGradientNode { + rv := objc.Call[CNNConvolutionGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionGradientNode_Alloc() CNNConvolutionGradientNode { + return CNNConvolutionGradientNodeClass.Alloc() +} + +func (cc _CNNConvolutionGradientNodeClass) New() CNNConvolutionGradientNode { + rv := objc.Call[CNNConvolutionGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionGradientNode() CNNConvolutionGradientNode { + return CNNConvolutionGradientNodeClass.New() +} + +func (c_ CNNConvolutionGradientNode) Init() CNNConvolutionGradientNode { + rv := objc.Call[CNNConvolutionGradientNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_convolution_gradient_state.gen.go b/macos/mps/cnn_convolution_gradient_state.gen.go new file mode 100644 index 00000000..ebe82105 --- /dev/null +++ b/macos/mps/cnn_convolution_gradient_state.gen.go @@ -0,0 +1,152 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionGradientState] class. +var CNNConvolutionGradientStateClass = _CNNConvolutionGradientStateClass{objc.GetClass("MPSCNNConvolutionGradientState")} + +type _CNNConvolutionGradientStateClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionGradientState] class. +type ICNNConvolutionGradientState interface { + INNGradientState + GradientForWeightsLayout() CNNConvolutionWeightsLayout + Convolution() CNNConvolution + GradientForWeights() metal.BufferWrapper + GradientForBiases() metal.BufferWrapper +} + +// An object that exposes a gradient convolution kernel's gradient with respect to weights and biases. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientstate?language=objc +type CNNConvolutionGradientState struct { + NNGradientState +} + +func CNNConvolutionGradientStateFrom(ptr unsafe.Pointer) CNNConvolutionGradientState { + return CNNConvolutionGradientState{ + NNGradientState: NNGradientStateFrom(ptr), + } +} + +func (cc _CNNConvolutionGradientStateClass) Alloc() CNNConvolutionGradientState { + rv := objc.Call[CNNConvolutionGradientState](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionGradientState_Alloc() CNNConvolutionGradientState { + return CNNConvolutionGradientStateClass.Alloc() +} + +func (cc _CNNConvolutionGradientStateClass) New() CNNConvolutionGradientState { + rv := objc.Call[CNNConvolutionGradientState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionGradientState() CNNConvolutionGradientState { + return CNNConvolutionGradientStateClass.New() +} + +func (c_ CNNConvolutionGradientState) Init() CNNConvolutionGradientState { + rv := objc.Call[CNNConvolutionGradientState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolutionGradientState) InitWithResources(resources []metal.PResource) CNNConvolutionGradientState { + rv := objc.Call[CNNConvolutionGradientState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNConvolutionGradientStateWithResources(resources []metal.PResource) CNNConvolutionGradientState { + instance := CNNConvolutionGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNConvolutionGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionGradientState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNConvolutionGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNConvolutionGradientState { + instance := CNNConvolutionGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionGradientState) InitWithResource(resource metal.PResource) CNNConvolutionGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNConvolutionGradientState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNConvolutionGradientStateWithResource(resource metal.PResource) CNNConvolutionGradientState { + instance := CNNConvolutionGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNConvolutionGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNConvolutionGradientState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNConvolutionGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNConvolutionGradientState { + return CNNConvolutionGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientstate/3325841-gradientforweightslayout?language=objc +func (c_ CNNConvolutionGradientState) GradientForWeightsLayout() CNNConvolutionWeightsLayout { + rv := objc.Call[CNNConvolutionWeightsLayout](c_, objc.Sel("gradientForWeightsLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientstate/2953958-convolution?language=objc +func (c_ CNNConvolutionGradientState) Convolution() CNNConvolution { + rv := objc.Call[CNNConvolution](c_, objc.Sel("convolution")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientstate/2947889-gradientforweights?language=objc +func (c_ CNNConvolutionGradientState) GradientForWeights() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientstate/2947887-gradientforbiases?language=objc +func (c_ CNNConvolutionGradientState) GradientForBiases() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForBiases")) + return rv +} diff --git a/macos/mps/cnn_convolution_gradient_state_node.gen.go b/macos/mps/cnn_convolution_gradient_state_node.gen.go new file mode 100644 index 00000000..5f8e76b7 --- /dev/null +++ b/macos/mps/cnn_convolution_gradient_state_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionGradientStateNode] class. +var CNNConvolutionGradientStateNodeClass = _CNNConvolutionGradientStateNodeClass{objc.GetClass("MPSCNNConvolutionGradientStateNode")} + +type _CNNConvolutionGradientStateNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionGradientStateNode] class. +type ICNNConvolutionGradientStateNode interface { + INNGradientStateNode +} + +// A representation of a gradient convolution state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientstatenode?language=objc +type CNNConvolutionGradientStateNode struct { + NNGradientStateNode +} + +func CNNConvolutionGradientStateNodeFrom(ptr unsafe.Pointer) CNNConvolutionGradientStateNode { + return CNNConvolutionGradientStateNode{ + NNGradientStateNode: NNGradientStateNodeFrom(ptr), + } +} + +func (cc _CNNConvolutionGradientStateNodeClass) Alloc() CNNConvolutionGradientStateNode { + rv := objc.Call[CNNConvolutionGradientStateNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionGradientStateNode_Alloc() CNNConvolutionGradientStateNode { + return CNNConvolutionGradientStateNodeClass.Alloc() +} + +func (cc _CNNConvolutionGradientStateNodeClass) New() CNNConvolutionGradientStateNode { + rv := objc.Call[CNNConvolutionGradientStateNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionGradientStateNode() CNNConvolutionGradientStateNode { + return CNNConvolutionGradientStateNodeClass.New() +} + +func (c_ CNNConvolutionGradientStateNode) Init() CNNConvolutionGradientStateNode { + rv := objc.Call[CNNConvolutionGradientStateNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_convolution_node.gen.go b/macos/mps/cnn_convolution_node.gen.go new file mode 100644 index 00000000..d8874908 --- /dev/null +++ b/macos/mps/cnn_convolution_node.gen.go @@ -0,0 +1,129 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionNode] class. +var CNNConvolutionNodeClass = _CNNConvolutionNodeClass{objc.GetClass("MPSCNNConvolutionNode")} + +type _CNNConvolutionNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionNode] class. +type ICNNConvolutionNode interface { + INNFilterNode + ConvolutionGradientState() CNNConvolutionGradientStateNode + TrainingStyle() NNTrainingStyle + SetTrainingStyle(value NNTrainingStyle) + AccumulatorPrecision() NNConvolutionAccumulatorPrecisionOption + SetAccumulatorPrecision(value NNConvolutionAccumulatorPrecisionOption) +} + +// A representation of a convolution kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode?language=objc +type CNNConvolutionNode struct { + NNFilterNode +} + +func CNNConvolutionNodeFrom(ptr unsafe.Pointer) CNNConvolutionNode { + return CNNConvolutionNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNConvolutionNodeClass) NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionNode](cc, objc.Sel("nodeWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866436-nodewithsource?language=objc +func CNNConvolutionNode_NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionNode { + return CNNConvolutionNodeClass.NodeWithSourceWeights(sourceNode, weights) +} + +func (c_ CNNConvolutionNode) InitWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionNode](c_, objc.Sel("initWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866470-initwithsource?language=objc +func NewCNNConvolutionNodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionNode { + instance := CNNConvolutionNodeClass.Alloc().InitWithSourceWeights(sourceNode, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionNodeClass) Alloc() CNNConvolutionNode { + rv := objc.Call[CNNConvolutionNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionNode_Alloc() CNNConvolutionNode { + return CNNConvolutionNodeClass.Alloc() +} + +func (cc _CNNConvolutionNodeClass) New() CNNConvolutionNode { + rv := objc.Call[CNNConvolutionNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionNode() CNNConvolutionNode { + return CNNConvolutionNodeClass.New() +} + +func (c_ CNNConvolutionNode) Init() CNNConvolutionNode { + rv := objc.Call[CNNConvolutionNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2942634-convolutiongradientstate?language=objc +func (c_ CNNConvolutionNode) ConvolutionGradientState() CNNConvolutionGradientStateNode { + rv := objc.Call[CNNConvolutionGradientStateNode](c_, objc.Sel("convolutionGradientState")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/3197822-trainingstyle?language=objc +func (c_ CNNConvolutionNode) TrainingStyle() NNTrainingStyle { + rv := objc.Call[NNTrainingStyle](c_, objc.Sel("trainingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/3197822-trainingstyle?language=objc +func (c_ CNNConvolutionNode) SetTrainingStyle(value NNTrainingStyle) { + objc.Call[objc.Void](c_, objc.Sel("setTrainingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2980757-accumulatorprecision?language=objc +func (c_ CNNConvolutionNode) AccumulatorPrecision() NNConvolutionAccumulatorPrecisionOption { + rv := objc.Call[NNConvolutionAccumulatorPrecisionOption](c_, objc.Sel("accumulatorPrecision")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2980757-accumulatorprecision?language=objc +func (c_ CNNConvolutionNode) SetAccumulatorPrecision(value NNConvolutionAccumulatorPrecisionOption) { + objc.Call[objc.Void](c_, objc.Sel("setAccumulatorPrecision:"), value) +} diff --git a/macos/mps/cnn_convolution_transpose.gen.go b/macos/mps/cnn_convolution_transpose.gen.go new file mode 100644 index 00000000..7bfaa11d --- /dev/null +++ b/macos/mps/cnn_convolution_transpose.gen.go @@ -0,0 +1,276 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionTranspose] class. +var CNNConvolutionTransposeClass = _CNNConvolutionTransposeClass{objc.GetClass("MPSCNNConvolutionTranspose")} + +type _CNNConvolutionTransposeClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionTranspose] class. +type ICNNConvolutionTranspose interface { + ICNNKernel + ReloadWeightsAndBiasesFromDataSource() + EncodeBatchToCommandBufferSourceImagesConvolutionGradientStates(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, convolutionGradientState *foundation.Array) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImagesConvolutionGradientStates(commandBufferObject objc.IObject, sourceImage *foundation.Array, convolutionGradientState *foundation.Array) *foundation.Array + ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) + ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) + ExportWeightsAndBiasesWithCommandBufferResultStateCanBeTemporary(commandBuffer metal.PCommandBuffer, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState + ExportWeightsAndBiasesWithCommandBufferObjectResultStateCanBeTemporary(commandBufferObject objc.IObject, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState + EncodeToCommandBufferSourceImageConvolutionGradientState(commandBuffer metal.PCommandBuffer, sourceImage IImage, convolutionGradientState ICNNConvolutionGradientState) Image + EncodeToCommandBufferObjectSourceImageConvolutionGradientState(commandBufferObject objc.IObject, sourceImage IImage, convolutionGradientState ICNNConvolutionGradientState) Image + DataSource() CNNConvolutionDataSourceWrapper + OutputFeatureChannels() uint + InputFeatureChannels() uint + KernelOffsetX() int + SetKernelOffsetX(value int) + Groups() uint + KernelOffsetY() int + SetKernelOffsetY(value int) + AccumulatorPrecisionOption() NNConvolutionAccumulatorPrecisionOption + SetAccumulatorPrecisionOption(value NNConvolutionAccumulatorPrecisionOption) +} + +// A transposed convolution kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose?language=objc +type CNNConvolutionTranspose struct { + CNNKernel +} + +func CNNConvolutionTransposeFrom(ptr unsafe.Pointer) CNNConvolutionTranspose { + return CNNConvolutionTranspose{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNConvolutionTranspose) InitWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolutionTranspose { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTranspose](c_, objc.Sel("initWithDevice:weights:"), po0, po1) + return rv +} + +// Initializes a transposed convolution kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867157-initwithdevice?language=objc +func NewCNNConvolutionTransposeWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolutionTranspose { + instance := CNNConvolutionTransposeClass.Alloc().InitWithDeviceWeights(device, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionTransposeClass) Alloc() CNNConvolutionTranspose { + rv := objc.Call[CNNConvolutionTranspose](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionTranspose_Alloc() CNNConvolutionTranspose { + return CNNConvolutionTransposeClass.Alloc() +} + +func (cc _CNNConvolutionTransposeClass) New() CNNConvolutionTranspose { + rv := objc.Call[CNNConvolutionTranspose](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionTranspose() CNNConvolutionTranspose { + return CNNConvolutionTransposeClass.New() +} + +func (c_ CNNConvolutionTranspose) Init() CNNConvolutionTranspose { + rv := objc.Call[CNNConvolutionTranspose](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolutionTranspose) InitWithDevice(device metal.PDevice) CNNConvolutionTranspose { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionTranspose](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNConvolutionTransposeWithDevice(device metal.PDevice) CNNConvolutionTranspose { + instance := CNNConvolutionTransposeClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionTranspose) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolutionTranspose { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionTranspose](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNConvolutionTranspose_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolutionTranspose { + instance := CNNConvolutionTransposeClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/3131773-reloadweightsandbiasesfromdataso?language=objc +func (c_ CNNConvolutionTranspose) ReloadWeightsAndBiasesFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2942406-encodebatchtocommandbuffer?language=objc +func (c_ CNNConvolutionTranspose) EncodeBatchToCommandBufferSourceImagesConvolutionGradientStates(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, convolutionGradientState *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:convolutionGradientStates:"), po0, sourceImage, convolutionGradientState) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2942406-encodebatchtocommandbuffer?language=objc +func (c_ CNNConvolutionTranspose) EncodeBatchToCommandBufferObjectSourceImagesConvolutionGradientStates(commandBufferObject objc.IObject, sourceImage *foundation.Array, convolutionGradientState *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:convolutionGradientStates:"), objc.Ptr(commandBufferObject), sourceImage, convolutionGradientState) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/3131774-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionTranspose) ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), po0, objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/3131774-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionTranspose) ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), objc.Ptr(commandBufferObject), objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/3131772-exportweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionTranspose) ExportWeightsAndBiasesWithCommandBufferResultStateCanBeTemporary(commandBuffer metal.PCommandBuffer, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("exportWeightsAndBiasesWithCommandBuffer:resultStateCanBeTemporary:"), po0, resultStateCanBeTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/3131772-exportweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionTranspose) ExportWeightsAndBiasesWithCommandBufferObjectResultStateCanBeTemporary(commandBufferObject objc.IObject, resultStateCanBeTemporary bool) CNNConvolutionWeightsAndBiasesState { + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("exportWeightsAndBiasesWithCommandBuffer:resultStateCanBeTemporary:"), objc.Ptr(commandBufferObject), resultStateCanBeTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2942409-encodetocommandbuffer?language=objc +func (c_ CNNConvolutionTranspose) EncodeToCommandBufferSourceImageConvolutionGradientState(commandBuffer metal.PCommandBuffer, sourceImage IImage, convolutionGradientState ICNNConvolutionGradientState) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:convolutionGradientState:"), po0, objc.Ptr(sourceImage), objc.Ptr(convolutionGradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2942409-encodetocommandbuffer?language=objc +func (c_ CNNConvolutionTranspose) EncodeToCommandBufferObjectSourceImageConvolutionGradientState(commandBufferObject objc.IObject, sourceImage IImage, convolutionGradientState ICNNConvolutionGradientState) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:convolutionGradientState:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), objc.Ptr(convolutionGradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/3131769-datasource?language=objc +func (c_ CNNConvolutionTranspose) DataSource() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](c_, objc.Sel("dataSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867016-outputfeaturechannels?language=objc +func (c_ CNNConvolutionTranspose) OutputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("outputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867174-inputfeaturechannels?language=objc +func (c_ CNNConvolutionTranspose) InputFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("inputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867176-kerneloffsetx?language=objc +func (c_ CNNConvolutionTranspose) KernelOffsetX() int { + rv := objc.Call[int](c_, objc.Sel("kernelOffsetX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867176-kerneloffsetx?language=objc +func (c_ CNNConvolutionTranspose) SetKernelOffsetX(value int) { + objc.Call[objc.Void](c_, objc.Sel("setKernelOffsetX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867099-groups?language=objc +func (c_ CNNConvolutionTranspose) Groups() uint { + rv := objc.Call[uint](c_, objc.Sel("groups")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867086-kerneloffsety?language=objc +func (c_ CNNConvolutionTranspose) KernelOffsetY() int { + rv := objc.Call[int](c_, objc.Sel("kernelOffsetY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2867086-kerneloffsety?language=objc +func (c_ CNNConvolutionTranspose) SetKernelOffsetY(value int) { + objc.Call[objc.Void](c_, objc.Sel("setKernelOffsetY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2951924-accumulatorprecisionoption?language=objc +func (c_ CNNConvolutionTranspose) AccumulatorPrecisionOption() NNConvolutionAccumulatorPrecisionOption { + rv := objc.Call[NNConvolutionAccumulatorPrecisionOption](c_, objc.Sel("accumulatorPrecisionOption")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontranspose/2951924-accumulatorprecisionoption?language=objc +func (c_ CNNConvolutionTranspose) SetAccumulatorPrecisionOption(value NNConvolutionAccumulatorPrecisionOption) { + objc.Call[objc.Void](c_, objc.Sel("setAccumulatorPrecisionOption:"), value) +} diff --git a/macos/mps/cnn_convolution_transpose_gradient.gen.go b/macos/mps/cnn_convolution_transpose_gradient.gen.go new file mode 100644 index 00000000..63e7dab8 --- /dev/null +++ b/macos/mps/cnn_convolution_transpose_gradient.gen.go @@ -0,0 +1,184 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionTransposeGradient] class. +var CNNConvolutionTransposeGradientClass = _CNNConvolutionTransposeGradientClass{objc.GetClass("MPSCNNConvolutionTransposeGradient")} + +type _CNNConvolutionTransposeGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionTransposeGradient] class. +type ICNNConvolutionTransposeGradient interface { + ICNNGradientKernel + ReloadWeightsAndBiasesFromDataSource() + ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) + ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) + DataSource() CNNConvolutionDataSourceWrapper + SourceImageFeatureChannels() uint + GradientOption() CNNConvolutionGradientOption + SetGradientOption(value CNNConvolutionGradientOption) + SourceGradientFeatureChannels() uint + Groups() uint +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient?language=objc +type CNNConvolutionTransposeGradient struct { + CNNGradientKernel +} + +func CNNConvolutionTransposeGradientFrom(ptr unsafe.Pointer) CNNConvolutionTransposeGradient { + return CNNConvolutionTransposeGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNConvolutionTransposeGradient) InitWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeGradient](c_, objc.Sel("initWithDevice:weights:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131784-initwithdevice?language=objc +func NewCNNConvolutionTransposeGradientWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradient { + instance := CNNConvolutionTransposeGradientClass.Alloc().InitWithDeviceWeights(device, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionTransposeGradientClass) Alloc() CNNConvolutionTransposeGradient { + rv := objc.Call[CNNConvolutionTransposeGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionTransposeGradient_Alloc() CNNConvolutionTransposeGradient { + return CNNConvolutionTransposeGradientClass.Alloc() +} + +func (cc _CNNConvolutionTransposeGradientClass) New() CNNConvolutionTransposeGradient { + rv := objc.Call[CNNConvolutionTransposeGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionTransposeGradient() CNNConvolutionTransposeGradient { + return CNNConvolutionTransposeGradientClass.New() +} + +func (c_ CNNConvolutionTransposeGradient) Init() CNNConvolutionTransposeGradient { + rv := objc.Call[CNNConvolutionTransposeGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolutionTransposeGradient) InitWithDevice(device metal.PDevice) CNNConvolutionTransposeGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionTransposeGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNConvolutionTransposeGradientWithDevice(device metal.PDevice) CNNConvolutionTransposeGradient { + instance := CNNConvolutionTransposeGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionTransposeGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolutionTransposeGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionTransposeGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNConvolutionTransposeGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNConvolutionTransposeGradient { + instance := CNNConvolutionTransposeGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131785-reloadweightsandbiasesfromdataso?language=objc +func (c_ CNNConvolutionTransposeGradient) ReloadWeightsAndBiasesFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131786-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionTransposeGradient) ReloadWeightsAndBiasesWithCommandBufferState(commandBuffer metal.PCommandBuffer, state ICNNConvolutionWeightsAndBiasesState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), po0, objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131786-reloadweightsandbiaseswithcomman?language=objc +func (c_ CNNConvolutionTransposeGradient) ReloadWeightsAndBiasesWithCommandBufferObjectState(commandBufferObject objc.IObject, state ICNNConvolutionWeightsAndBiasesState) { + objc.Call[objc.Void](c_, objc.Sel("reloadWeightsAndBiasesWithCommandBuffer:state:"), objc.Ptr(commandBufferObject), objc.Ptr(state)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131780-datasource?language=objc +func (c_ CNNConvolutionTransposeGradient) DataSource() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](c_, objc.Sel("dataSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131788-sourceimagefeaturechannels?language=objc +func (c_ CNNConvolutionTransposeGradient) SourceImageFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("sourceImageFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131781-gradientoption?language=objc +func (c_ CNNConvolutionTransposeGradient) GradientOption() CNNConvolutionGradientOption { + rv := objc.Call[CNNConvolutionGradientOption](c_, objc.Sel("gradientOption")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131781-gradientoption?language=objc +func (c_ CNNConvolutionTransposeGradient) SetGradientOption(value CNNConvolutionGradientOption) { + objc.Call[objc.Void](c_, objc.Sel("setGradientOption:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131787-sourcegradientfeaturechannels?language=objc +func (c_ CNNConvolutionTransposeGradient) SourceGradientFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("sourceGradientFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradient/3131782-groups?language=objc +func (c_ CNNConvolutionTransposeGradient) Groups() uint { + rv := objc.Call[uint](c_, objc.Sel("groups")) + return rv +} diff --git a/macos/mps/cnn_convolution_transpose_gradient_node.gen.go b/macos/mps/cnn_convolution_transpose_gradient_node.gen.go new file mode 100644 index 00000000..702ba805 --- /dev/null +++ b/macos/mps/cnn_convolution_transpose_gradient_node.gen.go @@ -0,0 +1,114 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionTransposeGradientNode] class. +var CNNConvolutionTransposeGradientNodeClass = _CNNConvolutionTransposeGradientNodeClass{objc.GetClass("MPSCNNConvolutionTransposeGradientNode")} + +type _CNNConvolutionTransposeGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionTransposeGradientNode] class. +type ICNNConvolutionTransposeGradientNode interface { + ICNNConvolutionGradientNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradientnode?language=objc +type CNNConvolutionTransposeGradientNode struct { + CNNConvolutionGradientNode +} + +func CNNConvolutionTransposeGradientNodeFrom(ptr unsafe.Pointer) CNNConvolutionTransposeGradientNode { + return CNNConvolutionTransposeGradientNode{ + CNNConvolutionGradientNode: CNNConvolutionGradientNodeFrom(ptr), + } +} + +func (c_ CNNConvolutionTransposeGradientNode) InitWithSourceGradientSourceImageConvolutionTransposeGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionTransposeGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:convolutionTransposeGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradientnode/3143550-initwithsourcegradient?language=objc +func NewCNNConvolutionTransposeGradientNodeWithSourceGradientSourceImageConvolutionTransposeGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionTransposeGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + instance := CNNConvolutionTransposeGradientNodeClass.Alloc().InitWithSourceGradientSourceImageConvolutionTransposeGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionTransposeGradientNodeClass) NodeWithSourceGradientSourceImageConvolutionTransposeGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionTransposeGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:convolutionTransposeGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradientnode/3143551-nodewithsourcegradient?language=objc +func CNNConvolutionTransposeGradientNode_NodeWithSourceGradientSourceImageConvolutionTransposeGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionTransposeGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + return CNNConvolutionTransposeGradientNodeClass.NodeWithSourceGradientSourceImageConvolutionTransposeGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) +} + +func (cc _CNNConvolutionTransposeGradientNodeClass) Alloc() CNNConvolutionTransposeGradientNode { + rv := objc.Call[CNNConvolutionTransposeGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionTransposeGradientNode_Alloc() CNNConvolutionTransposeGradientNode { + return CNNConvolutionTransposeGradientNodeClass.Alloc() +} + +func (cc _CNNConvolutionTransposeGradientNodeClass) New() CNNConvolutionTransposeGradientNode { + rv := objc.Call[CNNConvolutionTransposeGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionTransposeGradientNode() CNNConvolutionTransposeGradientNode { + return CNNConvolutionTransposeGradientNodeClass.New() +} + +func (c_ CNNConvolutionTransposeGradientNode) Init() CNNConvolutionTransposeGradientNode { + rv := objc.Call[CNNConvolutionTransposeGradientNode](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolutionTransposeGradientNode) InitWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:convolutionGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientnode/2947999-initwithsourcegradient?language=objc +func NewCNNConvolutionTransposeGradientNodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + instance := CNNConvolutionTransposeGradientNodeClass.Alloc().InitWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionTransposeGradientNodeClass) NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:convolutionGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientnode/2947984-nodewithsourcegradient?language=objc +func CNNConvolutionTransposeGradientNode_NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeGradientNode { + return CNNConvolutionTransposeGradientNodeClass.NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) +} diff --git a/macos/mps/cnn_convolution_transpose_gradient_state.gen.go b/macos/mps/cnn_convolution_transpose_gradient_state.gen.go new file mode 100644 index 00000000..ccbb58c8 --- /dev/null +++ b/macos/mps/cnn_convolution_transpose_gradient_state.gen.go @@ -0,0 +1,125 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionTransposeGradientState] class. +var CNNConvolutionTransposeGradientStateClass = _CNNConvolutionTransposeGradientStateClass{objc.GetClass("MPSCNNConvolutionTransposeGradientState")} + +type _CNNConvolutionTransposeGradientStateClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionTransposeGradientState] class. +type ICNNConvolutionTransposeGradientState interface { + ICNNConvolutionGradientState + ConvolutionTranspose() CNNConvolutionTranspose +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradientstate?language=objc +type CNNConvolutionTransposeGradientState struct { + CNNConvolutionGradientState +} + +func CNNConvolutionTransposeGradientStateFrom(ptr unsafe.Pointer) CNNConvolutionTransposeGradientState { + return CNNConvolutionTransposeGradientState{ + CNNConvolutionGradientState: CNNConvolutionGradientStateFrom(ptr), + } +} + +func (cc _CNNConvolutionTransposeGradientStateClass) Alloc() CNNConvolutionTransposeGradientState { + rv := objc.Call[CNNConvolutionTransposeGradientState](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionTransposeGradientState_Alloc() CNNConvolutionTransposeGradientState { + return CNNConvolutionTransposeGradientStateClass.Alloc() +} + +func (cc _CNNConvolutionTransposeGradientStateClass) New() CNNConvolutionTransposeGradientState { + rv := objc.Call[CNNConvolutionTransposeGradientState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionTransposeGradientState() CNNConvolutionTransposeGradientState { + return CNNConvolutionTransposeGradientStateClass.New() +} + +func (c_ CNNConvolutionTransposeGradientState) Init() CNNConvolutionTransposeGradientState { + rv := objc.Call[CNNConvolutionTransposeGradientState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolutionTransposeGradientState) InitWithResources(resources []metal.PResource) CNNConvolutionTransposeGradientState { + rv := objc.Call[CNNConvolutionTransposeGradientState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNConvolutionTransposeGradientStateWithResources(resources []metal.PResource) CNNConvolutionTransposeGradientState { + instance := CNNConvolutionTransposeGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionTransposeGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNConvolutionTransposeGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionTransposeGradientState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNConvolutionTransposeGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNConvolutionTransposeGradientState { + instance := CNNConvolutionTransposeGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionTransposeGradientState) InitWithResource(resource metal.PResource) CNNConvolutionTransposeGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNConvolutionTransposeGradientState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNConvolutionTransposeGradientStateWithResource(resource metal.PResource) CNNConvolutionTransposeGradientState { + instance := CNNConvolutionTransposeGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionTransposeGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNConvolutionTransposeGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNConvolutionTransposeGradientState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNConvolutionTransposeGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNConvolutionTransposeGradientState { + return CNNConvolutionTransposeGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradientstate/3131790-convolutiontranspose?language=objc +func (c_ CNNConvolutionTransposeGradientState) ConvolutionTranspose() CNNConvolutionTranspose { + rv := objc.Call[CNNConvolutionTranspose](c_, objc.Sel("convolutionTranspose")) + return rv +} diff --git a/macos/mps/cnn_convolution_transpose_gradient_state_node.gen.go b/macos/mps/cnn_convolution_transpose_gradient_state_node.gen.go new file mode 100644 index 00000000..3a700efb --- /dev/null +++ b/macos/mps/cnn_convolution_transpose_gradient_state_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionTransposeGradientStateNode] class. +var CNNConvolutionTransposeGradientStateNodeClass = _CNNConvolutionTransposeGradientStateNodeClass{objc.GetClass("MPSCNNConvolutionTransposeGradientStateNode")} + +type _CNNConvolutionTransposeGradientStateNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionTransposeGradientStateNode] class. +type ICNNConvolutionTransposeGradientStateNode interface { + ICNNConvolutionGradientStateNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposegradientstatenode?language=objc +type CNNConvolutionTransposeGradientStateNode struct { + CNNConvolutionGradientStateNode +} + +func CNNConvolutionTransposeGradientStateNodeFrom(ptr unsafe.Pointer) CNNConvolutionTransposeGradientStateNode { + return CNNConvolutionTransposeGradientStateNode{ + CNNConvolutionGradientStateNode: CNNConvolutionGradientStateNodeFrom(ptr), + } +} + +func (cc _CNNConvolutionTransposeGradientStateNodeClass) Alloc() CNNConvolutionTransposeGradientStateNode { + rv := objc.Call[CNNConvolutionTransposeGradientStateNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionTransposeGradientStateNode_Alloc() CNNConvolutionTransposeGradientStateNode { + return CNNConvolutionTransposeGradientStateNodeClass.Alloc() +} + +func (cc _CNNConvolutionTransposeGradientStateNodeClass) New() CNNConvolutionTransposeGradientStateNode { + rv := objc.Call[CNNConvolutionTransposeGradientStateNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionTransposeGradientStateNode() CNNConvolutionTransposeGradientStateNode { + return CNNConvolutionTransposeGradientStateNodeClass.New() +} + +func (c_ CNNConvolutionTransposeGradientStateNode) Init() CNNConvolutionTransposeGradientStateNode { + rv := objc.Call[CNNConvolutionTransposeGradientStateNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_convolution_transpose_node.gen.go b/macos/mps/cnn_convolution_transpose_node.gen.go new file mode 100644 index 00000000..610a181c --- /dev/null +++ b/macos/mps/cnn_convolution_transpose_node.gen.go @@ -0,0 +1,114 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionTransposeNode] class. +var CNNConvolutionTransposeNodeClass = _CNNConvolutionTransposeNodeClass{objc.GetClass("MPSCNNConvolutionTransposeNode")} + +type _CNNConvolutionTransposeNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionTransposeNode] class. +type ICNNConvolutionTransposeNode interface { + ICNNConvolutionNode +} + +// A representation of a transposed convolution. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposenode?language=objc +type CNNConvolutionTransposeNode struct { + CNNConvolutionNode +} + +func CNNConvolutionTransposeNodeFrom(ptr unsafe.Pointer) CNNConvolutionTransposeNode { + return CNNConvolutionTransposeNode{ + CNNConvolutionNode: CNNConvolutionNodeFrom(ptr), + } +} + +func (cc _CNNConvolutionTransposeNodeClass) NodeWithSourceConvolutionGradientStateWeights(sourceNode INNImageNode, convolutionGradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + po2 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeNode](cc, objc.Sel("nodeWithSource:convolutionGradientState:weights:"), objc.Ptr(sourceNode), objc.Ptr(convolutionGradientState), po2) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposenode/2942636-nodewithsource?language=objc +func CNNConvolutionTransposeNode_NodeWithSourceConvolutionGradientStateWeights(sourceNode INNImageNode, convolutionGradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + return CNNConvolutionTransposeNodeClass.NodeWithSourceConvolutionGradientStateWeights(sourceNode, convolutionGradientState, weights) +} + +func (c_ CNNConvolutionTransposeNode) InitWithSourceConvolutionGradientStateWeights(sourceNode INNImageNode, convolutionGradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + po2 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeNode](c_, objc.Sel("initWithSource:convolutionGradientState:weights:"), objc.Ptr(sourceNode), objc.Ptr(convolutionGradientState), po2) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposenode/2942641-initwithsource?language=objc +func NewCNNConvolutionTransposeNodeWithSourceConvolutionGradientStateWeights(sourceNode INNImageNode, convolutionGradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + instance := CNNConvolutionTransposeNodeClass.Alloc().InitWithSourceConvolutionGradientStateWeights(sourceNode, convolutionGradientState, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionTransposeNodeClass) Alloc() CNNConvolutionTransposeNode { + rv := objc.Call[CNNConvolutionTransposeNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionTransposeNode_Alloc() CNNConvolutionTransposeNode { + return CNNConvolutionTransposeNodeClass.Alloc() +} + +func (cc _CNNConvolutionTransposeNodeClass) New() CNNConvolutionTransposeNode { + rv := objc.Call[CNNConvolutionTransposeNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionTransposeNode() CNNConvolutionTransposeNode { + return CNNConvolutionTransposeNodeClass.New() +} + +func (c_ CNNConvolutionTransposeNode) Init() CNNConvolutionTransposeNode { + rv := objc.Call[CNNConvolutionTransposeNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNConvolutionTransposeNodeClass) NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeNode](cc, objc.Sel("nodeWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866436-nodewithsource?language=objc +func CNNConvolutionTransposeNode_NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + return CNNConvolutionTransposeNodeClass.NodeWithSourceWeights(sourceNode, weights) +} + +func (c_ CNNConvolutionTransposeNode) InitWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNConvolutionTransposeNode](c_, objc.Sel("initWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionnode/2866470-initwithsource?language=objc +func NewCNNConvolutionTransposeNodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNConvolutionTransposeNode { + instance := CNNConvolutionTransposeNodeClass.Alloc().InitWithSourceWeights(sourceNode, weights) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_convolution_weights_and_biases_state.gen.go b/macos/mps/cnn_convolution_weights_and_biases_state.gen.go new file mode 100644 index 00000000..21f5b424 --- /dev/null +++ b/macos/mps/cnn_convolution_weights_and_biases_state.gen.go @@ -0,0 +1,196 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNConvolutionWeightsAndBiasesState] class. +var CNNConvolutionWeightsAndBiasesStateClass = _CNNConvolutionWeightsAndBiasesStateClass{objc.GetClass("MPSCNNConvolutionWeightsAndBiasesState")} + +type _CNNConvolutionWeightsAndBiasesStateClass struct { + objc.Class +} + +// An interface definition for the [CNNConvolutionWeightsAndBiasesState] class. +type ICNNConvolutionWeightsAndBiasesState interface { + IState + WeightsOffset() uint + Weights() metal.BufferWrapper + BiasesOffset() uint + Biases() metal.BufferWrapper +} + +// A class that stores weights and biases. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate?language=objc +type CNNConvolutionWeightsAndBiasesState struct { + State +} + +func CNNConvolutionWeightsAndBiasesStateFrom(ptr unsafe.Pointer) CNNConvolutionWeightsAndBiasesState { + return CNNConvolutionWeightsAndBiasesState{ + State: StateFrom(ptr), + } +} + +func (c_ CNNConvolutionWeightsAndBiasesState) InitWithDeviceCnnConvolutionDescriptor(device metal.PDevice, descriptor ICNNConvolutionDescriptor) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("initWithDevice:cnnConvolutionDescriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate/2953004-initwithdevice?language=objc +func NewCNNConvolutionWeightsAndBiasesStateWithDeviceCnnConvolutionDescriptor(device metal.PDevice, descriptor ICNNConvolutionDescriptor) CNNConvolutionWeightsAndBiasesState { + instance := CNNConvolutionWeightsAndBiasesStateClass.Alloc().InitWithDeviceCnnConvolutionDescriptor(device, descriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionWeightsAndBiasesState) InitWithWeightsBiases(weights metal.PBuffer, biases metal.PBuffer) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLBuffer", weights) + po1 := objc.WrapAsProtocol("MTLBuffer", biases) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("initWithWeights:biases:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate/2953008-initwithweights?language=objc +func NewCNNConvolutionWeightsAndBiasesStateWithWeightsBiases(weights metal.PBuffer, biases metal.PBuffer) CNNConvolutionWeightsAndBiasesState { + instance := CNNConvolutionWeightsAndBiasesStateClass.Alloc().InitWithWeightsBiases(weights, biases) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionWeightsAndBiasesStateClass) TemporaryCNNConvolutionWeightsAndBiasesStateWithCommandBufferCnnConvolutionDescriptor(commandBuffer metal.PCommandBuffer, descriptor ICNNConvolutionDescriptor) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](cc, objc.Sel("temporaryCNNConvolutionWeightsAndBiasesStateWithCommandBuffer:cnnConvolutionDescriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate/2953005-temporarycnnconvolutionweightsan?language=objc +func CNNConvolutionWeightsAndBiasesState_TemporaryCNNConvolutionWeightsAndBiasesStateWithCommandBufferCnnConvolutionDescriptor(commandBuffer metal.PCommandBuffer, descriptor ICNNConvolutionDescriptor) CNNConvolutionWeightsAndBiasesState { + return CNNConvolutionWeightsAndBiasesStateClass.TemporaryCNNConvolutionWeightsAndBiasesStateWithCommandBufferCnnConvolutionDescriptor(commandBuffer, descriptor) +} + +func (cc _CNNConvolutionWeightsAndBiasesStateClass) Alloc() CNNConvolutionWeightsAndBiasesState { + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](cc, objc.Sel("alloc")) + return rv +} + +func CNNConvolutionWeightsAndBiasesState_Alloc() CNNConvolutionWeightsAndBiasesState { + return CNNConvolutionWeightsAndBiasesStateClass.Alloc() +} + +func (cc _CNNConvolutionWeightsAndBiasesStateClass) New() CNNConvolutionWeightsAndBiasesState { + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNConvolutionWeightsAndBiasesState() CNNConvolutionWeightsAndBiasesState { + return CNNConvolutionWeightsAndBiasesStateClass.New() +} + +func (c_ CNNConvolutionWeightsAndBiasesState) Init() CNNConvolutionWeightsAndBiasesState { + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNConvolutionWeightsAndBiasesState) InitWithResources(resources []metal.PResource) CNNConvolutionWeightsAndBiasesState { + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNConvolutionWeightsAndBiasesStateWithResources(resources []metal.PResource) CNNConvolutionWeightsAndBiasesState { + instance := CNNConvolutionWeightsAndBiasesStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionWeightsAndBiasesState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNConvolutionWeightsAndBiasesStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNConvolutionWeightsAndBiasesState { + instance := CNNConvolutionWeightsAndBiasesStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNConvolutionWeightsAndBiasesState) InitWithResource(resource metal.PResource) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNConvolutionWeightsAndBiasesStateWithResource(resource metal.PResource) CNNConvolutionWeightsAndBiasesState { + instance := CNNConvolutionWeightsAndBiasesStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNConvolutionWeightsAndBiasesStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNConvolutionWeightsAndBiasesState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNConvolutionWeightsAndBiasesState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNConvolutionWeightsAndBiasesState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNConvolutionWeightsAndBiasesState { + return CNNConvolutionWeightsAndBiasesStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate/3325844-weightsoffset?language=objc +func (c_ CNNConvolutionWeightsAndBiasesState) WeightsOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("weightsOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate/2953006-weights?language=objc +func (c_ CNNConvolutionWeightsAndBiasesState) Weights() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("weights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate/3325842-biasesoffset?language=objc +func (c_ CNNConvolutionWeightsAndBiasesState) BiasesOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("biasesOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightsandbiasesstate/2953002-biases?language=objc +func (c_ CNNConvolutionWeightsAndBiasesState) Biases() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("biases")) + return rv +} diff --git a/macos/mps/cnn_cross_channel_normalization.gen.go b/macos/mps/cnn_cross_channel_normalization.gen.go new file mode 100644 index 00000000..5a28dd4e --- /dev/null +++ b/macos/mps/cnn_cross_channel_normalization.gen.go @@ -0,0 +1,165 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNCrossChannelNormalization] class. +var CNNCrossChannelNormalizationClass = _CNNCrossChannelNormalizationClass{objc.GetClass("MPSCNNCrossChannelNormalization")} + +type _CNNCrossChannelNormalizationClass struct { + objc.Class +} + +// An interface definition for the [CNNCrossChannelNormalization] class. +type ICNNCrossChannelNormalization interface { + ICNNKernel + KernelSize() uint + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// A normalization kernel applied across feature channels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization?language=objc +type CNNCrossChannelNormalization struct { + CNNKernel +} + +func CNNCrossChannelNormalizationFrom(ptr unsafe.Pointer) CNNCrossChannelNormalization { + return CNNCrossChannelNormalization{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNCrossChannelNormalization) InitWithDeviceKernelSize(device metal.PDevice, kernelSize uint) CNNCrossChannelNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNCrossChannelNormalization](c_, objc.Sel("initWithDevice:kernelSize:"), po0, kernelSize) + return rv +} + +// Initializes a normalization kernel in a channel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648834-initwithdevice?language=objc +func NewCNNCrossChannelNormalizationWithDeviceKernelSize(device metal.PDevice, kernelSize uint) CNNCrossChannelNormalization { + instance := CNNCrossChannelNormalizationClass.Alloc().InitWithDeviceKernelSize(device, kernelSize) + instance.Autorelease() + return instance +} + +func (cc _CNNCrossChannelNormalizationClass) Alloc() CNNCrossChannelNormalization { + rv := objc.Call[CNNCrossChannelNormalization](cc, objc.Sel("alloc")) + return rv +} + +func CNNCrossChannelNormalization_Alloc() CNNCrossChannelNormalization { + return CNNCrossChannelNormalizationClass.Alloc() +} + +func (cc _CNNCrossChannelNormalizationClass) New() CNNCrossChannelNormalization { + rv := objc.Call[CNNCrossChannelNormalization](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNCrossChannelNormalization() CNNCrossChannelNormalization { + return CNNCrossChannelNormalizationClass.New() +} + +func (c_ CNNCrossChannelNormalization) Init() CNNCrossChannelNormalization { + rv := objc.Call[CNNCrossChannelNormalization](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNCrossChannelNormalization) InitWithDevice(device metal.PDevice) CNNCrossChannelNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNCrossChannelNormalization](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNCrossChannelNormalizationWithDevice(device metal.PDevice) CNNCrossChannelNormalization { + instance := CNNCrossChannelNormalizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNCrossChannelNormalization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNCrossChannelNormalization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNCrossChannelNormalization](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNCrossChannelNormalization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNCrossChannelNormalization { + instance := CNNCrossChannelNormalizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The size of the square kernel window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648811-kernelsize?language=objc +func (c_ CNNCrossChannelNormalization) KernelSize() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelSize")) + return rv +} + +// The "beta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648879-beta?language=objc +func (c_ CNNCrossChannelNormalization) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// The "beta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648879-beta?language=objc +func (c_ CNNCrossChannelNormalization) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// The "delta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648881-delta?language=objc +func (c_ CNNCrossChannelNormalization) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// The "delta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648881-delta?language=objc +func (c_ CNNCrossChannelNormalization) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// The "alpha" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648896-alpha?language=objc +func (c_ CNNCrossChannelNormalization) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// The "alpha" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalization/1648896-alpha?language=objc +func (c_ CNNCrossChannelNormalization) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/cnn_cross_channel_normalization_gradient.gen.go b/macos/mps/cnn_cross_channel_normalization_gradient.gen.go new file mode 100644 index 00000000..e580eaf4 --- /dev/null +++ b/macos/mps/cnn_cross_channel_normalization_gradient.gen.go @@ -0,0 +1,165 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNCrossChannelNormalizationGradient] class. +var CNNCrossChannelNormalizationGradientClass = _CNNCrossChannelNormalizationGradientClass{objc.GetClass("MPSCNNCrossChannelNormalizationGradient")} + +type _CNNCrossChannelNormalizationGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNCrossChannelNormalizationGradient] class. +type ICNNCrossChannelNormalizationGradient interface { + ICNNGradientKernel + KernelSize() uint + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// A gradient normalization kernel applied across feature channels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient?language=objc +type CNNCrossChannelNormalizationGradient struct { + CNNGradientKernel +} + +func CNNCrossChannelNormalizationGradientFrom(ptr unsafe.Pointer) CNNCrossChannelNormalizationGradient { + return CNNCrossChannelNormalizationGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNCrossChannelNormalizationGradient) InitWithDeviceKernelSize(device metal.PDevice, kernelSize uint) CNNCrossChannelNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNCrossChannelNormalizationGradient](c_, objc.Sel("initWithDevice:kernelSize:"), po0, kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942463-initwithdevice?language=objc +func NewCNNCrossChannelNormalizationGradientWithDeviceKernelSize(device metal.PDevice, kernelSize uint) CNNCrossChannelNormalizationGradient { + instance := CNNCrossChannelNormalizationGradientClass.Alloc().InitWithDeviceKernelSize(device, kernelSize) + instance.Autorelease() + return instance +} + +func (cc _CNNCrossChannelNormalizationGradientClass) Alloc() CNNCrossChannelNormalizationGradient { + rv := objc.Call[CNNCrossChannelNormalizationGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNCrossChannelNormalizationGradient_Alloc() CNNCrossChannelNormalizationGradient { + return CNNCrossChannelNormalizationGradientClass.Alloc() +} + +func (cc _CNNCrossChannelNormalizationGradientClass) New() CNNCrossChannelNormalizationGradient { + rv := objc.Call[CNNCrossChannelNormalizationGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNCrossChannelNormalizationGradient() CNNCrossChannelNormalizationGradient { + return CNNCrossChannelNormalizationGradientClass.New() +} + +func (c_ CNNCrossChannelNormalizationGradient) Init() CNNCrossChannelNormalizationGradient { + rv := objc.Call[CNNCrossChannelNormalizationGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNCrossChannelNormalizationGradient) InitWithDevice(device metal.PDevice) CNNCrossChannelNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNCrossChannelNormalizationGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNCrossChannelNormalizationGradientWithDevice(device metal.PDevice) CNNCrossChannelNormalizationGradient { + instance := CNNCrossChannelNormalizationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNCrossChannelNormalizationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNCrossChannelNormalizationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNCrossChannelNormalizationGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNCrossChannelNormalizationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNCrossChannelNormalizationGradient { + instance := CNNCrossChannelNormalizationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942468-kernelsize?language=objc +func (c_ CNNCrossChannelNormalizationGradient) KernelSize() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942477-beta?language=objc +func (c_ CNNCrossChannelNormalizationGradient) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942477-beta?language=objc +func (c_ CNNCrossChannelNormalizationGradient) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942465-delta?language=objc +func (c_ CNNCrossChannelNormalizationGradient) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942465-delta?language=objc +func (c_ CNNCrossChannelNormalizationGradient) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942464-alpha?language=objc +func (c_ CNNCrossChannelNormalizationGradient) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradient/2942464-alpha?language=objc +func (c_ CNNCrossChannelNormalizationGradient) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/cnn_cross_channel_normalization_gradient_node.gen.go b/macos/mps/cnn_cross_channel_normalization_gradient_node.gen.go new file mode 100644 index 00000000..0439aba6 --- /dev/null +++ b/macos/mps/cnn_cross_channel_normalization_gradient_node.gen.go @@ -0,0 +1,93 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNCrossChannelNormalizationGradientNode] class. +var CNNCrossChannelNormalizationGradientNodeClass = _CNNCrossChannelNormalizationGradientNodeClass{objc.GetClass("MPSCNNCrossChannelNormalizationGradientNode")} + +type _CNNCrossChannelNormalizationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNCrossChannelNormalizationGradientNode] class. +type ICNNCrossChannelNormalizationGradientNode interface { + INNGradientFilterNode + KernelSize() uint +} + +// A representation of a gradient normalization kernel applied across feature channels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradientnode?language=objc +type CNNCrossChannelNormalizationGradientNode struct { + NNGradientFilterNode +} + +func CNNCrossChannelNormalizationGradientNodeFrom(ptr unsafe.Pointer) CNNCrossChannelNormalizationGradientNode { + return CNNCrossChannelNormalizationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNCrossChannelNormalizationGradientNode) InitWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNCrossChannelNormalizationGradientNode { + rv := objc.Call[CNNCrossChannelNormalizationGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelSize:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradientnode/2948043-initwithsourcegradient?language=objc +func NewCNNCrossChannelNormalizationGradientNodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNCrossChannelNormalizationGradientNode { + instance := CNNCrossChannelNormalizationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient, sourceImage, gradientState, kernelSize) + instance.Autorelease() + return instance +} + +func (cc _CNNCrossChannelNormalizationGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNCrossChannelNormalizationGradientNode { + rv := objc.Call[CNNCrossChannelNormalizationGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelSize:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradientnode/2948032-nodewithsourcegradient?language=objc +func CNNCrossChannelNormalizationGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNCrossChannelNormalizationGradientNode { + return CNNCrossChannelNormalizationGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient, sourceImage, gradientState, kernelSize) +} + +func (cc _CNNCrossChannelNormalizationGradientNodeClass) Alloc() CNNCrossChannelNormalizationGradientNode { + rv := objc.Call[CNNCrossChannelNormalizationGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNCrossChannelNormalizationGradientNode_Alloc() CNNCrossChannelNormalizationGradientNode { + return CNNCrossChannelNormalizationGradientNodeClass.Alloc() +} + +func (cc _CNNCrossChannelNormalizationGradientNodeClass) New() CNNCrossChannelNormalizationGradientNode { + rv := objc.Call[CNNCrossChannelNormalizationGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNCrossChannelNormalizationGradientNode() CNNCrossChannelNormalizationGradientNode { + return CNNCrossChannelNormalizationGradientNodeClass.New() +} + +func (c_ CNNCrossChannelNormalizationGradientNode) Init() CNNCrossChannelNormalizationGradientNode { + rv := objc.Call[CNNCrossChannelNormalizationGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationgradientnode/2948049-kernelsize?language=objc +func (c_ CNNCrossChannelNormalizationGradientNode) KernelSize() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelSize")) + return rv +} diff --git a/macos/mps/cnn_cross_channel_normalization_node.gen.go b/macos/mps/cnn_cross_channel_normalization_node.gen.go new file mode 100644 index 00000000..e2d23ebc --- /dev/null +++ b/macos/mps/cnn_cross_channel_normalization_node.gen.go @@ -0,0 +1,113 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNCrossChannelNormalizationNode] class. +var CNNCrossChannelNormalizationNodeClass = _CNNCrossChannelNormalizationNodeClass{objc.GetClass("MPSCNNCrossChannelNormalizationNode")} + +type _CNNCrossChannelNormalizationNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNCrossChannelNormalizationNode] class. +type ICNNCrossChannelNormalizationNode interface { + ICNNNormalizationNode + KernelSizeInFeatureChannels() uint + SetKernelSizeInFeatureChannels(value uint) +} + +// A representation of a normalization kernel across feature channels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationnode?language=objc +type CNNCrossChannelNormalizationNode struct { + CNNNormalizationNode +} + +func CNNCrossChannelNormalizationNodeFrom(ptr unsafe.Pointer) CNNCrossChannelNormalizationNode { + return CNNCrossChannelNormalizationNode{ + CNNNormalizationNode: CNNNormalizationNodeFrom(ptr), + } +} + +func (cc _CNNCrossChannelNormalizationNodeClass) NodeWithSourceKernelSize(sourceNode INNImageNode, kernelSize uint) CNNCrossChannelNormalizationNode { + rv := objc.Call[CNNCrossChannelNormalizationNode](cc, objc.Sel("nodeWithSource:kernelSize:"), objc.Ptr(sourceNode), kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationnode/2866476-nodewithsource?language=objc +func CNNCrossChannelNormalizationNode_NodeWithSourceKernelSize(sourceNode INNImageNode, kernelSize uint) CNNCrossChannelNormalizationNode { + return CNNCrossChannelNormalizationNodeClass.NodeWithSourceKernelSize(sourceNode, kernelSize) +} + +func (c_ CNNCrossChannelNormalizationNode) InitWithSource(sourceNode INNImageNode) CNNCrossChannelNormalizationNode { + rv := objc.Call[CNNCrossChannelNormalizationNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationnode/2866459-initwithsource?language=objc +func NewCNNCrossChannelNormalizationNodeWithSource(sourceNode INNImageNode) CNNCrossChannelNormalizationNode { + instance := CNNCrossChannelNormalizationNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNCrossChannelNormalizationNodeClass) Alloc() CNNCrossChannelNormalizationNode { + rv := objc.Call[CNNCrossChannelNormalizationNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNCrossChannelNormalizationNode_Alloc() CNNCrossChannelNormalizationNode { + return CNNCrossChannelNormalizationNodeClass.Alloc() +} + +func (cc _CNNCrossChannelNormalizationNodeClass) New() CNNCrossChannelNormalizationNode { + rv := objc.Call[CNNCrossChannelNormalizationNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNCrossChannelNormalizationNode() CNNCrossChannelNormalizationNode { + return CNNCrossChannelNormalizationNodeClass.New() +} + +func (c_ CNNCrossChannelNormalizationNode) Init() CNNCrossChannelNormalizationNode { + rv := objc.Call[CNNCrossChannelNormalizationNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNCrossChannelNormalizationNodeClass) NodeWithSource(sourceNode INNImageNode) CNNCrossChannelNormalizationNode { + rv := objc.Call[CNNCrossChannelNormalizationNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866460-nodewithsource?language=objc +func CNNCrossChannelNormalizationNode_NodeWithSource(sourceNode INNImageNode) CNNCrossChannelNormalizationNode { + return CNNCrossChannelNormalizationNodeClass.NodeWithSource(sourceNode) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationnode/2866419-kernelsizeinfeaturechannels?language=objc +func (c_ CNNCrossChannelNormalizationNode) KernelSizeInFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelSizeInFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnncrosschannelnormalizationnode/2866419-kernelsizeinfeaturechannels?language=objc +func (c_ CNNCrossChannelNormalizationNode) SetKernelSizeInFeatureChannels(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelSizeInFeatureChannels:"), value) +} diff --git a/macos/mps/cnn_depth_wise_convolution_descriptor.gen.go b/macos/mps/cnn_depth_wise_convolution_descriptor.gen.go new file mode 100644 index 00000000..2f0391a2 --- /dev/null +++ b/macos/mps/cnn_depth_wise_convolution_descriptor.gen.go @@ -0,0 +1,79 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDepthWiseConvolutionDescriptor] class. +var CNNDepthWiseConvolutionDescriptorClass = _CNNDepthWiseConvolutionDescriptorClass{objc.GetClass("MPSCNNDepthWiseConvolutionDescriptor")} + +type _CNNDepthWiseConvolutionDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CNNDepthWiseConvolutionDescriptor] class. +type ICNNDepthWiseConvolutionDescriptor interface { + ICNNConvolutionDescriptor + ChannelMultiplier() uint +} + +// A description of a convolution object that does depthwise convolution. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndepthwiseconvolutiondescriptor?language=objc +type CNNDepthWiseConvolutionDescriptor struct { + CNNConvolutionDescriptor +} + +func CNNDepthWiseConvolutionDescriptorFrom(ptr unsafe.Pointer) CNNDepthWiseConvolutionDescriptor { + return CNNDepthWiseConvolutionDescriptor{ + CNNConvolutionDescriptor: CNNConvolutionDescriptorFrom(ptr), + } +} + +func (cc _CNNDepthWiseConvolutionDescriptorClass) Alloc() CNNDepthWiseConvolutionDescriptor { + rv := objc.Call[CNNDepthWiseConvolutionDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CNNDepthWiseConvolutionDescriptor_Alloc() CNNDepthWiseConvolutionDescriptor { + return CNNDepthWiseConvolutionDescriptorClass.Alloc() +} + +func (cc _CNNDepthWiseConvolutionDescriptorClass) New() CNNDepthWiseConvolutionDescriptor { + rv := objc.Call[CNNDepthWiseConvolutionDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDepthWiseConvolutionDescriptor() CNNDepthWiseConvolutionDescriptor { + return CNNDepthWiseConvolutionDescriptorClass.New() +} + +func (c_ CNNDepthWiseConvolutionDescriptor) Init() CNNDepthWiseConvolutionDescriptor { + rv := objc.Call[CNNDepthWiseConvolutionDescriptor](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNDepthWiseConvolutionDescriptorClass) CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth uint, kernelHeight uint, inputFeatureChannels uint, outputFeatureChannels uint) CNNDepthWiseConvolutionDescriptor { + rv := objc.Call[CNNDepthWiseConvolutionDescriptor](cc, objc.Sel("cnnConvolutionDescriptorWithKernelWidth:kernelHeight:inputFeatureChannels:outputFeatureChannels:"), kernelWidth, kernelHeight, inputFeatureChannels, outputFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648813-cnnconvolutiondescriptorwithkern?language=objc +func CNNDepthWiseConvolutionDescriptor_CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth uint, kernelHeight uint, inputFeatureChannels uint, outputFeatureChannels uint) CNNDepthWiseConvolutionDescriptor { + return CNNDepthWiseConvolutionDescriptorClass.CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth, kernelHeight, inputFeatureChannels, outputFeatureChannels) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndepthwiseconvolutiondescriptor/2919731-channelmultiplier?language=objc +func (c_ CNNDepthWiseConvolutionDescriptor) ChannelMultiplier() uint { + rv := objc.Call[uint](c_, objc.Sel("channelMultiplier")) + return rv +} diff --git a/macos/mps/cnn_dilated_pooling_max.gen.go b/macos/mps/cnn_dilated_pooling_max.gen.go new file mode 100644 index 00000000..b60d7724 --- /dev/null +++ b/macos/mps/cnn_dilated_pooling_max.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDilatedPoolingMax] class. +var CNNDilatedPoolingMaxClass = _CNNDilatedPoolingMaxClass{objc.GetClass("MPSCNNDilatedPoolingMax")} + +type _CNNDilatedPoolingMaxClass struct { + objc.Class +} + +// An interface definition for the [CNNDilatedPoolingMax] class. +type ICNNDilatedPoolingMax interface { + ICNNPooling +} + +// A dilated max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmax?language=objc +type CNNDilatedPoolingMax struct { + CNNPooling +} + +func CNNDilatedPoolingMaxFrom(ptr unsafe.Pointer) CNNDilatedPoolingMax { + return CNNDilatedPoolingMax{ + CNNPooling: CNNPoolingFrom(ptr), + } +} + +func (c_ CNNDilatedPoolingMax) InitWithDeviceKernelWidthKernelHeightDilationRateXDilationRateYStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, dilationRateX uint, dilationRateY uint, strideInPixelsX uint, strideInPixelsY uint) CNNDilatedPoolingMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMax](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:dilationRateX:dilationRateY:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, dilationRateX, dilationRateY, strideInPixelsX, strideInPixelsY) + return rv +} + +// Initializes a dilated max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmax/2881192-initwithdevice?language=objc +func NewCNNDilatedPoolingMaxWithDeviceKernelWidthKernelHeightDilationRateXDilationRateYStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, dilationRateX uint, dilationRateY uint, strideInPixelsX uint, strideInPixelsY uint) CNNDilatedPoolingMax { + instance := CNNDilatedPoolingMaxClass.Alloc().InitWithDeviceKernelWidthKernelHeightDilationRateXDilationRateYStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, dilationRateX, dilationRateY, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNDilatedPoolingMaxClass) Alloc() CNNDilatedPoolingMax { + rv := objc.Call[CNNDilatedPoolingMax](cc, objc.Sel("alloc")) + return rv +} + +func CNNDilatedPoolingMax_Alloc() CNNDilatedPoolingMax { + return CNNDilatedPoolingMaxClass.Alloc() +} + +func (cc _CNNDilatedPoolingMaxClass) New() CNNDilatedPoolingMax { + rv := objc.Call[CNNDilatedPoolingMax](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDilatedPoolingMax() CNNDilatedPoolingMax { + return CNNDilatedPoolingMaxClass.New() +} + +func (c_ CNNDilatedPoolingMax) Init() CNNDilatedPoolingMax { + rv := objc.Call[CNNDilatedPoolingMax](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNDilatedPoolingMax) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNDilatedPoolingMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMax](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// Initializes a pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpooling/1648902-initwithdevice?language=objc +func NewCNNDilatedPoolingMaxWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNDilatedPoolingMax { + instance := CNNDilatedPoolingMaxClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (c_ CNNDilatedPoolingMax) InitWithDevice(device metal.PDevice) CNNDilatedPoolingMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMax](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNDilatedPoolingMaxWithDevice(device metal.PDevice) CNNDilatedPoolingMax { + instance := CNNDilatedPoolingMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNDilatedPoolingMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDilatedPoolingMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMax](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNDilatedPoolingMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDilatedPoolingMax { + instance := CNNDilatedPoolingMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_dilated_pooling_max_gradient.gen.go b/macos/mps/cnn_dilated_pooling_max_gradient.gen.go new file mode 100644 index 00000000..19683aee --- /dev/null +++ b/macos/mps/cnn_dilated_pooling_max_gradient.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDilatedPoolingMaxGradient] class. +var CNNDilatedPoolingMaxGradientClass = _CNNDilatedPoolingMaxGradientClass{objc.GetClass("MPSCNNDilatedPoolingMaxGradient")} + +type _CNNDilatedPoolingMaxGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNDilatedPoolingMaxGradient] class. +type ICNNDilatedPoolingMaxGradient interface { + ICNNPoolingGradient +} + +// A gradient dilated max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxgradient?language=objc +type CNNDilatedPoolingMaxGradient struct { + CNNPoolingGradient +} + +func CNNDilatedPoolingMaxGradientFrom(ptr unsafe.Pointer) CNNDilatedPoolingMaxGradient { + return CNNDilatedPoolingMaxGradient{ + CNNPoolingGradient: CNNPoolingGradientFrom(ptr), + } +} + +func (c_ CNNDilatedPoolingMaxGradient) InitWithDeviceKernelWidthKernelHeightDilationRateXDilationRateYStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, dilationRateX uint, dilationRateY uint, strideInPixelsX uint, strideInPixelsY uint) CNNDilatedPoolingMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMaxGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:dilationRateX:dilationRateY:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, dilationRateX, dilationRateY, strideInPixelsX, strideInPixelsY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxgradient/2942349-initwithdevice?language=objc +func NewCNNDilatedPoolingMaxGradientWithDeviceKernelWidthKernelHeightDilationRateXDilationRateYStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, dilationRateX uint, dilationRateY uint, strideInPixelsX uint, strideInPixelsY uint) CNNDilatedPoolingMaxGradient { + instance := CNNDilatedPoolingMaxGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeightDilationRateXDilationRateYStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, dilationRateX, dilationRateY, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNDilatedPoolingMaxGradientClass) Alloc() CNNDilatedPoolingMaxGradient { + rv := objc.Call[CNNDilatedPoolingMaxGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNDilatedPoolingMaxGradient_Alloc() CNNDilatedPoolingMaxGradient { + return CNNDilatedPoolingMaxGradientClass.Alloc() +} + +func (cc _CNNDilatedPoolingMaxGradientClass) New() CNNDilatedPoolingMaxGradient { + rv := objc.Call[CNNDilatedPoolingMaxGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDilatedPoolingMaxGradient() CNNDilatedPoolingMaxGradient { + return CNNDilatedPoolingMaxGradientClass.New() +} + +func (c_ CNNDilatedPoolingMaxGradient) Init() CNNDilatedPoolingMaxGradient { + rv := objc.Call[CNNDilatedPoolingMaxGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNDilatedPoolingMaxGradient) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNDilatedPoolingMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMaxGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient/2942337-initwithdevice?language=objc +func NewCNNDilatedPoolingMaxGradientWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNDilatedPoolingMaxGradient { + instance := CNNDilatedPoolingMaxGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (c_ CNNDilatedPoolingMaxGradient) InitWithDevice(device metal.PDevice) CNNDilatedPoolingMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMaxGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNDilatedPoolingMaxGradientWithDevice(device metal.PDevice) CNNDilatedPoolingMaxGradient { + instance := CNNDilatedPoolingMaxGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNDilatedPoolingMaxGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDilatedPoolingMaxGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDilatedPoolingMaxGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNDilatedPoolingMaxGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDilatedPoolingMaxGradient { + instance := CNNDilatedPoolingMaxGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_dilated_pooling_max_gradient_node.gen.go b/macos/mps/cnn_dilated_pooling_max_gradient_node.gen.go new file mode 100644 index 00000000..13b4e7ca --- /dev/null +++ b/macos/mps/cnn_dilated_pooling_max_gradient_node.gen.go @@ -0,0 +1,130 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDilatedPoolingMaxGradientNode] class. +var CNNDilatedPoolingMaxGradientNodeClass = _CNNDilatedPoolingMaxGradientNodeClass{objc.GetClass("MPSCNNDilatedPoolingMaxGradientNode")} + +type _CNNDilatedPoolingMaxGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNDilatedPoolingMaxGradientNode] class. +type ICNNDilatedPoolingMaxGradientNode interface { + ICNNPoolingGradientNode + DilationRateY() uint + DilationRateX() uint +} + +// A representation of a gradient dilated max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxgradientnode?language=objc +type CNNDilatedPoolingMaxGradientNode struct { + CNNPoolingGradientNode +} + +func CNNDilatedPoolingMaxGradientNodeFrom(ptr unsafe.Pointer) CNNDilatedPoolingMaxGradientNode { + return CNNDilatedPoolingMaxGradientNode{ + CNNPoolingGradientNode: CNNPoolingGradientNodeFrom(ptr), + } +} + +func (c_ CNNDilatedPoolingMaxGradientNode) InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYDilationRateXDilationRateY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, dilationRateX uint, dilationRateY uint) CNNDilatedPoolingMaxGradientNode { + rv := objc.Call[CNNDilatedPoolingMaxGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:dilationRateX:dilationRateY:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, dilationRateX, dilationRateY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxgradientnode/2948026-initwithsourcegradient?language=objc +func NewCNNDilatedPoolingMaxGradientNodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYDilationRateXDilationRateY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, dilationRateX uint, dilationRateY uint) CNNDilatedPoolingMaxGradientNode { + instance := CNNDilatedPoolingMaxGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYDilationRateXDilationRateY(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, dilationRateX, dilationRateY) + instance.Autorelease() + return instance +} + +func (cc _CNNDilatedPoolingMaxGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYDilationRateXDilationRateY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, dilationRateX uint, dilationRateY uint) CNNDilatedPoolingMaxGradientNode { + rv := objc.Call[CNNDilatedPoolingMaxGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:dilationRateX:dilationRateY:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, dilationRateX, dilationRateY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxgradientnode/2948012-nodewithsourcegradient?language=objc +func CNNDilatedPoolingMaxGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYDilationRateXDilationRateY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, dilationRateX uint, dilationRateY uint) CNNDilatedPoolingMaxGradientNode { + return CNNDilatedPoolingMaxGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYDilationRateXDilationRateY(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, dilationRateX, dilationRateY) +} + +func (cc _CNNDilatedPoolingMaxGradientNodeClass) Alloc() CNNDilatedPoolingMaxGradientNode { + rv := objc.Call[CNNDilatedPoolingMaxGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNDilatedPoolingMaxGradientNode_Alloc() CNNDilatedPoolingMaxGradientNode { + return CNNDilatedPoolingMaxGradientNodeClass.Alloc() +} + +func (cc _CNNDilatedPoolingMaxGradientNodeClass) New() CNNDilatedPoolingMaxGradientNode { + rv := objc.Call[CNNDilatedPoolingMaxGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDilatedPoolingMaxGradientNode() CNNDilatedPoolingMaxGradientNode { + return CNNDilatedPoolingMaxGradientNodeClass.New() +} + +func (c_ CNNDilatedPoolingMaxGradientNode) Init() CNNDilatedPoolingMaxGradientNode { + rv := objc.Call[CNNDilatedPoolingMaxGradientNode](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNDilatedPoolingMaxGradientNode) InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNDilatedPoolingMaxGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNDilatedPoolingMaxGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948011-initwithsourcegradient?language=objc +func NewCNNDilatedPoolingMaxGradientNodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNDilatedPoolingMaxGradientNode { + instance := CNNDilatedPoolingMaxGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) + instance.Autorelease() + return instance +} + +func (cc _CNNDilatedPoolingMaxGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNDilatedPoolingMaxGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNDilatedPoolingMaxGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948045-nodewithsourcegradient?language=objc +func CNNDilatedPoolingMaxGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNDilatedPoolingMaxGradientNode { + return CNNDilatedPoolingMaxGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxgradientnode/2948037-dilationratey?language=objc +func (c_ CNNDilatedPoolingMaxGradientNode) DilationRateY() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxgradientnode/2947996-dilationratex?language=objc +func (c_ CNNDilatedPoolingMaxGradientNode) DilationRateX() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateX")) + return rv +} diff --git a/macos/mps/cnn_dilated_pooling_max_node.gen.go b/macos/mps/cnn_dilated_pooling_max_node.gen.go new file mode 100644 index 00000000..12746030 --- /dev/null +++ b/macos/mps/cnn_dilated_pooling_max_node.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDilatedPoolingMaxNode] class. +var CNNDilatedPoolingMaxNodeClass = _CNNDilatedPoolingMaxNodeClass{objc.GetClass("MPSCNNDilatedPoolingMaxNode")} + +type _CNNDilatedPoolingMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNDilatedPoolingMaxNode] class. +type ICNNDilatedPoolingMaxNode interface { + INNFilterNode + DilationRateY() uint + DilationRateX() uint +} + +// A representation of a dilated max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxnode?language=objc +type CNNDilatedPoolingMaxNode struct { + NNFilterNode +} + +func CNNDilatedPoolingMaxNodeFrom(ptr unsafe.Pointer) CNNDilatedPoolingMaxNode { + return CNNDilatedPoolingMaxNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNDilatedPoolingMaxNodeClass) NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNDilatedPoolingMaxNode { + rv := objc.Call[CNNDilatedPoolingMaxNode](cc, objc.Sel("nodeWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxnode/2873227-nodewithsource?language=objc +func CNNDilatedPoolingMaxNode_NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNDilatedPoolingMaxNode { + return CNNDilatedPoolingMaxNodeClass.NodeWithSourceFilterSize(sourceNode, size) +} + +func (c_ CNNDilatedPoolingMaxNode) InitWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNDilatedPoolingMaxNode { + rv := objc.Call[CNNDilatedPoolingMaxNode](c_, objc.Sel("initWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxnode/2873240-initwithsource?language=objc +func NewCNNDilatedPoolingMaxNodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNDilatedPoolingMaxNode { + instance := CNNDilatedPoolingMaxNodeClass.Alloc().InitWithSourceFilterSize(sourceNode, size) + instance.Autorelease() + return instance +} + +func (cc _CNNDilatedPoolingMaxNodeClass) Alloc() CNNDilatedPoolingMaxNode { + rv := objc.Call[CNNDilatedPoolingMaxNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNDilatedPoolingMaxNode_Alloc() CNNDilatedPoolingMaxNode { + return CNNDilatedPoolingMaxNodeClass.Alloc() +} + +func (cc _CNNDilatedPoolingMaxNodeClass) New() CNNDilatedPoolingMaxNode { + rv := objc.Call[CNNDilatedPoolingMaxNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDilatedPoolingMaxNode() CNNDilatedPoolingMaxNode { + return CNNDilatedPoolingMaxNodeClass.New() +} + +func (c_ CNNDilatedPoolingMaxNode) Init() CNNDilatedPoolingMaxNode { + rv := objc.Call[CNNDilatedPoolingMaxNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxnode/2887342-dilationratey?language=objc +func (c_ CNNDilatedPoolingMaxNode) DilationRateY() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndilatedpoolingmaxnode/2887341-dilationratex?language=objc +func (c_ CNNDilatedPoolingMaxNode) DilationRateX() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateX")) + return rv +} diff --git a/macos/mps/cnn_divide.gen.go b/macos/mps/cnn_divide.gen.go new file mode 100644 index 00000000..57db1abe --- /dev/null +++ b/macos/mps/cnn_divide.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDivide] class. +var CNNDivideClass = _CNNDivideClass{objc.GetClass("MPSCNNDivide")} + +type _CNNDivideClass struct { + objc.Class +} + +// An interface definition for the [CNNDivide] class. +type ICNNDivide interface { + ICNNArithmetic +} + +// A division operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndivide?language=objc +type CNNDivide struct { + CNNArithmetic +} + +func CNNDivideFrom(ptr unsafe.Pointer) CNNDivide { + return CNNDivide{ + CNNArithmetic: CNNArithmeticFrom(ptr), + } +} + +func (c_ CNNDivide) InitWithDevice(device metal.PDevice) CNNDivide { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDivide](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndivide/2942508-initwithdevice?language=objc +func NewCNNDivideWithDevice(device metal.PDevice) CNNDivide { + instance := CNNDivideClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNDivideClass) Alloc() CNNDivide { + rv := objc.Call[CNNDivide](cc, objc.Sel("alloc")) + return rv +} + +func CNNDivide_Alloc() CNNDivide { + return CNNDivideClass.Alloc() +} + +func (cc _CNNDivideClass) New() CNNDivide { + rv := objc.Call[CNNDivide](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDivide() CNNDivide { + return CNNDivideClass.New() +} + +func (c_ CNNDivide) Init() CNNDivide { + rv := objc.Call[CNNDivide](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNDivide) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDivide { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDivide](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNDivide_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDivide { + instance := CNNDivideClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_dropout.gen.go b/macos/mps/cnn_dropout.gen.go new file mode 100644 index 00000000..422239ec --- /dev/null +++ b/macos/mps/cnn_dropout.gen.go @@ -0,0 +1,132 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDropout] class. +var CNNDropoutClass = _CNNDropoutClass{objc.GetClass("MPSCNNDropout")} + +type _CNNDropoutClass struct { + objc.Class +} + +// An interface definition for the [CNNDropout] class. +type ICNNDropout interface { + ICNNKernel + KeepProbability() float64 + MaskStrideInPixels() metal.Size + Seed() uint +} + +// A dropout filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropout?language=objc +type CNNDropout struct { + CNNKernel +} + +func CNNDropoutFrom(ptr unsafe.Pointer) CNNDropout { + return CNNDropout{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNDropout) InitWithDeviceKeepProbabilitySeedMaskStrideInPixels(device metal.PDevice, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropout { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDropout](c_, objc.Sel("initWithDevice:keepProbability:seed:maskStrideInPixels:"), po0, keepProbability, seed, maskStrideInPixels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropout/2942522-initwithdevice?language=objc +func NewCNNDropoutWithDeviceKeepProbabilitySeedMaskStrideInPixels(device metal.PDevice, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropout { + instance := CNNDropoutClass.Alloc().InitWithDeviceKeepProbabilitySeedMaskStrideInPixels(device, keepProbability, seed, maskStrideInPixels) + instance.Autorelease() + return instance +} + +func (cc _CNNDropoutClass) Alloc() CNNDropout { + rv := objc.Call[CNNDropout](cc, objc.Sel("alloc")) + return rv +} + +func CNNDropout_Alloc() CNNDropout { + return CNNDropoutClass.Alloc() +} + +func (cc _CNNDropoutClass) New() CNNDropout { + rv := objc.Call[CNNDropout](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDropout() CNNDropout { + return CNNDropoutClass.New() +} + +func (c_ CNNDropout) Init() CNNDropout { + rv := objc.Call[CNNDropout](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNDropout) InitWithDevice(device metal.PDevice) CNNDropout { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDropout](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNDropoutWithDevice(device metal.PDevice) CNNDropout { + instance := CNNDropoutClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNDropout) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDropout { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDropout](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNDropout_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDropout { + instance := CNNDropoutClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropout/2942524-keepprobability?language=objc +func (c_ CNNDropout) KeepProbability() float64 { + rv := objc.Call[float64](c_, objc.Sel("keepProbability")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropout/2942519-maskstrideinpixels?language=objc +func (c_ CNNDropout) MaskStrideInPixels() metal.Size { + rv := objc.Call[metal.Size](c_, objc.Sel("maskStrideInPixels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropout/2942517-seed?language=objc +func (c_ CNNDropout) Seed() uint { + rv := objc.Call[uint](c_, objc.Sel("seed")) + return rv +} diff --git a/macos/mps/cnn_dropout_gradient.gen.go b/macos/mps/cnn_dropout_gradient.gen.go new file mode 100644 index 00000000..ef754a43 --- /dev/null +++ b/macos/mps/cnn_dropout_gradient.gen.go @@ -0,0 +1,132 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDropoutGradient] class. +var CNNDropoutGradientClass = _CNNDropoutGradientClass{objc.GetClass("MPSCNNDropoutGradient")} + +type _CNNDropoutGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNDropoutGradient] class. +type ICNNDropoutGradient interface { + ICNNGradientKernel + KeepProbability() float64 + MaskStrideInPixels() metal.Size + Seed() uint +} + +// A gradient dropout filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradient?language=objc +type CNNDropoutGradient struct { + CNNGradientKernel +} + +func CNNDropoutGradientFrom(ptr unsafe.Pointer) CNNDropoutGradient { + return CNNDropoutGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNDropoutGradient) InitWithDeviceKeepProbabilitySeedMaskStrideInPixels(device metal.PDevice, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropoutGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDropoutGradient](c_, objc.Sel("initWithDevice:keepProbability:seed:maskStrideInPixels:"), po0, keepProbability, seed, maskStrideInPixels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradient/2942518-initwithdevice?language=objc +func NewCNNDropoutGradientWithDeviceKeepProbabilitySeedMaskStrideInPixels(device metal.PDevice, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropoutGradient { + instance := CNNDropoutGradientClass.Alloc().InitWithDeviceKeepProbabilitySeedMaskStrideInPixels(device, keepProbability, seed, maskStrideInPixels) + instance.Autorelease() + return instance +} + +func (cc _CNNDropoutGradientClass) Alloc() CNNDropoutGradient { + rv := objc.Call[CNNDropoutGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNDropoutGradient_Alloc() CNNDropoutGradient { + return CNNDropoutGradientClass.Alloc() +} + +func (cc _CNNDropoutGradientClass) New() CNNDropoutGradient { + rv := objc.Call[CNNDropoutGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDropoutGradient() CNNDropoutGradient { + return CNNDropoutGradientClass.New() +} + +func (c_ CNNDropoutGradient) Init() CNNDropoutGradient { + rv := objc.Call[CNNDropoutGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNDropoutGradient) InitWithDevice(device metal.PDevice) CNNDropoutGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDropoutGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNDropoutGradientWithDevice(device metal.PDevice) CNNDropoutGradient { + instance := CNNDropoutGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNDropoutGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDropoutGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDropoutGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNDropoutGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNDropoutGradient { + instance := CNNDropoutGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradient/2942520-keepprobability?language=objc +func (c_ CNNDropoutGradient) KeepProbability() float64 { + rv := objc.Call[float64](c_, objc.Sel("keepProbability")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradient/2942515-maskstrideinpixels?language=objc +func (c_ CNNDropoutGradient) MaskStrideInPixels() metal.Size { + rv := objc.Call[metal.Size](c_, objc.Sel("maskStrideInPixels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradient/2942528-seed?language=objc +func (c_ CNNDropoutGradient) Seed() uint { + rv := objc.Call[uint](c_, objc.Sel("seed")) + return rv +} diff --git a/macos/mps/cnn_dropout_gradient_node.gen.go b/macos/mps/cnn_dropout_gradient_node.gen.go new file mode 100644 index 00000000..7b9198ff --- /dev/null +++ b/macos/mps/cnn_dropout_gradient_node.gen.go @@ -0,0 +1,112 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDropoutGradientNode] class. +var CNNDropoutGradientNodeClass = _CNNDropoutGradientNodeClass{objc.GetClass("MPSCNNDropoutGradientNode")} + +type _CNNDropoutGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNDropoutGradientNode] class. +type ICNNDropoutGradientNode interface { + INNGradientFilterNode + KeepProbability() float64 + MaskStrideInPixels() metal.Size + Seed() uint +} + +// A representation of a gradient dropout filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientnode?language=objc +type CNNDropoutGradientNode struct { + NNGradientFilterNode +} + +func CNNDropoutGradientNodeFrom(ptr unsafe.Pointer) CNNDropoutGradientNode { + return CNNDropoutGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNDropoutGradientNode) InitWithSourceGradientSourceImageGradientStateKeepProbabilitySeedMaskStrideInPixels(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropoutGradientNode { + rv := objc.Call[CNNDropoutGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:keepProbability:seed:maskStrideInPixels:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), keepProbability, seed, maskStrideInPixels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientnode/2948001-initwithsourcegradient?language=objc +func NewCNNDropoutGradientNodeWithSourceGradientSourceImageGradientStateKeepProbabilitySeedMaskStrideInPixels(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropoutGradientNode { + instance := CNNDropoutGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKeepProbabilitySeedMaskStrideInPixels(sourceGradient, sourceImage, gradientState, keepProbability, seed, maskStrideInPixels) + instance.Autorelease() + return instance +} + +func (cc _CNNDropoutGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKeepProbabilitySeedMaskStrideInPixels(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropoutGradientNode { + rv := objc.Call[CNNDropoutGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:keepProbability:seed:maskStrideInPixels:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), keepProbability, seed, maskStrideInPixels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientnode/2947997-nodewithsourcegradient?language=objc +func CNNDropoutGradientNode_NodeWithSourceGradientSourceImageGradientStateKeepProbabilitySeedMaskStrideInPixels(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, keepProbability float64, seed uint, maskStrideInPixels metal.Size) CNNDropoutGradientNode { + return CNNDropoutGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKeepProbabilitySeedMaskStrideInPixels(sourceGradient, sourceImage, gradientState, keepProbability, seed, maskStrideInPixels) +} + +func (cc _CNNDropoutGradientNodeClass) Alloc() CNNDropoutGradientNode { + rv := objc.Call[CNNDropoutGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNDropoutGradientNode_Alloc() CNNDropoutGradientNode { + return CNNDropoutGradientNodeClass.Alloc() +} + +func (cc _CNNDropoutGradientNodeClass) New() CNNDropoutGradientNode { + rv := objc.Call[CNNDropoutGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDropoutGradientNode() CNNDropoutGradientNode { + return CNNDropoutGradientNodeClass.New() +} + +func (c_ CNNDropoutGradientNode) Init() CNNDropoutGradientNode { + rv := objc.Call[CNNDropoutGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientnode/2947988-keepprobability?language=objc +func (c_ CNNDropoutGradientNode) KeepProbability() float64 { + rv := objc.Call[float64](c_, objc.Sel("keepProbability")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientnode/2947972-maskstrideinpixels?language=objc +func (c_ CNNDropoutGradientNode) MaskStrideInPixels() metal.Size { + rv := objc.Call[metal.Size](c_, objc.Sel("maskStrideInPixels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientnode/2948003-seed?language=objc +func (c_ CNNDropoutGradientNode) Seed() uint { + rv := objc.Call[uint](c_, objc.Sel("seed")) + return rv +} diff --git a/macos/mps/cnn_dropout_gradient_state.gen.go b/macos/mps/cnn_dropout_gradient_state.gen.go new file mode 100644 index 00000000..6dbc4872 --- /dev/null +++ b/macos/mps/cnn_dropout_gradient_state.gen.go @@ -0,0 +1,125 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDropoutGradientState] class. +var CNNDropoutGradientStateClass = _CNNDropoutGradientStateClass{objc.GetClass("MPSCNNDropoutGradientState")} + +type _CNNDropoutGradientStateClass struct { + objc.Class +} + +// An interface definition for the [CNNDropoutGradientState] class. +type ICNNDropoutGradientState interface { + INNGradientState + MaskData() []byte +} + +// A class that stores the mask used by dropout and gradient dropout filters. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientstate?language=objc +type CNNDropoutGradientState struct { + NNGradientState +} + +func CNNDropoutGradientStateFrom(ptr unsafe.Pointer) CNNDropoutGradientState { + return CNNDropoutGradientState{ + NNGradientState: NNGradientStateFrom(ptr), + } +} + +func (cc _CNNDropoutGradientStateClass) Alloc() CNNDropoutGradientState { + rv := objc.Call[CNNDropoutGradientState](cc, objc.Sel("alloc")) + return rv +} + +func CNNDropoutGradientState_Alloc() CNNDropoutGradientState { + return CNNDropoutGradientStateClass.Alloc() +} + +func (cc _CNNDropoutGradientStateClass) New() CNNDropoutGradientState { + rv := objc.Call[CNNDropoutGradientState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDropoutGradientState() CNNDropoutGradientState { + return CNNDropoutGradientStateClass.New() +} + +func (c_ CNNDropoutGradientState) Init() CNNDropoutGradientState { + rv := objc.Call[CNNDropoutGradientState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNDropoutGradientState) InitWithResources(resources []metal.PResource) CNNDropoutGradientState { + rv := objc.Call[CNNDropoutGradientState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNDropoutGradientStateWithResources(resources []metal.PResource) CNNDropoutGradientState { + instance := CNNDropoutGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNDropoutGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNDropoutGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNDropoutGradientState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNDropoutGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNDropoutGradientState { + instance := CNNDropoutGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNDropoutGradientState) InitWithResource(resource metal.PResource) CNNDropoutGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNDropoutGradientState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNDropoutGradientStateWithResource(resource metal.PResource) CNNDropoutGradientState { + instance := CNNDropoutGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNDropoutGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNDropoutGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNDropoutGradientState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNDropoutGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNDropoutGradientState { + return CNNDropoutGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutgradientstate/2942527-maskdata?language=objc +func (c_ CNNDropoutGradientState) MaskData() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("maskData")) + return rv +} diff --git a/macos/mps/cnn_dropout_node.gen.go b/macos/mps/cnn_dropout_node.gen.go new file mode 100644 index 00000000..098609c2 --- /dev/null +++ b/macos/mps/cnn_dropout_node.gen.go @@ -0,0 +1,112 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNDropoutNode] class. +var CNNDropoutNodeClass = _CNNDropoutNodeClass{objc.GetClass("MPSCNNDropoutNode")} + +type _CNNDropoutNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNDropoutNode] class. +type ICNNDropoutNode interface { + INNFilterNode + KeepProbability() float64 + MaskStrideInPixels() metal.Size + Seed() uint +} + +// A representation of a dropout filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutnode?language=objc +type CNNDropoutNode struct { + NNFilterNode +} + +func CNNDropoutNodeFrom(ptr unsafe.Pointer) CNNDropoutNode { + return CNNDropoutNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNDropoutNodeClass) NodeWithSource(source INNImageNode) CNNDropoutNode { + rv := objc.Call[CNNDropoutNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(source)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutnode/2948007-nodewithsource?language=objc +func CNNDropoutNode_NodeWithSource(source INNImageNode) CNNDropoutNode { + return CNNDropoutNodeClass.NodeWithSource(source) +} + +func (c_ CNNDropoutNode) InitWithSourceKeepProbability(source INNImageNode, keepProbability float64) CNNDropoutNode { + rv := objc.Call[CNNDropoutNode](c_, objc.Sel("initWithSource:keepProbability:"), objc.Ptr(source), keepProbability) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutnode/2948000-initwithsource?language=objc +func NewCNNDropoutNodeWithSourceKeepProbability(source INNImageNode, keepProbability float64) CNNDropoutNode { + instance := CNNDropoutNodeClass.Alloc().InitWithSourceKeepProbability(source, keepProbability) + instance.Autorelease() + return instance +} + +func (cc _CNNDropoutNodeClass) Alloc() CNNDropoutNode { + rv := objc.Call[CNNDropoutNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNDropoutNode_Alloc() CNNDropoutNode { + return CNNDropoutNodeClass.Alloc() +} + +func (cc _CNNDropoutNodeClass) New() CNNDropoutNode { + rv := objc.Call[CNNDropoutNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNDropoutNode() CNNDropoutNode { + return CNNDropoutNodeClass.New() +} + +func (c_ CNNDropoutNode) Init() CNNDropoutNode { + rv := objc.Call[CNNDropoutNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutnode/2947982-keepprobability?language=objc +func (c_ CNNDropoutNode) KeepProbability() float64 { + rv := objc.Call[float64](c_, objc.Sel("keepProbability")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutnode/2947998-maskstrideinpixels?language=objc +func (c_ CNNDropoutNode) MaskStrideInPixels() metal.Size { + rv := objc.Call[metal.Size](c_, objc.Sel("maskStrideInPixels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnndropoutnode/2948030-seed?language=objc +func (c_ CNNDropoutNode) Seed() uint { + rv := objc.Call[uint](c_, objc.Sel("seed")) + return rv +} diff --git a/macos/mps/cnn_fully_connected.gen.go b/macos/mps/cnn_fully_connected.gen.go new file mode 100644 index 00000000..d8728639 --- /dev/null +++ b/macos/mps/cnn_fully_connected.gen.go @@ -0,0 +1,106 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNFullyConnected] class. +var CNNFullyConnectedClass = _CNNFullyConnectedClass{objc.GetClass("MPSCNNFullyConnected")} + +type _CNNFullyConnectedClass struct { + objc.Class +} + +// An interface definition for the [CNNFullyConnected] class. +type ICNNFullyConnected interface { + ICNNConvolution +} + +// A fully connected convolution layer, also known as an inner product layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnected?language=objc +type CNNFullyConnected struct { + CNNConvolution +} + +func CNNFullyConnectedFrom(ptr unsafe.Pointer) CNNFullyConnected { + return CNNFullyConnected{ + CNNConvolution: CNNConvolutionFrom(ptr), + } +} + +func (c_ CNNFullyConnected) InitWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNFullyConnected { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNFullyConnected](c_, objc.Sel("initWithDevice:weights:"), po0, po1) + return rv +} + +// Initializes a fully connected convolution layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnected/2867198-initwithdevice?language=objc +func NewCNNFullyConnectedWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNFullyConnected { + instance := CNNFullyConnectedClass.Alloc().InitWithDeviceWeights(device, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNFullyConnectedClass) Alloc() CNNFullyConnected { + rv := objc.Call[CNNFullyConnected](cc, objc.Sel("alloc")) + return rv +} + +func CNNFullyConnected_Alloc() CNNFullyConnected { + return CNNFullyConnectedClass.Alloc() +} + +func (cc _CNNFullyConnectedClass) New() CNNFullyConnected { + rv := objc.Call[CNNFullyConnected](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNFullyConnected() CNNFullyConnected { + return CNNFullyConnectedClass.New() +} + +func (c_ CNNFullyConnected) Init() CNNFullyConnected { + rv := objc.Call[CNNFullyConnected](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNFullyConnected) InitWithDevice(device metal.PDevice) CNNFullyConnected { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNFullyConnected](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNFullyConnectedWithDevice(device metal.PDevice) CNNFullyConnected { + instance := CNNFullyConnectedClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNFullyConnected) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNFullyConnected { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNFullyConnected](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNFullyConnected_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNFullyConnected { + instance := CNNFullyConnectedClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_fully_connected_gradient.gen.go b/macos/mps/cnn_fully_connected_gradient.gen.go new file mode 100644 index 00000000..0104b183 --- /dev/null +++ b/macos/mps/cnn_fully_connected_gradient.gen.go @@ -0,0 +1,106 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNFullyConnectedGradient] class. +var CNNFullyConnectedGradientClass = _CNNFullyConnectedGradientClass{objc.GetClass("MPSCNNFullyConnectedGradient")} + +type _CNNFullyConnectedGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNFullyConnectedGradient] class. +type ICNNFullyConnectedGradient interface { + ICNNConvolutionGradient +} + +// A gradient fully connected convolution layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectedgradient?language=objc +type CNNFullyConnectedGradient struct { + CNNConvolutionGradient +} + +func CNNFullyConnectedGradientFrom(ptr unsafe.Pointer) CNNFullyConnectedGradient { + return CNNFullyConnectedGradient{ + CNNConvolutionGradient: CNNConvolutionGradientFrom(ptr), + } +} + +func (c_ CNNFullyConnectedGradient) InitWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNFullyConnectedGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNFullyConnectedGradient](c_, objc.Sel("initWithDevice:weights:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectedgradient/2951921-initwithdevice?language=objc +func NewCNNFullyConnectedGradientWithDeviceWeights(device metal.PDevice, weights PCNNConvolutionDataSource) CNNFullyConnectedGradient { + instance := CNNFullyConnectedGradientClass.Alloc().InitWithDeviceWeights(device, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNFullyConnectedGradientClass) Alloc() CNNFullyConnectedGradient { + rv := objc.Call[CNNFullyConnectedGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNFullyConnectedGradient_Alloc() CNNFullyConnectedGradient { + return CNNFullyConnectedGradientClass.Alloc() +} + +func (cc _CNNFullyConnectedGradientClass) New() CNNFullyConnectedGradient { + rv := objc.Call[CNNFullyConnectedGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNFullyConnectedGradient() CNNFullyConnectedGradient { + return CNNFullyConnectedGradientClass.New() +} + +func (c_ CNNFullyConnectedGradient) Init() CNNFullyConnectedGradient { + rv := objc.Call[CNNFullyConnectedGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNFullyConnectedGradient) InitWithDevice(device metal.PDevice) CNNFullyConnectedGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNFullyConnectedGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNFullyConnectedGradientWithDevice(device metal.PDevice) CNNFullyConnectedGradient { + instance := CNNFullyConnectedGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNFullyConnectedGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNFullyConnectedGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNFullyConnectedGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNFullyConnectedGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNFullyConnectedGradient { + instance := CNNFullyConnectedGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_fully_connected_gradient_node.gen.go b/macos/mps/cnn_fully_connected_gradient_node.gen.go new file mode 100644 index 00000000..adf871f0 --- /dev/null +++ b/macos/mps/cnn_fully_connected_gradient_node.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNFullyConnectedGradientNode] class. +var CNNFullyConnectedGradientNodeClass = _CNNFullyConnectedGradientNodeClass{objc.GetClass("MPSCNNFullyConnectedGradientNode")} + +type _CNNFullyConnectedGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNFullyConnectedGradientNode] class. +type ICNNFullyConnectedGradientNode interface { + ICNNConvolutionGradientNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectedgradientnode?language=objc +type CNNFullyConnectedGradientNode struct { + CNNConvolutionGradientNode +} + +func CNNFullyConnectedGradientNodeFrom(ptr unsafe.Pointer) CNNFullyConnectedGradientNode { + return CNNFullyConnectedGradientNode{ + CNNConvolutionGradientNode: CNNConvolutionGradientNodeFrom(ptr), + } +} + +func (c_ CNNFullyConnectedGradientNode) InitWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNFullyConnectedGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNFullyConnectedGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:convolutionGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectedgradientnode/3152566-initwithsourcegradient?language=objc +func NewCNNFullyConnectedGradientNodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNFullyConnectedGradientNode { + instance := CNNFullyConnectedGradientNodeClass.Alloc().InitWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNFullyConnectedGradientNodeClass) NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNFullyConnectedGradientNode { + po3 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNFullyConnectedGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:convolutionGradientState:weights:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), po3) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectedgradientnode/3152567-nodewithsourcegradient?language=objc +func CNNFullyConnectedGradientNode_NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState ICNNConvolutionGradientStateNode, weights PCNNConvolutionDataSource) CNNFullyConnectedGradientNode { + return CNNFullyConnectedGradientNodeClass.NodeWithSourceGradientSourceImageConvolutionGradientStateWeights(sourceGradient, sourceImage, gradientState, weights) +} + +func (cc _CNNFullyConnectedGradientNodeClass) Alloc() CNNFullyConnectedGradientNode { + rv := objc.Call[CNNFullyConnectedGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNFullyConnectedGradientNode_Alloc() CNNFullyConnectedGradientNode { + return CNNFullyConnectedGradientNodeClass.Alloc() +} + +func (cc _CNNFullyConnectedGradientNodeClass) New() CNNFullyConnectedGradientNode { + rv := objc.Call[CNNFullyConnectedGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNFullyConnectedGradientNode() CNNFullyConnectedGradientNode { + return CNNFullyConnectedGradientNodeClass.New() +} + +func (c_ CNNFullyConnectedGradientNode) Init() CNNFullyConnectedGradientNode { + rv := objc.Call[CNNFullyConnectedGradientNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_fully_connected_node.gen.go b/macos/mps/cnn_fully_connected_node.gen.go new file mode 100644 index 00000000..d0876682 --- /dev/null +++ b/macos/mps/cnn_fully_connected_node.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNFullyConnectedNode] class. +var CNNFullyConnectedNodeClass = _CNNFullyConnectedNodeClass{objc.GetClass("MPSCNNFullyConnectedNode")} + +type _CNNFullyConnectedNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNFullyConnectedNode] class. +type ICNNFullyConnectedNode interface { + ICNNConvolutionNode +} + +// A representation of a fully connected convolution layer, also known as an inner product layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectednode?language=objc +type CNNFullyConnectedNode struct { + CNNConvolutionNode +} + +func CNNFullyConnectedNodeFrom(ptr unsafe.Pointer) CNNFullyConnectedNode { + return CNNFullyConnectedNode{ + CNNConvolutionNode: CNNConvolutionNodeFrom(ptr), + } +} + +func (cc _CNNFullyConnectedNodeClass) NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNFullyConnectedNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNFullyConnectedNode](cc, objc.Sel("nodeWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectednode/2866458-nodewithsource?language=objc +func CNNFullyConnectedNode_NodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNFullyConnectedNode { + return CNNFullyConnectedNodeClass.NodeWithSourceWeights(sourceNode, weights) +} + +func (c_ CNNFullyConnectedNode) InitWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNFullyConnectedNode { + po1 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", weights) + rv := objc.Call[CNNFullyConnectedNode](c_, objc.Sel("initWithSource:weights:"), objc.Ptr(sourceNode), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnfullyconnectednode/2866412-initwithsource?language=objc +func NewCNNFullyConnectedNodeWithSourceWeights(sourceNode INNImageNode, weights PCNNConvolutionDataSource) CNNFullyConnectedNode { + instance := CNNFullyConnectedNodeClass.Alloc().InitWithSourceWeights(sourceNode, weights) + instance.Autorelease() + return instance +} + +func (cc _CNNFullyConnectedNodeClass) Alloc() CNNFullyConnectedNode { + rv := objc.Call[CNNFullyConnectedNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNFullyConnectedNode_Alloc() CNNFullyConnectedNode { + return CNNFullyConnectedNodeClass.Alloc() +} + +func (cc _CNNFullyConnectedNodeClass) New() CNNFullyConnectedNode { + rv := objc.Call[CNNFullyConnectedNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNFullyConnectedNode() CNNFullyConnectedNode { + return CNNFullyConnectedNodeClass.New() +} + +func (c_ CNNFullyConnectedNode) Init() CNNFullyConnectedNode { + rv := objc.Call[CNNFullyConnectedNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_gradient_kernel.gen.go b/macos/mps/cnn_gradient_kernel.gen.go new file mode 100644 index 00000000..47e56123 --- /dev/null +++ b/macos/mps/cnn_gradient_kernel.gen.go @@ -0,0 +1,163 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNGradientKernel] class. +var CNNGradientKernelClass = _CNNGradientKernelClass{objc.GetClass("MPSCNNGradientKernel")} + +type _CNNGradientKernelClass struct { + objc.Class +} + +// An interface definition for the [CNNGradientKernel] class. +type ICNNGradientKernel interface { + ICNNBinaryKernel + EncodeBatchToCommandBufferSourceGradientsSourceImagesGradientStates(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, gradientStates *foundation.Array) *foundation.Array + EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesGradientStates(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, gradientStates *foundation.Array) *foundation.Array + EncodeToCommandBufferSourceGradientSourceImageGradientState(commandBuffer metal.PCommandBuffer, sourceGradient IImage, sourceImage IImage, gradientState IState) Image + EncodeToCommandBufferObjectSourceGradientSourceImageGradientState(commandBufferObject objc.IObject, sourceGradient IImage, sourceImage IImage, gradientState IState) Image + KernelOffsetX() int + SetKernelOffsetX(value int) + KernelOffsetY() int + SetKernelOffsetY(value int) +} + +// The base class for gradient layers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel?language=objc +type CNNGradientKernel struct { + CNNBinaryKernel +} + +func CNNGradientKernelFrom(ptr unsafe.Pointer) CNNGradientKernel { + return CNNGradientKernel{ + CNNBinaryKernel: CNNBinaryKernelFrom(ptr), + } +} + +func (c_ CNNGradientKernel) InitWithDevice(device metal.PDevice) CNNGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNGradientKernel](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNGradientKernelWithDevice(device metal.PDevice) CNNGradientKernel { + instance := CNNGradientKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNGradientKernelClass) Alloc() CNNGradientKernel { + rv := objc.Call[CNNGradientKernel](cc, objc.Sel("alloc")) + return rv +} + +func CNNGradientKernel_Alloc() CNNGradientKernel { + return CNNGradientKernelClass.Alloc() +} + +func (cc _CNNGradientKernelClass) New() CNNGradientKernel { + rv := objc.Call[CNNGradientKernel](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNGradientKernel() CNNGradientKernel { + return CNNGradientKernelClass.New() +} + +func (c_ CNNGradientKernel) Init() CNNGradientKernel { + rv := objc.Call[CNNGradientKernel](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNGradientKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNGradientKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNGradientKernel](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNGradientKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNGradientKernel { + instance := CNNGradientKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942668-encodebatchtocommandbuffer?language=objc +func (c_ CNNGradientKernel) EncodeBatchToCommandBufferSourceGradientsSourceImagesGradientStates(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, gradientStates *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:gradientStates:"), po0, sourceGradients, sourceImages, gradientStates) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942668-encodebatchtocommandbuffer?language=objc +func (c_ CNNGradientKernel) EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesGradientStates(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, gradientStates *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:gradientStates:"), objc.Ptr(commandBufferObject), sourceGradients, sourceImages, gradientStates) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942663-encodetocommandbuffer?language=objc +func (c_ CNNGradientKernel) EncodeToCommandBufferSourceGradientSourceImageGradientState(commandBuffer metal.PCommandBuffer, sourceGradient IImage, sourceImage IImage, gradientState IState) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceGradient:sourceImage:gradientState:"), po0, objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942663-encodetocommandbuffer?language=objc +func (c_ CNNGradientKernel) EncodeToCommandBufferObjectSourceGradientSourceImageGradientState(commandBufferObject objc.IObject, sourceGradient IImage, sourceImage IImage, gradientState IState) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceGradient:sourceImage:gradientState:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942676-kerneloffsetx?language=objc +func (c_ CNNGradientKernel) KernelOffsetX() int { + rv := objc.Call[int](c_, objc.Sel("kernelOffsetX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942676-kerneloffsetx?language=objc +func (c_ CNNGradientKernel) SetKernelOffsetX(value int) { + objc.Call[objc.Void](c_, objc.Sel("setKernelOffsetX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942644-kerneloffsety?language=objc +func (c_ CNNGradientKernel) KernelOffsetY() int { + rv := objc.Call[int](c_, objc.Sel("kernelOffsetY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942644-kerneloffsety?language=objc +func (c_ CNNGradientKernel) SetKernelOffsetY(value int) { + objc.Call[objc.Void](c_, objc.Sel("setKernelOffsetY:"), value) +} diff --git a/macos/mps/cnn_group_normalization.gen.go b/macos/mps/cnn_group_normalization.gen.go new file mode 100644 index 00000000..267b35db --- /dev/null +++ b/macos/mps/cnn_group_normalization.gen.go @@ -0,0 +1,157 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNGroupNormalization] class. +var CNNGroupNormalizationClass = _CNNGroupNormalizationClass{objc.GetClass("MPSCNNGroupNormalization")} + +type _CNNGroupNormalizationClass struct { + objc.Class +} + +// An interface definition for the [CNNGroupNormalization] class. +type ICNNGroupNormalization interface { + ICNNKernel + ReloadGammaAndBetaFromDataSource() + ReloadGammaAndBetaWithCommandBufferGammaAndBetaState(commandBuffer metal.PCommandBuffer, gammaAndBetaState ICNNNormalizationGammaAndBetaState) + ReloadGammaAndBetaWithCommandBufferObjectGammaAndBetaState(commandBufferObject objc.IObject, gammaAndBetaState ICNNNormalizationGammaAndBetaState) + DataSource() CNNGroupNormalizationDataSourceWrapper + Epsilon() float64 + SetEpsilon(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization?language=objc +type CNNGroupNormalization struct { + CNNKernel +} + +func CNNGroupNormalizationFrom(ptr unsafe.Pointer) CNNGroupNormalization { + return CNNGroupNormalization{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNGroupNormalization) InitWithDeviceDataSource(device metal.PDevice, dataSource PCNNGroupNormalizationDataSource) CNNGroupNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNGroupNormalizationDataSource", dataSource) + rv := objc.Call[CNNGroupNormalization](c_, objc.Sel("initWithDevice:dataSource:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization/3152537-initwithdevice?language=objc +func NewCNNGroupNormalizationWithDeviceDataSource(device metal.PDevice, dataSource PCNNGroupNormalizationDataSource) CNNGroupNormalization { + instance := CNNGroupNormalizationClass.Alloc().InitWithDeviceDataSource(device, dataSource) + instance.Autorelease() + return instance +} + +func (cc _CNNGroupNormalizationClass) Alloc() CNNGroupNormalization { + rv := objc.Call[CNNGroupNormalization](cc, objc.Sel("alloc")) + return rv +} + +func CNNGroupNormalization_Alloc() CNNGroupNormalization { + return CNNGroupNormalizationClass.Alloc() +} + +func (cc _CNNGroupNormalizationClass) New() CNNGroupNormalization { + rv := objc.Call[CNNGroupNormalization](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNGroupNormalization() CNNGroupNormalization { + return CNNGroupNormalizationClass.New() +} + +func (c_ CNNGroupNormalization) Init() CNNGroupNormalization { + rv := objc.Call[CNNGroupNormalization](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNGroupNormalization) InitWithDevice(device metal.PDevice) CNNGroupNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNGroupNormalization](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNGroupNormalizationWithDevice(device metal.PDevice) CNNGroupNormalization { + instance := CNNGroupNormalizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNGroupNormalization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNGroupNormalization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNGroupNormalization](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNGroupNormalization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNGroupNormalization { + instance := CNNGroupNormalizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization/3152538-reloadgammaandbetafromdatasource?language=objc +func (c_ CNNGroupNormalization) ReloadGammaAndBetaFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization/3152539-reloadgammaandbetawithcommandbuf?language=objc +func (c_ CNNGroupNormalization) ReloadGammaAndBetaWithCommandBufferGammaAndBetaState(commandBuffer metal.PCommandBuffer, gammaAndBetaState ICNNNormalizationGammaAndBetaState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaWithCommandBuffer:gammaAndBetaState:"), po0, objc.Ptr(gammaAndBetaState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization/3152539-reloadgammaandbetawithcommandbuf?language=objc +func (c_ CNNGroupNormalization) ReloadGammaAndBetaWithCommandBufferObjectGammaAndBetaState(commandBufferObject objc.IObject, gammaAndBetaState ICNNNormalizationGammaAndBetaState) { + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaWithCommandBuffer:gammaAndBetaState:"), objc.Ptr(commandBufferObject), objc.Ptr(gammaAndBetaState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization/3152534-datasource?language=objc +func (c_ CNNGroupNormalization) DataSource() CNNGroupNormalizationDataSourceWrapper { + rv := objc.Call[CNNGroupNormalizationDataSourceWrapper](c_, objc.Sel("dataSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization/3152535-epsilon?language=objc +func (c_ CNNGroupNormalization) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalization/3152535-epsilon?language=objc +func (c_ CNNGroupNormalization) SetEpsilon(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setEpsilon:"), value) +} diff --git a/macos/mps/cnn_group_normalization_data_source.gen.go b/macos/mps/cnn_group_normalization_data_source.gen.go new file mode 100644 index 00000000..24ca5d78 --- /dev/null +++ b/macos/mps/cnn_group_normalization_data_source.gen.go @@ -0,0 +1,214 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource?language=objc +type PCNNGroupNormalizationDataSource interface { + // optional + UpdateGammaAndBetaWithCommandBufferGroupNormalizationStateBatch(commandBuffer metal.CommandBufferWrapper, groupNormalizationStateBatch *foundation.Array) ICNNNormalizationGammaAndBetaState + HasUpdateGammaAndBetaWithCommandBufferGroupNormalizationStateBatch() bool + + // optional + Beta() *float64 + HasBeta() bool + + // optional + Epsilon() float64 + HasEpsilon() bool + + // optional + EncodeWithCoder(aCoder foundation.Coder) + HasEncodeWithCoder() bool + + // optional + UpdateGammaAndBetaWithGroupNormalizationStateBatch(groupNormalizationStateBatch *foundation.Array) bool + HasUpdateGammaAndBetaWithGroupNormalizationStateBatch() bool + + // optional + InitWithCoder(aDecoder foundation.Coder) objc.IObject + HasInitWithCoder() bool + + // optional + Gamma() *float64 + HasGamma() bool + + // optional + CopyWithZoneDevice(zone unsafe.Pointer, device metal.DeviceWrapper) objc.IObject + HasCopyWithZoneDevice() bool + + // optional + Label() string + HasLabel() bool + + // optional + SetNumberOfGroups(value uint) + HasSetNumberOfGroups() bool + + // optional + NumberOfGroups() uint + HasNumberOfGroups() bool + + // optional + NumberOfFeatureChannels() uint + HasNumberOfFeatureChannels() bool +} + +// A concrete type wrapper for the [PCNNGroupNormalizationDataSource] protocol. +type CNNGroupNormalizationDataSourceWrapper struct { + objc.Object +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasUpdateGammaAndBetaWithCommandBufferGroupNormalizationStateBatch() bool { + return c_.RespondsToSelector(objc.Sel("updateGammaAndBetaWithCommandBuffer:groupNormalizationStateBatch:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152553-updategammaandbetawithcommandbuf?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) UpdateGammaAndBetaWithCommandBufferGroupNormalizationStateBatch(commandBuffer metal.PCommandBuffer, groupNormalizationStateBatch *foundation.Array) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("updateGammaAndBetaWithCommandBuffer:groupNormalizationStateBatch:"), po0, groupNormalizationStateBatch) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasBeta() bool { + return c_.RespondsToSelector(objc.Sel("beta")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152543-beta?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) Beta() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("beta")) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasEpsilon() bool { + return c_.RespondsToSelector(objc.Sel("epsilon")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152546-epsilon?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasEncodeWithCoder() bool { + return c_.RespondsToSelector(objc.Sel("encodeWithCoder:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152545-encodewithcoder?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) EncodeWithCoder(aCoder foundation.ICoder) { + objc.Call[objc.Void](c_, objc.Sel("encodeWithCoder:"), objc.Ptr(aCoder)) +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasUpdateGammaAndBetaWithGroupNormalizationStateBatch() bool { + return c_.RespondsToSelector(objc.Sel("updateGammaAndBetaWithGroupNormalizationStateBatch:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152554-updategammaandbetawithgroupnorma?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) UpdateGammaAndBetaWithGroupNormalizationStateBatch(groupNormalizationStateBatch *foundation.Array) bool { + rv := objc.Call[bool](c_, objc.Sel("updateGammaAndBetaWithGroupNormalizationStateBatch:"), groupNormalizationStateBatch) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasInitWithCoder() bool { + return c_.RespondsToSelector(objc.Sel("initWithCoder:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152548-initwithcoder?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) InitWithCoder(aDecoder foundation.ICoder) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("initWithCoder:"), objc.Ptr(aDecoder)) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasGamma() bool { + return c_.RespondsToSelector(objc.Sel("gamma")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152547-gamma?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) Gamma() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("gamma")) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasCopyWithZoneDevice() bool { + return c_.RespondsToSelector(objc.Sel("copyWithZone:device:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152544-copywithzone?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) objc.Object { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[objc.Object](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasLabel() bool { + return c_.RespondsToSelector(objc.Sel("label")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152549-label?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) Label() string { + rv := objc.Call[string](c_, objc.Sel("label")) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasSetNumberOfGroups() bool { + return c_.RespondsToSelector(objc.Sel("setNumberOfGroups:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152551-numberofgroups?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) SetNumberOfGroups(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setNumberOfGroups:"), value) +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasNumberOfGroups() bool { + return c_.RespondsToSelector(objc.Sel("numberOfGroups")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152551-numberofgroups?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) NumberOfGroups() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfGroups")) + return rv +} + +func (c_ CNNGroupNormalizationDataSourceWrapper) HasNumberOfFeatureChannels() bool { + return c_.RespondsToSelector(objc.Sel("numberOfFeatureChannels")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationdatasource/3152550-numberoffeaturechannels?language=objc +func (c_ CNNGroupNormalizationDataSourceWrapper) NumberOfFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfFeatureChannels")) + return rv +} diff --git a/macos/mps/cnn_group_normalization_gradient.gen.go b/macos/mps/cnn_group_normalization_gradient.gen.go new file mode 100644 index 00000000..91b8757f --- /dev/null +++ b/macos/mps/cnn_group_normalization_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNGroupNormalizationGradient] class. +var CNNGroupNormalizationGradientClass = _CNNGroupNormalizationGradientClass{objc.GetClass("MPSCNNGroupNormalizationGradient")} + +type _CNNGroupNormalizationGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNGroupNormalizationGradient] class. +type ICNNGroupNormalizationGradient interface { + ICNNGradientKernel +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradient?language=objc +type CNNGroupNormalizationGradient struct { + CNNGradientKernel +} + +func CNNGroupNormalizationGradientFrom(ptr unsafe.Pointer) CNNGroupNormalizationGradient { + return CNNGroupNormalizationGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (cc _CNNGroupNormalizationGradientClass) Alloc() CNNGroupNormalizationGradient { + rv := objc.Call[CNNGroupNormalizationGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNGroupNormalizationGradient_Alloc() CNNGroupNormalizationGradient { + return CNNGroupNormalizationGradientClass.Alloc() +} + +func (cc _CNNGroupNormalizationGradientClass) New() CNNGroupNormalizationGradient { + rv := objc.Call[CNNGroupNormalizationGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNGroupNormalizationGradient() CNNGroupNormalizationGradient { + return CNNGroupNormalizationGradientClass.New() +} + +func (c_ CNNGroupNormalizationGradient) Init() CNNGroupNormalizationGradient { + rv := objc.Call[CNNGroupNormalizationGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNGroupNormalizationGradient) InitWithDevice(device metal.PDevice) CNNGroupNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNGroupNormalizationGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNGroupNormalizationGradientWithDevice(device metal.PDevice) CNNGroupNormalizationGradient { + instance := CNNGroupNormalizationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNGroupNormalizationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNGroupNormalizationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNGroupNormalizationGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNGroupNormalizationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNGroupNormalizationGradient { + instance := CNNGroupNormalizationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_group_normalization_gradient_node.gen.go b/macos/mps/cnn_group_normalization_gradient_node.gen.go new file mode 100644 index 00000000..ae7834df --- /dev/null +++ b/macos/mps/cnn_group_normalization_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNGroupNormalizationGradientNode] class. +var CNNGroupNormalizationGradientNodeClass = _CNNGroupNormalizationGradientNodeClass{objc.GetClass("MPSCNNGroupNormalizationGradientNode")} + +type _CNNGroupNormalizationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNGroupNormalizationGradientNode] class. +type ICNNGroupNormalizationGradientNode interface { + INNGradientFilterNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientnode?language=objc +type CNNGroupNormalizationGradientNode struct { + NNGradientFilterNode +} + +func CNNGroupNormalizationGradientNodeFrom(ptr unsafe.Pointer) CNNGroupNormalizationGradientNode { + return CNNGroupNormalizationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNGroupNormalizationGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNGroupNormalizationGradientNode { + rv := objc.Call[CNNGroupNormalizationGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientnode/3152569-initwithsourcegradient?language=objc +func NewCNNGroupNormalizationGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNGroupNormalizationGradientNode { + instance := CNNGroupNormalizationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (cc _CNNGroupNormalizationGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNGroupNormalizationGradientNode { + rv := objc.Call[CNNGroupNormalizationGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientnode/3152570-nodewithsourcegradient?language=objc +func CNNGroupNormalizationGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNGroupNormalizationGradientNode { + return CNNGroupNormalizationGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (cc _CNNGroupNormalizationGradientNodeClass) Alloc() CNNGroupNormalizationGradientNode { + rv := objc.Call[CNNGroupNormalizationGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNGroupNormalizationGradientNode_Alloc() CNNGroupNormalizationGradientNode { + return CNNGroupNormalizationGradientNodeClass.Alloc() +} + +func (cc _CNNGroupNormalizationGradientNodeClass) New() CNNGroupNormalizationGradientNode { + rv := objc.Call[CNNGroupNormalizationGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNGroupNormalizationGradientNode() CNNGroupNormalizationGradientNode { + return CNNGroupNormalizationGradientNodeClass.New() +} + +func (c_ CNNGroupNormalizationGradientNode) Init() CNNGroupNormalizationGradientNode { + rv := objc.Call[CNNGroupNormalizationGradientNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_group_normalization_gradient_state.gen.go b/macos/mps/cnn_group_normalization_gradient_state.gen.go new file mode 100644 index 00000000..69a17167 --- /dev/null +++ b/macos/mps/cnn_group_normalization_gradient_state.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNGroupNormalizationGradientState] class. +var CNNGroupNormalizationGradientStateClass = _CNNGroupNormalizationGradientStateClass{objc.GetClass("MPSCNNGroupNormalizationGradientState")} + +type _CNNGroupNormalizationGradientStateClass struct { + objc.Class +} + +// An interface definition for the [CNNGroupNormalizationGradientState] class. +type ICNNGroupNormalizationGradientState interface { + INNGradientState + GroupNormalization() CNNGroupNormalization + GradientForGamma() metal.BufferWrapper + Beta() metal.BufferWrapper + Gamma() metal.BufferWrapper + GradientForBeta() metal.BufferWrapper +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientstate?language=objc +type CNNGroupNormalizationGradientState struct { + NNGradientState +} + +func CNNGroupNormalizationGradientStateFrom(ptr unsafe.Pointer) CNNGroupNormalizationGradientState { + return CNNGroupNormalizationGradientState{ + NNGradientState: NNGradientStateFrom(ptr), + } +} + +func (cc _CNNGroupNormalizationGradientStateClass) Alloc() CNNGroupNormalizationGradientState { + rv := objc.Call[CNNGroupNormalizationGradientState](cc, objc.Sel("alloc")) + return rv +} + +func CNNGroupNormalizationGradientState_Alloc() CNNGroupNormalizationGradientState { + return CNNGroupNormalizationGradientStateClass.Alloc() +} + +func (cc _CNNGroupNormalizationGradientStateClass) New() CNNGroupNormalizationGradientState { + rv := objc.Call[CNNGroupNormalizationGradientState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNGroupNormalizationGradientState() CNNGroupNormalizationGradientState { + return CNNGroupNormalizationGradientStateClass.New() +} + +func (c_ CNNGroupNormalizationGradientState) Init() CNNGroupNormalizationGradientState { + rv := objc.Call[CNNGroupNormalizationGradientState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNGroupNormalizationGradientState) InitWithResources(resources []metal.PResource) CNNGroupNormalizationGradientState { + rv := objc.Call[CNNGroupNormalizationGradientState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNGroupNormalizationGradientStateWithResources(resources []metal.PResource) CNNGroupNormalizationGradientState { + instance := CNNGroupNormalizationGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNGroupNormalizationGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNGroupNormalizationGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNGroupNormalizationGradientState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNGroupNormalizationGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNGroupNormalizationGradientState { + instance := CNNGroupNormalizationGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNGroupNormalizationGradientState) InitWithResource(resource metal.PResource) CNNGroupNormalizationGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNGroupNormalizationGradientState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNGroupNormalizationGradientStateWithResource(resource metal.PResource) CNNGroupNormalizationGradientState { + instance := CNNGroupNormalizationGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNGroupNormalizationGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNGroupNormalizationGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNGroupNormalizationGradientState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNGroupNormalizationGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNGroupNormalizationGradientState { + return CNNGroupNormalizationGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientstate/3152561-groupnormalization?language=objc +func (c_ CNNGroupNormalizationGradientState) GroupNormalization() CNNGroupNormalization { + rv := objc.Call[CNNGroupNormalization](c_, objc.Sel("groupNormalization")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientstate/3152560-gradientforgamma?language=objc +func (c_ CNNGroupNormalizationGradientState) GradientForGamma() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForGamma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientstate/3152557-beta?language=objc +func (c_ CNNGroupNormalizationGradientState) Beta() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientstate/3152558-gamma?language=objc +func (c_ CNNGroupNormalizationGradientState) Gamma() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gamma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationgradientstate/3152559-gradientforbeta?language=objc +func (c_ CNNGroupNormalizationGradientState) GradientForBeta() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForBeta")) + return rv +} diff --git a/macos/mps/cnn_group_normalization_node.gen.go b/macos/mps/cnn_group_normalization_node.gen.go new file mode 100644 index 00000000..de105e6e --- /dev/null +++ b/macos/mps/cnn_group_normalization_node.gen.go @@ -0,0 +1,103 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNGroupNormalizationNode] class. +var CNNGroupNormalizationNodeClass = _CNNGroupNormalizationNodeClass{objc.GetClass("MPSCNNGroupNormalizationNode")} + +type _CNNGroupNormalizationNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNGroupNormalizationNode] class. +type ICNNGroupNormalizationNode interface { + INNFilterNode + TrainingStyle() NNTrainingStyle + SetTrainingStyle(value NNTrainingStyle) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationnode?language=objc +type CNNGroupNormalizationNode struct { + NNFilterNode +} + +func CNNGroupNormalizationNodeFrom(ptr unsafe.Pointer) CNNGroupNormalizationNode { + return CNNGroupNormalizationNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNGroupNormalizationNodeClass) NodeWithSourceDataSource(source INNImageNode, dataSource PCNNGroupNormalizationDataSource) CNNGroupNormalizationNode { + po1 := objc.WrapAsProtocol("MPSCNNGroupNormalizationDataSource", dataSource) + rv := objc.Call[CNNGroupNormalizationNode](cc, objc.Sel("nodeWithSource:dataSource:"), objc.Ptr(source), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationnode/3152573-nodewithsource?language=objc +func CNNGroupNormalizationNode_NodeWithSourceDataSource(source INNImageNode, dataSource PCNNGroupNormalizationDataSource) CNNGroupNormalizationNode { + return CNNGroupNormalizationNodeClass.NodeWithSourceDataSource(source, dataSource) +} + +func (c_ CNNGroupNormalizationNode) InitWithSourceDataSource(source INNImageNode, dataSource PCNNGroupNormalizationDataSource) CNNGroupNormalizationNode { + po1 := objc.WrapAsProtocol("MPSCNNGroupNormalizationDataSource", dataSource) + rv := objc.Call[CNNGroupNormalizationNode](c_, objc.Sel("initWithSource:dataSource:"), objc.Ptr(source), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationnode/3152572-initwithsource?language=objc +func NewCNNGroupNormalizationNodeWithSourceDataSource(source INNImageNode, dataSource PCNNGroupNormalizationDataSource) CNNGroupNormalizationNode { + instance := CNNGroupNormalizationNodeClass.Alloc().InitWithSourceDataSource(source, dataSource) + instance.Autorelease() + return instance +} + +func (cc _CNNGroupNormalizationNodeClass) Alloc() CNNGroupNormalizationNode { + rv := objc.Call[CNNGroupNormalizationNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNGroupNormalizationNode_Alloc() CNNGroupNormalizationNode { + return CNNGroupNormalizationNodeClass.Alloc() +} + +func (cc _CNNGroupNormalizationNodeClass) New() CNNGroupNormalizationNode { + rv := objc.Call[CNNGroupNormalizationNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNGroupNormalizationNode() CNNGroupNormalizationNode { + return CNNGroupNormalizationNodeClass.New() +} + +func (c_ CNNGroupNormalizationNode) Init() CNNGroupNormalizationNode { + rv := objc.Call[CNNGroupNormalizationNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationnode/3197823-trainingstyle?language=objc +func (c_ CNNGroupNormalizationNode) TrainingStyle() NNTrainingStyle { + rv := objc.Call[NNTrainingStyle](c_, objc.Sel("trainingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngroupnormalizationnode/3197823-trainingstyle?language=objc +func (c_ CNNGroupNormalizationNode) SetTrainingStyle(value NNTrainingStyle) { + objc.Call[objc.Void](c_, objc.Sel("setTrainingStyle:"), value) +} diff --git a/macos/mps/cnn_instance_normalization.gen.go b/macos/mps/cnn_instance_normalization.gen.go new file mode 100644 index 00000000..8155197e --- /dev/null +++ b/macos/mps/cnn_instance_normalization.gen.go @@ -0,0 +1,157 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNInstanceNormalization] class. +var CNNInstanceNormalizationClass = _CNNInstanceNormalizationClass{objc.GetClass("MPSCNNInstanceNormalization")} + +type _CNNInstanceNormalizationClass struct { + objc.Class +} + +// An interface definition for the [CNNInstanceNormalization] class. +type ICNNInstanceNormalization interface { + ICNNKernel + ReloadGammaAndBetaFromDataSource() + ReloadGammaAndBetaWithCommandBufferGammaAndBetaState(commandBuffer metal.PCommandBuffer, gammaAndBetaState ICNNNormalizationGammaAndBetaState) + ReloadGammaAndBetaWithCommandBufferObjectGammaAndBetaState(commandBufferObject objc.IObject, gammaAndBetaState ICNNNormalizationGammaAndBetaState) + DataSource() CNNInstanceNormalizationDataSourceWrapper + Epsilon() float64 + SetEpsilon(value float64) +} + +// An instance normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization?language=objc +type CNNInstanceNormalization struct { + CNNKernel +} + +func CNNInstanceNormalizationFrom(ptr unsafe.Pointer) CNNInstanceNormalization { + return CNNInstanceNormalization{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNInstanceNormalization) InitWithDeviceDataSource(device metal.PDevice, dataSource PCNNInstanceNormalizationDataSource) CNNInstanceNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + po1 := objc.WrapAsProtocol("MPSCNNInstanceNormalizationDataSource", dataSource) + rv := objc.Call[CNNInstanceNormalization](c_, objc.Sel("initWithDevice:dataSource:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization/2947947-initwithdevice?language=objc +func NewCNNInstanceNormalizationWithDeviceDataSource(device metal.PDevice, dataSource PCNNInstanceNormalizationDataSource) CNNInstanceNormalization { + instance := CNNInstanceNormalizationClass.Alloc().InitWithDeviceDataSource(device, dataSource) + instance.Autorelease() + return instance +} + +func (cc _CNNInstanceNormalizationClass) Alloc() CNNInstanceNormalization { + rv := objc.Call[CNNInstanceNormalization](cc, objc.Sel("alloc")) + return rv +} + +func CNNInstanceNormalization_Alloc() CNNInstanceNormalization { + return CNNInstanceNormalizationClass.Alloc() +} + +func (cc _CNNInstanceNormalizationClass) New() CNNInstanceNormalization { + rv := objc.Call[CNNInstanceNormalization](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNInstanceNormalization() CNNInstanceNormalization { + return CNNInstanceNormalizationClass.New() +} + +func (c_ CNNInstanceNormalization) Init() CNNInstanceNormalization { + rv := objc.Call[CNNInstanceNormalization](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNInstanceNormalization) InitWithDevice(device metal.PDevice) CNNInstanceNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNInstanceNormalization](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNInstanceNormalizationWithDevice(device metal.PDevice) CNNInstanceNormalization { + instance := CNNInstanceNormalizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNInstanceNormalization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNInstanceNormalization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNInstanceNormalization](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNInstanceNormalization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNInstanceNormalization { + instance := CNNInstanceNormalizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization/2976471-reloadgammaandbetafromdatasource?language=objc +func (c_ CNNInstanceNormalization) ReloadGammaAndBetaFromDataSource() { + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaFromDataSource")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization/2953921-reloadgammaandbetawithcommandbuf?language=objc +func (c_ CNNInstanceNormalization) ReloadGammaAndBetaWithCommandBufferGammaAndBetaState(commandBuffer metal.PCommandBuffer, gammaAndBetaState ICNNNormalizationGammaAndBetaState) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaWithCommandBuffer:gammaAndBetaState:"), po0, objc.Ptr(gammaAndBetaState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization/2953921-reloadgammaandbetawithcommandbuf?language=objc +func (c_ CNNInstanceNormalization) ReloadGammaAndBetaWithCommandBufferObjectGammaAndBetaState(commandBufferObject objc.IObject, gammaAndBetaState ICNNNormalizationGammaAndBetaState) { + objc.Call[objc.Void](c_, objc.Sel("reloadGammaAndBetaWithCommandBuffer:gammaAndBetaState:"), objc.Ptr(commandBufferObject), objc.Ptr(gammaAndBetaState)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization/2953927-datasource?language=objc +func (c_ CNNInstanceNormalization) DataSource() CNNInstanceNormalizationDataSourceWrapper { + rv := objc.Call[CNNInstanceNormalizationDataSourceWrapper](c_, objc.Sel("dataSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization/2947943-epsilon?language=objc +func (c_ CNNInstanceNormalization) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalization/2947943-epsilon?language=objc +func (c_ CNNInstanceNormalization) SetEpsilon(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setEpsilon:"), value) +} diff --git a/macos/mps/cnn_instance_normalization_data_source.gen.go b/macos/mps/cnn_instance_normalization_data_source.gen.go new file mode 100644 index 00000000..2d553af1 --- /dev/null +++ b/macos/mps/cnn_instance_normalization_data_source.gen.go @@ -0,0 +1,214 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines methods that an instance normalization uses to initialize scale factors and bias terms. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource?language=objc +type PCNNInstanceNormalizationDataSource interface { + // optional + UpdateGammaAndBetaWithCommandBufferInstanceNormalizationStateBatch(commandBuffer metal.CommandBufferWrapper, instanceNormalizationStateBatch *foundation.Array) ICNNNormalizationGammaAndBetaState + HasUpdateGammaAndBetaWithCommandBufferInstanceNormalizationStateBatch() bool + + // optional + Beta() *float64 + HasBeta() bool + + // optional + Epsilon() float64 + HasEpsilon() bool + + // optional + EncodeWithCoder(aCoder foundation.Coder) + HasEncodeWithCoder() bool + + // optional + UpdateGammaAndBetaWithInstanceNormalizationStateBatch(instanceNormalizationStateBatch *foundation.Array) bool + HasUpdateGammaAndBetaWithInstanceNormalizationStateBatch() bool + + // optional + InitWithCoder(aDecoder foundation.Coder) objc.IObject + HasInitWithCoder() bool + + // optional + Gamma() *float64 + HasGamma() bool + + // optional + Purge() + HasPurge() bool + + // optional + CopyWithZoneDevice(zone unsafe.Pointer, device metal.DeviceWrapper) objc.IObject + HasCopyWithZoneDevice() bool + + // optional + Load() bool + HasLoad() bool + + // optional + Label() string + HasLabel() bool + + // optional + NumberOfFeatureChannels() uint + HasNumberOfFeatureChannels() bool +} + +// A concrete type wrapper for the [PCNNInstanceNormalizationDataSource] protocol. +type CNNInstanceNormalizationDataSourceWrapper struct { + objc.Object +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasUpdateGammaAndBetaWithCommandBufferInstanceNormalizationStateBatch() bool { + return c_.RespondsToSelector(objc.Sel("updateGammaAndBetaWithCommandBuffer:instanceNormalizationStateBatch:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2953926-updategammaandbetawithcommandbuf?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) UpdateGammaAndBetaWithCommandBufferInstanceNormalizationStateBatch(commandBuffer metal.PCommandBuffer, instanceNormalizationStateBatch *foundation.Array) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("updateGammaAndBetaWithCommandBuffer:instanceNormalizationStateBatch:"), po0, instanceNormalizationStateBatch) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasBeta() bool { + return c_.RespondsToSelector(objc.Sel("beta")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2953922-beta?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) Beta() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("beta")) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasEpsilon() bool { + return c_.RespondsToSelector(objc.Sel("epsilon")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2953925-epsilon?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasEncodeWithCoder() bool { + return c_.RespondsToSelector(objc.Sel("encodeWithCoder:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2947953-encodewithcoder?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) EncodeWithCoder(aCoder foundation.ICoder) { + objc.Call[objc.Void](c_, objc.Sel("encodeWithCoder:"), objc.Ptr(aCoder)) +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasUpdateGammaAndBetaWithInstanceNormalizationStateBatch() bool { + return c_.RespondsToSelector(objc.Sel("updateGammaAndBetaWithInstanceNormalizationStateBatch:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2953931-updategammaandbetawithinstanceno?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) UpdateGammaAndBetaWithInstanceNormalizationStateBatch(instanceNormalizationStateBatch *foundation.Array) bool { + rv := objc.Call[bool](c_, objc.Sel("updateGammaAndBetaWithInstanceNormalizationStateBatch:"), instanceNormalizationStateBatch) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasInitWithCoder() bool { + return c_.RespondsToSelector(objc.Sel("initWithCoder:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2947957-initwithcoder?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) InitWithCoder(aDecoder foundation.ICoder) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("initWithCoder:"), objc.Ptr(aDecoder)) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasGamma() bool { + return c_.RespondsToSelector(objc.Sel("gamma")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2953923-gamma?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) Gamma() *float64 { + rv := objc.Call[*float64](c_, objc.Sel("gamma")) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasPurge() bool { + return c_.RespondsToSelector(objc.Sel("purge")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/3088879-purge?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) Purge() { + objc.Call[objc.Void](c_, objc.Sel("purge")) +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasCopyWithZoneDevice() bool { + return c_.RespondsToSelector(objc.Sel("copyWithZone:device:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/3013780-copywithzone?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) objc.Object { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[objc.Object](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasLoad() bool { + return c_.RespondsToSelector(objc.Sel("load")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/3088878-load?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) Load() bool { + rv := objc.Call[bool](c_, objc.Sel("load")) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasLabel() bool { + return c_.RespondsToSelector(objc.Sel("label")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2952998-label?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) Label() string { + rv := objc.Call[string](c_, objc.Sel("label")) + return rv +} + +func (c_ CNNInstanceNormalizationDataSourceWrapper) HasNumberOfFeatureChannels() bool { + return c_.RespondsToSelector(objc.Sel("numberOfFeatureChannels")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationdatasource/2947961-numberoffeaturechannels?language=objc +func (c_ CNNInstanceNormalizationDataSourceWrapper) NumberOfFeatureChannels() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfFeatureChannels")) + return rv +} diff --git a/macos/mps/cnn_instance_normalization_gradient.gen.go b/macos/mps/cnn_instance_normalization_gradient.gen.go new file mode 100644 index 00000000..6f99091d --- /dev/null +++ b/macos/mps/cnn_instance_normalization_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNInstanceNormalizationGradient] class. +var CNNInstanceNormalizationGradientClass = _CNNInstanceNormalizationGradientClass{objc.GetClass("MPSCNNInstanceNormalizationGradient")} + +type _CNNInstanceNormalizationGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNInstanceNormalizationGradient] class. +type ICNNInstanceNormalizationGradient interface { + ICNNGradientKernel +} + +// A gradient instance normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradient?language=objc +type CNNInstanceNormalizationGradient struct { + CNNGradientKernel +} + +func CNNInstanceNormalizationGradientFrom(ptr unsafe.Pointer) CNNInstanceNormalizationGradient { + return CNNInstanceNormalizationGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (cc _CNNInstanceNormalizationGradientClass) Alloc() CNNInstanceNormalizationGradient { + rv := objc.Call[CNNInstanceNormalizationGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNInstanceNormalizationGradient_Alloc() CNNInstanceNormalizationGradient { + return CNNInstanceNormalizationGradientClass.Alloc() +} + +func (cc _CNNInstanceNormalizationGradientClass) New() CNNInstanceNormalizationGradient { + rv := objc.Call[CNNInstanceNormalizationGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNInstanceNormalizationGradient() CNNInstanceNormalizationGradient { + return CNNInstanceNormalizationGradientClass.New() +} + +func (c_ CNNInstanceNormalizationGradient) Init() CNNInstanceNormalizationGradient { + rv := objc.Call[CNNInstanceNormalizationGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNInstanceNormalizationGradient) InitWithDevice(device metal.PDevice) CNNInstanceNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNInstanceNormalizationGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNInstanceNormalizationGradientWithDevice(device metal.PDevice) CNNInstanceNormalizationGradient { + instance := CNNInstanceNormalizationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNInstanceNormalizationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNInstanceNormalizationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNInstanceNormalizationGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNInstanceNormalizationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNInstanceNormalizationGradient { + instance := CNNInstanceNormalizationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_instance_normalization_gradient_node.gen.go b/macos/mps/cnn_instance_normalization_gradient_node.gen.go new file mode 100644 index 00000000..523a825e --- /dev/null +++ b/macos/mps/cnn_instance_normalization_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNInstanceNormalizationGradientNode] class. +var CNNInstanceNormalizationGradientNodeClass = _CNNInstanceNormalizationGradientNodeClass{objc.GetClass("MPSCNNInstanceNormalizationGradientNode")} + +type _CNNInstanceNormalizationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNInstanceNormalizationGradientNode] class. +type ICNNInstanceNormalizationGradientNode interface { + INNGradientFilterNode +} + +// A representation of a gradient instance normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientnode?language=objc +type CNNInstanceNormalizationGradientNode struct { + NNGradientFilterNode +} + +func CNNInstanceNormalizationGradientNodeFrom(ptr unsafe.Pointer) CNNInstanceNormalizationGradientNode { + return CNNInstanceNormalizationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNInstanceNormalizationGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNInstanceNormalizationGradientNode { + rv := objc.Call[CNNInstanceNormalizationGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientnode/2951954-initwithsourcegradient?language=objc +func NewCNNInstanceNormalizationGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNInstanceNormalizationGradientNode { + instance := CNNInstanceNormalizationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (cc _CNNInstanceNormalizationGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNInstanceNormalizationGradientNode { + rv := objc.Call[CNNInstanceNormalizationGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientnode/2951932-nodewithsourcegradient?language=objc +func CNNInstanceNormalizationGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNInstanceNormalizationGradientNode { + return CNNInstanceNormalizationGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (cc _CNNInstanceNormalizationGradientNodeClass) Alloc() CNNInstanceNormalizationGradientNode { + rv := objc.Call[CNNInstanceNormalizationGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNInstanceNormalizationGradientNode_Alloc() CNNInstanceNormalizationGradientNode { + return CNNInstanceNormalizationGradientNodeClass.Alloc() +} + +func (cc _CNNInstanceNormalizationGradientNodeClass) New() CNNInstanceNormalizationGradientNode { + rv := objc.Call[CNNInstanceNormalizationGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNInstanceNormalizationGradientNode() CNNInstanceNormalizationGradientNode { + return CNNInstanceNormalizationGradientNodeClass.New() +} + +func (c_ CNNInstanceNormalizationGradientNode) Init() CNNInstanceNormalizationGradientNode { + rv := objc.Call[CNNInstanceNormalizationGradientNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_instance_normalization_gradient_state.gen.go b/macos/mps/cnn_instance_normalization_gradient_state.gen.go new file mode 100644 index 00000000..db68d43c --- /dev/null +++ b/macos/mps/cnn_instance_normalization_gradient_state.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNInstanceNormalizationGradientState] class. +var CNNInstanceNormalizationGradientStateClass = _CNNInstanceNormalizationGradientStateClass{objc.GetClass("MPSCNNInstanceNormalizationGradientState")} + +type _CNNInstanceNormalizationGradientStateClass struct { + objc.Class +} + +// An interface definition for the [CNNInstanceNormalizationGradientState] class. +type ICNNInstanceNormalizationGradientState interface { + INNGradientState + InstanceNormalization() CNNInstanceNormalization + GradientForGamma() metal.BufferWrapper + Beta() metal.BufferWrapper + Gamma() metal.BufferWrapper + GradientForBeta() metal.BufferWrapper +} + +// An object that stores information required to execute a gradient pass for instance normalization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientstate?language=objc +type CNNInstanceNormalizationGradientState struct { + NNGradientState +} + +func CNNInstanceNormalizationGradientStateFrom(ptr unsafe.Pointer) CNNInstanceNormalizationGradientState { + return CNNInstanceNormalizationGradientState{ + NNGradientState: NNGradientStateFrom(ptr), + } +} + +func (cc _CNNInstanceNormalizationGradientStateClass) Alloc() CNNInstanceNormalizationGradientState { + rv := objc.Call[CNNInstanceNormalizationGradientState](cc, objc.Sel("alloc")) + return rv +} + +func CNNInstanceNormalizationGradientState_Alloc() CNNInstanceNormalizationGradientState { + return CNNInstanceNormalizationGradientStateClass.Alloc() +} + +func (cc _CNNInstanceNormalizationGradientStateClass) New() CNNInstanceNormalizationGradientState { + rv := objc.Call[CNNInstanceNormalizationGradientState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNInstanceNormalizationGradientState() CNNInstanceNormalizationGradientState { + return CNNInstanceNormalizationGradientStateClass.New() +} + +func (c_ CNNInstanceNormalizationGradientState) Init() CNNInstanceNormalizationGradientState { + rv := objc.Call[CNNInstanceNormalizationGradientState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNInstanceNormalizationGradientState) InitWithResources(resources []metal.PResource) CNNInstanceNormalizationGradientState { + rv := objc.Call[CNNInstanceNormalizationGradientState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNInstanceNormalizationGradientStateWithResources(resources []metal.PResource) CNNInstanceNormalizationGradientState { + instance := CNNInstanceNormalizationGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNInstanceNormalizationGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNInstanceNormalizationGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNInstanceNormalizationGradientState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNInstanceNormalizationGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNInstanceNormalizationGradientState { + instance := CNNInstanceNormalizationGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNInstanceNormalizationGradientState) InitWithResource(resource metal.PResource) CNNInstanceNormalizationGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNInstanceNormalizationGradientState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNInstanceNormalizationGradientStateWithResource(resource metal.PResource) CNNInstanceNormalizationGradientState { + instance := CNNInstanceNormalizationGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNInstanceNormalizationGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNInstanceNormalizationGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNInstanceNormalizationGradientState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNInstanceNormalizationGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNInstanceNormalizationGradientState { + return CNNInstanceNormalizationGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientstate/2953924-instancenormalization?language=objc +func (c_ CNNInstanceNormalizationGradientState) InstanceNormalization() CNNInstanceNormalization { + rv := objc.Call[CNNInstanceNormalization](c_, objc.Sel("instanceNormalization")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientstate/2953928-gradientforgamma?language=objc +func (c_ CNNInstanceNormalizationGradientState) GradientForGamma() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForGamma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientstate/2956162-beta?language=objc +func (c_ CNNInstanceNormalizationGradientState) Beta() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientstate/2956161-gamma?language=objc +func (c_ CNNInstanceNormalizationGradientState) Gamma() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gamma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationgradientstate/2953930-gradientforbeta?language=objc +func (c_ CNNInstanceNormalizationGradientState) GradientForBeta() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gradientForBeta")) + return rv +} diff --git a/macos/mps/cnn_instance_normalization_node.gen.go b/macos/mps/cnn_instance_normalization_node.gen.go new file mode 100644 index 00000000..ff971540 --- /dev/null +++ b/macos/mps/cnn_instance_normalization_node.gen.go @@ -0,0 +1,103 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNInstanceNormalizationNode] class. +var CNNInstanceNormalizationNodeClass = _CNNInstanceNormalizationNodeClass{objc.GetClass("MPSCNNInstanceNormalizationNode")} + +type _CNNInstanceNormalizationNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNInstanceNormalizationNode] class. +type ICNNInstanceNormalizationNode interface { + INNFilterNode + TrainingStyle() NNTrainingStyle + SetTrainingStyle(value NNTrainingStyle) +} + +// A representation of an instance normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationnode?language=objc +type CNNInstanceNormalizationNode struct { + NNFilterNode +} + +func CNNInstanceNormalizationNodeFrom(ptr unsafe.Pointer) CNNInstanceNormalizationNode { + return CNNInstanceNormalizationNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNInstanceNormalizationNodeClass) NodeWithSourceDataSource(source INNImageNode, dataSource PCNNInstanceNormalizationDataSource) CNNInstanceNormalizationNode { + po1 := objc.WrapAsProtocol("MPSCNNInstanceNormalizationDataSource", dataSource) + rv := objc.Call[CNNInstanceNormalizationNode](cc, objc.Sel("nodeWithSource:dataSource:"), objc.Ptr(source), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationnode/2951941-nodewithsource?language=objc +func CNNInstanceNormalizationNode_NodeWithSourceDataSource(source INNImageNode, dataSource PCNNInstanceNormalizationDataSource) CNNInstanceNormalizationNode { + return CNNInstanceNormalizationNodeClass.NodeWithSourceDataSource(source, dataSource) +} + +func (c_ CNNInstanceNormalizationNode) InitWithSourceDataSource(source INNImageNode, dataSource PCNNInstanceNormalizationDataSource) CNNInstanceNormalizationNode { + po1 := objc.WrapAsProtocol("MPSCNNInstanceNormalizationDataSource", dataSource) + rv := objc.Call[CNNInstanceNormalizationNode](c_, objc.Sel("initWithSource:dataSource:"), objc.Ptr(source), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationnode/2951940-initwithsource?language=objc +func NewCNNInstanceNormalizationNodeWithSourceDataSource(source INNImageNode, dataSource PCNNInstanceNormalizationDataSource) CNNInstanceNormalizationNode { + instance := CNNInstanceNormalizationNodeClass.Alloc().InitWithSourceDataSource(source, dataSource) + instance.Autorelease() + return instance +} + +func (cc _CNNInstanceNormalizationNodeClass) Alloc() CNNInstanceNormalizationNode { + rv := objc.Call[CNNInstanceNormalizationNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNInstanceNormalizationNode_Alloc() CNNInstanceNormalizationNode { + return CNNInstanceNormalizationNodeClass.Alloc() +} + +func (cc _CNNInstanceNormalizationNodeClass) New() CNNInstanceNormalizationNode { + rv := objc.Call[CNNInstanceNormalizationNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNInstanceNormalizationNode() CNNInstanceNormalizationNode { + return CNNInstanceNormalizationNodeClass.New() +} + +func (c_ CNNInstanceNormalizationNode) Init() CNNInstanceNormalizationNode { + rv := objc.Call[CNNInstanceNormalizationNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationnode/3197824-trainingstyle?language=objc +func (c_ CNNInstanceNormalizationNode) TrainingStyle() NNTrainingStyle { + rv := objc.Call[NNTrainingStyle](c_, objc.Sel("trainingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnninstancenormalizationnode/3197824-trainingstyle?language=objc +func (c_ CNNInstanceNormalizationNode) SetTrainingStyle(value NNTrainingStyle) { + objc.Call[objc.Void](c_, objc.Sel("setTrainingStyle:"), value) +} diff --git a/macos/mps/cnn_kernel.gen.go b/macos/mps/cnn_kernel.gen.go new file mode 100644 index 00000000..1fb7b55b --- /dev/null +++ b/macos/mps/cnn_kernel.gen.go @@ -0,0 +1,456 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNKernel] class. +var CNNKernelClass = _CNNKernelClass{objc.GetClass("MPSCNNKernel")} + +type _CNNKernelClass struct { + objc.Class +} + +// An interface definition for the [CNNKernel] class. +type ICNNKernel interface { + IKernel + BatchEncodingStorageSizeForSourceImageSourceStatesDestinationImage(sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) uint + TemporaryResultStateForCommandBufferSourceImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage IImage, sourceStates []IState, destinationImage IImage) State + TemporaryResultStateForCommandBufferObjectSourceImageSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage IImage, sourceStates []IState, destinationImage IImage) State + AppendBatchBarrier() bool + TemporaryResultStateBatchForCommandBufferSourceImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + TemporaryResultStateBatchForCommandBufferObjectSourceImageSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + DestinationImageDescriptorForSourceImagesSourceStates(sourceImages []IImage, sourceStates []IState) ImageDescriptor + EncodingStorageSizeForSourceImageSourceStatesDestinationImage(sourceImage IImage, sourceStates []IState, destinationImage IImage) uint + EncodeBatchToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImages *foundation.Array) *foundation.Array + ResultStateBatchForSourceImageSourceStatesDestinationImage(sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + EncodeToCommandBufferSourceImage(commandBuffer metal.PCommandBuffer, sourceImage IImage) Image + EncodeToCommandBufferObjectSourceImage(commandBufferObject objc.IObject, sourceImage IImage) Image + IsResultStateReusedAcrossBatch() bool + ResultStateForSourceImageSourceStatesDestinationImage(sourceImage IImage, sourceStates []IState, destinationImage IImage) State + SourceFeatureChannelMaxCount() uint + SetSourceFeatureChannelMaxCount(value uint) + IsStateModified() bool + Padding() NNPaddingWrapper + SetPadding(value PNNPadding) + SetPaddingObject(valueObject objc.IObject) + SourceFeatureChannelOffset() uint + SetSourceFeatureChannelOffset(value uint) + StrideInPixelsY() uint + StrideInPixelsX() uint + EdgeMode() ImageEdgeMode + SetEdgeMode(value ImageEdgeMode) + Offset() Offset + SetOffset(value Offset) + IsBackwards() bool + DilationRateY() uint + KernelHeight() uint + ClipRect() metal.Region + SetClipRect(value metal.Region) + KernelWidth() uint + DestinationImageAllocator() ImageAllocatorWrapper + SetDestinationImageAllocator(value PImageAllocator) + SetDestinationImageAllocatorObject(valueObject objc.IObject) + DestinationFeatureChannelOffset() uint + SetDestinationFeatureChannelOffset(value uint) + DilationRateX() uint +} + +// Base class for neural network layers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel?language=objc +type CNNKernel struct { + Kernel +} + +func CNNKernelFrom(ptr unsafe.Pointer) CNNKernel { + return CNNKernel{ + Kernel: KernelFrom(ptr), + } +} + +func (c_ CNNKernel) InitWithDevice(device metal.PDevice) CNNKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNKernel](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNKernelWithDevice(device metal.PDevice) CNNKernel { + instance := CNNKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNKernelClass) Alloc() CNNKernel { + rv := objc.Call[CNNKernel](cc, objc.Sel("alloc")) + return rv +} + +func CNNKernel_Alloc() CNNKernel { + return CNNKernelClass.Alloc() +} + +func (cc _CNNKernelClass) New() CNNKernel { + rv := objc.Call[CNNKernel](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNKernel() CNNKernel { + return CNNKernelClass.New() +} + +func (c_ CNNKernel) Init() CNNKernel { + rv := objc.Call[CNNKernel](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNKernel](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNKernel { + instance := CNNKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/3237263-batchencodingstoragesizeforsourc?language=objc +func (c_ CNNKernel) BatchEncodingStorageSizeForSourceImageSourceStatesDestinationImage(sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) uint { + rv := objc.Call[uint](c_, objc.Sel("batchEncodingStorageSizeForSourceImage:sourceStates:destinationImage:"), sourceImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2947937-temporaryresultstateforcommandbu?language=objc +func (c_ CNNKernel) TemporaryResultStateForCommandBufferSourceImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage IImage, sourceStates []IState, destinationImage IImage) State { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[State](c_, objc.Sel("temporaryResultStateForCommandBuffer:sourceImage:sourceStates:destinationImage:"), po0, objc.Ptr(sourceImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2947937-temporaryresultstateforcommandbu?language=objc +func (c_ CNNKernel) TemporaryResultStateForCommandBufferObjectSourceImageSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage IImage, sourceStates []IState, destinationImage IImage) State { + rv := objc.Call[State](c_, objc.Sel("temporaryResultStateForCommandBuffer:sourceImage:sourceStates:destinationImage:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942671-appendbatchbarrier?language=objc +func (c_ CNNKernel) AppendBatchBarrier() bool { + rv := objc.Call[bool](c_, objc.Sel("appendBatchBarrier")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2947939-temporaryresultstatebatchforcomm?language=objc +func (c_ CNNKernel) TemporaryResultStateBatchForCommandBufferSourceImageSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("temporaryResultStateBatchForCommandBuffer:sourceImage:sourceStates:destinationImage:"), po0, sourceImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2947939-temporaryresultstatebatchforcomm?language=objc +func (c_ CNNKernel) TemporaryResultStateBatchForCommandBufferObjectSourceImageSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("temporaryResultStateBatchForCommandBuffer:sourceImage:sourceStates:destinationImage:"), objc.Ptr(commandBufferObject), sourceImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942661-destinationimagedescriptorforsou?language=objc +func (c_ CNNKernel) DestinationImageDescriptorForSourceImagesSourceStates(sourceImages []IImage, sourceStates []IState) ImageDescriptor { + rv := objc.Call[ImageDescriptor](c_, objc.Sel("destinationImageDescriptorForSourceImages:sourceStates:"), sourceImages, sourceStates) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/3237264-encodingstoragesizeforsourceimag?language=objc +func (c_ CNNKernel) EncodingStorageSizeForSourceImageSourceStatesDestinationImage(sourceImage IImage, sourceStates []IState, destinationImage IImage) uint { + rv := objc.Call[uint](c_, objc.Sel("encodingStorageSizeForSourceImage:sourceStates:destinationImage:"), objc.Ptr(sourceImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942651-encodebatchtocommandbuffer?language=objc +func (c_ CNNKernel) EncodeBatchToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:"), po0, sourceImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942651-encodebatchtocommandbuffer?language=objc +func (c_ CNNKernel) EncodeBatchToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImages *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:"), objc.Ptr(commandBufferObject), sourceImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2947931-resultstatebatchforsourceimage?language=objc +func (c_ CNNKernel) ResultStateBatchForSourceImageSourceStatesDestinationImage(sourceImage *foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("resultStateBatchForSourceImage:sourceStates:destinationImage:"), sourceImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865642-encodetocommandbuffer?language=objc +func (c_ CNNKernel) EncodeToCommandBufferSourceImage(commandBuffer metal.PCommandBuffer, sourceImage IImage) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:"), po0, objc.Ptr(sourceImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865642-encodetocommandbuffer?language=objc +func (c_ CNNKernel) EncodeToCommandBufferObjectSourceImage(commandBufferObject objc.IObject, sourceImage IImage) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942665-isresultstatereusedacrossbatch?language=objc +func (c_ CNNKernel) IsResultStateReusedAcrossBatch() bool { + rv := objc.Call[bool](c_, objc.Sel("isResultStateReusedAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2947932-resultstateforsourceimage?language=objc +func (c_ CNNKernel) ResultStateForSourceImageSourceStatesDestinationImage(sourceImage IImage, sourceStates []IState, destinationImage IImage) State { + rv := objc.Call[State](c_, objc.Sel("resultStateForSourceImage:sourceStates:destinationImage:"), objc.Ptr(sourceImage), sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2951917-sourcefeaturechannelmaxcount?language=objc +func (c_ CNNKernel) SourceFeatureChannelMaxCount() uint { + rv := objc.Call[uint](c_, objc.Sel("sourceFeatureChannelMaxCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2951917-sourcefeaturechannelmaxcount?language=objc +func (c_ CNNKernel) SetSourceFeatureChannelMaxCount(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSourceFeatureChannelMaxCount:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942673-isstatemodified?language=objc +func (c_ CNNKernel) IsStateModified() bool { + rv := objc.Call[bool](c_, objc.Sel("isStateModified")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865657-padding?language=objc +func (c_ CNNKernel) Padding() NNPaddingWrapper { + rv := objc.Call[NNPaddingWrapper](c_, objc.Sel("padding")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865657-padding?language=objc +func (c_ CNNKernel) SetPadding(value PNNPadding) { + po0 := objc.WrapAsProtocol("MPSNNPadding", value) + objc.Call[objc.Void](c_, objc.Sel("setPadding:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865657-padding?language=objc +func (c_ CNNKernel) SetPaddingObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setPadding:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942682-sourcefeaturechanneloffset?language=objc +func (c_ CNNKernel) SourceFeatureChannelOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("sourceFeatureChannelOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942682-sourcefeaturechanneloffset?language=objc +func (c_ CNNKernel) SetSourceFeatureChannelOffset(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSourceFeatureChannelOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865644-strideinpixelsy?language=objc +func (c_ CNNKernel) StrideInPixelsY() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865654-strideinpixelsx?language=objc +func (c_ CNNKernel) StrideInPixelsX() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsX")) + return rv +} + +// The edge mode to use when texture reads stray off the edge of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/1648826-edgemode?language=objc +func (c_ CNNKernel) EdgeMode() ImageEdgeMode { + rv := objc.Call[ImageEdgeMode](c_, objc.Sel("edgeMode")) + return rv +} + +// The edge mode to use when texture reads stray off the edge of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/1648826-edgemode?language=objc +func (c_ CNNKernel) SetEdgeMode(value ImageEdgeMode) { + objc.Call[objc.Void](c_, objc.Sel("setEdgeMode:"), value) +} + +// The position of the destination image's clip rectangle origin, relative to the source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/1648835-offset?language=objc +func (c_ CNNKernel) Offset() Offset { + rv := objc.Call[Offset](c_, objc.Sel("offset")) + return rv +} + +// The position of the destination image's clip rectangle origin, relative to the source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/1648835-offset?language=objc +func (c_ CNNKernel) SetOffset(value Offset) { + objc.Call[objc.Void](c_, objc.Sel("setOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865634-isbackwards?language=objc +func (c_ CNNKernel) IsBackwards() bool { + rv := objc.Call[bool](c_, objc.Sel("isBackwards")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942679-dilationratey?language=objc +func (c_ CNNKernel) DilationRateY() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865648-kernelheight?language=objc +func (c_ CNNKernel) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// An optional clip rectangle to use when writing data. Only the pixels in the clip rectangle will be overwritten. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/1648911-cliprect?language=objc +func (c_ CNNKernel) ClipRect() metal.Region { + rv := objc.Call[metal.Region](c_, objc.Sel("clipRect")) + return rv +} + +// An optional clip rectangle to use when writing data. Only the pixels in the clip rectangle will be overwritten. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/1648911-cliprect?language=objc +func (c_ CNNKernel) SetClipRect(value metal.Region) { + objc.Call[objc.Void](c_, objc.Sel("setClipRect:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865637-kernelwidth?language=objc +func (c_ CNNKernel) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865650-destinationimageallocator?language=objc +func (c_ CNNKernel) DestinationImageAllocator() ImageAllocatorWrapper { + rv := objc.Call[ImageAllocatorWrapper](c_, objc.Sel("destinationImageAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865650-destinationimageallocator?language=objc +func (c_ CNNKernel) SetDestinationImageAllocator(value PImageAllocator) { + po0 := objc.WrapAsProtocol("MPSImageAllocator", value) + objc.Call[objc.Void](c_, objc.Sel("setDestinationImageAllocator:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865650-destinationimageallocator?language=objc +func (c_ CNNKernel) SetDestinationImageAllocatorObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setDestinationImageAllocator:"), objc.Ptr(valueObject)) +} + +// The number of channels in the destination image to skip before writing output data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2097550-destinationfeaturechanneloffset?language=objc +func (c_ CNNKernel) DestinationFeatureChannelOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("destinationFeatureChannelOffset")) + return rv +} + +// The number of channels in the destination image to skip before writing output data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2097550-destinationfeaturechanneloffset?language=objc +func (c_ CNNKernel) SetDestinationFeatureChannelOffset(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setDestinationFeatureChannelOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2942669-dilationratex?language=objc +func (c_ CNNKernel) DilationRateX() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateX")) + return rv +} diff --git a/macos/mps/cnn_local_contrast_normalization.gen.go b/macos/mps/cnn_local_contrast_normalization.gen.go new file mode 100644 index 00000000..6fcce6a3 --- /dev/null +++ b/macos/mps/cnn_local_contrast_normalization.gen.go @@ -0,0 +1,207 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLocalContrastNormalization] class. +var CNNLocalContrastNormalizationClass = _CNNLocalContrastNormalizationClass{objc.GetClass("MPSCNNLocalContrastNormalization")} + +type _CNNLocalContrastNormalizationClass struct { + objc.Class +} + +// An interface definition for the [CNNLocalContrastNormalization] class. +type ICNNLocalContrastNormalization interface { + ICNNKernel + Ps() float64 + SetPs(value float64) + P0() float64 + SetP0(value float64) + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Pm() float64 + SetPm(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// A local-contrast normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization?language=objc +type CNNLocalContrastNormalization struct { + CNNKernel +} + +func CNNLocalContrastNormalizationFrom(ptr unsafe.Pointer) CNNLocalContrastNormalization { + return CNNLocalContrastNormalization{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNLocalContrastNormalization) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLocalContrastNormalization](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// Initializes a local contrast normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648924-initwithdevice?language=objc +func NewCNNLocalContrastNormalizationWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalization { + instance := CNNLocalContrastNormalizationClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (cc _CNNLocalContrastNormalizationClass) Alloc() CNNLocalContrastNormalization { + rv := objc.Call[CNNLocalContrastNormalization](cc, objc.Sel("alloc")) + return rv +} + +func CNNLocalContrastNormalization_Alloc() CNNLocalContrastNormalization { + return CNNLocalContrastNormalizationClass.Alloc() +} + +func (cc _CNNLocalContrastNormalizationClass) New() CNNLocalContrastNormalization { + rv := objc.Call[CNNLocalContrastNormalization](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLocalContrastNormalization() CNNLocalContrastNormalization { + return CNNLocalContrastNormalizationClass.New() +} + +func (c_ CNNLocalContrastNormalization) Init() CNNLocalContrastNormalization { + rv := objc.Call[CNNLocalContrastNormalization](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNLocalContrastNormalization) InitWithDevice(device metal.PDevice) CNNLocalContrastNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLocalContrastNormalization](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNLocalContrastNormalizationWithDevice(device metal.PDevice) CNNLocalContrastNormalization { + instance := CNNLocalContrastNormalizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNLocalContrastNormalization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLocalContrastNormalization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLocalContrastNormalization](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNLocalContrastNormalization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLocalContrastNormalization { + instance := CNNLocalContrastNormalizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The "ps" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648942-ps?language=objc +func (c_ CNNLocalContrastNormalization) Ps() float64 { + rv := objc.Call[float64](c_, objc.Sel("ps")) + return rv +} + +// The "ps" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648942-ps?language=objc +func (c_ CNNLocalContrastNormalization) SetPs(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPs:"), value) +} + +// The "p0" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648953-p0?language=objc +func (c_ CNNLocalContrastNormalization) P0() float64 { + rv := objc.Call[float64](c_, objc.Sel("p0")) + return rv +} + +// The "p0" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648953-p0?language=objc +func (c_ CNNLocalContrastNormalization) SetP0(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setP0:"), value) +} + +// The "beta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648905-beta?language=objc +func (c_ CNNLocalContrastNormalization) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// The "beta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648905-beta?language=objc +func (c_ CNNLocalContrastNormalization) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// The "delta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648812-delta?language=objc +func (c_ CNNLocalContrastNormalization) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// The "delta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648812-delta?language=objc +func (c_ CNNLocalContrastNormalization) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// The "pm" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648907-pm?language=objc +func (c_ CNNLocalContrastNormalization) Pm() float64 { + rv := objc.Call[float64](c_, objc.Sel("pm")) + return rv +} + +// The "pm" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648907-pm?language=objc +func (c_ CNNLocalContrastNormalization) SetPm(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPm:"), value) +} + +// The "alpha" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648923-alpha?language=objc +func (c_ CNNLocalContrastNormalization) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// The "alpha" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalization/1648923-alpha?language=objc +func (c_ CNNLocalContrastNormalization) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/cnn_local_contrast_normalization_gradient.gen.go b/macos/mps/cnn_local_contrast_normalization_gradient.gen.go new file mode 100644 index 00000000..69be2949 --- /dev/null +++ b/macos/mps/cnn_local_contrast_normalization_gradient.gen.go @@ -0,0 +1,207 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLocalContrastNormalizationGradient] class. +var CNNLocalContrastNormalizationGradientClass = _CNNLocalContrastNormalizationGradientClass{objc.GetClass("MPSCNNLocalContrastNormalizationGradient")} + +type _CNNLocalContrastNormalizationGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNLocalContrastNormalizationGradient] class. +type ICNNLocalContrastNormalizationGradient interface { + ICNNGradientKernel + Ps() float64 + SetPs(value float64) + P0() float64 + SetP0(value float64) + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Pm() float64 + SetPm(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// A gradient local-contrast normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient?language=objc +type CNNLocalContrastNormalizationGradient struct { + CNNGradientKernel +} + +func CNNLocalContrastNormalizationGradientFrom(ptr unsafe.Pointer) CNNLocalContrastNormalizationGradient { + return CNNLocalContrastNormalizationGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNLocalContrastNormalizationGradient) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLocalContrastNormalizationGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942462-initwithdevice?language=objc +func NewCNNLocalContrastNormalizationGradientWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalizationGradient { + instance := CNNLocalContrastNormalizationGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (cc _CNNLocalContrastNormalizationGradientClass) Alloc() CNNLocalContrastNormalizationGradient { + rv := objc.Call[CNNLocalContrastNormalizationGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNLocalContrastNormalizationGradient_Alloc() CNNLocalContrastNormalizationGradient { + return CNNLocalContrastNormalizationGradientClass.Alloc() +} + +func (cc _CNNLocalContrastNormalizationGradientClass) New() CNNLocalContrastNormalizationGradient { + rv := objc.Call[CNNLocalContrastNormalizationGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLocalContrastNormalizationGradient() CNNLocalContrastNormalizationGradient { + return CNNLocalContrastNormalizationGradientClass.New() +} + +func (c_ CNNLocalContrastNormalizationGradient) Init() CNNLocalContrastNormalizationGradient { + rv := objc.Call[CNNLocalContrastNormalizationGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNLocalContrastNormalizationGradient) InitWithDevice(device metal.PDevice) CNNLocalContrastNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLocalContrastNormalizationGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNLocalContrastNormalizationGradientWithDevice(device metal.PDevice) CNNLocalContrastNormalizationGradient { + instance := CNNLocalContrastNormalizationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNLocalContrastNormalizationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLocalContrastNormalizationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLocalContrastNormalizationGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNLocalContrastNormalizationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLocalContrastNormalizationGradient { + instance := CNNLocalContrastNormalizationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942466-ps?language=objc +func (c_ CNNLocalContrastNormalizationGradient) Ps() float64 { + rv := objc.Call[float64](c_, objc.Sel("ps")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942466-ps?language=objc +func (c_ CNNLocalContrastNormalizationGradient) SetPs(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPs:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942472-p0?language=objc +func (c_ CNNLocalContrastNormalizationGradient) P0() float64 { + rv := objc.Call[float64](c_, objc.Sel("p0")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942472-p0?language=objc +func (c_ CNNLocalContrastNormalizationGradient) SetP0(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setP0:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942484-beta?language=objc +func (c_ CNNLocalContrastNormalizationGradient) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942484-beta?language=objc +func (c_ CNNLocalContrastNormalizationGradient) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942482-delta?language=objc +func (c_ CNNLocalContrastNormalizationGradient) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942482-delta?language=objc +func (c_ CNNLocalContrastNormalizationGradient) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942485-pm?language=objc +func (c_ CNNLocalContrastNormalizationGradient) Pm() float64 { + rv := objc.Call[float64](c_, objc.Sel("pm")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942485-pm?language=objc +func (c_ CNNLocalContrastNormalizationGradient) SetPm(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPm:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942471-alpha?language=objc +func (c_ CNNLocalContrastNormalizationGradient) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradient/2942471-alpha?language=objc +func (c_ CNNLocalContrastNormalizationGradient) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/cnn_local_contrast_normalization_gradient_node.gen.go b/macos/mps/cnn_local_contrast_normalization_gradient_node.gen.go new file mode 100644 index 00000000..f966e5fe --- /dev/null +++ b/macos/mps/cnn_local_contrast_normalization_gradient_node.gen.go @@ -0,0 +1,204 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLocalContrastNormalizationGradientNode] class. +var CNNLocalContrastNormalizationGradientNodeClass = _CNNLocalContrastNormalizationGradientNodeClass{objc.GetClass("MPSCNNLocalContrastNormalizationGradientNode")} + +type _CNNLocalContrastNormalizationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNLocalContrastNormalizationGradientNode] class. +type ICNNLocalContrastNormalizationGradientNode interface { + INNGradientFilterNode + Ps() float64 + SetPs(value float64) + P0() float64 + SetP0(value float64) + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Pm() float64 + SetPm(value float64) + Alpha() float64 + SetAlpha(value float64) + KernelHeight() uint + KernelWidth() uint +} + +// A representation of a gradient local-contrast normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode?language=objc +type CNNLocalContrastNormalizationGradientNode struct { + NNGradientFilterNode +} + +func CNNLocalContrastNormalizationGradientNodeFrom(ptr unsafe.Pointer) CNNLocalContrastNormalizationGradientNode { + return CNNLocalContrastNormalizationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNLocalContrastNormalizationGradientNode) InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeight(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalizationGradientNode { + rv := objc.Call[CNNLocalContrastNormalizationGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948016-initwithsourcegradient?language=objc +func NewCNNLocalContrastNormalizationGradientNodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeight(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalizationGradientNode { + instance := CNNLocalContrastNormalizationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeight(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (cc _CNNLocalContrastNormalizationGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeight(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalizationGradientNode { + rv := objc.Call[CNNLocalContrastNormalizationGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948047-nodewithsourcegradient?language=objc +func CNNLocalContrastNormalizationGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeight(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint) CNNLocalContrastNormalizationGradientNode { + return CNNLocalContrastNormalizationGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeight(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight) +} + +func (cc _CNNLocalContrastNormalizationGradientNodeClass) Alloc() CNNLocalContrastNormalizationGradientNode { + rv := objc.Call[CNNLocalContrastNormalizationGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNLocalContrastNormalizationGradientNode_Alloc() CNNLocalContrastNormalizationGradientNode { + return CNNLocalContrastNormalizationGradientNodeClass.Alloc() +} + +func (cc _CNNLocalContrastNormalizationGradientNodeClass) New() CNNLocalContrastNormalizationGradientNode { + rv := objc.Call[CNNLocalContrastNormalizationGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLocalContrastNormalizationGradientNode() CNNLocalContrastNormalizationGradientNode { + return CNNLocalContrastNormalizationGradientNodeClass.New() +} + +func (c_ CNNLocalContrastNormalizationGradientNode) Init() CNNLocalContrastNormalizationGradientNode { + rv := objc.Call[CNNLocalContrastNormalizationGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948008-ps?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) Ps() float64 { + rv := objc.Call[float64](c_, objc.Sel("ps")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948008-ps?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) SetPs(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPs:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948017-p0?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) P0() float64 { + rv := objc.Call[float64](c_, objc.Sel("p0")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948017-p0?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) SetP0(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setP0:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2947977-beta?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2947977-beta?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948014-delta?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948014-delta?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948053-pm?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) Pm() float64 { + rv := objc.Call[float64](c_, objc.Sel("pm")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948053-pm?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) SetPm(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPm:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2947973-alpha?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2947973-alpha?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2948019-kernelheight?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationgradientnode/2947965-kernelwidth?language=objc +func (c_ CNNLocalContrastNormalizationGradientNode) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/cnn_local_contrast_normalization_node.gen.go b/macos/mps/cnn_local_contrast_normalization_node.gen.go new file mode 100644 index 00000000..8e8e82cf --- /dev/null +++ b/macos/mps/cnn_local_contrast_normalization_node.gen.go @@ -0,0 +1,181 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLocalContrastNormalizationNode] class. +var CNNLocalContrastNormalizationNodeClass = _CNNLocalContrastNormalizationNodeClass{objc.GetClass("MPSCNNLocalContrastNormalizationNode")} + +type _CNNLocalContrastNormalizationNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNLocalContrastNormalizationNode] class. +type ICNNLocalContrastNormalizationNode interface { + ICNNNormalizationNode + Ps() float64 + SetPs(value float64) + P0() float64 + SetP0(value float64) + Pm() float64 + SetPm(value float64) + KernelHeight() uint + SetKernelHeight(value uint) + KernelWidth() uint + SetKernelWidth(value uint) +} + +// A representation of a local-contrast normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode?language=objc +type CNNLocalContrastNormalizationNode struct { + CNNNormalizationNode +} + +func CNNLocalContrastNormalizationNodeFrom(ptr unsafe.Pointer) CNNLocalContrastNormalizationNode { + return CNNLocalContrastNormalizationNode{ + CNNNormalizationNode: CNNNormalizationNodeFrom(ptr), + } +} + +func (cc _CNNLocalContrastNormalizationNodeClass) NodeWithSourceKernelSize(sourceNode INNImageNode, kernelSize uint) CNNLocalContrastNormalizationNode { + rv := objc.Call[CNNLocalContrastNormalizationNode](cc, objc.Sel("nodeWithSource:kernelSize:"), objc.Ptr(sourceNode), kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866439-nodewithsource?language=objc +func CNNLocalContrastNormalizationNode_NodeWithSourceKernelSize(sourceNode INNImageNode, kernelSize uint) CNNLocalContrastNormalizationNode { + return CNNLocalContrastNormalizationNodeClass.NodeWithSourceKernelSize(sourceNode, kernelSize) +} + +func (c_ CNNLocalContrastNormalizationNode) InitWithSource(sourceNode INNImageNode) CNNLocalContrastNormalizationNode { + rv := objc.Call[CNNLocalContrastNormalizationNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866454-initwithsource?language=objc +func NewCNNLocalContrastNormalizationNodeWithSource(sourceNode INNImageNode) CNNLocalContrastNormalizationNode { + instance := CNNLocalContrastNormalizationNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNLocalContrastNormalizationNodeClass) Alloc() CNNLocalContrastNormalizationNode { + rv := objc.Call[CNNLocalContrastNormalizationNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNLocalContrastNormalizationNode_Alloc() CNNLocalContrastNormalizationNode { + return CNNLocalContrastNormalizationNodeClass.Alloc() +} + +func (cc _CNNLocalContrastNormalizationNodeClass) New() CNNLocalContrastNormalizationNode { + rv := objc.Call[CNNLocalContrastNormalizationNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLocalContrastNormalizationNode() CNNLocalContrastNormalizationNode { + return CNNLocalContrastNormalizationNodeClass.New() +} + +func (c_ CNNLocalContrastNormalizationNode) Init() CNNLocalContrastNormalizationNode { + rv := objc.Call[CNNLocalContrastNormalizationNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNLocalContrastNormalizationNodeClass) NodeWithSource(sourceNode INNImageNode) CNNLocalContrastNormalizationNode { + rv := objc.Call[CNNLocalContrastNormalizationNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866460-nodewithsource?language=objc +func CNNLocalContrastNormalizationNode_NodeWithSource(sourceNode INNImageNode) CNNLocalContrastNormalizationNode { + return CNNLocalContrastNormalizationNodeClass.NodeWithSource(sourceNode) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866500-ps?language=objc +func (c_ CNNLocalContrastNormalizationNode) Ps() float64 { + rv := objc.Call[float64](c_, objc.Sel("ps")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866500-ps?language=objc +func (c_ CNNLocalContrastNormalizationNode) SetPs(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPs:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866510-p0?language=objc +func (c_ CNNLocalContrastNormalizationNode) P0() float64 { + rv := objc.Call[float64](c_, objc.Sel("p0")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866510-p0?language=objc +func (c_ CNNLocalContrastNormalizationNode) SetP0(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setP0:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866404-pm?language=objc +func (c_ CNNLocalContrastNormalizationNode) Pm() float64 { + rv := objc.Call[float64](c_, objc.Sel("pm")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866404-pm?language=objc +func (c_ CNNLocalContrastNormalizationNode) SetPm(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setPm:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866485-kernelheight?language=objc +func (c_ CNNLocalContrastNormalizationNode) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866485-kernelheight?language=objc +func (c_ CNNLocalContrastNormalizationNode) SetKernelHeight(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelHeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866441-kernelwidth?language=objc +func (c_ CNNLocalContrastNormalizationNode) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlocalcontrastnormalizationnode/2866441-kernelwidth?language=objc +func (c_ CNNLocalContrastNormalizationNode) SetKernelWidth(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelWidth:"), value) +} diff --git a/macos/mps/cnn_log_soft_max.gen.go b/macos/mps/cnn_log_soft_max.gen.go new file mode 100644 index 00000000..50ad0889 --- /dev/null +++ b/macos/mps/cnn_log_soft_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLogSoftMax] class. +var CNNLogSoftMaxClass = _CNNLogSoftMaxClass{objc.GetClass("MPSCNNLogSoftMax")} + +type _CNNLogSoftMaxClass struct { + objc.Class +} + +// An interface definition for the [CNNLogSoftMax] class. +type ICNNLogSoftMax interface { + ICNNKernel +} + +// A neural transfer function that is useful for constructing a loss function to be minimized when training neural networks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmax?language=objc +type CNNLogSoftMax struct { + CNNKernel +} + +func CNNLogSoftMaxFrom(ptr unsafe.Pointer) CNNLogSoftMax { + return CNNLogSoftMax{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (cc _CNNLogSoftMaxClass) Alloc() CNNLogSoftMax { + rv := objc.Call[CNNLogSoftMax](cc, objc.Sel("alloc")) + return rv +} + +func CNNLogSoftMax_Alloc() CNNLogSoftMax { + return CNNLogSoftMaxClass.Alloc() +} + +func (cc _CNNLogSoftMaxClass) New() CNNLogSoftMax { + rv := objc.Call[CNNLogSoftMax](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLogSoftMax() CNNLogSoftMax { + return CNNLogSoftMaxClass.New() +} + +func (c_ CNNLogSoftMax) Init() CNNLogSoftMax { + rv := objc.Call[CNNLogSoftMax](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNLogSoftMax) InitWithDevice(device metal.PDevice) CNNLogSoftMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLogSoftMax](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNLogSoftMaxWithDevice(device metal.PDevice) CNNLogSoftMax { + instance := CNNLogSoftMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNLogSoftMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLogSoftMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLogSoftMax](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNLogSoftMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLogSoftMax { + instance := CNNLogSoftMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_log_soft_max_gradient.gen.go b/macos/mps/cnn_log_soft_max_gradient.gen.go new file mode 100644 index 00000000..cba90af4 --- /dev/null +++ b/macos/mps/cnn_log_soft_max_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLogSoftMaxGradient] class. +var CNNLogSoftMaxGradientClass = _CNNLogSoftMaxGradientClass{objc.GetClass("MPSCNNLogSoftMaxGradient")} + +type _CNNLogSoftMaxGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNLogSoftMaxGradient] class. +type ICNNLogSoftMaxGradient interface { + ICNNGradientKernel +} + +// A gradient logarithmic softmax filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxgradient?language=objc +type CNNLogSoftMaxGradient struct { + CNNGradientKernel +} + +func CNNLogSoftMaxGradientFrom(ptr unsafe.Pointer) CNNLogSoftMaxGradient { + return CNNLogSoftMaxGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNLogSoftMaxGradient) InitWithDevice(device metal.PDevice) CNNLogSoftMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLogSoftMaxGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxgradient/2942622-initwithdevice?language=objc +func NewCNNLogSoftMaxGradientWithDevice(device metal.PDevice) CNNLogSoftMaxGradient { + instance := CNNLogSoftMaxGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNLogSoftMaxGradientClass) Alloc() CNNLogSoftMaxGradient { + rv := objc.Call[CNNLogSoftMaxGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNLogSoftMaxGradient_Alloc() CNNLogSoftMaxGradient { + return CNNLogSoftMaxGradientClass.Alloc() +} + +func (cc _CNNLogSoftMaxGradientClass) New() CNNLogSoftMaxGradient { + rv := objc.Call[CNNLogSoftMaxGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLogSoftMaxGradient() CNNLogSoftMaxGradient { + return CNNLogSoftMaxGradientClass.New() +} + +func (c_ CNNLogSoftMaxGradient) Init() CNNLogSoftMaxGradient { + rv := objc.Call[CNNLogSoftMaxGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNLogSoftMaxGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLogSoftMaxGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLogSoftMaxGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNLogSoftMaxGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLogSoftMaxGradient { + instance := CNNLogSoftMaxGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_log_soft_max_gradient_node.gen.go b/macos/mps/cnn_log_soft_max_gradient_node.gen.go new file mode 100644 index 00000000..b7b31269 --- /dev/null +++ b/macos/mps/cnn_log_soft_max_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLogSoftMaxGradientNode] class. +var CNNLogSoftMaxGradientNodeClass = _CNNLogSoftMaxGradientNodeClass{objc.GetClass("MPSCNNLogSoftMaxGradientNode")} + +type _CNNLogSoftMaxGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNLogSoftMaxGradientNode] class. +type ICNNLogSoftMaxGradientNode interface { + INNGradientFilterNode +} + +// A representation of a gradient logarithmic softmax filter kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxgradientnode?language=objc +type CNNLogSoftMaxGradientNode struct { + NNGradientFilterNode +} + +func CNNLogSoftMaxGradientNodeFrom(ptr unsafe.Pointer) CNNLogSoftMaxGradientNode { + return CNNLogSoftMaxGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNLogSoftMaxGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNLogSoftMaxGradientNode { + rv := objc.Call[CNNLogSoftMaxGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxgradientnode/2947971-initwithsourcegradient?language=objc +func NewCNNLogSoftMaxGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNLogSoftMaxGradientNode { + instance := CNNLogSoftMaxGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (cc _CNNLogSoftMaxGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNLogSoftMaxGradientNode { + rv := objc.Call[CNNLogSoftMaxGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxgradientnode/2947974-nodewithsourcegradient?language=objc +func CNNLogSoftMaxGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNLogSoftMaxGradientNode { + return CNNLogSoftMaxGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (cc _CNNLogSoftMaxGradientNodeClass) Alloc() CNNLogSoftMaxGradientNode { + rv := objc.Call[CNNLogSoftMaxGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNLogSoftMaxGradientNode_Alloc() CNNLogSoftMaxGradientNode { + return CNNLogSoftMaxGradientNodeClass.Alloc() +} + +func (cc _CNNLogSoftMaxGradientNodeClass) New() CNNLogSoftMaxGradientNode { + rv := objc.Call[CNNLogSoftMaxGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLogSoftMaxGradientNode() CNNLogSoftMaxGradientNode { + return CNNLogSoftMaxGradientNodeClass.New() +} + +func (c_ CNNLogSoftMaxGradientNode) Init() CNNLogSoftMaxGradientNode { + rv := objc.Call[CNNLogSoftMaxGradientNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_log_soft_max_node.gen.go b/macos/mps/cnn_log_soft_max_node.gen.go new file mode 100644 index 00000000..24fb7f56 --- /dev/null +++ b/macos/mps/cnn_log_soft_max_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLogSoftMaxNode] class. +var CNNLogSoftMaxNodeClass = _CNNLogSoftMaxNodeClass{objc.GetClass("MPSCNNLogSoftMaxNode")} + +type _CNNLogSoftMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNLogSoftMaxNode] class. +type ICNNLogSoftMaxNode interface { + INNFilterNode +} + +// A representation of a logarithmic softmax filter kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxnode?language=objc +type CNNLogSoftMaxNode struct { + NNFilterNode +} + +func CNNLogSoftMaxNodeFrom(ptr unsafe.Pointer) CNNLogSoftMaxNode { + return CNNLogSoftMaxNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNLogSoftMaxNodeClass) NodeWithSource(sourceNode INNImageNode) CNNLogSoftMaxNode { + rv := objc.Call[CNNLogSoftMaxNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxnode/2866434-nodewithsource?language=objc +func CNNLogSoftMaxNode_NodeWithSource(sourceNode INNImageNode) CNNLogSoftMaxNode { + return CNNLogSoftMaxNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNLogSoftMaxNode) InitWithSource(sourceNode INNImageNode) CNNLogSoftMaxNode { + rv := objc.Call[CNNLogSoftMaxNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlogsoftmaxnode/2866457-initwithsource?language=objc +func NewCNNLogSoftMaxNodeWithSource(sourceNode INNImageNode) CNNLogSoftMaxNode { + instance := CNNLogSoftMaxNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNLogSoftMaxNodeClass) Alloc() CNNLogSoftMaxNode { + rv := objc.Call[CNNLogSoftMaxNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNLogSoftMaxNode_Alloc() CNNLogSoftMaxNode { + return CNNLogSoftMaxNodeClass.Alloc() +} + +func (cc _CNNLogSoftMaxNodeClass) New() CNNLogSoftMaxNode { + rv := objc.Call[CNNLogSoftMaxNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLogSoftMaxNode() CNNLogSoftMaxNode { + return CNNLogSoftMaxNodeClass.New() +} + +func (c_ CNNLogSoftMaxNode) Init() CNNLogSoftMaxNode { + rv := objc.Call[CNNLogSoftMaxNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_loss.gen.go b/macos/mps/cnn_loss.gen.go new file mode 100644 index 00000000..8a7c2f2e --- /dev/null +++ b/macos/mps/cnn_loss.gen.go @@ -0,0 +1,216 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLoss] class. +var CNNLossClass = _CNNLossClass{objc.GetClass("MPSCNNLoss")} + +type _CNNLossClass struct { + objc.Class +} + +// An interface definition for the [CNNLoss] class. +type ICNNLoss interface { + ICNNKernel + EncodeBatchToCommandBufferSourceImagesLabels(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImagesLabels(commandBufferObject objc.IObject, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array + EncodeToCommandBufferSourceImageLabels(commandBuffer metal.PCommandBuffer, sourceImage IImage, labels ICNNLossLabels) Image + EncodeToCommandBufferObjectSourceImageLabels(commandBufferObject objc.IObject, sourceImage IImage, labels ICNNLossLabels) Image + NumberOfClasses() uint + Weight() float64 + Epsilon() float64 + Delta() float64 + ReductionType() CNNReductionType + ReduceAcrossBatch() bool + LossType() CNNLossType + LabelSmoothing() float64 +} + +// A kernel that computes the loss and loss gradient between specified predictions and labels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss?language=objc +type CNNLoss struct { + CNNKernel +} + +func CNNLossFrom(ptr unsafe.Pointer) CNNLoss { + return CNNLoss{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNLoss) InitWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNLossDescriptor) CNNLoss { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLoss](c_, objc.Sel("initWithDevice:lossDescriptor:"), po0, objc.Ptr(lossDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942377-initwithdevice?language=objc +func NewCNNLossWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNLossDescriptor) CNNLoss { + instance := CNNLossClass.Alloc().InitWithDeviceLossDescriptor(device, lossDescriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNLossClass) Alloc() CNNLoss { + rv := objc.Call[CNNLoss](cc, objc.Sel("alloc")) + return rv +} + +func CNNLoss_Alloc() CNNLoss { + return CNNLossClass.Alloc() +} + +func (cc _CNNLossClass) New() CNNLoss { + rv := objc.Call[CNNLoss](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLoss() CNNLoss { + return CNNLossClass.New() +} + +func (c_ CNNLoss) Init() CNNLoss { + rv := objc.Call[CNNLoss](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNLoss) InitWithDevice(device metal.PDevice) CNNLoss { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLoss](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNLossWithDevice(device metal.PDevice) CNNLoss { + instance := CNNLossClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNLoss) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLoss { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLoss](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNLoss_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNLoss { + instance := CNNLossClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2951839-encodebatchtocommandbuffer?language=objc +func (c_ CNNLoss) EncodeBatchToCommandBufferSourceImagesLabels(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:labels:"), po0, sourceImage, labels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2951839-encodebatchtocommandbuffer?language=objc +func (c_ CNNLoss) EncodeBatchToCommandBufferObjectSourceImagesLabels(commandBufferObject objc.IObject, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:labels:"), objc.Ptr(commandBufferObject), sourceImage, labels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2951838-encodetocommandbuffer?language=objc +func (c_ CNNLoss) EncodeToCommandBufferSourceImageLabels(commandBuffer metal.PCommandBuffer, sourceImage IImage, labels ICNNLossLabels) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:labels:"), po0, objc.Ptr(sourceImage), objc.Ptr(labels)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2951838-encodetocommandbuffer?language=objc +func (c_ CNNLoss) EncodeToCommandBufferObjectSourceImageLabels(commandBufferObject objc.IObject, sourceImage IImage, labels ICNNLossLabels) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:labels:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), objc.Ptr(labels)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942389-numberofclasses?language=objc +func (c_ CNNLoss) NumberOfClasses() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfClasses")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942387-weight?language=objc +func (c_ CNNLoss) Weight() float64 { + rv := objc.Call[float64](c_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942371-epsilon?language=objc +func (c_ CNNLoss) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942360-delta?language=objc +func (c_ CNNLoss) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942365-reductiontype?language=objc +func (c_ CNNLoss) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](c_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/3547981-reduceacrossbatch?language=objc +func (c_ CNNLoss) ReduceAcrossBatch() bool { + rv := objc.Call[bool](c_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942359-losstype?language=objc +func (c_ CNNLoss) LossType() CNNLossType { + rv := objc.Call[CNNLossType](c_, objc.Sel("lossType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnloss/2942358-labelsmoothing?language=objc +func (c_ CNNLoss) LabelSmoothing() float64 { + rv := objc.Call[float64](c_, objc.Sel("labelSmoothing")) + return rv +} diff --git a/macos/mps/cnn_loss_data_descriptor.gen.go b/macos/mps/cnn_loss_data_descriptor.gen.go new file mode 100644 index 00000000..c4f205e9 --- /dev/null +++ b/macos/mps/cnn_loss_data_descriptor.gen.go @@ -0,0 +1,126 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLossDataDescriptor] class. +var CNNLossDataDescriptorClass = _CNNLossDataDescriptorClass{objc.GetClass("MPSCNNLossDataDescriptor")} + +type _CNNLossDataDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CNNLossDataDescriptor] class. +type ICNNLossDataDescriptor interface { + objc.IObject + BytesPerRow() uint + SetBytesPerRow(value uint) + BytesPerImage() uint + SetBytesPerImage(value uint) + Layout() DataLayout + Size() metal.Size +} + +// An object that specifies properties used by a loss data descriptor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor?language=objc +type CNNLossDataDescriptor struct { + objc.Object +} + +func CNNLossDataDescriptorFrom(ptr unsafe.Pointer) CNNLossDataDescriptor { + return CNNLossDataDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CNNLossDataDescriptorClass) Alloc() CNNLossDataDescriptor { + rv := objc.Call[CNNLossDataDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CNNLossDataDescriptor_Alloc() CNNLossDataDescriptor { + return CNNLossDataDescriptorClass.Alloc() +} + +func (cc _CNNLossDataDescriptorClass) New() CNNLossDataDescriptor { + rv := objc.Call[CNNLossDataDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLossDataDescriptor() CNNLossDataDescriptor { + return CNNLossDataDescriptorClass.New() +} + +func (c_ CNNLossDataDescriptor) Init() CNNLossDataDescriptor { + rv := objc.Call[CNNLossDataDescriptor](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951840-cnnlossdatadescriptorwithdata?language=objc +func (cc _CNNLossDataDescriptorClass) CnnLossDataDescriptorWithDataLayoutSize(data []byte, layout DataLayout, size metal.Size) CNNLossDataDescriptor { + rv := objc.Call[CNNLossDataDescriptor](cc, objc.Sel("cnnLossDataDescriptorWithData:layout:size:"), data, layout, size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951840-cnnlossdatadescriptorwithdata?language=objc +func CNNLossDataDescriptor_CnnLossDataDescriptorWithDataLayoutSize(data []byte, layout DataLayout, size metal.Size) CNNLossDataDescriptor { + return CNNLossDataDescriptorClass.CnnLossDataDescriptorWithDataLayoutSize(data, layout, size) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951849-bytesperrow?language=objc +func (c_ CNNLossDataDescriptor) BytesPerRow() uint { + rv := objc.Call[uint](c_, objc.Sel("bytesPerRow")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951849-bytesperrow?language=objc +func (c_ CNNLossDataDescriptor) SetBytesPerRow(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setBytesPerRow:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951847-bytesperimage?language=objc +func (c_ CNNLossDataDescriptor) BytesPerImage() uint { + rv := objc.Call[uint](c_, objc.Sel("bytesPerImage")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951847-bytesperimage?language=objc +func (c_ CNNLossDataDescriptor) SetBytesPerImage(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setBytesPerImage:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951842-layout?language=objc +func (c_ CNNLossDataDescriptor) Layout() DataLayout { + rv := objc.Call[DataLayout](c_, objc.Sel("layout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdatadescriptor/2951848-size?language=objc +func (c_ CNNLossDataDescriptor) Size() metal.Size { + rv := objc.Call[metal.Size](c_, objc.Sel("size")) + return rv +} diff --git a/macos/mps/cnn_loss_descriptor.gen.go b/macos/mps/cnn_loss_descriptor.gen.go new file mode 100644 index 00000000..3a006e42 --- /dev/null +++ b/macos/mps/cnn_loss_descriptor.gen.go @@ -0,0 +1,209 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLossDescriptor] class. +var CNNLossDescriptorClass = _CNNLossDescriptorClass{objc.GetClass("MPSCNNLossDescriptor")} + +type _CNNLossDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CNNLossDescriptor] class. +type ICNNLossDescriptor interface { + objc.IObject + NumberOfClasses() uint + SetNumberOfClasses(value uint) + Weight() float64 + SetWeight(value float64) + Epsilon() float64 + SetEpsilon(value float64) + Delta() float64 + SetDelta(value float64) + ReductionType() CNNReductionType + SetReductionType(value CNNReductionType) + ReduceAcrossBatch() bool + SetReduceAcrossBatch(value bool) + LossType() CNNLossType + SetLossType(value CNNLossType) + LabelSmoothing() float64 + SetLabelSmoothing(value float64) +} + +// An object that specifies properties used by a loss kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor?language=objc +type CNNLossDescriptor struct { + objc.Object +} + +func CNNLossDescriptorFrom(ptr unsafe.Pointer) CNNLossDescriptor { + return CNNLossDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CNNLossDescriptorClass) Alloc() CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CNNLossDescriptor_Alloc() CNNLossDescriptor { + return CNNLossDescriptorClass.Alloc() +} + +func (cc _CNNLossDescriptorClass) New() CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLossDescriptor() CNNLossDescriptor { + return CNNLossDescriptorClass.New() +} + +func (c_ CNNLossDescriptor) Init() CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942373-cnnlossdescriptorwithtype?language=objc +func (cc _CNNLossDescriptorClass) CnnLossDescriptorWithTypeReductionType(lossType CNNLossType, reductionType CNNReductionType) CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](cc, objc.Sel("cnnLossDescriptorWithType:reductionType:"), lossType, reductionType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942373-cnnlossdescriptorwithtype?language=objc +func CNNLossDescriptor_CnnLossDescriptorWithTypeReductionType(lossType CNNLossType, reductionType CNNReductionType) CNNLossDescriptor { + return CNNLossDescriptorClass.CnnLossDescriptorWithTypeReductionType(lossType, reductionType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942382-numberofclasses?language=objc +func (c_ CNNLossDescriptor) NumberOfClasses() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfClasses")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942382-numberofclasses?language=objc +func (c_ CNNLossDescriptor) SetNumberOfClasses(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setNumberOfClasses:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942367-weight?language=objc +func (c_ CNNLossDescriptor) Weight() float64 { + rv := objc.Call[float64](c_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942367-weight?language=objc +func (c_ CNNLossDescriptor) SetWeight(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setWeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942362-epsilon?language=objc +func (c_ CNNLossDescriptor) Epsilon() float64 { + rv := objc.Call[float64](c_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942362-epsilon?language=objc +func (c_ CNNLossDescriptor) SetEpsilon(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setEpsilon:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942378-delta?language=objc +func (c_ CNNLossDescriptor) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942378-delta?language=objc +func (c_ CNNLossDescriptor) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942388-reductiontype?language=objc +func (c_ CNNLossDescriptor) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](c_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942388-reductiontype?language=objc +func (c_ CNNLossDescriptor) SetReductionType(value CNNReductionType) { + objc.Call[objc.Void](c_, objc.Sel("setReductionType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/3547982-reduceacrossbatch?language=objc +func (c_ CNNLossDescriptor) ReduceAcrossBatch() bool { + rv := objc.Call[bool](c_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/3547982-reduceacrossbatch?language=objc +func (c_ CNNLossDescriptor) SetReduceAcrossBatch(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setReduceAcrossBatch:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942381-losstype?language=objc +func (c_ CNNLossDescriptor) LossType() CNNLossType { + rv := objc.Call[CNNLossType](c_, objc.Sel("lossType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942381-losstype?language=objc +func (c_ CNNLossDescriptor) SetLossType(value CNNLossType) { + objc.Call[objc.Void](c_, objc.Sel("setLossType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942369-labelsmoothing?language=objc +func (c_ CNNLossDescriptor) LabelSmoothing() float64 { + rv := objc.Call[float64](c_, objc.Sel("labelSmoothing")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossdescriptor/2942369-labelsmoothing?language=objc +func (c_ CNNLossDescriptor) SetLabelSmoothing(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setLabelSmoothing:"), value) +} diff --git a/macos/mps/cnn_loss_labels.gen.go b/macos/mps/cnn_loss_labels.gen.go new file mode 100644 index 00000000..e97df784 --- /dev/null +++ b/macos/mps/cnn_loss_labels.gen.go @@ -0,0 +1,158 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLossLabels] class. +var CNNLossLabelsClass = _CNNLossLabelsClass{objc.GetClass("MPSCNNLossLabels")} + +type _CNNLossLabelsClass struct { + objc.Class +} + +// An interface definition for the [CNNLossLabels] class. +type ICNNLossLabels interface { + IState + WeightsImage() Image + LossImage() Image + LabelsImage() Image +} + +// A class that stores the per-element weight buffer used by loss and gradient loss kernels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlosslabels?language=objc +type CNNLossLabels struct { + State +} + +func CNNLossLabelsFrom(ptr unsafe.Pointer) CNNLossLabels { + return CNNLossLabels{ + State: StateFrom(ptr), + } +} + +func (c_ CNNLossLabels) InitWithDeviceLabelsDescriptor(device metal.PDevice, labelsDescriptor ICNNLossDataDescriptor) CNNLossLabels { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLossLabels](c_, objc.Sel("initWithDevice:labelsDescriptor:"), po0, objc.Ptr(labelsDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlosslabels/2951850-initwithdevice?language=objc +func NewCNNLossLabelsWithDeviceLabelsDescriptor(device metal.PDevice, labelsDescriptor ICNNLossDataDescriptor) CNNLossLabels { + instance := CNNLossLabelsClass.Alloc().InitWithDeviceLabelsDescriptor(device, labelsDescriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNLossLabelsClass) Alloc() CNNLossLabels { + rv := objc.Call[CNNLossLabels](cc, objc.Sel("alloc")) + return rv +} + +func CNNLossLabels_Alloc() CNNLossLabels { + return CNNLossLabelsClass.Alloc() +} + +func (cc _CNNLossLabelsClass) New() CNNLossLabels { + rv := objc.Call[CNNLossLabels](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLossLabels() CNNLossLabels { + return CNNLossLabelsClass.New() +} + +func (c_ CNNLossLabels) Init() CNNLossLabels { + rv := objc.Call[CNNLossLabels](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNLossLabels) InitWithResources(resources []metal.PResource) CNNLossLabels { + rv := objc.Call[CNNLossLabels](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNLossLabelsWithResources(resources []metal.PResource) CNNLossLabels { + instance := CNNLossLabelsClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNLossLabels) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNLossLabels { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNLossLabels](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNLossLabelsWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNLossLabels { + instance := CNNLossLabelsClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNLossLabels) InitWithResource(resource metal.PResource) CNNLossLabels { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNLossLabels](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNLossLabelsWithResource(resource metal.PResource) CNNLossLabels { + instance := CNNLossLabelsClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNLossLabelsClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNLossLabels { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNLossLabels](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNLossLabels_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNLossLabels { + return CNNLossLabelsClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlosslabels/2976473-weightsimage?language=objc +func (c_ CNNLossLabels) WeightsImage() Image { + rv := objc.Call[Image](c_, objc.Sel("weightsImage")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlosslabels/2951845-lossimage?language=objc +func (c_ CNNLossLabels) LossImage() Image { + rv := objc.Call[Image](c_, objc.Sel("lossImage")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlosslabels/2976472-labelsimage?language=objc +func (c_ CNNLossLabels) LabelsImage() Image { + rv := objc.Call[Image](c_, objc.Sel("labelsImage")) + return rv +} diff --git a/macos/mps/cnn_loss_node.gen.go b/macos/mps/cnn_loss_node.gen.go new file mode 100644 index 00000000..45f11414 --- /dev/null +++ b/macos/mps/cnn_loss_node.gen.go @@ -0,0 +1,93 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNLossNode] class. +var CNNLossNodeClass = _CNNLossNodeClass{objc.GetClass("MPSCNNLossNode")} + +type _CNNLossNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNLossNode] class. +type ICNNLossNode interface { + INNFilterNode + InputLabels() NNLabelsNode +} + +// A representation of a loss kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossnode?language=objc +type CNNLossNode struct { + NNFilterNode +} + +func CNNLossNodeFrom(ptr unsafe.Pointer) CNNLossNode { + return CNNLossNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNLossNodeClass) NodeWithSourceLossDescriptor(source INNImageNode, descriptor ICNNLossDescriptor) CNNLossNode { + rv := objc.Call[CNNLossNode](cc, objc.Sel("nodeWithSource:lossDescriptor:"), objc.Ptr(source), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossnode/2951956-nodewithsource?language=objc +func CNNLossNode_NodeWithSourceLossDescriptor(source INNImageNode, descriptor ICNNLossDescriptor) CNNLossNode { + return CNNLossNodeClass.NodeWithSourceLossDescriptor(source, descriptor) +} + +func (c_ CNNLossNode) InitWithSourceLossDescriptor(source INNImageNode, descriptor ICNNLossDescriptor) CNNLossNode { + rv := objc.Call[CNNLossNode](c_, objc.Sel("initWithSource:lossDescriptor:"), objc.Ptr(source), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossnode/2951947-initwithsource?language=objc +func NewCNNLossNodeWithSourceLossDescriptor(source INNImageNode, descriptor ICNNLossDescriptor) CNNLossNode { + instance := CNNLossNodeClass.Alloc().InitWithSourceLossDescriptor(source, descriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNLossNodeClass) Alloc() CNNLossNode { + rv := objc.Call[CNNLossNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNLossNode_Alloc() CNNLossNode { + return CNNLossNodeClass.Alloc() +} + +func (cc _CNNLossNodeClass) New() CNNLossNode { + rv := objc.Call[CNNLossNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNLossNode() CNNLossNode { + return CNNLossNodeClass.New() +} + +func (c_ CNNLossNode) Init() CNNLossNode { + rv := objc.Call[CNNLossNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlossnode/2951942-inputlabels?language=objc +func (c_ CNNLossNode) InputLabels() NNLabelsNode { + rv := objc.Call[NNLabelsNode](c_, objc.Sel("inputLabels")) + return rv +} diff --git a/macos/mps/cnn_multiary_kernel.gen.go b/macos/mps/cnn_multiary_kernel.gen.go new file mode 100644 index 00000000..3f05b6ad --- /dev/null +++ b/macos/mps/cnn_multiary_kernel.gen.go @@ -0,0 +1,510 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNMultiaryKernel] class. +var CNNMultiaryKernelClass = _CNNMultiaryKernelClass{objc.GetClass("MPSCNNMultiaryKernel")} + +type _CNNMultiaryKernelClass struct { + objc.Class +} + +// An interface definition for the [CNNMultiaryKernel] class. +type ICNNMultiaryKernel interface { + IKernel + EdgeModeAtIndex(index uint) ImageEdgeMode + StrideInPixelsXatIndex(index uint) uint + TemporaryResultStateForCommandBufferSourceImagesSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage []IImage, sourceStates []IState, destinationImage IImage) State + TemporaryResultStateForCommandBufferObjectSourceImagesSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage []IImage, sourceStates []IState, destinationImage IImage) State + ResultStateForSourceImagesSourceStatesDestinationImage(sourceImages []IImage, sourceStates []IState, destinationImage IImage) State + AppendBatchBarrier() bool + TemporaryResultStateBatchForCommandBufferSourceImagesSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage []*foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + TemporaryResultStateBatchForCommandBufferObjectSourceImagesSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage []*foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + DestinationImageDescriptorForSourceImagesSourceStates(sourceImages []IImage, sourceStates []IState) ImageDescriptor + EncodeBatchToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImageBatches []*foundation.Array) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImageBatches []*foundation.Array) *foundation.Array + SetStrideInPixelsYAtIndex(stride uint, index uint) + SetKernelWidthAtIndex(width uint, index uint) + ResultStateBatchForSourceImagesSourceStatesDestinationImage(sourceImages []*foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array + SetOffsetAtIndex(offset Offset, index uint) + SetSourceFeatureChannelMaxCountAtIndex(count uint, index uint) + SetStrideInPixelsXAtIndex(stride uint, index uint) + DilationRateXatIndex(index uint) uint + SetDilationRateXAtIndex(dilationRate uint, index uint) + OffsetAtIndex(index uint) Offset + StrideInPixelsYatIndex(index uint) uint + SetDilationRateYAtIndex(dilationRate uint, index uint) + SourceFeatureChannelMaxCountAtIndex(index uint) uint + DilationRateYatIndex(index uint) uint + KernelWidthAtIndex(index uint) uint + EncodeToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImages []IImage) Image + EncodeToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImages []IImage) Image + SetKernelHeightAtIndex(height uint, index uint) + IsResultStateReusedAcrossBatch() bool + SetEdgeModeAtIndex(edgeMode ImageEdgeMode, index uint) + KernelHeightAtIndex(index uint) uint + SetSourceFeatureChannelOffsetAtIndex(offset uint, index uint) + SourceFeatureChannelOffsetAtIndex(index uint) uint + IsStateModified() bool + Padding() NNPaddingWrapper + SetPadding(value PNNPadding) + SetPaddingObject(valueObject objc.IObject) + SourceCount() uint + IsBackwards() bool + ClipRect() metal.Region + SetClipRect(value metal.Region) + DestinationImageAllocator() ImageAllocatorWrapper + SetDestinationImageAllocator(value PImageAllocator) + SetDestinationImageAllocatorObject(valueObject objc.IObject) + DestinationFeatureChannelOffset() uint + SetDestinationFeatureChannelOffset(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel?language=objc +type CNNMultiaryKernel struct { + Kernel +} + +func CNNMultiaryKernelFrom(ptr unsafe.Pointer) CNNMultiaryKernel { + return CNNMultiaryKernel{ + Kernel: KernelFrom(ptr), + } +} + +func (c_ CNNMultiaryKernel) InitWithDeviceSourceCount(device metal.PDevice, sourceCount uint) CNNMultiaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiaryKernel](c_, objc.Sel("initWithDevice:sourceCount:"), po0, sourceCount) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043426-initwithdevice?language=objc +func NewCNNMultiaryKernelWithDeviceSourceCount(device metal.PDevice, sourceCount uint) CNNMultiaryKernel { + instance := CNNMultiaryKernelClass.Alloc().InitWithDeviceSourceCount(device, sourceCount) + instance.Autorelease() + return instance +} + +func (cc _CNNMultiaryKernelClass) Alloc() CNNMultiaryKernel { + rv := objc.Call[CNNMultiaryKernel](cc, objc.Sel("alloc")) + return rv +} + +func CNNMultiaryKernel_Alloc() CNNMultiaryKernel { + return CNNMultiaryKernelClass.Alloc() +} + +func (cc _CNNMultiaryKernelClass) New() CNNMultiaryKernel { + rv := objc.Call[CNNMultiaryKernel](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNMultiaryKernel() CNNMultiaryKernel { + return CNNMultiaryKernelClass.New() +} + +func (c_ CNNMultiaryKernel) Init() CNNMultiaryKernel { + rv := objc.Call[CNNMultiaryKernel](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNMultiaryKernel) InitWithDevice(device metal.PDevice) CNNMultiaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiaryKernel](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewCNNMultiaryKernelWithDevice(device metal.PDevice) CNNMultiaryKernel { + instance := CNNMultiaryKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNMultiaryKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNMultiaryKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiaryKernel](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNMultiaryKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNMultiaryKernel { + instance := CNNMultiaryKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043418-edgemodeatindex?language=objc +func (c_ CNNMultiaryKernel) EdgeModeAtIndex(index uint) ImageEdgeMode { + rv := objc.Call[ImageEdgeMode](c_, objc.Sel("edgeModeAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043449-strideinpixelsxatindex?language=objc +func (c_ CNNMultiaryKernel) StrideInPixelsXatIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsXatIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043452-temporaryresultstateforcommandbu?language=objc +func (c_ CNNMultiaryKernel) TemporaryResultStateForCommandBufferSourceImagesSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage []IImage, sourceStates []IState, destinationImage IImage) State { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[State](c_, objc.Sel("temporaryResultStateForCommandBuffer:sourceImages:sourceStates:destinationImage:"), po0, sourceImage, sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043452-temporaryresultstateforcommandbu?language=objc +func (c_ CNNMultiaryKernel) TemporaryResultStateForCommandBufferObjectSourceImagesSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage []IImage, sourceStates []IState, destinationImage IImage) State { + rv := objc.Call[State](c_, objc.Sel("temporaryResultStateForCommandBuffer:sourceImages:sourceStates:destinationImage:"), objc.Ptr(commandBufferObject), sourceImage, sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043435-resultstateforsourceimages?language=objc +func (c_ CNNMultiaryKernel) ResultStateForSourceImagesSourceStatesDestinationImage(sourceImages []IImage, sourceStates []IState, destinationImage IImage) State { + rv := objc.Call[State](c_, objc.Sel("resultStateForSourceImages:sourceStates:destinationImage:"), sourceImages, sourceStates, objc.Ptr(destinationImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043411-appendbatchbarrier?language=objc +func (c_ CNNMultiaryKernel) AppendBatchBarrier() bool { + rv := objc.Call[bool](c_, objc.Sel("appendBatchBarrier")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043451-temporaryresultstatebatchforcomm?language=objc +func (c_ CNNMultiaryKernel) TemporaryResultStateBatchForCommandBufferSourceImagesSourceStatesDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage []*foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("temporaryResultStateBatchForCommandBuffer:sourceImages:sourceStates:destinationImage:"), po0, sourceImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043451-temporaryresultstatebatchforcomm?language=objc +func (c_ CNNMultiaryKernel) TemporaryResultStateBatchForCommandBufferObjectSourceImagesSourceStatesDestinationImage(commandBufferObject objc.IObject, sourceImage []*foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("temporaryResultStateBatchForCommandBuffer:sourceImages:sourceStates:destinationImage:"), objc.Ptr(commandBufferObject), sourceImage, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043415-destinationimagedescriptorforsou?language=objc +func (c_ CNNMultiaryKernel) DestinationImageDescriptorForSourceImagesSourceStates(sourceImages []IImage, sourceStates []IState) ImageDescriptor { + rv := objc.Call[ImageDescriptor](c_, objc.Sel("destinationImageDescriptorForSourceImages:sourceStates:"), sourceImages, sourceStates) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043419-encodebatchtocommandbuffer?language=objc +func (c_ CNNMultiaryKernel) EncodeBatchToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImageBatches []*foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:"), po0, sourceImageBatches) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043419-encodebatchtocommandbuffer?language=objc +func (c_ CNNMultiaryKernel) EncodeBatchToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImageBatches []*foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:"), objc.Ptr(commandBufferObject), sourceImageBatches) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043445-setstrideinpixelsy?language=objc +func (c_ CNNMultiaryKernel) SetStrideInPixelsYAtIndex(stride uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setStrideInPixelsY:atIndex:"), stride, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043440-setkernelwidth?language=objc +func (c_ CNNMultiaryKernel) SetKernelWidthAtIndex(width uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelWidth:atIndex:"), width, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043434-resultstatebatchforsourceimages?language=objc +func (c_ CNNMultiaryKernel) ResultStateBatchForSourceImagesSourceStatesDestinationImage(sourceImages []*foundation.Array, sourceStates []*foundation.Array, destinationImage *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("resultStateBatchForSourceImages:sourceStates:destinationImage:"), sourceImages, sourceStates, destinationImage) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043441-setoffset?language=objc +func (c_ CNNMultiaryKernel) SetOffsetAtIndex(offset Offset, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setOffset:atIndex:"), offset, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043442-setsourcefeaturechannelmaxcount?language=objc +func (c_ CNNMultiaryKernel) SetSourceFeatureChannelMaxCountAtIndex(count uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setSourceFeatureChannelMaxCount:atIndex:"), count, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043444-setstrideinpixelsx?language=objc +func (c_ CNNMultiaryKernel) SetStrideInPixelsXAtIndex(stride uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setStrideInPixelsX:atIndex:"), stride, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043416-dilationratexatindex?language=objc +func (c_ CNNMultiaryKernel) DilationRateXatIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateXatIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043436-setdilationratex?language=objc +func (c_ CNNMultiaryKernel) SetDilationRateXAtIndex(dilationRate uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setDilationRateX:atIndex:"), dilationRate, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043432-offsetatindex?language=objc +func (c_ CNNMultiaryKernel) OffsetAtIndex(index uint) Offset { + rv := objc.Call[Offset](c_, objc.Sel("offsetAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043450-strideinpixelsyatindex?language=objc +func (c_ CNNMultiaryKernel) StrideInPixelsYatIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsYatIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043437-setdilationratey?language=objc +func (c_ CNNMultiaryKernel) SetDilationRateYAtIndex(dilationRate uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setDilationRateY:atIndex:"), dilationRate, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043447-sourcefeaturechannelmaxcountatin?language=objc +func (c_ CNNMultiaryKernel) SourceFeatureChannelMaxCountAtIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("sourceFeatureChannelMaxCountAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043417-dilationrateyatindex?language=objc +func (c_ CNNMultiaryKernel) DilationRateYatIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateYatIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043431-kernelwidthatindex?language=objc +func (c_ CNNMultiaryKernel) KernelWidthAtIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidthAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043422-encodetocommandbuffer?language=objc +func (c_ CNNMultiaryKernel) EncodeToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImages []IImage) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImages:"), po0, sourceImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043422-encodetocommandbuffer?language=objc +func (c_ CNNMultiaryKernel) EncodeToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImages []IImage) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImages:"), objc.Ptr(commandBufferObject), sourceImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043439-setkernelheight?language=objc +func (c_ CNNMultiaryKernel) SetKernelHeightAtIndex(height uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelHeight:atIndex:"), height, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043428-isresultstatereusedacrossbatch?language=objc +func (c_ CNNMultiaryKernel) IsResultStateReusedAcrossBatch() bool { + rv := objc.Call[bool](c_, objc.Sel("isResultStateReusedAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043438-setedgemode?language=objc +func (c_ CNNMultiaryKernel) SetEdgeModeAtIndex(edgeMode ImageEdgeMode, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setEdgeMode:atIndex:"), edgeMode, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043430-kernelheightatindex?language=objc +func (c_ CNNMultiaryKernel) KernelHeightAtIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeightAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043443-setsourcefeaturechanneloffset?language=objc +func (c_ CNNMultiaryKernel) SetSourceFeatureChannelOffsetAtIndex(offset uint, index uint) { + objc.Call[objc.Void](c_, objc.Sel("setSourceFeatureChannelOffset:atIndex:"), offset, index) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043448-sourcefeaturechanneloffsetatinde?language=objc +func (c_ CNNMultiaryKernel) SourceFeatureChannelOffsetAtIndex(index uint) uint { + rv := objc.Call[uint](c_, objc.Sel("sourceFeatureChannelOffsetAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043429-isstatemodified?language=objc +func (c_ CNNMultiaryKernel) IsStateModified() bool { + rv := objc.Call[bool](c_, objc.Sel("isStateModified")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043433-padding?language=objc +func (c_ CNNMultiaryKernel) Padding() NNPaddingWrapper { + rv := objc.Call[NNPaddingWrapper](c_, objc.Sel("padding")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043433-padding?language=objc +func (c_ CNNMultiaryKernel) SetPadding(value PNNPadding) { + po0 := objc.WrapAsProtocol("MPSNNPadding", value) + objc.Call[objc.Void](c_, objc.Sel("setPadding:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043433-padding?language=objc +func (c_ CNNMultiaryKernel) SetPaddingObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setPadding:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043446-sourcecount?language=objc +func (c_ CNNMultiaryKernel) SourceCount() uint { + rv := objc.Call[uint](c_, objc.Sel("sourceCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043427-isbackwards?language=objc +func (c_ CNNMultiaryKernel) IsBackwards() bool { + rv := objc.Call[bool](c_, objc.Sel("isBackwards")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043412-cliprect?language=objc +func (c_ CNNMultiaryKernel) ClipRect() metal.Region { + rv := objc.Call[metal.Region](c_, objc.Sel("clipRect")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043412-cliprect?language=objc +func (c_ CNNMultiaryKernel) SetClipRect(value metal.Region) { + objc.Call[objc.Void](c_, objc.Sel("setClipRect:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043414-destinationimageallocator?language=objc +func (c_ CNNMultiaryKernel) DestinationImageAllocator() ImageAllocatorWrapper { + rv := objc.Call[ImageAllocatorWrapper](c_, objc.Sel("destinationImageAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043414-destinationimageallocator?language=objc +func (c_ CNNMultiaryKernel) SetDestinationImageAllocator(value PImageAllocator) { + po0 := objc.WrapAsProtocol("MPSImageAllocator", value) + objc.Call[objc.Void](c_, objc.Sel("setDestinationImageAllocator:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043414-destinationimageallocator?language=objc +func (c_ CNNMultiaryKernel) SetDestinationImageAllocatorObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setDestinationImageAllocator:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043413-destinationfeaturechanneloffset?language=objc +func (c_ CNNMultiaryKernel) DestinationFeatureChannelOffset() uint { + rv := objc.Call[uint](c_, objc.Sel("destinationFeatureChannelOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiarykernel/3043413-destinationfeaturechanneloffset?language=objc +func (c_ CNNMultiaryKernel) SetDestinationFeatureChannelOffset(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setDestinationFeatureChannelOffset:"), value) +} diff --git a/macos/mps/cnn_multiply.gen.go b/macos/mps/cnn_multiply.gen.go new file mode 100644 index 00000000..4b224272 --- /dev/null +++ b/macos/mps/cnn_multiply.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNMultiply] class. +var CNNMultiplyClass = _CNNMultiplyClass{objc.GetClass("MPSCNNMultiply")} + +type _CNNMultiplyClass struct { + objc.Class +} + +// An interface definition for the [CNNMultiply] class. +type ICNNMultiply interface { + ICNNArithmetic +} + +// A multiply operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiply?language=objc +type CNNMultiply struct { + CNNArithmetic +} + +func CNNMultiplyFrom(ptr unsafe.Pointer) CNNMultiply { + return CNNMultiply{ + CNNArithmetic: CNNArithmeticFrom(ptr), + } +} + +func (c_ CNNMultiply) InitWithDevice(device metal.PDevice) CNNMultiply { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiply](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiply/2942507-initwithdevice?language=objc +func NewCNNMultiplyWithDevice(device metal.PDevice) CNNMultiply { + instance := CNNMultiplyClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNMultiplyClass) Alloc() CNNMultiply { + rv := objc.Call[CNNMultiply](cc, objc.Sel("alloc")) + return rv +} + +func CNNMultiply_Alloc() CNNMultiply { + return CNNMultiplyClass.Alloc() +} + +func (cc _CNNMultiplyClass) New() CNNMultiply { + rv := objc.Call[CNNMultiply](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNMultiply() CNNMultiply { + return CNNMultiplyClass.New() +} + +func (c_ CNNMultiply) Init() CNNMultiply { + rv := objc.Call[CNNMultiply](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNMultiply) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNMultiply { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiply](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNMultiply_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNMultiply { + instance := CNNMultiplyClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_multiply_gradient.gen.go b/macos/mps/cnn_multiply_gradient.gen.go new file mode 100644 index 00000000..3f3ff10f --- /dev/null +++ b/macos/mps/cnn_multiply_gradient.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNMultiplyGradient] class. +var CNNMultiplyGradientClass = _CNNMultiplyGradientClass{objc.GetClass("MPSCNNMultiplyGradient")} + +type _CNNMultiplyGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNMultiplyGradient] class. +type ICNNMultiplyGradient interface { + ICNNArithmeticGradient +} + +// A gradient multiply operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiplygradient?language=objc +type CNNMultiplyGradient struct { + CNNArithmeticGradient +} + +func CNNMultiplyGradientFrom(ptr unsafe.Pointer) CNNMultiplyGradient { + return CNNMultiplyGradient{ + CNNArithmeticGradient: CNNArithmeticGradientFrom(ptr), + } +} + +func (c_ CNNMultiplyGradient) InitWithDeviceIsSecondarySourceFilter(device metal.PDevice, isSecondarySourceFilter bool) CNNMultiplyGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiplyGradient](c_, objc.Sel("initWithDevice:isSecondarySourceFilter:"), po0, isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnmultiplygradient/2956164-initwithdevice?language=objc +func NewCNNMultiplyGradientWithDeviceIsSecondarySourceFilter(device metal.PDevice, isSecondarySourceFilter bool) CNNMultiplyGradient { + instance := CNNMultiplyGradientClass.Alloc().InitWithDeviceIsSecondarySourceFilter(device, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (cc _CNNMultiplyGradientClass) Alloc() CNNMultiplyGradient { + rv := objc.Call[CNNMultiplyGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNMultiplyGradient_Alloc() CNNMultiplyGradient { + return CNNMultiplyGradientClass.Alloc() +} + +func (cc _CNNMultiplyGradientClass) New() CNNMultiplyGradient { + rv := objc.Call[CNNMultiplyGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNMultiplyGradient() CNNMultiplyGradient { + return CNNMultiplyGradientClass.New() +} + +func (c_ CNNMultiplyGradient) Init() CNNMultiplyGradient { + rv := objc.Call[CNNMultiplyGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNMultiplyGradient) InitWithDevice(device metal.PDevice) CNNMultiplyGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiplyGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNMultiplyGradientWithDevice(device metal.PDevice) CNNMultiplyGradient { + instance := CNNMultiplyGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNMultiplyGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNMultiplyGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNMultiplyGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNMultiplyGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNMultiplyGradient { + instance := CNNMultiplyGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron.gen.go b/macos/mps/cnn_neuron.gen.go new file mode 100644 index 00000000..4085d9d9 --- /dev/null +++ b/macos/mps/cnn_neuron.gen.go @@ -0,0 +1,150 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuron] class. +var CNNNeuronClass = _CNNNeuronClass{objc.GetClass("MPSCNNNeuron")} + +type _CNNNeuronClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuron] class. +type ICNNNeuron interface { + ICNNKernel + A() float64 + Data() []byte + NeuronType() CNNNeuronType + C() float64 + B() float64 +} + +// A filter that applies a neuron activation function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron?language=objc +type CNNNeuron struct { + CNNKernel +} + +func CNNNeuronFrom(ptr unsafe.Pointer) CNNNeuron { + return CNNNeuron{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNNeuron) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuron { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuron](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuron { + instance := CNNNeuronClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronClass) Alloc() CNNNeuron { + rv := objc.Call[CNNNeuron](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuron_Alloc() CNNNeuron { + return CNNNeuronClass.Alloc() +} + +func (cc _CNNNeuronClass) New() CNNNeuron { + rv := objc.Call[CNNNeuron](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuron() CNNNeuron { + return CNNNeuronClass.New() +} + +func (c_ CNNNeuron) Init() CNNNeuron { + rv := objc.Call[CNNNeuron](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuron) InitWithDevice(device metal.PDevice) CNNNeuron { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuron](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronWithDevice(device metal.PDevice) CNNNeuron { + instance := CNNNeuronClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuron) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuron { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuron](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuron_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuron { + instance := CNNNeuronClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942297-a?language=objc +func (c_ CNNNeuron) A() float64 { + rv := objc.Call[float64](c_, objc.Sel("a")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942308-data?language=objc +func (c_ CNNNeuron) Data() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("data")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942309-neurontype?language=objc +func (c_ CNNNeuron) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](c_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942303-c?language=objc +func (c_ CNNNeuron) C() float64 { + rv := objc.Call[float64](c_, objc.Sel("c")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942306-b?language=objc +func (c_ CNNNeuron) B() float64 { + rv := objc.Call[float64](c_, objc.Sel("b")) + return rv +} diff --git a/macos/mps/cnn_neuron_absolute.gen.go b/macos/mps/cnn_neuron_absolute.gen.go new file mode 100644 index 00000000..6f376ae8 --- /dev/null +++ b/macos/mps/cnn_neuron_absolute.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronAbsolute] class. +var CNNNeuronAbsoluteClass = _CNNNeuronAbsoluteClass{objc.GetClass("MPSCNNNeuronAbsolute")} + +type _CNNNeuronAbsoluteClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronAbsolute] class. +type ICNNNeuronAbsolute interface { + ICNNNeuron +} + +// An absolute neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronabsolute?language=objc +type CNNNeuronAbsolute struct { + CNNNeuron +} + +func CNNNeuronAbsoluteFrom(ptr unsafe.Pointer) CNNNeuronAbsolute { + return CNNNeuronAbsolute{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronAbsoluteClass) Alloc() CNNNeuronAbsolute { + rv := objc.Call[CNNNeuronAbsolute](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronAbsolute_Alloc() CNNNeuronAbsolute { + return CNNNeuronAbsoluteClass.Alloc() +} + +func (cc _CNNNeuronAbsoluteClass) New() CNNNeuronAbsolute { + rv := objc.Call[CNNNeuronAbsolute](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronAbsolute() CNNNeuronAbsolute { + return CNNNeuronAbsoluteClass.New() +} + +func (c_ CNNNeuronAbsolute) Init() CNNNeuronAbsolute { + rv := objc.Call[CNNNeuronAbsolute](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronAbsolute) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronAbsolute { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronAbsolute](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronAbsoluteWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronAbsolute { + instance := CNNNeuronAbsoluteClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronAbsolute) InitWithDevice(device metal.PDevice) CNNNeuronAbsolute { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronAbsolute](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronAbsoluteWithDevice(device metal.PDevice) CNNNeuronAbsolute { + instance := CNNNeuronAbsoluteClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronAbsolute) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronAbsolute { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronAbsolute](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronAbsolute_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronAbsolute { + instance := CNNNeuronAbsoluteClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_absolute_node.gen.go b/macos/mps/cnn_neuron_absolute_node.gen.go new file mode 100644 index 00000000..19669bdc --- /dev/null +++ b/macos/mps/cnn_neuron_absolute_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronAbsoluteNode] class. +var CNNNeuronAbsoluteNodeClass = _CNNNeuronAbsoluteNodeClass{objc.GetClass("MPSCNNNeuronAbsoluteNode")} + +type _CNNNeuronAbsoluteNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronAbsoluteNode] class. +type ICNNNeuronAbsoluteNode interface { + ICNNNeuronNode +} + +// A representation of an absolute neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronabsolutenode?language=objc +type CNNNeuronAbsoluteNode struct { + CNNNeuronNode +} + +func CNNNeuronAbsoluteNodeFrom(ptr unsafe.Pointer) CNNNeuronAbsoluteNode { + return CNNNeuronAbsoluteNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronAbsoluteNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronAbsoluteNode { + rv := objc.Call[CNNNeuronAbsoluteNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronabsolutenode/2866431-nodewithsource?language=objc +func CNNNeuronAbsoluteNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronAbsoluteNode { + return CNNNeuronAbsoluteNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronAbsoluteNode) InitWithSource(sourceNode INNImageNode) CNNNeuronAbsoluteNode { + rv := objc.Call[CNNNeuronAbsoluteNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronabsolutenode/2921448-initwithsource?language=objc +func NewCNNNeuronAbsoluteNodeWithSource(sourceNode INNImageNode) CNNNeuronAbsoluteNode { + instance := CNNNeuronAbsoluteNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronAbsoluteNodeClass) Alloc() CNNNeuronAbsoluteNode { + rv := objc.Call[CNNNeuronAbsoluteNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronAbsoluteNode_Alloc() CNNNeuronAbsoluteNode { + return CNNNeuronAbsoluteNodeClass.Alloc() +} + +func (cc _CNNNeuronAbsoluteNodeClass) New() CNNNeuronAbsoluteNode { + rv := objc.Call[CNNNeuronAbsoluteNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronAbsoluteNode() CNNNeuronAbsoluteNode { + return CNNNeuronAbsoluteNodeClass.New() +} + +func (c_ CNNNeuronAbsoluteNode) Init() CNNNeuronAbsoluteNode { + rv := objc.Call[CNNNeuronAbsoluteNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronAbsoluteNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronAbsoluteNode { + rv := objc.Call[CNNNeuronAbsoluteNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronAbsoluteNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronAbsoluteNode { + return CNNNeuronAbsoluteNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_elu.gen.go b/macos/mps/cnn_neuron_elu.gen.go new file mode 100644 index 00000000..5f0b2c55 --- /dev/null +++ b/macos/mps/cnn_neuron_elu.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronELU] class. +var CNNNeuronELUClass = _CNNNeuronELUClass{objc.GetClass("MPSCNNNeuronELU")} + +type _CNNNeuronELUClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronELU] class. +type ICNNNeuronELU interface { + ICNNNeuron +} + +// A parametric ELU neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronelu?language=objc +type CNNNeuronELU struct { + CNNNeuron +} + +func CNNNeuronELUFrom(ptr unsafe.Pointer) CNNNeuronELU { + return CNNNeuronELU{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronELUClass) Alloc() CNNNeuronELU { + rv := objc.Call[CNNNeuronELU](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronELU_Alloc() CNNNeuronELU { + return CNNNeuronELUClass.Alloc() +} + +func (cc _CNNNeuronELUClass) New() CNNNeuronELU { + rv := objc.Call[CNNNeuronELU](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronELU() CNNNeuronELU { + return CNNNeuronELUClass.New() +} + +func (c_ CNNNeuronELU) Init() CNNNeuronELU { + rv := objc.Call[CNNNeuronELU](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronELU) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronELU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronELU](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronELUWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronELU { + instance := CNNNeuronELUClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronELU) InitWithDevice(device metal.PDevice) CNNNeuronELU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronELU](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronELUWithDevice(device metal.PDevice) CNNNeuronELU { + instance := CNNNeuronELUClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronELU) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronELU { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronELU](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronELU_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronELU { + instance := CNNNeuronELUClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_elu_node.gen.go b/macos/mps/cnn_neuron_elu_node.gen.go new file mode 100644 index 00000000..e3d4e40b --- /dev/null +++ b/macos/mps/cnn_neuron_elu_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronELUNode] class. +var CNNNeuronELUNodeClass = _CNNNeuronELUNodeClass{objc.GetClass("MPSCNNNeuronELUNode")} + +type _CNNNeuronELUNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronELUNode] class. +type ICNNNeuronELUNode interface { + ICNNNeuronNode +} + +// A representation of a parametric ELU neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronelunode?language=objc +type CNNNeuronELUNode struct { + CNNNeuronNode +} + +func CNNNeuronELUNodeFrom(ptr unsafe.Pointer) CNNNeuronELUNode { + return CNNNeuronELUNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronELUNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronELUNode { + rv := objc.Call[CNNNeuronELUNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronelunode/2921452-nodewithsource?language=objc +func CNNNeuronELUNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronELUNode { + return CNNNeuronELUNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronELUNode) InitWithSource(sourceNode INNImageNode) CNNNeuronELUNode { + rv := objc.Call[CNNNeuronELUNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronelunode/2921447-initwithsource?language=objc +func NewCNNNeuronELUNodeWithSource(sourceNode INNImageNode) CNNNeuronELUNode { + instance := CNNNeuronELUNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronELUNodeClass) Alloc() CNNNeuronELUNode { + rv := objc.Call[CNNNeuronELUNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronELUNode_Alloc() CNNNeuronELUNode { + return CNNNeuronELUNodeClass.Alloc() +} + +func (cc _CNNNeuronELUNodeClass) New() CNNNeuronELUNode { + rv := objc.Call[CNNNeuronELUNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronELUNode() CNNNeuronELUNode { + return CNNNeuronELUNodeClass.New() +} + +func (c_ CNNNeuronELUNode) Init() CNNNeuronELUNode { + rv := objc.Call[CNNNeuronELUNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronELUNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronELUNode { + rv := objc.Call[CNNNeuronELUNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronELUNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronELUNode { + return CNNNeuronELUNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_exponential.gen.go b/macos/mps/cnn_neuron_exponential.gen.go new file mode 100644 index 00000000..4fdc51c1 --- /dev/null +++ b/macos/mps/cnn_neuron_exponential.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronExponential] class. +var CNNNeuronExponentialClass = _CNNNeuronExponentialClass{objc.GetClass("MPSCNNNeuronExponential")} + +type _CNNNeuronExponentialClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronExponential] class. +type ICNNNeuronExponential interface { + ICNNNeuron +} + +// An exponential neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronexponential?language=objc +type CNNNeuronExponential struct { + CNNNeuron +} + +func CNNNeuronExponentialFrom(ptr unsafe.Pointer) CNNNeuronExponential { + return CNNNeuronExponential{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronExponentialClass) Alloc() CNNNeuronExponential { + rv := objc.Call[CNNNeuronExponential](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronExponential_Alloc() CNNNeuronExponential { + return CNNNeuronExponentialClass.Alloc() +} + +func (cc _CNNNeuronExponentialClass) New() CNNNeuronExponential { + rv := objc.Call[CNNNeuronExponential](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronExponential() CNNNeuronExponential { + return CNNNeuronExponentialClass.New() +} + +func (c_ CNNNeuronExponential) Init() CNNNeuronExponential { + rv := objc.Call[CNNNeuronExponential](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronExponential) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronExponential { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronExponential](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronExponentialWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronExponential { + instance := CNNNeuronExponentialClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronExponential) InitWithDevice(device metal.PDevice) CNNNeuronExponential { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronExponential](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronExponentialWithDevice(device metal.PDevice) CNNNeuronExponential { + instance := CNNNeuronExponentialClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronExponential) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronExponential { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronExponential](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronExponential_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronExponential { + instance := CNNNeuronExponentialClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_exponential_node.gen.go b/macos/mps/cnn_neuron_exponential_node.gen.go new file mode 100644 index 00000000..6ab0ae27 --- /dev/null +++ b/macos/mps/cnn_neuron_exponential_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronExponentialNode] class. +var CNNNeuronExponentialNodeClass = _CNNNeuronExponentialNodeClass{objc.GetClass("MPSCNNNeuronExponentialNode")} + +type _CNNNeuronExponentialNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronExponentialNode] class. +type ICNNNeuronExponentialNode interface { + ICNNNeuronNode +} + +// A representation of an exponential neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronexponentialnode?language=objc +type CNNNeuronExponentialNode struct { + CNNNeuronNode +} + +func CNNNeuronExponentialNodeFrom(ptr unsafe.Pointer) CNNNeuronExponentialNode { + return CNNNeuronExponentialNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronExponentialNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronExponentialNode { + rv := objc.Call[CNNNeuronExponentialNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronexponentialnode/2951950-nodewithsource?language=objc +func CNNNeuronExponentialNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronExponentialNode { + return CNNNeuronExponentialNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronExponentialNode) InitWithSource(sourceNode INNImageNode) CNNNeuronExponentialNode { + rv := objc.Call[CNNNeuronExponentialNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronexponentialnode/2951936-initwithsource?language=objc +func NewCNNNeuronExponentialNodeWithSource(sourceNode INNImageNode) CNNNeuronExponentialNode { + instance := CNNNeuronExponentialNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronExponentialNodeClass) Alloc() CNNNeuronExponentialNode { + rv := objc.Call[CNNNeuronExponentialNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronExponentialNode_Alloc() CNNNeuronExponentialNode { + return CNNNeuronExponentialNodeClass.Alloc() +} + +func (cc _CNNNeuronExponentialNodeClass) New() CNNNeuronExponentialNode { + rv := objc.Call[CNNNeuronExponentialNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronExponentialNode() CNNNeuronExponentialNode { + return CNNNeuronExponentialNodeClass.New() +} + +func (c_ CNNNeuronExponentialNode) Init() CNNNeuronExponentialNode { + rv := objc.Call[CNNNeuronExponentialNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronExponentialNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronExponentialNode { + rv := objc.Call[CNNNeuronExponentialNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronExponentialNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronExponentialNode { + return CNNNeuronExponentialNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_ge_lu_node.gen.go b/macos/mps/cnn_neuron_ge_lu_node.gen.go new file mode 100644 index 00000000..e5e4833c --- /dev/null +++ b/macos/mps/cnn_neuron_ge_lu_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronGeLUNode] class. +var CNNNeuronGeLUNodeClass = _CNNNeuronGeLUNodeClass{objc.GetClass("MPSCNNNeuronGeLUNode")} + +type _CNNNeuronGeLUNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronGeLUNode] class. +type ICNNNeuronGeLUNode interface { + ICNNNeuronNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongelunode?language=objc +type CNNNeuronGeLUNode struct { + CNNNeuronNode +} + +func CNNNeuronGeLUNodeFrom(ptr unsafe.Pointer) CNNNeuronGeLUNode { + return CNNNeuronGeLUNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronGeLUNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronGeLUNode { + rv := objc.Call[CNNNeuronGeLUNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongelunode/3237267-nodewithsource?language=objc +func CNNNeuronGeLUNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronGeLUNode { + return CNNNeuronGeLUNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronGeLUNode) InitWithSource(sourceNode INNImageNode) CNNNeuronGeLUNode { + rv := objc.Call[CNNNeuronGeLUNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongelunode/3237266-initwithsource?language=objc +func NewCNNNeuronGeLUNodeWithSource(sourceNode INNImageNode) CNNNeuronGeLUNode { + instance := CNNNeuronGeLUNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronGeLUNodeClass) Alloc() CNNNeuronGeLUNode { + rv := objc.Call[CNNNeuronGeLUNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronGeLUNode_Alloc() CNNNeuronGeLUNode { + return CNNNeuronGeLUNodeClass.Alloc() +} + +func (cc _CNNNeuronGeLUNodeClass) New() CNNNeuronGeLUNode { + rv := objc.Call[CNNNeuronGeLUNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronGeLUNode() CNNNeuronGeLUNode { + return CNNNeuronGeLUNodeClass.New() +} + +func (c_ CNNNeuronGeLUNode) Init() CNNNeuronGeLUNode { + rv := objc.Call[CNNNeuronGeLUNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronGeLUNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronGeLUNode { + rv := objc.Call[CNNNeuronGeLUNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronGeLUNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronGeLUNode { + return CNNNeuronGeLUNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_gradient.gen.go b/macos/mps/cnn_neuron_gradient.gen.go new file mode 100644 index 00000000..34cb25ed --- /dev/null +++ b/macos/mps/cnn_neuron_gradient.gen.go @@ -0,0 +1,150 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronGradient] class. +var CNNNeuronGradientClass = _CNNNeuronGradientClass{objc.GetClass("MPSCNNNeuronGradient")} + +type _CNNNeuronGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronGradient] class. +type ICNNNeuronGradient interface { + ICNNGradientKernel + A() float64 + Data() []byte + NeuronType() CNNNeuronType + C() float64 + B() float64 +} + +// A gradient neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradient?language=objc +type CNNNeuronGradient struct { + CNNGradientKernel +} + +func CNNNeuronGradientFrom(ptr unsafe.Pointer) CNNNeuronGradient { + return CNNNeuronGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNNeuronGradient) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronGradient](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradient/2942293-initwithdevice?language=objc +func NewCNNNeuronGradientWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronGradient { + instance := CNNNeuronGradientClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronGradientClass) Alloc() CNNNeuronGradient { + rv := objc.Call[CNNNeuronGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronGradient_Alloc() CNNNeuronGradient { + return CNNNeuronGradientClass.Alloc() +} + +func (cc _CNNNeuronGradientClass) New() CNNNeuronGradient { + rv := objc.Call[CNNNeuronGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronGradient() CNNNeuronGradient { + return CNNNeuronGradientClass.New() +} + +func (c_ CNNNeuronGradient) Init() CNNNeuronGradient { + rv := objc.Call[CNNNeuronGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronGradient) InitWithDevice(device metal.PDevice) CNNNeuronGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNNeuronGradientWithDevice(device metal.PDevice) CNNNeuronGradient { + instance := CNNNeuronGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronGradient { + instance := CNNNeuronGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradient/2942312-a?language=objc +func (c_ CNNNeuronGradient) A() float64 { + rv := objc.Call[float64](c_, objc.Sel("a")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradient/2942314-data?language=objc +func (c_ CNNNeuronGradient) Data() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("data")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradient/2942300-neurontype?language=objc +func (c_ CNNNeuronGradient) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](c_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradient/2942310-c?language=objc +func (c_ CNNNeuronGradient) C() float64 { + rv := objc.Call[float64](c_, objc.Sel("c")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradient/2942313-b?language=objc +func (c_ CNNNeuronGradient) B() float64 { + rv := objc.Call[float64](c_, objc.Sel("b")) + return rv +} diff --git a/macos/mps/cnn_neuron_gradient_node.gen.go b/macos/mps/cnn_neuron_gradient_node.gen.go new file mode 100644 index 00000000..d92c59be --- /dev/null +++ b/macos/mps/cnn_neuron_gradient_node.gen.go @@ -0,0 +1,93 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronGradientNode] class. +var CNNNeuronGradientNodeClass = _CNNNeuronGradientNodeClass{objc.GetClass("MPSCNNNeuronGradientNode")} + +type _CNNNeuronGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronGradientNode] class. +type ICNNNeuronGradientNode interface { + INNGradientFilterNode + Descriptor() NNNeuronDescriptor +} + +// A representation of a gradient exponential neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradientnode?language=objc +type CNNNeuronGradientNode struct { + NNGradientFilterNode +} + +func CNNNeuronGradientNodeFrom(ptr unsafe.Pointer) CNNNeuronGradientNode { + return CNNNeuronGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNNeuronGradientNode) InitWithSourceGradientSourceImageGradientStateDescriptor(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, descriptor INNNeuronDescriptor) CNNNeuronGradientNode { + rv := objc.Call[CNNNeuronGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:descriptor:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradientnode/2948031-initwithsourcegradient?language=objc +func NewCNNNeuronGradientNodeWithSourceGradientSourceImageGradientStateDescriptor(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, descriptor INNNeuronDescriptor) CNNNeuronGradientNode { + instance := CNNNeuronGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateDescriptor(sourceGradient, sourceImage, gradientState, descriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateDescriptor(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, descriptor INNNeuronDescriptor) CNNNeuronGradientNode { + rv := objc.Call[CNNNeuronGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:descriptor:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradientnode/2948028-nodewithsourcegradient?language=objc +func CNNNeuronGradientNode_NodeWithSourceGradientSourceImageGradientStateDescriptor(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, descriptor INNNeuronDescriptor) CNNNeuronGradientNode { + return CNNNeuronGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateDescriptor(sourceGradient, sourceImage, gradientState, descriptor) +} + +func (cc _CNNNeuronGradientNodeClass) Alloc() CNNNeuronGradientNode { + rv := objc.Call[CNNNeuronGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronGradientNode_Alloc() CNNNeuronGradientNode { + return CNNNeuronGradientNodeClass.Alloc() +} + +func (cc _CNNNeuronGradientNodeClass) New() CNNNeuronGradientNode { + rv := objc.Call[CNNNeuronGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronGradientNode() CNNNeuronGradientNode { + return CNNNeuronGradientNodeClass.New() +} + +func (c_ CNNNeuronGradientNode) Init() CNNNeuronGradientNode { + rv := objc.Call[CNNNeuronGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurongradientnode/2948040-descriptor?language=objc +func (c_ CNNNeuronGradientNode) Descriptor() NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](c_, objc.Sel("descriptor")) + return rv +} diff --git a/macos/mps/cnn_neuron_hard_sigmoid.gen.go b/macos/mps/cnn_neuron_hard_sigmoid.gen.go new file mode 100644 index 00000000..da8c170a --- /dev/null +++ b/macos/mps/cnn_neuron_hard_sigmoid.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronHardSigmoid] class. +var CNNNeuronHardSigmoidClass = _CNNNeuronHardSigmoidClass{objc.GetClass("MPSCNNNeuronHardSigmoid")} + +type _CNNNeuronHardSigmoidClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronHardSigmoid] class. +type ICNNNeuronHardSigmoid interface { + ICNNNeuron +} + +// A hard sigmoid neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronhardsigmoid?language=objc +type CNNNeuronHardSigmoid struct { + CNNNeuron +} + +func CNNNeuronHardSigmoidFrom(ptr unsafe.Pointer) CNNNeuronHardSigmoid { + return CNNNeuronHardSigmoid{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronHardSigmoidClass) Alloc() CNNNeuronHardSigmoid { + rv := objc.Call[CNNNeuronHardSigmoid](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronHardSigmoid_Alloc() CNNNeuronHardSigmoid { + return CNNNeuronHardSigmoidClass.Alloc() +} + +func (cc _CNNNeuronHardSigmoidClass) New() CNNNeuronHardSigmoid { + rv := objc.Call[CNNNeuronHardSigmoid](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronHardSigmoid() CNNNeuronHardSigmoid { + return CNNNeuronHardSigmoidClass.New() +} + +func (c_ CNNNeuronHardSigmoid) Init() CNNNeuronHardSigmoid { + rv := objc.Call[CNNNeuronHardSigmoid](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronHardSigmoid) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronHardSigmoid { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronHardSigmoid](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronHardSigmoidWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronHardSigmoid { + instance := CNNNeuronHardSigmoidClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronHardSigmoid) InitWithDevice(device metal.PDevice) CNNNeuronHardSigmoid { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronHardSigmoid](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronHardSigmoidWithDevice(device metal.PDevice) CNNNeuronHardSigmoid { + instance := CNNNeuronHardSigmoidClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronHardSigmoid) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronHardSigmoid { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronHardSigmoid](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronHardSigmoid_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronHardSigmoid { + instance := CNNNeuronHardSigmoidClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_hard_sigmoid_node.gen.go b/macos/mps/cnn_neuron_hard_sigmoid_node.gen.go new file mode 100644 index 00000000..4ba7766d --- /dev/null +++ b/macos/mps/cnn_neuron_hard_sigmoid_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronHardSigmoidNode] class. +var CNNNeuronHardSigmoidNodeClass = _CNNNeuronHardSigmoidNodeClass{objc.GetClass("MPSCNNNeuronHardSigmoidNode")} + +type _CNNNeuronHardSigmoidNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronHardSigmoidNode] class. +type ICNNNeuronHardSigmoidNode interface { + ICNNNeuronNode +} + +// A representation of a hard sigmoid neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronhardsigmoidnode?language=objc +type CNNNeuronHardSigmoidNode struct { + CNNNeuronNode +} + +func CNNNeuronHardSigmoidNodeFrom(ptr unsafe.Pointer) CNNNeuronHardSigmoidNode { + return CNNNeuronHardSigmoidNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronHardSigmoidNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronHardSigmoidNode { + rv := objc.Call[CNNNeuronHardSigmoidNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronhardsigmoidnode/2921453-nodewithsource?language=objc +func CNNNeuronHardSigmoidNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronHardSigmoidNode { + return CNNNeuronHardSigmoidNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronHardSigmoidNode) InitWithSource(sourceNode INNImageNode) CNNNeuronHardSigmoidNode { + rv := objc.Call[CNNNeuronHardSigmoidNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronhardsigmoidnode/2921455-initwithsource?language=objc +func NewCNNNeuronHardSigmoidNodeWithSource(sourceNode INNImageNode) CNNNeuronHardSigmoidNode { + instance := CNNNeuronHardSigmoidNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronHardSigmoidNodeClass) Alloc() CNNNeuronHardSigmoidNode { + rv := objc.Call[CNNNeuronHardSigmoidNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronHardSigmoidNode_Alloc() CNNNeuronHardSigmoidNode { + return CNNNeuronHardSigmoidNodeClass.Alloc() +} + +func (cc _CNNNeuronHardSigmoidNodeClass) New() CNNNeuronHardSigmoidNode { + rv := objc.Call[CNNNeuronHardSigmoidNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronHardSigmoidNode() CNNNeuronHardSigmoidNode { + return CNNNeuronHardSigmoidNodeClass.New() +} + +func (c_ CNNNeuronHardSigmoidNode) Init() CNNNeuronHardSigmoidNode { + rv := objc.Call[CNNNeuronHardSigmoidNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronHardSigmoidNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronHardSigmoidNode { + rv := objc.Call[CNNNeuronHardSigmoidNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronHardSigmoidNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronHardSigmoidNode { + return CNNNeuronHardSigmoidNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_linear.gen.go b/macos/mps/cnn_neuron_linear.gen.go new file mode 100644 index 00000000..820e8e2d --- /dev/null +++ b/macos/mps/cnn_neuron_linear.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronLinear] class. +var CNNNeuronLinearClass = _CNNNeuronLinearClass{objc.GetClass("MPSCNNNeuronLinear")} + +type _CNNNeuronLinearClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronLinear] class. +type ICNNNeuronLinear interface { + ICNNNeuron +} + +// A linear neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlinear?language=objc +type CNNNeuronLinear struct { + CNNNeuron +} + +func CNNNeuronLinearFrom(ptr unsafe.Pointer) CNNNeuronLinear { + return CNNNeuronLinear{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronLinearClass) Alloc() CNNNeuronLinear { + rv := objc.Call[CNNNeuronLinear](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronLinear_Alloc() CNNNeuronLinear { + return CNNNeuronLinearClass.Alloc() +} + +func (cc _CNNNeuronLinearClass) New() CNNNeuronLinear { + rv := objc.Call[CNNNeuronLinear](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronLinear() CNNNeuronLinear { + return CNNNeuronLinearClass.New() +} + +func (c_ CNNNeuronLinear) Init() CNNNeuronLinear { + rv := objc.Call[CNNNeuronLinear](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronLinear) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronLinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronLinear](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronLinearWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronLinear { + instance := CNNNeuronLinearClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronLinear) InitWithDevice(device metal.PDevice) CNNNeuronLinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronLinear](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronLinearWithDevice(device metal.PDevice) CNNNeuronLinear { + instance := CNNNeuronLinearClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronLinear) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronLinear { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronLinear](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronLinear_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronLinear { + instance := CNNNeuronLinearClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_linear_node.gen.go b/macos/mps/cnn_neuron_linear_node.gen.go new file mode 100644 index 00000000..e105ada5 --- /dev/null +++ b/macos/mps/cnn_neuron_linear_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronLinearNode] class. +var CNNNeuronLinearNodeClass = _CNNNeuronLinearNodeClass{objc.GetClass("MPSCNNNeuronLinearNode")} + +type _CNNNeuronLinearNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronLinearNode] class. +type ICNNNeuronLinearNode interface { + ICNNNeuronNode +} + +// A representation of a linear neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlinearnode?language=objc +type CNNNeuronLinearNode struct { + CNNNeuronNode +} + +func CNNNeuronLinearNodeFrom(ptr unsafe.Pointer) CNNNeuronLinearNode { + return CNNNeuronLinearNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronLinearNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronLinearNode { + rv := objc.Call[CNNNeuronLinearNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlinearnode/2921450-nodewithsource?language=objc +func CNNNeuronLinearNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronLinearNode { + return CNNNeuronLinearNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronLinearNode) InitWithSource(sourceNode INNImageNode) CNNNeuronLinearNode { + rv := objc.Call[CNNNeuronLinearNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlinearnode/2921456-initwithsource?language=objc +func NewCNNNeuronLinearNodeWithSource(sourceNode INNImageNode) CNNNeuronLinearNode { + instance := CNNNeuronLinearNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronLinearNodeClass) Alloc() CNNNeuronLinearNode { + rv := objc.Call[CNNNeuronLinearNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronLinearNode_Alloc() CNNNeuronLinearNode { + return CNNNeuronLinearNodeClass.Alloc() +} + +func (cc _CNNNeuronLinearNodeClass) New() CNNNeuronLinearNode { + rv := objc.Call[CNNNeuronLinearNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronLinearNode() CNNNeuronLinearNode { + return CNNNeuronLinearNodeClass.New() +} + +func (c_ CNNNeuronLinearNode) Init() CNNNeuronLinearNode { + rv := objc.Call[CNNNeuronLinearNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronLinearNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronLinearNode { + rv := objc.Call[CNNNeuronLinearNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronLinearNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronLinearNode { + return CNNNeuronLinearNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_logarithm.gen.go b/macos/mps/cnn_neuron_logarithm.gen.go new file mode 100644 index 00000000..8cd83cc7 --- /dev/null +++ b/macos/mps/cnn_neuron_logarithm.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronLogarithm] class. +var CNNNeuronLogarithmClass = _CNNNeuronLogarithmClass{objc.GetClass("MPSCNNNeuronLogarithm")} + +type _CNNNeuronLogarithmClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronLogarithm] class. +type ICNNNeuronLogarithm interface { + ICNNNeuron +} + +// A logarithm neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlogarithm?language=objc +type CNNNeuronLogarithm struct { + CNNNeuron +} + +func CNNNeuronLogarithmFrom(ptr unsafe.Pointer) CNNNeuronLogarithm { + return CNNNeuronLogarithm{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronLogarithmClass) Alloc() CNNNeuronLogarithm { + rv := objc.Call[CNNNeuronLogarithm](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronLogarithm_Alloc() CNNNeuronLogarithm { + return CNNNeuronLogarithmClass.Alloc() +} + +func (cc _CNNNeuronLogarithmClass) New() CNNNeuronLogarithm { + rv := objc.Call[CNNNeuronLogarithm](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronLogarithm() CNNNeuronLogarithm { + return CNNNeuronLogarithmClass.New() +} + +func (c_ CNNNeuronLogarithm) Init() CNNNeuronLogarithm { + rv := objc.Call[CNNNeuronLogarithm](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronLogarithm) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronLogarithm { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronLogarithm](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronLogarithmWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronLogarithm { + instance := CNNNeuronLogarithmClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronLogarithm) InitWithDevice(device metal.PDevice) CNNNeuronLogarithm { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronLogarithm](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronLogarithmWithDevice(device metal.PDevice) CNNNeuronLogarithm { + instance := CNNNeuronLogarithmClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronLogarithm) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronLogarithm { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronLogarithm](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronLogarithm_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronLogarithm { + instance := CNNNeuronLogarithmClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_logarithm_node.gen.go b/macos/mps/cnn_neuron_logarithm_node.gen.go new file mode 100644 index 00000000..c447e398 --- /dev/null +++ b/macos/mps/cnn_neuron_logarithm_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronLogarithmNode] class. +var CNNNeuronLogarithmNodeClass = _CNNNeuronLogarithmNodeClass{objc.GetClass("MPSCNNNeuronLogarithmNode")} + +type _CNNNeuronLogarithmNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronLogarithmNode] class. +type ICNNNeuronLogarithmNode interface { + ICNNNeuronNode +} + +// A representation of a logarithm neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlogarithmnode?language=objc +type CNNNeuronLogarithmNode struct { + CNNNeuronNode +} + +func CNNNeuronLogarithmNodeFrom(ptr unsafe.Pointer) CNNNeuronLogarithmNode { + return CNNNeuronLogarithmNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronLogarithmNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronLogarithmNode { + rv := objc.Call[CNNNeuronLogarithmNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlogarithmnode/2951931-nodewithsource?language=objc +func CNNNeuronLogarithmNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronLogarithmNode { + return CNNNeuronLogarithmNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronLogarithmNode) InitWithSource(sourceNode INNImageNode) CNNNeuronLogarithmNode { + rv := objc.Call[CNNNeuronLogarithmNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronlogarithmnode/2951949-initwithsource?language=objc +func NewCNNNeuronLogarithmNodeWithSource(sourceNode INNImageNode) CNNNeuronLogarithmNode { + instance := CNNNeuronLogarithmNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronLogarithmNodeClass) Alloc() CNNNeuronLogarithmNode { + rv := objc.Call[CNNNeuronLogarithmNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronLogarithmNode_Alloc() CNNNeuronLogarithmNode { + return CNNNeuronLogarithmNodeClass.Alloc() +} + +func (cc _CNNNeuronLogarithmNodeClass) New() CNNNeuronLogarithmNode { + rv := objc.Call[CNNNeuronLogarithmNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronLogarithmNode() CNNNeuronLogarithmNode { + return CNNNeuronLogarithmNodeClass.New() +} + +func (c_ CNNNeuronLogarithmNode) Init() CNNNeuronLogarithmNode { + rv := objc.Call[CNNNeuronLogarithmNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronLogarithmNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronLogarithmNode { + rv := objc.Call[CNNNeuronLogarithmNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronLogarithmNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronLogarithmNode { + return CNNNeuronLogarithmNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_node.gen.go b/macos/mps/cnn_neuron_node.gen.go new file mode 100644 index 00000000..a62c1a03 --- /dev/null +++ b/macos/mps/cnn_neuron_node.gen.go @@ -0,0 +1,97 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronNode] class. +var CNNNeuronNodeClass = _CNNNeuronNodeClass{objc.GetClass("MPSCNNNeuronNode")} + +type _CNNNeuronNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronNode] class. +type ICNNNeuronNode interface { + INNFilterNode + A() float64 + C() float64 + B() float64 +} + +// The virtual base class for MPS CNN neuron nodes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode?language=objc +type CNNNeuronNode struct { + NNFilterNode +} + +func CNNNeuronNodeFrom(ptr unsafe.Pointer) CNNNeuronNode { + return CNNNeuronNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNNeuronNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronNode { + rv := objc.Call[CNNNeuronNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronNode { + return CNNNeuronNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} + +func (cc _CNNNeuronNodeClass) Alloc() CNNNeuronNode { + rv := objc.Call[CNNNeuronNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronNode_Alloc() CNNNeuronNode { + return CNNNeuronNodeClass.Alloc() +} + +func (cc _CNNNeuronNodeClass) New() CNNNeuronNode { + rv := objc.Call[CNNNeuronNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronNode() CNNNeuronNode { + return CNNNeuronNodeClass.New() +} + +func (c_ CNNNeuronNode) Init() CNNNeuronNode { + rv := objc.Call[CNNNeuronNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/2921459-a?language=objc +func (c_ CNNNeuronNode) A() float64 { + rv := objc.Call[float64](c_, objc.Sel("a")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/2935553-c?language=objc +func (c_ CNNNeuronNode) C() float64 { + rv := objc.Call[float64](c_, objc.Sel("c")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/2921461-b?language=objc +func (c_ CNNNeuronNode) B() float64 { + rv := objc.Call[float64](c_, objc.Sel("b")) + return rv +} diff --git a/macos/mps/cnn_neuron_p_re_lu.gen.go b/macos/mps/cnn_neuron_p_re_lu.gen.go new file mode 100644 index 00000000..18c47327 --- /dev/null +++ b/macos/mps/cnn_neuron_p_re_lu.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronPReLU] class. +var CNNNeuronPReLUClass = _CNNNeuronPReLUClass{objc.GetClass("MPSCNNNeuronPReLU")} + +type _CNNNeuronPReLUClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronPReLU] class. +type ICNNNeuronPReLU interface { + ICNNNeuron +} + +// A parametric ReLU (Rectified Linear Unit) neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronprelu?language=objc +type CNNNeuronPReLU struct { + CNNNeuron +} + +func CNNNeuronPReLUFrom(ptr unsafe.Pointer) CNNNeuronPReLU { + return CNNNeuronPReLU{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronPReLUClass) Alloc() CNNNeuronPReLU { + rv := objc.Call[CNNNeuronPReLU](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronPReLU_Alloc() CNNNeuronPReLU { + return CNNNeuronPReLUClass.Alloc() +} + +func (cc _CNNNeuronPReLUClass) New() CNNNeuronPReLU { + rv := objc.Call[CNNNeuronPReLU](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronPReLU() CNNNeuronPReLU { + return CNNNeuronPReLUClass.New() +} + +func (c_ CNNNeuronPReLU) Init() CNNNeuronPReLU { + rv := objc.Call[CNNNeuronPReLU](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronPReLU) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronPReLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronPReLU](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronPReLUWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronPReLU { + instance := CNNNeuronPReLUClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronPReLU) InitWithDevice(device metal.PDevice) CNNNeuronPReLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronPReLU](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronPReLUWithDevice(device metal.PDevice) CNNNeuronPReLU { + instance := CNNNeuronPReLUClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronPReLU) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronPReLU { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronPReLU](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronPReLU_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronPReLU { + instance := CNNNeuronPReLUClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_p_re_lu_node.gen.go b/macos/mps/cnn_neuron_p_re_lu_node.gen.go new file mode 100644 index 00000000..5877f9af --- /dev/null +++ b/macos/mps/cnn_neuron_p_re_lu_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronPReLUNode] class. +var CNNNeuronPReLUNodeClass = _CNNNeuronPReLUNodeClass{objc.GetClass("MPSCNNNeuronPReLUNode")} + +type _CNNNeuronPReLUNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronPReLUNode] class. +type ICNNNeuronPReLUNode interface { + ICNNNeuronNode +} + +// A representation a PReLU neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronprelunode?language=objc +type CNNNeuronPReLUNode struct { + CNNNeuronNode +} + +func CNNNeuronPReLUNodeFrom(ptr unsafe.Pointer) CNNNeuronPReLUNode { + return CNNNeuronPReLUNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronPReLUNodeClass) NodeWithSourceAData(sourceNode INNImageNode, aData []byte) CNNNeuronPReLUNode { + rv := objc.Call[CNNNeuronPReLUNode](cc, objc.Sel("nodeWithSource:aData:"), objc.Ptr(sourceNode), aData) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronprelunode/2921597-nodewithsource?language=objc +func CNNNeuronPReLUNode_NodeWithSourceAData(sourceNode INNImageNode, aData []byte) CNNNeuronPReLUNode { + return CNNNeuronPReLUNodeClass.NodeWithSourceAData(sourceNode, aData) +} + +func (c_ CNNNeuronPReLUNode) InitWithSourceAData(sourceNode INNImageNode, aData []byte) CNNNeuronPReLUNode { + rv := objc.Call[CNNNeuronPReLUNode](c_, objc.Sel("initWithSource:aData:"), objc.Ptr(sourceNode), aData) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronprelunode/2921595-initwithsource?language=objc +func NewCNNNeuronPReLUNodeWithSourceAData(sourceNode INNImageNode, aData []byte) CNNNeuronPReLUNode { + instance := CNNNeuronPReLUNodeClass.Alloc().InitWithSourceAData(sourceNode, aData) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronPReLUNodeClass) Alloc() CNNNeuronPReLUNode { + rv := objc.Call[CNNNeuronPReLUNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronPReLUNode_Alloc() CNNNeuronPReLUNode { + return CNNNeuronPReLUNodeClass.Alloc() +} + +func (cc _CNNNeuronPReLUNodeClass) New() CNNNeuronPReLUNode { + rv := objc.Call[CNNNeuronPReLUNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronPReLUNode() CNNNeuronPReLUNode { + return CNNNeuronPReLUNodeClass.New() +} + +func (c_ CNNNeuronPReLUNode) Init() CNNNeuronPReLUNode { + rv := objc.Call[CNNNeuronPReLUNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronPReLUNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronPReLUNode { + rv := objc.Call[CNNNeuronPReLUNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronPReLUNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronPReLUNode { + return CNNNeuronPReLUNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_power.gen.go b/macos/mps/cnn_neuron_power.gen.go new file mode 100644 index 00000000..a1b0d93f --- /dev/null +++ b/macos/mps/cnn_neuron_power.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronPower] class. +var CNNNeuronPowerClass = _CNNNeuronPowerClass{objc.GetClass("MPSCNNNeuronPower")} + +type _CNNNeuronPowerClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronPower] class. +type ICNNNeuronPower interface { + ICNNNeuron +} + +// A power neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronpower?language=objc +type CNNNeuronPower struct { + CNNNeuron +} + +func CNNNeuronPowerFrom(ptr unsafe.Pointer) CNNNeuronPower { + return CNNNeuronPower{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronPowerClass) Alloc() CNNNeuronPower { + rv := objc.Call[CNNNeuronPower](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronPower_Alloc() CNNNeuronPower { + return CNNNeuronPowerClass.Alloc() +} + +func (cc _CNNNeuronPowerClass) New() CNNNeuronPower { + rv := objc.Call[CNNNeuronPower](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronPower() CNNNeuronPower { + return CNNNeuronPowerClass.New() +} + +func (c_ CNNNeuronPower) Init() CNNNeuronPower { + rv := objc.Call[CNNNeuronPower](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronPower) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronPower { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronPower](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronPowerWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronPower { + instance := CNNNeuronPowerClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronPower) InitWithDevice(device metal.PDevice) CNNNeuronPower { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronPower](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronPowerWithDevice(device metal.PDevice) CNNNeuronPower { + instance := CNNNeuronPowerClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronPower) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronPower { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronPower](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronPower_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronPower { + instance := CNNNeuronPowerClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_power_node.gen.go b/macos/mps/cnn_neuron_power_node.gen.go new file mode 100644 index 00000000..6228d059 --- /dev/null +++ b/macos/mps/cnn_neuron_power_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronPowerNode] class. +var CNNNeuronPowerNodeClass = _CNNNeuronPowerNodeClass{objc.GetClass("MPSCNNNeuronPowerNode")} + +type _CNNNeuronPowerNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronPowerNode] class. +type ICNNNeuronPowerNode interface { + ICNNNeuronNode +} + +// A representation of a power neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronpowernode?language=objc +type CNNNeuronPowerNode struct { + CNNNeuronNode +} + +func CNNNeuronPowerNodeFrom(ptr unsafe.Pointer) CNNNeuronPowerNode { + return CNNNeuronPowerNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronPowerNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronPowerNode { + rv := objc.Call[CNNNeuronPowerNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronpowernode/2951958-nodewithsource?language=objc +func CNNNeuronPowerNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronPowerNode { + return CNNNeuronPowerNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronPowerNode) InitWithSource(sourceNode INNImageNode) CNNNeuronPowerNode { + rv := objc.Call[CNNNeuronPowerNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronpowernode/2951937-initwithsource?language=objc +func NewCNNNeuronPowerNodeWithSource(sourceNode INNImageNode) CNNNeuronPowerNode { + instance := CNNNeuronPowerNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronPowerNodeClass) Alloc() CNNNeuronPowerNode { + rv := objc.Call[CNNNeuronPowerNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronPowerNode_Alloc() CNNNeuronPowerNode { + return CNNNeuronPowerNodeClass.Alloc() +} + +func (cc _CNNNeuronPowerNodeClass) New() CNNNeuronPowerNode { + rv := objc.Call[CNNNeuronPowerNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronPowerNode() CNNNeuronPowerNode { + return CNNNeuronPowerNodeClass.New() +} + +func (c_ CNNNeuronPowerNode) Init() CNNNeuronPowerNode { + rv := objc.Call[CNNNeuronPowerNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronPowerNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronPowerNode { + rv := objc.Call[CNNNeuronPowerNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronPowerNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronPowerNode { + return CNNNeuronPowerNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_re_lu.gen.go b/macos/mps/cnn_neuron_re_lu.gen.go new file mode 100644 index 00000000..1136a7d2 --- /dev/null +++ b/macos/mps/cnn_neuron_re_lu.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronReLU] class. +var CNNNeuronReLUClass = _CNNNeuronReLUClass{objc.GetClass("MPSCNNNeuronReLU")} + +type _CNNNeuronReLUClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronReLU] class. +type ICNNNeuronReLU interface { + ICNNNeuron +} + +// A ReLU (Rectified Linear Unit) neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelu?language=objc +type CNNNeuronReLU struct { + CNNNeuron +} + +func CNNNeuronReLUFrom(ptr unsafe.Pointer) CNNNeuronReLU { + return CNNNeuronReLU{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronReLUClass) Alloc() CNNNeuronReLU { + rv := objc.Call[CNNNeuronReLU](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronReLU_Alloc() CNNNeuronReLU { + return CNNNeuronReLUClass.Alloc() +} + +func (cc _CNNNeuronReLUClass) New() CNNNeuronReLU { + rv := objc.Call[CNNNeuronReLU](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronReLU() CNNNeuronReLU { + return CNNNeuronReLUClass.New() +} + +func (c_ CNNNeuronReLU) Init() CNNNeuronReLU { + rv := objc.Call[CNNNeuronReLU](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronReLU) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronReLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronReLU](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronReLUWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronReLU { + instance := CNNNeuronReLUClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronReLU) InitWithDevice(device metal.PDevice) CNNNeuronReLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronReLU](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronReLUWithDevice(device metal.PDevice) CNNNeuronReLU { + instance := CNNNeuronReLUClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronReLU) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronReLU { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronReLU](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronReLU_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronReLU { + instance := CNNNeuronReLUClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_re_lu_node.gen.go b/macos/mps/cnn_neuron_re_lu_node.gen.go new file mode 100644 index 00000000..cd1491f1 --- /dev/null +++ b/macos/mps/cnn_neuron_re_lu_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronReLUNode] class. +var CNNNeuronReLUNodeClass = _CNNNeuronReLUNodeClass{objc.GetClass("MPSCNNNeuronReLUNode")} + +type _CNNNeuronReLUNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronReLUNode] class. +type ICNNNeuronReLUNode interface { + ICNNNeuronNode +} + +// A representation a ReLU neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelunode?language=objc +type CNNNeuronReLUNode struct { + CNNNeuronNode +} + +func CNNNeuronReLUNodeFrom(ptr unsafe.Pointer) CNNNeuronReLUNode { + return CNNNeuronReLUNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronReLUNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronReLUNode { + rv := objc.Call[CNNNeuronReLUNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelunode/2921460-nodewithsource?language=objc +func CNNNeuronReLUNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronReLUNode { + return CNNNeuronReLUNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronReLUNode) InitWithSource(sourceNode INNImageNode) CNNNeuronReLUNode { + rv := objc.Call[CNNNeuronReLUNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelunode/2921464-initwithsource?language=objc +func NewCNNNeuronReLUNodeWithSource(sourceNode INNImageNode) CNNNeuronReLUNode { + instance := CNNNeuronReLUNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronReLUNodeClass) Alloc() CNNNeuronReLUNode { + rv := objc.Call[CNNNeuronReLUNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronReLUNode_Alloc() CNNNeuronReLUNode { + return CNNNeuronReLUNodeClass.Alloc() +} + +func (cc _CNNNeuronReLUNodeClass) New() CNNNeuronReLUNode { + rv := objc.Call[CNNNeuronReLUNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronReLUNode() CNNNeuronReLUNode { + return CNNNeuronReLUNodeClass.New() +} + +func (c_ CNNNeuronReLUNode) Init() CNNNeuronReLUNode { + rv := objc.Call[CNNNeuronReLUNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronReLUNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronReLUNode { + rv := objc.Call[CNNNeuronReLUNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronReLUNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronReLUNode { + return CNNNeuronReLUNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_re_lun.gen.go b/macos/mps/cnn_neuron_re_lun.gen.go new file mode 100644 index 00000000..6a900d81 --- /dev/null +++ b/macos/mps/cnn_neuron_re_lun.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronReLUN] class. +var CNNNeuronReLUNClass = _CNNNeuronReLUNClass{objc.GetClass("MPSCNNNeuronReLUN")} + +type _CNNNeuronReLUNClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronReLUN] class. +type ICNNNeuronReLUN interface { + ICNNNeuron +} + +// A ReLUN neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelun?language=objc +type CNNNeuronReLUN struct { + CNNNeuron +} + +func CNNNeuronReLUNFrom(ptr unsafe.Pointer) CNNNeuronReLUN { + return CNNNeuronReLUN{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronReLUNClass) Alloc() CNNNeuronReLUN { + rv := objc.Call[CNNNeuronReLUN](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronReLUN_Alloc() CNNNeuronReLUN { + return CNNNeuronReLUNClass.Alloc() +} + +func (cc _CNNNeuronReLUNClass) New() CNNNeuronReLUN { + rv := objc.Call[CNNNeuronReLUN](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronReLUN() CNNNeuronReLUN { + return CNNNeuronReLUNClass.New() +} + +func (c_ CNNNeuronReLUN) Init() CNNNeuronReLUN { + rv := objc.Call[CNNNeuronReLUN](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronReLUN) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronReLUN { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronReLUN](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronReLUNWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronReLUN { + instance := CNNNeuronReLUNClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronReLUN) InitWithDevice(device metal.PDevice) CNNNeuronReLUN { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronReLUN](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronReLUNWithDevice(device metal.PDevice) CNNNeuronReLUN { + instance := CNNNeuronReLUNClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronReLUN) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronReLUN { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronReLUN](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronReLUN_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronReLUN { + instance := CNNNeuronReLUNClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_re_lun_node.gen.go b/macos/mps/cnn_neuron_re_lun_node.gen.go new file mode 100644 index 00000000..7ae9cf2e --- /dev/null +++ b/macos/mps/cnn_neuron_re_lun_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronReLUNNode] class. +var CNNNeuronReLUNNodeClass = _CNNNeuronReLUNNodeClass{objc.GetClass("MPSCNNNeuronReLUNNode")} + +type _CNNNeuronReLUNNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronReLUNNode] class. +type ICNNNeuronReLUNNode interface { + ICNNNeuronNode +} + +// A representation a ReLUN neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelunnode?language=objc +type CNNNeuronReLUNNode struct { + CNNNeuronNode +} + +func CNNNeuronReLUNNodeFrom(ptr unsafe.Pointer) CNNNeuronReLUNNode { + return CNNNeuronReLUNNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronReLUNNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronReLUNNode { + rv := objc.Call[CNNNeuronReLUNNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelunnode/2921594-nodewithsource?language=objc +func CNNNeuronReLUNNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronReLUNNode { + return CNNNeuronReLUNNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronReLUNNode) InitWithSource(sourceNode INNImageNode) CNNNeuronReLUNNode { + rv := objc.Call[CNNNeuronReLUNNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronrelunnode/2921593-initwithsource?language=objc +func NewCNNNeuronReLUNNodeWithSource(sourceNode INNImageNode) CNNNeuronReLUNNode { + instance := CNNNeuronReLUNNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronReLUNNodeClass) Alloc() CNNNeuronReLUNNode { + rv := objc.Call[CNNNeuronReLUNNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronReLUNNode_Alloc() CNNNeuronReLUNNode { + return CNNNeuronReLUNNodeClass.Alloc() +} + +func (cc _CNNNeuronReLUNNodeClass) New() CNNNeuronReLUNNode { + rv := objc.Call[CNNNeuronReLUNNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronReLUNNode() CNNNeuronReLUNNode { + return CNNNeuronReLUNNodeClass.New() +} + +func (c_ CNNNeuronReLUNNode) Init() CNNNeuronReLUNNode { + rv := objc.Call[CNNNeuronReLUNNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronReLUNNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronReLUNNode { + rv := objc.Call[CNNNeuronReLUNNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronReLUNNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronReLUNNode { + return CNNNeuronReLUNNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_sigmoid.gen.go b/macos/mps/cnn_neuron_sigmoid.gen.go new file mode 100644 index 00000000..78698848 --- /dev/null +++ b/macos/mps/cnn_neuron_sigmoid.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronSigmoid] class. +var CNNNeuronSigmoidClass = _CNNNeuronSigmoidClass{objc.GetClass("MPSCNNNeuronSigmoid")} + +type _CNNNeuronSigmoidClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronSigmoid] class. +type ICNNNeuronSigmoid interface { + ICNNNeuron +} + +// A sigmoid neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsigmoid?language=objc +type CNNNeuronSigmoid struct { + CNNNeuron +} + +func CNNNeuronSigmoidFrom(ptr unsafe.Pointer) CNNNeuronSigmoid { + return CNNNeuronSigmoid{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronSigmoidClass) Alloc() CNNNeuronSigmoid { + rv := objc.Call[CNNNeuronSigmoid](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronSigmoid_Alloc() CNNNeuronSigmoid { + return CNNNeuronSigmoidClass.Alloc() +} + +func (cc _CNNNeuronSigmoidClass) New() CNNNeuronSigmoid { + rv := objc.Call[CNNNeuronSigmoid](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronSigmoid() CNNNeuronSigmoid { + return CNNNeuronSigmoidClass.New() +} + +func (c_ CNNNeuronSigmoid) Init() CNNNeuronSigmoid { + rv := objc.Call[CNNNeuronSigmoid](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronSigmoid) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronSigmoid { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSigmoid](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronSigmoidWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronSigmoid { + instance := CNNNeuronSigmoidClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronSigmoid) InitWithDevice(device metal.PDevice) CNNNeuronSigmoid { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSigmoid](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronSigmoidWithDevice(device metal.PDevice) CNNNeuronSigmoid { + instance := CNNNeuronSigmoidClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronSigmoid) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronSigmoid { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSigmoid](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronSigmoid_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronSigmoid { + instance := CNNNeuronSigmoidClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_sigmoid_node.gen.go b/macos/mps/cnn_neuron_sigmoid_node.gen.go new file mode 100644 index 00000000..7eed51c4 --- /dev/null +++ b/macos/mps/cnn_neuron_sigmoid_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronSigmoidNode] class. +var CNNNeuronSigmoidNodeClass = _CNNNeuronSigmoidNodeClass{objc.GetClass("MPSCNNNeuronSigmoidNode")} + +type _CNNNeuronSigmoidNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronSigmoidNode] class. +type ICNNNeuronSigmoidNode interface { + ICNNNeuronNode +} + +// A representation of a sigmoid neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsigmoidnode?language=objc +type CNNNeuronSigmoidNode struct { + CNNNeuronNode +} + +func CNNNeuronSigmoidNodeFrom(ptr unsafe.Pointer) CNNNeuronSigmoidNode { + return CNNNeuronSigmoidNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronSigmoidNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronSigmoidNode { + rv := objc.Call[CNNNeuronSigmoidNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsigmoidnode/2866467-nodewithsource?language=objc +func CNNNeuronSigmoidNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronSigmoidNode { + return CNNNeuronSigmoidNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronSigmoidNode) InitWithSource(sourceNode INNImageNode) CNNNeuronSigmoidNode { + rv := objc.Call[CNNNeuronSigmoidNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsigmoidnode/2921458-initwithsource?language=objc +func NewCNNNeuronSigmoidNodeWithSource(sourceNode INNImageNode) CNNNeuronSigmoidNode { + instance := CNNNeuronSigmoidNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronSigmoidNodeClass) Alloc() CNNNeuronSigmoidNode { + rv := objc.Call[CNNNeuronSigmoidNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronSigmoidNode_Alloc() CNNNeuronSigmoidNode { + return CNNNeuronSigmoidNodeClass.Alloc() +} + +func (cc _CNNNeuronSigmoidNodeClass) New() CNNNeuronSigmoidNode { + rv := objc.Call[CNNNeuronSigmoidNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronSigmoidNode() CNNNeuronSigmoidNode { + return CNNNeuronSigmoidNodeClass.New() +} + +func (c_ CNNNeuronSigmoidNode) Init() CNNNeuronSigmoidNode { + rv := objc.Call[CNNNeuronSigmoidNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronSigmoidNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronSigmoidNode { + rv := objc.Call[CNNNeuronSigmoidNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronSigmoidNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronSigmoidNode { + return CNNNeuronSigmoidNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_soft_plus.gen.go b/macos/mps/cnn_neuron_soft_plus.gen.go new file mode 100644 index 00000000..b023762a --- /dev/null +++ b/macos/mps/cnn_neuron_soft_plus.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronSoftPlus] class. +var CNNNeuronSoftPlusClass = _CNNNeuronSoftPlusClass{objc.GetClass("MPSCNNNeuronSoftPlus")} + +type _CNNNeuronSoftPlusClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronSoftPlus] class. +type ICNNNeuronSoftPlus interface { + ICNNNeuron +} + +// A parametric softplus neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftplus?language=objc +type CNNNeuronSoftPlus struct { + CNNNeuron +} + +func CNNNeuronSoftPlusFrom(ptr unsafe.Pointer) CNNNeuronSoftPlus { + return CNNNeuronSoftPlus{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronSoftPlusClass) Alloc() CNNNeuronSoftPlus { + rv := objc.Call[CNNNeuronSoftPlus](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronSoftPlus_Alloc() CNNNeuronSoftPlus { + return CNNNeuronSoftPlusClass.Alloc() +} + +func (cc _CNNNeuronSoftPlusClass) New() CNNNeuronSoftPlus { + rv := objc.Call[CNNNeuronSoftPlus](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronSoftPlus() CNNNeuronSoftPlus { + return CNNNeuronSoftPlusClass.New() +} + +func (c_ CNNNeuronSoftPlus) Init() CNNNeuronSoftPlus { + rv := objc.Call[CNNNeuronSoftPlus](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronSoftPlus) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronSoftPlus { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSoftPlus](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronSoftPlusWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronSoftPlus { + instance := CNNNeuronSoftPlusClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronSoftPlus) InitWithDevice(device metal.PDevice) CNNNeuronSoftPlus { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSoftPlus](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronSoftPlusWithDevice(device metal.PDevice) CNNNeuronSoftPlus { + instance := CNNNeuronSoftPlusClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronSoftPlus) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronSoftPlus { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSoftPlus](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronSoftPlus_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronSoftPlus { + instance := CNNNeuronSoftPlusClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_soft_plus_node.gen.go b/macos/mps/cnn_neuron_soft_plus_node.gen.go new file mode 100644 index 00000000..fad066f1 --- /dev/null +++ b/macos/mps/cnn_neuron_soft_plus_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronSoftPlusNode] class. +var CNNNeuronSoftPlusNodeClass = _CNNNeuronSoftPlusNodeClass{objc.GetClass("MPSCNNNeuronSoftPlusNode")} + +type _CNNNeuronSoftPlusNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronSoftPlusNode] class. +type ICNNNeuronSoftPlusNode interface { + ICNNNeuronNode +} + +// A representation of a parametric softplus neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftplusnode?language=objc +type CNNNeuronSoftPlusNode struct { + CNNNeuronNode +} + +func CNNNeuronSoftPlusNodeFrom(ptr unsafe.Pointer) CNNNeuronSoftPlusNode { + return CNNNeuronSoftPlusNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronSoftPlusNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronSoftPlusNode { + rv := objc.Call[CNNNeuronSoftPlusNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftplusnode/2921449-nodewithsource?language=objc +func CNNNeuronSoftPlusNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronSoftPlusNode { + return CNNNeuronSoftPlusNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronSoftPlusNode) InitWithSource(sourceNode INNImageNode) CNNNeuronSoftPlusNode { + rv := objc.Call[CNNNeuronSoftPlusNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftplusnode/2921457-initwithsource?language=objc +func NewCNNNeuronSoftPlusNodeWithSource(sourceNode INNImageNode) CNNNeuronSoftPlusNode { + instance := CNNNeuronSoftPlusNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronSoftPlusNodeClass) Alloc() CNNNeuronSoftPlusNode { + rv := objc.Call[CNNNeuronSoftPlusNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronSoftPlusNode_Alloc() CNNNeuronSoftPlusNode { + return CNNNeuronSoftPlusNodeClass.Alloc() +} + +func (cc _CNNNeuronSoftPlusNodeClass) New() CNNNeuronSoftPlusNode { + rv := objc.Call[CNNNeuronSoftPlusNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronSoftPlusNode() CNNNeuronSoftPlusNode { + return CNNNeuronSoftPlusNodeClass.New() +} + +func (c_ CNNNeuronSoftPlusNode) Init() CNNNeuronSoftPlusNode { + rv := objc.Call[CNNNeuronSoftPlusNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronSoftPlusNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronSoftPlusNode { + rv := objc.Call[CNNNeuronSoftPlusNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronSoftPlusNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronSoftPlusNode { + return CNNNeuronSoftPlusNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_soft_sign.gen.go b/macos/mps/cnn_neuron_soft_sign.gen.go new file mode 100644 index 00000000..c076e88a --- /dev/null +++ b/macos/mps/cnn_neuron_soft_sign.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronSoftSign] class. +var CNNNeuronSoftSignClass = _CNNNeuronSoftSignClass{objc.GetClass("MPSCNNNeuronSoftSign")} + +type _CNNNeuronSoftSignClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronSoftSign] class. +type ICNNNeuronSoftSign interface { + ICNNNeuron +} + +// A softsign neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftsign?language=objc +type CNNNeuronSoftSign struct { + CNNNeuron +} + +func CNNNeuronSoftSignFrom(ptr unsafe.Pointer) CNNNeuronSoftSign { + return CNNNeuronSoftSign{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronSoftSignClass) Alloc() CNNNeuronSoftSign { + rv := objc.Call[CNNNeuronSoftSign](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronSoftSign_Alloc() CNNNeuronSoftSign { + return CNNNeuronSoftSignClass.Alloc() +} + +func (cc _CNNNeuronSoftSignClass) New() CNNNeuronSoftSign { + rv := objc.Call[CNNNeuronSoftSign](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronSoftSign() CNNNeuronSoftSign { + return CNNNeuronSoftSignClass.New() +} + +func (c_ CNNNeuronSoftSign) Init() CNNNeuronSoftSign { + rv := objc.Call[CNNNeuronSoftSign](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronSoftSign) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronSoftSign { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSoftSign](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronSoftSignWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronSoftSign { + instance := CNNNeuronSoftSignClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronSoftSign) InitWithDevice(device metal.PDevice) CNNNeuronSoftSign { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSoftSign](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronSoftSignWithDevice(device metal.PDevice) CNNNeuronSoftSign { + instance := CNNNeuronSoftSignClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronSoftSign) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronSoftSign { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronSoftSign](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronSoftSign_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronSoftSign { + instance := CNNNeuronSoftSignClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_soft_sign_node.gen.go b/macos/mps/cnn_neuron_soft_sign_node.gen.go new file mode 100644 index 00000000..86a443fb --- /dev/null +++ b/macos/mps/cnn_neuron_soft_sign_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronSoftSignNode] class. +var CNNNeuronSoftSignNodeClass = _CNNNeuronSoftSignNodeClass{objc.GetClass("MPSCNNNeuronSoftSignNode")} + +type _CNNNeuronSoftSignNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronSoftSignNode] class. +type ICNNNeuronSoftSignNode interface { + ICNNNeuronNode +} + +// A representation of a softsign neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftsignnode?language=objc +type CNNNeuronSoftSignNode struct { + CNNNeuronNode +} + +func CNNNeuronSoftSignNodeFrom(ptr unsafe.Pointer) CNNNeuronSoftSignNode { + return CNNNeuronSoftSignNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronSoftSignNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronSoftSignNode { + rv := objc.Call[CNNNeuronSoftSignNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftsignnode/2866428-nodewithsource?language=objc +func CNNNeuronSoftSignNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronSoftSignNode { + return CNNNeuronSoftSignNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronSoftSignNode) InitWithSource(sourceNode INNImageNode) CNNNeuronSoftSignNode { + rv := objc.Call[CNNNeuronSoftSignNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronsoftsignnode/2921463-initwithsource?language=objc +func NewCNNNeuronSoftSignNodeWithSource(sourceNode INNImageNode) CNNNeuronSoftSignNode { + instance := CNNNeuronSoftSignNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronSoftSignNodeClass) Alloc() CNNNeuronSoftSignNode { + rv := objc.Call[CNNNeuronSoftSignNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronSoftSignNode_Alloc() CNNNeuronSoftSignNode { + return CNNNeuronSoftSignNodeClass.Alloc() +} + +func (cc _CNNNeuronSoftSignNodeClass) New() CNNNeuronSoftSignNode { + rv := objc.Call[CNNNeuronSoftSignNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronSoftSignNode() CNNNeuronSoftSignNode { + return CNNNeuronSoftSignNodeClass.New() +} + +func (c_ CNNNeuronSoftSignNode) Init() CNNNeuronSoftSignNode { + rv := objc.Call[CNNNeuronSoftSignNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronSoftSignNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronSoftSignNode { + rv := objc.Call[CNNNeuronSoftSignNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronSoftSignNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronSoftSignNode { + return CNNNeuronSoftSignNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_neuron_tan_h.gen.go b/macos/mps/cnn_neuron_tan_h.gen.go new file mode 100644 index 00000000..d21f6da6 --- /dev/null +++ b/macos/mps/cnn_neuron_tan_h.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronTanH] class. +var CNNNeuronTanHClass = _CNNNeuronTanHClass{objc.GetClass("MPSCNNNeuronTanH")} + +type _CNNNeuronTanHClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronTanH] class. +type ICNNNeuronTanH interface { + ICNNNeuron +} + +// A hyperbolic tangent neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurontanh?language=objc +type CNNNeuronTanH struct { + CNNNeuron +} + +func CNNNeuronTanHFrom(ptr unsafe.Pointer) CNNNeuronTanH { + return CNNNeuronTanH{ + CNNNeuron: CNNNeuronFrom(ptr), + } +} + +func (cc _CNNNeuronTanHClass) Alloc() CNNNeuronTanH { + rv := objc.Call[CNNNeuronTanH](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronTanH_Alloc() CNNNeuronTanH { + return CNNNeuronTanHClass.Alloc() +} + +func (cc _CNNNeuronTanHClass) New() CNNNeuronTanH { + rv := objc.Call[CNNNeuronTanH](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronTanH() CNNNeuronTanH { + return CNNNeuronTanHClass.New() +} + +func (c_ CNNNeuronTanH) Init() CNNNeuronTanH { + rv := objc.Call[CNNNeuronTanH](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNeuronTanH) InitWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronTanH { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronTanH](c_, objc.Sel("initWithDevice:neuronDescriptor:"), po0, objc.Ptr(neuronDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuron/2942315-initwithdevice?language=objc +func NewCNNNeuronTanHWithDeviceNeuronDescriptor(device metal.PDevice, neuronDescriptor INNNeuronDescriptor) CNNNeuronTanH { + instance := CNNNeuronTanHClass.Alloc().InitWithDeviceNeuronDescriptor(device, neuronDescriptor) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronTanH) InitWithDevice(device metal.PDevice) CNNNeuronTanH { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronTanH](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNNeuronTanHWithDevice(device metal.PDevice) CNNNeuronTanH { + instance := CNNNeuronTanHClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNNeuronTanH) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronTanH { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNeuronTanH](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNNeuronTanH_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNNeuronTanH { + instance := CNNNeuronTanHClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_neuron_tan_h_node.gen.go b/macos/mps/cnn_neuron_tan_h_node.gen.go new file mode 100644 index 00000000..87bb1ca4 --- /dev/null +++ b/macos/mps/cnn_neuron_tan_h_node.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNeuronTanHNode] class. +var CNNNeuronTanHNodeClass = _CNNNeuronTanHNodeClass{objc.GetClass("MPSCNNNeuronTanHNode")} + +type _CNNNeuronTanHNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNeuronTanHNode] class. +type ICNNNeuronTanHNode interface { + ICNNNeuronNode +} + +// A representation of a hyperbolic tangent neuron filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurontanhnode?language=objc +type CNNNeuronTanHNode struct { + CNNNeuronNode +} + +func CNNNeuronTanHNodeFrom(ptr unsafe.Pointer) CNNNeuronTanHNode { + return CNNNeuronTanHNode{ + CNNNeuronNode: CNNNeuronNodeFrom(ptr), + } +} + +func (cc _CNNNeuronTanHNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNeuronTanHNode { + rv := objc.Call[CNNNeuronTanHNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurontanhnode/2921451-nodewithsource?language=objc +func CNNNeuronTanHNode_NodeWithSource(sourceNode INNImageNode) CNNNeuronTanHNode { + return CNNNeuronTanHNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNeuronTanHNode) InitWithSource(sourceNode INNImageNode) CNNNeuronTanHNode { + rv := objc.Call[CNNNeuronTanHNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurontanhnode/2921465-initwithsource?language=objc +func NewCNNNeuronTanHNodeWithSource(sourceNode INNImageNode) CNNNeuronTanHNode { + instance := CNNNeuronTanHNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNeuronTanHNodeClass) Alloc() CNNNeuronTanHNode { + rv := objc.Call[CNNNeuronTanHNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNeuronTanHNode_Alloc() CNNNeuronTanHNode { + return CNNNeuronTanHNodeClass.Alloc() +} + +func (cc _CNNNeuronTanHNodeClass) New() CNNNeuronTanHNode { + rv := objc.Call[CNNNeuronTanHNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNeuronTanHNode() CNNNeuronTanHNode { + return CNNNeuronTanHNodeClass.New() +} + +func (c_ CNNNeuronTanHNode) Init() CNNNeuronTanHNode { + rv := objc.Call[CNNNeuronTanHNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNNeuronTanHNodeClass) NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronTanHNode { + rv := objc.Call[CNNNeuronTanHNode](cc, objc.Sel("nodeWithSource:descriptor:"), objc.Ptr(sourceNode), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneuronnode/3019333-nodewithsource?language=objc +func CNNNeuronTanHNode_NodeWithSourceDescriptor(sourceNode INNImageNode, descriptor INNNeuronDescriptor) CNNNeuronTanHNode { + return CNNNeuronTanHNodeClass.NodeWithSourceDescriptor(sourceNode, descriptor) +} diff --git a/macos/mps/cnn_normalization_gamma_and_beta_state.gen.go b/macos/mps/cnn_normalization_gamma_and_beta_state.gen.go new file mode 100644 index 00000000..d7ebba10 --- /dev/null +++ b/macos/mps/cnn_normalization_gamma_and_beta_state.gen.go @@ -0,0 +1,163 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNormalizationGammaAndBetaState] class. +var CNNNormalizationGammaAndBetaStateClass = _CNNNormalizationGammaAndBetaStateClass{objc.GetClass("MPSCNNNormalizationGammaAndBetaState")} + +type _CNNNormalizationGammaAndBetaStateClass struct { + objc.Class +} + +// An interface definition for the [CNNNormalizationGammaAndBetaState] class. +type ICNNNormalizationGammaAndBetaState interface { + IState + Beta() metal.BufferWrapper + Gamma() metal.BufferWrapper +} + +// An object that stores gamma and beta terms used to apply a scale and bias in instance- or batch-normalization operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationgammaandbetastate?language=objc +type CNNNormalizationGammaAndBetaState struct { + State +} + +func CNNNormalizationGammaAndBetaStateFrom(ptr unsafe.Pointer) CNNNormalizationGammaAndBetaState { + return CNNNormalizationGammaAndBetaState{ + State: StateFrom(ptr), + } +} + +func (c_ CNNNormalizationGammaAndBetaState) InitWithGammaBeta(gamma metal.PBuffer, beta metal.PBuffer) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLBuffer", gamma) + po1 := objc.WrapAsProtocol("MTLBuffer", beta) + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("initWithGamma:beta:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationgammaandbetastate/2953936-initwithgamma?language=objc +func NewCNNNormalizationGammaAndBetaStateWithGammaBeta(gamma metal.PBuffer, beta metal.PBuffer) CNNNormalizationGammaAndBetaState { + instance := CNNNormalizationGammaAndBetaStateClass.Alloc().InitWithGammaBeta(gamma, beta) + instance.Autorelease() + return instance +} + +func (cc _CNNNormalizationGammaAndBetaStateClass) TemporaryStateWithCommandBufferNumberOfFeatureChannels(commandBuffer metal.PCommandBuffer, numberOfFeatureChannels uint) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationGammaAndBetaState](cc, objc.Sel("temporaryStateWithCommandBuffer:numberOfFeatureChannels:"), po0, numberOfFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationgammaandbetastate/2953937-temporarystatewithcommandbuffer?language=objc +func CNNNormalizationGammaAndBetaState_TemporaryStateWithCommandBufferNumberOfFeatureChannels(commandBuffer metal.PCommandBuffer, numberOfFeatureChannels uint) CNNNormalizationGammaAndBetaState { + return CNNNormalizationGammaAndBetaStateClass.TemporaryStateWithCommandBufferNumberOfFeatureChannels(commandBuffer, numberOfFeatureChannels) +} + +func (cc _CNNNormalizationGammaAndBetaStateClass) Alloc() CNNNormalizationGammaAndBetaState { + rv := objc.Call[CNNNormalizationGammaAndBetaState](cc, objc.Sel("alloc")) + return rv +} + +func CNNNormalizationGammaAndBetaState_Alloc() CNNNormalizationGammaAndBetaState { + return CNNNormalizationGammaAndBetaStateClass.Alloc() +} + +func (cc _CNNNormalizationGammaAndBetaStateClass) New() CNNNormalizationGammaAndBetaState { + rv := objc.Call[CNNNormalizationGammaAndBetaState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNormalizationGammaAndBetaState() CNNNormalizationGammaAndBetaState { + return CNNNormalizationGammaAndBetaStateClass.New() +} + +func (c_ CNNNormalizationGammaAndBetaState) Init() CNNNormalizationGammaAndBetaState { + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNormalizationGammaAndBetaState) InitWithResources(resources []metal.PResource) CNNNormalizationGammaAndBetaState { + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNNormalizationGammaAndBetaStateWithResources(resources []metal.PResource) CNNNormalizationGammaAndBetaState { + instance := CNNNormalizationGammaAndBetaStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNNormalizationGammaAndBetaState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNNormalizationGammaAndBetaStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNNormalizationGammaAndBetaState { + instance := CNNNormalizationGammaAndBetaStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNNormalizationGammaAndBetaState) InitWithResource(resource metal.PResource) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNNormalizationGammaAndBetaState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNNormalizationGammaAndBetaStateWithResource(resource metal.PResource) CNNNormalizationGammaAndBetaState { + instance := CNNNormalizationGammaAndBetaStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNNormalizationGammaAndBetaStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNNormalizationGammaAndBetaState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationGammaAndBetaState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNNormalizationGammaAndBetaState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNNormalizationGammaAndBetaState { + return CNNNormalizationGammaAndBetaStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationgammaandbetastate/2953938-beta?language=objc +func (c_ CNNNormalizationGammaAndBetaState) Beta() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationgammaandbetastate/2953934-gamma?language=objc +func (c_ CNNNormalizationGammaAndBetaState) Gamma() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("gamma")) + return rv +} diff --git a/macos/mps/cnn_normalization_mean_and_variance_state.gen.go b/macos/mps/cnn_normalization_mean_and_variance_state.gen.go new file mode 100644 index 00000000..0ce21a8d --- /dev/null +++ b/macos/mps/cnn_normalization_mean_and_variance_state.gen.go @@ -0,0 +1,163 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNormalizationMeanAndVarianceState] class. +var CNNNormalizationMeanAndVarianceStateClass = _CNNNormalizationMeanAndVarianceStateClass{objc.GetClass("MPSCNNNormalizationMeanAndVarianceState")} + +type _CNNNormalizationMeanAndVarianceStateClass struct { + objc.Class +} + +// An interface definition for the [CNNNormalizationMeanAndVarianceState] class. +type ICNNNormalizationMeanAndVarianceState interface { + IState + Variance() metal.BufferWrapper + Mean() metal.BufferWrapper +} + +// An object that stores mean and variance terms used to execute batch normalization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationmeanandvariancestate?language=objc +type CNNNormalizationMeanAndVarianceState struct { + State +} + +func CNNNormalizationMeanAndVarianceStateFrom(ptr unsafe.Pointer) CNNNormalizationMeanAndVarianceState { + return CNNNormalizationMeanAndVarianceState{ + State: StateFrom(ptr), + } +} + +func (c_ CNNNormalizationMeanAndVarianceState) InitWithMeanVariance(mean metal.PBuffer, variance metal.PBuffer) CNNNormalizationMeanAndVarianceState { + po0 := objc.WrapAsProtocol("MTLBuffer", mean) + po1 := objc.WrapAsProtocol("MTLBuffer", variance) + rv := objc.Call[CNNNormalizationMeanAndVarianceState](c_, objc.Sel("initWithMean:variance:"), po0, po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationmeanandvariancestate/3002363-initwithmean?language=objc +func NewCNNNormalizationMeanAndVarianceStateWithMeanVariance(mean metal.PBuffer, variance metal.PBuffer) CNNNormalizationMeanAndVarianceState { + instance := CNNNormalizationMeanAndVarianceStateClass.Alloc().InitWithMeanVariance(mean, variance) + instance.Autorelease() + return instance +} + +func (cc _CNNNormalizationMeanAndVarianceStateClass) TemporaryStateWithCommandBufferNumberOfFeatureChannels(commandBuffer metal.PCommandBuffer, numberOfFeatureChannels uint) CNNNormalizationMeanAndVarianceState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationMeanAndVarianceState](cc, objc.Sel("temporaryStateWithCommandBuffer:numberOfFeatureChannels:"), po0, numberOfFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationmeanandvariancestate/3002365-temporarystatewithcommandbuffer?language=objc +func CNNNormalizationMeanAndVarianceState_TemporaryStateWithCommandBufferNumberOfFeatureChannels(commandBuffer metal.PCommandBuffer, numberOfFeatureChannels uint) CNNNormalizationMeanAndVarianceState { + return CNNNormalizationMeanAndVarianceStateClass.TemporaryStateWithCommandBufferNumberOfFeatureChannels(commandBuffer, numberOfFeatureChannels) +} + +func (cc _CNNNormalizationMeanAndVarianceStateClass) Alloc() CNNNormalizationMeanAndVarianceState { + rv := objc.Call[CNNNormalizationMeanAndVarianceState](cc, objc.Sel("alloc")) + return rv +} + +func CNNNormalizationMeanAndVarianceState_Alloc() CNNNormalizationMeanAndVarianceState { + return CNNNormalizationMeanAndVarianceStateClass.Alloc() +} + +func (cc _CNNNormalizationMeanAndVarianceStateClass) New() CNNNormalizationMeanAndVarianceState { + rv := objc.Call[CNNNormalizationMeanAndVarianceState](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNormalizationMeanAndVarianceState() CNNNormalizationMeanAndVarianceState { + return CNNNormalizationMeanAndVarianceStateClass.New() +} + +func (c_ CNNNormalizationMeanAndVarianceState) Init() CNNNormalizationMeanAndVarianceState { + rv := objc.Call[CNNNormalizationMeanAndVarianceState](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNNormalizationMeanAndVarianceState) InitWithResources(resources []metal.PResource) CNNNormalizationMeanAndVarianceState { + rv := objc.Call[CNNNormalizationMeanAndVarianceState](c_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewCNNNormalizationMeanAndVarianceStateWithResources(resources []metal.PResource) CNNNormalizationMeanAndVarianceState { + instance := CNNNormalizationMeanAndVarianceStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (c_ CNNNormalizationMeanAndVarianceState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNNormalizationMeanAndVarianceState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNNormalizationMeanAndVarianceState](c_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewCNNNormalizationMeanAndVarianceStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) CNNNormalizationMeanAndVarianceState { + instance := CNNNormalizationMeanAndVarianceStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (c_ CNNNormalizationMeanAndVarianceState) InitWithResource(resource metal.PResource) CNNNormalizationMeanAndVarianceState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[CNNNormalizationMeanAndVarianceState](c_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewCNNNormalizationMeanAndVarianceStateWithResource(resource metal.PResource) CNNNormalizationMeanAndVarianceState { + instance := CNNNormalizationMeanAndVarianceStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (cc _CNNNormalizationMeanAndVarianceStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNNormalizationMeanAndVarianceState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CNNNormalizationMeanAndVarianceState](cc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func CNNNormalizationMeanAndVarianceState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) CNNNormalizationMeanAndVarianceState { + return CNNNormalizationMeanAndVarianceStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationmeanandvariancestate/3002366-variance?language=objc +func (c_ CNNNormalizationMeanAndVarianceState) Variance() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("variance")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationmeanandvariancestate/3002364-mean?language=objc +func (c_ CNNNormalizationMeanAndVarianceState) Mean() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](c_, objc.Sel("mean")) + return rv +} diff --git a/macos/mps/cnn_normalization_node.gen.go b/macos/mps/cnn_normalization_node.gen.go new file mode 100644 index 00000000..10a7c0a6 --- /dev/null +++ b/macos/mps/cnn_normalization_node.gen.go @@ -0,0 +1,135 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNNormalizationNode] class. +var CNNNormalizationNodeClass = _CNNNormalizationNodeClass{objc.GetClass("MPSCNNNormalizationNode")} + +type _CNNNormalizationNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNNormalizationNode] class. +type ICNNNormalizationNode interface { + INNFilterNode + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// Virtual base class for CNN normalization nodes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode?language=objc +type CNNNormalizationNode struct { + NNFilterNode +} + +func CNNNormalizationNodeFrom(ptr unsafe.Pointer) CNNNormalizationNode { + return CNNNormalizationNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNNormalizationNodeClass) NodeWithSource(sourceNode INNImageNode) CNNNormalizationNode { + rv := objc.Call[CNNNormalizationNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866460-nodewithsource?language=objc +func CNNNormalizationNode_NodeWithSource(sourceNode INNImageNode) CNNNormalizationNode { + return CNNNormalizationNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNNormalizationNode) InitWithSource(sourceNode INNImageNode) CNNNormalizationNode { + rv := objc.Call[CNNNormalizationNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866425-initwithsource?language=objc +func NewCNNNormalizationNodeWithSource(sourceNode INNImageNode) CNNNormalizationNode { + instance := CNNNormalizationNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNNormalizationNodeClass) Alloc() CNNNormalizationNode { + rv := objc.Call[CNNNormalizationNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNNormalizationNode_Alloc() CNNNormalizationNode { + return CNNNormalizationNodeClass.Alloc() +} + +func (cc _CNNNormalizationNodeClass) New() CNNNormalizationNode { + rv := objc.Call[CNNNormalizationNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNNormalizationNode() CNNNormalizationNode { + return CNNNormalizationNodeClass.New() +} + +func (c_ CNNNormalizationNode) Init() CNNNormalizationNode { + rv := objc.Call[CNNNormalizationNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866497-beta?language=objc +func (c_ CNNNormalizationNode) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866497-beta?language=objc +func (c_ CNNNormalizationNode) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866482-delta?language=objc +func (c_ CNNNormalizationNode) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866482-delta?language=objc +func (c_ CNNNormalizationNode) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866474-alpha?language=objc +func (c_ CNNNormalizationNode) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866474-alpha?language=objc +func (c_ CNNNormalizationNode) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/cnn_pooling.gen.go b/macos/mps/cnn_pooling.gen.go new file mode 100644 index 00000000..5575abef --- /dev/null +++ b/macos/mps/cnn_pooling.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPooling] class. +var CNNPoolingClass = _CNNPoolingClass{objc.GetClass("MPSCNNPooling")} + +type _CNNPoolingClass struct { + objc.Class +} + +// An interface definition for the [CNNPooling] class. +type ICNNPooling interface { + ICNNKernel +} + +// A pooling kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpooling?language=objc +type CNNPooling struct { + CNNKernel +} + +func CNNPoolingFrom(ptr unsafe.Pointer) CNNPooling { + return CNNPooling{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNPooling) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPooling { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPooling](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// Initializes a pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpooling/1648902-initwithdevice?language=objc +func NewCNNPoolingWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPooling { + instance := CNNPoolingClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingClass) Alloc() CNNPooling { + rv := objc.Call[CNNPooling](cc, objc.Sel("alloc")) + return rv +} + +func CNNPooling_Alloc() CNNPooling { + return CNNPoolingClass.Alloc() +} + +func (cc _CNNPoolingClass) New() CNNPooling { + rv := objc.Call[CNNPooling](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPooling() CNNPooling { + return CNNPoolingClass.New() +} + +func (c_ CNNPooling) Init() CNNPooling { + rv := objc.Call[CNNPooling](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPooling) InitWithDevice(device metal.PDevice) CNNPooling { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPooling](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNPoolingWithDevice(device metal.PDevice) CNNPooling { + instance := CNNPoolingClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPooling) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPooling { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPooling](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPooling_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPooling { + instance := CNNPoolingClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_average.gen.go b/macos/mps/cnn_pooling_average.gen.go new file mode 100644 index 00000000..dbe07261 --- /dev/null +++ b/macos/mps/cnn_pooling_average.gen.go @@ -0,0 +1,139 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingAverage] class. +var CNNPoolingAverageClass = _CNNPoolingAverageClass{objc.GetClass("MPSCNNPoolingAverage")} + +type _CNNPoolingAverageClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingAverage] class. +type ICNNPoolingAverage interface { + ICNNPooling + ZeroPadSizeX() uint + SetZeroPadSizeX(value uint) + ZeroPadSizeY() uint + SetZeroPadSizeY(value uint) +} + +// An average pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaverage?language=objc +type CNNPoolingAverage struct { + CNNPooling +} + +func CNNPoolingAverageFrom(ptr unsafe.Pointer) CNNPoolingAverage { + return CNNPoolingAverage{ + CNNPooling: CNNPoolingFrom(ptr), + } +} + +func (c_ CNNPoolingAverage) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingAverage { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingAverage](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// Initializes an average pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaverage/2875216-initwithdevice?language=objc +func NewCNNPoolingAverageWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingAverage { + instance := CNNPoolingAverageClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingAverageClass) Alloc() CNNPoolingAverage { + rv := objc.Call[CNNPoolingAverage](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingAverage_Alloc() CNNPoolingAverage { + return CNNPoolingAverageClass.Alloc() +} + +func (cc _CNNPoolingAverageClass) New() CNNPoolingAverage { + rv := objc.Call[CNNPoolingAverage](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingAverage() CNNPoolingAverage { + return CNNPoolingAverageClass.New() +} + +func (c_ CNNPoolingAverage) Init() CNNPoolingAverage { + rv := objc.Call[CNNPoolingAverage](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingAverage) InitWithDevice(device metal.PDevice) CNNPoolingAverage { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingAverage](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNPoolingAverageWithDevice(device metal.PDevice) CNNPoolingAverage { + instance := CNNPoolingAverageClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingAverage) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingAverage { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingAverage](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPoolingAverage_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingAverage { + instance := CNNPoolingAverageClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaverage/2875207-zeropadsizex?language=objc +func (c_ CNNPoolingAverage) ZeroPadSizeX() uint { + rv := objc.Call[uint](c_, objc.Sel("zeroPadSizeX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaverage/2875207-zeropadsizex?language=objc +func (c_ CNNPoolingAverage) SetZeroPadSizeX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setZeroPadSizeX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaverage/2875221-zeropadsizey?language=objc +func (c_ CNNPoolingAverage) ZeroPadSizeY() uint { + rv := objc.Call[uint](c_, objc.Sel("zeroPadSizeY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaverage/2875221-zeropadsizey?language=objc +func (c_ CNNPoolingAverage) SetZeroPadSizeY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setZeroPadSizeY:"), value) +} diff --git a/macos/mps/cnn_pooling_average_gradient.gen.go b/macos/mps/cnn_pooling_average_gradient.gen.go new file mode 100644 index 00000000..8d861d41 --- /dev/null +++ b/macos/mps/cnn_pooling_average_gradient.gen.go @@ -0,0 +1,154 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingAverageGradient] class. +var CNNPoolingAverageGradientClass = _CNNPoolingAverageGradientClass{objc.GetClass("MPSCNNPoolingAverageGradient")} + +type _CNNPoolingAverageGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingAverageGradient] class. +type ICNNPoolingAverageGradient interface { + ICNNPoolingGradient + ZeroPadSizeX() uint + SetZeroPadSizeX(value uint) + ZeroPadSizeY() uint + SetZeroPadSizeY(value uint) +} + +// A gradient average pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragegradient?language=objc +type CNNPoolingAverageGradient struct { + CNNPoolingGradient +} + +func CNNPoolingAverageGradientFrom(ptr unsafe.Pointer) CNNPoolingAverageGradient { + return CNNPoolingAverageGradient{ + CNNPoolingGradient: CNNPoolingGradientFrom(ptr), + } +} + +func (c_ CNNPoolingAverageGradient) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingAverageGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingAverageGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragegradient/2942339-initwithdevice?language=objc +func NewCNNPoolingAverageGradientWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingAverageGradient { + instance := CNNPoolingAverageGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingAverageGradientClass) Alloc() CNNPoolingAverageGradient { + rv := objc.Call[CNNPoolingAverageGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingAverageGradient_Alloc() CNNPoolingAverageGradient { + return CNNPoolingAverageGradientClass.Alloc() +} + +func (cc _CNNPoolingAverageGradientClass) New() CNNPoolingAverageGradient { + rv := objc.Call[CNNPoolingAverageGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingAverageGradient() CNNPoolingAverageGradient { + return CNNPoolingAverageGradientClass.New() +} + +func (c_ CNNPoolingAverageGradient) Init() CNNPoolingAverageGradient { + rv := objc.Call[CNNPoolingAverageGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingAverageGradient) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingAverageGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingAverageGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient/2942337-initwithdevice?language=objc +func NewCNNPoolingAverageGradientWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingAverageGradient { + instance := CNNPoolingAverageGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingAverageGradient) InitWithDevice(device metal.PDevice) CNNPoolingAverageGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingAverageGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNPoolingAverageGradientWithDevice(device metal.PDevice) CNNPoolingAverageGradient { + instance := CNNPoolingAverageGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingAverageGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingAverageGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingAverageGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPoolingAverageGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingAverageGradient { + instance := CNNPoolingAverageGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragegradient/2942341-zeropadsizex?language=objc +func (c_ CNNPoolingAverageGradient) ZeroPadSizeX() uint { + rv := objc.Call[uint](c_, objc.Sel("zeroPadSizeX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragegradient/2942341-zeropadsizex?language=objc +func (c_ CNNPoolingAverageGradient) SetZeroPadSizeX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setZeroPadSizeX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragegradient/2942354-zeropadsizey?language=objc +func (c_ CNNPoolingAverageGradient) ZeroPadSizeY() uint { + rv := objc.Call[uint](c_, objc.Sel("zeroPadSizeY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragegradient/2942354-zeropadsizey?language=objc +func (c_ CNNPoolingAverageGradient) SetZeroPadSizeY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setZeroPadSizeY:"), value) +} diff --git a/macos/mps/cnn_pooling_average_gradient_node.gen.go b/macos/mps/cnn_pooling_average_gradient_node.gen.go new file mode 100644 index 00000000..edf3e5d0 --- /dev/null +++ b/macos/mps/cnn_pooling_average_gradient_node.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingAverageGradientNode] class. +var CNNPoolingAverageGradientNodeClass = _CNNPoolingAverageGradientNodeClass{objc.GetClass("MPSCNNPoolingAverageGradientNode")} + +type _CNNPoolingAverageGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingAverageGradientNode] class. +type ICNNPoolingAverageGradientNode interface { + ICNNPoolingGradientNode +} + +// A representation of a gradient average pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragegradientnode?language=objc +type CNNPoolingAverageGradientNode struct { + CNNPoolingGradientNode +} + +func CNNPoolingAverageGradientNodeFrom(ptr unsafe.Pointer) CNNPoolingAverageGradientNode { + return CNNPoolingAverageGradientNode{ + CNNPoolingGradientNode: CNNPoolingGradientNodeFrom(ptr), + } +} + +func (cc _CNNPoolingAverageGradientNodeClass) Alloc() CNNPoolingAverageGradientNode { + rv := objc.Call[CNNPoolingAverageGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingAverageGradientNode_Alloc() CNNPoolingAverageGradientNode { + return CNNPoolingAverageGradientNodeClass.Alloc() +} + +func (cc _CNNPoolingAverageGradientNodeClass) New() CNNPoolingAverageGradientNode { + rv := objc.Call[CNNPoolingAverageGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingAverageGradientNode() CNNPoolingAverageGradientNode { + return CNNPoolingAverageGradientNodeClass.New() +} + +func (c_ CNNPoolingAverageGradientNode) Init() CNNPoolingAverageGradientNode { + rv := objc.Call[CNNPoolingAverageGradientNode](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingAverageGradientNode) InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingAverageGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingAverageGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948011-initwithsourcegradient?language=objc +func NewCNNPoolingAverageGradientNodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingAverageGradientNode { + instance := CNNPoolingAverageGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingAverageGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingAverageGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingAverageGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948045-nodewithsourcegradient?language=objc +func CNNPoolingAverageGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingAverageGradientNode { + return CNNPoolingAverageGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) +} diff --git a/macos/mps/cnn_pooling_average_node.gen.go b/macos/mps/cnn_pooling_average_node.gen.go new file mode 100644 index 00000000..a2554c5f --- /dev/null +++ b/macos/mps/cnn_pooling_average_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingAverageNode] class. +var CNNPoolingAverageNodeClass = _CNNPoolingAverageNodeClass{objc.GetClass("MPSCNNPoolingAverageNode")} + +type _CNNPoolingAverageNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingAverageNode] class. +type ICNNPoolingAverageNode interface { + ICNNPoolingNode +} + +// A representation of an average pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingaveragenode?language=objc +type CNNPoolingAverageNode struct { + CNNPoolingNode +} + +func CNNPoolingAverageNodeFrom(ptr unsafe.Pointer) CNNPoolingAverageNode { + return CNNPoolingAverageNode{ + CNNPoolingNode: CNNPoolingNodeFrom(ptr), + } +} + +func (cc _CNNPoolingAverageNodeClass) Alloc() CNNPoolingAverageNode { + rv := objc.Call[CNNPoolingAverageNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingAverageNode_Alloc() CNNPoolingAverageNode { + return CNNPoolingAverageNodeClass.Alloc() +} + +func (cc _CNNPoolingAverageNodeClass) New() CNNPoolingAverageNode { + rv := objc.Call[CNNPoolingAverageNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingAverageNode() CNNPoolingAverageNode { + return CNNPoolingAverageNodeClass.New() +} + +func (c_ CNNPoolingAverageNode) Init() CNNPoolingAverageNode { + rv := objc.Call[CNNPoolingAverageNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNPoolingAverageNodeClass) NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingAverageNode { + rv := objc.Call[CNNPoolingAverageNode](cc, objc.Sel("nodeWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866508-nodewithsource?language=objc +func CNNPoolingAverageNode_NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingAverageNode { + return CNNPoolingAverageNodeClass.NodeWithSourceFilterSize(sourceNode, size) +} + +func (c_ CNNPoolingAverageNode) InitWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingAverageNode { + rv := objc.Call[CNNPoolingAverageNode](c_, objc.Sel("initWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866488-initwithsource?language=objc +func NewCNNPoolingAverageNodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingAverageNode { + instance := CNNPoolingAverageNodeClass.Alloc().InitWithSourceFilterSize(sourceNode, size) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_gradient.gen.go b/macos/mps/cnn_pooling_gradient.gen.go new file mode 100644 index 00000000..9bd444d0 --- /dev/null +++ b/macos/mps/cnn_pooling_gradient.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingGradient] class. +var CNNPoolingGradientClass = _CNNPoolingGradientClass{objc.GetClass("MPSCNNPoolingGradient")} + +type _CNNPoolingGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingGradient] class. +type ICNNPoolingGradient interface { + ICNNGradientKernel + SourceSize() metal.Size + SetSourceSize(value metal.Size) +} + +// A gradient pooling kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient?language=objc +type CNNPoolingGradient struct { + CNNGradientKernel +} + +func CNNPoolingGradientFrom(ptr unsafe.Pointer) CNNPoolingGradient { + return CNNPoolingGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNPoolingGradient) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient/2942337-initwithdevice?language=objc +func NewCNNPoolingGradientWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingGradient { + instance := CNNPoolingGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingGradientClass) Alloc() CNNPoolingGradient { + rv := objc.Call[CNNPoolingGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingGradient_Alloc() CNNPoolingGradient { + return CNNPoolingGradientClass.Alloc() +} + +func (cc _CNNPoolingGradientClass) New() CNNPoolingGradient { + rv := objc.Call[CNNPoolingGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingGradient() CNNPoolingGradient { + return CNNPoolingGradientClass.New() +} + +func (c_ CNNPoolingGradient) Init() CNNPoolingGradient { + rv := objc.Call[CNNPoolingGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingGradient) InitWithDevice(device metal.PDevice) CNNPoolingGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNPoolingGradientWithDevice(device metal.PDevice) CNNPoolingGradient { + instance := CNNPoolingGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPoolingGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingGradient { + instance := CNNPoolingGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient/2942343-sourcesize?language=objc +func (c_ CNNPoolingGradient) SourceSize() metal.Size { + rv := objc.Call[metal.Size](c_, objc.Sel("sourceSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient/2942343-sourcesize?language=objc +func (c_ CNNPoolingGradient) SetSourceSize(value metal.Size) { + objc.Call[objc.Void](c_, objc.Sel("setSourceSize:"), value) +} diff --git a/macos/mps/cnn_pooling_gradient_node.gen.go b/macos/mps/cnn_pooling_gradient_node.gen.go new file mode 100644 index 00000000..6037a530 --- /dev/null +++ b/macos/mps/cnn_pooling_gradient_node.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingGradientNode] class. +var CNNPoolingGradientNodeClass = _CNNPoolingGradientNodeClass{objc.GetClass("MPSCNNPoolingGradientNode")} + +type _CNNPoolingGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingGradientNode] class. +type ICNNPoolingGradientNode interface { + INNGradientFilterNode + StrideInPixelsY() uint + StrideInPixelsX() uint + KernelHeight() uint + KernelWidth() uint +} + +// A representation of a gradient pooling kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode?language=objc +type CNNPoolingGradientNode struct { + NNGradientFilterNode +} + +func CNNPoolingGradientNodeFrom(ptr unsafe.Pointer) CNNPoolingGradientNode { + return CNNPoolingGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNPoolingGradientNode) InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948011-initwithsourcegradient?language=objc +func NewCNNPoolingGradientNodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingGradientNode { + instance := CNNPoolingGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948045-nodewithsourcegradient?language=objc +func CNNPoolingGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingGradientNode { + return CNNPoolingGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) +} + +func (cc _CNNPoolingGradientNodeClass) Alloc() CNNPoolingGradientNode { + rv := objc.Call[CNNPoolingGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingGradientNode_Alloc() CNNPoolingGradientNode { + return CNNPoolingGradientNodeClass.Alloc() +} + +func (cc _CNNPoolingGradientNodeClass) New() CNNPoolingGradientNode { + rv := objc.Call[CNNPoolingGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingGradientNode() CNNPoolingGradientNode { + return CNNPoolingGradientNodeClass.New() +} + +func (c_ CNNPoolingGradientNode) Init() CNNPoolingGradientNode { + rv := objc.Call[CNNPoolingGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948048-strideinpixelsy?language=objc +func (c_ CNNPoolingGradientNode) StrideInPixelsY() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948018-strideinpixelsx?language=objc +func (c_ CNNPoolingGradientNode) StrideInPixelsX() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2947992-kernelheight?language=objc +func (c_ CNNPoolingGradientNode) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948034-kernelwidth?language=objc +func (c_ CNNPoolingGradientNode) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/cnn_pooling_l2_norm.gen.go b/macos/mps/cnn_pooling_l2_norm.gen.go new file mode 100644 index 00000000..0a371abc --- /dev/null +++ b/macos/mps/cnn_pooling_l2_norm.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingL2Norm] class. +var CNNPoolingL2NormClass = _CNNPoolingL2NormClass{objc.GetClass("MPSCNNPoolingL2Norm")} + +type _CNNPoolingL2NormClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingL2Norm] class. +type ICNNPoolingL2Norm interface { + ICNNPooling +} + +// An L2-norm pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingl2norm?language=objc +type CNNPoolingL2Norm struct { + CNNPooling +} + +func CNNPoolingL2NormFrom(ptr unsafe.Pointer) CNNPoolingL2Norm { + return CNNPoolingL2Norm{ + CNNPooling: CNNPoolingFrom(ptr), + } +} + +func (c_ CNNPoolingL2Norm) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingL2Norm { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingL2Norm](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// Initializes an L2-norm pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingl2norm/2875162-initwithdevice?language=objc +func NewCNNPoolingL2NormWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingL2Norm { + instance := CNNPoolingL2NormClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingL2NormClass) Alloc() CNNPoolingL2Norm { + rv := objc.Call[CNNPoolingL2Norm](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingL2Norm_Alloc() CNNPoolingL2Norm { + return CNNPoolingL2NormClass.Alloc() +} + +func (cc _CNNPoolingL2NormClass) New() CNNPoolingL2Norm { + rv := objc.Call[CNNPoolingL2Norm](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingL2Norm() CNNPoolingL2Norm { + return CNNPoolingL2NormClass.New() +} + +func (c_ CNNPoolingL2Norm) Init() CNNPoolingL2Norm { + rv := objc.Call[CNNPoolingL2Norm](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingL2Norm) InitWithDevice(device metal.PDevice) CNNPoolingL2Norm { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingL2Norm](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNPoolingL2NormWithDevice(device metal.PDevice) CNNPoolingL2Norm { + instance := CNNPoolingL2NormClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingL2Norm) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingL2Norm { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingL2Norm](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPoolingL2Norm_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingL2Norm { + instance := CNNPoolingL2NormClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_l2_norm_gradient.gen.go b/macos/mps/cnn_pooling_l2_norm_gradient.gen.go new file mode 100644 index 00000000..8701d168 --- /dev/null +++ b/macos/mps/cnn_pooling_l2_norm_gradient.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingL2NormGradient] class. +var CNNPoolingL2NormGradientClass = _CNNPoolingL2NormGradientClass{objc.GetClass("MPSCNNPoolingL2NormGradient")} + +type _CNNPoolingL2NormGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingL2NormGradient] class. +type ICNNPoolingL2NormGradient interface { + ICNNPoolingGradient +} + +// A gradient L2-norm pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingl2normgradient?language=objc +type CNNPoolingL2NormGradient struct { + CNNPoolingGradient +} + +func CNNPoolingL2NormGradientFrom(ptr unsafe.Pointer) CNNPoolingL2NormGradient { + return CNNPoolingL2NormGradient{ + CNNPoolingGradient: CNNPoolingGradientFrom(ptr), + } +} + +func (c_ CNNPoolingL2NormGradient) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingL2NormGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingL2NormGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingl2normgradient/2942355-initwithdevice?language=objc +func NewCNNPoolingL2NormGradientWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingL2NormGradient { + instance := CNNPoolingL2NormGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingL2NormGradientClass) Alloc() CNNPoolingL2NormGradient { + rv := objc.Call[CNNPoolingL2NormGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingL2NormGradient_Alloc() CNNPoolingL2NormGradient { + return CNNPoolingL2NormGradientClass.Alloc() +} + +func (cc _CNNPoolingL2NormGradientClass) New() CNNPoolingL2NormGradient { + rv := objc.Call[CNNPoolingL2NormGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingL2NormGradient() CNNPoolingL2NormGradient { + return CNNPoolingL2NormGradientClass.New() +} + +func (c_ CNNPoolingL2NormGradient) Init() CNNPoolingL2NormGradient { + rv := objc.Call[CNNPoolingL2NormGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingL2NormGradient) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingL2NormGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingL2NormGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient/2942337-initwithdevice?language=objc +func NewCNNPoolingL2NormGradientWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingL2NormGradient { + instance := CNNPoolingL2NormGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingL2NormGradient) InitWithDevice(device metal.PDevice) CNNPoolingL2NormGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingL2NormGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNPoolingL2NormGradientWithDevice(device metal.PDevice) CNNPoolingL2NormGradient { + instance := CNNPoolingL2NormGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingL2NormGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingL2NormGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingL2NormGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPoolingL2NormGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingL2NormGradient { + instance := CNNPoolingL2NormGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_l2_norm_gradient_node.gen.go b/macos/mps/cnn_pooling_l2_norm_gradient_node.gen.go new file mode 100644 index 00000000..ec914571 --- /dev/null +++ b/macos/mps/cnn_pooling_l2_norm_gradient_node.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingL2NormGradientNode] class. +var CNNPoolingL2NormGradientNodeClass = _CNNPoolingL2NormGradientNodeClass{objc.GetClass("MPSCNNPoolingL2NormGradientNode")} + +type _CNNPoolingL2NormGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingL2NormGradientNode] class. +type ICNNPoolingL2NormGradientNode interface { + ICNNPoolingGradientNode +} + +// A representation of a gradient L2-norm pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingl2normgradientnode?language=objc +type CNNPoolingL2NormGradientNode struct { + CNNPoolingGradientNode +} + +func CNNPoolingL2NormGradientNodeFrom(ptr unsafe.Pointer) CNNPoolingL2NormGradientNode { + return CNNPoolingL2NormGradientNode{ + CNNPoolingGradientNode: CNNPoolingGradientNodeFrom(ptr), + } +} + +func (cc _CNNPoolingL2NormGradientNodeClass) Alloc() CNNPoolingL2NormGradientNode { + rv := objc.Call[CNNPoolingL2NormGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingL2NormGradientNode_Alloc() CNNPoolingL2NormGradientNode { + return CNNPoolingL2NormGradientNodeClass.Alloc() +} + +func (cc _CNNPoolingL2NormGradientNodeClass) New() CNNPoolingL2NormGradientNode { + rv := objc.Call[CNNPoolingL2NormGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingL2NormGradientNode() CNNPoolingL2NormGradientNode { + return CNNPoolingL2NormGradientNodeClass.New() +} + +func (c_ CNNPoolingL2NormGradientNode) Init() CNNPoolingL2NormGradientNode { + rv := objc.Call[CNNPoolingL2NormGradientNode](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingL2NormGradientNode) InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingL2NormGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingL2NormGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948011-initwithsourcegradient?language=objc +func NewCNNPoolingL2NormGradientNodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingL2NormGradientNode { + instance := CNNPoolingL2NormGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingL2NormGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingL2NormGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingL2NormGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948045-nodewithsourcegradient?language=objc +func CNNPoolingL2NormGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingL2NormGradientNode { + return CNNPoolingL2NormGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) +} diff --git a/macos/mps/cnn_pooling_l2_norm_node.gen.go b/macos/mps/cnn_pooling_l2_norm_node.gen.go new file mode 100644 index 00000000..3d776c7c --- /dev/null +++ b/macos/mps/cnn_pooling_l2_norm_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingL2NormNode] class. +var CNNPoolingL2NormNodeClass = _CNNPoolingL2NormNodeClass{objc.GetClass("MPSCNNPoolingL2NormNode")} + +type _CNNPoolingL2NormNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingL2NormNode] class. +type ICNNPoolingL2NormNode interface { + ICNNPoolingNode +} + +// A representation of a L2-norm pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingl2normnode?language=objc +type CNNPoolingL2NormNode struct { + CNNPoolingNode +} + +func CNNPoolingL2NormNodeFrom(ptr unsafe.Pointer) CNNPoolingL2NormNode { + return CNNPoolingL2NormNode{ + CNNPoolingNode: CNNPoolingNodeFrom(ptr), + } +} + +func (cc _CNNPoolingL2NormNodeClass) Alloc() CNNPoolingL2NormNode { + rv := objc.Call[CNNPoolingL2NormNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingL2NormNode_Alloc() CNNPoolingL2NormNode { + return CNNPoolingL2NormNodeClass.Alloc() +} + +func (cc _CNNPoolingL2NormNodeClass) New() CNNPoolingL2NormNode { + rv := objc.Call[CNNPoolingL2NormNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingL2NormNode() CNNPoolingL2NormNode { + return CNNPoolingL2NormNodeClass.New() +} + +func (c_ CNNPoolingL2NormNode) Init() CNNPoolingL2NormNode { + rv := objc.Call[CNNPoolingL2NormNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNPoolingL2NormNodeClass) NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingL2NormNode { + rv := objc.Call[CNNPoolingL2NormNode](cc, objc.Sel("nodeWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866508-nodewithsource?language=objc +func CNNPoolingL2NormNode_NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingL2NormNode { + return CNNPoolingL2NormNodeClass.NodeWithSourceFilterSize(sourceNode, size) +} + +func (c_ CNNPoolingL2NormNode) InitWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingL2NormNode { + rv := objc.Call[CNNPoolingL2NormNode](c_, objc.Sel("initWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866488-initwithsource?language=objc +func NewCNNPoolingL2NormNodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingL2NormNode { + instance := CNNPoolingL2NormNodeClass.Alloc().InitWithSourceFilterSize(sourceNode, size) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_max.gen.go b/macos/mps/cnn_pooling_max.gen.go new file mode 100644 index 00000000..2a76440c --- /dev/null +++ b/macos/mps/cnn_pooling_max.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingMax] class. +var CNNPoolingMaxClass = _CNNPoolingMaxClass{objc.GetClass("MPSCNNPoolingMax")} + +type _CNNPoolingMaxClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingMax] class. +type ICNNPoolingMax interface { + ICNNPooling +} + +// A max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingmax?language=objc +type CNNPoolingMax struct { + CNNPooling +} + +func CNNPoolingMaxFrom(ptr unsafe.Pointer) CNNPoolingMax { + return CNNPoolingMax{ + CNNPooling: CNNPoolingFrom(ptr), + } +} + +func (c_ CNNPoolingMax) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingMax](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// Initializes a max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingmax/2875151-initwithdevice?language=objc +func NewCNNPoolingMaxWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingMax { + instance := CNNPoolingMaxClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingMaxClass) Alloc() CNNPoolingMax { + rv := objc.Call[CNNPoolingMax](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingMax_Alloc() CNNPoolingMax { + return CNNPoolingMaxClass.Alloc() +} + +func (cc _CNNPoolingMaxClass) New() CNNPoolingMax { + rv := objc.Call[CNNPoolingMax](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingMax() CNNPoolingMax { + return CNNPoolingMaxClass.New() +} + +func (c_ CNNPoolingMax) Init() CNNPoolingMax { + rv := objc.Call[CNNPoolingMax](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingMax) InitWithDevice(device metal.PDevice) CNNPoolingMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingMax](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNPoolingMaxWithDevice(device metal.PDevice) CNNPoolingMax { + instance := CNNPoolingMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingMax](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPoolingMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingMax { + instance := CNNPoolingMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_max_gradient.gen.go b/macos/mps/cnn_pooling_max_gradient.gen.go new file mode 100644 index 00000000..b5efdc99 --- /dev/null +++ b/macos/mps/cnn_pooling_max_gradient.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingMaxGradient] class. +var CNNPoolingMaxGradientClass = _CNNPoolingMaxGradientClass{objc.GetClass("MPSCNNPoolingMaxGradient")} + +type _CNNPoolingMaxGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingMaxGradient] class. +type ICNNPoolingMaxGradient interface { + ICNNPoolingGradient +} + +// A gradient max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingmaxgradient?language=objc +type CNNPoolingMaxGradient struct { + CNNPoolingGradient +} + +func CNNPoolingMaxGradientFrom(ptr unsafe.Pointer) CNNPoolingMaxGradient { + return CNNPoolingMaxGradient{ + CNNPoolingGradient: CNNPoolingGradientFrom(ptr), + } +} + +func (c_ CNNPoolingMaxGradient) InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingMaxGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:"), po0, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingmaxgradient/2942348-initwithdevice?language=objc +func NewCNNPoolingMaxGradientWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device metal.PDevice, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint) CNNPoolingMaxGradient { + instance := CNNPoolingMaxGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(device, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingMaxGradientClass) Alloc() CNNPoolingMaxGradient { + rv := objc.Call[CNNPoolingMaxGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingMaxGradient_Alloc() CNNPoolingMaxGradient { + return CNNPoolingMaxGradientClass.Alloc() +} + +func (cc _CNNPoolingMaxGradientClass) New() CNNPoolingMaxGradient { + rv := objc.Call[CNNPoolingMaxGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingMaxGradient() CNNPoolingMaxGradient { + return CNNPoolingMaxGradientClass.New() +} + +func (c_ CNNPoolingMaxGradient) Init() CNNPoolingMaxGradient { + rv := objc.Call[CNNPoolingMaxGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingMaxGradient) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingMaxGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradient/2942337-initwithdevice?language=objc +func NewCNNPoolingMaxGradientWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNPoolingMaxGradient { + instance := CNNPoolingMaxGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingMaxGradient) InitWithDevice(device metal.PDevice) CNNPoolingMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingMaxGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNPoolingMaxGradientWithDevice(device metal.PDevice) CNNPoolingMaxGradient { + instance := CNNPoolingMaxGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNPoolingMaxGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingMaxGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNPoolingMaxGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNPoolingMaxGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNPoolingMaxGradient { + instance := CNNPoolingMaxGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_max_gradient_node.gen.go b/macos/mps/cnn_pooling_max_gradient_node.gen.go new file mode 100644 index 00000000..099c2290 --- /dev/null +++ b/macos/mps/cnn_pooling_max_gradient_node.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingMaxGradientNode] class. +var CNNPoolingMaxGradientNodeClass = _CNNPoolingMaxGradientNodeClass{objc.GetClass("MPSCNNPoolingMaxGradientNode")} + +type _CNNPoolingMaxGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingMaxGradientNode] class. +type ICNNPoolingMaxGradientNode interface { + ICNNPoolingGradientNode +} + +// A representation of a gradient max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingmaxgradientnode?language=objc +type CNNPoolingMaxGradientNode struct { + CNNPoolingGradientNode +} + +func CNNPoolingMaxGradientNodeFrom(ptr unsafe.Pointer) CNNPoolingMaxGradientNode { + return CNNPoolingMaxGradientNode{ + CNNPoolingGradientNode: CNNPoolingGradientNodeFrom(ptr), + } +} + +func (cc _CNNPoolingMaxGradientNodeClass) Alloc() CNNPoolingMaxGradientNode { + rv := objc.Call[CNNPoolingMaxGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingMaxGradientNode_Alloc() CNNPoolingMaxGradientNode { + return CNNPoolingMaxGradientNodeClass.Alloc() +} + +func (cc _CNNPoolingMaxGradientNodeClass) New() CNNPoolingMaxGradientNode { + rv := objc.Call[CNNPoolingMaxGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingMaxGradientNode() CNNPoolingMaxGradientNode { + return CNNPoolingMaxGradientNodeClass.New() +} + +func (c_ CNNPoolingMaxGradientNode) Init() CNNPoolingMaxGradientNode { + rv := objc.Call[CNNPoolingMaxGradientNode](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNPoolingMaxGradientNode) InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingMaxGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingMaxGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948011-initwithsourcegradient?language=objc +func NewCNNPoolingMaxGradientNodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingMaxGradientNode { + instance := CNNPoolingMaxGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingMaxGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingMaxGradientNode { + po7 := objc.WrapAsProtocol("MPSNNPadding", paddingPolicy) + rv := objc.Call[CNNPoolingMaxGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:paddingPolicy:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, po7) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolinggradientnode/2948045-nodewithsourcegradient?language=objc +func CNNPoolingMaxGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelWidth uint, kernelHeight uint, strideInPixelsX uint, strideInPixelsY uint, paddingPolicy PNNPadding) CNNPoolingMaxGradientNode { + return CNNPoolingMaxGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelWidthKernelHeightStrideInPixelsXStrideInPixelsYPaddingPolicy(sourceGradient, sourceImage, gradientState, kernelWidth, kernelHeight, strideInPixelsX, strideInPixelsY, paddingPolicy) +} diff --git a/macos/mps/cnn_pooling_max_node.gen.go b/macos/mps/cnn_pooling_max_node.gen.go new file mode 100644 index 00000000..59d00c5a --- /dev/null +++ b/macos/mps/cnn_pooling_max_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingMaxNode] class. +var CNNPoolingMaxNodeClass = _CNNPoolingMaxNodeClass{objc.GetClass("MPSCNNPoolingMaxNode")} + +type _CNNPoolingMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingMaxNode] class. +type ICNNPoolingMaxNode interface { + ICNNPoolingNode +} + +// A representation of a max pooling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingmaxnode?language=objc +type CNNPoolingMaxNode struct { + CNNPoolingNode +} + +func CNNPoolingMaxNodeFrom(ptr unsafe.Pointer) CNNPoolingMaxNode { + return CNNPoolingMaxNode{ + CNNPoolingNode: CNNPoolingNodeFrom(ptr), + } +} + +func (cc _CNNPoolingMaxNodeClass) Alloc() CNNPoolingMaxNode { + rv := objc.Call[CNNPoolingMaxNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingMaxNode_Alloc() CNNPoolingMaxNode { + return CNNPoolingMaxNodeClass.Alloc() +} + +func (cc _CNNPoolingMaxNodeClass) New() CNNPoolingMaxNode { + rv := objc.Call[CNNPoolingMaxNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingMaxNode() CNNPoolingMaxNode { + return CNNPoolingMaxNodeClass.New() +} + +func (c_ CNNPoolingMaxNode) Init() CNNPoolingMaxNode { + rv := objc.Call[CNNPoolingMaxNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNPoolingMaxNodeClass) NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingMaxNode { + rv := objc.Call[CNNPoolingMaxNode](cc, objc.Sel("nodeWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866508-nodewithsource?language=objc +func CNNPoolingMaxNode_NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingMaxNode { + return CNNPoolingMaxNodeClass.NodeWithSourceFilterSize(sourceNode, size) +} + +func (c_ CNNPoolingMaxNode) InitWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingMaxNode { + rv := objc.Call[CNNPoolingMaxNode](c_, objc.Sel("initWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866488-initwithsource?language=objc +func NewCNNPoolingMaxNodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingMaxNode { + instance := CNNPoolingMaxNodeClass.Alloc().InitWithSourceFilterSize(sourceNode, size) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_pooling_node.gen.go b/macos/mps/cnn_pooling_node.gen.go new file mode 100644 index 00000000..20132f7e --- /dev/null +++ b/macos/mps/cnn_pooling_node.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNPoolingNode] class. +var CNNPoolingNodeClass = _CNNPoolingNodeClass{objc.GetClass("MPSCNNPoolingNode")} + +type _CNNPoolingNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNPoolingNode] class. +type ICNNPoolingNode interface { + INNFilterNode + StrideInPixelsY() uint + StrideInPixelsX() uint + KernelHeight() uint + KernelWidth() uint +} + +// A representation of a MPS CNN pooling kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode?language=objc +type CNNPoolingNode struct { + NNFilterNode +} + +func CNNPoolingNodeFrom(ptr unsafe.Pointer) CNNPoolingNode { + return CNNPoolingNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNPoolingNodeClass) NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingNode { + rv := objc.Call[CNNPoolingNode](cc, objc.Sel("nodeWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866508-nodewithsource?language=objc +func CNNPoolingNode_NodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingNode { + return CNNPoolingNodeClass.NodeWithSourceFilterSize(sourceNode, size) +} + +func (c_ CNNPoolingNode) InitWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingNode { + rv := objc.Call[CNNPoolingNode](c_, objc.Sel("initWithSource:filterSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2866488-initwithsource?language=objc +func NewCNNPoolingNodeWithSourceFilterSize(sourceNode INNImageNode, size uint) CNNPoolingNode { + instance := CNNPoolingNodeClass.Alloc().InitWithSourceFilterSize(sourceNode, size) + instance.Autorelease() + return instance +} + +func (cc _CNNPoolingNodeClass) Alloc() CNNPoolingNode { + rv := objc.Call[CNNPoolingNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNPoolingNode_Alloc() CNNPoolingNode { + return CNNPoolingNodeClass.Alloc() +} + +func (cc _CNNPoolingNodeClass) New() CNNPoolingNode { + rv := objc.Call[CNNPoolingNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNPoolingNode() CNNPoolingNode { + return CNNPoolingNodeClass.New() +} + +func (c_ CNNPoolingNode) Init() CNNPoolingNode { + rv := objc.Call[CNNPoolingNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2993004-strideinpixelsy?language=objc +func (c_ CNNPoolingNode) StrideInPixelsY() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2993003-strideinpixelsx?language=objc +func (c_ CNNPoolingNode) StrideInPixelsX() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInPixelsX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2993001-kernelheight?language=objc +func (c_ CNNPoolingNode) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnpoolingnode/2993002-kernelwidth?language=objc +func (c_ CNNPoolingNode) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/cnn_soft_max.gen.go b/macos/mps/cnn_soft_max.gen.go new file mode 100644 index 00000000..a9425530 --- /dev/null +++ b/macos/mps/cnn_soft_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSoftMax] class. +var CNNSoftMaxClass = _CNNSoftMaxClass{objc.GetClass("MPSCNNSoftMax")} + +type _CNNSoftMaxClass struct { + objc.Class +} + +// An interface definition for the [CNNSoftMax] class. +type ICNNSoftMax interface { + ICNNKernel +} + +// A neural transfer function that is useful for classification tasks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmax?language=objc +type CNNSoftMax struct { + CNNKernel +} + +func CNNSoftMaxFrom(ptr unsafe.Pointer) CNNSoftMax { + return CNNSoftMax{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (cc _CNNSoftMaxClass) Alloc() CNNSoftMax { + rv := objc.Call[CNNSoftMax](cc, objc.Sel("alloc")) + return rv +} + +func CNNSoftMax_Alloc() CNNSoftMax { + return CNNSoftMaxClass.Alloc() +} + +func (cc _CNNSoftMaxClass) New() CNNSoftMax { + rv := objc.Call[CNNSoftMax](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSoftMax() CNNSoftMax { + return CNNSoftMaxClass.New() +} + +func (c_ CNNSoftMax) Init() CNNSoftMax { + rv := objc.Call[CNNSoftMax](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNSoftMax) InitWithDevice(device metal.PDevice) CNNSoftMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSoftMax](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNSoftMaxWithDevice(device metal.PDevice) CNNSoftMax { + instance := CNNSoftMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNSoftMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSoftMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSoftMax](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNSoftMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSoftMax { + instance := CNNSoftMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_soft_max_gradient.gen.go b/macos/mps/cnn_soft_max_gradient.gen.go new file mode 100644 index 00000000..d1f51ccb --- /dev/null +++ b/macos/mps/cnn_soft_max_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSoftMaxGradient] class. +var CNNSoftMaxGradientClass = _CNNSoftMaxGradientClass{objc.GetClass("MPSCNNSoftMaxGradient")} + +type _CNNSoftMaxGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNSoftMaxGradient] class. +type ICNNSoftMaxGradient interface { + ICNNGradientKernel +} + +// A gradient softmax filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxgradient?language=objc +type CNNSoftMaxGradient struct { + CNNGradientKernel +} + +func CNNSoftMaxGradientFrom(ptr unsafe.Pointer) CNNSoftMaxGradient { + return CNNSoftMaxGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNSoftMaxGradient) InitWithDevice(device metal.PDevice) CNNSoftMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSoftMaxGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxgradient/2942620-initwithdevice?language=objc +func NewCNNSoftMaxGradientWithDevice(device metal.PDevice) CNNSoftMaxGradient { + instance := CNNSoftMaxGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNSoftMaxGradientClass) Alloc() CNNSoftMaxGradient { + rv := objc.Call[CNNSoftMaxGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNSoftMaxGradient_Alloc() CNNSoftMaxGradient { + return CNNSoftMaxGradientClass.Alloc() +} + +func (cc _CNNSoftMaxGradientClass) New() CNNSoftMaxGradient { + rv := objc.Call[CNNSoftMaxGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSoftMaxGradient() CNNSoftMaxGradient { + return CNNSoftMaxGradientClass.New() +} + +func (c_ CNNSoftMaxGradient) Init() CNNSoftMaxGradient { + rv := objc.Call[CNNSoftMaxGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNSoftMaxGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSoftMaxGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSoftMaxGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNSoftMaxGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSoftMaxGradient { + instance := CNNSoftMaxGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_soft_max_gradient_node.gen.go b/macos/mps/cnn_soft_max_gradient_node.gen.go new file mode 100644 index 00000000..e4efb742 --- /dev/null +++ b/macos/mps/cnn_soft_max_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSoftMaxGradientNode] class. +var CNNSoftMaxGradientNodeClass = _CNNSoftMaxGradientNodeClass{objc.GetClass("MPSCNNSoftMaxGradientNode")} + +type _CNNSoftMaxGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNSoftMaxGradientNode] class. +type ICNNSoftMaxGradientNode interface { + INNGradientFilterNode +} + +// A representation of a gradient softmax filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxgradientnode?language=objc +type CNNSoftMaxGradientNode struct { + NNGradientFilterNode +} + +func CNNSoftMaxGradientNodeFrom(ptr unsafe.Pointer) CNNSoftMaxGradientNode { + return CNNSoftMaxGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNSoftMaxGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNSoftMaxGradientNode { + rv := objc.Call[CNNSoftMaxGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxgradientnode/2948039-initwithsourcegradient?language=objc +func NewCNNSoftMaxGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNSoftMaxGradientNode { + instance := CNNSoftMaxGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (cc _CNNSoftMaxGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNSoftMaxGradientNode { + rv := objc.Call[CNNSoftMaxGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxgradientnode/2947995-nodewithsourcegradient?language=objc +func CNNSoftMaxGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) CNNSoftMaxGradientNode { + return CNNSoftMaxGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (cc _CNNSoftMaxGradientNodeClass) Alloc() CNNSoftMaxGradientNode { + rv := objc.Call[CNNSoftMaxGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNSoftMaxGradientNode_Alloc() CNNSoftMaxGradientNode { + return CNNSoftMaxGradientNodeClass.Alloc() +} + +func (cc _CNNSoftMaxGradientNodeClass) New() CNNSoftMaxGradientNode { + rv := objc.Call[CNNSoftMaxGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSoftMaxGradientNode() CNNSoftMaxGradientNode { + return CNNSoftMaxGradientNodeClass.New() +} + +func (c_ CNNSoftMaxGradientNode) Init() CNNSoftMaxGradientNode { + rv := objc.Call[CNNSoftMaxGradientNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_soft_max_node.gen.go b/macos/mps/cnn_soft_max_node.gen.go new file mode 100644 index 00000000..72195359 --- /dev/null +++ b/macos/mps/cnn_soft_max_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSoftMaxNode] class. +var CNNSoftMaxNodeClass = _CNNSoftMaxNodeClass{objc.GetClass("MPSCNNSoftMaxNode")} + +type _CNNSoftMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNSoftMaxNode] class. +type ICNNSoftMaxNode interface { + INNFilterNode +} + +// A representation of a softmax filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxnode?language=objc +type CNNSoftMaxNode struct { + NNFilterNode +} + +func CNNSoftMaxNodeFrom(ptr unsafe.Pointer) CNNSoftMaxNode { + return CNNSoftMaxNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNSoftMaxNodeClass) NodeWithSource(sourceNode INNImageNode) CNNSoftMaxNode { + rv := objc.Call[CNNSoftMaxNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxnode/2866455-nodewithsource?language=objc +func CNNSoftMaxNode_NodeWithSource(sourceNode INNImageNode) CNNSoftMaxNode { + return CNNSoftMaxNodeClass.NodeWithSource(sourceNode) +} + +func (c_ CNNSoftMaxNode) InitWithSource(sourceNode INNImageNode) CNNSoftMaxNode { + rv := objc.Call[CNNSoftMaxNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmaxnode/2866408-initwithsource?language=objc +func NewCNNSoftMaxNodeWithSource(sourceNode INNImageNode) CNNSoftMaxNode { + instance := CNNSoftMaxNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNSoftMaxNodeClass) Alloc() CNNSoftMaxNode { + rv := objc.Call[CNNSoftMaxNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNSoftMaxNode_Alloc() CNNSoftMaxNode { + return CNNSoftMaxNodeClass.Alloc() +} + +func (cc _CNNSoftMaxNodeClass) New() CNNSoftMaxNode { + rv := objc.Call[CNNSoftMaxNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSoftMaxNode() CNNSoftMaxNode { + return CNNSoftMaxNodeClass.New() +} + +func (c_ CNNSoftMaxNode) Init() CNNSoftMaxNode { + rv := objc.Call[CNNSoftMaxNode](c_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/cnn_spatial_normalization.gen.go b/macos/mps/cnn_spatial_normalization.gen.go new file mode 100644 index 00000000..80682554 --- /dev/null +++ b/macos/mps/cnn_spatial_normalization.gen.go @@ -0,0 +1,156 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSpatialNormalization] class. +var CNNSpatialNormalizationClass = _CNNSpatialNormalizationClass{objc.GetClass("MPSCNNSpatialNormalization")} + +type _CNNSpatialNormalizationClass struct { + objc.Class +} + +// An interface definition for the [CNNSpatialNormalization] class. +type ICNNSpatialNormalization interface { + ICNNKernel + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// A spatial normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization?language=objc +type CNNSpatialNormalization struct { + CNNKernel +} + +func CNNSpatialNormalizationFrom(ptr unsafe.Pointer) CNNSpatialNormalization { + return CNNSpatialNormalization{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNSpatialNormalization) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNSpatialNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSpatialNormalization](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// Initializes a spatial normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization/1648831-initwithdevice?language=objc +func NewCNNSpatialNormalizationWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNSpatialNormalization { + instance := CNNSpatialNormalizationClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (cc _CNNSpatialNormalizationClass) Alloc() CNNSpatialNormalization { + rv := objc.Call[CNNSpatialNormalization](cc, objc.Sel("alloc")) + return rv +} + +func CNNSpatialNormalization_Alloc() CNNSpatialNormalization { + return CNNSpatialNormalizationClass.Alloc() +} + +func (cc _CNNSpatialNormalizationClass) New() CNNSpatialNormalization { + rv := objc.Call[CNNSpatialNormalization](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSpatialNormalization() CNNSpatialNormalization { + return CNNSpatialNormalizationClass.New() +} + +func (c_ CNNSpatialNormalization) Init() CNNSpatialNormalization { + rv := objc.Call[CNNSpatialNormalization](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNSpatialNormalization) InitWithDevice(device metal.PDevice) CNNSpatialNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSpatialNormalization](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNSpatialNormalizationWithDevice(device metal.PDevice) CNNSpatialNormalization { + instance := CNNSpatialNormalizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNSpatialNormalization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSpatialNormalization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSpatialNormalization](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNSpatialNormalization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSpatialNormalization { + instance := CNNSpatialNormalizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The "beta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization/1648936-beta?language=objc +func (c_ CNNSpatialNormalization) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// The "beta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization/1648936-beta?language=objc +func (c_ CNNSpatialNormalization) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// The "delta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization/1648933-delta?language=objc +func (c_ CNNSpatialNormalization) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// The "delta" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization/1648933-delta?language=objc +func (c_ CNNSpatialNormalization) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// The "alpha" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization/1648825-alpha?language=objc +func (c_ CNNSpatialNormalization) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// The "alpha" variable of the kernel function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalization/1648825-alpha?language=objc +func (c_ CNNSpatialNormalization) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/cnn_spatial_normalization_gradient.gen.go b/macos/mps/cnn_spatial_normalization_gradient.gen.go new file mode 100644 index 00000000..7b0c3932 --- /dev/null +++ b/macos/mps/cnn_spatial_normalization_gradient.gen.go @@ -0,0 +1,156 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSpatialNormalizationGradient] class. +var CNNSpatialNormalizationGradientClass = _CNNSpatialNormalizationGradientClass{objc.GetClass("MPSCNNSpatialNormalizationGradient")} + +type _CNNSpatialNormalizationGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNSpatialNormalizationGradient] class. +type ICNNSpatialNormalizationGradient interface { + ICNNGradientKernel + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// A gradient spatial normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient?language=objc +type CNNSpatialNormalizationGradient struct { + CNNGradientKernel +} + +func CNNSpatialNormalizationGradientFrom(ptr unsafe.Pointer) CNNSpatialNormalizationGradient { + return CNNSpatialNormalizationGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (c_ CNNSpatialNormalizationGradient) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNSpatialNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSpatialNormalizationGradient](c_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient/2942461-initwithdevice?language=objc +func NewCNNSpatialNormalizationGradientWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) CNNSpatialNormalizationGradient { + instance := CNNSpatialNormalizationGradientClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (cc _CNNSpatialNormalizationGradientClass) Alloc() CNNSpatialNormalizationGradient { + rv := objc.Call[CNNSpatialNormalizationGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNSpatialNormalizationGradient_Alloc() CNNSpatialNormalizationGradient { + return CNNSpatialNormalizationGradientClass.Alloc() +} + +func (cc _CNNSpatialNormalizationGradientClass) New() CNNSpatialNormalizationGradient { + rv := objc.Call[CNNSpatialNormalizationGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSpatialNormalizationGradient() CNNSpatialNormalizationGradient { + return CNNSpatialNormalizationGradientClass.New() +} + +func (c_ CNNSpatialNormalizationGradient) Init() CNNSpatialNormalizationGradient { + rv := objc.Call[CNNSpatialNormalizationGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNSpatialNormalizationGradient) InitWithDevice(device metal.PDevice) CNNSpatialNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSpatialNormalizationGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNSpatialNormalizationGradientWithDevice(device metal.PDevice) CNNSpatialNormalizationGradient { + instance := CNNSpatialNormalizationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNSpatialNormalizationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSpatialNormalizationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSpatialNormalizationGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNSpatialNormalizationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSpatialNormalizationGradient { + instance := CNNSpatialNormalizationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient/2942470-beta?language=objc +func (c_ CNNSpatialNormalizationGradient) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient/2942470-beta?language=objc +func (c_ CNNSpatialNormalizationGradient) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient/2942486-delta?language=objc +func (c_ CNNSpatialNormalizationGradient) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient/2942486-delta?language=objc +func (c_ CNNSpatialNormalizationGradient) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient/2942478-alpha?language=objc +func (c_ CNNSpatialNormalizationGradient) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradient/2942478-alpha?language=objc +func (c_ CNNSpatialNormalizationGradient) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/cnn_spatial_normalization_gradient_node.gen.go b/macos/mps/cnn_spatial_normalization_gradient_node.gen.go new file mode 100644 index 00000000..68668088 --- /dev/null +++ b/macos/mps/cnn_spatial_normalization_gradient_node.gen.go @@ -0,0 +1,169 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSpatialNormalizationGradientNode] class. +var CNNSpatialNormalizationGradientNodeClass = _CNNSpatialNormalizationGradientNodeClass{objc.GetClass("MPSCNNSpatialNormalizationGradientNode")} + +type _CNNSpatialNormalizationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNSpatialNormalizationGradientNode] class. +type ICNNSpatialNormalizationGradientNode interface { + INNGradientFilterNode + Beta() float64 + SetBeta(value float64) + Delta() float64 + SetDelta(value float64) + Alpha() float64 + SetAlpha(value float64) + KernelHeight() uint + SetKernelHeight(value uint) + KernelWidth() uint + SetKernelWidth(value uint) +} + +// A representation of a gradient spatial normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode?language=objc +type CNNSpatialNormalizationGradientNode struct { + NNGradientFilterNode +} + +func CNNSpatialNormalizationGradientNodeFrom(ptr unsafe.Pointer) CNNSpatialNormalizationGradientNode { + return CNNSpatialNormalizationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNSpatialNormalizationGradientNode) InitWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNSpatialNormalizationGradientNode { + rv := objc.Call[CNNSpatialNormalizationGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:kernelSize:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948009-initwithsourcegradient?language=objc +func NewCNNSpatialNormalizationGradientNodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNSpatialNormalizationGradientNode { + instance := CNNSpatialNormalizationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient, sourceImage, gradientState, kernelSize) + instance.Autorelease() + return instance +} + +func (cc _CNNSpatialNormalizationGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNSpatialNormalizationGradientNode { + rv := objc.Call[CNNSpatialNormalizationGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:kernelSize:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2947978-nodewithsourcegradient?language=objc +func CNNSpatialNormalizationGradientNode_NodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, kernelSize uint) CNNSpatialNormalizationGradientNode { + return CNNSpatialNormalizationGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateKernelSize(sourceGradient, sourceImage, gradientState, kernelSize) +} + +func (cc _CNNSpatialNormalizationGradientNodeClass) Alloc() CNNSpatialNormalizationGradientNode { + rv := objc.Call[CNNSpatialNormalizationGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNSpatialNormalizationGradientNode_Alloc() CNNSpatialNormalizationGradientNode { + return CNNSpatialNormalizationGradientNodeClass.Alloc() +} + +func (cc _CNNSpatialNormalizationGradientNodeClass) New() CNNSpatialNormalizationGradientNode { + rv := objc.Call[CNNSpatialNormalizationGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSpatialNormalizationGradientNode() CNNSpatialNormalizationGradientNode { + return CNNSpatialNormalizationGradientNodeClass.New() +} + +func (c_ CNNSpatialNormalizationGradientNode) Init() CNNSpatialNormalizationGradientNode { + rv := objc.Call[CNNSpatialNormalizationGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948006-beta?language=objc +func (c_ CNNSpatialNormalizationGradientNode) Beta() float64 { + rv := objc.Call[float64](c_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948006-beta?language=objc +func (c_ CNNSpatialNormalizationGradientNode) SetBeta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setBeta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2947968-delta?language=objc +func (c_ CNNSpatialNormalizationGradientNode) Delta() float64 { + rv := objc.Call[float64](c_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2947968-delta?language=objc +func (c_ CNNSpatialNormalizationGradientNode) SetDelta(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948027-alpha?language=objc +func (c_ CNNSpatialNormalizationGradientNode) Alpha() float64 { + rv := objc.Call[float64](c_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948027-alpha?language=objc +func (c_ CNNSpatialNormalizationGradientNode) SetAlpha(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setAlpha:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948020-kernelheight?language=objc +func (c_ CNNSpatialNormalizationGradientNode) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948020-kernelheight?language=objc +func (c_ CNNSpatialNormalizationGradientNode) SetKernelHeight(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelHeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948013-kernelwidth?language=objc +func (c_ CNNSpatialNormalizationGradientNode) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationgradientnode/2948013-kernelwidth?language=objc +func (c_ CNNSpatialNormalizationGradientNode) SetKernelWidth(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelWidth:"), value) +} diff --git a/macos/mps/cnn_spatial_normalization_node.gen.go b/macos/mps/cnn_spatial_normalization_node.gen.go new file mode 100644 index 00000000..37cfa36f --- /dev/null +++ b/macos/mps/cnn_spatial_normalization_node.gen.go @@ -0,0 +1,130 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSpatialNormalizationNode] class. +var CNNSpatialNormalizationNodeClass = _CNNSpatialNormalizationNodeClass{objc.GetClass("MPSCNNSpatialNormalizationNode")} + +type _CNNSpatialNormalizationNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNSpatialNormalizationNode] class. +type ICNNSpatialNormalizationNode interface { + ICNNNormalizationNode + KernelHeight() uint + SetKernelHeight(value uint) + KernelWidth() uint + SetKernelWidth(value uint) +} + +// A representation of a spatial normalization kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationnode?language=objc +type CNNSpatialNormalizationNode struct { + CNNNormalizationNode +} + +func CNNSpatialNormalizationNodeFrom(ptr unsafe.Pointer) CNNSpatialNormalizationNode { + return CNNSpatialNormalizationNode{ + CNNNormalizationNode: CNNNormalizationNodeFrom(ptr), + } +} + +func (cc _CNNSpatialNormalizationNodeClass) NodeWithSourceKernelSize(sourceNode INNImageNode, kernelSize uint) CNNSpatialNormalizationNode { + rv := objc.Call[CNNSpatialNormalizationNode](cc, objc.Sel("nodeWithSource:kernelSize:"), objc.Ptr(sourceNode), kernelSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationnode/2866401-nodewithsource?language=objc +func CNNSpatialNormalizationNode_NodeWithSourceKernelSize(sourceNode INNImageNode, kernelSize uint) CNNSpatialNormalizationNode { + return CNNSpatialNormalizationNodeClass.NodeWithSourceKernelSize(sourceNode, kernelSize) +} + +func (c_ CNNSpatialNormalizationNode) InitWithSource(sourceNode INNImageNode) CNNSpatialNormalizationNode { + rv := objc.Call[CNNSpatialNormalizationNode](c_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationnode/2866502-initwithsource?language=objc +func NewCNNSpatialNormalizationNodeWithSource(sourceNode INNImageNode) CNNSpatialNormalizationNode { + instance := CNNSpatialNormalizationNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (cc _CNNSpatialNormalizationNodeClass) Alloc() CNNSpatialNormalizationNode { + rv := objc.Call[CNNSpatialNormalizationNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNSpatialNormalizationNode_Alloc() CNNSpatialNormalizationNode { + return CNNSpatialNormalizationNodeClass.Alloc() +} + +func (cc _CNNSpatialNormalizationNodeClass) New() CNNSpatialNormalizationNode { + rv := objc.Call[CNNSpatialNormalizationNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSpatialNormalizationNode() CNNSpatialNormalizationNode { + return CNNSpatialNormalizationNodeClass.New() +} + +func (c_ CNNSpatialNormalizationNode) Init() CNNSpatialNormalizationNode { + rv := objc.Call[CNNSpatialNormalizationNode](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNSpatialNormalizationNodeClass) NodeWithSource(sourceNode INNImageNode) CNNSpatialNormalizationNode { + rv := objc.Call[CNNSpatialNormalizationNode](cc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnnormalizationnode/2866460-nodewithsource?language=objc +func CNNSpatialNormalizationNode_NodeWithSource(sourceNode INNImageNode) CNNSpatialNormalizationNode { + return CNNSpatialNormalizationNodeClass.NodeWithSource(sourceNode) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationnode/2866424-kernelheight?language=objc +func (c_ CNNSpatialNormalizationNode) KernelHeight() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationnode/2866424-kernelheight?language=objc +func (c_ CNNSpatialNormalizationNode) SetKernelHeight(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelHeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationnode/2866402-kernelwidth?language=objc +func (c_ CNNSpatialNormalizationNode) KernelWidth() uint { + rv := objc.Call[uint](c_, objc.Sel("kernelWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnspatialnormalizationnode/2866402-kernelwidth?language=objc +func (c_ CNNSpatialNormalizationNode) SetKernelWidth(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setKernelWidth:"), value) +} diff --git a/macos/mps/cnn_sub_pixel_convolution_descriptor.gen.go b/macos/mps/cnn_sub_pixel_convolution_descriptor.gen.go new file mode 100644 index 00000000..d30cddf9 --- /dev/null +++ b/macos/mps/cnn_sub_pixel_convolution_descriptor.gen.go @@ -0,0 +1,87 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSubPixelConvolutionDescriptor] class. +var CNNSubPixelConvolutionDescriptorClass = _CNNSubPixelConvolutionDescriptorClass{objc.GetClass("MPSCNNSubPixelConvolutionDescriptor")} + +type _CNNSubPixelConvolutionDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CNNSubPixelConvolutionDescriptor] class. +type ICNNSubPixelConvolutionDescriptor interface { + ICNNConvolutionDescriptor + SubPixelScaleFactor() uint + SetSubPixelScaleFactor(value uint) +} + +// A description of a convolution object that does subpixel upsampling and reshaping. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsubpixelconvolutiondescriptor?language=objc +type CNNSubPixelConvolutionDescriptor struct { + CNNConvolutionDescriptor +} + +func CNNSubPixelConvolutionDescriptorFrom(ptr unsafe.Pointer) CNNSubPixelConvolutionDescriptor { + return CNNSubPixelConvolutionDescriptor{ + CNNConvolutionDescriptor: CNNConvolutionDescriptorFrom(ptr), + } +} + +func (cc _CNNSubPixelConvolutionDescriptorClass) Alloc() CNNSubPixelConvolutionDescriptor { + rv := objc.Call[CNNSubPixelConvolutionDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CNNSubPixelConvolutionDescriptor_Alloc() CNNSubPixelConvolutionDescriptor { + return CNNSubPixelConvolutionDescriptorClass.Alloc() +} + +func (cc _CNNSubPixelConvolutionDescriptorClass) New() CNNSubPixelConvolutionDescriptor { + rv := objc.Call[CNNSubPixelConvolutionDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSubPixelConvolutionDescriptor() CNNSubPixelConvolutionDescriptor { + return CNNSubPixelConvolutionDescriptorClass.New() +} + +func (c_ CNNSubPixelConvolutionDescriptor) Init() CNNSubPixelConvolutionDescriptor { + rv := objc.Call[CNNSubPixelConvolutionDescriptor](c_, objc.Sel("init")) + return rv +} + +func (cc _CNNSubPixelConvolutionDescriptorClass) CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth uint, kernelHeight uint, inputFeatureChannels uint, outputFeatureChannels uint) CNNSubPixelConvolutionDescriptor { + rv := objc.Call[CNNSubPixelConvolutionDescriptor](cc, objc.Sel("cnnConvolutionDescriptorWithKernelWidth:kernelHeight:inputFeatureChannels:outputFeatureChannels:"), kernelWidth, kernelHeight, inputFeatureChannels, outputFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiondescriptor/1648813-cnnconvolutiondescriptorwithkern?language=objc +func CNNSubPixelConvolutionDescriptor_CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth uint, kernelHeight uint, inputFeatureChannels uint, outputFeatureChannels uint) CNNSubPixelConvolutionDescriptor { + return CNNSubPixelConvolutionDescriptorClass.CnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(kernelWidth, kernelHeight, inputFeatureChannels, outputFeatureChannels) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsubpixelconvolutiondescriptor/2875156-subpixelscalefactor?language=objc +func (c_ CNNSubPixelConvolutionDescriptor) SubPixelScaleFactor() uint { + rv := objc.Call[uint](c_, objc.Sel("subPixelScaleFactor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsubpixelconvolutiondescriptor/2875156-subpixelscalefactor?language=objc +func (c_ CNNSubPixelConvolutionDescriptor) SetSubPixelScaleFactor(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setSubPixelScaleFactor:"), value) +} diff --git a/macos/mps/cnn_subtract.gen.go b/macos/mps/cnn_subtract.gen.go new file mode 100644 index 00000000..fb034faa --- /dev/null +++ b/macos/mps/cnn_subtract.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSubtract] class. +var CNNSubtractClass = _CNNSubtractClass{objc.GetClass("MPSCNNSubtract")} + +type _CNNSubtractClass struct { + objc.Class +} + +// An interface definition for the [CNNSubtract] class. +type ICNNSubtract interface { + ICNNArithmetic +} + +// A subtraction operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsubtract?language=objc +type CNNSubtract struct { + CNNArithmetic +} + +func CNNSubtractFrom(ptr unsafe.Pointer) CNNSubtract { + return CNNSubtract{ + CNNArithmetic: CNNArithmeticFrom(ptr), + } +} + +func (c_ CNNSubtract) InitWithDevice(device metal.PDevice) CNNSubtract { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSubtract](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsubtract/2942503-initwithdevice?language=objc +func NewCNNSubtractWithDevice(device metal.PDevice) CNNSubtract { + instance := CNNSubtractClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (cc _CNNSubtractClass) Alloc() CNNSubtract { + rv := objc.Call[CNNSubtract](cc, objc.Sel("alloc")) + return rv +} + +func CNNSubtract_Alloc() CNNSubtract { + return CNNSubtractClass.Alloc() +} + +func (cc _CNNSubtractClass) New() CNNSubtract { + rv := objc.Call[CNNSubtract](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSubtract() CNNSubtract { + return CNNSubtractClass.New() +} + +func (c_ CNNSubtract) Init() CNNSubtract { + rv := objc.Call[CNNSubtract](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNSubtract) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSubtract { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSubtract](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNSubtract_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSubtract { + instance := CNNSubtractClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_subtract_gradient.gen.go b/macos/mps/cnn_subtract_gradient.gen.go new file mode 100644 index 00000000..ba506823 --- /dev/null +++ b/macos/mps/cnn_subtract_gradient.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNSubtractGradient] class. +var CNNSubtractGradientClass = _CNNSubtractGradientClass{objc.GetClass("MPSCNNSubtractGradient")} + +type _CNNSubtractGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNSubtractGradient] class. +type ICNNSubtractGradient interface { + ICNNArithmeticGradient +} + +// A gradient subtraction operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsubtractgradient?language=objc +type CNNSubtractGradient struct { + CNNArithmeticGradient +} + +func CNNSubtractGradientFrom(ptr unsafe.Pointer) CNNSubtractGradient { + return CNNSubtractGradient{ + CNNArithmeticGradient: CNNArithmeticGradientFrom(ptr), + } +} + +func (c_ CNNSubtractGradient) InitWithDeviceIsSecondarySourceFilter(device metal.PDevice, isSecondarySourceFilter bool) CNNSubtractGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSubtractGradient](c_, objc.Sel("initWithDevice:isSecondarySourceFilter:"), po0, isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsubtractgradient/2956165-initwithdevice?language=objc +func NewCNNSubtractGradientWithDeviceIsSecondarySourceFilter(device metal.PDevice, isSecondarySourceFilter bool) CNNSubtractGradient { + instance := CNNSubtractGradientClass.Alloc().InitWithDeviceIsSecondarySourceFilter(device, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (cc _CNNSubtractGradientClass) Alloc() CNNSubtractGradient { + rv := objc.Call[CNNSubtractGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNSubtractGradient_Alloc() CNNSubtractGradient { + return CNNSubtractGradientClass.Alloc() +} + +func (cc _CNNSubtractGradientClass) New() CNNSubtractGradient { + rv := objc.Call[CNNSubtractGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNSubtractGradient() CNNSubtractGradient { + return CNNSubtractGradientClass.New() +} + +func (c_ CNNSubtractGradient) Init() CNNSubtractGradient { + rv := objc.Call[CNNSubtractGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNSubtractGradient) InitWithDevice(device metal.PDevice) CNNSubtractGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSubtractGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNSubtractGradientWithDevice(device metal.PDevice) CNNSubtractGradient { + instance := CNNSubtractGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNSubtractGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSubtractGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNSubtractGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNSubtractGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNSubtractGradient { + instance := CNNSubtractGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_upsampling.gen.go b/macos/mps/cnn_upsampling.gen.go new file mode 100644 index 00000000..05869ef7 --- /dev/null +++ b/macos/mps/cnn_upsampling.gen.go @@ -0,0 +1,117 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsampling] class. +var CNNUpsamplingClass = _CNNUpsamplingClass{objc.GetClass("MPSCNNUpsampling")} + +type _CNNUpsamplingClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsampling] class. +type ICNNUpsampling interface { + ICNNKernel + AlignCorners() bool + ScaleFactorY() float64 + ScaleFactorX() float64 +} + +// A filter that resamples an existing MPS image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsampling?language=objc +type CNNUpsampling struct { + CNNKernel +} + +func CNNUpsamplingFrom(ptr unsafe.Pointer) CNNUpsampling { + return CNNUpsampling{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (cc _CNNUpsamplingClass) Alloc() CNNUpsampling { + rv := objc.Call[CNNUpsampling](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsampling_Alloc() CNNUpsampling { + return CNNUpsamplingClass.Alloc() +} + +func (cc _CNNUpsamplingClass) New() CNNUpsampling { + rv := objc.Call[CNNUpsampling](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsampling() CNNUpsampling { + return CNNUpsamplingClass.New() +} + +func (c_ CNNUpsampling) Init() CNNUpsampling { + rv := objc.Call[CNNUpsampling](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNUpsampling) InitWithDevice(device metal.PDevice) CNNUpsampling { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsampling](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNUpsamplingWithDevice(device metal.PDevice) CNNUpsampling { + instance := CNNUpsamplingClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNUpsampling) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsampling { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsampling](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNUpsampling_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsampling { + instance := CNNUpsamplingClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsampling/2966660-aligncorners?language=objc +func (c_ CNNUpsampling) AlignCorners() bool { + rv := objc.Call[bool](c_, objc.Sel("alignCorners")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsampling/2875154-scalefactory?language=objc +func (c_ CNNUpsampling) ScaleFactorY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsampling/2875206-scalefactorx?language=objc +func (c_ CNNUpsampling) ScaleFactorX() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorX")) + return rv +} diff --git a/macos/mps/cnn_upsampling_bilinear.gen.go b/macos/mps/cnn_upsampling_bilinear.gen.go new file mode 100644 index 00000000..3884b15c --- /dev/null +++ b/macos/mps/cnn_upsampling_bilinear.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingBilinear] class. +var CNNUpsamplingBilinearClass = _CNNUpsamplingBilinearClass{objc.GetClass("MPSCNNUpsamplingBilinear")} + +type _CNNUpsamplingBilinearClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingBilinear] class. +type ICNNUpsamplingBilinear interface { + ICNNUpsampling +} + +// A bilinear spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinear?language=objc +type CNNUpsamplingBilinear struct { + CNNUpsampling +} + +func CNNUpsamplingBilinearFrom(ptr unsafe.Pointer) CNNUpsamplingBilinear { + return CNNUpsamplingBilinear{ + CNNUpsampling: CNNUpsamplingFrom(ptr), + } +} + +func (c_ CNNUpsamplingBilinear) InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingBilinear](c_, objc.Sel("initWithDevice:integerScaleFactorX:integerScaleFactorY:"), po0, integerScaleFactorX, integerScaleFactorY) + return rv +} + +// Initializes a bilinear spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinear/2875160-initwithdevice?language=objc +func NewCNNUpsamplingBilinearWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinear { + instance := CNNUpsamplingBilinearClass.Alloc().InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device, integerScaleFactorX, integerScaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingBilinearClass) Alloc() CNNUpsamplingBilinear { + rv := objc.Call[CNNUpsamplingBilinear](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingBilinear_Alloc() CNNUpsamplingBilinear { + return CNNUpsamplingBilinearClass.Alloc() +} + +func (cc _CNNUpsamplingBilinearClass) New() CNNUpsamplingBilinear { + rv := objc.Call[CNNUpsamplingBilinear](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingBilinear() CNNUpsamplingBilinear { + return CNNUpsamplingBilinearClass.New() +} + +func (c_ CNNUpsamplingBilinear) Init() CNNUpsamplingBilinear { + rv := objc.Call[CNNUpsamplingBilinear](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNUpsamplingBilinear) InitWithDevice(device metal.PDevice) CNNUpsamplingBilinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingBilinear](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNUpsamplingBilinearWithDevice(device metal.PDevice) CNNUpsamplingBilinear { + instance := CNNUpsamplingBilinearClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNUpsamplingBilinear) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingBilinear { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingBilinear](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNUpsamplingBilinear_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingBilinear { + instance := CNNUpsamplingBilinearClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_upsampling_bilinear_gradient.gen.go b/macos/mps/cnn_upsampling_bilinear_gradient.gen.go new file mode 100644 index 00000000..1fe4f739 --- /dev/null +++ b/macos/mps/cnn_upsampling_bilinear_gradient.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingBilinearGradient] class. +var CNNUpsamplingBilinearGradientClass = _CNNUpsamplingBilinearGradientClass{objc.GetClass("MPSCNNUpsamplingBilinearGradient")} + +type _CNNUpsamplingBilinearGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingBilinearGradient] class. +type ICNNUpsamplingBilinearGradient interface { + ICNNUpsamplingGradient +} + +// A gradient bilinear spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilineargradient?language=objc +type CNNUpsamplingBilinearGradient struct { + CNNUpsamplingGradient +} + +func CNNUpsamplingBilinearGradientFrom(ptr unsafe.Pointer) CNNUpsamplingBilinearGradient { + return CNNUpsamplingBilinearGradient{ + CNNUpsamplingGradient: CNNUpsamplingGradientFrom(ptr), + } +} + +func (c_ CNNUpsamplingBilinearGradient) InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinearGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingBilinearGradient](c_, objc.Sel("initWithDevice:integerScaleFactorX:integerScaleFactorY:"), po0, integerScaleFactorX, integerScaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilineargradient/2947918-initwithdevice?language=objc +func NewCNNUpsamplingBilinearGradientWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinearGradient { + instance := CNNUpsamplingBilinearGradientClass.Alloc().InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device, integerScaleFactorX, integerScaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingBilinearGradientClass) Alloc() CNNUpsamplingBilinearGradient { + rv := objc.Call[CNNUpsamplingBilinearGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingBilinearGradient_Alloc() CNNUpsamplingBilinearGradient { + return CNNUpsamplingBilinearGradientClass.Alloc() +} + +func (cc _CNNUpsamplingBilinearGradientClass) New() CNNUpsamplingBilinearGradient { + rv := objc.Call[CNNUpsamplingBilinearGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingBilinearGradient() CNNUpsamplingBilinearGradient { + return CNNUpsamplingBilinearGradientClass.New() +} + +func (c_ CNNUpsamplingBilinearGradient) Init() CNNUpsamplingBilinearGradient { + rv := objc.Call[CNNUpsamplingBilinearGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNUpsamplingBilinearGradient) InitWithDevice(device metal.PDevice) CNNUpsamplingBilinearGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingBilinearGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNUpsamplingBilinearGradientWithDevice(device metal.PDevice) CNNUpsamplingBilinearGradient { + instance := CNNUpsamplingBilinearGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNUpsamplingBilinearGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingBilinearGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingBilinearGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNUpsamplingBilinearGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingBilinearGradient { + instance := CNNUpsamplingBilinearGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_upsampling_bilinear_gradient_node.gen.go b/macos/mps/cnn_upsampling_bilinear_gradient_node.gen.go new file mode 100644 index 00000000..4bfcedcd --- /dev/null +++ b/macos/mps/cnn_upsampling_bilinear_gradient_node.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingBilinearGradientNode] class. +var CNNUpsamplingBilinearGradientNodeClass = _CNNUpsamplingBilinearGradientNodeClass{objc.GetClass("MPSCNNUpsamplingBilinearGradientNode")} + +type _CNNUpsamplingBilinearGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingBilinearGradientNode] class. +type ICNNUpsamplingBilinearGradientNode interface { + INNGradientFilterNode + ScaleFactorY() float64 + ScaleFactorX() float64 +} + +// A representation of a gradient bilinear spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilineargradientnode?language=objc +type CNNUpsamplingBilinearGradientNode struct { + NNGradientFilterNode +} + +func CNNUpsamplingBilinearGradientNodeFrom(ptr unsafe.Pointer) CNNUpsamplingBilinearGradientNode { + return CNNUpsamplingBilinearGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNUpsamplingBilinearGradientNode) InitWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingBilinearGradientNode { + rv := objc.Call[CNNUpsamplingBilinearGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:scaleFactorX:scaleFactorY:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), scaleFactorX, scaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilineargradientnode/2947991-initwithsourcegradient?language=objc +func NewCNNUpsamplingBilinearGradientNodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingBilinearGradientNode { + instance := CNNUpsamplingBilinearGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient, sourceImage, gradientState, scaleFactorX, scaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingBilinearGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingBilinearGradientNode { + rv := objc.Call[CNNUpsamplingBilinearGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:scaleFactorX:scaleFactorY:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), scaleFactorX, scaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilineargradientnode/2948025-nodewithsourcegradient?language=objc +func CNNUpsamplingBilinearGradientNode_NodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingBilinearGradientNode { + return CNNUpsamplingBilinearGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient, sourceImage, gradientState, scaleFactorX, scaleFactorY) +} + +func (cc _CNNUpsamplingBilinearGradientNodeClass) Alloc() CNNUpsamplingBilinearGradientNode { + rv := objc.Call[CNNUpsamplingBilinearGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingBilinearGradientNode_Alloc() CNNUpsamplingBilinearGradientNode { + return CNNUpsamplingBilinearGradientNodeClass.Alloc() +} + +func (cc _CNNUpsamplingBilinearGradientNodeClass) New() CNNUpsamplingBilinearGradientNode { + rv := objc.Call[CNNUpsamplingBilinearGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingBilinearGradientNode() CNNUpsamplingBilinearGradientNode { + return CNNUpsamplingBilinearGradientNodeClass.New() +} + +func (c_ CNNUpsamplingBilinearGradientNode) Init() CNNUpsamplingBilinearGradientNode { + rv := objc.Call[CNNUpsamplingBilinearGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilineargradientnode/2948054-scalefactory?language=objc +func (c_ CNNUpsamplingBilinearGradientNode) ScaleFactorY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilineargradientnode/2948051-scalefactorx?language=objc +func (c_ CNNUpsamplingBilinearGradientNode) ScaleFactorX() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorX")) + return rv +} diff --git a/macos/mps/cnn_upsampling_bilinear_node.gen.go b/macos/mps/cnn_upsampling_bilinear_node.gen.go new file mode 100644 index 00000000..3abcf51a --- /dev/null +++ b/macos/mps/cnn_upsampling_bilinear_node.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingBilinearNode] class. +var CNNUpsamplingBilinearNodeClass = _CNNUpsamplingBilinearNodeClass{objc.GetClass("MPSCNNUpsamplingBilinearNode")} + +type _CNNUpsamplingBilinearNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingBilinearNode] class. +type ICNNUpsamplingBilinearNode interface { + INNFilterNode + AlignCorners() bool + ScaleFactorY() float64 + ScaleFactorX() float64 +} + +// A representation of a bilinear spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinearnode?language=objc +type CNNUpsamplingBilinearNode struct { + NNFilterNode +} + +func CNNUpsamplingBilinearNodeFrom(ptr unsafe.Pointer) CNNUpsamplingBilinearNode { + return CNNUpsamplingBilinearNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNUpsamplingBilinearNodeClass) NodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinearNode { + rv := objc.Call[CNNUpsamplingBilinearNode](cc, objc.Sel("nodeWithSource:integerScaleFactorX:integerScaleFactorY:"), objc.Ptr(sourceNode), integerScaleFactorX, integerScaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinearnode/2875987-nodewithsource?language=objc +func CNNUpsamplingBilinearNode_NodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinearNode { + return CNNUpsamplingBilinearNodeClass.NodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode, integerScaleFactorX, integerScaleFactorY) +} + +func (c_ CNNUpsamplingBilinearNode) InitWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinearNode { + rv := objc.Call[CNNUpsamplingBilinearNode](c_, objc.Sel("initWithSource:integerScaleFactorX:integerScaleFactorY:"), objc.Ptr(sourceNode), integerScaleFactorX, integerScaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinearnode/2875152-initwithsource?language=objc +func NewCNNUpsamplingBilinearNodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingBilinearNode { + instance := CNNUpsamplingBilinearNodeClass.Alloc().InitWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode, integerScaleFactorX, integerScaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingBilinearNodeClass) Alloc() CNNUpsamplingBilinearNode { + rv := objc.Call[CNNUpsamplingBilinearNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingBilinearNode_Alloc() CNNUpsamplingBilinearNode { + return CNNUpsamplingBilinearNodeClass.Alloc() +} + +func (cc _CNNUpsamplingBilinearNodeClass) New() CNNUpsamplingBilinearNode { + rv := objc.Call[CNNUpsamplingBilinearNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingBilinearNode() CNNUpsamplingBilinearNode { + return CNNUpsamplingBilinearNodeClass.New() +} + +func (c_ CNNUpsamplingBilinearNode) Init() CNNUpsamplingBilinearNode { + rv := objc.Call[CNNUpsamplingBilinearNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinearnode/2966687-aligncorners?language=objc +func (c_ CNNUpsamplingBilinearNode) AlignCorners() bool { + rv := objc.Call[bool](c_, objc.Sel("alignCorners")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinearnode/2875150-scalefactory?language=objc +func (c_ CNNUpsamplingBilinearNode) ScaleFactorY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingbilinearnode/2875153-scalefactorx?language=objc +func (c_ CNNUpsamplingBilinearNode) ScaleFactorX() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorX")) + return rv +} diff --git a/macos/mps/cnn_upsampling_gradient.gen.go b/macos/mps/cnn_upsampling_gradient.gen.go new file mode 100644 index 00000000..ff632124 --- /dev/null +++ b/macos/mps/cnn_upsampling_gradient.gen.go @@ -0,0 +1,108 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingGradient] class. +var CNNUpsamplingGradientClass = _CNNUpsamplingGradientClass{objc.GetClass("MPSCNNUpsamplingGradient")} + +type _CNNUpsamplingGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingGradient] class. +type ICNNUpsamplingGradient interface { + ICNNGradientKernel + ScaleFactorY() float64 + ScaleFactorX() float64 +} + +// A gradient filter that upsamples an existing Metal Performance Shaders image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplinggradient?language=objc +type CNNUpsamplingGradient struct { + CNNGradientKernel +} + +func CNNUpsamplingGradientFrom(ptr unsafe.Pointer) CNNUpsamplingGradient { + return CNNUpsamplingGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (cc _CNNUpsamplingGradientClass) Alloc() CNNUpsamplingGradient { + rv := objc.Call[CNNUpsamplingGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingGradient_Alloc() CNNUpsamplingGradient { + return CNNUpsamplingGradientClass.Alloc() +} + +func (cc _CNNUpsamplingGradientClass) New() CNNUpsamplingGradient { + rv := objc.Call[CNNUpsamplingGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingGradient() CNNUpsamplingGradient { + return CNNUpsamplingGradientClass.New() +} + +func (c_ CNNUpsamplingGradient) Init() CNNUpsamplingGradient { + rv := objc.Call[CNNUpsamplingGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNUpsamplingGradient) InitWithDevice(device metal.PDevice) CNNUpsamplingGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNUpsamplingGradientWithDevice(device metal.PDevice) CNNUpsamplingGradient { + instance := CNNUpsamplingGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNUpsamplingGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNUpsamplingGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingGradient { + instance := CNNUpsamplingGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplinggradient/2942628-scalefactory?language=objc +func (c_ CNNUpsamplingGradient) ScaleFactorY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplinggradient/2942630-scalefactorx?language=objc +func (c_ CNNUpsamplingGradient) ScaleFactorX() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorX")) + return rv +} diff --git a/macos/mps/cnn_upsampling_nearest.gen.go b/macos/mps/cnn_upsampling_nearest.gen.go new file mode 100644 index 00000000..61674137 --- /dev/null +++ b/macos/mps/cnn_upsampling_nearest.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingNearest] class. +var CNNUpsamplingNearestClass = _CNNUpsamplingNearestClass{objc.GetClass("MPSCNNUpsamplingNearest")} + +type _CNNUpsamplingNearestClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingNearest] class. +type ICNNUpsamplingNearest interface { + ICNNUpsampling +} + +// A nearest spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearest?language=objc +type CNNUpsamplingNearest struct { + CNNUpsampling +} + +func CNNUpsamplingNearestFrom(ptr unsafe.Pointer) CNNUpsamplingNearest { + return CNNUpsamplingNearest{ + CNNUpsampling: CNNUpsamplingFrom(ptr), + } +} + +func (c_ CNNUpsamplingNearest) InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearest { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingNearest](c_, objc.Sel("initWithDevice:integerScaleFactorX:integerScaleFactorY:"), po0, integerScaleFactorX, integerScaleFactorY) + return rv +} + +// Initializes a nearest spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearest/2875223-initwithdevice?language=objc +func NewCNNUpsamplingNearestWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearest { + instance := CNNUpsamplingNearestClass.Alloc().InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device, integerScaleFactorX, integerScaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingNearestClass) Alloc() CNNUpsamplingNearest { + rv := objc.Call[CNNUpsamplingNearest](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingNearest_Alloc() CNNUpsamplingNearest { + return CNNUpsamplingNearestClass.Alloc() +} + +func (cc _CNNUpsamplingNearestClass) New() CNNUpsamplingNearest { + rv := objc.Call[CNNUpsamplingNearest](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingNearest() CNNUpsamplingNearest { + return CNNUpsamplingNearestClass.New() +} + +func (c_ CNNUpsamplingNearest) Init() CNNUpsamplingNearest { + rv := objc.Call[CNNUpsamplingNearest](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNUpsamplingNearest) InitWithDevice(device metal.PDevice) CNNUpsamplingNearest { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingNearest](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNUpsamplingNearestWithDevice(device metal.PDevice) CNNUpsamplingNearest { + instance := CNNUpsamplingNearestClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNUpsamplingNearest) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingNearest { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingNearest](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNUpsamplingNearest_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingNearest { + instance := CNNUpsamplingNearestClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_upsampling_nearest_gradient.gen.go b/macos/mps/cnn_upsampling_nearest_gradient.gen.go new file mode 100644 index 00000000..384efe57 --- /dev/null +++ b/macos/mps/cnn_upsampling_nearest_gradient.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingNearestGradient] class. +var CNNUpsamplingNearestGradientClass = _CNNUpsamplingNearestGradientClass{objc.GetClass("MPSCNNUpsamplingNearestGradient")} + +type _CNNUpsamplingNearestGradientClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingNearestGradient] class. +type ICNNUpsamplingNearestGradient interface { + ICNNUpsamplingGradient +} + +// A gradient upsampling filter that samples the pixel nearest to the source when upsampling to the destination pixel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestgradient?language=objc +type CNNUpsamplingNearestGradient struct { + CNNUpsamplingGradient +} + +func CNNUpsamplingNearestGradientFrom(ptr unsafe.Pointer) CNNUpsamplingNearestGradient { + return CNNUpsamplingNearestGradient{ + CNNUpsamplingGradient: CNNUpsamplingGradientFrom(ptr), + } +} + +func (c_ CNNUpsamplingNearestGradient) InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearestGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingNearestGradient](c_, objc.Sel("initWithDevice:integerScaleFactorX:integerScaleFactorY:"), po0, integerScaleFactorX, integerScaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestgradient/2947920-initwithdevice?language=objc +func NewCNNUpsamplingNearestGradientWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device metal.PDevice, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearestGradient { + instance := CNNUpsamplingNearestGradientClass.Alloc().InitWithDeviceIntegerScaleFactorXIntegerScaleFactorY(device, integerScaleFactorX, integerScaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingNearestGradientClass) Alloc() CNNUpsamplingNearestGradient { + rv := objc.Call[CNNUpsamplingNearestGradient](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingNearestGradient_Alloc() CNNUpsamplingNearestGradient { + return CNNUpsamplingNearestGradientClass.Alloc() +} + +func (cc _CNNUpsamplingNearestGradientClass) New() CNNUpsamplingNearestGradient { + rv := objc.Call[CNNUpsamplingNearestGradient](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingNearestGradient() CNNUpsamplingNearestGradient { + return CNNUpsamplingNearestGradientClass.New() +} + +func (c_ CNNUpsamplingNearestGradient) Init() CNNUpsamplingNearestGradient { + rv := objc.Call[CNNUpsamplingNearestGradient](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNUpsamplingNearestGradient) InitWithDevice(device metal.PDevice) CNNUpsamplingNearestGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingNearestGradient](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnngradientkernel/2942657-initwithdevice?language=objc +func NewCNNUpsamplingNearestGradientWithDevice(device metal.PDevice) CNNUpsamplingNearestGradient { + instance := CNNUpsamplingNearestGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNUpsamplingNearestGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingNearestGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNUpsamplingNearestGradient](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNUpsamplingNearestGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNUpsamplingNearestGradient { + instance := CNNUpsamplingNearestGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/cnn_upsampling_nearest_gradient_node.gen.go b/macos/mps/cnn_upsampling_nearest_gradient_node.gen.go new file mode 100644 index 00000000..7fd818ce --- /dev/null +++ b/macos/mps/cnn_upsampling_nearest_gradient_node.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingNearestGradientNode] class. +var CNNUpsamplingNearestGradientNodeClass = _CNNUpsamplingNearestGradientNodeClass{objc.GetClass("MPSCNNUpsamplingNearestGradientNode")} + +type _CNNUpsamplingNearestGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingNearestGradientNode] class. +type ICNNUpsamplingNearestGradientNode interface { + INNGradientFilterNode + ScaleFactorY() float64 + ScaleFactorX() float64 +} + +// A representation of a gradient nearest spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestgradientnode?language=objc +type CNNUpsamplingNearestGradientNode struct { + NNGradientFilterNode +} + +func CNNUpsamplingNearestGradientNodeFrom(ptr unsafe.Pointer) CNNUpsamplingNearestGradientNode { + return CNNUpsamplingNearestGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (c_ CNNUpsamplingNearestGradientNode) InitWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingNearestGradientNode { + rv := objc.Call[CNNUpsamplingNearestGradientNode](c_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:scaleFactorX:scaleFactorY:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), scaleFactorX, scaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestgradientnode/2947983-initwithsourcegradient?language=objc +func NewCNNUpsamplingNearestGradientNodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingNearestGradientNode { + instance := CNNUpsamplingNearestGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient, sourceImage, gradientState, scaleFactorX, scaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingNearestGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingNearestGradientNode { + rv := objc.Call[CNNUpsamplingNearestGradientNode](cc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:scaleFactorX:scaleFactorY:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), scaleFactorX, scaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestgradientnode/2948021-nodewithsourcegradient?language=objc +func CNNUpsamplingNearestGradientNode_NodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode, scaleFactorX float64, scaleFactorY float64) CNNUpsamplingNearestGradientNode { + return CNNUpsamplingNearestGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateScaleFactorXScaleFactorY(sourceGradient, sourceImage, gradientState, scaleFactorX, scaleFactorY) +} + +func (cc _CNNUpsamplingNearestGradientNodeClass) Alloc() CNNUpsamplingNearestGradientNode { + rv := objc.Call[CNNUpsamplingNearestGradientNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingNearestGradientNode_Alloc() CNNUpsamplingNearestGradientNode { + return CNNUpsamplingNearestGradientNodeClass.Alloc() +} + +func (cc _CNNUpsamplingNearestGradientNodeClass) New() CNNUpsamplingNearestGradientNode { + rv := objc.Call[CNNUpsamplingNearestGradientNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingNearestGradientNode() CNNUpsamplingNearestGradientNode { + return CNNUpsamplingNearestGradientNodeClass.New() +} + +func (c_ CNNUpsamplingNearestGradientNode) Init() CNNUpsamplingNearestGradientNode { + rv := objc.Call[CNNUpsamplingNearestGradientNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestgradientnode/2948035-scalefactory?language=objc +func (c_ CNNUpsamplingNearestGradientNode) ScaleFactorY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestgradientnode/2948024-scalefactorx?language=objc +func (c_ CNNUpsamplingNearestGradientNode) ScaleFactorX() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorX")) + return rv +} diff --git a/macos/mps/cnn_upsampling_nearest_node.gen.go b/macos/mps/cnn_upsampling_nearest_node.gen.go new file mode 100644 index 00000000..5f3e5064 --- /dev/null +++ b/macos/mps/cnn_upsampling_nearest_node.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNUpsamplingNearestNode] class. +var CNNUpsamplingNearestNodeClass = _CNNUpsamplingNearestNodeClass{objc.GetClass("MPSCNNUpsamplingNearestNode")} + +type _CNNUpsamplingNearestNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNUpsamplingNearestNode] class. +type ICNNUpsamplingNearestNode interface { + INNFilterNode + ScaleFactorY() float64 + ScaleFactorX() float64 +} + +// A representation of a nearest spatial upsampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestnode?language=objc +type CNNUpsamplingNearestNode struct { + NNFilterNode +} + +func CNNUpsamplingNearestNodeFrom(ptr unsafe.Pointer) CNNUpsamplingNearestNode { + return CNNUpsamplingNearestNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNUpsamplingNearestNodeClass) NodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearestNode { + rv := objc.Call[CNNUpsamplingNearestNode](cc, objc.Sel("nodeWithSource:integerScaleFactorX:integerScaleFactorY:"), objc.Ptr(sourceNode), integerScaleFactorX, integerScaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestnode/2875985-nodewithsource?language=objc +func CNNUpsamplingNearestNode_NodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearestNode { + return CNNUpsamplingNearestNodeClass.NodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode, integerScaleFactorX, integerScaleFactorY) +} + +func (c_ CNNUpsamplingNearestNode) InitWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearestNode { + rv := objc.Call[CNNUpsamplingNearestNode](c_, objc.Sel("initWithSource:integerScaleFactorX:integerScaleFactorY:"), objc.Ptr(sourceNode), integerScaleFactorX, integerScaleFactorY) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestnode/2875222-initwithsource?language=objc +func NewCNNUpsamplingNearestNodeWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode INNImageNode, integerScaleFactorX uint, integerScaleFactorY uint) CNNUpsamplingNearestNode { + instance := CNNUpsamplingNearestNodeClass.Alloc().InitWithSourceIntegerScaleFactorXIntegerScaleFactorY(sourceNode, integerScaleFactorX, integerScaleFactorY) + instance.Autorelease() + return instance +} + +func (cc _CNNUpsamplingNearestNodeClass) Alloc() CNNUpsamplingNearestNode { + rv := objc.Call[CNNUpsamplingNearestNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNUpsamplingNearestNode_Alloc() CNNUpsamplingNearestNode { + return CNNUpsamplingNearestNodeClass.Alloc() +} + +func (cc _CNNUpsamplingNearestNodeClass) New() CNNUpsamplingNearestNode { + rv := objc.Call[CNNUpsamplingNearestNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNUpsamplingNearestNode() CNNUpsamplingNearestNode { + return CNNUpsamplingNearestNodeClass.New() +} + +func (c_ CNNUpsamplingNearestNode) Init() CNNUpsamplingNearestNode { + rv := objc.Call[CNNUpsamplingNearestNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestnode/2875155-scalefactory?language=objc +func (c_ CNNUpsamplingNearestNode) ScaleFactorY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnupsamplingnearestnode/2875209-scalefactorx?language=objc +func (c_ CNNUpsamplingNearestNode) ScaleFactorX() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleFactorX")) + return rv +} diff --git a/macos/mps/cnnyolo_loss.gen.go b/macos/mps/cnnyolo_loss.gen.go new file mode 100644 index 00000000..93724ab6 --- /dev/null +++ b/macos/mps/cnnyolo_loss.gen.go @@ -0,0 +1,279 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNYOLOLoss] class. +var CNNYOLOLossClass = _CNNYOLOLossClass{objc.GetClass("MPSCNNYOLOLoss")} + +type _CNNYOLOLossClass struct { + objc.Class +} + +// An interface definition for the [CNNYOLOLoss] class. +type ICNNYOLOLoss interface { + ICNNKernel + EncodeBatchToCommandBufferSourceImagesLabels(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImagesLabels(commandBufferObject objc.IObject, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array + EncodeToCommandBufferSourceImageLabels(commandBuffer metal.PCommandBuffer, sourceImage IImage, labels ICNNLossLabels) Image + EncodeToCommandBufferObjectSourceImageLabels(commandBufferObject objc.IObject, sourceImage IImage, labels ICNNLossLabels) Image + LossClasses() CNNLoss + ScaleWH() float64 + MinIOUForObjectPresence() float64 + ScaleXY() float64 + ScaleObject() float64 + MaxIOUForObjectAbsence() float64 + AnchorBoxes() []byte + ReductionType() CNNReductionType + ReduceAcrossBatch() bool + ScaleClass() float64 + LossConfidence() CNNLoss + ScaleNoObject() float64 + LossXY() CNNLoss + LossWH() CNNLoss + NumberOfAnchorBoxes() uint +} + +// A kernel that computes the YOLO loss and loss gradient between specified predictions and labels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss?language=objc +type CNNYOLOLoss struct { + CNNKernel +} + +func CNNYOLOLossFrom(ptr unsafe.Pointer) CNNYOLOLoss { + return CNNYOLOLoss{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (c_ CNNYOLOLoss) InitWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNYOLOLossDescriptor) CNNYOLOLoss { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNYOLOLoss](c_, objc.Sel("initWithDevice:lossDescriptor:"), po0, objc.Ptr(lossDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976481-initwithdevice?language=objc +func NewCNNYOLOLossWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNYOLOLossDescriptor) CNNYOLOLoss { + instance := CNNYOLOLossClass.Alloc().InitWithDeviceLossDescriptor(device, lossDescriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNYOLOLossClass) Alloc() CNNYOLOLoss { + rv := objc.Call[CNNYOLOLoss](cc, objc.Sel("alloc")) + return rv +} + +func CNNYOLOLoss_Alloc() CNNYOLOLoss { + return CNNYOLOLossClass.Alloc() +} + +func (cc _CNNYOLOLossClass) New() CNNYOLOLoss { + rv := objc.Call[CNNYOLOLoss](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNYOLOLoss() CNNYOLOLoss { + return CNNYOLOLossClass.New() +} + +func (c_ CNNYOLOLoss) Init() CNNYOLOLoss { + rv := objc.Call[CNNYOLOLoss](c_, objc.Sel("init")) + return rv +} + +func (c_ CNNYOLOLoss) InitWithDevice(device metal.PDevice) CNNYOLOLoss { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNYOLOLoss](c_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewCNNYOLOLossWithDevice(device metal.PDevice) CNNYOLOLoss { + instance := CNNYOLOLossClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (c_ CNNYOLOLoss) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNYOLOLoss { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[CNNYOLOLoss](c_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func CNNYOLOLoss_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) CNNYOLOLoss { + instance := CNNYOLOLossClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976476-encodebatchtocommandbuffer?language=objc +func (c_ CNNYOLOLoss) EncodeBatchToCommandBufferSourceImagesLabels(commandBuffer metal.PCommandBuffer, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:labels:"), po0, sourceImage, labels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976476-encodebatchtocommandbuffer?language=objc +func (c_ CNNYOLOLoss) EncodeBatchToCommandBufferObjectSourceImagesLabels(commandBufferObject objc.IObject, sourceImage *foundation.Array, labels *foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](c_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:labels:"), objc.Ptr(commandBufferObject), sourceImage, labels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976478-encodetocommandbuffer?language=objc +func (c_ CNNYOLOLoss) EncodeToCommandBufferSourceImageLabels(commandBuffer metal.PCommandBuffer, sourceImage IImage, labels ICNNLossLabels) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:labels:"), po0, objc.Ptr(sourceImage), objc.Ptr(labels)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976478-encodetocommandbuffer?language=objc +func (c_ CNNYOLOLoss) EncodeToCommandBufferObjectSourceImageLabels(commandBufferObject objc.IObject, sourceImage IImage, labels ICNNLossLabels) Image { + rv := objc.Call[Image](c_, objc.Sel("encodeToCommandBuffer:sourceImage:labels:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), objc.Ptr(labels)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976482-lossclasses?language=objc +func (c_ CNNYOLOLoss) LossClasses() CNNLoss { + rv := objc.Call[CNNLoss](c_, objc.Sel("lossClasses")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976493-scalewh?language=objc +func (c_ CNNYOLOLoss) ScaleWH() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleWH")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976487-miniouforobjectpresence?language=objc +func (c_ CNNYOLOLoss) MinIOUForObjectPresence() float64 { + rv := objc.Call[float64](c_, objc.Sel("minIOUForObjectPresence")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976494-scalexy?language=objc +func (c_ CNNYOLOLoss) ScaleXY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleXY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976492-scaleobject?language=objc +func (c_ CNNYOLOLoss) ScaleObject() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleObject")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976486-maxiouforobjectabsence?language=objc +func (c_ CNNYOLOLoss) MaxIOUForObjectAbsence() float64 { + rv := objc.Call[float64](c_, objc.Sel("maxIOUForObjectAbsence")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976475-anchorboxes?language=objc +func (c_ CNNYOLOLoss) AnchorBoxes() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("anchorBoxes")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976489-reductiontype?language=objc +func (c_ CNNYOLOLoss) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](c_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/3547983-reduceacrossbatch?language=objc +func (c_ CNNYOLOLoss) ReduceAcrossBatch() bool { + rv := objc.Call[bool](c_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976490-scaleclass?language=objc +func (c_ CNNYOLOLoss) ScaleClass() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleClass")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976483-lossconfidence?language=objc +func (c_ CNNYOLOLoss) LossConfidence() CNNLoss { + rv := objc.Call[CNNLoss](c_, objc.Sel("lossConfidence")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976491-scalenoobject?language=objc +func (c_ CNNYOLOLoss) ScaleNoObject() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleNoObject")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976485-lossxy?language=objc +func (c_ CNNYOLOLoss) LossXY() CNNLoss { + rv := objc.Call[CNNLoss](c_, objc.Sel("lossXY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976484-losswh?language=objc +func (c_ CNNYOLOLoss) LossWH() CNNLoss { + rv := objc.Call[CNNLoss](c_, objc.Sel("lossWH")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololoss/2976488-numberofanchorboxes?language=objc +func (c_ CNNYOLOLoss) NumberOfAnchorBoxes() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfAnchorBoxes")) + return rv +} diff --git a/macos/mps/cnnyolo_loss_descriptor.gen.go b/macos/mps/cnnyolo_loss_descriptor.gen.go new file mode 100644 index 00000000..07b3f98a --- /dev/null +++ b/macos/mps/cnnyolo_loss_descriptor.gen.go @@ -0,0 +1,345 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNYOLOLossDescriptor] class. +var CNNYOLOLossDescriptorClass = _CNNYOLOLossDescriptorClass{objc.GetClass("MPSCNNYOLOLossDescriptor")} + +type _CNNYOLOLossDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CNNYOLOLossDescriptor] class. +type ICNNYOLOLossDescriptor interface { + objc.IObject + ScaleWH() float64 + SetScaleWH(value float64) + MinIOUForObjectPresence() float64 + SetMinIOUForObjectPresence(value float64) + ScaleXY() float64 + SetScaleXY(value float64) + ScaleObject() float64 + SetScaleObject(value float64) + MaxIOUForObjectAbsence() float64 + SetMaxIOUForObjectAbsence(value float64) + AnchorBoxes() []byte + SetAnchorBoxes(value []byte) + Rescore() bool + SetRescore(value bool) + ReductionType() CNNReductionType + SetReductionType(value CNNReductionType) + ReduceAcrossBatch() bool + SetReduceAcrossBatch(value bool) + ConfidenceLossDescriptor() CNNLossDescriptor + SetConfidenceLossDescriptor(value ICNNLossDescriptor) + WHLossDescriptor() CNNLossDescriptor + SetWHLossDescriptor(value ICNNLossDescriptor) + ScaleClass() float64 + SetScaleClass(value float64) + XYLossDescriptor() CNNLossDescriptor + SetXYLossDescriptor(value ICNNLossDescriptor) + ScaleNoObject() float64 + SetScaleNoObject(value float64) + ClassesLossDescriptor() CNNLossDescriptor + SetClassesLossDescriptor(value ICNNLossDescriptor) + NumberOfAnchorBoxes() uint + SetNumberOfAnchorBoxes(value uint) +} + +// An object that specifies properties used by a YOLO loss kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor?language=objc +type CNNYOLOLossDescriptor struct { + objc.Object +} + +func CNNYOLOLossDescriptorFrom(ptr unsafe.Pointer) CNNYOLOLossDescriptor { + return CNNYOLOLossDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CNNYOLOLossDescriptorClass) Alloc() CNNYOLOLossDescriptor { + rv := objc.Call[CNNYOLOLossDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CNNYOLOLossDescriptor_Alloc() CNNYOLOLossDescriptor { + return CNNYOLOLossDescriptorClass.Alloc() +} + +func (cc _CNNYOLOLossDescriptorClass) New() CNNYOLOLossDescriptor { + rv := objc.Call[CNNYOLOLossDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNYOLOLossDescriptor() CNNYOLOLossDescriptor { + return CNNYOLOLossDescriptorClass.New() +} + +func (c_ CNNYOLOLossDescriptor) Init() CNNYOLOLossDescriptor { + rv := objc.Call[CNNYOLOLossDescriptor](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976500-cnnlossdescriptorwithxylosstype?language=objc +func (cc _CNNYOLOLossDescriptorClass) CnnLossDescriptorWithXYLossTypeWHLossTypeConfidenceLossTypeClassesLossTypeReductionTypeAnchorBoxesNumberOfAnchorBoxes(XYLossType CNNLossType, WHLossType CNNLossType, confidenceLossType CNNLossType, classesLossType CNNLossType, reductionType CNNReductionType, anchorBoxes []byte, numberOfAnchorBoxes uint) CNNYOLOLossDescriptor { + rv := objc.Call[CNNYOLOLossDescriptor](cc, objc.Sel("cnnLossDescriptorWithXYLossType:WHLossType:confidenceLossType:classesLossType:reductionType:anchorBoxes:numberOfAnchorBoxes:"), XYLossType, WHLossType, confidenceLossType, classesLossType, reductionType, anchorBoxes, numberOfAnchorBoxes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976500-cnnlossdescriptorwithxylosstype?language=objc +func CNNYOLOLossDescriptor_CnnLossDescriptorWithXYLossTypeWHLossTypeConfidenceLossTypeClassesLossTypeReductionTypeAnchorBoxesNumberOfAnchorBoxes(XYLossType CNNLossType, WHLossType CNNLossType, confidenceLossType CNNLossType, classesLossType CNNLossType, reductionType CNNReductionType, anchorBoxes []byte, numberOfAnchorBoxes uint) CNNYOLOLossDescriptor { + return CNNYOLOLossDescriptorClass.CnnLossDescriptorWithXYLossTypeWHLossTypeConfidenceLossTypeClassesLossTypeReductionTypeAnchorBoxesNumberOfAnchorBoxes(XYLossType, WHLossType, confidenceLossType, classesLossType, reductionType, anchorBoxes, numberOfAnchorBoxes) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976510-scalewh?language=objc +func (c_ CNNYOLOLossDescriptor) ScaleWH() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleWH")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976510-scalewh?language=objc +func (c_ CNNYOLOLossDescriptor) SetScaleWH(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setScaleWH:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976503-miniouforobjectpresence?language=objc +func (c_ CNNYOLOLossDescriptor) MinIOUForObjectPresence() float64 { + rv := objc.Call[float64](c_, objc.Sel("minIOUForObjectPresence")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976503-miniouforobjectpresence?language=objc +func (c_ CNNYOLOLossDescriptor) SetMinIOUForObjectPresence(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setMinIOUForObjectPresence:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976511-scalexy?language=objc +func (c_ CNNYOLOLossDescriptor) ScaleXY() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleXY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976511-scalexy?language=objc +func (c_ CNNYOLOLossDescriptor) SetScaleXY(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setScaleXY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976509-scaleobject?language=objc +func (c_ CNNYOLOLossDescriptor) ScaleObject() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleObject")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976509-scaleobject?language=objc +func (c_ CNNYOLOLossDescriptor) SetScaleObject(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setScaleObject:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976502-maxiouforobjectabsence?language=objc +func (c_ CNNYOLOLossDescriptor) MaxIOUForObjectAbsence() float64 { + rv := objc.Call[float64](c_, objc.Sel("maxIOUForObjectAbsence")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976502-maxiouforobjectabsence?language=objc +func (c_ CNNYOLOLossDescriptor) SetMaxIOUForObjectAbsence(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setMaxIOUForObjectAbsence:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976498-anchorboxes?language=objc +func (c_ CNNYOLOLossDescriptor) AnchorBoxes() []byte { + rv := objc.Call[[]byte](c_, objc.Sel("anchorBoxes")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976498-anchorboxes?language=objc +func (c_ CNNYOLOLossDescriptor) SetAnchorBoxes(value []byte) { + objc.Call[objc.Void](c_, objc.Sel("setAnchorBoxes:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976506-rescore?language=objc +func (c_ CNNYOLOLossDescriptor) Rescore() bool { + rv := objc.Call[bool](c_, objc.Sel("rescore")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976506-rescore?language=objc +func (c_ CNNYOLOLossDescriptor) SetRescore(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setRescore:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976505-reductiontype?language=objc +func (c_ CNNYOLOLossDescriptor) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](c_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976505-reductiontype?language=objc +func (c_ CNNYOLOLossDescriptor) SetReductionType(value CNNReductionType) { + objc.Call[objc.Void](c_, objc.Sel("setReductionType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/3547984-reduceacrossbatch?language=objc +func (c_ CNNYOLOLossDescriptor) ReduceAcrossBatch() bool { + rv := objc.Call[bool](c_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/3547984-reduceacrossbatch?language=objc +func (c_ CNNYOLOLossDescriptor) SetReduceAcrossBatch(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setReduceAcrossBatch:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976501-confidencelossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) ConfidenceLossDescriptor() CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](c_, objc.Sel("confidenceLossDescriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976501-confidencelossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) SetConfidenceLossDescriptor(value ICNNLossDescriptor) { + objc.Call[objc.Void](c_, objc.Sel("setConfidenceLossDescriptor:"), objc.Ptr(value)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976496-whlossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) WHLossDescriptor() CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](c_, objc.Sel("WHLossDescriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976496-whlossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) SetWHLossDescriptor(value ICNNLossDescriptor) { + objc.Call[objc.Void](c_, objc.Sel("setWHLossDescriptor:"), objc.Ptr(value)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976507-scaleclass?language=objc +func (c_ CNNYOLOLossDescriptor) ScaleClass() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleClass")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976507-scaleclass?language=objc +func (c_ CNNYOLOLossDescriptor) SetScaleClass(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setScaleClass:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976497-xylossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) XYLossDescriptor() CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](c_, objc.Sel("XYLossDescriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976497-xylossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) SetXYLossDescriptor(value ICNNLossDescriptor) { + objc.Call[objc.Void](c_, objc.Sel("setXYLossDescriptor:"), objc.Ptr(value)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976508-scalenoobject?language=objc +func (c_ CNNYOLOLossDescriptor) ScaleNoObject() float64 { + rv := objc.Call[float64](c_, objc.Sel("scaleNoObject")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976508-scalenoobject?language=objc +func (c_ CNNYOLOLossDescriptor) SetScaleNoObject(value float64) { + objc.Call[objc.Void](c_, objc.Sel("setScaleNoObject:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976499-classeslossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) ClassesLossDescriptor() CNNLossDescriptor { + rv := objc.Call[CNNLossDescriptor](c_, objc.Sel("classesLossDescriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976499-classeslossdescriptor?language=objc +func (c_ CNNYOLOLossDescriptor) SetClassesLossDescriptor(value ICNNLossDescriptor) { + objc.Call[objc.Void](c_, objc.Sel("setClassesLossDescriptor:"), objc.Ptr(value)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976504-numberofanchorboxes?language=objc +func (c_ CNNYOLOLossDescriptor) NumberOfAnchorBoxes() uint { + rv := objc.Call[uint](c_, objc.Sel("numberOfAnchorBoxes")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossdescriptor/2976504-numberofanchorboxes?language=objc +func (c_ CNNYOLOLossDescriptor) SetNumberOfAnchorBoxes(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setNumberOfAnchorBoxes:"), value) +} diff --git a/macos/mps/cnnyolo_loss_node.gen.go b/macos/mps/cnnyolo_loss_node.gen.go new file mode 100644 index 00000000..3e998912 --- /dev/null +++ b/macos/mps/cnnyolo_loss_node.gen.go @@ -0,0 +1,93 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CNNYOLOLossNode] class. +var CNNYOLOLossNodeClass = _CNNYOLOLossNodeClass{objc.GetClass("MPSCNNYOLOLossNode")} + +type _CNNYOLOLossNodeClass struct { + objc.Class +} + +// An interface definition for the [CNNYOLOLossNode] class. +type ICNNYOLOLossNode interface { + INNFilterNode + InputLabels() NNLabelsNode +} + +// A representation of a YOLO loss kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossnode?language=objc +type CNNYOLOLossNode struct { + NNFilterNode +} + +func CNNYOLOLossNodeFrom(ptr unsafe.Pointer) CNNYOLOLossNode { + return CNNYOLOLossNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (cc _CNNYOLOLossNodeClass) NodeWithSourceLossDescriptor(source INNImageNode, descriptor ICNNYOLOLossDescriptor) CNNYOLOLossNode { + rv := objc.Call[CNNYOLOLossNode](cc, objc.Sel("nodeWithSource:lossDescriptor:"), objc.Ptr(source), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossnode/2976516-nodewithsource?language=objc +func CNNYOLOLossNode_NodeWithSourceLossDescriptor(source INNImageNode, descriptor ICNNYOLOLossDescriptor) CNNYOLOLossNode { + return CNNYOLOLossNodeClass.NodeWithSourceLossDescriptor(source, descriptor) +} + +func (c_ CNNYOLOLossNode) InitWithSourceLossDescriptor(source INNImageNode, descriptor ICNNYOLOLossDescriptor) CNNYOLOLossNode { + rv := objc.Call[CNNYOLOLossNode](c_, objc.Sel("initWithSource:lossDescriptor:"), objc.Ptr(source), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossnode/2976514-initwithsource?language=objc +func NewCNNYOLOLossNodeWithSourceLossDescriptor(source INNImageNode, descriptor ICNNYOLOLossDescriptor) CNNYOLOLossNode { + instance := CNNYOLOLossNodeClass.Alloc().InitWithSourceLossDescriptor(source, descriptor) + instance.Autorelease() + return instance +} + +func (cc _CNNYOLOLossNodeClass) Alloc() CNNYOLOLossNode { + rv := objc.Call[CNNYOLOLossNode](cc, objc.Sel("alloc")) + return rv +} + +func CNNYOLOLossNode_Alloc() CNNYOLOLossNode { + return CNNYOLOLossNodeClass.Alloc() +} + +func (cc _CNNYOLOLossNodeClass) New() CNNYOLOLossNode { + rv := objc.Call[CNNYOLOLossNode](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCNNYOLOLossNode() CNNYOLOLossNode { + return CNNYOLOLossNodeClass.New() +} + +func (c_ CNNYOLOLossNode) Init() CNNYOLOLossNode { + rv := objc.Call[CNNYOLOLossNode](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnyololossnode/2976515-inputlabels?language=objc +func (c_ CNNYOLOLossNode) InputLabels() NNLabelsNode { + rv := objc.Call[NNLabelsNode](c_, objc.Sel("inputLabels")) + return rv +} diff --git a/macos/mps/command_buffer.gen.go b/macos/mps/command_buffer.gen.go new file mode 100644 index 00000000..65856b13 --- /dev/null +++ b/macos/mps/command_buffer.gen.go @@ -0,0 +1,177 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CommandBuffer] class. +var CommandBufferClass = _CommandBufferClass{objc.GetClass("MPSCommandBuffer")} + +type _CommandBufferClass struct { + objc.Class +} + +// An interface definition for the [CommandBuffer] class. +type ICommandBuffer interface { + objc.IObject + PrefetchHeapForWorkloadSize(size uint) + CommitAndContinue() + RootCommandBuffer() metal.CommandBufferWrapper + CommandBuffer() metal.CommandBufferWrapper + Predicate() Predicate + SetPredicate(value IPredicate) + HeapProvider() HeapProviderWrapper + SetHeapProvider(value PHeapProvider) + SetHeapProviderObject(valueObject objc.IObject) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer?language=objc +type CommandBuffer struct { + objc.Object +} + +func CommandBufferFrom(ptr unsafe.Pointer) CommandBuffer { + return CommandBuffer{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ CommandBuffer) InitWithCommandBuffer(commandBuffer metal.PCommandBuffer) CommandBuffer { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CommandBuffer](c_, objc.Sel("initWithCommandBuffer:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3114031-initwithcommandbuffer?language=objc +func NewCommandBufferWithCommandBuffer(commandBuffer metal.PCommandBuffer) CommandBuffer { + instance := CommandBufferClass.Alloc().InitWithCommandBuffer(commandBuffer) + instance.Autorelease() + return instance +} + +func (cc _CommandBufferClass) CommandBufferWithCommandBuffer(commandBuffer metal.PCommandBuffer) CommandBuffer { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[CommandBuffer](cc, objc.Sel("commandBufferWithCommandBuffer:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3114030-commandbufferwithcommandbuffer?language=objc +func CommandBuffer_CommandBufferWithCommandBuffer(commandBuffer metal.PCommandBuffer) CommandBuffer { + return CommandBufferClass.CommandBufferWithCommandBuffer(commandBuffer) +} + +func (cc _CommandBufferClass) CommandBufferFromCommandQueue(commandQueue metal.PCommandQueue) CommandBuffer { + po0 := objc.WrapAsProtocol("MTLCommandQueue", commandQueue) + rv := objc.Call[CommandBuffer](cc, objc.Sel("commandBufferFromCommandQueue:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3114029-commandbufferfromcommandqueue?language=objc +func CommandBuffer_CommandBufferFromCommandQueue(commandQueue metal.PCommandQueue) CommandBuffer { + return CommandBufferClass.CommandBufferFromCommandQueue(commandQueue) +} + +func (cc _CommandBufferClass) Alloc() CommandBuffer { + rv := objc.Call[CommandBuffer](cc, objc.Sel("alloc")) + return rv +} + +func CommandBuffer_Alloc() CommandBuffer { + return CommandBufferClass.Alloc() +} + +func (cc _CommandBufferClass) New() CommandBuffer { + rv := objc.Call[CommandBuffer](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCommandBuffer() CommandBuffer { + return CommandBufferClass.New() +} + +func (c_ CommandBuffer) Init() CommandBuffer { + rv := objc.Call[CommandBuffer](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3229858-prefetchheapforworkloadsize?language=objc +func (c_ CommandBuffer) PrefetchHeapForWorkloadSize(size uint) { + objc.Call[objc.Void](c_, objc.Sel("prefetchHeapForWorkloadSize:"), size) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3152524-commitandcontinue?language=objc +func (c_ CommandBuffer) CommitAndContinue() { + objc.Call[objc.Void](c_, objc.Sel("commitAndContinue")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3166772-rootcommandbuffer?language=objc +func (c_ CommandBuffer) RootCommandBuffer() metal.CommandBufferWrapper { + rv := objc.Call[metal.CommandBufferWrapper](c_, objc.Sel("rootCommandBuffer")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3114028-commandbuffer?language=objc +func (c_ CommandBuffer) CommandBuffer() metal.CommandBufferWrapper { + rv := objc.Call[metal.CommandBufferWrapper](c_, objc.Sel("commandBuffer")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3114032-predicate?language=objc +func (c_ CommandBuffer) Predicate() Predicate { + rv := objc.Call[Predicate](c_, objc.Sel("predicate")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3114032-predicate?language=objc +func (c_ CommandBuffer) SetPredicate(value IPredicate) { + objc.Call[objc.Void](c_, objc.Sel("setPredicate:"), objc.Ptr(value)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3229857-heapprovider?language=objc +func (c_ CommandBuffer) HeapProvider() HeapProviderWrapper { + rv := objc.Call[HeapProviderWrapper](c_, objc.Sel("heapProvider")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3229857-heapprovider?language=objc +func (c_ CommandBuffer) SetHeapProvider(value PHeapProvider) { + po0 := objc.WrapAsProtocol("MPSHeapProvider", value) + objc.Call[objc.Void](c_, objc.Sel("setHeapProvider:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscommandbuffer/3229857-heapprovider?language=objc +func (c_ CommandBuffer) SetHeapProviderObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setHeapProvider:"), objc.Ptr(valueObject)) +} diff --git a/macos/mps/device_provider.gen.go b/macos/mps/device_provider.gen.go new file mode 100644 index 00000000..45410b10 --- /dev/null +++ b/macos/mps/device_provider.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// An interface that enables the setting of a Metal device for unarchived objects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsdeviceprovider?language=objc +type PDeviceProvider interface { + // optional + MpsMTLDevice() metal.PDevice + HasMpsMTLDevice() bool +} + +// A concrete type wrapper for the [PDeviceProvider] protocol. +type DeviceProviderWrapper struct { + objc.Object +} + +func (d_ DeviceProviderWrapper) HasMpsMTLDevice() bool { + return d_.RespondsToSelector(objc.Sel("mpsMTLDevice")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsdeviceprovider/2875211-mpsmtldevice?language=objc +func (d_ DeviceProviderWrapper) MpsMTLDevice() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](d_, objc.Sel("mpsMTLDevice")) + return rv +} diff --git a/macos/mps/doc.gen.go b/macos/mps/doc.gen.go new file mode 100644 index 00000000..85018bd5 --- /dev/null +++ b/macos/mps/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Optimize graphics and compute performance with kernels that are fine-tuned for the unique characteristics of each Metal GPU family. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/metalperformanceshaders?language=objc +package mps diff --git a/macos/mps/enumtypes.gen.go b/macos/mps/enumtypes.gen.go new file mode 100644 index 00000000..0dd9787f --- /dev/null +++ b/macos/mps/enumtypes.gen.go @@ -0,0 +1,655 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +// Constants that indicate an acceleration structure build state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsaccelerationstructurestatus?language=objc +type AccelerationStructureStatus uint + +const ( + AccelerationStructureStatusBuilt AccelerationStructureStatus = 1 + AccelerationStructureStatusUnbuilt AccelerationStructureStatus = 0 +) + +// Options that describe how an acceleration structure will be used. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsaccelerationstructureusage?language=objc +type AccelerationStructureUsage uint + +const ( + AccelerationStructureUsageFrequentRebuild AccelerationStructureUsage = 2 + AccelerationStructureUsageNone AccelerationStructureUsage = 0 + AccelerationStructureUsagePreferCPUBuild AccelerationStructureUsage = 8 + AccelerationStructureUsagePreferGPUBuild AccelerationStructureUsage = 4 + AccelerationStructureUsageRefit AccelerationStructureUsage = 1 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsaliasingstrategy?language=objc +type AliasingStrategy uint + +const ( + AliasingStrategyAliasingReserved AliasingStrategy = 3 + AliasingStrategyDefault AliasingStrategy = 0 + AliasingStrategyDontCare AliasingStrategy = 0 + AliasingStrategyPreferNonTemporaryMemory AliasingStrategy = 8 + AliasingStrategyPreferTemporaryMemory AliasingStrategy = 4 + AliasingStrategyShallAlias AliasingStrategy = 1 + AliasingStrategyShallNotAlias AliasingStrategy = 2 +) + +// Premultiplication description for the color channels of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsalphatype?language=objc +type AlphaType uint + +const ( + AlphaTypeAlphaIsOne AlphaType = 1 + AlphaTypeNonPremultiplied AlphaType = 0 + AlphaTypePremultiplied AlphaType = 2 +) + +// Options for the intersection test type for a ray intersector bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsboundingboxintersectiontesttype?language=objc +type BoundingBoxIntersectionTestType uint + +const ( + BoundingBoxIntersectionTestTypeAxisAligned BoundingBoxIntersectionTestType = 1 + BoundingBoxIntersectionTestTypeDefault BoundingBoxIntersectionTestType = 0 + BoundingBoxIntersectionTestTypeFast BoundingBoxIntersectionTestType = 2 +) + +// Options that define how statistics are calculated during batch normalization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbatchnormalizationflags?language=objc +type CNNBatchNormalizationFlags uint + +const ( + CNNBatchNormalizationFlagsCalculateStatisticsAlways CNNBatchNormalizationFlags = 1 + CNNBatchNormalizationFlagsCalculateStatisticsAutomatic CNNBatchNormalizationFlags = 0 + CNNBatchNormalizationFlagsCalculateStatisticsMask CNNBatchNormalizationFlags = 3 + CNNBatchNormalizationFlagsCalculateStatisticsNever CNNBatchNormalizationFlags = 2 + CNNBatchNormalizationFlagsDefault CNNBatchNormalizationFlags = 0 +) + +// Options used to control binary convolution kernels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolutionflags?language=objc +type CNNBinaryConvolutionFlags uint + +const ( + CNNBinaryConvolutionFlagsNone CNNBinaryConvolutionFlags = 0 + CNNBinaryConvolutionFlagsUseBetaScaling CNNBinaryConvolutionFlags = 1 +) + +// Options that defines what operations are used to perform binary convolution. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinaryconvolutiontype?language=objc +type CNNBinaryConvolutionType uint + +const ( + CNNBinaryConvolutionTypeAND CNNBinaryConvolutionType = 2 + CNNBinaryConvolutionTypeBinaryWeights CNNBinaryConvolutionType = 0 + CNNBinaryConvolutionTypeXNOR CNNBinaryConvolutionType = 1 +) + +// Options used to control how kernel weights are stored and used in the CNN kernels [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionflags?language=objc +type CNNConvolutionFlags uint + +const ( + CNNConvolutionFlagsNone CNNConvolutionFlags = 0 +) + +// Options that control which gradient to compute during backward propagation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiongradientoption?language=objc +type CNNConvolutionGradientOption uint + +const ( + CNNConvolutionGradientOptionAll CNNConvolutionGradientOption = 3 + CNNConvolutionGradientOptionGradientWithData CNNConvolutionGradientOption = 1 + CNNConvolutionGradientOptionGradientWithWeightsAndBias CNNConvolutionGradientOption = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutionweightslayout?language=objc +type CNNConvolutionWeightsLayout uint32 + +const ( + CNNConvolutionWeightsLayoutOHWI CNNConvolutionWeightsLayout = 0 +) + +// Constants that indicate supported loss filter types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnlosstype?language=objc +type CNNLossType uint32 + +const ( + CNNLossTypeCategoricalCrossEntropy CNNLossType = 4 + CNNLossTypeCosineDistance CNNLossType = 7 + CNNLossTypeCount CNNLossType = 10 + CNNLossTypeHinge CNNLossType = 5 + CNNLossTypeHuber CNNLossType = 6 + CNNLossTypeKullbackLeiblerDivergence CNNLossType = 9 + CNNLossTypeLog CNNLossType = 8 + CNNLossTypeMeanAbsoluteError CNNLossType = 0 + CNNLossTypeMeanSquaredError CNNLossType = 1 + CNNLossTypeSigmoidCrossEntropy CNNLossType = 3 + CNNLossTypeSoftMaxCrossEntropy CNNLossType = 2 +) + +// The types of neuron filter to append to a convolution. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnneurontype?language=objc +type CNNNeuronType int32 + +const ( + CNNNeuronTypeAbsolute CNNNeuronType = 6 + CNNNeuronTypeCount CNNNeuronType = 16 + CNNNeuronTypeELU CNNNeuronType = 9 + CNNNeuronTypeExponential CNNNeuronType = 13 + CNNNeuronTypeGeLU CNNNeuronType = 15 + CNNNeuronTypeHardSigmoid CNNNeuronType = 4 + CNNNeuronTypeLinear CNNNeuronType = 2 + CNNNeuronTypeLogarithm CNNNeuronType = 14 + CNNNeuronTypeNone CNNNeuronType = 0 + CNNNeuronTypePReLU CNNNeuronType = 10 + CNNNeuronTypePower CNNNeuronType = 12 + CNNNeuronTypeReLU CNNNeuronType = 1 + CNNNeuronTypeReLUN CNNNeuronType = 11 + CNNNeuronTypeSigmoid CNNNeuronType = 3 + CNNNeuronTypeSoftPlus CNNNeuronType = 7 + CNNNeuronTypeSoftSign CNNNeuronType = 8 + CNNNeuronTypeTanH CNNNeuronType = 5 +) + +// Constants that indicate supported reduction types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnreductiontype?language=objc +type CNNReductionType int32 + +const ( + CNNReductionTypeCount CNNReductionType = 4 + CNNReductionTypeMean CNNReductionType = 2 + CNNReductionTypeNone CNNReductionType = 0 + CNNReductionTypeSum CNNReductionType = 1 + CNNReductionTypeSumByNonZeroWeights CNNReductionType = 3 +) + +// Options that specify the type of quantization used to generate unsigned integer weights. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnweightsquantizationtype?language=objc +type CNNWeightsQuantizationType uint32 + +const ( + CNNWeightsQuantizationTypeLinear CNNWeightsQuantizationType = 1 + CNNWeightsQuantizationTypeLookupTable CNNWeightsQuantizationType = 2 + CNNWeightsQuantizationTypeNone CNNWeightsQuantizationType = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscustomkernelindex?language=objc +type CustomKernelIndex int + +const ( + CustomKernelIndexDestIndex CustomKernelIndex = 0 + CustomKernelIndexSrc0Index CustomKernelIndex = 0 + CustomKernelIndexSrc1Index CustomKernelIndex = 1 + CustomKernelIndexSrc2Index CustomKernelIndex = 2 + CustomKernelIndexSrc3Index CustomKernelIndex = 3 + CustomKernelIndexSrc4Index CustomKernelIndex = 4 + CustomKernelIndexUserDataIndex CustomKernelIndex = 30 +) + +// Options that define how buffer data is arranged. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsdatalayout?language=objc +type DataLayout uint + +const ( + DataLayoutFeatureChannelsxHeightxWidth DataLayout = 1 + DataLayoutHeightxWidthxFeatureChannels DataLayout = 0 +) + +// A value to specify a type of data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsdatatype?language=objc +type DataType uint32 + +const ( + DataTypeAlternateEncodingBit DataType = 2147483648 + DataTypeBool DataType = 2147483656 + DataTypeFloat16 DataType = 268435472 + DataTypeFloat32 DataType = 268435488 + DataTypeFloatBit DataType = 268435456 + DataTypeInt16 DataType = 536870928 + DataTypeInt32 DataType = 536870944 + DataTypeInt64 DataType = 536870976 + DataTypeInt8 DataType = 536870920 + DataTypeIntBit DataType = 536870912 + DataTypeInvalid DataType = 0 + DataTypeNormalizedBit DataType = 1073741824 + DataTypeSignedBit DataType = 536870912 + DataTypeUInt16 DataType = 16 + DataTypeUInt32 DataType = 32 + DataTypeUInt64 DataType = 64 + DataTypeUInt8 DataType = 8 + DataTypeUnorm1 DataType = 1073741825 + DataTypeUnorm8 DataType = 1073741832 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsdevicecaps?language=objc +type DeviceCaps uint32 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsdevicecapsvalues?language=objc +type DeviceCapsValues uint32 + +const ( + DeviceCapsNull DeviceCapsValues = 0 + DeviceIsAppleDevice DeviceCapsValues = 1024 + DeviceSupportsFloat16BicubicFiltering DeviceCapsValues = 512 + DeviceSupportsFloat32Filtering DeviceCapsValues = 128 + DeviceSupportsNorm16BicubicFiltering DeviceCapsValues = 256 + DeviceSupportsQuadShuffle DeviceCapsValues = 16 + DeviceSupportsReadWriteTextures DeviceCapsValues = 4 + DeviceSupportsReadableArrayOfTextures DeviceCapsValues = 1 + DeviceSupportsSimdReduction DeviceCapsValues = 64 + DeviceSupportsSimdShuffle DeviceCapsValues = 32 + DeviceSupportsSimdgroupBarrier DeviceCapsValues = 8 + DeviceSupportsWritableArrayOfTextures DeviceCapsValues = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsdeviceoptions?language=objc +type DeviceOptions uint + +const ( + DeviceOptionsDefault DeviceOptions = 0 + DeviceOptionsLowPower DeviceOptions = 1 + DeviceOptionsSkipRemovable DeviceOptions = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsfunctionconstant?language=objc +type FunctionConstant int64 + +const ( + FunctionConstantNone FunctionConstant = -1 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsfunctionconstantinmetal?language=objc +type FunctionConstantInMetal uint32 + +// The options used to control the edge behavior of an image filter when it reads outside the bounds of a source texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedgemode?language=objc +type ImageEdgeMode uint + +const ( + ImageEdgeModeClamp ImageEdgeMode = 1 + ImageEdgeModeConstant ImageEdgeMode = 4 + ImageEdgeModeMirror ImageEdgeMode = 2 + ImageEdgeModeMirrorWithEdge ImageEdgeMode = 3 + ImageEdgeModeZero ImageEdgeMode = 0 +) + +// Encodes the representation of a single channel within an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagefeaturechannelformat?language=objc +type ImageFeatureChannelFormat uint + +const ( + ImageFeatureChannelFormatCount ImageFeatureChannelFormat = 6 + ImageFeatureChannelFormatFloat16 ImageFeatureChannelFormat = 3 + ImageFeatureChannelFormatFloat32 ImageFeatureChannelFormat = 4 + ImageFeatureChannelFormatNone ImageFeatureChannelFormat = 0 + ImageFeatureChannelFormatUnorm16 ImageFeatureChannelFormat = 2 + ImageFeatureChannelFormatUnorm8 ImageFeatureChannelFormat = 1 + ImageFeatureChannelFormat_reserved0 ImageFeatureChannelFormat = 5 +) + +// Options that define a Metal Performance Shaders image type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagetype?language=objc +type ImageType uint32 + +const ( + ImageType2d ImageType = 0 + ImageType2d_array ImageType = 1 + ImageType2d_array_noAlpha ImageType = 5 + ImageType2d_noAlpha ImageType = 4 + ImageTypeArray2d ImageType = 2 + ImageTypeArray2d_array ImageType = 3 + ImageTypeArray2d_array_noAlpha ImageType = 7 + ImageTypeArray2d_noAlpha ImageType = 6 + ImageType_ArrayMask ImageType = 1 + ImageType_BatchMask ImageType = 2 + ImageType_bitCount ImageType = 6 + ImageType_mask ImageType = 63 + ImageType_noAlpha ImageType = 4 + ImageType_texelFormatBFloat16 ImageType = 24 + ImageType_texelFormatFloat16 ImageType = 16 + ImageType_texelFormatMask ImageType = 56 + ImageType_texelFormatShift ImageType = 3 + ImageType_texelFormatStandard ImageType = 0 + ImageType_texelFormatUnorm8 ImageType = 8 + ImageType_typeMask ImageType = 3 +) + +// Options that determine the data contained in an intersection result. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsintersectiondatatype?language=objc +type IntersectionDataType uint + +const ( + IntersectionDataTypeDistance IntersectionDataType = 0 + IntersectionDataTypeDistancePrimitiveIndex IntersectionDataType = 1 + IntersectionDataTypeDistancePrimitiveIndexBufferIndex IntersectionDataType = 5 + IntersectionDataTypeDistancePrimitiveIndexBufferIndexCoordinates IntersectionDataType = 6 + IntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndex IntersectionDataType = 7 + IntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates IntersectionDataType = 8 + IntersectionDataTypeDistancePrimitiveIndexCoordinates IntersectionDataType = 2 + IntersectionDataTypeDistancePrimitiveIndexInstanceIndex IntersectionDataType = 3 + IntersectionDataTypeDistancePrimitiveIndexInstanceIndexCoordinates IntersectionDataType = 4 +) + +// Options that determine an intersection type for a ray intersector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsintersectiontype?language=objc +type IntersectionType uint + +const ( + IntersectionTypeAny IntersectionType = 1 + IntersectionTypeNearest IntersectionType = 0 +) + +// The options used when creating a kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskerneloptions?language=objc +type KernelOptions uint + +const ( + KernelOptionsAllowReducedPrecision KernelOptions = 2 + KernelOptionsDisableInternalTiling KernelOptions = 4 + KernelOptionsInsertDebugGroups KernelOptions = 8 + KernelOptionsNone KernelOptions = 0 + KernelOptionsSkipAPIValidation KernelOptions = 1 + KernelOptionsVerbose KernelOptions = 16 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositionstatus?language=objc +type MatrixDecompositionStatus int + +const ( + MatrixDecompositionStatusFailure MatrixDecompositionStatus = -1 + MatrixDecompositionStatusNonPositiveDefinite MatrixDecompositionStatus = -3 + MatrixDecompositionStatusSingular MatrixDecompositionStatus = -2 + MatrixDecompositionStatusSuccess MatrixDecompositionStatus = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistribution?language=objc +type MatrixRandomDistribution uint + +const ( + MatrixRandomDistributionDefault MatrixRandomDistribution = 1 + MatrixRandomDistributionNormal MatrixRandomDistribution = 3 + MatrixRandomDistributionUniform MatrixRandomDistribution = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncomparisontype?language=objc +type NNComparisonType uint + +const ( + NNComparisonTypeEqual NNComparisonType = 0 + NNComparisonTypeGreater NNComparisonType = 4 + NNComparisonTypeGreaterOrEqual NNComparisonType = 5 + NNComparisonTypeLess NNComparisonType = 2 + NNComparisonTypeLessOrEqual NNComparisonType = 3 + NNComparisonTypeNotEqual NNComparisonType = 1 +) + +// Options that specify convolution accumulator precision. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnconvolutionaccumulatorprecisionoption?language=objc +type NNConvolutionAccumulatorPrecisionOption uint + +const ( + NNConvolutionAccumulatorPrecisionOptionFloat NNConvolutionAccumulatorPrecisionOption = 1 + NNConvolutionAccumulatorPrecisionOptionHalf NNConvolutionAccumulatorPrecisionOption = 0 +) + +// Options that define a graph's padding. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpaddingmethod?language=objc +type NNPaddingMethod uint + +const ( + NNPaddingMethodAddRemainderToBottomLeft NNPaddingMethod = 8 + NNPaddingMethodAddRemainderToBottomRight NNPaddingMethod = 12 + NNPaddingMethodAddRemainderToMask NNPaddingMethod = 12 + NNPaddingMethodAddRemainderToTopLeft NNPaddingMethod = 0 + NNPaddingMethodAddRemainderToTopRight NNPaddingMethod = 4 + NNPaddingMethodAlignBottomRight NNPaddingMethod = 2 + NNPaddingMethodAlignCentered NNPaddingMethod = 0 + NNPaddingMethodAlignMask NNPaddingMethod = 3 + NNPaddingMethodAlignTopLeft NNPaddingMethod = 1 + NNPaddingMethodAlign_reserved NNPaddingMethod = 3 + NNPaddingMethodCustom NNPaddingMethod = 16384 + NNPaddingMethodCustomAllowForNodeFusion NNPaddingMethod = 8192 + NNPaddingMethodCustomWhitelistForNodeFusion NNPaddingMethod = 8192 + NNPaddingMethodExcludeEdges NNPaddingMethod = 32768 + NNPaddingMethodSizeFull NNPaddingMethod = 32 + NNPaddingMethodSizeMask NNPaddingMethod = 2032 + NNPaddingMethodSizeSame NNPaddingMethod = 16 + NNPaddingMethodSizeValidOnly NNPaddingMethod = 0 + NNPaddingMethodSize_reserved NNPaddingMethod = 48 +) + +// Options that define the regularization type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnregularizationtype?language=objc +type NNRegularizationType uint + +const ( + NNRegularizationTypeL1 NNRegularizationType = 1 + NNRegularizationTypeL2 NNRegularizationType = 2 + NNRegularizationTypeNone NNRegularizationType = 0 +) + +// Options that control how graph nodes are trained. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnntrainingstyle?language=objc +type NNTrainingStyle uint + +const ( + NNTrainingStyleUpdateDeviceCPU NNTrainingStyle = 1 + NNTrainingStyleUpdateDeviceGPU NNTrainingStyle = 2 + NNTrainingStyleUpdateDeviceNone NNTrainingStyle = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspolygontype?language=objc +type PolygonType uint + +const ( + PolygonTypeQuadrilateral PolygonType = 1 + PolygonTypeTriangle PolygonType = 0 +) + +// The purgeable state of an image’s underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspurgeablestate?language=objc +type PurgeableState uint + +const ( + PurgeableStateAllocationDeferred PurgeableState = 0 + PurgeableStateEmpty PurgeableState = 4 + PurgeableStateKeepCurrent PurgeableState = 1 + PurgeableStateNonVolatile PurgeableState = 2 + PurgeableStateVolatile PurgeableState = 3 +) + +// Modes that define how two images or matrices are combined. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnbidirectionalcombinemode?language=objc +type RNNBidirectionalCombineMode uint + +const ( + RNNBidirectionalCombineModeAdd RNNBidirectionalCombineMode = 1 + RNNBidirectionalCombineModeConcatenate RNNBidirectionalCombineMode = 2 + RNNBidirectionalCombineModeNone RNNBidirectionalCombineMode = 0 +) + +// Options that define which matrix is copied in or out of a trainable RNN layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixid?language=objc +type RNNMatrixId uint + +const ( + RNNMatrixIdGRUInputGateBiasTerms RNNMatrixId = 21 + RNNMatrixIdGRUInputGateInputWeights RNNMatrixId = 19 + RNNMatrixIdGRUInputGateRecurrentWeights RNNMatrixId = 20 + RNNMatrixIdGRUOutputGateBiasTerms RNNMatrixId = 28 + RNNMatrixIdGRUOutputGateInputGateWeights RNNMatrixId = 27 + RNNMatrixIdGRUOutputGateInputWeights RNNMatrixId = 25 + RNNMatrixIdGRUOutputGateRecurrentWeights RNNMatrixId = 26 + RNNMatrixIdGRURecurrentGateBiasTerms RNNMatrixId = 24 + RNNMatrixIdGRURecurrentGateInputWeights RNNMatrixId = 22 + RNNMatrixIdGRURecurrentGateRecurrentWeights RNNMatrixId = 23 + RNNMatrixIdLSTMForgetGateBiasTerms RNNMatrixId = 10 + RNNMatrixIdLSTMForgetGateInputWeights RNNMatrixId = 7 + RNNMatrixIdLSTMForgetGateMemoryWeights RNNMatrixId = 9 + RNNMatrixIdLSTMForgetGateRecurrentWeights RNNMatrixId = 8 + RNNMatrixIdLSTMInputGateBiasTerms RNNMatrixId = 6 + RNNMatrixIdLSTMInputGateInputWeights RNNMatrixId = 3 + RNNMatrixIdLSTMInputGateMemoryWeights RNNMatrixId = 5 + RNNMatrixIdLSTMInputGateRecurrentWeights RNNMatrixId = 4 + RNNMatrixIdLSTMMemoryGateBiasTerms RNNMatrixId = 14 + RNNMatrixIdLSTMMemoryGateInputWeights RNNMatrixId = 11 + RNNMatrixIdLSTMMemoryGateMemoryWeights RNNMatrixId = 13 + RNNMatrixIdLSTMMemoryGateRecurrentWeights RNNMatrixId = 12 + RNNMatrixIdLSTMOutputGateBiasTerms RNNMatrixId = 18 + RNNMatrixIdLSTMOutputGateInputWeights RNNMatrixId = 15 + RNNMatrixIdLSTMOutputGateMemoryWeights RNNMatrixId = 17 + RNNMatrixIdLSTMOutputGateRecurrentWeights RNNMatrixId = 16 + RNNMatrixIdSingleGateBiasTerms RNNMatrixId = 2 + RNNMatrixIdSingleGateInputWeights RNNMatrixId = 0 + RNNMatrixIdSingleGateRecurrentWeights RNNMatrixId = 1 + RNNMatrixId_count RNNMatrixId = 29 +) + +// Directions that a sequence of inputs can be processed by a recurrent neural network layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsequencedirection?language=objc +type RNNSequenceDirection uint + +const ( + RNNSequenceDirectionBackward RNNSequenceDirection = 1 + RNNSequenceDirectionForward RNNSequenceDirection = 0 +) + +// Options for the data type for an intersector ray. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsraydatatype?language=objc +type RayDataType uint + +const ( + RayDataTypeOriginDirection RayDataType = 0 + RayDataTypeOriginMaskDirectionMaxDistance RayDataType = 2 + RayDataTypeOriginMinDistanceDirectionMaxDistance RayDataType = 1 + RayDataTypePackedOriginDirection RayDataType = 3 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsraymaskoperator?language=objc +type RayMaskOperator uint + +const ( + RayMaskOperatorAnd RayMaskOperator = 0 + RayMaskOperatorEqual RayMaskOperator = 10 + RayMaskOperatorGreaterThan RayMaskOperator = 8 + RayMaskOperatorGreaterThanOrEqualTo RayMaskOperator = 9 + RayMaskOperatorLessThan RayMaskOperator = 6 + RayMaskOperatorLessThanOrEqualTo RayMaskOperator = 7 + RayMaskOperatorNotAnd RayMaskOperator = 1 + RayMaskOperatorNotEqual RayMaskOperator = 11 + RayMaskOperatorNotOr RayMaskOperator = 3 + RayMaskOperatorNotXor RayMaskOperator = 5 + RayMaskOperatorOr RayMaskOperator = 2 + RayMaskOperatorXor RayMaskOperator = 4 +) + +// Options for ray intersector mask options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsraymaskoptions?language=objc +type RayMaskOptions uint + +const ( + RayMaskOptionInstance RayMaskOptions = 2 + RayMaskOptionNone RayMaskOptions = 0 + RayMaskOptionPrimitive RayMaskOptions = 1 +) + +// Options for the underlying resource type for a state object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstateresourcetype?language=objc +type StateResourceType uint + +const ( + StateResourceTypeBuffer StateResourceType = 1 + StateResourceTypeNone StateResourceType = 0 + StateResourceTypeTexture StateResourceType = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalweighting?language=objc +type TemporalWeighting uint + +const ( + TemporalWeightingAverage TemporalWeighting = 0 + TemporalWeightingExponentialMovingAverage TemporalWeighting = 1 +) + +// Constants that indicate instance transformation types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstransformtype?language=objc +type TransformType uint + +const ( + TransformTypeFloat4x4 TransformType = 0 + TransformTypeIdentity TransformType = 1 +) + +// Options for the ray-triangle intersection test. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstriangleintersectiontesttype?language=objc +type TriangleIntersectionTestType uint + +const ( + TriangleIntersectionTestTypeDefault TriangleIntersectionTestType = 0 + TriangleIntersectionTestTypeWatertight TriangleIntersectionTestType = 1 +) diff --git a/macos/mps/gru_descriptor.gen.go b/macos/mps/gru_descriptor.gen.go new file mode 100644 index 00000000..45fb1bfe --- /dev/null +++ b/macos/mps/gru_descriptor.gen.go @@ -0,0 +1,286 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [GRUDescriptor] class. +var GRUDescriptorClass = _GRUDescriptorClass{objc.GetClass("MPSGRUDescriptor")} + +type _GRUDescriptorClass struct { + objc.Class +} + +// An interface definition for the [GRUDescriptor] class. +type IGRUDescriptor interface { + IRNNDescriptor + InputGateInputWeights() CNNConvolutionDataSourceWrapper + SetInputGateInputWeights(value PCNNConvolutionDataSource) + SetInputGateInputWeightsObject(valueObject objc.IObject) + RecurrentGateRecurrentWeights() CNNConvolutionDataSourceWrapper + SetRecurrentGateRecurrentWeights(value PCNNConvolutionDataSource) + SetRecurrentGateRecurrentWeightsObject(valueObject objc.IObject) + OutputGateInputGateWeights() CNNConvolutionDataSourceWrapper + SetOutputGateInputGateWeights(value PCNNConvolutionDataSource) + SetOutputGateInputGateWeightsObject(valueObject objc.IObject) + GatePnormValue() float64 + SetGatePnormValue(value float64) + OutputGateRecurrentWeights() CNNConvolutionDataSourceWrapper + SetOutputGateRecurrentWeights(value PCNNConvolutionDataSource) + SetOutputGateRecurrentWeightsObject(valueObject objc.IObject) + FlipOutputGates() bool + SetFlipOutputGates(value bool) + RecurrentGateInputWeights() CNNConvolutionDataSourceWrapper + SetRecurrentGateInputWeights(value PCNNConvolutionDataSource) + SetRecurrentGateInputWeightsObject(valueObject objc.IObject) + InputGateRecurrentWeights() CNNConvolutionDataSourceWrapper + SetInputGateRecurrentWeights(value PCNNConvolutionDataSource) + SetInputGateRecurrentWeightsObject(valueObject objc.IObject) + OutputGateInputWeights() CNNConvolutionDataSourceWrapper + SetOutputGateInputWeights(value PCNNConvolutionDataSource) + SetOutputGateInputWeightsObject(valueObject objc.IObject) +} + +// A description of a gated recurrent unit block or layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor?language=objc +type GRUDescriptor struct { + RNNDescriptor +} + +func GRUDescriptorFrom(ptr unsafe.Pointer) GRUDescriptor { + return GRUDescriptor{ + RNNDescriptor: RNNDescriptorFrom(ptr), + } +} + +func (gc _GRUDescriptorClass) CreateGRUDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels uint, outputFeatureChannels uint) GRUDescriptor { + rv := objc.Call[GRUDescriptor](gc, objc.Sel("createGRUDescriptorWithInputFeatureChannels:outputFeatureChannels:"), inputFeatureChannels, outputFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865715-creategrudescriptorwithinputfeat?language=objc +func GRUDescriptor_CreateGRUDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels uint, outputFeatureChannels uint) GRUDescriptor { + return GRUDescriptorClass.CreateGRUDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels, outputFeatureChannels) +} + +func (gc _GRUDescriptorClass) Alloc() GRUDescriptor { + rv := objc.Call[GRUDescriptor](gc, objc.Sel("alloc")) + return rv +} + +func GRUDescriptor_Alloc() GRUDescriptor { + return GRUDescriptorClass.Alloc() +} + +func (gc _GRUDescriptorClass) New() GRUDescriptor { + rv := objc.Call[GRUDescriptor](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGRUDescriptor() GRUDescriptor { + return GRUDescriptorClass.New() +} + +func (g_ GRUDescriptor) Init() GRUDescriptor { + rv := objc.Call[GRUDescriptor](g_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865690-inputgateinputweights?language=objc +func (g_ GRUDescriptor) InputGateInputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](g_, objc.Sel("inputGateInputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865690-inputgateinputweights?language=objc +func (g_ GRUDescriptor) SetInputGateInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](g_, objc.Sel("setInputGateInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865690-inputgateinputweights?language=objc +func (g_ GRUDescriptor) SetInputGateInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](g_, objc.Sel("setInputGateInputWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865695-recurrentgaterecurrentweights?language=objc +func (g_ GRUDescriptor) RecurrentGateRecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](g_, objc.Sel("recurrentGateRecurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865695-recurrentgaterecurrentweights?language=objc +func (g_ GRUDescriptor) SetRecurrentGateRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](g_, objc.Sel("setRecurrentGateRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865695-recurrentgaterecurrentweights?language=objc +func (g_ GRUDescriptor) SetRecurrentGateRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](g_, objc.Sel("setRecurrentGateRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2878270-outputgateinputgateweights?language=objc +func (g_ GRUDescriptor) OutputGateInputGateWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](g_, objc.Sel("outputGateInputGateWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2878270-outputgateinputgateweights?language=objc +func (g_ GRUDescriptor) SetOutputGateInputGateWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](g_, objc.Sel("setOutputGateInputGateWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2878270-outputgateinputgateweights?language=objc +func (g_ GRUDescriptor) SetOutputGateInputGateWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](g_, objc.Sel("setOutputGateInputGateWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2873332-gatepnormvalue?language=objc +func (g_ GRUDescriptor) GatePnormValue() float64 { + rv := objc.Call[float64](g_, objc.Sel("gatePnormValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2873332-gatepnormvalue?language=objc +func (g_ GRUDescriptor) SetGatePnormValue(value float64) { + objc.Call[objc.Void](g_, objc.Sel("setGatePnormValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865699-outputgaterecurrentweights?language=objc +func (g_ GRUDescriptor) OutputGateRecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](g_, objc.Sel("outputGateRecurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865699-outputgaterecurrentweights?language=objc +func (g_ GRUDescriptor) SetOutputGateRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](g_, objc.Sel("setOutputGateRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865699-outputgaterecurrentweights?language=objc +func (g_ GRUDescriptor) SetOutputGateRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](g_, objc.Sel("setOutputGateRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2878271-flipoutputgates?language=objc +func (g_ GRUDescriptor) FlipOutputGates() bool { + rv := objc.Call[bool](g_, objc.Sel("flipOutputGates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2878271-flipoutputgates?language=objc +func (g_ GRUDescriptor) SetFlipOutputGates(value bool) { + objc.Call[objc.Void](g_, objc.Sel("setFlipOutputGates:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865719-recurrentgateinputweights?language=objc +func (g_ GRUDescriptor) RecurrentGateInputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](g_, objc.Sel("recurrentGateInputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865719-recurrentgateinputweights?language=objc +func (g_ GRUDescriptor) SetRecurrentGateInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](g_, objc.Sel("setRecurrentGateInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865719-recurrentgateinputweights?language=objc +func (g_ GRUDescriptor) SetRecurrentGateInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](g_, objc.Sel("setRecurrentGateInputWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865724-inputgaterecurrentweights?language=objc +func (g_ GRUDescriptor) InputGateRecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](g_, objc.Sel("inputGateRecurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865724-inputgaterecurrentweights?language=objc +func (g_ GRUDescriptor) SetInputGateRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](g_, objc.Sel("setInputGateRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865724-inputgaterecurrentweights?language=objc +func (g_ GRUDescriptor) SetInputGateRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](g_, objc.Sel("setInputGateRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865722-outputgateinputweights?language=objc +func (g_ GRUDescriptor) OutputGateInputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](g_, objc.Sel("outputGateInputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865722-outputgateinputweights?language=objc +func (g_ GRUDescriptor) SetOutputGateInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](g_, objc.Sel("setOutputGateInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsgrudescriptor/2865722-outputgateinputweights?language=objc +func (g_ GRUDescriptor) SetOutputGateInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](g_, objc.Sel("setOutputGateInputWeights:"), objc.Ptr(valueObject)) +} diff --git a/macos/mps/handle.gen.go b/macos/mps/handle.gen.go new file mode 100644 index 00000000..a5138ce1 --- /dev/null +++ b/macos/mps/handle.gen.go @@ -0,0 +1,33 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/objc" +) + +// The protocol that provides resource identification. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpshandle?language=objc +type PHandle interface { + // optional + Label() string + HasLabel() bool +} + +// A concrete type wrapper for the [PHandle] protocol. +type HandleWrapper struct { + objc.Object +} + +func (h_ HandleWrapper) HasLabel() bool { + return h_.RespondsToSelector(objc.Sel("label")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpshandle/2866414-label?language=objc +func (h_ HandleWrapper) Label() string { + rv := objc.Call[string](h_, objc.Sel("label")) + return rv +} diff --git a/macos/mps/heap_provider.gen.go b/macos/mps/heap_provider.gen.go new file mode 100644 index 00000000..a69f96bf --- /dev/null +++ b/macos/mps/heap_provider.gen.go @@ -0,0 +1,51 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsheapprovider?language=objc +type PHeapProvider interface { + // optional + RetireHeapCacheDelay(heap metal.HeapWrapper, seconds float64) + HasRetireHeapCacheDelay() bool + + // optional + NewHeapWithDescriptor(descriptor metal.HeapDescriptor) metal.PHeap + HasNewHeapWithDescriptor() bool +} + +// A concrete type wrapper for the [PHeapProvider] protocol. +type HeapProviderWrapper struct { + objc.Object +} + +func (h_ HeapProviderWrapper) HasRetireHeapCacheDelay() bool { + return h_.RespondsToSelector(objc.Sel("retireHeap:cacheDelay:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsheapprovider/3229862-retireheap?language=objc +func (h_ HeapProviderWrapper) RetireHeapCacheDelay(heap metal.PHeap, seconds float64) { + po0 := objc.WrapAsProtocol("MTLHeap", heap) + objc.Call[objc.Void](h_, objc.Sel("retireHeap:cacheDelay:"), po0, seconds) +} + +func (h_ HeapProviderWrapper) HasNewHeapWithDescriptor() bool { + return h_.RespondsToSelector(objc.Sel("newHeapWithDescriptor:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsheapprovider/3229861-newheapwithdescriptor?language=objc +func (h_ HeapProviderWrapper) NewHeapWithDescriptor(descriptor metal.IHeapDescriptor) metal.HeapWrapper { + rv := objc.Call[metal.HeapWrapper](h_, objc.Sel("newHeapWithDescriptor:"), objc.Ptr(descriptor)) + rv.Autorelease() + return rv +} diff --git a/macos/mps/image.gen.go b/macos/mps/image.gen.go new file mode 100644 index 00000000..a5b84720 --- /dev/null +++ b/macos/mps/image.gen.go @@ -0,0 +1,331 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Image] class. +var ImageClass = _ImageClass{objc.GetClass("MPSImage")} + +type _ImageClass struct { + objc.Class +} + +// An interface definition for the [Image] class. +type IImage interface { + objc.IObject + BatchRepresentationWithSubRange(subRange foundation.Range) *foundation.Array + ResourceSize() uint + BatchRepresentation() *foundation.Array + WriteBytesDataLayoutImageIndex(dataBytes unsafe.Pointer, dataLayout DataLayout, imageIndex uint) + ReadBytesDataLayoutImageIndex(dataBytes unsafe.Pointer, dataLayout DataLayout, imageIndex uint) + SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) + SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) + SubImageWithFeatureChannelRange(range_ foundation.Range) Image + SetPurgeableState(state PurgeableState) PurgeableState + Width() uint + Usage() metal.TextureUsage + Parent() Image + Device() metal.DeviceWrapper + NumberOfImages() uint + Height() uint + FeatureChannelFormat() ImageFeatureChannelFormat + TextureType() metal.TextureType + PixelFormat() metal.PixelFormat + FeatureChannels() uint + Label() string + SetLabel(value string) + Texture() metal.TextureWrapper + Precision() uint + PixelSize() uint +} + +// A texture that may have more than four channels for use in convolutional neural networks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage?language=objc +type Image struct { + objc.Object +} + +func ImageFrom(ptr unsafe.Pointer) Image { + return Image{ + Object: objc.ObjectFrom(ptr), + } +} + +func (i_ Image) InitWithParentImageSliceRangeFeatureChannels(parent IImage, sliceRange foundation.Range, featureChannels uint) Image { + rv := objc.Call[Image](i_, objc.Sel("initWithParentImage:sliceRange:featureChannels:"), objc.Ptr(parent), sliceRange, featureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942493-initwithparentimage?language=objc +func NewImageWithParentImageSliceRangeFeatureChannels(parent IImage, sliceRange foundation.Range, featureChannels uint) Image { + instance := ImageClass.Alloc().InitWithParentImageSliceRangeFeatureChannels(parent, sliceRange, featureChannels) + instance.Autorelease() + return instance +} + +func (i_ Image) InitWithTextureFeatureChannels(texture metal.PTexture, featureChannels uint) Image { + po0 := objc.WrapAsProtocol("MTLTexture", texture) + rv := objc.Call[Image](i_, objc.Sel("initWithTexture:featureChannels:"), po0, featureChannels) + return rv +} + +// Initializes an image from a texture. The user-allocated texture has been created for a specific number of feature channels and number of images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2097547-initwithtexture?language=objc +func NewImageWithTextureFeatureChannels(texture metal.PTexture, featureChannels uint) Image { + instance := ImageClass.Alloc().InitWithTextureFeatureChannels(texture, featureChannels) + instance.Autorelease() + return instance +} + +func (i_ Image) InitWithDeviceImageDescriptor(device metal.PDevice, imageDescriptor IImageDescriptor) Image { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[Image](i_, objc.Sel("initWithDevice:imageDescriptor:"), po0, objc.Ptr(imageDescriptor)) + return rv +} + +// Initializes an empty image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648920-initwithdevice?language=objc +func NewImageWithDeviceImageDescriptor(device metal.PDevice, imageDescriptor IImageDescriptor) Image { + instance := ImageClass.Alloc().InitWithDeviceImageDescriptor(device, imageDescriptor) + instance.Autorelease() + return instance +} + +func (ic _ImageClass) Alloc() Image { + rv := objc.Call[Image](ic, objc.Sel("alloc")) + return rv +} + +func Image_Alloc() Image { + return ImageClass.Alloc() +} + +func (ic _ImageClass) New() Image { + rv := objc.Call[Image](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImage() Image { + return ImageClass.New() +} + +func (i_ Image) Init() Image { + rv := objc.Call[Image](i_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942492-batchrepresentationwithsubrange?language=objc +func (i_ Image) BatchRepresentationWithSubRange(subRange foundation.Range) *foundation.Array { + rv := objc.Call[*foundation.Array](i_, objc.Sel("batchRepresentationWithSubRange:"), subRange) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942494-resourcesize?language=objc +func (i_ Image) ResourceSize() uint { + rv := objc.Call[uint](i_, objc.Sel("resourceSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942495-batchrepresentation?language=objc +func (i_ Image) BatchRepresentation() *foundation.Array { + rv := objc.Call[*foundation.Array](i_, objc.Sel("batchRepresentation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2867189-writebytes?language=objc +func (i_ Image) WriteBytesDataLayoutImageIndex(dataBytes unsafe.Pointer, dataLayout DataLayout, imageIndex uint) { + objc.Call[objc.Void](i_, objc.Sel("writeBytes:dataLayout:imageIndex:"), dataBytes, dataLayout, imageIndex) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2867188-readbytes?language=objc +func (i_ Image) ReadBytesDataLayoutImageIndex(dataBytes unsafe.Pointer, dataLayout DataLayout, imageIndex uint) { + objc.Call[objc.Void](i_, objc.Sel("readBytes:dataLayout:imageIndex:"), dataBytes, dataLayout, imageIndex) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942491-synchronizeoncommandbuffer?language=objc +func (i_ Image) SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](i_, objc.Sel("synchronizeOnCommandBuffer:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942491-synchronizeoncommandbuffer?language=objc +func (i_ Image) SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) { + objc.Call[objc.Void](i_, objc.Sel("synchronizeOnCommandBuffer:"), objc.Ptr(commandBufferObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2867148-defaultallocator?language=objc +func (ic _ImageClass) DefaultAllocator() ImageAllocatorWrapper { + rv := objc.Call[ImageAllocatorWrapper](ic, objc.Sel("defaultAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2867148-defaultallocator?language=objc +func Image_DefaultAllocator() ImageAllocatorWrapper { + return ImageClass.DefaultAllocator() +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942488-subimagewithfeaturechannelrange?language=objc +func (i_ Image) SubImageWithFeatureChannelRange(range_ foundation.Range) Image { + rv := objc.Call[Image](i_, objc.Sel("subImageWithFeatureChannelRange:"), range_) + return rv +} + +// Set (or query) the purgeable state of the image’s underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648820-setpurgeablestate?language=objc +func (i_ Image) SetPurgeableState(state PurgeableState) PurgeableState { + rv := objc.Call[PurgeableState](i_, objc.Sel("setPurgeableState:"), state) + return rv +} + +// The formal width of the image, in pixels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648884-width?language=objc +func (i_ Image) Width() uint { + rv := objc.Call[uint](i_, objc.Sel("width")) + return rv +} + +// The intended usage of the underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648828-usage?language=objc +func (i_ Image) Usage() metal.TextureUsage { + rv := objc.Call[metal.TextureUsage](i_, objc.Sel("usage")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942490-parent?language=objc +func (i_ Image) Parent() Image { + rv := objc.Call[Image](i_, objc.Sel("parent")) + return rv +} + +// The device on which the image will be used. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648857-device?language=objc +func (i_ Image) Device() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](i_, objc.Sel("device")) + return rv +} + +// The number of images for batch processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648900-numberofimages?language=objc +func (i_ Image) NumberOfImages() uint { + rv := objc.Call[uint](i_, objc.Sel("numberOfImages")) + return rv +} + +// The formal height of the image, in pixels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648952-height?language=objc +func (i_ Image) Height() uint { + rv := objc.Call[uint](i_, objc.Sel("height")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/3131715-featurechannelformat?language=objc +func (i_ Image) FeatureChannelFormat() ImageFeatureChannelFormat { + rv := objc.Call[ImageFeatureChannelFormat](i_, objc.Sel("featureChannelFormat")) + return rv +} + +// The type of the underlying texture, typically [metal/mtltexturetype/mtltexturetype2d] or [metal/mtltexturetype/mtltexturetype2darray]. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648948-texturetype?language=objc +func (i_ Image) TextureType() metal.TextureType { + rv := objc.Call[metal.TextureType](i_, objc.Sel("textureType")) + return rv +} + +// The pixel format of the underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648844-pixelformat?language=objc +func (i_ Image) PixelFormat() metal.PixelFormat { + rv := objc.Call[metal.PixelFormat](i_, objc.Sel("pixelFormat")) + return rv +} + +// The number of feature channels per pixel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648901-featurechannels?language=objc +func (i_ Image) FeatureChannels() uint { + rv := objc.Call[uint](i_, objc.Sel("featureChannels")) + return rv +} + +// A string to help identify this object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648899-label?language=objc +func (i_ Image) Label() string { + rv := objc.Call[string](i_, objc.Sel("label")) + return rv +} + +// A string to help identify this object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648899-label?language=objc +func (i_ Image) SetLabel(value string) { + objc.Call[objc.Void](i_, objc.Sel("setLabel:"), value) +} + +// The underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648903-texture?language=objc +func (i_ Image) Texture() metal.TextureWrapper { + rv := objc.Call[metal.TextureWrapper](i_, objc.Sel("texture")) + return rv +} + +// The number of bits of numeric precision available for each feature channel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648880-precision?language=objc +func (i_ Image) Precision() uint { + rv := objc.Call[uint](i_, objc.Sel("precision")) + return rv +} + +// The number of bytes from the first byte of one pixel to the first byte of the next pixel, in storage order. (Includes padding.) [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648854-pixelsize?language=objc +func (i_ Image) PixelSize() uint { + rv := objc.Call[uint](i_, objc.Sel("pixelSize")) + return rv +} diff --git a/macos/mps/image_add.gen.go b/macos/mps/image_add.gen.go new file mode 100644 index 00000000..46388cd7 --- /dev/null +++ b/macos/mps/image_add.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageAdd] class. +var ImageAddClass = _ImageAddClass{objc.GetClass("MPSImageAdd")} + +type _ImageAddClass struct { + objc.Class +} + +// An interface definition for the [ImageAdd] class. +type IImageAdd interface { + IImageArithmetic +} + +// A filter that returns the element-wise sum of its two input images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageadd?language=objc +type ImageAdd struct { + ImageArithmetic +} + +func ImageAddFrom(ptr unsafe.Pointer) ImageAdd { + return ImageAdd{ + ImageArithmetic: ImageArithmeticFrom(ptr), + } +} + +func (i_ ImageAdd) InitWithDevice(device metal.PDevice) ImageAdd { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAdd](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageadd/2866610-initwithdevice?language=objc +func NewImageAddWithDevice(device metal.PDevice) ImageAdd { + instance := ImageAddClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageAddClass) Alloc() ImageAdd { + rv := objc.Call[ImageAdd](ic, objc.Sel("alloc")) + return rv +} + +func ImageAdd_Alloc() ImageAdd { + return ImageAddClass.Alloc() +} + +func (ic _ImageAddClass) New() ImageAdd { + rv := objc.Call[ImageAdd](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageAdd() ImageAdd { + return ImageAddClass.New() +} + +func (i_ ImageAdd) Init() ImageAdd { + rv := objc.Call[ImageAdd](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageAdd) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageAdd { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAdd](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageAdd_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageAdd { + instance := ImageAddClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_allocator.gen.go b/macos/mps/image_allocator.gen.go new file mode 100644 index 00000000..c262fd71 --- /dev/null +++ b/macos/mps/image_allocator.gen.go @@ -0,0 +1,53 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageallocator?language=objc +type PImageAllocator interface { + // optional + ImageForCommandBufferImageDescriptorKernel(cmdBuf metal.CommandBufferWrapper, descriptor ImageDescriptor, kernel Kernel) IImage + HasImageForCommandBufferImageDescriptorKernel() bool + + // optional + ImageBatchForCommandBufferImageDescriptorKernelCount(cmdBuf metal.CommandBufferWrapper, descriptor ImageDescriptor, kernel Kernel, count uint) *foundation.Array + HasImageBatchForCommandBufferImageDescriptorKernelCount() bool +} + +// A concrete type wrapper for the [PImageAllocator] protocol. +type ImageAllocatorWrapper struct { + objc.Object +} + +func (i_ ImageAllocatorWrapper) HasImageForCommandBufferImageDescriptorKernel() bool { + return i_.RespondsToSelector(objc.Sel("imageForCommandBuffer:imageDescriptor:kernel:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageallocator/2866966-imageforcommandbuffer?language=objc +func (i_ ImageAllocatorWrapper) ImageForCommandBufferImageDescriptorKernel(cmdBuf metal.PCommandBuffer, descriptor IImageDescriptor, kernel IKernel) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[Image](i_, objc.Sel("imageForCommandBuffer:imageDescriptor:kernel:"), po0, objc.Ptr(descriptor), objc.Ptr(kernel)) + return rv +} + +func (i_ ImageAllocatorWrapper) HasImageBatchForCommandBufferImageDescriptorKernelCount() bool { + return i_.RespondsToSelector(objc.Sel("imageBatchForCommandBuffer:imageDescriptor:kernel:count:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageallocator/3020685-imagebatchforcommandbuffer?language=objc +func (i_ ImageAllocatorWrapper) ImageBatchForCommandBufferImageDescriptorKernelCount(cmdBuf metal.PCommandBuffer, descriptor IImageDescriptor, kernel IKernel, count uint) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[*foundation.Array](i_, objc.Sel("imageBatchForCommandBuffer:imageDescriptor:kernel:count:"), po0, objc.Ptr(descriptor), objc.Ptr(kernel), count) + return rv +} diff --git a/macos/mps/image_area_max.gen.go b/macos/mps/image_area_max.gen.go new file mode 100644 index 00000000..64f017a0 --- /dev/null +++ b/macos/mps/image_area_max.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageAreaMax] class. +var ImageAreaMaxClass = _ImageAreaMaxClass{objc.GetClass("MPSImageAreaMax")} + +type _ImageAreaMaxClass struct { + objc.Class +} + +// An interface definition for the [ImageAreaMax] class. +type IImageAreaMax interface { + IUnaryImageKernel + KernelHeight() uint + KernelWidth() uint +} + +// A filter that finds the maximum pixel value in a rectangular region centered around each pixel in the source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageareamax?language=objc +type ImageAreaMax struct { + UnaryImageKernel +} + +func ImageAreaMaxFrom(ptr unsafe.Pointer) ImageAreaMax { + return ImageAreaMax{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageAreaMax) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageAreaMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAreaMax](i_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// Initializes the kernel with a specified width and height. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageareamax/1618281-initwithdevice?language=objc +func NewImageAreaMaxWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageAreaMax { + instance := ImageAreaMaxClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (ic _ImageAreaMaxClass) Alloc() ImageAreaMax { + rv := objc.Call[ImageAreaMax](ic, objc.Sel("alloc")) + return rv +} + +func ImageAreaMax_Alloc() ImageAreaMax { + return ImageAreaMaxClass.Alloc() +} + +func (ic _ImageAreaMaxClass) New() ImageAreaMax { + rv := objc.Call[ImageAreaMax](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageAreaMax() ImageAreaMax { + return ImageAreaMaxClass.New() +} + +func (i_ ImageAreaMax) Init() ImageAreaMax { + rv := objc.Call[ImageAreaMax](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageAreaMax) InitWithDevice(device metal.PDevice) ImageAreaMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAreaMax](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageAreaMaxWithDevice(device metal.PDevice) ImageAreaMax { + instance := ImageAreaMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageAreaMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageAreaMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAreaMax](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageAreaMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageAreaMax { + instance := ImageAreaMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The height of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageareamax/1618277-kernelheight?language=objc +func (i_ ImageAreaMax) KernelHeight() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelHeight")) + return rv +} + +// The width of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageareamax/1618282-kernelwidth?language=objc +func (i_ ImageAreaMax) KernelWidth() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/image_area_min.gen.go b/macos/mps/image_area_min.gen.go new file mode 100644 index 00000000..4b5b4f0f --- /dev/null +++ b/macos/mps/image_area_min.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageAreaMin] class. +var ImageAreaMinClass = _ImageAreaMinClass{objc.GetClass("MPSImageAreaMin")} + +type _ImageAreaMinClass struct { + objc.Class +} + +// An interface definition for the [ImageAreaMin] class. +type IImageAreaMin interface { + IImageAreaMax +} + +// A filter that finds the minimum pixel value in a rectangular region centered around each pixel in the source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageareamin?language=objc +type ImageAreaMin struct { + ImageAreaMax +} + +func ImageAreaMinFrom(ptr unsafe.Pointer) ImageAreaMin { + return ImageAreaMin{ + ImageAreaMax: ImageAreaMaxFrom(ptr), + } +} + +func (ic _ImageAreaMinClass) Alloc() ImageAreaMin { + rv := objc.Call[ImageAreaMin](ic, objc.Sel("alloc")) + return rv +} + +func ImageAreaMin_Alloc() ImageAreaMin { + return ImageAreaMinClass.Alloc() +} + +func (ic _ImageAreaMinClass) New() ImageAreaMin { + rv := objc.Call[ImageAreaMin](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageAreaMin() ImageAreaMin { + return ImageAreaMinClass.New() +} + +func (i_ ImageAreaMin) Init() ImageAreaMin { + rv := objc.Call[ImageAreaMin](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageAreaMin) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageAreaMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAreaMin](i_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// Initializes the kernel with a specified width and height. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageareamax/1618281-initwithdevice?language=objc +func NewImageAreaMinWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageAreaMin { + instance := ImageAreaMinClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (i_ ImageAreaMin) InitWithDevice(device metal.PDevice) ImageAreaMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAreaMin](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageAreaMinWithDevice(device metal.PDevice) ImageAreaMin { + instance := ImageAreaMinClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageAreaMin) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageAreaMin { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageAreaMin](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageAreaMin_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageAreaMin { + instance := ImageAreaMinClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_arithmetic.gen.go b/macos/mps/image_arithmetic.gen.go new file mode 100644 index 00000000..f7c0b6fc --- /dev/null +++ b/macos/mps/image_arithmetic.gen.go @@ -0,0 +1,209 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageArithmetic] class. +var ImageArithmeticClass = _ImageArithmeticClass{objc.GetClass("MPSImageArithmetic")} + +type _ImageArithmeticClass struct { + objc.Class +} + +// An interface definition for the [ImageArithmetic] class. +type IImageArithmetic interface { + IBinaryImageKernel + SecondaryScale() float64 + SetSecondaryScale(value float64) + PrimaryStrideInPixels() metal.Size + SetPrimaryStrideInPixels(value metal.Size) + SecondaryStrideInPixels() metal.Size + SetSecondaryStrideInPixels(value metal.Size) + MaximumValue() float64 + SetMaximumValue(value float64) + PrimaryScale() float64 + SetPrimaryScale(value float64) + MinimumValue() float64 + SetMinimumValue(value float64) + Bias() float64 + SetBias(value float64) +} + +// Base class for basic arithmetic nodes [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic?language=objc +type ImageArithmetic struct { + BinaryImageKernel +} + +func ImageArithmeticFrom(ptr unsafe.Pointer) ImageArithmetic { + return ImageArithmetic{ + BinaryImageKernel: BinaryImageKernelFrom(ptr), + } +} + +func (ic _ImageArithmeticClass) Alloc() ImageArithmetic { + rv := objc.Call[ImageArithmetic](ic, objc.Sel("alloc")) + return rv +} + +func ImageArithmetic_Alloc() ImageArithmetic { + return ImageArithmeticClass.Alloc() +} + +func (ic _ImageArithmeticClass) New() ImageArithmetic { + rv := objc.Call[ImageArithmetic](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageArithmetic() ImageArithmetic { + return ImageArithmeticClass.New() +} + +func (i_ ImageArithmetic) Init() ImageArithmetic { + rv := objc.Call[ImageArithmetic](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageArithmetic) InitWithDevice(device metal.PDevice) ImageArithmetic { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageArithmetic](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsbinaryimagekernel/2866331-initwithdevice?language=objc +func NewImageArithmeticWithDevice(device metal.PDevice) ImageArithmetic { + instance := ImageArithmeticClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageArithmetic) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageArithmetic { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageArithmetic](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageArithmetic_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageArithmetic { + instance := ImageArithmeticClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2866601-secondaryscale?language=objc +func (i_ ImageArithmetic) SecondaryScale() float64 { + rv := objc.Call[float64](i_, objc.Sel("secondaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2866601-secondaryscale?language=objc +func (i_ ImageArithmetic) SetSecondaryScale(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setSecondaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2889864-primarystrideinpixels?language=objc +func (i_ ImageArithmetic) PrimaryStrideInPixels() metal.Size { + rv := objc.Call[metal.Size](i_, objc.Sel("primaryStrideInPixels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2889864-primarystrideinpixels?language=objc +func (i_ ImageArithmetic) SetPrimaryStrideInPixels(value metal.Size) { + objc.Call[objc.Void](i_, objc.Sel("setPrimaryStrideInPixels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2889865-secondarystrideinpixels?language=objc +func (i_ ImageArithmetic) SecondaryStrideInPixels() metal.Size { + rv := objc.Call[metal.Size](i_, objc.Sel("secondaryStrideInPixels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2889865-secondarystrideinpixels?language=objc +func (i_ ImageArithmetic) SetSecondaryStrideInPixels(value metal.Size) { + objc.Call[objc.Void](i_, objc.Sel("setSecondaryStrideInPixels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2942356-maximumvalue?language=objc +func (i_ ImageArithmetic) MaximumValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("maximumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2942356-maximumvalue?language=objc +func (i_ ImageArithmetic) SetMaximumValue(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setMaximumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2866602-primaryscale?language=objc +func (i_ ImageArithmetic) PrimaryScale() float64 { + rv := objc.Call[float64](i_, objc.Sel("primaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2866602-primaryscale?language=objc +func (i_ ImageArithmetic) SetPrimaryScale(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setPrimaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2942357-minimumvalue?language=objc +func (i_ ImageArithmetic) MinimumValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("minimumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2942357-minimumvalue?language=objc +func (i_ ImageArithmetic) SetMinimumValue(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setMinimumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2866609-bias?language=objc +func (i_ ImageArithmetic) Bias() float64 { + rv := objc.Call[float64](i_, objc.Sel("bias")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagearithmetic/2866609-bias?language=objc +func (i_ ImageArithmetic) SetBias(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setBias:"), value) +} diff --git a/macos/mps/image_bilinear_scale.gen.go b/macos/mps/image_bilinear_scale.gen.go new file mode 100644 index 00000000..5b589f9b --- /dev/null +++ b/macos/mps/image_bilinear_scale.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageBilinearScale] class. +var ImageBilinearScaleClass = _ImageBilinearScaleClass{objc.GetClass("MPSImageBilinearScale")} + +type _ImageBilinearScaleClass struct { + objc.Class +} + +// An interface definition for the [ImageBilinearScale] class. +type IImageBilinearScale interface { + IImageScale +} + +// A filter that resizes and changes the aspect ratio of an image using Bilinear resampling. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagebilinearscale?language=objc +type ImageBilinearScale struct { + ImageScale +} + +func ImageBilinearScaleFrom(ptr unsafe.Pointer) ImageBilinearScale { + return ImageBilinearScale{ + ImageScale: ImageScaleFrom(ptr), + } +} + +func (i_ ImageBilinearScale) InitWithDevice(device metal.PDevice) ImageBilinearScale { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageBilinearScale](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagebilinearscale/2881184-initwithdevice?language=objc +func NewImageBilinearScaleWithDevice(device metal.PDevice) ImageBilinearScale { + instance := ImageBilinearScaleClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageBilinearScaleClass) Alloc() ImageBilinearScale { + rv := objc.Call[ImageBilinearScale](ic, objc.Sel("alloc")) + return rv +} + +func ImageBilinearScale_Alloc() ImageBilinearScale { + return ImageBilinearScaleClass.Alloc() +} + +func (ic _ImageBilinearScaleClass) New() ImageBilinearScale { + rv := objc.Call[ImageBilinearScale](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageBilinearScale() ImageBilinearScale { + return ImageBilinearScaleClass.New() +} + +func (i_ ImageBilinearScale) Init() ImageBilinearScale { + rv := objc.Call[ImageBilinearScale](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageBilinearScale) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageBilinearScale { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageBilinearScale](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageBilinearScale_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageBilinearScale { + instance := ImageBilinearScaleClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_box.gen.go b/macos/mps/image_box.gen.go new file mode 100644 index 00000000..93755aaa --- /dev/null +++ b/macos/mps/image_box.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageBox] class. +var ImageBoxClass = _ImageBoxClass{objc.GetClass("MPSImageBox")} + +type _ImageBoxClass struct { + objc.Class +} + +// An interface definition for the [ImageBox] class. +type IImageBox interface { + IUnaryImageKernel + KernelHeight() uint + KernelWidth() uint +} + +// A filter that convolves an image with a given kernel of odd width and height. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagebox?language=objc +type ImageBox struct { + UnaryImageKernel +} + +func ImageBoxFrom(ptr unsafe.Pointer) ImageBox { + return ImageBox{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageBox) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageBox { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageBox](i_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// Initializes a box filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagebox/1618789-initwithdevice?language=objc +func NewImageBoxWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageBox { + instance := ImageBoxClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (ic _ImageBoxClass) Alloc() ImageBox { + rv := objc.Call[ImageBox](ic, objc.Sel("alloc")) + return rv +} + +func ImageBox_Alloc() ImageBox { + return ImageBoxClass.Alloc() +} + +func (ic _ImageBoxClass) New() ImageBox { + rv := objc.Call[ImageBox](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageBox() ImageBox { + return ImageBoxClass.New() +} + +func (i_ ImageBox) Init() ImageBox { + rv := objc.Call[ImageBox](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageBox) InitWithDevice(device metal.PDevice) ImageBox { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageBox](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageBoxWithDevice(device metal.PDevice) ImageBox { + instance := ImageBoxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageBox) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageBox { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageBox](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageBox_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageBox { + instance := ImageBoxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The height of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagebox/1618739-kernelheight?language=objc +func (i_ ImageBox) KernelHeight() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelHeight")) + return rv +} + +// The width of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagebox/1618834-kernelwidth?language=objc +func (i_ ImageBox) KernelWidth() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/image_canny.gen.go b/macos/mps/image_canny.gen.go new file mode 100644 index 00000000..6993b04b --- /dev/null +++ b/macos/mps/image_canny.gen.go @@ -0,0 +1,159 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageCanny] class. +var ImageCannyClass = _ImageCannyClass{objc.GetClass("MPSImageCanny")} + +type _ImageCannyClass struct { + objc.Class +} + +// An interface definition for the [ImageCanny] class. +type IImageCanny interface { + IUnaryImageKernel + LowThreshold() float64 + SetLowThreshold(value float64) + ColorTransform() *float64 + UseFastMode() bool + SetUseFastMode(value bool) + Sigma() float64 + HighThreshold() float64 + SetHighThreshold(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny?language=objc +type ImageCanny struct { + UnaryImageKernel +} + +func ImageCannyFrom(ptr unsafe.Pointer) ImageCanny { + return ImageCanny{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageCanny) InitWithDevice(device metal.PDevice) ImageCanny { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageCanny](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547972-initwithdevice?language=objc +func NewImageCannyWithDevice(device metal.PDevice) ImageCanny { + instance := ImageCannyClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageCannyClass) Alloc() ImageCanny { + rv := objc.Call[ImageCanny](ic, objc.Sel("alloc")) + return rv +} + +func ImageCanny_Alloc() ImageCanny { + return ImageCannyClass.Alloc() +} + +func (ic _ImageCannyClass) New() ImageCanny { + rv := objc.Call[ImageCanny](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageCanny() ImageCanny { + return ImageCannyClass.New() +} + +func (i_ ImageCanny) Init() ImageCanny { + rv := objc.Call[ImageCanny](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageCanny) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageCanny { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageCanny](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageCanny_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageCanny { + instance := ImageCannyClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547974-lowthreshold?language=objc +func (i_ ImageCanny) LowThreshold() float64 { + rv := objc.Call[float64](i_, objc.Sel("lowThreshold")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547974-lowthreshold?language=objc +func (i_ ImageCanny) SetLowThreshold(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setLowThreshold:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547969-colortransform?language=objc +func (i_ ImageCanny) ColorTransform() *float64 { + rv := objc.Call[*float64](i_, objc.Sel("colorTransform")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547976-usefastmode?language=objc +func (i_ ImageCanny) UseFastMode() bool { + rv := objc.Call[bool](i_, objc.Sel("useFastMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547976-usefastmode?language=objc +func (i_ ImageCanny) SetUseFastMode(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setUseFastMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547975-sigma?language=objc +func (i_ ImageCanny) Sigma() float64 { + rv := objc.Call[float64](i_, objc.Sel("sigma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547970-highthreshold?language=objc +func (i_ ImageCanny) HighThreshold() float64 { + rv := objc.Call[float64](i_, objc.Sel("highThreshold")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecanny/3547970-highthreshold?language=objc +func (i_ ImageCanny) SetHighThreshold(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setHighThreshold:"), value) +} diff --git a/macos/mps/image_conversion.gen.go b/macos/mps/image_conversion.gen.go new file mode 100644 index 00000000..c23a66a8 --- /dev/null +++ b/macos/mps/image_conversion.gen.go @@ -0,0 +1,124 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageConversion] class. +var ImageConversionClass = _ImageConversionClass{objc.GetClass("MPSImageConversion")} + +type _ImageConversionClass struct { + objc.Class +} + +// An interface definition for the [ImageConversion] class. +type IImageConversion interface { + IUnaryImageKernel + SourceAlpha() AlphaType + DestinationAlpha() AlphaType +} + +// A filter that performs a conversion of color space, alpha, or pixel format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconversion?language=objc +type ImageConversion struct { + UnaryImageKernel +} + +func ImageConversionFrom(ptr unsafe.Pointer) ImageConversion { + return ImageConversion{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageConversion) InitWithDeviceSrcAlphaDestAlphaBackgroundColorConversionInfo(device metal.PDevice, srcAlpha AlphaType, destAlpha AlphaType, backgroundColor *float64, conversionInfo coregraphics.ColorConversionInfoRef) ImageConversion { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageConversion](i_, objc.Sel("initWithDevice:srcAlpha:destAlpha:backgroundColor:conversionInfo:"), po0, srcAlpha, destAlpha, backgroundColor, conversionInfo) + return rv +} + +// Initializes a filter that can convert texture color space, alpha, and pixel format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconversion/2206722-initwithdevice?language=objc +func NewImageConversionWithDeviceSrcAlphaDestAlphaBackgroundColorConversionInfo(device metal.PDevice, srcAlpha AlphaType, destAlpha AlphaType, backgroundColor *float64, conversionInfo coregraphics.ColorConversionInfoRef) ImageConversion { + instance := ImageConversionClass.Alloc().InitWithDeviceSrcAlphaDestAlphaBackgroundColorConversionInfo(device, srcAlpha, destAlpha, backgroundColor, conversionInfo) + instance.Autorelease() + return instance +} + +func (ic _ImageConversionClass) Alloc() ImageConversion { + rv := objc.Call[ImageConversion](ic, objc.Sel("alloc")) + return rv +} + +func ImageConversion_Alloc() ImageConversion { + return ImageConversionClass.Alloc() +} + +func (ic _ImageConversionClass) New() ImageConversion { + rv := objc.Call[ImageConversion](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageConversion() ImageConversion { + return ImageConversionClass.New() +} + +func (i_ ImageConversion) Init() ImageConversion { + rv := objc.Call[ImageConversion](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageConversion) InitWithDevice(device metal.PDevice) ImageConversion { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageConversion](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageConversionWithDevice(device metal.PDevice) ImageConversion { + instance := ImageConversionClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageConversion) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageConversion { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageConversion](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageConversion_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageConversion { + instance := ImageConversionClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Premultiplication description for the source texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconversion/1648518-sourcealpha?language=objc +func (i_ ImageConversion) SourceAlpha() AlphaType { + rv := objc.Call[AlphaType](i_, objc.Sel("sourceAlpha")) + return rv +} + +// Premultiplication description for the destination texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconversion/1648515-destinationalpha?language=objc +func (i_ ImageConversion) DestinationAlpha() AlphaType { + rv := objc.Call[AlphaType](i_, objc.Sel("destinationAlpha")) + return rv +} diff --git a/macos/mps/image_convolution.gen.go b/macos/mps/image_convolution.gen.go new file mode 100644 index 00000000..6d861a37 --- /dev/null +++ b/macos/mps/image_convolution.gen.go @@ -0,0 +1,140 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageConvolution] class. +var ImageConvolutionClass = _ImageConvolutionClass{objc.GetClass("MPSImageConvolution")} + +type _ImageConvolutionClass struct { + objc.Class +} + +// An interface definition for the [ImageConvolution] class. +type IImageConvolution interface { + IUnaryImageKernel + KernelHeight() uint + Bias() float64 + SetBias(value float64) + KernelWidth() uint +} + +// A filter that convolves an image with a given kernel of odd width and height. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconvolution?language=objc +type ImageConvolution struct { + UnaryImageKernel +} + +func ImageConvolutionFrom(ptr unsafe.Pointer) ImageConvolution { + return ImageConvolution{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageConvolution) InitWithDeviceKernelWidthKernelHeightWeights(device metal.PDevice, kernelWidth uint, kernelHeight uint, kernelWeights *float64) ImageConvolution { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageConvolution](i_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:weights:"), po0, kernelWidth, kernelHeight, kernelWeights) + return rv +} + +// Initializes a convolution filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconvolution/1618902-initwithdevice?language=objc +func NewImageConvolutionWithDeviceKernelWidthKernelHeightWeights(device metal.PDevice, kernelWidth uint, kernelHeight uint, kernelWeights *float64) ImageConvolution { + instance := ImageConvolutionClass.Alloc().InitWithDeviceKernelWidthKernelHeightWeights(device, kernelWidth, kernelHeight, kernelWeights) + instance.Autorelease() + return instance +} + +func (ic _ImageConvolutionClass) Alloc() ImageConvolution { + rv := objc.Call[ImageConvolution](ic, objc.Sel("alloc")) + return rv +} + +func ImageConvolution_Alloc() ImageConvolution { + return ImageConvolutionClass.Alloc() +} + +func (ic _ImageConvolutionClass) New() ImageConvolution { + rv := objc.Call[ImageConvolution](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageConvolution() ImageConvolution { + return ImageConvolutionClass.New() +} + +func (i_ ImageConvolution) Init() ImageConvolution { + rv := objc.Call[ImageConvolution](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageConvolution) InitWithDevice(device metal.PDevice) ImageConvolution { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageConvolution](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageConvolutionWithDevice(device metal.PDevice) ImageConvolution { + instance := ImageConvolutionClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageConvolution) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageConvolution { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageConvolution](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageConvolution_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageConvolution { + instance := ImageConvolutionClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The height of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconvolution/1618842-kernelheight?language=objc +func (i_ ImageConvolution) KernelHeight() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelHeight")) + return rv +} + +// The value added to a convolved pixel before it is converted back to its intended storage format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconvolution/1618841-bias?language=objc +func (i_ ImageConvolution) Bias() float64 { + rv := objc.Call[float64](i_, objc.Sel("bias")) + return rv +} + +// The value added to a convolved pixel before it is converted back to its intended storage format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconvolution/1618841-bias?language=objc +func (i_ ImageConvolution) SetBias(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setBias:"), value) +} + +// The width of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageconvolution/1618868-kernelwidth?language=objc +func (i_ ImageConvolution) KernelWidth() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/image_copy_to_matrix.gen.go b/macos/mps/image_copy_to_matrix.gen.go new file mode 100644 index 00000000..a111cd88 --- /dev/null +++ b/macos/mps/image_copy_to_matrix.gen.go @@ -0,0 +1,183 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageCopyToMatrix] class. +var ImageCopyToMatrixClass = _ImageCopyToMatrixClass{objc.GetClass("MPSImageCopyToMatrix")} + +type _ImageCopyToMatrixClass struct { + objc.Class +} + +// An interface definition for the [ImageCopyToMatrix] class. +type IImageCopyToMatrix interface { + IKernel + EncodeBatchToCommandBufferSourceImagesDestinationMatrix(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, destinationMatrix IMatrix) + EncodeBatchToCommandBufferObjectSourceImagesDestinationMatrix(commandBufferObject objc.IObject, sourceImages *foundation.Array, destinationMatrix IMatrix) + EncodeToCommandBufferSourceImageDestinationMatrix(commandBuffer metal.PCommandBuffer, sourceImage IImage, destinationMatrix IMatrix) + EncodeToCommandBufferObjectSourceImageDestinationMatrix(commandBufferObject objc.IObject, sourceImage IImage, destinationMatrix IMatrix) + DestinationMatrixBatchIndex() uint + SetDestinationMatrixBatchIndex(value uint) + DataLayout() DataLayout + DestinationMatrixOrigin() metal.Origin + SetDestinationMatrixOrigin(value metal.Origin) +} + +// A class that copies image data to a matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix?language=objc +type ImageCopyToMatrix struct { + Kernel +} + +func ImageCopyToMatrixFrom(ptr unsafe.Pointer) ImageCopyToMatrix { + return ImageCopyToMatrix{ + Kernel: KernelFrom(ptr), + } +} + +func (i_ ImageCopyToMatrix) InitWithDeviceDataLayout(device metal.PDevice, dataLayout DataLayout) ImageCopyToMatrix { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageCopyToMatrix](i_, objc.Sel("initWithDevice:dataLayout:"), po0, dataLayout) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873210-initwithdevice?language=objc +func NewImageCopyToMatrixWithDeviceDataLayout(device metal.PDevice, dataLayout DataLayout) ImageCopyToMatrix { + instance := ImageCopyToMatrixClass.Alloc().InitWithDeviceDataLayout(device, dataLayout) + instance.Autorelease() + return instance +} + +func (ic _ImageCopyToMatrixClass) Alloc() ImageCopyToMatrix { + rv := objc.Call[ImageCopyToMatrix](ic, objc.Sel("alloc")) + return rv +} + +func ImageCopyToMatrix_Alloc() ImageCopyToMatrix { + return ImageCopyToMatrixClass.Alloc() +} + +func (ic _ImageCopyToMatrixClass) New() ImageCopyToMatrix { + rv := objc.Call[ImageCopyToMatrix](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageCopyToMatrix() ImageCopyToMatrix { + return ImageCopyToMatrixClass.New() +} + +func (i_ ImageCopyToMatrix) Init() ImageCopyToMatrix { + rv := objc.Call[ImageCopyToMatrix](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageCopyToMatrix) InitWithDevice(device metal.PDevice) ImageCopyToMatrix { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageCopyToMatrix](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewImageCopyToMatrixWithDevice(device metal.PDevice) ImageCopyToMatrix { + instance := ImageCopyToMatrixClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageCopyToMatrix) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageCopyToMatrix { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageCopyToMatrix](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageCopyToMatrix_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageCopyToMatrix { + instance := ImageCopyToMatrixClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/3013769-encodebatchtocommandbuffer?language=objc +func (i_ ImageCopyToMatrix) EncodeBatchToCommandBufferSourceImagesDestinationMatrix(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, destinationMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](i_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:destinationMatrix:"), po0, sourceImages, objc.Ptr(destinationMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/3013769-encodebatchtocommandbuffer?language=objc +func (i_ ImageCopyToMatrix) EncodeBatchToCommandBufferObjectSourceImagesDestinationMatrix(commandBufferObject objc.IObject, sourceImages *foundation.Array, destinationMatrix IMatrix) { + objc.Call[objc.Void](i_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:destinationMatrix:"), objc.Ptr(commandBufferObject), sourceImages, objc.Ptr(destinationMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873212-encodetocommandbuffer?language=objc +func (i_ ImageCopyToMatrix) EncodeToCommandBufferSourceImageDestinationMatrix(commandBuffer metal.PCommandBuffer, sourceImage IImage, destinationMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceImage:destinationMatrix:"), po0, objc.Ptr(sourceImage), objc.Ptr(destinationMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873212-encodetocommandbuffer?language=objc +func (i_ ImageCopyToMatrix) EncodeToCommandBufferObjectSourceImageDestinationMatrix(commandBufferObject objc.IObject, sourceImage IImage, destinationMatrix IMatrix) { + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceImage:destinationMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), objc.Ptr(destinationMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873211-destinationmatrixbatchindex?language=objc +func (i_ ImageCopyToMatrix) DestinationMatrixBatchIndex() uint { + rv := objc.Call[uint](i_, objc.Sel("destinationMatrixBatchIndex")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873211-destinationmatrixbatchindex?language=objc +func (i_ ImageCopyToMatrix) SetDestinationMatrixBatchIndex(value uint) { + objc.Call[objc.Void](i_, objc.Sel("setDestinationMatrixBatchIndex:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873216-datalayout?language=objc +func (i_ ImageCopyToMatrix) DataLayout() DataLayout { + rv := objc.Call[DataLayout](i_, objc.Sel("dataLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873215-destinationmatrixorigin?language=objc +func (i_ ImageCopyToMatrix) DestinationMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](i_, objc.Sel("destinationMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecopytomatrix/2873215-destinationmatrixorigin?language=objc +func (i_ ImageCopyToMatrix) SetDestinationMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](i_, objc.Sel("setDestinationMatrixOrigin:"), value) +} diff --git a/macos/mps/image_descriptor.gen.go b/macos/mps/image_descriptor.gen.go new file mode 100644 index 00000000..fbdb0ef6 --- /dev/null +++ b/macos/mps/image_descriptor.gen.go @@ -0,0 +1,231 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageDescriptor] class. +var ImageDescriptorClass = _ImageDescriptorClass{objc.GetClass("MPSImageDescriptor")} + +type _ImageDescriptorClass struct { + objc.Class +} + +// An interface definition for the [ImageDescriptor] class. +type IImageDescriptor interface { + objc.IObject + Width() uint + SetWidth(value uint) + Usage() metal.TextureUsage + SetUsage(value metal.TextureUsage) + NumberOfImages() uint + SetNumberOfImages(value uint) + Height() uint + SetHeight(value uint) + CpuCacheMode() metal.CPUCacheMode + SetCpuCacheMode(value metal.CPUCacheMode) + PixelFormat() metal.PixelFormat + StorageMode() metal.StorageMode + SetStorageMode(value metal.StorageMode) + FeatureChannels() uint + SetFeatureChannels(value uint) + ChannelFormat() ImageFeatureChannelFormat + SetChannelFormat(value ImageFeatureChannelFormat) +} + +// A description of the attributes used to create an MPSImage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor?language=objc +type ImageDescriptor struct { + objc.Object +} + +func ImageDescriptorFrom(ptr unsafe.Pointer) ImageDescriptor { + return ImageDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ic _ImageDescriptorClass) ImageDescriptorWithChannelFormatWidthHeightFeatureChannels(channelFormat ImageFeatureChannelFormat, width uint, height uint, featureChannels uint) ImageDescriptor { + rv := objc.Call[ImageDescriptor](ic, objc.Sel("imageDescriptorWithChannelFormat:width:height:featureChannels:"), channelFormat, width, height, featureChannels) + return rv +} + +// Creates an image descriptor for a single image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648819-imagedescriptorwithchannelformat?language=objc +func ImageDescriptor_ImageDescriptorWithChannelFormatWidthHeightFeatureChannels(channelFormat ImageFeatureChannelFormat, width uint, height uint, featureChannels uint) ImageDescriptor { + return ImageDescriptorClass.ImageDescriptorWithChannelFormatWidthHeightFeatureChannels(channelFormat, width, height, featureChannels) +} + +func (i_ ImageDescriptor) CopyWithZone(zone unsafe.Pointer) ImageDescriptor { + rv := objc.Call[ImageDescriptor](i_, objc.Sel("copyWithZone:"), zone) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/3020686-copywithzone?language=objc +func ImageDescriptor_CopyWithZone(zone unsafe.Pointer) ImageDescriptor { + instance := ImageDescriptorClass.Alloc().CopyWithZone(zone) + instance.Autorelease() + return instance +} + +func (ic _ImageDescriptorClass) Alloc() ImageDescriptor { + rv := objc.Call[ImageDescriptor](ic, objc.Sel("alloc")) + return rv +} + +func ImageDescriptor_Alloc() ImageDescriptor { + return ImageDescriptorClass.Alloc() +} + +func (ic _ImageDescriptorClass) New() ImageDescriptor { + rv := objc.Call[ImageDescriptor](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageDescriptor() ImageDescriptor { + return ImageDescriptorClass.New() +} + +func (i_ ImageDescriptor) Init() ImageDescriptor { + rv := objc.Call[ImageDescriptor](i_, objc.Sel("init")) + return rv +} + +// The width of the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648830-width?language=objc +func (i_ ImageDescriptor) Width() uint { + rv := objc.Call[uint](i_, objc.Sel("width")) + return rv +} + +// The width of the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648830-width?language=objc +func (i_ ImageDescriptor) SetWidth(value uint) { + objc.Call[objc.Void](i_, objc.Sel("setWidth:"), value) +} + +// Options to specify the intended usage of the underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648937-usage?language=objc +func (i_ ImageDescriptor) Usage() metal.TextureUsage { + rv := objc.Call[metal.TextureUsage](i_, objc.Sel("usage")) + return rv +} + +// Options to specify the intended usage of the underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648937-usage?language=objc +func (i_ ImageDescriptor) SetUsage(value metal.TextureUsage) { + objc.Call[objc.Void](i_, objc.Sel("setUsage:"), value) +} + +// The number of images for batch processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648846-numberofimages?language=objc +func (i_ ImageDescriptor) NumberOfImages() uint { + rv := objc.Call[uint](i_, objc.Sel("numberOfImages")) + return rv +} + +// The number of images for batch processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648846-numberofimages?language=objc +func (i_ ImageDescriptor) SetNumberOfImages(value uint) { + objc.Call[objc.Void](i_, objc.Sel("setNumberOfImages:"), value) +} + +// The height of the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648947-height?language=objc +func (i_ ImageDescriptor) Height() uint { + rv := objc.Call[uint](i_, objc.Sel("height")) + return rv +} + +// The height of the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648947-height?language=objc +func (i_ ImageDescriptor) SetHeight(value uint) { + objc.Call[objc.Void](i_, objc.Sel("setHeight:"), value) +} + +// The CPU cache mode of the underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648930-cpucachemode?language=objc +func (i_ ImageDescriptor) CpuCacheMode() metal.CPUCacheMode { + rv := objc.Call[metal.CPUCacheMode](i_, objc.Sel("cpuCacheMode")) + return rv +} + +// The CPU cache mode of the underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648930-cpucachemode?language=objc +func (i_ ImageDescriptor) SetCpuCacheMode(value metal.CPUCacheMode) { + objc.Call[objc.Void](i_, objc.Sel("setCpuCacheMode:"), value) +} + +// The pixel format for the underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648913-pixelformat?language=objc +func (i_ ImageDescriptor) PixelFormat() metal.PixelFormat { + rv := objc.Call[metal.PixelFormat](i_, objc.Sel("pixelFormat")) + return rv +} + +// The storage mode of underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648955-storagemode?language=objc +func (i_ ImageDescriptor) StorageMode() metal.StorageMode { + rv := objc.Call[metal.StorageMode](i_, objc.Sel("storageMode")) + return rv +} + +// The storage mode of underlying texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648955-storagemode?language=objc +func (i_ ImageDescriptor) SetStorageMode(value metal.StorageMode) { + objc.Call[objc.Void](i_, objc.Sel("setStorageMode:"), value) +} + +// The number of feature channels per pixel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648918-featurechannels?language=objc +func (i_ ImageDescriptor) FeatureChannels() uint { + rv := objc.Call[uint](i_, objc.Sel("featureChannels")) + return rv +} + +// The number of feature channels per pixel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648918-featurechannels?language=objc +func (i_ ImageDescriptor) SetFeatureChannels(value uint) { + objc.Call[objc.Void](i_, objc.Sel("setFeatureChannels:"), value) +} + +// The storage format to use for each channel in the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648818-channelformat?language=objc +func (i_ ImageDescriptor) ChannelFormat() ImageFeatureChannelFormat { + rv := objc.Call[ImageFeatureChannelFormat](i_, objc.Sel("channelFormat")) + return rv +} + +// The storage format to use for each channel in the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedescriptor/1648818-channelformat?language=objc +func (i_ ImageDescriptor) SetChannelFormat(value ImageFeatureChannelFormat) { + objc.Call[objc.Void](i_, objc.Sel("setChannelFormat:"), value) +} diff --git a/macos/mps/image_dilate.gen.go b/macos/mps/image_dilate.gen.go new file mode 100644 index 00000000..f08b28a4 --- /dev/null +++ b/macos/mps/image_dilate.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageDilate] class. +var ImageDilateClass = _ImageDilateClass{objc.GetClass("MPSImageDilate")} + +type _ImageDilateClass struct { + objc.Class +} + +// An interface definition for the [ImageDilate] class. +type IImageDilate interface { + IUnaryImageKernel + KernelHeight() uint + KernelWidth() uint +} + +// A filter that finds the maximum pixel value in a rectangular region by applying a dilation function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedilate?language=objc +type ImageDilate struct { + UnaryImageKernel +} + +func ImageDilateFrom(ptr unsafe.Pointer) ImageDilate { + return ImageDilate{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageDilate) InitWithDeviceKernelWidthKernelHeightValues(device metal.PDevice, kernelWidth uint, kernelHeight uint, values *float64) ImageDilate { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageDilate](i_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:values:"), po0, kernelWidth, kernelHeight, values) + return rv +} + +// Initializes the kernel with a specified width, height, and weight values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedilate/1618285-initwithdevice?language=objc +func NewImageDilateWithDeviceKernelWidthKernelHeightValues(device metal.PDevice, kernelWidth uint, kernelHeight uint, values *float64) ImageDilate { + instance := ImageDilateClass.Alloc().InitWithDeviceKernelWidthKernelHeightValues(device, kernelWidth, kernelHeight, values) + instance.Autorelease() + return instance +} + +func (ic _ImageDilateClass) Alloc() ImageDilate { + rv := objc.Call[ImageDilate](ic, objc.Sel("alloc")) + return rv +} + +func ImageDilate_Alloc() ImageDilate { + return ImageDilateClass.Alloc() +} + +func (ic _ImageDilateClass) New() ImageDilate { + rv := objc.Call[ImageDilate](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageDilate() ImageDilate { + return ImageDilateClass.New() +} + +func (i_ ImageDilate) Init() ImageDilate { + rv := objc.Call[ImageDilate](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageDilate) InitWithDevice(device metal.PDevice) ImageDilate { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageDilate](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageDilateWithDevice(device metal.PDevice) ImageDilate { + instance := ImageDilateClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageDilate) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageDilate { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageDilate](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageDilate_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageDilate { + instance := ImageDilateClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The height of the filter window. which must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedilate/1618280-kernelheight?language=objc +func (i_ ImageDilate) KernelHeight() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelHeight")) + return rv +} + +// The width of the filter window which must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedilate/1618279-kernelwidth?language=objc +func (i_ ImageDilate) KernelWidth() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/image_divide.gen.go b/macos/mps/image_divide.gen.go new file mode 100644 index 00000000..2407ebb4 --- /dev/null +++ b/macos/mps/image_divide.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageDivide] class. +var ImageDivideClass = _ImageDivideClass{objc.GetClass("MPSImageDivide")} + +type _ImageDivideClass struct { + objc.Class +} + +// An interface definition for the [ImageDivide] class. +type IImageDivide interface { + IImageArithmetic +} + +// A filter that returns the element-wise quotient of its two input images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedivide?language=objc +type ImageDivide struct { + ImageArithmetic +} + +func ImageDivideFrom(ptr unsafe.Pointer) ImageDivide { + return ImageDivide{ + ImageArithmetic: ImageArithmeticFrom(ptr), + } +} + +func (i_ ImageDivide) InitWithDevice(device metal.PDevice) ImageDivide { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageDivide](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedivide/2866606-initwithdevice?language=objc +func NewImageDivideWithDevice(device metal.PDevice) ImageDivide { + instance := ImageDivideClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageDivideClass) Alloc() ImageDivide { + rv := objc.Call[ImageDivide](ic, objc.Sel("alloc")) + return rv +} + +func ImageDivide_Alloc() ImageDivide { + return ImageDivideClass.Alloc() +} + +func (ic _ImageDivideClass) New() ImageDivide { + rv := objc.Call[ImageDivide](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageDivide() ImageDivide { + return ImageDivideClass.New() +} + +func (i_ ImageDivide) Init() ImageDivide { + rv := objc.Call[ImageDivide](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageDivide) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageDivide { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageDivide](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageDivide_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageDivide { + instance := ImageDivideClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_ed_lines.gen.go b/macos/mps/image_ed_lines.gen.go new file mode 100644 index 00000000..c3bfa3a9 --- /dev/null +++ b/macos/mps/image_ed_lines.gen.go @@ -0,0 +1,253 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageEDLines] class. +var ImageEDLinesClass = _ImageEDLinesClass{objc.GetClass("MPSImageEDLines")} + +type _ImageEDLinesClass struct { + objc.Class +} + +// An interface definition for the [ImageEDLines] class. +type IImageEDLines interface { + IKernel + EncodeToCommandBufferSourceTextureDestinationTextureEndpointBufferEndpointOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, dest metal.PTexture, endpointBuffer metal.PBuffer, endpointOffset uint) + EncodeToCommandBufferObjectSourceTextureObjectDestinationTextureObjectEndpointBufferObjectEndpointOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, destObject objc.IObject, endpointBufferObject objc.IObject, endpointOffset uint) + MaxLines() uint + SetMaxLines(value uint) + MinLineLength() int + SetMinLineLength(value int) + LineErrorThreshold() float64 + SetLineErrorThreshold(value float64) + GaussianSigma() float64 + DetailRatio() int + SetDetailRatio(value int) + GradientThreshold() float64 + SetGradientThreshold(value float64) + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) + MergeLocalityThreshold() float64 + SetMergeLocalityThreshold(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines?language=objc +type ImageEDLines struct { + Kernel +} + +func ImageEDLinesFrom(ptr unsafe.Pointer) ImageEDLines { + return ImageEDLines{ + Kernel: KernelFrom(ptr), + } +} + +func (i_ ImageEDLines) InitWithDeviceGaussianSigmaMinLineLengthMaxLinesDetailRatioGradientThresholdLineErrorThresholdMergeLocalityThreshold(device metal.PDevice, gaussianSigma float64, minLineLength int, maxLines uint, detailRatio int, gradientThreshold float64, lineErrorThreshold float64, mergeLocalityThreshold float64) ImageEDLines { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageEDLines](i_, objc.Sel("initWithDevice:gaussianSigma:minLineLength:maxLines:detailRatio:gradientThreshold:lineErrorThreshold:mergeLocalityThreshold:"), po0, gaussianSigma, minLineLength, maxLines, detailRatio, gradientThreshold, lineErrorThreshold, mergeLocalityThreshold) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618921-initwithdevice?language=objc +func NewImageEDLinesWithDeviceGaussianSigmaMinLineLengthMaxLinesDetailRatioGradientThresholdLineErrorThresholdMergeLocalityThreshold(device metal.PDevice, gaussianSigma float64, minLineLength int, maxLines uint, detailRatio int, gradientThreshold float64, lineErrorThreshold float64, mergeLocalityThreshold float64) ImageEDLines { + instance := ImageEDLinesClass.Alloc().InitWithDeviceGaussianSigmaMinLineLengthMaxLinesDetailRatioGradientThresholdLineErrorThresholdMergeLocalityThreshold(device, gaussianSigma, minLineLength, maxLines, detailRatio, gradientThreshold, lineErrorThreshold, mergeLocalityThreshold) + instance.Autorelease() + return instance +} + +func (ic _ImageEDLinesClass) Alloc() ImageEDLines { + rv := objc.Call[ImageEDLines](ic, objc.Sel("alloc")) + return rv +} + +func ImageEDLines_Alloc() ImageEDLines { + return ImageEDLinesClass.Alloc() +} + +func (ic _ImageEDLinesClass) New() ImageEDLines { + rv := objc.Call[ImageEDLines](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageEDLines() ImageEDLines { + return ImageEDLinesClass.New() +} + +func (i_ ImageEDLines) Init() ImageEDLines { + rv := objc.Call[ImageEDLines](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageEDLines) InitWithDevice(device metal.PDevice) ImageEDLines { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageEDLines](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewImageEDLinesWithDevice(device metal.PDevice) ImageEDLines { + instance := ImageEDLinesClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageEDLines) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageEDLines { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageEDLines](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageEDLines_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageEDLines { + instance := ImageEDLinesClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618917-encodetocommandbuffer?language=objc +func (i_ ImageEDLines) EncodeToCommandBufferSourceTextureDestinationTextureEndpointBufferEndpointOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, dest metal.PTexture, endpointBuffer metal.PBuffer, endpointOffset uint) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", source) + po2 := objc.WrapAsProtocol("MTLTexture", dest) + po3 := objc.WrapAsProtocol("MTLBuffer", endpointBuffer) + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:destinationTexture:endpointBuffer:endpointOffset:"), po0, po1, po2, po3, endpointOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618917-encodetocommandbuffer?language=objc +func (i_ ImageEDLines) EncodeToCommandBufferObjectSourceTextureObjectDestinationTextureObjectEndpointBufferObjectEndpointOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, destObject objc.IObject, endpointBufferObject objc.IObject, endpointOffset uint) { + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:destinationTexture:endpointBuffer:endpointOffset:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceObject), objc.Ptr(destObject), objc.Ptr(endpointBufferObject), endpointOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618923-maxlines?language=objc +func (i_ ImageEDLines) MaxLines() uint { + rv := objc.Call[uint](i_, objc.Sel("maxLines")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618923-maxlines?language=objc +func (i_ ImageEDLines) SetMaxLines(value uint) { + objc.Call[objc.Void](i_, objc.Sel("setMaxLines:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618925-minlinelength?language=objc +func (i_ ImageEDLines) MinLineLength() int { + rv := objc.Call[int](i_, objc.Sel("minLineLength")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618925-minlinelength?language=objc +func (i_ ImageEDLines) SetMinLineLength(value int) { + objc.Call[objc.Void](i_, objc.Sel("setMinLineLength:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618922-lineerrorthreshold?language=objc +func (i_ ImageEDLines) LineErrorThreshold() float64 { + rv := objc.Call[float64](i_, objc.Sel("lineErrorThreshold")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618922-lineerrorthreshold?language=objc +func (i_ ImageEDLines) SetLineErrorThreshold(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setLineErrorThreshold:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618918-gaussiansigma?language=objc +func (i_ ImageEDLines) GaussianSigma() float64 { + rv := objc.Call[float64](i_, objc.Sel("gaussianSigma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618916-detailratio?language=objc +func (i_ ImageEDLines) DetailRatio() int { + rv := objc.Call[int](i_, objc.Sel("detailRatio")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618916-detailratio?language=objc +func (i_ ImageEDLines) SetDetailRatio(value int) { + objc.Call[objc.Void](i_, objc.Sel("setDetailRatio:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618919-gradientthreshold?language=objc +func (i_ ImageEDLines) GradientThreshold() float64 { + rv := objc.Call[float64](i_, objc.Sel("gradientThreshold")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618919-gradientthreshold?language=objc +func (i_ ImageEDLines) SetGradientThreshold(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setGradientThreshold:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618915-cliprectsource?language=objc +func (i_ ImageEDLines) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](i_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618915-cliprectsource?language=objc +func (i_ ImageEDLines) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](i_, objc.Sel("setClipRectSource:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618924-mergelocalitythreshold?language=objc +func (i_ ImageEDLines) MergeLocalityThreshold() float64 { + rv := objc.Call[float64](i_, objc.Sel("mergeLocalityThreshold")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageedlines/3618924-mergelocalitythreshold?language=objc +func (i_ ImageEDLines) SetMergeLocalityThreshold(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setMergeLocalityThreshold:"), value) +} diff --git a/macos/mps/image_erode.gen.go b/macos/mps/image_erode.gen.go new file mode 100644 index 00000000..a9182b39 --- /dev/null +++ b/macos/mps/image_erode.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageErode] class. +var ImageErodeClass = _ImageErodeClass{objc.GetClass("MPSImageErode")} + +type _ImageErodeClass struct { + objc.Class +} + +// An interface definition for the [ImageErode] class. +type IImageErode interface { + IImageDilate +} + +// A filter that finds the minimum pixel value in a rectangular region by applying an erosion function. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageerode?language=objc +type ImageErode struct { + ImageDilate +} + +func ImageErodeFrom(ptr unsafe.Pointer) ImageErode { + return ImageErode{ + ImageDilate: ImageDilateFrom(ptr), + } +} + +func (ic _ImageErodeClass) Alloc() ImageErode { + rv := objc.Call[ImageErode](ic, objc.Sel("alloc")) + return rv +} + +func ImageErode_Alloc() ImageErode { + return ImageErodeClass.Alloc() +} + +func (ic _ImageErodeClass) New() ImageErode { + rv := objc.Call[ImageErode](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageErode() ImageErode { + return ImageErodeClass.New() +} + +func (i_ ImageErode) Init() ImageErode { + rv := objc.Call[ImageErode](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageErode) InitWithDeviceKernelWidthKernelHeightValues(device metal.PDevice, kernelWidth uint, kernelHeight uint, values *float64) ImageErode { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageErode](i_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:values:"), po0, kernelWidth, kernelHeight, values) + return rv +} + +// Initializes the kernel with a specified width, height, and weight values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagedilate/1618285-initwithdevice?language=objc +func NewImageErodeWithDeviceKernelWidthKernelHeightValues(device metal.PDevice, kernelWidth uint, kernelHeight uint, values *float64) ImageErode { + instance := ImageErodeClass.Alloc().InitWithDeviceKernelWidthKernelHeightValues(device, kernelWidth, kernelHeight, values) + instance.Autorelease() + return instance +} + +func (i_ ImageErode) InitWithDevice(device metal.PDevice) ImageErode { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageErode](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageErodeWithDevice(device metal.PDevice) ImageErode { + instance := ImageErodeClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageErode) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageErode { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageErode](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageErode_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageErode { + instance := ImageErodeClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_euclidean_distance_transform.gen.go b/macos/mps/image_euclidean_distance_transform.gen.go new file mode 100644 index 00000000..2acf6049 --- /dev/null +++ b/macos/mps/image_euclidean_distance_transform.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageEuclideanDistanceTransform] class. +var ImageEuclideanDistanceTransformClass = _ImageEuclideanDistanceTransformClass{objc.GetClass("MPSImageEuclideanDistanceTransform")} + +type _ImageEuclideanDistanceTransformClass struct { + objc.Class +} + +// An interface definition for the [ImageEuclideanDistanceTransform] class. +type IImageEuclideanDistanceTransform interface { + IUnaryImageKernel + SearchLimitRadius() float64 + SetSearchLimitRadius(value float64) +} + +// A filter that performs a Euclidean distance transform on an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageeuclideandistancetransform?language=objc +type ImageEuclideanDistanceTransform struct { + UnaryImageKernel +} + +func ImageEuclideanDistanceTransformFrom(ptr unsafe.Pointer) ImageEuclideanDistanceTransform { + return ImageEuclideanDistanceTransform{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageEuclideanDistanceTransform) InitWithDevice(device metal.PDevice) ImageEuclideanDistanceTransform { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageEuclideanDistanceTransform](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Creates a Euclidean distance transform that runs on a specified device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageeuclideandistancetransform/2953973-initwithdevice?language=objc +func NewImageEuclideanDistanceTransformWithDevice(device metal.PDevice) ImageEuclideanDistanceTransform { + instance := ImageEuclideanDistanceTransformClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageEuclideanDistanceTransformClass) Alloc() ImageEuclideanDistanceTransform { + rv := objc.Call[ImageEuclideanDistanceTransform](ic, objc.Sel("alloc")) + return rv +} + +func ImageEuclideanDistanceTransform_Alloc() ImageEuclideanDistanceTransform { + return ImageEuclideanDistanceTransformClass.Alloc() +} + +func (ic _ImageEuclideanDistanceTransformClass) New() ImageEuclideanDistanceTransform { + rv := objc.Call[ImageEuclideanDistanceTransform](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageEuclideanDistanceTransform() ImageEuclideanDistanceTransform { + return ImageEuclideanDistanceTransformClass.New() +} + +func (i_ ImageEuclideanDistanceTransform) Init() ImageEuclideanDistanceTransform { + rv := objc.Call[ImageEuclideanDistanceTransform](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageEuclideanDistanceTransform) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageEuclideanDistanceTransform { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageEuclideanDistanceTransform](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageEuclideanDistanceTransform_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageEuclideanDistanceTransform { + instance := ImageEuclideanDistanceTransformClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Limits the search in an image from a pixel to the closest nonzero pixel within a specified radius. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageeuclideandistancetransform/3547977-searchlimitradius?language=objc +func (i_ ImageEuclideanDistanceTransform) SearchLimitRadius() float64 { + rv := objc.Call[float64](i_, objc.Sel("searchLimitRadius")) + return rv +} + +// Limits the search in an image from a pixel to the closest nonzero pixel within a specified radius. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageeuclideandistancetransform/3547977-searchlimitradius?language=objc +func (i_ ImageEuclideanDistanceTransform) SetSearchLimitRadius(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setSearchLimitRadius:"), value) +} diff --git a/macos/mps/image_find_keypoints.gen.go b/macos/mps/image_find_keypoints.gen.go new file mode 100644 index 00000000..9efad336 --- /dev/null +++ b/macos/mps/image_find_keypoints.gen.go @@ -0,0 +1,134 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageFindKeypoints] class. +var ImageFindKeypointsClass = _ImageFindKeypointsClass{objc.GetClass("MPSImageFindKeypoints")} + +type _ImageFindKeypointsClass struct { + objc.Class +} + +// An interface definition for the [ImageFindKeypoints] class. +type IImageFindKeypoints interface { + IKernel + EncodeToCommandBufferSourceTextureRegionsNumberOfRegionsKeypointCountBufferKeypointCountBufferOffsetKeypointDataBufferKeypointDataBufferOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, regions *metal.Region, numberOfRegions uint, keypointCountBuffer metal.PBuffer, keypointCountBufferOffset uint, keypointDataBuffer metal.PBuffer, keypointDataBufferOffset uint) + EncodeToCommandBufferObjectSourceTextureObjectRegionsNumberOfRegionsKeypointCountBufferObjectKeypointCountBufferOffsetKeypointDataBufferObjectKeypointDataBufferOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, regions *metal.Region, numberOfRegions uint, keypointCountBufferObject objc.IObject, keypointCountBufferOffset uint, keypointDataBufferObject objc.IObject, keypointDataBufferOffset uint) + KeypointRangeInfo() ImageKeypointRangeInfo +} + +// A kernel that is used to find a list of keypoints. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagefindkeypoints?language=objc +type ImageFindKeypoints struct { + Kernel +} + +func ImageFindKeypointsFrom(ptr unsafe.Pointer) ImageFindKeypoints { + return ImageFindKeypoints{ + Kernel: KernelFrom(ptr), + } +} + +func (i_ ImageFindKeypoints) InitWithDeviceInfo(device metal.PDevice, info *ImageKeypointRangeInfo) ImageFindKeypoints { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageFindKeypoints](i_, objc.Sel("initWithDevice:info:"), po0, info) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagefindkeypoints/2873309-initwithdevice?language=objc +func NewImageFindKeypointsWithDeviceInfo(device metal.PDevice, info *ImageKeypointRangeInfo) ImageFindKeypoints { + instance := ImageFindKeypointsClass.Alloc().InitWithDeviceInfo(device, info) + instance.Autorelease() + return instance +} + +func (ic _ImageFindKeypointsClass) Alloc() ImageFindKeypoints { + rv := objc.Call[ImageFindKeypoints](ic, objc.Sel("alloc")) + return rv +} + +func ImageFindKeypoints_Alloc() ImageFindKeypoints { + return ImageFindKeypointsClass.Alloc() +} + +func (ic _ImageFindKeypointsClass) New() ImageFindKeypoints { + rv := objc.Call[ImageFindKeypoints](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageFindKeypoints() ImageFindKeypoints { + return ImageFindKeypointsClass.New() +} + +func (i_ ImageFindKeypoints) Init() ImageFindKeypoints { + rv := objc.Call[ImageFindKeypoints](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageFindKeypoints) InitWithDevice(device metal.PDevice) ImageFindKeypoints { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageFindKeypoints](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewImageFindKeypointsWithDevice(device metal.PDevice) ImageFindKeypoints { + instance := ImageFindKeypointsClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageFindKeypoints) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageFindKeypoints { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageFindKeypoints](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageFindKeypoints_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageFindKeypoints { + instance := ImageFindKeypointsClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagefindkeypoints/2873307-encodetocommandbuffer?language=objc +func (i_ ImageFindKeypoints) EncodeToCommandBufferSourceTextureRegionsNumberOfRegionsKeypointCountBufferKeypointCountBufferOffsetKeypointDataBufferKeypointDataBufferOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, regions *metal.Region, numberOfRegions uint, keypointCountBuffer metal.PBuffer, keypointCountBufferOffset uint, keypointDataBuffer metal.PBuffer, keypointDataBufferOffset uint) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", source) + po4 := objc.WrapAsProtocol("MTLBuffer", keypointCountBuffer) + po6 := objc.WrapAsProtocol("MTLBuffer", keypointDataBuffer) + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:regions:numberOfRegions:keypointCountBuffer:keypointCountBufferOffset:keypointDataBuffer:keypointDataBufferOffset:"), po0, po1, regions, numberOfRegions, po4, keypointCountBufferOffset, po6, keypointDataBufferOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagefindkeypoints/2873307-encodetocommandbuffer?language=objc +func (i_ ImageFindKeypoints) EncodeToCommandBufferObjectSourceTextureObjectRegionsNumberOfRegionsKeypointCountBufferObjectKeypointCountBufferOffsetKeypointDataBufferObjectKeypointDataBufferOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, regions *metal.Region, numberOfRegions uint, keypointCountBufferObject objc.IObject, keypointCountBufferOffset uint, keypointDataBufferObject objc.IObject, keypointDataBufferOffset uint) { + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:regions:numberOfRegions:keypointCountBuffer:keypointCountBufferOffset:keypointDataBuffer:keypointDataBufferOffset:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceObject), regions, numberOfRegions, objc.Ptr(keypointCountBufferObject), keypointCountBufferOffset, objc.Ptr(keypointDataBufferObject), keypointDataBufferOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagefindkeypoints/2873310-keypointrangeinfo?language=objc +func (i_ ImageFindKeypoints) KeypointRangeInfo() ImageKeypointRangeInfo { + rv := objc.Call[ImageKeypointRangeInfo](i_, objc.Sel("keypointRangeInfo")) + return rv +} diff --git a/macos/mps/image_gaussian_blur.gen.go b/macos/mps/image_gaussian_blur.gen.go new file mode 100644 index 00000000..aa4d7a7d --- /dev/null +++ b/macos/mps/image_gaussian_blur.gen.go @@ -0,0 +1,114 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageGaussianBlur] class. +var ImageGaussianBlurClass = _ImageGaussianBlurClass{objc.GetClass("MPSImageGaussianBlur")} + +type _ImageGaussianBlurClass struct { + objc.Class +} + +// An interface definition for the [ImageGaussianBlur] class. +type IImageGaussianBlur interface { + IUnaryImageKernel + Sigma() float64 +} + +// A filter that convolves an image with a Gaussian blur of a given sigma in both the x and y directions. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagegaussianblur?language=objc +type ImageGaussianBlur struct { + UnaryImageKernel +} + +func ImageGaussianBlurFrom(ptr unsafe.Pointer) ImageGaussianBlur { + return ImageGaussianBlur{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageGaussianBlur) InitWithDeviceSigma(device metal.PDevice, sigma float64) ImageGaussianBlur { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGaussianBlur](i_, objc.Sel("initWithDevice:sigma:"), po0, sigma) + return rv +} + +// Initializes a Gaussian blur filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagegaussianblur/1618813-initwithdevice?language=objc +func NewImageGaussianBlurWithDeviceSigma(device metal.PDevice, sigma float64) ImageGaussianBlur { + instance := ImageGaussianBlurClass.Alloc().InitWithDeviceSigma(device, sigma) + instance.Autorelease() + return instance +} + +func (ic _ImageGaussianBlurClass) Alloc() ImageGaussianBlur { + rv := objc.Call[ImageGaussianBlur](ic, objc.Sel("alloc")) + return rv +} + +func ImageGaussianBlur_Alloc() ImageGaussianBlur { + return ImageGaussianBlurClass.Alloc() +} + +func (ic _ImageGaussianBlurClass) New() ImageGaussianBlur { + rv := objc.Call[ImageGaussianBlur](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageGaussianBlur() ImageGaussianBlur { + return ImageGaussianBlurClass.New() +} + +func (i_ ImageGaussianBlur) Init() ImageGaussianBlur { + rv := objc.Call[ImageGaussianBlur](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageGaussianBlur) InitWithDevice(device metal.PDevice) ImageGaussianBlur { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGaussianBlur](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageGaussianBlurWithDevice(device metal.PDevice) ImageGaussianBlur { + instance := ImageGaussianBlurClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageGaussianBlur) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageGaussianBlur { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGaussianBlur](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageGaussianBlur_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageGaussianBlur { + instance := ImageGaussianBlurClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The sigma value with which the filter was created. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagegaussianblur/1618850-sigma?language=objc +func (i_ ImageGaussianBlur) Sigma() float64 { + rv := objc.Call[float64](i_, objc.Sel("sigma")) + return rv +} diff --git a/macos/mps/image_gaussian_pyramid.gen.go b/macos/mps/image_gaussian_pyramid.gen.go new file mode 100644 index 00000000..e6505a80 --- /dev/null +++ b/macos/mps/image_gaussian_pyramid.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageGaussianPyramid] class. +var ImageGaussianPyramidClass = _ImageGaussianPyramidClass{objc.GetClass("MPSImageGaussianPyramid")} + +type _ImageGaussianPyramidClass struct { + objc.Class +} + +// An interface definition for the [ImageGaussianPyramid] class. +type IImageGaussianPyramid interface { + IImagePyramid +} + +// A filter that convolves an image with a Gaussian pyramid. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagegaussianpyramid?language=objc +type ImageGaussianPyramid struct { + ImagePyramid +} + +func ImageGaussianPyramidFrom(ptr unsafe.Pointer) ImageGaussianPyramid { + return ImageGaussianPyramid{ + ImagePyramid: ImagePyramidFrom(ptr), + } +} + +func (ic _ImageGaussianPyramidClass) Alloc() ImageGaussianPyramid { + rv := objc.Call[ImageGaussianPyramid](ic, objc.Sel("alloc")) + return rv +} + +func ImageGaussianPyramid_Alloc() ImageGaussianPyramid { + return ImageGaussianPyramidClass.Alloc() +} + +func (ic _ImageGaussianPyramidClass) New() ImageGaussianPyramid { + rv := objc.Call[ImageGaussianPyramid](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageGaussianPyramid() ImageGaussianPyramid { + return ImageGaussianPyramidClass.New() +} + +func (i_ ImageGaussianPyramid) Init() ImageGaussianPyramid { + rv := objc.Call[ImageGaussianPyramid](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageGaussianPyramid) InitWithDevice(device metal.PDevice) ImageGaussianPyramid { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGaussianPyramid](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a downwards 5-tap image pyramid with the default filter kernel and device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid/1648935-initwithdevice?language=objc +func NewImageGaussianPyramidWithDevice(device metal.PDevice) ImageGaussianPyramid { + instance := ImageGaussianPyramidClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageGaussianPyramid) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageGaussianPyramid { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGaussianPyramid](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageGaussianPyramid_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageGaussianPyramid { + instance := ImageGaussianPyramidClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_guided_filter.gen.go b/macos/mps/image_guided_filter.gen.go new file mode 100644 index 00000000..08ca5f60 --- /dev/null +++ b/macos/mps/image_guided_filter.gen.go @@ -0,0 +1,206 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageGuidedFilter] class. +var ImageGuidedFilterClass = _ImageGuidedFilterClass{objc.GetClass("MPSImageGuidedFilter")} + +type _ImageGuidedFilterClass struct { + objc.Class +} + +// An interface definition for the [ImageGuidedFilter] class. +type IImageGuidedFilter interface { + IKernel + EncodeReconstructionToCommandBufferGuidanceTextureCoefficientsTextureDestinationTexture(commandBuffer metal.PCommandBuffer, guidanceTexture metal.PTexture, coefficientsTexture metal.PTexture, destinationTexture metal.PTexture) + EncodeReconstructionToCommandBufferObjectGuidanceTextureObjectCoefficientsTextureObjectDestinationTextureObject(commandBufferObject objc.IObject, guidanceTextureObject objc.IObject, coefficientsTextureObject objc.IObject, destinationTextureObject objc.IObject) + EncodeRegressionToCommandBufferSourceTextureGuidanceTextureWeightsTextureDestinationCoefficientsTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, guidanceTexture metal.PTexture, weightsTexture metal.PTexture, destinationCoefficientsTexture metal.PTexture) + EncodeRegressionToCommandBufferObjectSourceTextureObjectGuidanceTextureObjectWeightsTextureObjectDestinationCoefficientsTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, guidanceTextureObject objc.IObject, weightsTextureObject objc.IObject, destinationCoefficientsTextureObject objc.IObject) + ReconstructOffset() float64 + SetReconstructOffset(value float64) + Epsilon() float64 + SetEpsilon(value float64) + ReconstructScale() float64 + SetReconstructScale(value float64) + KernelDiameter() uint +} + +// A filter that performs edge-aware filtering on an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter?language=objc +type ImageGuidedFilter struct { + Kernel +} + +func ImageGuidedFilterFrom(ptr unsafe.Pointer) ImageGuidedFilter { + return ImageGuidedFilter{ + Kernel: KernelFrom(ptr), + } +} + +func (i_ ImageGuidedFilter) InitWithDeviceKernelDiameter(device metal.PDevice, kernelDiameter uint) ImageGuidedFilter { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGuidedFilter](i_, objc.Sel("initWithDevice:kernelDiameter:"), po0, kernelDiameter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951910-initwithdevice?language=objc +func NewImageGuidedFilterWithDeviceKernelDiameter(device metal.PDevice, kernelDiameter uint) ImageGuidedFilter { + instance := ImageGuidedFilterClass.Alloc().InitWithDeviceKernelDiameter(device, kernelDiameter) + instance.Autorelease() + return instance +} + +func (ic _ImageGuidedFilterClass) Alloc() ImageGuidedFilter { + rv := objc.Call[ImageGuidedFilter](ic, objc.Sel("alloc")) + return rv +} + +func ImageGuidedFilter_Alloc() ImageGuidedFilter { + return ImageGuidedFilterClass.Alloc() +} + +func (ic _ImageGuidedFilterClass) New() ImageGuidedFilter { + rv := objc.Call[ImageGuidedFilter](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageGuidedFilter() ImageGuidedFilter { + return ImageGuidedFilterClass.New() +} + +func (i_ ImageGuidedFilter) Init() ImageGuidedFilter { + rv := objc.Call[ImageGuidedFilter](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageGuidedFilter) InitWithDevice(device metal.PDevice) ImageGuidedFilter { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGuidedFilter](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewImageGuidedFilterWithDevice(device metal.PDevice) ImageGuidedFilter { + instance := ImageGuidedFilterClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageGuidedFilter) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageGuidedFilter { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageGuidedFilter](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageGuidedFilter_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageGuidedFilter { + instance := ImageGuidedFilterClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951906-encodereconstructiontocommandbuf?language=objc +func (i_ ImageGuidedFilter) EncodeReconstructionToCommandBufferGuidanceTextureCoefficientsTextureDestinationTexture(commandBuffer metal.PCommandBuffer, guidanceTexture metal.PTexture, coefficientsTexture metal.PTexture, destinationTexture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", guidanceTexture) + po2 := objc.WrapAsProtocol("MTLTexture", coefficientsTexture) + po3 := objc.WrapAsProtocol("MTLTexture", destinationTexture) + objc.Call[objc.Void](i_, objc.Sel("encodeReconstructionToCommandBuffer:guidanceTexture:coefficientsTexture:destinationTexture:"), po0, po1, po2, po3) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951906-encodereconstructiontocommandbuf?language=objc +func (i_ ImageGuidedFilter) EncodeReconstructionToCommandBufferObjectGuidanceTextureObjectCoefficientsTextureObjectDestinationTextureObject(commandBufferObject objc.IObject, guidanceTextureObject objc.IObject, coefficientsTextureObject objc.IObject, destinationTextureObject objc.IObject) { + objc.Call[objc.Void](i_, objc.Sel("encodeReconstructionToCommandBuffer:guidanceTexture:coefficientsTexture:destinationTexture:"), objc.Ptr(commandBufferObject), objc.Ptr(guidanceTextureObject), objc.Ptr(coefficientsTextureObject), objc.Ptr(destinationTextureObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951907-encoderegressiontocommandbuffer?language=objc +func (i_ ImageGuidedFilter) EncodeRegressionToCommandBufferSourceTextureGuidanceTextureWeightsTextureDestinationCoefficientsTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, guidanceTexture metal.PTexture, weightsTexture metal.PTexture, destinationCoefficientsTexture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", sourceTexture) + po2 := objc.WrapAsProtocol("MTLTexture", guidanceTexture) + po3 := objc.WrapAsProtocol("MTLTexture", weightsTexture) + po4 := objc.WrapAsProtocol("MTLTexture", destinationCoefficientsTexture) + objc.Call[objc.Void](i_, objc.Sel("encodeRegressionToCommandBuffer:sourceTexture:guidanceTexture:weightsTexture:destinationCoefficientsTexture:"), po0, po1, po2, po3, po4) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951907-encoderegressiontocommandbuffer?language=objc +func (i_ ImageGuidedFilter) EncodeRegressionToCommandBufferObjectSourceTextureObjectGuidanceTextureObjectWeightsTextureObjectDestinationCoefficientsTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, guidanceTextureObject objc.IObject, weightsTextureObject objc.IObject, destinationCoefficientsTextureObject objc.IObject) { + objc.Call[objc.Void](i_, objc.Sel("encodeRegressionToCommandBuffer:sourceTexture:guidanceTexture:weightsTexture:destinationCoefficientsTexture:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceTextureObject), objc.Ptr(guidanceTextureObject), objc.Ptr(weightsTextureObject), objc.Ptr(destinationCoefficientsTextureObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2953079-reconstructoffset?language=objc +func (i_ ImageGuidedFilter) ReconstructOffset() float64 { + rv := objc.Call[float64](i_, objc.Sel("reconstructOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2953079-reconstructoffset?language=objc +func (i_ ImageGuidedFilter) SetReconstructOffset(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setReconstructOffset:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951908-epsilon?language=objc +func (i_ ImageGuidedFilter) Epsilon() float64 { + rv := objc.Call[float64](i_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951908-epsilon?language=objc +func (i_ ImageGuidedFilter) SetEpsilon(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setEpsilon:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2953078-reconstructscale?language=objc +func (i_ ImageGuidedFilter) ReconstructScale() float64 { + rv := objc.Call[float64](i_, objc.Sel("reconstructScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2953078-reconstructscale?language=objc +func (i_ ImageGuidedFilter) SetReconstructScale(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setReconstructScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageguidedfilter/2951909-kerneldiameter?language=objc +func (i_ ImageGuidedFilter) KernelDiameter() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelDiameter")) + return rv +} diff --git a/macos/mps/image_histogram.gen.go b/macos/mps/image_histogram.gen.go new file mode 100644 index 00000000..8c8374cc --- /dev/null +++ b/macos/mps/image_histogram.gen.go @@ -0,0 +1,194 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/kernel" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageHistogram] class. +var ImageHistogramClass = _ImageHistogramClass{objc.GetClass("MPSImageHistogram")} + +type _ImageHistogramClass struct { + objc.Class +} + +// An interface definition for the [ImageHistogram] class. +type IImageHistogram interface { + IKernel + HistogramSizeForSourceFormat(sourceFormat metal.PixelFormat) uint + EncodeToCommandBufferSourceTextureHistogramHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, histogram metal.PBuffer, histogramOffset uint) + EncodeToCommandBufferObjectSourceTextureObjectHistogramObjectHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, histogramObject objc.IObject, histogramOffset uint) + HistogramInfo() ImageHistogramInfo + MinPixelThresholdValue() kernel.Vector_float4 + SetMinPixelThresholdValue(value kernel.Vector_float4) + ZeroHistogram() bool + SetZeroHistogram(value bool) + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// A filter that computes the histogram of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram?language=objc +type ImageHistogram struct { + Kernel +} + +func ImageHistogramFrom(ptr unsafe.Pointer) ImageHistogram { + return ImageHistogram{ + Kernel: KernelFrom(ptr), + } +} + +func (i_ ImageHistogram) InitWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageHistogram { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogram](i_, objc.Sel("initWithDevice:histogramInfo:"), po0, histogramInfo) + return rv +} + +// Initializes a histogram with specific information. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618910-initwithdevice?language=objc +func NewImageHistogramWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageHistogram { + instance := ImageHistogramClass.Alloc().InitWithDeviceHistogramInfo(device, histogramInfo) + instance.Autorelease() + return instance +} + +func (ic _ImageHistogramClass) Alloc() ImageHistogram { + rv := objc.Call[ImageHistogram](ic, objc.Sel("alloc")) + return rv +} + +func ImageHistogram_Alloc() ImageHistogram { + return ImageHistogramClass.Alloc() +} + +func (ic _ImageHistogramClass) New() ImageHistogram { + rv := objc.Call[ImageHistogram](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageHistogram() ImageHistogram { + return ImageHistogramClass.New() +} + +func (i_ ImageHistogram) Init() ImageHistogram { + rv := objc.Call[ImageHistogram](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageHistogram) InitWithDevice(device metal.PDevice) ImageHistogram { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogram](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewImageHistogramWithDevice(device metal.PDevice) ImageHistogram { + instance := ImageHistogramClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageHistogram) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageHistogram { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogram](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageHistogram_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageHistogram { + instance := ImageHistogramClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The amount of space the histogram will take up in the output buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618839-histogramsizeforsourceformat?language=objc +func (i_ ImageHistogram) HistogramSizeForSourceFormat(sourceFormat metal.PixelFormat) uint { + rv := objc.Call[uint](i_, objc.Sel("histogramSizeForSourceFormat:"), sourceFormat) + return rv +} + +// Encodes the filter to a command buffer using a compute command encoder. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618853-encodetocommandbuffer?language=objc +func (i_ ImageHistogram) EncodeToCommandBufferSourceTextureHistogramHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, histogram metal.PBuffer, histogramOffset uint) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", source) + po2 := objc.WrapAsProtocol("MTLBuffer", histogram) + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:histogram:histogramOffset:"), po0, po1, po2, histogramOffset) +} + +// Encodes the filter to a command buffer using a compute command encoder. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618853-encodetocommandbuffer?language=objc +func (i_ ImageHistogram) EncodeToCommandBufferObjectSourceTextureObjectHistogramObjectHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, histogramObject objc.IObject, histogramOffset uint) { + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:histogram:histogramOffset:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceObject), objc.Ptr(histogramObject), histogramOffset) +} + +// A structure describing the histogram content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618844-histograminfo?language=objc +func (i_ ImageHistogram) HistogramInfo() ImageHistogramInfo { + rv := objc.Call[ImageHistogramInfo](i_, objc.Sel("histogramInfo")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/2867008-minpixelthresholdvalue?language=objc +func (i_ ImageHistogram) MinPixelThresholdValue() kernel.Vector_float4 { + rv := objc.Call[kernel.Vector_float4](i_, objc.Sel("minPixelThresholdValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/2867008-minpixelthresholdvalue?language=objc +func (i_ ImageHistogram) SetMinPixelThresholdValue(value kernel.Vector_float4) { + objc.Call[objc.Void](i_, objc.Sel("setMinPixelThresholdValue:"), value) +} + +// Determines whether to zero-initialize the histogram results. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618891-zerohistogram?language=objc +func (i_ ImageHistogram) ZeroHistogram() bool { + rv := objc.Call[bool](i_, objc.Sel("zeroHistogram")) + return rv +} + +// Determines whether to zero-initialize the histogram results. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618891-zerohistogram?language=objc +func (i_ ImageHistogram) SetZeroHistogram(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setZeroHistogram:"), value) +} + +// The source rectangle to use when reading data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618765-cliprectsource?language=objc +func (i_ ImageHistogram) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](i_, objc.Sel("clipRectSource")) + return rv +} + +// The source rectangle to use when reading data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogram/1618765-cliprectsource?language=objc +func (i_ ImageHistogram) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](i_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/image_histogram_equalization.gen.go b/macos/mps/image_histogram_equalization.gen.go new file mode 100644 index 00000000..92570fdf --- /dev/null +++ b/macos/mps/image_histogram_equalization.gen.go @@ -0,0 +1,133 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageHistogramEqualization] class. +var ImageHistogramEqualizationClass = _ImageHistogramEqualizationClass{objc.GetClass("MPSImageHistogramEqualization")} + +type _ImageHistogramEqualizationClass struct { + objc.Class +} + +// An interface definition for the [ImageHistogramEqualization] class. +type IImageHistogramEqualization interface { + IUnaryImageKernel + EncodeTransformToCommandBufferSourceTextureHistogramHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, histogram metal.PBuffer, histogramOffset uint) + EncodeTransformToCommandBufferObjectSourceTextureObjectHistogramObjectHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, histogramObject objc.IObject, histogramOffset uint) + HistogramInfo() ImageHistogramInfo +} + +// A filter that equalizes the histogram of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramequalization?language=objc +type ImageHistogramEqualization struct { + UnaryImageKernel +} + +func ImageHistogramEqualizationFrom(ptr unsafe.Pointer) ImageHistogramEqualization { + return ImageHistogramEqualization{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageHistogramEqualization) InitWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageHistogramEqualization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogramEqualization](i_, objc.Sel("initWithDevice:histogramInfo:"), po0, histogramInfo) + return rv +} + +// Initializes a histogram with specific information. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramequalization/1618856-initwithdevice?language=objc +func NewImageHistogramEqualizationWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageHistogramEqualization { + instance := ImageHistogramEqualizationClass.Alloc().InitWithDeviceHistogramInfo(device, histogramInfo) + instance.Autorelease() + return instance +} + +func (ic _ImageHistogramEqualizationClass) Alloc() ImageHistogramEqualization { + rv := objc.Call[ImageHistogramEqualization](ic, objc.Sel("alloc")) + return rv +} + +func ImageHistogramEqualization_Alloc() ImageHistogramEqualization { + return ImageHistogramEqualizationClass.Alloc() +} + +func (ic _ImageHistogramEqualizationClass) New() ImageHistogramEqualization { + rv := objc.Call[ImageHistogramEqualization](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageHistogramEqualization() ImageHistogramEqualization { + return ImageHistogramEqualizationClass.New() +} + +func (i_ ImageHistogramEqualization) Init() ImageHistogramEqualization { + rv := objc.Call[ImageHistogramEqualization](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageHistogramEqualization) InitWithDevice(device metal.PDevice) ImageHistogramEqualization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogramEqualization](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageHistogramEqualizationWithDevice(device metal.PDevice) ImageHistogramEqualization { + instance := ImageHistogramEqualizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageHistogramEqualization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageHistogramEqualization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogramEqualization](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageHistogramEqualization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageHistogramEqualization { + instance := ImageHistogramEqualizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Encodes the transform function to a command buffer using a compute command encoder. The transform function computes the equalization lookup table. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramequalization/1618746-encodetransformtocommandbuffer?language=objc +func (i_ ImageHistogramEqualization) EncodeTransformToCommandBufferSourceTextureHistogramHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, histogram metal.PBuffer, histogramOffset uint) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", source) + po2 := objc.WrapAsProtocol("MTLBuffer", histogram) + objc.Call[objc.Void](i_, objc.Sel("encodeTransformToCommandBuffer:sourceTexture:histogram:histogramOffset:"), po0, po1, po2, histogramOffset) +} + +// Encodes the transform function to a command buffer using a compute command encoder. The transform function computes the equalization lookup table. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramequalization/1618746-encodetransformtocommandbuffer?language=objc +func (i_ ImageHistogramEqualization) EncodeTransformToCommandBufferObjectSourceTextureObjectHistogramObjectHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, histogramObject objc.IObject, histogramOffset uint) { + objc.Call[objc.Void](i_, objc.Sel("encodeTransformToCommandBuffer:sourceTexture:histogram:histogramOffset:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceObject), objc.Ptr(histogramObject), histogramOffset) +} + +// A structure describing the histogram content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramequalization/1618775-histograminfo?language=objc +func (i_ ImageHistogramEqualization) HistogramInfo() ImageHistogramInfo { + rv := objc.Call[ImageHistogramInfo](i_, objc.Sel("histogramInfo")) + return rv +} diff --git a/macos/mps/image_histogram_specification.gen.go b/macos/mps/image_histogram_specification.gen.go new file mode 100644 index 00000000..b727f1a8 --- /dev/null +++ b/macos/mps/image_histogram_specification.gen.go @@ -0,0 +1,134 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageHistogramSpecification] class. +var ImageHistogramSpecificationClass = _ImageHistogramSpecificationClass{objc.GetClass("MPSImageHistogramSpecification")} + +type _ImageHistogramSpecificationClass struct { + objc.Class +} + +// An interface definition for the [ImageHistogramSpecification] class. +type IImageHistogramSpecification interface { + IUnaryImageKernel + EncodeTransformToCommandBufferSourceTextureSourceHistogramSourceHistogramOffsetDesiredHistogramDesiredHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, sourceHistogram metal.PBuffer, sourceHistogramOffset uint, desiredHistogram metal.PBuffer, desiredHistogramOffset uint) + EncodeTransformToCommandBufferObjectSourceTextureObjectSourceHistogramObjectSourceHistogramOffsetDesiredHistogramObjectDesiredHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, sourceHistogramObject objc.IObject, sourceHistogramOffset uint, desiredHistogramObject objc.IObject, desiredHistogramOffset uint) + HistogramInfo() ImageHistogramInfo +} + +// A filter that performs a histogram specification operation on an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramspecification?language=objc +type ImageHistogramSpecification struct { + UnaryImageKernel +} + +func ImageHistogramSpecificationFrom(ptr unsafe.Pointer) ImageHistogramSpecification { + return ImageHistogramSpecification{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageHistogramSpecification) InitWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageHistogramSpecification { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogramSpecification](i_, objc.Sel("initWithDevice:histogramInfo:"), po0, histogramInfo) + return rv +} + +// Initializes a histogram with specific information. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramspecification/1618907-initwithdevice?language=objc +func NewImageHistogramSpecificationWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageHistogramSpecification { + instance := ImageHistogramSpecificationClass.Alloc().InitWithDeviceHistogramInfo(device, histogramInfo) + instance.Autorelease() + return instance +} + +func (ic _ImageHistogramSpecificationClass) Alloc() ImageHistogramSpecification { + rv := objc.Call[ImageHistogramSpecification](ic, objc.Sel("alloc")) + return rv +} + +func ImageHistogramSpecification_Alloc() ImageHistogramSpecification { + return ImageHistogramSpecificationClass.Alloc() +} + +func (ic _ImageHistogramSpecificationClass) New() ImageHistogramSpecification { + rv := objc.Call[ImageHistogramSpecification](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageHistogramSpecification() ImageHistogramSpecification { + return ImageHistogramSpecificationClass.New() +} + +func (i_ ImageHistogramSpecification) Init() ImageHistogramSpecification { + rv := objc.Call[ImageHistogramSpecification](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageHistogramSpecification) InitWithDevice(device metal.PDevice) ImageHistogramSpecification { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogramSpecification](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageHistogramSpecificationWithDevice(device metal.PDevice) ImageHistogramSpecification { + instance := ImageHistogramSpecificationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageHistogramSpecification) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageHistogramSpecification { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageHistogramSpecification](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageHistogramSpecification_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageHistogramSpecification { + instance := ImageHistogramSpecificationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Encodes the transform function to a command buffer using a compute command encoder. The transform function computes the equalization lookup table. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramspecification/1618854-encodetransformtocommandbuffer?language=objc +func (i_ ImageHistogramSpecification) EncodeTransformToCommandBufferSourceTextureSourceHistogramSourceHistogramOffsetDesiredHistogramDesiredHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, sourceHistogram metal.PBuffer, sourceHistogramOffset uint, desiredHistogram metal.PBuffer, desiredHistogramOffset uint) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", source) + po2 := objc.WrapAsProtocol("MTLBuffer", sourceHistogram) + po4 := objc.WrapAsProtocol("MTLBuffer", desiredHistogram) + objc.Call[objc.Void](i_, objc.Sel("encodeTransformToCommandBuffer:sourceTexture:sourceHistogram:sourceHistogramOffset:desiredHistogram:desiredHistogramOffset:"), po0, po1, po2, sourceHistogramOffset, po4, desiredHistogramOffset) +} + +// Encodes the transform function to a command buffer using a compute command encoder. The transform function computes the equalization lookup table. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramspecification/1618854-encodetransformtocommandbuffer?language=objc +func (i_ ImageHistogramSpecification) EncodeTransformToCommandBufferObjectSourceTextureObjectSourceHistogramObjectSourceHistogramOffsetDesiredHistogramObjectDesiredHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, sourceHistogramObject objc.IObject, sourceHistogramOffset uint, desiredHistogramObject objc.IObject, desiredHistogramOffset uint) { + objc.Call[objc.Void](i_, objc.Sel("encodeTransformToCommandBuffer:sourceTexture:sourceHistogram:sourceHistogramOffset:desiredHistogram:desiredHistogramOffset:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceObject), objc.Ptr(sourceHistogramObject), sourceHistogramOffset, objc.Ptr(desiredHistogramObject), desiredHistogramOffset) +} + +// A structure describing the histogram content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistogramspecification/1618810-histograminfo?language=objc +func (i_ ImageHistogramSpecification) HistogramInfo() ImageHistogramInfo { + rv := objc.Call[ImageHistogramInfo](i_, objc.Sel("histogramInfo")) + return rv +} diff --git a/macos/mps/image_integral.gen.go b/macos/mps/image_integral.gen.go new file mode 100644 index 00000000..c125018e --- /dev/null +++ b/macos/mps/image_integral.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageIntegral] class. +var ImageIntegralClass = _ImageIntegralClass{objc.GetClass("MPSImageIntegral")} + +type _ImageIntegralClass struct { + objc.Class +} + +// An interface definition for the [ImageIntegral] class. +type IImageIntegral interface { + IUnaryImageKernel +} + +// A filter that calculates the sum of pixels over a specified region in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageintegral?language=objc +type ImageIntegral struct { + UnaryImageKernel +} + +func ImageIntegralFrom(ptr unsafe.Pointer) ImageIntegral { + return ImageIntegral{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (ic _ImageIntegralClass) Alloc() ImageIntegral { + rv := objc.Call[ImageIntegral](ic, objc.Sel("alloc")) + return rv +} + +func ImageIntegral_Alloc() ImageIntegral { + return ImageIntegralClass.Alloc() +} + +func (ic _ImageIntegralClass) New() ImageIntegral { + rv := objc.Call[ImageIntegral](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageIntegral() ImageIntegral { + return ImageIntegralClass.New() +} + +func (i_ ImageIntegral) Init() ImageIntegral { + rv := objc.Call[ImageIntegral](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageIntegral) InitWithDevice(device metal.PDevice) ImageIntegral { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageIntegral](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageIntegralWithDevice(device metal.PDevice) ImageIntegral { + instance := ImageIntegralClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageIntegral) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageIntegral { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageIntegral](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageIntegral_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageIntegral { + instance := ImageIntegralClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_integral_of_squares.gen.go b/macos/mps/image_integral_of_squares.gen.go new file mode 100644 index 00000000..746a0369 --- /dev/null +++ b/macos/mps/image_integral_of_squares.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageIntegralOfSquares] class. +var ImageIntegralOfSquaresClass = _ImageIntegralOfSquaresClass{objc.GetClass("MPSImageIntegralOfSquares")} + +type _ImageIntegralOfSquaresClass struct { + objc.Class +} + +// An interface definition for the [ImageIntegralOfSquares] class. +type IImageIntegralOfSquares interface { + IUnaryImageKernel +} + +// A filter that calculates the sum of squared pixels over a specified region in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimageintegralofsquares?language=objc +type ImageIntegralOfSquares struct { + UnaryImageKernel +} + +func ImageIntegralOfSquaresFrom(ptr unsafe.Pointer) ImageIntegralOfSquares { + return ImageIntegralOfSquares{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (ic _ImageIntegralOfSquaresClass) Alloc() ImageIntegralOfSquares { + rv := objc.Call[ImageIntegralOfSquares](ic, objc.Sel("alloc")) + return rv +} + +func ImageIntegralOfSquares_Alloc() ImageIntegralOfSquares { + return ImageIntegralOfSquaresClass.Alloc() +} + +func (ic _ImageIntegralOfSquaresClass) New() ImageIntegralOfSquares { + rv := objc.Call[ImageIntegralOfSquares](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageIntegralOfSquares() ImageIntegralOfSquares { + return ImageIntegralOfSquaresClass.New() +} + +func (i_ ImageIntegralOfSquares) Init() ImageIntegralOfSquares { + rv := objc.Call[ImageIntegralOfSquares](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageIntegralOfSquares) InitWithDevice(device metal.PDevice) ImageIntegralOfSquares { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageIntegralOfSquares](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageIntegralOfSquaresWithDevice(device metal.PDevice) ImageIntegralOfSquares { + instance := ImageIntegralOfSquaresClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageIntegralOfSquares) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageIntegralOfSquares { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageIntegralOfSquares](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageIntegralOfSquares_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageIntegralOfSquares { + instance := ImageIntegralOfSquaresClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_lanczos_scale.gen.go b/macos/mps/image_lanczos_scale.gen.go new file mode 100644 index 00000000..3fb9cdc1 --- /dev/null +++ b/macos/mps/image_lanczos_scale.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageLanczosScale] class. +var ImageLanczosScaleClass = _ImageLanczosScaleClass{objc.GetClass("MPSImageLanczosScale")} + +type _ImageLanczosScaleClass struct { + objc.Class +} + +// An interface definition for the [ImageLanczosScale] class. +type IImageLanczosScale interface { + IImageScale +} + +// A filter that resizes and changes the aspect ratio of an image using Lanczos resampling. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelanczosscale?language=objc +type ImageLanczosScale struct { + ImageScale +} + +func ImageLanczosScaleFrom(ptr unsafe.Pointer) ImageLanczosScale { + return ImageLanczosScale{ + ImageScale: ImageScaleFrom(ptr), + } +} + +func (i_ ImageLanczosScale) InitWithDevice(device metal.PDevice) ImageLanczosScale { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLanczosScale](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelanczosscale/2867001-initwithdevice?language=objc +func NewImageLanczosScaleWithDevice(device metal.PDevice) ImageLanczosScale { + instance := ImageLanczosScaleClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageLanczosScaleClass) Alloc() ImageLanczosScale { + rv := objc.Call[ImageLanczosScale](ic, objc.Sel("alloc")) + return rv +} + +func ImageLanczosScale_Alloc() ImageLanczosScale { + return ImageLanczosScaleClass.Alloc() +} + +func (ic _ImageLanczosScaleClass) New() ImageLanczosScale { + rv := objc.Call[ImageLanczosScale](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageLanczosScale() ImageLanczosScale { + return ImageLanczosScaleClass.New() +} + +func (i_ ImageLanczosScale) Init() ImageLanczosScale { + rv := objc.Call[ImageLanczosScale](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageLanczosScale) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLanczosScale { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLanczosScale](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageLanczosScale_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLanczosScale { + instance := ImageLanczosScaleClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_laplacian.gen.go b/macos/mps/image_laplacian.gen.go new file mode 100644 index 00000000..cc2e84a8 --- /dev/null +++ b/macos/mps/image_laplacian.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageLaplacian] class. +var ImageLaplacianClass = _ImageLaplacianClass{objc.GetClass("MPSImageLaplacian")} + +type _ImageLaplacianClass struct { + objc.Class +} + +// An interface definition for the [ImageLaplacian] class. +type IImageLaplacian interface { + IUnaryImageKernel + Bias() float64 + SetBias(value float64) +} + +// An optimized Laplacian filter, provided for ease of use. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacian?language=objc +type ImageLaplacian struct { + UnaryImageKernel +} + +func ImageLaplacianFrom(ptr unsafe.Pointer) ImageLaplacian { + return ImageLaplacian{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (ic _ImageLaplacianClass) Alloc() ImageLaplacian { + rv := objc.Call[ImageLaplacian](ic, objc.Sel("alloc")) + return rv +} + +func ImageLaplacian_Alloc() ImageLaplacian { + return ImageLaplacianClass.Alloc() +} + +func (ic _ImageLaplacianClass) New() ImageLaplacian { + rv := objc.Call[ImageLaplacian](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageLaplacian() ImageLaplacian { + return ImageLaplacianClass.New() +} + +func (i_ ImageLaplacian) Init() ImageLaplacian { + rv := objc.Call[ImageLaplacian](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageLaplacian) InitWithDevice(device metal.PDevice) ImageLaplacian { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacian](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageLaplacianWithDevice(device metal.PDevice) ImageLaplacian { + instance := ImageLaplacianClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageLaplacian) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacian { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacian](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageLaplacian_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacian { + instance := ImageLaplacianClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The value added to a convolved pixel before it is converted back to its intended storage format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacian/1648929-bias?language=objc +func (i_ ImageLaplacian) Bias() float64 { + rv := objc.Call[float64](i_, objc.Sel("bias")) + return rv +} + +// The value added to a convolved pixel before it is converted back to its intended storage format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacian/1648929-bias?language=objc +func (i_ ImageLaplacian) SetBias(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setBias:"), value) +} diff --git a/macos/mps/image_laplacian_pyramid.gen.go b/macos/mps/image_laplacian_pyramid.gen.go new file mode 100644 index 00000000..6e4fc037 --- /dev/null +++ b/macos/mps/image_laplacian_pyramid.gen.go @@ -0,0 +1,124 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageLaplacianPyramid] class. +var ImageLaplacianPyramidClass = _ImageLaplacianPyramidClass{objc.GetClass("MPSImageLaplacianPyramid")} + +type _ImageLaplacianPyramidClass struct { + objc.Class +} + +// An interface definition for the [ImageLaplacianPyramid] class. +type IImageLaplacianPyramid interface { + IImagePyramid + GetLaplacianBias() float64 + SetLaplacianBias(value float64) + GetLaplacianScale() float64 + SetLaplacianScale(value float64) +} + +// A filter that convolves an image with a Laplacian filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacianpyramid?language=objc +type ImageLaplacianPyramid struct { + ImagePyramid +} + +func ImageLaplacianPyramidFrom(ptr unsafe.Pointer) ImageLaplacianPyramid { + return ImageLaplacianPyramid{ + ImagePyramid: ImagePyramidFrom(ptr), + } +} + +func (ic _ImageLaplacianPyramidClass) Alloc() ImageLaplacianPyramid { + rv := objc.Call[ImageLaplacianPyramid](ic, objc.Sel("alloc")) + return rv +} + +func ImageLaplacianPyramid_Alloc() ImageLaplacianPyramid { + return ImageLaplacianPyramidClass.Alloc() +} + +func (ic _ImageLaplacianPyramidClass) New() ImageLaplacianPyramid { + rv := objc.Call[ImageLaplacianPyramid](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageLaplacianPyramid() ImageLaplacianPyramid { + return ImageLaplacianPyramidClass.New() +} + +func (i_ ImageLaplacianPyramid) Init() ImageLaplacianPyramid { + rv := objc.Call[ImageLaplacianPyramid](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageLaplacianPyramid) InitWithDevice(device metal.PDevice) ImageLaplacianPyramid { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacianPyramid](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a downwards 5-tap image pyramid with the default filter kernel and device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid/1648935-initwithdevice?language=objc +func NewImageLaplacianPyramidWithDevice(device metal.PDevice) ImageLaplacianPyramid { + instance := ImageLaplacianPyramidClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageLaplacianPyramid) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacianPyramid { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacianPyramid](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageLaplacianPyramid_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacianPyramid { + instance := ImageLaplacianPyramidClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacianpyramid/2966645-laplacianbias?language=objc +func (i_ ImageLaplacianPyramid) GetLaplacianBias() float64 { + rv := objc.Call[float64](i_, objc.Sel("getLaplacianBias")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacianpyramid/2966645-laplacianbias?language=objc +func (i_ ImageLaplacianPyramid) SetLaplacianBias(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setLaplacianBias:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacianpyramid/2966646-laplacianscale?language=objc +func (i_ ImageLaplacianPyramid) GetLaplacianScale() float64 { + rv := objc.Call[float64](i_, objc.Sel("getLaplacianScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacianpyramid/2966646-laplacianscale?language=objc +func (i_ ImageLaplacianPyramid) SetLaplacianScale(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setLaplacianScale:"), value) +} diff --git a/macos/mps/image_laplacian_pyramid_add.gen.go b/macos/mps/image_laplacian_pyramid_add.gen.go new file mode 100644 index 00000000..96c7ad7c --- /dev/null +++ b/macos/mps/image_laplacian_pyramid_add.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageLaplacianPyramidAdd] class. +var ImageLaplacianPyramidAddClass = _ImageLaplacianPyramidAddClass{objc.GetClass("MPSImageLaplacianPyramidAdd")} + +type _ImageLaplacianPyramidAddClass struct { + objc.Class +} + +// An interface definition for the [ImageLaplacianPyramidAdd] class. +type IImageLaplacianPyramidAdd interface { + IImageLaplacianPyramid +} + +// A filter that convolves an image with an additive Laplacian pyramid. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacianpyramidadd?language=objc +type ImageLaplacianPyramidAdd struct { + ImageLaplacianPyramid +} + +func ImageLaplacianPyramidAddFrom(ptr unsafe.Pointer) ImageLaplacianPyramidAdd { + return ImageLaplacianPyramidAdd{ + ImageLaplacianPyramid: ImageLaplacianPyramidFrom(ptr), + } +} + +func (ic _ImageLaplacianPyramidAddClass) Alloc() ImageLaplacianPyramidAdd { + rv := objc.Call[ImageLaplacianPyramidAdd](ic, objc.Sel("alloc")) + return rv +} + +func ImageLaplacianPyramidAdd_Alloc() ImageLaplacianPyramidAdd { + return ImageLaplacianPyramidAddClass.Alloc() +} + +func (ic _ImageLaplacianPyramidAddClass) New() ImageLaplacianPyramidAdd { + rv := objc.Call[ImageLaplacianPyramidAdd](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageLaplacianPyramidAdd() ImageLaplacianPyramidAdd { + return ImageLaplacianPyramidAddClass.New() +} + +func (i_ ImageLaplacianPyramidAdd) Init() ImageLaplacianPyramidAdd { + rv := objc.Call[ImageLaplacianPyramidAdd](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageLaplacianPyramidAdd) InitWithDevice(device metal.PDevice) ImageLaplacianPyramidAdd { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacianPyramidAdd](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a downwards 5-tap image pyramid with the default filter kernel and device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid/1648935-initwithdevice?language=objc +func NewImageLaplacianPyramidAddWithDevice(device metal.PDevice) ImageLaplacianPyramidAdd { + instance := ImageLaplacianPyramidAddClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageLaplacianPyramidAdd) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacianPyramidAdd { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacianPyramidAdd](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageLaplacianPyramidAdd_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacianPyramidAdd { + instance := ImageLaplacianPyramidAddClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_laplacian_pyramid_subtract.gen.go b/macos/mps/image_laplacian_pyramid_subtract.gen.go new file mode 100644 index 00000000..676cef02 --- /dev/null +++ b/macos/mps/image_laplacian_pyramid_subtract.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageLaplacianPyramidSubtract] class. +var ImageLaplacianPyramidSubtractClass = _ImageLaplacianPyramidSubtractClass{objc.GetClass("MPSImageLaplacianPyramidSubtract")} + +type _ImageLaplacianPyramidSubtractClass struct { + objc.Class +} + +// An interface definition for the [ImageLaplacianPyramidSubtract] class. +type IImageLaplacianPyramidSubtract interface { + IImageLaplacianPyramid +} + +// A filter that convolves an image with a subtractive Laplacian pyramid. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagelaplacianpyramidsubtract?language=objc +type ImageLaplacianPyramidSubtract struct { + ImageLaplacianPyramid +} + +func ImageLaplacianPyramidSubtractFrom(ptr unsafe.Pointer) ImageLaplacianPyramidSubtract { + return ImageLaplacianPyramidSubtract{ + ImageLaplacianPyramid: ImageLaplacianPyramidFrom(ptr), + } +} + +func (ic _ImageLaplacianPyramidSubtractClass) Alloc() ImageLaplacianPyramidSubtract { + rv := objc.Call[ImageLaplacianPyramidSubtract](ic, objc.Sel("alloc")) + return rv +} + +func ImageLaplacianPyramidSubtract_Alloc() ImageLaplacianPyramidSubtract { + return ImageLaplacianPyramidSubtractClass.Alloc() +} + +func (ic _ImageLaplacianPyramidSubtractClass) New() ImageLaplacianPyramidSubtract { + rv := objc.Call[ImageLaplacianPyramidSubtract](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageLaplacianPyramidSubtract() ImageLaplacianPyramidSubtract { + return ImageLaplacianPyramidSubtractClass.New() +} + +func (i_ ImageLaplacianPyramidSubtract) Init() ImageLaplacianPyramidSubtract { + rv := objc.Call[ImageLaplacianPyramidSubtract](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageLaplacianPyramidSubtract) InitWithDevice(device metal.PDevice) ImageLaplacianPyramidSubtract { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacianPyramidSubtract](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a downwards 5-tap image pyramid with the default filter kernel and device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid/1648935-initwithdevice?language=objc +func NewImageLaplacianPyramidSubtractWithDevice(device metal.PDevice) ImageLaplacianPyramidSubtract { + instance := ImageLaplacianPyramidSubtractClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageLaplacianPyramidSubtract) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacianPyramidSubtract { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageLaplacianPyramidSubtract](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageLaplacianPyramidSubtract_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageLaplacianPyramidSubtract { + instance := ImageLaplacianPyramidSubtractClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_median.gen.go b/macos/mps/image_median.gen.go new file mode 100644 index 00000000..2293c9c7 --- /dev/null +++ b/macos/mps/image_median.gen.go @@ -0,0 +1,144 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageMedian] class. +var ImageMedianClass = _ImageMedianClass{objc.GetClass("MPSImageMedian")} + +type _ImageMedianClass struct { + objc.Class +} + +// An interface definition for the [ImageMedian] class. +type IImageMedian interface { + IUnaryImageKernel + KernelDiameter() uint +} + +// A filter that applies a median filter in a square region centered around each pixel in the source image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemedian?language=objc +type ImageMedian struct { + UnaryImageKernel +} + +func ImageMedianFrom(ptr unsafe.Pointer) ImageMedian { + return ImageMedian{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageMedian) InitWithDeviceKernelDiameter(device metal.PDevice, kernelDiameter uint) ImageMedian { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageMedian](i_, objc.Sel("initWithDevice:kernelDiameter:"), po0, kernelDiameter) + return rv +} + +// Initializes a filter for a particular kernel size and device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemedian/1618837-initwithdevice?language=objc +func NewImageMedianWithDeviceKernelDiameter(device metal.PDevice, kernelDiameter uint) ImageMedian { + instance := ImageMedianClass.Alloc().InitWithDeviceKernelDiameter(device, kernelDiameter) + instance.Autorelease() + return instance +} + +func (ic _ImageMedianClass) Alloc() ImageMedian { + rv := objc.Call[ImageMedian](ic, objc.Sel("alloc")) + return rv +} + +func ImageMedian_Alloc() ImageMedian { + return ImageMedianClass.Alloc() +} + +func (ic _ImageMedianClass) New() ImageMedian { + rv := objc.Call[ImageMedian](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageMedian() ImageMedian { + return ImageMedianClass.New() +} + +func (i_ ImageMedian) Init() ImageMedian { + rv := objc.Call[ImageMedian](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageMedian) InitWithDevice(device metal.PDevice) ImageMedian { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageMedian](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageMedianWithDevice(device metal.PDevice) ImageMedian { + instance := ImageMedianClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageMedian) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageMedian { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageMedian](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageMedian_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageMedian { + instance := ImageMedianClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Queries the minimum diameter, in pixels, of the filter window supported by the median filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemedian/1618864-minkerneldiameter?language=objc +func (ic _ImageMedianClass) MinKernelDiameter() uint { + rv := objc.Call[uint](ic, objc.Sel("minKernelDiameter")) + return rv +} + +// Queries the minimum diameter, in pixels, of the filter window supported by the median filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemedian/1618864-minkerneldiameter?language=objc +func ImageMedian_MinKernelDiameter() uint { + return ImageMedianClass.MinKernelDiameter() +} + +// Queries the maximum diameter, in pixels, of the filter window supported by the median filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemedian/1618830-maxkerneldiameter?language=objc +func (ic _ImageMedianClass) MaxKernelDiameter() uint { + rv := objc.Call[uint](ic, objc.Sel("maxKernelDiameter")) + return rv +} + +// Queries the maximum diameter, in pixels, of the filter window supported by the median filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemedian/1618830-maxkerneldiameter?language=objc +func ImageMedian_MaxKernelDiameter() uint { + return ImageMedianClass.MaxKernelDiameter() +} + +// The diameter, in pixels, of the filter window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemedian/1618909-kerneldiameter?language=objc +func (i_ ImageMedian) KernelDiameter() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelDiameter")) + return rv +} diff --git a/macos/mps/image_multiply.gen.go b/macos/mps/image_multiply.gen.go new file mode 100644 index 00000000..a40ed174 --- /dev/null +++ b/macos/mps/image_multiply.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageMultiply] class. +var ImageMultiplyClass = _ImageMultiplyClass{objc.GetClass("MPSImageMultiply")} + +type _ImageMultiplyClass struct { + objc.Class +} + +// An interface definition for the [ImageMultiply] class. +type IImageMultiply interface { + IImageArithmetic +} + +// A filter that returns the element-wise product of its two input images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemultiply?language=objc +type ImageMultiply struct { + ImageArithmetic +} + +func ImageMultiplyFrom(ptr unsafe.Pointer) ImageMultiply { + return ImageMultiply{ + ImageArithmetic: ImageArithmeticFrom(ptr), + } +} + +func (i_ ImageMultiply) InitWithDevice(device metal.PDevice) ImageMultiply { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageMultiply](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagemultiply/2866600-initwithdevice?language=objc +func NewImageMultiplyWithDevice(device metal.PDevice) ImageMultiply { + instance := ImageMultiplyClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageMultiplyClass) Alloc() ImageMultiply { + rv := objc.Call[ImageMultiply](ic, objc.Sel("alloc")) + return rv +} + +func ImageMultiply_Alloc() ImageMultiply { + return ImageMultiplyClass.Alloc() +} + +func (ic _ImageMultiplyClass) New() ImageMultiply { + rv := objc.Call[ImageMultiply](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageMultiply() ImageMultiply { + return ImageMultiplyClass.New() +} + +func (i_ ImageMultiply) Init() ImageMultiply { + rv := objc.Call[ImageMultiply](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageMultiply) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageMultiply { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageMultiply](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageMultiply_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageMultiply { + instance := ImageMultiplyClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_normalized_histogram.gen.go b/macos/mps/image_normalized_histogram.gen.go new file mode 100644 index 00000000..96c52eea --- /dev/null +++ b/macos/mps/image_normalized_histogram.gen.go @@ -0,0 +1,177 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageNormalizedHistogram] class. +var ImageNormalizedHistogramClass = _ImageNormalizedHistogramClass{objc.GetClass("MPSImageNormalizedHistogram")} + +type _ImageNormalizedHistogramClass struct { + objc.Class +} + +// An interface definition for the [ImageNormalizedHistogram] class. +type IImageNormalizedHistogram interface { + IKernel + HistogramSizeForSourceFormat(sourceFormat metal.PixelFormat) uint + EncodeToCommandBufferSourceTextureMinmaxTextureHistogramHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, minmaxTexture metal.PTexture, histogram metal.PBuffer, histogramOffset uint) + EncodeToCommandBufferObjectSourceTextureObjectMinmaxTextureObjectHistogramObjectHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, minmaxTextureObject objc.IObject, histogramObject objc.IObject, histogramOffset uint) + HistogramInfo() ImageHistogramInfo + ZeroHistogram() bool + SetZeroHistogram(value bool) + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// A filter that computes the normalized histogram of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram?language=objc +type ImageNormalizedHistogram struct { + Kernel +} + +func ImageNormalizedHistogramFrom(ptr unsafe.Pointer) ImageNormalizedHistogram { + return ImageNormalizedHistogram{ + Kernel: KernelFrom(ptr), + } +} + +func (i_ ImageNormalizedHistogram) InitWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageNormalizedHistogram { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageNormalizedHistogram](i_, objc.Sel("initWithDevice:histogramInfo:"), po0, histogramInfo) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019326-initwithdevice?language=objc +func NewImageNormalizedHistogramWithDeviceHistogramInfo(device metal.PDevice, histogramInfo *ImageHistogramInfo) ImageNormalizedHistogram { + instance := ImageNormalizedHistogramClass.Alloc().InitWithDeviceHistogramInfo(device, histogramInfo) + instance.Autorelease() + return instance +} + +func (ic _ImageNormalizedHistogramClass) Alloc() ImageNormalizedHistogram { + rv := objc.Call[ImageNormalizedHistogram](ic, objc.Sel("alloc")) + return rv +} + +func ImageNormalizedHistogram_Alloc() ImageNormalizedHistogram { + return ImageNormalizedHistogramClass.Alloc() +} + +func (ic _ImageNormalizedHistogramClass) New() ImageNormalizedHistogram { + rv := objc.Call[ImageNormalizedHistogram](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageNormalizedHistogram() ImageNormalizedHistogram { + return ImageNormalizedHistogramClass.New() +} + +func (i_ ImageNormalizedHistogram) Init() ImageNormalizedHistogram { + rv := objc.Call[ImageNormalizedHistogram](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageNormalizedHistogram) InitWithDevice(device metal.PDevice) ImageNormalizedHistogram { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageNormalizedHistogram](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewImageNormalizedHistogramWithDevice(device metal.PDevice) ImageNormalizedHistogram { + instance := ImageNormalizedHistogramClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageNormalizedHistogram) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageNormalizedHistogram { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageNormalizedHistogram](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageNormalizedHistogram_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageNormalizedHistogram { + instance := ImageNormalizedHistogramClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019324-histogramsizeforsourceformat?language=objc +func (i_ ImageNormalizedHistogram) HistogramSizeForSourceFormat(sourceFormat metal.PixelFormat) uint { + rv := objc.Call[uint](i_, objc.Sel("histogramSizeForSourceFormat:"), sourceFormat) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019322-encodetocommandbuffer?language=objc +func (i_ ImageNormalizedHistogram) EncodeToCommandBufferSourceTextureMinmaxTextureHistogramHistogramOffset(commandBuffer metal.PCommandBuffer, source metal.PTexture, minmaxTexture metal.PTexture, histogram metal.PBuffer, histogramOffset uint) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", source) + po2 := objc.WrapAsProtocol("MTLTexture", minmaxTexture) + po3 := objc.WrapAsProtocol("MTLBuffer", histogram) + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:minmaxTexture:histogram:histogramOffset:"), po0, po1, po2, po3, histogramOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019322-encodetocommandbuffer?language=objc +func (i_ ImageNormalizedHistogram) EncodeToCommandBufferObjectSourceTextureObjectMinmaxTextureObjectHistogramObjectHistogramOffset(commandBufferObject objc.IObject, sourceObject objc.IObject, minmaxTextureObject objc.IObject, histogramObject objc.IObject, histogramOffset uint) { + objc.Call[objc.Void](i_, objc.Sel("encodeToCommandBuffer:sourceTexture:minmaxTexture:histogram:histogramOffset:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceObject), objc.Ptr(minmaxTextureObject), objc.Ptr(histogramObject), histogramOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019323-histograminfo?language=objc +func (i_ ImageNormalizedHistogram) HistogramInfo() ImageHistogramInfo { + rv := objc.Call[ImageHistogramInfo](i_, objc.Sel("histogramInfo")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019327-zerohistogram?language=objc +func (i_ ImageNormalizedHistogram) ZeroHistogram() bool { + rv := objc.Call[bool](i_, objc.Sel("zeroHistogram")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019327-zerohistogram?language=objc +func (i_ ImageNormalizedHistogram) SetZeroHistogram(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setZeroHistogram:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019321-cliprectsource?language=objc +func (i_ ImageNormalizedHistogram) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](i_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagenormalizedhistogram/3019321-cliprectsource?language=objc +func (i_ ImageNormalizedHistogram) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](i_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/image_pyramid.gen.go b/macos/mps/image_pyramid.gen.go new file mode 100644 index 00000000..404d8aee --- /dev/null +++ b/macos/mps/image_pyramid.gen.go @@ -0,0 +1,108 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImagePyramid] class. +var ImagePyramidClass = _ImagePyramidClass{objc.GetClass("MPSImagePyramid")} + +type _ImagePyramidClass struct { + objc.Class +} + +// An interface definition for the [ImagePyramid] class. +type IImagePyramid interface { + IUnaryImageKernel + KernelHeight() uint + KernelWidth() uint +} + +// A base class for creating different kinds of pyramid images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid?language=objc +type ImagePyramid struct { + UnaryImageKernel +} + +func ImagePyramidFrom(ptr unsafe.Pointer) ImagePyramid { + return ImagePyramid{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImagePyramid) InitWithDevice(device metal.PDevice) ImagePyramid { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImagePyramid](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a downwards 5-tap image pyramid with the default filter kernel and device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid/1648935-initwithdevice?language=objc +func NewImagePyramidWithDevice(device metal.PDevice) ImagePyramid { + instance := ImagePyramidClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImagePyramidClass) Alloc() ImagePyramid { + rv := objc.Call[ImagePyramid](ic, objc.Sel("alloc")) + return rv +} + +func ImagePyramid_Alloc() ImagePyramid { + return ImagePyramidClass.Alloc() +} + +func (ic _ImagePyramidClass) New() ImagePyramid { + rv := objc.Call[ImagePyramid](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImagePyramid() ImagePyramid { + return ImagePyramidClass.New() +} + +func (i_ ImagePyramid) Init() ImagePyramid { + rv := objc.Call[ImagePyramid](i_, objc.Sel("init")) + return rv +} + +func (i_ ImagePyramid) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImagePyramid { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImagePyramid](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImagePyramid_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImagePyramid { + instance := ImagePyramidClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The height of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid/1648863-kernelheight?language=objc +func (i_ ImagePyramid) KernelHeight() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelHeight")) + return rv +} + +// The width of the filter window. Must be an odd number. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagepyramid/1648842-kernelwidth?language=objc +func (i_ ImagePyramid) KernelWidth() uint { + rv := objc.Call[uint](i_, objc.Sel("kernelWidth")) + return rv +} diff --git a/macos/mps/image_reduce_column_max.gen.go b/macos/mps/image_reduce_column_max.gen.go new file mode 100644 index 00000000..f3d27086 --- /dev/null +++ b/macos/mps/image_reduce_column_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceColumnMax] class. +var ImageReduceColumnMaxClass = _ImageReduceColumnMaxClass{objc.GetClass("MPSImageReduceColumnMax")} + +type _ImageReduceColumnMaxClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceColumnMax] class. +type IImageReduceColumnMax interface { + IImageReduceUnary +} + +// A filter that returns the maximum value for each column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmax?language=objc +type ImageReduceColumnMax struct { + ImageReduceUnary +} + +func ImageReduceColumnMaxFrom(ptr unsafe.Pointer) ImageReduceColumnMax { + return ImageReduceColumnMax{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceColumnMax) InitWithDevice(device metal.PDevice) ImageReduceColumnMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnMax](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmax/2942318-initwithdevice?language=objc +func NewImageReduceColumnMaxWithDevice(device metal.PDevice) ImageReduceColumnMax { + instance := ImageReduceColumnMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceColumnMaxClass) Alloc() ImageReduceColumnMax { + rv := objc.Call[ImageReduceColumnMax](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceColumnMax_Alloc() ImageReduceColumnMax { + return ImageReduceColumnMaxClass.Alloc() +} + +func (ic _ImageReduceColumnMaxClass) New() ImageReduceColumnMax { + rv := objc.Call[ImageReduceColumnMax](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceColumnMax() ImageReduceColumnMax { + return ImageReduceColumnMaxClass.New() +} + +func (i_ ImageReduceColumnMax) Init() ImageReduceColumnMax { + rv := objc.Call[ImageReduceColumnMax](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceColumnMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnMax](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceColumnMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnMax { + instance := ImageReduceColumnMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_column_mean.gen.go b/macos/mps/image_reduce_column_mean.gen.go new file mode 100644 index 00000000..7fdbdece --- /dev/null +++ b/macos/mps/image_reduce_column_mean.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceColumnMean] class. +var ImageReduceColumnMeanClass = _ImageReduceColumnMeanClass{objc.GetClass("MPSImageReduceColumnMean")} + +type _ImageReduceColumnMeanClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceColumnMean] class. +type IImageReduceColumnMean interface { + IImageReduceUnary +} + +// A filter that returns the mean value for each column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmean?language=objc +type ImageReduceColumnMean struct { + ImageReduceUnary +} + +func ImageReduceColumnMeanFrom(ptr unsafe.Pointer) ImageReduceColumnMean { + return ImageReduceColumnMean{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceColumnMean) InitWithDevice(device metal.PDevice) ImageReduceColumnMean { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnMean](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmean/2942331-initwithdevice?language=objc +func NewImageReduceColumnMeanWithDevice(device metal.PDevice) ImageReduceColumnMean { + instance := ImageReduceColumnMeanClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceColumnMeanClass) Alloc() ImageReduceColumnMean { + rv := objc.Call[ImageReduceColumnMean](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceColumnMean_Alloc() ImageReduceColumnMean { + return ImageReduceColumnMeanClass.Alloc() +} + +func (ic _ImageReduceColumnMeanClass) New() ImageReduceColumnMean { + rv := objc.Call[ImageReduceColumnMean](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceColumnMean() ImageReduceColumnMean { + return ImageReduceColumnMeanClass.New() +} + +func (i_ ImageReduceColumnMean) Init() ImageReduceColumnMean { + rv := objc.Call[ImageReduceColumnMean](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceColumnMean) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnMean { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnMean](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceColumnMean_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnMean { + instance := ImageReduceColumnMeanClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_column_min.gen.go b/macos/mps/image_reduce_column_min.gen.go new file mode 100644 index 00000000..b5a991a7 --- /dev/null +++ b/macos/mps/image_reduce_column_min.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceColumnMin] class. +var ImageReduceColumnMinClass = _ImageReduceColumnMinClass{objc.GetClass("MPSImageReduceColumnMin")} + +type _ImageReduceColumnMinClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceColumnMin] class. +type IImageReduceColumnMin interface { + IImageReduceUnary +} + +// A filter that returns the minimum value for each column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmin?language=objc +type ImageReduceColumnMin struct { + ImageReduceUnary +} + +func ImageReduceColumnMinFrom(ptr unsafe.Pointer) ImageReduceColumnMin { + return ImageReduceColumnMin{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceColumnMin) InitWithDevice(device metal.PDevice) ImageReduceColumnMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnMin](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmin/2942333-initwithdevice?language=objc +func NewImageReduceColumnMinWithDevice(device metal.PDevice) ImageReduceColumnMin { + instance := ImageReduceColumnMinClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceColumnMinClass) Alloc() ImageReduceColumnMin { + rv := objc.Call[ImageReduceColumnMin](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceColumnMin_Alloc() ImageReduceColumnMin { + return ImageReduceColumnMinClass.Alloc() +} + +func (ic _ImageReduceColumnMinClass) New() ImageReduceColumnMin { + rv := objc.Call[ImageReduceColumnMin](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceColumnMin() ImageReduceColumnMin { + return ImageReduceColumnMinClass.New() +} + +func (i_ ImageReduceColumnMin) Init() ImageReduceColumnMin { + rv := objc.Call[ImageReduceColumnMin](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceColumnMin) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnMin { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnMin](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceColumnMin_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnMin { + instance := ImageReduceColumnMinClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_column_sum.gen.go b/macos/mps/image_reduce_column_sum.gen.go new file mode 100644 index 00000000..1c73ef1a --- /dev/null +++ b/macos/mps/image_reduce_column_sum.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceColumnSum] class. +var ImageReduceColumnSumClass = _ImageReduceColumnSumClass{objc.GetClass("MPSImageReduceColumnSum")} + +type _ImageReduceColumnSumClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceColumnSum] class. +type IImageReduceColumnSum interface { + IImageReduceUnary +} + +// A filter that returns the sum of all values for a column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnsum?language=objc +type ImageReduceColumnSum struct { + ImageReduceUnary +} + +func ImageReduceColumnSumFrom(ptr unsafe.Pointer) ImageReduceColumnSum { + return ImageReduceColumnSum{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceColumnSum) InitWithDevice(device metal.PDevice) ImageReduceColumnSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnSum](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnsum/2942321-initwithdevice?language=objc +func NewImageReduceColumnSumWithDevice(device metal.PDevice) ImageReduceColumnSum { + instance := ImageReduceColumnSumClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceColumnSumClass) Alloc() ImageReduceColumnSum { + rv := objc.Call[ImageReduceColumnSum](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceColumnSum_Alloc() ImageReduceColumnSum { + return ImageReduceColumnSumClass.Alloc() +} + +func (ic _ImageReduceColumnSumClass) New() ImageReduceColumnSum { + rv := objc.Call[ImageReduceColumnSum](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceColumnSum() ImageReduceColumnSum { + return ImageReduceColumnSumClass.New() +} + +func (i_ ImageReduceColumnSum) Init() ImageReduceColumnSum { + rv := objc.Call[ImageReduceColumnSum](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceColumnSum) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnSum { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceColumnSum](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceColumnSum_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceColumnSum { + instance := ImageReduceColumnSumClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_row_max.gen.go b/macos/mps/image_reduce_row_max.gen.go new file mode 100644 index 00000000..582dbf1f --- /dev/null +++ b/macos/mps/image_reduce_row_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceRowMax] class. +var ImageReduceRowMaxClass = _ImageReduceRowMaxClass{objc.GetClass("MPSImageReduceRowMax")} + +type _ImageReduceRowMaxClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceRowMax] class. +type IImageReduceRowMax interface { + IImageReduceUnary +} + +// A filter that returns the maximum value for each row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmax?language=objc +type ImageReduceRowMax struct { + ImageReduceUnary +} + +func ImageReduceRowMaxFrom(ptr unsafe.Pointer) ImageReduceRowMax { + return ImageReduceRowMax{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceRowMax) InitWithDevice(device metal.PDevice) ImageReduceRowMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowMax](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmax/2942328-initwithdevice?language=objc +func NewImageReduceRowMaxWithDevice(device metal.PDevice) ImageReduceRowMax { + instance := ImageReduceRowMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceRowMaxClass) Alloc() ImageReduceRowMax { + rv := objc.Call[ImageReduceRowMax](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceRowMax_Alloc() ImageReduceRowMax { + return ImageReduceRowMaxClass.Alloc() +} + +func (ic _ImageReduceRowMaxClass) New() ImageReduceRowMax { + rv := objc.Call[ImageReduceRowMax](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceRowMax() ImageReduceRowMax { + return ImageReduceRowMaxClass.New() +} + +func (i_ ImageReduceRowMax) Init() ImageReduceRowMax { + rv := objc.Call[ImageReduceRowMax](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceRowMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowMax](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceRowMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowMax { + instance := ImageReduceRowMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_row_mean.gen.go b/macos/mps/image_reduce_row_mean.gen.go new file mode 100644 index 00000000..858fb564 --- /dev/null +++ b/macos/mps/image_reduce_row_mean.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceRowMean] class. +var ImageReduceRowMeanClass = _ImageReduceRowMeanClass{objc.GetClass("MPSImageReduceRowMean")} + +type _ImageReduceRowMeanClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceRowMean] class. +type IImageReduceRowMean interface { + IImageReduceUnary +} + +// A filter that returns the mean value for each row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmean?language=objc +type ImageReduceRowMean struct { + ImageReduceUnary +} + +func ImageReduceRowMeanFrom(ptr unsafe.Pointer) ImageReduceRowMean { + return ImageReduceRowMean{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceRowMean) InitWithDevice(device metal.PDevice) ImageReduceRowMean { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowMean](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmean/2942322-initwithdevice?language=objc +func NewImageReduceRowMeanWithDevice(device metal.PDevice) ImageReduceRowMean { + instance := ImageReduceRowMeanClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceRowMeanClass) Alloc() ImageReduceRowMean { + rv := objc.Call[ImageReduceRowMean](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceRowMean_Alloc() ImageReduceRowMean { + return ImageReduceRowMeanClass.Alloc() +} + +func (ic _ImageReduceRowMeanClass) New() ImageReduceRowMean { + rv := objc.Call[ImageReduceRowMean](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceRowMean() ImageReduceRowMean { + return ImageReduceRowMeanClass.New() +} + +func (i_ ImageReduceRowMean) Init() ImageReduceRowMean { + rv := objc.Call[ImageReduceRowMean](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceRowMean) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowMean { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowMean](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceRowMean_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowMean { + instance := ImageReduceRowMeanClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_row_min.gen.go b/macos/mps/image_reduce_row_min.gen.go new file mode 100644 index 00000000..7504ffbd --- /dev/null +++ b/macos/mps/image_reduce_row_min.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceRowMin] class. +var ImageReduceRowMinClass = _ImageReduceRowMinClass{objc.GetClass("MPSImageReduceRowMin")} + +type _ImageReduceRowMinClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceRowMin] class. +type IImageReduceRowMin interface { + IImageReduceUnary +} + +// A filter that returns the minimum value for each row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmin?language=objc +type ImageReduceRowMin struct { + ImageReduceUnary +} + +func ImageReduceRowMinFrom(ptr unsafe.Pointer) ImageReduceRowMin { + return ImageReduceRowMin{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceRowMin) InitWithDevice(device metal.PDevice) ImageReduceRowMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowMin](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmin/2942325-initwithdevice?language=objc +func NewImageReduceRowMinWithDevice(device metal.PDevice) ImageReduceRowMin { + instance := ImageReduceRowMinClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceRowMinClass) Alloc() ImageReduceRowMin { + rv := objc.Call[ImageReduceRowMin](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceRowMin_Alloc() ImageReduceRowMin { + return ImageReduceRowMinClass.Alloc() +} + +func (ic _ImageReduceRowMinClass) New() ImageReduceRowMin { + rv := objc.Call[ImageReduceRowMin](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceRowMin() ImageReduceRowMin { + return ImageReduceRowMinClass.New() +} + +func (i_ ImageReduceRowMin) Init() ImageReduceRowMin { + rv := objc.Call[ImageReduceRowMin](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceRowMin) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowMin { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowMin](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceRowMin_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowMin { + instance := ImageReduceRowMinClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_row_sum.gen.go b/macos/mps/image_reduce_row_sum.gen.go new file mode 100644 index 00000000..2dd08efc --- /dev/null +++ b/macos/mps/image_reduce_row_sum.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceRowSum] class. +var ImageReduceRowSumClass = _ImageReduceRowSumClass{objc.GetClass("MPSImageReduceRowSum")} + +type _ImageReduceRowSumClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceRowSum] class. +type IImageReduceRowSum interface { + IImageReduceUnary +} + +// A filter that returns the sum of all values for a row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowsum?language=objc +type ImageReduceRowSum struct { + ImageReduceUnary +} + +func ImageReduceRowSumFrom(ptr unsafe.Pointer) ImageReduceRowSum { + return ImageReduceRowSum{ + ImageReduceUnary: ImageReduceUnaryFrom(ptr), + } +} + +func (i_ ImageReduceRowSum) InitWithDevice(device metal.PDevice) ImageReduceRowSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowSum](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowsum/2942334-initwithdevice?language=objc +func NewImageReduceRowSumWithDevice(device metal.PDevice) ImageReduceRowSum { + instance := ImageReduceRowSumClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageReduceRowSumClass) Alloc() ImageReduceRowSum { + rv := objc.Call[ImageReduceRowSum](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceRowSum_Alloc() ImageReduceRowSum { + return ImageReduceRowSumClass.Alloc() +} + +func (ic _ImageReduceRowSumClass) New() ImageReduceRowSum { + rv := objc.Call[ImageReduceRowSum](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceRowSum() ImageReduceRowSum { + return ImageReduceRowSumClass.New() +} + +func (i_ ImageReduceRowSum) Init() ImageReduceRowSum { + rv := objc.Call[ImageReduceRowSum](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceRowSum) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowSum { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceRowSum](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceRowSum_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceRowSum { + instance := ImageReduceRowSumClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_reduce_unary.gen.go b/macos/mps/image_reduce_unary.gen.go new file mode 100644 index 00000000..cf6126cc --- /dev/null +++ b/macos/mps/image_reduce_unary.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageReduceUnary] class. +var ImageReduceUnaryClass = _ImageReduceUnaryClass{objc.GetClass("MPSImageReduceUnary")} + +type _ImageReduceUnaryClass struct { + objc.Class +} + +// An interface definition for the [ImageReduceUnary] class. +type IImageReduceUnary interface { + IUnaryImageKernel + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// The base class for reduction filters that take a single source as input. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereduceunary?language=objc +type ImageReduceUnary struct { + UnaryImageKernel +} + +func ImageReduceUnaryFrom(ptr unsafe.Pointer) ImageReduceUnary { + return ImageReduceUnary{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (ic _ImageReduceUnaryClass) Alloc() ImageReduceUnary { + rv := objc.Call[ImageReduceUnary](ic, objc.Sel("alloc")) + return rv +} + +func ImageReduceUnary_Alloc() ImageReduceUnary { + return ImageReduceUnaryClass.Alloc() +} + +func (ic _ImageReduceUnaryClass) New() ImageReduceUnary { + rv := objc.Call[ImageReduceUnary](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageReduceUnary() ImageReduceUnary { + return ImageReduceUnaryClass.New() +} + +func (i_ ImageReduceUnary) Init() ImageReduceUnary { + rv := objc.Call[ImageReduceUnary](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageReduceUnary) InitWithDevice(device metal.PDevice) ImageReduceUnary { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceUnary](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageReduceUnaryWithDevice(device metal.PDevice) ImageReduceUnary { + instance := ImageReduceUnaryClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageReduceUnary) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceUnary { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageReduceUnary](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageReduceUnary_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageReduceUnary { + instance := ImageReduceUnaryClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereduceunary/2942332-cliprectsource?language=objc +func (i_ ImageReduceUnary) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](i_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereduceunary/2942332-cliprectsource?language=objc +func (i_ ImageReduceUnary) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](i_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/image_scale.gen.go b/macos/mps/image_scale.gen.go new file mode 100644 index 00000000..00f78bd0 --- /dev/null +++ b/macos/mps/image_scale.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageScale] class. +var ImageScaleClass = _ImageScaleClass{objc.GetClass("MPSImageScale")} + +type _ImageScaleClass struct { + objc.Class +} + +// An interface definition for the [ImageScale] class. +type IImageScale interface { + IUnaryImageKernel + ScaleTransform() *ScaleTransform + SetScaleTransform(value *ScaleTransform) +} + +// A filter that resizes and changes the aspect ratio of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagescale?language=objc +type ImageScale struct { + UnaryImageKernel +} + +func ImageScaleFrom(ptr unsafe.Pointer) ImageScale { + return ImageScale{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageScale) InitWithDevice(device metal.PDevice) ImageScale { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageScale](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagescale/2881186-initwithdevice?language=objc +func NewImageScaleWithDevice(device metal.PDevice) ImageScale { + instance := ImageScaleClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageScaleClass) Alloc() ImageScale { + rv := objc.Call[ImageScale](ic, objc.Sel("alloc")) + return rv +} + +func ImageScale_Alloc() ImageScale { + return ImageScaleClass.Alloc() +} + +func (ic _ImageScaleClass) New() ImageScale { + rv := objc.Call[ImageScale](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageScale() ImageScale { + return ImageScaleClass.New() +} + +func (i_ ImageScale) Init() ImageScale { + rv := objc.Call[ImageScale](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageScale) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageScale { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageScale](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageScale_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageScale { + instance := ImageScaleClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagescale/2881183-scaletransform?language=objc +func (i_ ImageScale) ScaleTransform() *ScaleTransform { + rv := objc.Call[*ScaleTransform](i_, objc.Sel("scaleTransform")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagescale/2881183-scaletransform?language=objc +func (i_ ImageScale) SetScaleTransform(value *ScaleTransform) { + objc.Call[objc.Void](i_, objc.Sel("setScaleTransform:"), value) +} diff --git a/macos/mps/image_size_encoding_state.gen.go b/macos/mps/image_size_encoding_state.gen.go new file mode 100644 index 00000000..560569ea --- /dev/null +++ b/macos/mps/image_size_encoding_state.gen.go @@ -0,0 +1,49 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol for objects that contain information about an image size elsewhere in the graph. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesizeencodingstate?language=objc +type PImageSizeEncodingState interface { + // optional + SourceWidth() uint + HasSourceWidth() bool + + // optional + SourceHeight() uint + HasSourceHeight() bool +} + +// A concrete type wrapper for the [PImageSizeEncodingState] protocol. +type ImageSizeEncodingStateWrapper struct { + objc.Object +} + +func (i_ ImageSizeEncodingStateWrapper) HasSourceWidth() bool { + return i_.RespondsToSelector(objc.Sel("sourceWidth")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesizeencodingstate/2873364-sourcewidth?language=objc +func (i_ ImageSizeEncodingStateWrapper) SourceWidth() uint { + rv := objc.Call[uint](i_, objc.Sel("sourceWidth")) + return rv +} + +func (i_ ImageSizeEncodingStateWrapper) HasSourceHeight() bool { + return i_.RespondsToSelector(objc.Sel("sourceHeight")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesizeencodingstate/2873329-sourceheight?language=objc +func (i_ ImageSizeEncodingStateWrapper) SourceHeight() uint { + rv := objc.Call[uint](i_, objc.Sel("sourceHeight")) + return rv +} diff --git a/macos/mps/image_sobel.gen.go b/macos/mps/image_sobel.gen.go new file mode 100644 index 00000000..fea0746b --- /dev/null +++ b/macos/mps/image_sobel.gen.go @@ -0,0 +1,99 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageSobel] class. +var ImageSobelClass = _ImageSobelClass{objc.GetClass("MPSImageSobel")} + +type _ImageSobelClass struct { + objc.Class +} + +// An interface definition for the [ImageSobel] class. +type IImageSobel interface { + IUnaryImageKernel + ColorTransform() *float64 +} + +// A filter that convolves an image with the Sobel operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesobel?language=objc +type ImageSobel struct { + UnaryImageKernel +} + +func ImageSobelFrom(ptr unsafe.Pointer) ImageSobel { + return ImageSobel{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageSobel) InitWithDevice(device metal.PDevice) ImageSobel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageSobel](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a Sobel filter on a given device using the default color transform. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesobel/1618843-initwithdevice?language=objc +func NewImageSobelWithDevice(device metal.PDevice) ImageSobel { + instance := ImageSobelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageSobelClass) Alloc() ImageSobel { + rv := objc.Call[ImageSobel](ic, objc.Sel("alloc")) + return rv +} + +func ImageSobel_Alloc() ImageSobel { + return ImageSobelClass.Alloc() +} + +func (ic _ImageSobelClass) New() ImageSobel { + rv := objc.Call[ImageSobel](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageSobel() ImageSobel { + return ImageSobelClass.New() +} + +func (i_ ImageSobel) Init() ImageSobel { + rv := objc.Call[ImageSobel](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageSobel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageSobel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageSobel](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageSobel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageSobel { + instance := ImageSobelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The color transform used to initialize the Sobel filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesobel/1618777-colortransform?language=objc +func (i_ ImageSobel) ColorTransform() *float64 { + rv := objc.Call[*float64](i_, objc.Sel("colorTransform")) + return rv +} diff --git a/macos/mps/image_statistics_mean.gen.go b/macos/mps/image_statistics_mean.gen.go new file mode 100644 index 00000000..9fb0dd37 --- /dev/null +++ b/macos/mps/image_statistics_mean.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageStatisticsMean] class. +var ImageStatisticsMeanClass = _ImageStatisticsMeanClass{objc.GetClass("MPSImageStatisticsMean")} + +type _ImageStatisticsMeanClass struct { + objc.Class +} + +// An interface definition for the [ImageStatisticsMean] class. +type IImageStatisticsMean interface { + IUnaryImageKernel + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// A kernel that computes the mean for a given region of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmean?language=objc +type ImageStatisticsMean struct { + UnaryImageKernel +} + +func ImageStatisticsMeanFrom(ptr unsafe.Pointer) ImageStatisticsMean { + return ImageStatisticsMean{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageStatisticsMean) InitWithDevice(device metal.PDevice) ImageStatisticsMean { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageStatisticsMean](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmean/2867156-initwithdevice?language=objc +func NewImageStatisticsMeanWithDevice(device metal.PDevice) ImageStatisticsMean { + instance := ImageStatisticsMeanClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageStatisticsMeanClass) Alloc() ImageStatisticsMean { + rv := objc.Call[ImageStatisticsMean](ic, objc.Sel("alloc")) + return rv +} + +func ImageStatisticsMean_Alloc() ImageStatisticsMean { + return ImageStatisticsMeanClass.Alloc() +} + +func (ic _ImageStatisticsMeanClass) New() ImageStatisticsMean { + rv := objc.Call[ImageStatisticsMean](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageStatisticsMean() ImageStatisticsMean { + return ImageStatisticsMeanClass.New() +} + +func (i_ ImageStatisticsMean) Init() ImageStatisticsMean { + rv := objc.Call[ImageStatisticsMean](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageStatisticsMean) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageStatisticsMean { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageStatisticsMean](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageStatisticsMean_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageStatisticsMean { + instance := ImageStatisticsMeanClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmean/2867093-cliprectsource?language=objc +func (i_ ImageStatisticsMean) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](i_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmean/2867093-cliprectsource?language=objc +func (i_ ImageStatisticsMean) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](i_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/image_statistics_mean_and_variance.gen.go b/macos/mps/image_statistics_mean_and_variance.gen.go new file mode 100644 index 00000000..d4a140ee --- /dev/null +++ b/macos/mps/image_statistics_mean_and_variance.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageStatisticsMeanAndVariance] class. +var ImageStatisticsMeanAndVarianceClass = _ImageStatisticsMeanAndVarianceClass{objc.GetClass("MPSImageStatisticsMeanAndVariance")} + +type _ImageStatisticsMeanAndVarianceClass struct { + objc.Class +} + +// An interface definition for the [ImageStatisticsMeanAndVariance] class. +type IImageStatisticsMeanAndVariance interface { + IUnaryImageKernel + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// A kernel that computes the mean and variance for a given region of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmeanandvariance?language=objc +type ImageStatisticsMeanAndVariance struct { + UnaryImageKernel +} + +func ImageStatisticsMeanAndVarianceFrom(ptr unsafe.Pointer) ImageStatisticsMeanAndVariance { + return ImageStatisticsMeanAndVariance{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageStatisticsMeanAndVariance) InitWithDevice(device metal.PDevice) ImageStatisticsMeanAndVariance { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageStatisticsMeanAndVariance](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmeanandvariance/2867165-initwithdevice?language=objc +func NewImageStatisticsMeanAndVarianceWithDevice(device metal.PDevice) ImageStatisticsMeanAndVariance { + instance := ImageStatisticsMeanAndVarianceClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageStatisticsMeanAndVarianceClass) Alloc() ImageStatisticsMeanAndVariance { + rv := objc.Call[ImageStatisticsMeanAndVariance](ic, objc.Sel("alloc")) + return rv +} + +func ImageStatisticsMeanAndVariance_Alloc() ImageStatisticsMeanAndVariance { + return ImageStatisticsMeanAndVarianceClass.Alloc() +} + +func (ic _ImageStatisticsMeanAndVarianceClass) New() ImageStatisticsMeanAndVariance { + rv := objc.Call[ImageStatisticsMeanAndVariance](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageStatisticsMeanAndVariance() ImageStatisticsMeanAndVariance { + return ImageStatisticsMeanAndVarianceClass.New() +} + +func (i_ ImageStatisticsMeanAndVariance) Init() ImageStatisticsMeanAndVariance { + rv := objc.Call[ImageStatisticsMeanAndVariance](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageStatisticsMeanAndVariance) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageStatisticsMeanAndVariance { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageStatisticsMeanAndVariance](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageStatisticsMeanAndVariance_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageStatisticsMeanAndVariance { + instance := ImageStatisticsMeanAndVarianceClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmeanandvariance/2867131-cliprectsource?language=objc +func (i_ ImageStatisticsMeanAndVariance) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](i_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsmeanandvariance/2867131-cliprectsource?language=objc +func (i_ ImageStatisticsMeanAndVariance) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](i_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/image_statistics_min_and_max.gen.go b/macos/mps/image_statistics_min_and_max.gen.go new file mode 100644 index 00000000..e4d20551 --- /dev/null +++ b/macos/mps/image_statistics_min_and_max.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageStatisticsMinAndMax] class. +var ImageStatisticsMinAndMaxClass = _ImageStatisticsMinAndMaxClass{objc.GetClass("MPSImageStatisticsMinAndMax")} + +type _ImageStatisticsMinAndMaxClass struct { + objc.Class +} + +// An interface definition for the [ImageStatisticsMinAndMax] class. +type IImageStatisticsMinAndMax interface { + IUnaryImageKernel + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// A kernel that computes the minimum and maximum pixel values for a given region of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsminandmax?language=objc +type ImageStatisticsMinAndMax struct { + UnaryImageKernel +} + +func ImageStatisticsMinAndMaxFrom(ptr unsafe.Pointer) ImageStatisticsMinAndMax { + return ImageStatisticsMinAndMax{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageStatisticsMinAndMax) InitWithDevice(device metal.PDevice) ImageStatisticsMinAndMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageStatisticsMinAndMax](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsminandmax/2867125-initwithdevice?language=objc +func NewImageStatisticsMinAndMaxWithDevice(device metal.PDevice) ImageStatisticsMinAndMax { + instance := ImageStatisticsMinAndMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageStatisticsMinAndMaxClass) Alloc() ImageStatisticsMinAndMax { + rv := objc.Call[ImageStatisticsMinAndMax](ic, objc.Sel("alloc")) + return rv +} + +func ImageStatisticsMinAndMax_Alloc() ImageStatisticsMinAndMax { + return ImageStatisticsMinAndMaxClass.Alloc() +} + +func (ic _ImageStatisticsMinAndMaxClass) New() ImageStatisticsMinAndMax { + rv := objc.Call[ImageStatisticsMinAndMax](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageStatisticsMinAndMax() ImageStatisticsMinAndMax { + return ImageStatisticsMinAndMaxClass.New() +} + +func (i_ ImageStatisticsMinAndMax) Init() ImageStatisticsMinAndMax { + rv := objc.Call[ImageStatisticsMinAndMax](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageStatisticsMinAndMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageStatisticsMinAndMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageStatisticsMinAndMax](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageStatisticsMinAndMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageStatisticsMinAndMax { + instance := ImageStatisticsMinAndMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsminandmax/2867045-cliprectsource?language=objc +func (i_ ImageStatisticsMinAndMax) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](i_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagestatisticsminandmax/2867045-cliprectsource?language=objc +func (i_ ImageStatisticsMinAndMax) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](i_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/image_subtract.gen.go b/macos/mps/image_subtract.gen.go new file mode 100644 index 00000000..3392df23 --- /dev/null +++ b/macos/mps/image_subtract.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageSubtract] class. +var ImageSubtractClass = _ImageSubtractClass{objc.GetClass("MPSImageSubtract")} + +type _ImageSubtractClass struct { + objc.Class +} + +// An interface definition for the [ImageSubtract] class. +type IImageSubtract interface { + IImageArithmetic +} + +// A filter that returns the element-wise difference of its two input images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesubtract?language=objc +type ImageSubtract struct { + ImageArithmetic +} + +func ImageSubtractFrom(ptr unsafe.Pointer) ImageSubtract { + return ImageSubtract{ + ImageArithmetic: ImageArithmeticFrom(ptr), + } +} + +func (i_ ImageSubtract) InitWithDevice(device metal.PDevice) ImageSubtract { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageSubtract](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagesubtract/2866613-initwithdevice?language=objc +func NewImageSubtractWithDevice(device metal.PDevice) ImageSubtract { + instance := ImageSubtractClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (ic _ImageSubtractClass) Alloc() ImageSubtract { + rv := objc.Call[ImageSubtract](ic, objc.Sel("alloc")) + return rv +} + +func ImageSubtract_Alloc() ImageSubtract { + return ImageSubtractClass.Alloc() +} + +func (ic _ImageSubtractClass) New() ImageSubtract { + rv := objc.Call[ImageSubtract](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageSubtract() ImageSubtract { + return ImageSubtractClass.New() +} + +func (i_ ImageSubtract) Init() ImageSubtract { + rv := objc.Call[ImageSubtract](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageSubtract) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageSubtract { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageSubtract](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageSubtract_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageSubtract { + instance := ImageSubtractClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_tent.gen.go b/macos/mps/image_tent.gen.go new file mode 100644 index 00000000..ec2e2f88 --- /dev/null +++ b/macos/mps/image_tent.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageTent] class. +var ImageTentClass = _ImageTentClass{objc.GetClass("MPSImageTent")} + +type _ImageTentClass struct { + objc.Class +} + +// An interface definition for the [ImageTent] class. +type IImageTent interface { + IImageBox +} + +// A filter that convolves an image with a tent filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagetent?language=objc +type ImageTent struct { + ImageBox +} + +func ImageTentFrom(ptr unsafe.Pointer) ImageTent { + return ImageTent{ + ImageBox: ImageBoxFrom(ptr), + } +} + +func (ic _ImageTentClass) Alloc() ImageTent { + rv := objc.Call[ImageTent](ic, objc.Sel("alloc")) + return rv +} + +func ImageTent_Alloc() ImageTent { + return ImageTentClass.Alloc() +} + +func (ic _ImageTentClass) New() ImageTent { + rv := objc.Call[ImageTent](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageTent() ImageTent { + return ImageTentClass.New() +} + +func (i_ ImageTent) Init() ImageTent { + rv := objc.Call[ImageTent](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageTent) InitWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageTent { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageTent](i_, objc.Sel("initWithDevice:kernelWidth:kernelHeight:"), po0, kernelWidth, kernelHeight) + return rv +} + +// Initializes a box filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagebox/1618789-initwithdevice?language=objc +func NewImageTentWithDeviceKernelWidthKernelHeight(device metal.PDevice, kernelWidth uint, kernelHeight uint) ImageTent { + instance := ImageTentClass.Alloc().InitWithDeviceKernelWidthKernelHeight(device, kernelWidth, kernelHeight) + instance.Autorelease() + return instance +} + +func (i_ ImageTent) InitWithDevice(device metal.PDevice) ImageTent { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageTent](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageTentWithDevice(device metal.PDevice) ImageTent { + instance := ImageTentClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageTent) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageTent { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageTent](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageTent_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageTent { + instance := ImageTentClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/image_threshold_binary.gen.go b/macos/mps/image_threshold_binary.gen.go new file mode 100644 index 00000000..85a6374f --- /dev/null +++ b/macos/mps/image_threshold_binary.gen.go @@ -0,0 +1,132 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageThresholdBinary] class. +var ImageThresholdBinaryClass = _ImageThresholdBinaryClass{objc.GetClass("MPSImageThresholdBinary")} + +type _ImageThresholdBinaryClass struct { + objc.Class +} + +// An interface definition for the [ImageThresholdBinary] class. +type IImageThresholdBinary interface { + IUnaryImageKernel + MaximumValue() float64 + Transform() *float64 + ThresholdValue() float64 +} + +// A filter that returns a specified value for each pixel with a value greater than a specified threshold or 0 otherwise. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinary?language=objc +type ImageThresholdBinary struct { + UnaryImageKernel +} + +func ImageThresholdBinaryFrom(ptr unsafe.Pointer) ImageThresholdBinary { + return ImageThresholdBinary{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageThresholdBinary) InitWithDeviceThresholdValueMaximumValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, maximumValue float64, transform *float64) ImageThresholdBinary { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdBinary](i_, objc.Sel("initWithDevice:thresholdValue:maximumValue:linearGrayColorTransform:"), po0, thresholdValue, maximumValue, transform) + return rv +} + +// Initializes the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinary/1618855-initwithdevice?language=objc +func NewImageThresholdBinaryWithDeviceThresholdValueMaximumValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, maximumValue float64, transform *float64) ImageThresholdBinary { + instance := ImageThresholdBinaryClass.Alloc().InitWithDeviceThresholdValueMaximumValueLinearGrayColorTransform(device, thresholdValue, maximumValue, transform) + instance.Autorelease() + return instance +} + +func (ic _ImageThresholdBinaryClass) Alloc() ImageThresholdBinary { + rv := objc.Call[ImageThresholdBinary](ic, objc.Sel("alloc")) + return rv +} + +func ImageThresholdBinary_Alloc() ImageThresholdBinary { + return ImageThresholdBinaryClass.Alloc() +} + +func (ic _ImageThresholdBinaryClass) New() ImageThresholdBinary { + rv := objc.Call[ImageThresholdBinary](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageThresholdBinary() ImageThresholdBinary { + return ImageThresholdBinaryClass.New() +} + +func (i_ ImageThresholdBinary) Init() ImageThresholdBinary { + rv := objc.Call[ImageThresholdBinary](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageThresholdBinary) InitWithDevice(device metal.PDevice) ImageThresholdBinary { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdBinary](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageThresholdBinaryWithDevice(device metal.PDevice) ImageThresholdBinary { + instance := ImageThresholdBinaryClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageThresholdBinary) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdBinary { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdBinary](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageThresholdBinary_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdBinary { + instance := ImageThresholdBinaryClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The maximum value used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinary/1618852-maximumvalue?language=objc +func (i_ ImageThresholdBinary) MaximumValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("maximumValue")) + return rv +} + +// The color transform used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinary/1618744-transform?language=objc +func (i_ ImageThresholdBinary) Transform() *float64 { + rv := objc.Call[*float64](i_, objc.Sel("transform")) + return rv +} + +// The threshold value used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinary/1618851-thresholdvalue?language=objc +func (i_ ImageThresholdBinary) ThresholdValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("thresholdValue")) + return rv +} diff --git a/macos/mps/image_threshold_binary_inverse.gen.go b/macos/mps/image_threshold_binary_inverse.gen.go new file mode 100644 index 00000000..4ffcd015 --- /dev/null +++ b/macos/mps/image_threshold_binary_inverse.gen.go @@ -0,0 +1,132 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageThresholdBinaryInverse] class. +var ImageThresholdBinaryInverseClass = _ImageThresholdBinaryInverseClass{objc.GetClass("MPSImageThresholdBinaryInverse")} + +type _ImageThresholdBinaryInverseClass struct { + objc.Class +} + +// An interface definition for the [ImageThresholdBinaryInverse] class. +type IImageThresholdBinaryInverse interface { + IUnaryImageKernel + MaximumValue() float64 + Transform() *float64 + ThresholdValue() float64 +} + +// A filter that returns 0 for each pixel with a value greater than a specified threshold or a specified value otherwise. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinaryinverse?language=objc +type ImageThresholdBinaryInverse struct { + UnaryImageKernel +} + +func ImageThresholdBinaryInverseFrom(ptr unsafe.Pointer) ImageThresholdBinaryInverse { + return ImageThresholdBinaryInverse{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageThresholdBinaryInverse) InitWithDeviceThresholdValueMaximumValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, maximumValue float64, transform *float64) ImageThresholdBinaryInverse { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdBinaryInverse](i_, objc.Sel("initWithDevice:thresholdValue:maximumValue:linearGrayColorTransform:"), po0, thresholdValue, maximumValue, transform) + return rv +} + +// Initializes the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinaryinverse/1618903-initwithdevice?language=objc +func NewImageThresholdBinaryInverseWithDeviceThresholdValueMaximumValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, maximumValue float64, transform *float64) ImageThresholdBinaryInverse { + instance := ImageThresholdBinaryInverseClass.Alloc().InitWithDeviceThresholdValueMaximumValueLinearGrayColorTransform(device, thresholdValue, maximumValue, transform) + instance.Autorelease() + return instance +} + +func (ic _ImageThresholdBinaryInverseClass) Alloc() ImageThresholdBinaryInverse { + rv := objc.Call[ImageThresholdBinaryInverse](ic, objc.Sel("alloc")) + return rv +} + +func ImageThresholdBinaryInverse_Alloc() ImageThresholdBinaryInverse { + return ImageThresholdBinaryInverseClass.Alloc() +} + +func (ic _ImageThresholdBinaryInverseClass) New() ImageThresholdBinaryInverse { + rv := objc.Call[ImageThresholdBinaryInverse](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageThresholdBinaryInverse() ImageThresholdBinaryInverse { + return ImageThresholdBinaryInverseClass.New() +} + +func (i_ ImageThresholdBinaryInverse) Init() ImageThresholdBinaryInverse { + rv := objc.Call[ImageThresholdBinaryInverse](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageThresholdBinaryInverse) InitWithDevice(device metal.PDevice) ImageThresholdBinaryInverse { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdBinaryInverse](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageThresholdBinaryInverseWithDevice(device metal.PDevice) ImageThresholdBinaryInverse { + instance := ImageThresholdBinaryInverseClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageThresholdBinaryInverse) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdBinaryInverse { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdBinaryInverse](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageThresholdBinaryInverse_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdBinaryInverse { + instance := ImageThresholdBinaryInverseClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The maximum value used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinaryinverse/1618906-maximumvalue?language=objc +func (i_ ImageThresholdBinaryInverse) MaximumValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("maximumValue")) + return rv +} + +// The color transform used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinaryinverse/1618904-transform?language=objc +func (i_ ImageThresholdBinaryInverse) Transform() *float64 { + rv := objc.Call[*float64](i_, objc.Sel("transform")) + return rv +} + +// The threshold value used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdbinaryinverse/1618845-thresholdvalue?language=objc +func (i_ ImageThresholdBinaryInverse) ThresholdValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("thresholdValue")) + return rv +} diff --git a/macos/mps/image_threshold_to_zero.gen.go b/macos/mps/image_threshold_to_zero.gen.go new file mode 100644 index 00000000..8f42f1e4 --- /dev/null +++ b/macos/mps/image_threshold_to_zero.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageThresholdToZero] class. +var ImageThresholdToZeroClass = _ImageThresholdToZeroClass{objc.GetClass("MPSImageThresholdToZero")} + +type _ImageThresholdToZeroClass struct { + objc.Class +} + +// An interface definition for the [ImageThresholdToZero] class. +type IImageThresholdToZero interface { + IUnaryImageKernel + Transform() *float64 + ThresholdValue() float64 +} + +// A filter that returns the original value for each pixel with a value greater than a specified threshold or 0 otherwise. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozero?language=objc +type ImageThresholdToZero struct { + UnaryImageKernel +} + +func ImageThresholdToZeroFrom(ptr unsafe.Pointer) ImageThresholdToZero { + return ImageThresholdToZero{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageThresholdToZero) InitWithDeviceThresholdValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, transform *float64) ImageThresholdToZero { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdToZero](i_, objc.Sel("initWithDevice:thresholdValue:linearGrayColorTransform:"), po0, thresholdValue, transform) + return rv +} + +// Initializes the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozero/1618865-initwithdevice?language=objc +func NewImageThresholdToZeroWithDeviceThresholdValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, transform *float64) ImageThresholdToZero { + instance := ImageThresholdToZeroClass.Alloc().InitWithDeviceThresholdValueLinearGrayColorTransform(device, thresholdValue, transform) + instance.Autorelease() + return instance +} + +func (ic _ImageThresholdToZeroClass) Alloc() ImageThresholdToZero { + rv := objc.Call[ImageThresholdToZero](ic, objc.Sel("alloc")) + return rv +} + +func ImageThresholdToZero_Alloc() ImageThresholdToZero { + return ImageThresholdToZeroClass.Alloc() +} + +func (ic _ImageThresholdToZeroClass) New() ImageThresholdToZero { + rv := objc.Call[ImageThresholdToZero](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageThresholdToZero() ImageThresholdToZero { + return ImageThresholdToZeroClass.New() +} + +func (i_ ImageThresholdToZero) Init() ImageThresholdToZero { + rv := objc.Call[ImageThresholdToZero](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageThresholdToZero) InitWithDevice(device metal.PDevice) ImageThresholdToZero { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdToZero](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageThresholdToZeroWithDevice(device metal.PDevice) ImageThresholdToZero { + instance := ImageThresholdToZeroClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageThresholdToZero) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdToZero { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdToZero](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageThresholdToZero_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdToZero { + instance := ImageThresholdToZeroClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The color transform used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozero/1618823-transform?language=objc +func (i_ ImageThresholdToZero) Transform() *float64 { + rv := objc.Call[*float64](i_, objc.Sel("transform")) + return rv +} + +// The threshold value used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozero/1618767-thresholdvalue?language=objc +func (i_ ImageThresholdToZero) ThresholdValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("thresholdValue")) + return rv +} diff --git a/macos/mps/image_threshold_to_zero_inverse.gen.go b/macos/mps/image_threshold_to_zero_inverse.gen.go new file mode 100644 index 00000000..36ab6b90 --- /dev/null +++ b/macos/mps/image_threshold_to_zero_inverse.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageThresholdToZeroInverse] class. +var ImageThresholdToZeroInverseClass = _ImageThresholdToZeroInverseClass{objc.GetClass("MPSImageThresholdToZeroInverse")} + +type _ImageThresholdToZeroInverseClass struct { + objc.Class +} + +// An interface definition for the [ImageThresholdToZeroInverse] class. +type IImageThresholdToZeroInverse interface { + IUnaryImageKernel + Transform() *float64 + ThresholdValue() float64 +} + +// A filter that returns 0 for each pixel with a value greater than a specified threshold or the original value otherwise. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozeroinverse?language=objc +type ImageThresholdToZeroInverse struct { + UnaryImageKernel +} + +func ImageThresholdToZeroInverseFrom(ptr unsafe.Pointer) ImageThresholdToZeroInverse { + return ImageThresholdToZeroInverse{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageThresholdToZeroInverse) InitWithDeviceThresholdValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, transform *float64) ImageThresholdToZeroInverse { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdToZeroInverse](i_, objc.Sel("initWithDevice:thresholdValue:linearGrayColorTransform:"), po0, thresholdValue, transform) + return rv +} + +// Initializes the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozeroinverse/1618911-initwithdevice?language=objc +func NewImageThresholdToZeroInverseWithDeviceThresholdValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, transform *float64) ImageThresholdToZeroInverse { + instance := ImageThresholdToZeroInverseClass.Alloc().InitWithDeviceThresholdValueLinearGrayColorTransform(device, thresholdValue, transform) + instance.Autorelease() + return instance +} + +func (ic _ImageThresholdToZeroInverseClass) Alloc() ImageThresholdToZeroInverse { + rv := objc.Call[ImageThresholdToZeroInverse](ic, objc.Sel("alloc")) + return rv +} + +func ImageThresholdToZeroInverse_Alloc() ImageThresholdToZeroInverse { + return ImageThresholdToZeroInverseClass.Alloc() +} + +func (ic _ImageThresholdToZeroInverseClass) New() ImageThresholdToZeroInverse { + rv := objc.Call[ImageThresholdToZeroInverse](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageThresholdToZeroInverse() ImageThresholdToZeroInverse { + return ImageThresholdToZeroInverseClass.New() +} + +func (i_ ImageThresholdToZeroInverse) Init() ImageThresholdToZeroInverse { + rv := objc.Call[ImageThresholdToZeroInverse](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageThresholdToZeroInverse) InitWithDevice(device metal.PDevice) ImageThresholdToZeroInverse { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdToZeroInverse](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageThresholdToZeroInverseWithDevice(device metal.PDevice) ImageThresholdToZeroInverse { + instance := ImageThresholdToZeroInverseClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageThresholdToZeroInverse) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdToZeroInverse { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdToZeroInverse](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageThresholdToZeroInverse_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdToZeroInverse { + instance := ImageThresholdToZeroInverseClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The color transform used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozeroinverse/1618828-transform?language=objc +func (i_ ImageThresholdToZeroInverse) Transform() *float64 { + rv := objc.Call[*float64](i_, objc.Sel("transform")) + return rv +} + +// The threshold value used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtozeroinverse/1618914-thresholdvalue?language=objc +func (i_ ImageThresholdToZeroInverse) ThresholdValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("thresholdValue")) + return rv +} diff --git a/macos/mps/image_threshold_truncate.gen.go b/macos/mps/image_threshold_truncate.gen.go new file mode 100644 index 00000000..96dacbca --- /dev/null +++ b/macos/mps/image_threshold_truncate.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageThresholdTruncate] class. +var ImageThresholdTruncateClass = _ImageThresholdTruncateClass{objc.GetClass("MPSImageThresholdTruncate")} + +type _ImageThresholdTruncateClass struct { + objc.Class +} + +// An interface definition for the [ImageThresholdTruncate] class. +type IImageThresholdTruncate interface { + IUnaryImageKernel + Transform() *float64 + ThresholdValue() float64 +} + +// A filter that clamps the return value to an upper specified value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtruncate?language=objc +type ImageThresholdTruncate struct { + UnaryImageKernel +} + +func ImageThresholdTruncateFrom(ptr unsafe.Pointer) ImageThresholdTruncate { + return ImageThresholdTruncate{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (i_ ImageThresholdTruncate) InitWithDeviceThresholdValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, transform *float64) ImageThresholdTruncate { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdTruncate](i_, objc.Sel("initWithDevice:thresholdValue:linearGrayColorTransform:"), po0, thresholdValue, transform) + return rv +} + +// Initializes the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtruncate/1618818-initwithdevice?language=objc +func NewImageThresholdTruncateWithDeviceThresholdValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float64, transform *float64) ImageThresholdTruncate { + instance := ImageThresholdTruncateClass.Alloc().InitWithDeviceThresholdValueLinearGrayColorTransform(device, thresholdValue, transform) + instance.Autorelease() + return instance +} + +func (ic _ImageThresholdTruncateClass) Alloc() ImageThresholdTruncate { + rv := objc.Call[ImageThresholdTruncate](ic, objc.Sel("alloc")) + return rv +} + +func ImageThresholdTruncate_Alloc() ImageThresholdTruncate { + return ImageThresholdTruncateClass.Alloc() +} + +func (ic _ImageThresholdTruncateClass) New() ImageThresholdTruncate { + rv := objc.Call[ImageThresholdTruncate](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageThresholdTruncate() ImageThresholdTruncate { + return ImageThresholdTruncateClass.New() +} + +func (i_ ImageThresholdTruncate) Init() ImageThresholdTruncate { + rv := objc.Call[ImageThresholdTruncate](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageThresholdTruncate) InitWithDevice(device metal.PDevice) ImageThresholdTruncate { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdTruncate](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageThresholdTruncateWithDevice(device metal.PDevice) ImageThresholdTruncate { + instance := ImageThresholdTruncateClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageThresholdTruncate) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdTruncate { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageThresholdTruncate](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageThresholdTruncate_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdTruncate { + instance := ImageThresholdTruncateClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// The color transform used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtruncate/1618787-transform?language=objc +func (i_ ImageThresholdTruncate) Transform() *float64 { + rv := objc.Call[*float64](i_, objc.Sel("transform")) + return rv +} + +// The threshold value used to initialize the threshold filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtruncate/1618882-thresholdvalue?language=objc +func (i_ ImageThresholdTruncate) ThresholdValue() float64 { + rv := objc.Call[float64](i_, objc.Sel("thresholdValue")) + return rv +} diff --git a/macos/mps/image_transform_provider.gen.go b/macos/mps/image_transform_provider.gen.go new file mode 100644 index 00000000..e8adb7e8 --- /dev/null +++ b/macos/mps/image_transform_provider.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/objc" +) + +// A general interface for objects that provide image resampling. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagetransformprovider?language=objc +type PImageTransformProvider interface { + // optional + TransformForSourceImageHandle(image Image, handle HandleWrapper) ScaleTransform + HasTransformForSourceImageHandle() bool +} + +// A concrete type wrapper for the [PImageTransformProvider] protocol. +type ImageTransformProviderWrapper struct { + objc.Object +} + +func (i_ ImageTransformProviderWrapper) HasTransformForSourceImageHandle() bool { + return i_.RespondsToSelector(objc.Sel("transformForSourceImage:handle:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagetransformprovider/2915282-transformforsourceimage?language=objc +func (i_ ImageTransformProviderWrapper) TransformForSourceImageHandle(image IImage, handle PHandle) ScaleTransform { + po1 := objc.WrapAsProtocol("MPSHandle", handle) + rv := objc.Call[ScaleTransform](i_, objc.Sel("transformForSourceImage:handle:"), objc.Ptr(image), po1) + return rv +} diff --git a/macos/mps/image_transpose.gen.go b/macos/mps/image_transpose.gen.go new file mode 100644 index 00000000..461435d9 --- /dev/null +++ b/macos/mps/image_transpose.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageTranspose] class. +var ImageTransposeClass = _ImageTransposeClass{objc.GetClass("MPSImageTranspose")} + +type _ImageTransposeClass struct { + objc.Class +} + +// An interface definition for the [ImageTranspose] class. +type IImageTranspose interface { + IUnaryImageKernel +} + +// A filter that transposes an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagetranspose?language=objc +type ImageTranspose struct { + UnaryImageKernel +} + +func ImageTransposeFrom(ptr unsafe.Pointer) ImageTranspose { + return ImageTranspose{ + UnaryImageKernel: UnaryImageKernelFrom(ptr), + } +} + +func (ic _ImageTransposeClass) Alloc() ImageTranspose { + rv := objc.Call[ImageTranspose](ic, objc.Sel("alloc")) + return rv +} + +func ImageTranspose_Alloc() ImageTranspose { + return ImageTransposeClass.Alloc() +} + +func (ic _ImageTransposeClass) New() ImageTranspose { + rv := objc.Call[ImageTranspose](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageTranspose() ImageTranspose { + return ImageTransposeClass.New() +} + +func (i_ ImageTranspose) Init() ImageTranspose { + rv := objc.Call[ImageTranspose](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageTranspose) InitWithDevice(device metal.PDevice) ImageTranspose { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageTranspose](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewImageTransposeWithDevice(device metal.PDevice) ImageTranspose { + instance := ImageTransposeClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ ImageTranspose) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageTranspose { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[ImageTranspose](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func ImageTranspose_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageTranspose { + instance := ImageTransposeClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/instance_acceleration_structure.gen.go b/macos/mps/instance_acceleration_structure.gen.go new file mode 100644 index 00000000..58665a3d --- /dev/null +++ b/macos/mps/instance_acceleration_structure.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [InstanceAccelerationStructure] class. +var InstanceAccelerationStructureClass = _InstanceAccelerationStructureClass{objc.GetClass("MPSInstanceAccelerationStructure")} + +type _InstanceAccelerationStructureClass struct { + objc.Class +} + +// An interface definition for the [InstanceAccelerationStructure] class. +type IInstanceAccelerationStructure interface { + IAccelerationStructure +} + +// An acceleration structure built over instances of other acceleration structures. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsinstanceaccelerationstructure?language=objc +type InstanceAccelerationStructure struct { + AccelerationStructure +} + +func InstanceAccelerationStructureFrom(ptr unsafe.Pointer) InstanceAccelerationStructure { + return InstanceAccelerationStructure{ + AccelerationStructure: AccelerationStructureFrom(ptr), + } +} + +func (ic _InstanceAccelerationStructureClass) Alloc() InstanceAccelerationStructure { + rv := objc.Call[InstanceAccelerationStructure](ic, objc.Sel("alloc")) + return rv +} + +func InstanceAccelerationStructure_Alloc() InstanceAccelerationStructure { + return InstanceAccelerationStructureClass.Alloc() +} + +func (ic _InstanceAccelerationStructureClass) New() InstanceAccelerationStructure { + rv := objc.Call[InstanceAccelerationStructure](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewInstanceAccelerationStructure() InstanceAccelerationStructure { + return InstanceAccelerationStructureClass.New() +} + +func (i_ InstanceAccelerationStructure) Init() InstanceAccelerationStructure { + rv := objc.Call[InstanceAccelerationStructure](i_, objc.Sel("init")) + return rv +} + +func (i_ InstanceAccelerationStructure) InitWithDevice(device metal.PDevice) InstanceAccelerationStructure { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[InstanceAccelerationStructure](i_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewInstanceAccelerationStructureWithDevice(device metal.PDevice) InstanceAccelerationStructure { + instance := InstanceAccelerationStructureClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (i_ InstanceAccelerationStructure) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) InstanceAccelerationStructure { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[InstanceAccelerationStructure](i_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func InstanceAccelerationStructure_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) InstanceAccelerationStructure { + instance := InstanceAccelerationStructureClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/kernel.gen.go b/macos/mps/kernel.gen.go new file mode 100644 index 00000000..787f7ee3 --- /dev/null +++ b/macos/mps/kernel.gen.go @@ -0,0 +1,133 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Kernel] class. +var KernelClass = _KernelClass{objc.GetClass("MPSKernel")} + +type _KernelClass struct { + objc.Class +} + +// An interface definition for the [Kernel] class. +type IKernel interface { + objc.IObject + Options() KernelOptions + SetOptions(value KernelOptions) + Device() metal.DeviceWrapper + Label() string + SetLabel(value string) +} + +// A standard interface for Metal Performance Shaders kernels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel?language=objc +type Kernel struct { + objc.Object +} + +func KernelFrom(ptr unsafe.Pointer) Kernel { + return Kernel{ + Object: objc.ObjectFrom(ptr), + } +} + +func (k_ Kernel) InitWithDevice(device metal.PDevice) Kernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[Kernel](k_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewKernelWithDevice(device metal.PDevice) Kernel { + instance := KernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (k_ Kernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) Kernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[Kernel](k_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func Kernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) Kernel { + instance := KernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (kc _KernelClass) Alloc() Kernel { + rv := objc.Call[Kernel](kc, objc.Sel("alloc")) + return rv +} + +func Kernel_Alloc() Kernel { + return KernelClass.Alloc() +} + +func (kc _KernelClass) New() Kernel { + rv := objc.Call[Kernel](kc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewKernel() Kernel { + return KernelClass.New() +} + +func (k_ Kernel) Init() Kernel { + rv := objc.Call[Kernel](k_, objc.Sel("init")) + return rv +} + +// The set of options used to run the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618889-options?language=objc +func (k_ Kernel) Options() KernelOptions { + rv := objc.Call[KernelOptions](k_, objc.Sel("options")) + return rv +} + +// The set of options used to run the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618889-options?language=objc +func (k_ Kernel) SetOptions(value KernelOptions) { + objc.Call[objc.Void](k_, objc.Sel("setOptions:"), value) +} + +// The device on which the kernel will be used. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618824-device?language=objc +func (k_ Kernel) Device() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](k_, objc.Sel("device")) + return rv +} + +// The string that identifies the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618803-label?language=objc +func (k_ Kernel) Label() string { + rv := objc.Call[string](k_, objc.Sel("label")) + return rv +} + +// The string that identifies the kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618803-label?language=objc +func (k_ Kernel) SetLabel(value string) { + objc.Call[objc.Void](k_, objc.Sel("setLabel:"), value) +} diff --git a/macos/mps/keyed_unarchiver.gen.go b/macos/mps/keyed_unarchiver.gen.go new file mode 100644 index 00000000..5cdc415e --- /dev/null +++ b/macos/mps/keyed_unarchiver.gen.go @@ -0,0 +1,160 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [KeyedUnarchiver] class. +var KeyedUnarchiverClass = _KeyedUnarchiverClass{objc.GetClass("MPSKeyedUnarchiver")} + +type _KeyedUnarchiverClass struct { + objc.Class +} + +// An interface definition for the [KeyedUnarchiver] class. +type IKeyedUnarchiver interface { + foundation.IKeyedUnarchiver + MpsMTLDevice() metal.DeviceWrapper +} + +// A keyed archiver that supports Metal Performance Shaders kernel decoding. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver?language=objc +type KeyedUnarchiver struct { + foundation.KeyedUnarchiver +} + +func KeyedUnarchiverFrom(ptr unsafe.Pointer) KeyedUnarchiver { + return KeyedUnarchiver{ + KeyedUnarchiver: foundation.KeyedUnarchiverFrom(ptr), + } +} + +func (k_ KeyedUnarchiver) InitForReadingFromDataDeviceError(data []byte, device metal.PDevice, error foundation.IError) KeyedUnarchiver { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[KeyedUnarchiver](k_, objc.Sel("initForReadingFromData:device:error:"), data, po1, objc.Ptr(error)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2966644-initforreadingfromdata?language=objc +func NewKeyedUnarchiverForReadingFromDataDeviceError(data []byte, device metal.PDevice, error foundation.IError) KeyedUnarchiver { + instance := KeyedUnarchiverClass.Alloc().InitForReadingFromDataDeviceError(data, device, error) + instance.Autorelease() + return instance +} + +func (kc _KeyedUnarchiverClass) Alloc() KeyedUnarchiver { + rv := objc.Call[KeyedUnarchiver](kc, objc.Sel("alloc")) + return rv +} + +func KeyedUnarchiver_Alloc() KeyedUnarchiver { + return KeyedUnarchiverClass.Alloc() +} + +func (kc _KeyedUnarchiverClass) New() KeyedUnarchiver { + rv := objc.Call[KeyedUnarchiver](kc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewKeyedUnarchiver() KeyedUnarchiver { + return KeyedUnarchiverClass.New() +} + +func (k_ KeyedUnarchiver) Init() KeyedUnarchiver { + rv := objc.Call[KeyedUnarchiver](k_, objc.Sel("init")) + return rv +} + +func (k_ KeyedUnarchiver) InitForReadingFromDataError(data []byte, error foundation.IError) KeyedUnarchiver { + rv := objc.Call[KeyedUnarchiver](k_, objc.Sel("initForReadingFromData:error:"), data, objc.Ptr(error)) + return rv +} + +// Initializes an archiver to decode data from the specified location. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/foundation/nskeyedunarchiver/2962883-initforreadingfromdata?language=objc +func NewKeyedUnarchiverForReadingFromDataError(data []byte, error foundation.IError) KeyedUnarchiver { + instance := KeyedUnarchiverClass.Alloc().InitForReadingFromDataError(data, error) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976453-unarchivedobjectofclass?language=objc +func (kc _KeyedUnarchiverClass) UnarchivedObjectOfClassFromDataDeviceError(cls objc.IClass, data []byte, device metal.PDevice, error foundation.IError) objc.Object { + po2 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[objc.Object](kc, objc.Sel("unarchivedObjectOfClass:fromData:device:error:"), objc.Ptr(cls), data, po2, objc.Ptr(error)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976453-unarchivedobjectofclass?language=objc +func KeyedUnarchiver_UnarchivedObjectOfClassFromDataDeviceError(cls objc.IClass, data []byte, device metal.PDevice, error foundation.IError) objc.Object { + return KeyedUnarchiverClass.UnarchivedObjectOfClassFromDataDeviceError(cls, data, device, error) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976453-unarchivedobjectofclass?language=objc +func (kc _KeyedUnarchiverClass) UnarchivedObjectOfClassFromDataDeviceObjectError(cls objc.IClass, data []byte, deviceObject objc.IObject, error foundation.IError) objc.Object { + rv := objc.Call[objc.Object](kc, objc.Sel("unarchivedObjectOfClass:fromData:device:error:"), objc.Ptr(cls), data, objc.Ptr(deviceObject), objc.Ptr(error)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976453-unarchivedobjectofclass?language=objc +func KeyedUnarchiver_UnarchivedObjectOfClassFromDataDeviceObjectError(cls objc.IClass, data []byte, deviceObject objc.IObject, error foundation.IError) objc.Object { + return KeyedUnarchiverClass.UnarchivedObjectOfClassFromDataDeviceObjectError(cls, data, deviceObject, error) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976454-unarchivedobjectofclasses?language=objc +func (kc _KeyedUnarchiverClass) UnarchivedObjectOfClassesFromDataDeviceError(classes foundation.ISet, data []byte, device metal.PDevice, error foundation.IError) objc.Object { + po2 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[objc.Object](kc, objc.Sel("unarchivedObjectOfClasses:fromData:device:error:"), objc.Ptr(classes), data, po2, objc.Ptr(error)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976454-unarchivedobjectofclasses?language=objc +func KeyedUnarchiver_UnarchivedObjectOfClassesFromDataDeviceError(classes foundation.ISet, data []byte, device metal.PDevice, error foundation.IError) objc.Object { + return KeyedUnarchiverClass.UnarchivedObjectOfClassesFromDataDeviceError(classes, data, device, error) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976454-unarchivedobjectofclasses?language=objc +func (kc _KeyedUnarchiverClass) UnarchivedObjectOfClassesFromDataDeviceObjectError(classes foundation.ISet, data []byte, deviceObject objc.IObject, error foundation.IError) objc.Object { + rv := objc.Call[objc.Object](kc, objc.Sel("unarchivedObjectOfClasses:fromData:device:error:"), objc.Ptr(classes), data, objc.Ptr(deviceObject), objc.Ptr(error)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2976454-unarchivedobjectofclasses?language=objc +func KeyedUnarchiver_UnarchivedObjectOfClassesFromDataDeviceObjectError(classes foundation.ISet, data []byte, deviceObject objc.IObject, error foundation.IError) objc.Object { + return KeyedUnarchiverClass.UnarchivedObjectOfClassesFromDataDeviceObjectError(classes, data, deviceObject, error) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskeyedunarchiver/2951880-mpsmtldevice?language=objc +func (k_ KeyedUnarchiver) MpsMTLDevice() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](k_, objc.Sel("mpsMTLDevice")) + return rv +} diff --git a/macos/mps/lstm_descriptor.gen.go b/macos/mps/lstm_descriptor.gen.go new file mode 100644 index 00000000..225edb46 --- /dev/null +++ b/macos/mps/lstm_descriptor.gen.go @@ -0,0 +1,467 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [LSTMDescriptor] class. +var LSTMDescriptorClass = _LSTMDescriptorClass{objc.GetClass("MPSLSTMDescriptor")} + +type _LSTMDescriptorClass struct { + objc.Class +} + +// An interface definition for the [LSTMDescriptor] class. +type ILSTMDescriptor interface { + IRNNDescriptor + InputGateInputWeights() CNNConvolutionDataSourceWrapper + SetInputGateInputWeights(value PCNNConvolutionDataSource) + SetInputGateInputWeightsObject(valueObject objc.IObject) + CellToOutputNeuronParamA() float64 + SetCellToOutputNeuronParamA(value float64) + ForgetGateInputWeights() CNNConvolutionDataSourceWrapper + SetForgetGateInputWeights(value PCNNConvolutionDataSource) + SetForgetGateInputWeightsObject(valueObject objc.IObject) + MemoryWeightsAreDiagonal() bool + SetMemoryWeightsAreDiagonal(value bool) + CellGateMemoryWeights() CNNConvolutionDataSourceWrapper + SetCellGateMemoryWeights(value PCNNConvolutionDataSource) + SetCellGateMemoryWeightsObject(valueObject objc.IObject) + ForgetGateRecurrentWeights() CNNConvolutionDataSourceWrapper + SetForgetGateRecurrentWeights(value PCNNConvolutionDataSource) + SetForgetGateRecurrentWeightsObject(valueObject objc.IObject) + ForgetGateMemoryWeights() CNNConvolutionDataSourceWrapper + SetForgetGateMemoryWeights(value PCNNConvolutionDataSource) + SetForgetGateMemoryWeightsObject(valueObject objc.IObject) + CellToOutputNeuronType() CNNNeuronType + SetCellToOutputNeuronType(value CNNNeuronType) + CellGateInputWeights() CNNConvolutionDataSourceWrapper + SetCellGateInputWeights(value PCNNConvolutionDataSource) + SetCellGateInputWeightsObject(valueObject objc.IObject) + OutputGateRecurrentWeights() CNNConvolutionDataSourceWrapper + SetOutputGateRecurrentWeights(value PCNNConvolutionDataSource) + SetOutputGateRecurrentWeightsObject(valueObject objc.IObject) + InputGateMemoryWeights() CNNConvolutionDataSourceWrapper + SetInputGateMemoryWeights(value PCNNConvolutionDataSource) + SetInputGateMemoryWeightsObject(valueObject objc.IObject) + InputGateRecurrentWeights() CNNConvolutionDataSourceWrapper + SetInputGateRecurrentWeights(value PCNNConvolutionDataSource) + SetInputGateRecurrentWeightsObject(valueObject objc.IObject) + CellToOutputNeuronParamC() float64 + SetCellToOutputNeuronParamC(value float64) + CellGateRecurrentWeights() CNNConvolutionDataSourceWrapper + SetCellGateRecurrentWeights(value PCNNConvolutionDataSource) + SetCellGateRecurrentWeightsObject(valueObject objc.IObject) + OutputGateMemoryWeights() CNNConvolutionDataSourceWrapper + SetOutputGateMemoryWeights(value PCNNConvolutionDataSource) + SetOutputGateMemoryWeightsObject(valueObject objc.IObject) + OutputGateInputWeights() CNNConvolutionDataSourceWrapper + SetOutputGateInputWeights(value PCNNConvolutionDataSource) + SetOutputGateInputWeightsObject(valueObject objc.IObject) + CellToOutputNeuronParamB() float64 + SetCellToOutputNeuronParamB(value float64) +} + +// A description of a long short-term memory block or layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor?language=objc +type LSTMDescriptor struct { + RNNDescriptor +} + +func LSTMDescriptorFrom(ptr unsafe.Pointer) LSTMDescriptor { + return LSTMDescriptor{ + RNNDescriptor: RNNDescriptorFrom(ptr), + } +} + +func (lc _LSTMDescriptorClass) CreateLSTMDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels uint, outputFeatureChannels uint) LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](lc, objc.Sel("createLSTMDescriptorWithInputFeatureChannels:outputFeatureChannels:"), inputFeatureChannels, outputFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865681-createlstmdescriptorwithinputfea?language=objc +func LSTMDescriptor_CreateLSTMDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels uint, outputFeatureChannels uint) LSTMDescriptor { + return LSTMDescriptorClass.CreateLSTMDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels, outputFeatureChannels) +} + +func (lc _LSTMDescriptorClass) Alloc() LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](lc, objc.Sel("alloc")) + return rv +} + +func LSTMDescriptor_Alloc() LSTMDescriptor { + return LSTMDescriptorClass.Alloc() +} + +func (lc _LSTMDescriptorClass) New() LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](lc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewLSTMDescriptor() LSTMDescriptor { + return LSTMDescriptorClass.New() +} + +func (l_ LSTMDescriptor) Init() LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](l_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865684-inputgateinputweights?language=objc +func (l_ LSTMDescriptor) InputGateInputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("inputGateInputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865684-inputgateinputweights?language=objc +func (l_ LSTMDescriptor) SetInputGateInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setInputGateInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865684-inputgateinputweights?language=objc +func (l_ LSTMDescriptor) SetInputGateInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setInputGateInputWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865744-celltooutputneuronparama?language=objc +func (l_ LSTMDescriptor) CellToOutputNeuronParamA() float64 { + rv := objc.Call[float64](l_, objc.Sel("cellToOutputNeuronParamA")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865744-celltooutputneuronparama?language=objc +func (l_ LSTMDescriptor) SetCellToOutputNeuronParamA(value float64) { + objc.Call[objc.Void](l_, objc.Sel("setCellToOutputNeuronParamA:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865734-forgetgateinputweights?language=objc +func (l_ LSTMDescriptor) ForgetGateInputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("forgetGateInputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865734-forgetgateinputweights?language=objc +func (l_ LSTMDescriptor) SetForgetGateInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setForgetGateInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865734-forgetgateinputweights?language=objc +func (l_ LSTMDescriptor) SetForgetGateInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setForgetGateInputWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865712-memoryweightsarediagonal?language=objc +func (l_ LSTMDescriptor) MemoryWeightsAreDiagonal() bool { + rv := objc.Call[bool](l_, objc.Sel("memoryWeightsAreDiagonal")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865712-memoryweightsarediagonal?language=objc +func (l_ LSTMDescriptor) SetMemoryWeightsAreDiagonal(value bool) { + objc.Call[objc.Void](l_, objc.Sel("setMemoryWeightsAreDiagonal:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865683-cellgatememoryweights?language=objc +func (l_ LSTMDescriptor) CellGateMemoryWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("cellGateMemoryWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865683-cellgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetCellGateMemoryWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setCellGateMemoryWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865683-cellgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetCellGateMemoryWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setCellGateMemoryWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865735-forgetgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) ForgetGateRecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("forgetGateRecurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865735-forgetgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetForgetGateRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setForgetGateRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865735-forgetgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetForgetGateRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setForgetGateRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865689-forgetgatememoryweights?language=objc +func (l_ LSTMDescriptor) ForgetGateMemoryWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("forgetGateMemoryWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865689-forgetgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetForgetGateMemoryWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setForgetGateMemoryWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865689-forgetgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetForgetGateMemoryWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setForgetGateMemoryWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865736-celltooutputneurontype?language=objc +func (l_ LSTMDescriptor) CellToOutputNeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](l_, objc.Sel("cellToOutputNeuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865736-celltooutputneurontype?language=objc +func (l_ LSTMDescriptor) SetCellToOutputNeuronType(value CNNNeuronType) { + objc.Call[objc.Void](l_, objc.Sel("setCellToOutputNeuronType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865741-cellgateinputweights?language=objc +func (l_ LSTMDescriptor) CellGateInputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("cellGateInputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865741-cellgateinputweights?language=objc +func (l_ LSTMDescriptor) SetCellGateInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setCellGateInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865741-cellgateinputweights?language=objc +func (l_ LSTMDescriptor) SetCellGateInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setCellGateInputWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865750-outputgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) OutputGateRecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("outputGateRecurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865750-outputgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetOutputGateRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setOutputGateRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865750-outputgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetOutputGateRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setOutputGateRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865731-inputgatememoryweights?language=objc +func (l_ LSTMDescriptor) InputGateMemoryWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("inputGateMemoryWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865731-inputgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetInputGateMemoryWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setInputGateMemoryWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865731-inputgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetInputGateMemoryWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setInputGateMemoryWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865747-inputgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) InputGateRecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("inputGateRecurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865747-inputgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetInputGateRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setInputGateRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865747-inputgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetInputGateRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setInputGateRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2935551-celltooutputneuronparamc?language=objc +func (l_ LSTMDescriptor) CellToOutputNeuronParamC() float64 { + rv := objc.Call[float64](l_, objc.Sel("cellToOutputNeuronParamC")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2935551-celltooutputneuronparamc?language=objc +func (l_ LSTMDescriptor) SetCellToOutputNeuronParamC(value float64) { + objc.Call[objc.Void](l_, objc.Sel("setCellToOutputNeuronParamC:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865679-cellgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) CellGateRecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("cellGateRecurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865679-cellgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetCellGateRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setCellGateRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865679-cellgaterecurrentweights?language=objc +func (l_ LSTMDescriptor) SetCellGateRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setCellGateRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865688-outputgatememoryweights?language=objc +func (l_ LSTMDescriptor) OutputGateMemoryWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("outputGateMemoryWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865688-outputgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetOutputGateMemoryWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setOutputGateMemoryWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865688-outputgatememoryweights?language=objc +func (l_ LSTMDescriptor) SetOutputGateMemoryWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setOutputGateMemoryWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865701-outputgateinputweights?language=objc +func (l_ LSTMDescriptor) OutputGateInputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](l_, objc.Sel("outputGateInputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865701-outputgateinputweights?language=objc +func (l_ LSTMDescriptor) SetOutputGateInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](l_, objc.Sel("setOutputGateInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865701-outputgateinputweights?language=objc +func (l_ LSTMDescriptor) SetOutputGateInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](l_, objc.Sel("setOutputGateInputWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865694-celltooutputneuronparamb?language=objc +func (l_ LSTMDescriptor) CellToOutputNeuronParamB() float64 { + rv := objc.Call[float64](l_, objc.Sel("cellToOutputNeuronParamB")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpslstmdescriptor/2865694-celltooutputneuronparamb?language=objc +func (l_ LSTMDescriptor) SetCellToOutputNeuronParamB(value float64) { + objc.Call[objc.Void](l_, objc.Sel("setCellToOutputNeuronParamB:"), value) +} diff --git a/macos/mps/matrix.gen.go b/macos/mps/matrix.gen.go new file mode 100644 index 00000000..3f4f5481 --- /dev/null +++ b/macos/mps/matrix.gen.go @@ -0,0 +1,196 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Matrix] class. +var MatrixClass = _MatrixClass{objc.GetClass("MPSMatrix")} + +type _MatrixClass struct { + objc.Class +} + +// An interface definition for the [Matrix] class. +type IMatrix interface { + objc.IObject + ResourceSize() uint + SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) + SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) + Device() metal.DeviceWrapper + RowBytes() uint + Columns() uint + Data() metal.BufferWrapper + Offset() uint + DataType() DataType + Rows() uint + Matrices() uint + MatrixBytes() uint +} + +// A 2D array of data that stores the data's values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix?language=objc +type Matrix struct { + objc.Object +} + +func MatrixFrom(ptr unsafe.Pointer) Matrix { + return Matrix{ + Object: objc.ObjectFrom(ptr), + } +} + +func (m_ Matrix) InitWithDeviceDescriptor(device metal.PDevice, descriptor IMatrixDescriptor) Matrix { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[Matrix](m_, objc.Sel("initWithDevice:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2942567-initwithdevice?language=objc +func NewMatrixWithDeviceDescriptor(device metal.PDevice, descriptor IMatrixDescriptor) Matrix { + instance := MatrixClass.Alloc().InitWithDeviceDescriptor(device, descriptor) + instance.Autorelease() + return instance +} + +func (m_ Matrix) InitWithBufferOffsetDescriptor(buffer metal.PBuffer, offset uint, descriptor IMatrixDescriptor) Matrix { + po0 := objc.WrapAsProtocol("MTLBuffer", buffer) + rv := objc.Call[Matrix](m_, objc.Sel("initWithBuffer:offset:descriptor:"), po0, offset, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/3229863-initwithbuffer?language=objc +func NewMatrixWithBufferOffsetDescriptor(buffer metal.PBuffer, offset uint, descriptor IMatrixDescriptor) Matrix { + instance := MatrixClass.Alloc().InitWithBufferOffsetDescriptor(buffer, offset, descriptor) + instance.Autorelease() + return instance +} + +func (mc _MatrixClass) Alloc() Matrix { + rv := objc.Call[Matrix](mc, objc.Sel("alloc")) + return rv +} + +func Matrix_Alloc() Matrix { + return MatrixClass.Alloc() +} + +func (mc _MatrixClass) New() Matrix { + rv := objc.Call[Matrix](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrix() Matrix { + return MatrixClass.New() +} + +func (m_ Matrix) Init() Matrix { + rv := objc.Call[Matrix](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2942569-resourcesize?language=objc +func (m_ Matrix) ResourceSize() uint { + rv := objc.Call[uint](m_, objc.Sel("resourceSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2942571-synchronizeoncommandbuffer?language=objc +func (m_ Matrix) SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("synchronizeOnCommandBuffer:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2942571-synchronizeoncommandbuffer?language=objc +func (m_ Matrix) SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("synchronizeOnCommandBuffer:"), objc.Ptr(commandBufferObject)) +} + +// The device on which the matrix will be used. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2143209-device?language=objc +func (m_ Matrix) Device() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](m_, objc.Sel("device")) + return rv +} + +// The stride, in bytes, between corresponding elements of consecutive rows in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2143208-rowbytes?language=objc +func (m_ Matrix) RowBytes() uint { + rv := objc.Call[uint](m_, objc.Sel("rowBytes")) + return rv +} + +// The number of columns in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2143207-columns?language=objc +func (m_ Matrix) Columns() uint { + rv := objc.Call[uint](m_, objc.Sel("columns")) + return rv +} + +// The buffer that stores the matrix data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2143205-data?language=objc +func (m_ Matrix) Data() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](m_, objc.Sel("data")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/3375740-offset?language=objc +func (m_ Matrix) Offset() uint { + rv := objc.Call[uint](m_, objc.Sel("offset")) + return rv +} + +// The type of the values in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2143197-datatype?language=objc +func (m_ Matrix) DataType() DataType { + rv := objc.Call[DataType](m_, objc.Sel("dataType")) + return rv +} + +// The number of rows in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2143210-rows?language=objc +func (m_ Matrix) Rows() uint { + rv := objc.Call[uint](m_, objc.Sel("rows")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2873334-matrices?language=objc +func (m_ Matrix) Matrices() uint { + rv := objc.Call[uint](m_, objc.Sel("matrices")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2873344-matrixbytes?language=objc +func (m_ Matrix) MatrixBytes() uint { + rv := objc.Call[uint](m_, objc.Sel("matrixBytes")) + return rv +} diff --git a/macos/mps/matrix_batch_normalization.gen.go b/macos/mps/matrix_batch_normalization.gen.go new file mode 100644 index 00000000..ffb63f83 --- /dev/null +++ b/macos/mps/matrix_batch_normalization.gen.go @@ -0,0 +1,219 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixBatchNormalization] class. +var MatrixBatchNormalizationClass = _MatrixBatchNormalizationClass{objc.GetClass("MPSMatrixBatchNormalization")} + +type _MatrixBatchNormalizationClass struct { + objc.Class +} + +// An interface definition for the [MatrixBatchNormalization] class. +type IMatrixBatchNormalization interface { + IMatrixUnaryKernel + NeuronParameterA() float64 + NeuronType() CNNNeuronType + SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) + NeuronParameterB() float64 + EncodeToCommandBufferInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultMatrix IMatrix) + EncodeToCommandBufferObjectInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultMatrix IMatrix) + NeuronParameterC() float64 + ComputeStatistics() bool + SetComputeStatistics(value bool) + Epsilon() float64 + SetEpsilon(value float64) + SourceNumberOfFeatureVectors() uint + SetSourceNumberOfFeatureVectors(value uint) + SourceInputFeatureChannels() uint + SetSourceInputFeatureChannels(value uint) +} + +// A batch normalization kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization?language=objc +type MatrixBatchNormalization struct { + MatrixUnaryKernel +} + +func MatrixBatchNormalizationFrom(ptr unsafe.Pointer) MatrixBatchNormalization { + return MatrixBatchNormalization{ + MatrixUnaryKernel: MatrixUnaryKernelFrom(ptr), + } +} + +func (m_ MatrixBatchNormalization) InitWithDevice(device metal.PDevice) MatrixBatchNormalization { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixBatchNormalization](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980735-initwithdevice?language=objc +func NewMatrixBatchNormalizationWithDevice(device metal.PDevice) MatrixBatchNormalization { + instance := MatrixBatchNormalizationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixBatchNormalization) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixBatchNormalization { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixBatchNormalization](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980731-copywithzone?language=objc +func MatrixBatchNormalization_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixBatchNormalization { + instance := MatrixBatchNormalizationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixBatchNormalizationClass) Alloc() MatrixBatchNormalization { + rv := objc.Call[MatrixBatchNormalization](mc, objc.Sel("alloc")) + return rv +} + +func MatrixBatchNormalization_Alloc() MatrixBatchNormalization { + return MatrixBatchNormalizationClass.Alloc() +} + +func (mc _MatrixBatchNormalizationClass) New() MatrixBatchNormalization { + rv := objc.Call[MatrixBatchNormalization](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixBatchNormalization() MatrixBatchNormalization { + return MatrixBatchNormalizationClass.New() +} + +func (m_ MatrixBatchNormalization) Init() MatrixBatchNormalization { + rv := objc.Call[MatrixBatchNormalization](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980736-neuronparametera?language=objc +func (m_ MatrixBatchNormalization) NeuronParameterA() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterA")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980739-neurontype?language=objc +func (m_ MatrixBatchNormalization) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](m_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980740-setneurontype?language=objc +func (m_ MatrixBatchNormalization) SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronType:parameterA:parameterB:parameterC:"), neuronType, parameterA, parameterB, parameterC) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980737-neuronparameterb?language=objc +func (m_ MatrixBatchNormalization) NeuronParameterB() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterB")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980732-encodetocommandbuffer?language=objc +func (m_ MatrixBatchNormalization) EncodeToCommandBufferInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:meanVector:varianceVector:gammaVector:betaVector:resultMatrix:"), po0, objc.Ptr(inputMatrix), objc.Ptr(meanVector), objc.Ptr(varianceVector), objc.Ptr(gammaVector), objc.Ptr(betaVector), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980732-encodetocommandbuffer?language=objc +func (m_ MatrixBatchNormalization) EncodeToCommandBufferObjectInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:meanVector:varianceVector:gammaVector:betaVector:resultMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputMatrix), objc.Ptr(meanVector), objc.Ptr(varianceVector), objc.Ptr(gammaVector), objc.Ptr(betaVector), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980738-neuronparameterc?language=objc +func (m_ MatrixBatchNormalization) NeuronParameterC() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterC")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980730-computestatistics?language=objc +func (m_ MatrixBatchNormalization) ComputeStatistics() bool { + rv := objc.Call[bool](m_, objc.Sel("computeStatistics")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980730-computestatistics?language=objc +func (m_ MatrixBatchNormalization) SetComputeStatistics(value bool) { + objc.Call[objc.Void](m_, objc.Sel("setComputeStatistics:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980733-epsilon?language=objc +func (m_ MatrixBatchNormalization) Epsilon() float64 { + rv := objc.Call[float64](m_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980733-epsilon?language=objc +func (m_ MatrixBatchNormalization) SetEpsilon(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setEpsilon:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980742-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixBatchNormalization) SourceNumberOfFeatureVectors() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceNumberOfFeatureVectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980742-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixBatchNormalization) SetSourceNumberOfFeatureVectors(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceNumberOfFeatureVectors:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980741-sourceinputfeaturechannels?language=objc +func (m_ MatrixBatchNormalization) SourceInputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceInputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalization/2980741-sourceinputfeaturechannels?language=objc +func (m_ MatrixBatchNormalization) SetSourceInputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceInputFeatureChannels:"), value) +} diff --git a/macos/mps/matrix_batch_normalization_gradient.gen.go b/macos/mps/matrix_batch_normalization_gradient.gen.go new file mode 100644 index 00000000..0f87157e --- /dev/null +++ b/macos/mps/matrix_batch_normalization_gradient.gen.go @@ -0,0 +1,202 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixBatchNormalizationGradient] class. +var MatrixBatchNormalizationGradientClass = _MatrixBatchNormalizationGradientClass{objc.GetClass("MPSMatrixBatchNormalizationGradient")} + +type _MatrixBatchNormalizationGradientClass struct { + objc.Class +} + +// An interface definition for the [MatrixBatchNormalizationGradient] class. +type IMatrixBatchNormalizationGradient interface { + IMatrixBinaryKernel + NeuronParameterA() float64 + NeuronType() CNNNeuronType + SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) + NeuronParameterB() float64 + EncodeToCommandBufferGradientMatrixInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultGradientForDataMatrixResultGradientForGammaVectorResultGradientForBetaVector(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForGammaVector IVector, resultGradientForBetaVector IVector) + EncodeToCommandBufferObjectGradientMatrixInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultGradientForDataMatrixResultGradientForGammaVectorResultGradientForBetaVector(commandBufferObject objc.IObject, gradientMatrix IMatrix, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForGammaVector IVector, resultGradientForBetaVector IVector) + NeuronParameterC() float64 + Epsilon() float64 + SetEpsilon(value float64) + SourceNumberOfFeatureVectors() uint + SetSourceNumberOfFeatureVectors(value uint) + SourceInputFeatureChannels() uint + SetSourceInputFeatureChannels(value uint) +} + +// A batch normalization gradient kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient?language=objc +type MatrixBatchNormalizationGradient struct { + MatrixBinaryKernel +} + +func MatrixBatchNormalizationGradientFrom(ptr unsafe.Pointer) MatrixBatchNormalizationGradient { + return MatrixBatchNormalizationGradient{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixBatchNormalizationGradient) InitWithDevice(device metal.PDevice) MatrixBatchNormalizationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixBatchNormalizationGradient](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980748-initwithdevice?language=objc +func NewMatrixBatchNormalizationGradientWithDevice(device metal.PDevice) MatrixBatchNormalizationGradient { + instance := MatrixBatchNormalizationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixBatchNormalizationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixBatchNormalizationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixBatchNormalizationGradient](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980744-copywithzone?language=objc +func MatrixBatchNormalizationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixBatchNormalizationGradient { + instance := MatrixBatchNormalizationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixBatchNormalizationGradientClass) Alloc() MatrixBatchNormalizationGradient { + rv := objc.Call[MatrixBatchNormalizationGradient](mc, objc.Sel("alloc")) + return rv +} + +func MatrixBatchNormalizationGradient_Alloc() MatrixBatchNormalizationGradient { + return MatrixBatchNormalizationGradientClass.Alloc() +} + +func (mc _MatrixBatchNormalizationGradientClass) New() MatrixBatchNormalizationGradient { + rv := objc.Call[MatrixBatchNormalizationGradient](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixBatchNormalizationGradient() MatrixBatchNormalizationGradient { + return MatrixBatchNormalizationGradientClass.New() +} + +func (m_ MatrixBatchNormalizationGradient) Init() MatrixBatchNormalizationGradient { + rv := objc.Call[MatrixBatchNormalizationGradient](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980749-neuronparametera?language=objc +func (m_ MatrixBatchNormalizationGradient) NeuronParameterA() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterA")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980752-neurontype?language=objc +func (m_ MatrixBatchNormalizationGradient) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](m_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980753-setneurontype?language=objc +func (m_ MatrixBatchNormalizationGradient) SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronType:parameterA:parameterB:parameterC:"), neuronType, parameterA, parameterB, parameterC) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980750-neuronparameterb?language=objc +func (m_ MatrixBatchNormalizationGradient) NeuronParameterB() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterB")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980745-encodetocommandbuffer?language=objc +func (m_ MatrixBatchNormalizationGradient) EncodeToCommandBufferGradientMatrixInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultGradientForDataMatrixResultGradientForGammaVectorResultGradientForBetaVector(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForGammaVector IVector, resultGradientForBetaVector IVector) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:gradientMatrix:inputMatrix:meanVector:varianceVector:gammaVector:betaVector:resultGradientForDataMatrix:resultGradientForGammaVector:resultGradientForBetaVector:"), po0, objc.Ptr(gradientMatrix), objc.Ptr(inputMatrix), objc.Ptr(meanVector), objc.Ptr(varianceVector), objc.Ptr(gammaVector), objc.Ptr(betaVector), objc.Ptr(resultGradientForDataMatrix), objc.Ptr(resultGradientForGammaVector), objc.Ptr(resultGradientForBetaVector)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980745-encodetocommandbuffer?language=objc +func (m_ MatrixBatchNormalizationGradient) EncodeToCommandBufferObjectGradientMatrixInputMatrixMeanVectorVarianceVectorGammaVectorBetaVectorResultGradientForDataMatrixResultGradientForGammaVectorResultGradientForBetaVector(commandBufferObject objc.IObject, gradientMatrix IMatrix, inputMatrix IMatrix, meanVector IVector, varianceVector IVector, gammaVector IVector, betaVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForGammaVector IVector, resultGradientForBetaVector IVector) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:gradientMatrix:inputMatrix:meanVector:varianceVector:gammaVector:betaVector:resultGradientForDataMatrix:resultGradientForGammaVector:resultGradientForBetaVector:"), objc.Ptr(commandBufferObject), objc.Ptr(gradientMatrix), objc.Ptr(inputMatrix), objc.Ptr(meanVector), objc.Ptr(varianceVector), objc.Ptr(gammaVector), objc.Ptr(betaVector), objc.Ptr(resultGradientForDataMatrix), objc.Ptr(resultGradientForGammaVector), objc.Ptr(resultGradientForBetaVector)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980751-neuronparameterc?language=objc +func (m_ MatrixBatchNormalizationGradient) NeuronParameterC() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterC")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980746-epsilon?language=objc +func (m_ MatrixBatchNormalizationGradient) Epsilon() float64 { + rv := objc.Call[float64](m_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980746-epsilon?language=objc +func (m_ MatrixBatchNormalizationGradient) SetEpsilon(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setEpsilon:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980755-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixBatchNormalizationGradient) SourceNumberOfFeatureVectors() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceNumberOfFeatureVectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980755-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixBatchNormalizationGradient) SetSourceNumberOfFeatureVectors(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceNumberOfFeatureVectors:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980754-sourceinputfeaturechannels?language=objc +func (m_ MatrixBatchNormalizationGradient) SourceInputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceInputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbatchnormalizationgradient/2980754-sourceinputfeaturechannels?language=objc +func (m_ MatrixBatchNormalizationGradient) SetSourceInputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceInputFeatureChannels:"), value) +} diff --git a/macos/mps/matrix_binary_kernel.gen.go b/macos/mps/matrix_binary_kernel.gen.go new file mode 100644 index 00000000..2febce7d --- /dev/null +++ b/macos/mps/matrix_binary_kernel.gen.go @@ -0,0 +1,175 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixBinaryKernel] class. +var MatrixBinaryKernelClass = _MatrixBinaryKernelClass{objc.GetClass("MPSMatrixBinaryKernel")} + +type _MatrixBinaryKernelClass struct { + objc.Class +} + +// An interface definition for the [MatrixBinaryKernel] class. +type IMatrixBinaryKernel interface { + IKernel + ResultMatrixOrigin() metal.Origin + SetResultMatrixOrigin(value metal.Origin) + BatchStart() uint + SetBatchStart(value uint) + BatchSize() uint + SetBatchSize(value uint) + SecondarySourceMatrixOrigin() metal.Origin + SetSecondarySourceMatrixOrigin(value metal.Origin) + PrimarySourceMatrixOrigin() metal.Origin + SetPrimarySourceMatrixOrigin(value metal.Origin) +} + +// A kernel that consumes two matrices and produces one matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel?language=objc +type MatrixBinaryKernel struct { + Kernel +} + +func MatrixBinaryKernelFrom(ptr unsafe.Pointer) MatrixBinaryKernel { + return MatrixBinaryKernel{ + Kernel: KernelFrom(ptr), + } +} + +func (mc _MatrixBinaryKernelClass) Alloc() MatrixBinaryKernel { + rv := objc.Call[MatrixBinaryKernel](mc, objc.Sel("alloc")) + return rv +} + +func MatrixBinaryKernel_Alloc() MatrixBinaryKernel { + return MatrixBinaryKernelClass.Alloc() +} + +func (mc _MatrixBinaryKernelClass) New() MatrixBinaryKernel { + rv := objc.Call[MatrixBinaryKernel](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixBinaryKernel() MatrixBinaryKernel { + return MatrixBinaryKernelClass.New() +} + +func (m_ MatrixBinaryKernel) Init() MatrixBinaryKernel { + rv := objc.Call[MatrixBinaryKernel](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixBinaryKernel) InitWithDevice(device metal.PDevice) MatrixBinaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixBinaryKernel](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixBinaryKernelWithDevice(device metal.PDevice) MatrixBinaryKernel { + instance := MatrixBinaryKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixBinaryKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixBinaryKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixBinaryKernel](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixBinaryKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixBinaryKernel { + instance := MatrixBinaryKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867193-resultmatrixorigin?language=objc +func (m_ MatrixBinaryKernel) ResultMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("resultMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867193-resultmatrixorigin?language=objc +func (m_ MatrixBinaryKernel) SetResultMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setResultMatrixOrigin:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867152-batchstart?language=objc +func (m_ MatrixBinaryKernel) BatchStart() uint { + rv := objc.Call[uint](m_, objc.Sel("batchStart")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867152-batchstart?language=objc +func (m_ MatrixBinaryKernel) SetBatchStart(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchStart:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867089-batchsize?language=objc +func (m_ MatrixBinaryKernel) BatchSize() uint { + rv := objc.Call[uint](m_, objc.Sel("batchSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867089-batchsize?language=objc +func (m_ MatrixBinaryKernel) SetBatchSize(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchSize:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867096-secondarysourcematrixorigin?language=objc +func (m_ MatrixBinaryKernel) SecondarySourceMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("secondarySourceMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867096-secondarysourcematrixorigin?language=objc +func (m_ MatrixBinaryKernel) SetSecondarySourceMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setSecondarySourceMatrixOrigin:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867182-primarysourcematrixorigin?language=objc +func (m_ MatrixBinaryKernel) PrimarySourceMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("primarySourceMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixbinarykernel/2867182-primarysourcematrixorigin?language=objc +func (m_ MatrixBinaryKernel) SetPrimarySourceMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setPrimarySourceMatrixOrigin:"), value) +} diff --git a/macos/mps/matrix_copy.gen.go b/macos/mps/matrix_copy.gen.go new file mode 100644 index 00000000..8526266f --- /dev/null +++ b/macos/mps/matrix_copy.gen.go @@ -0,0 +1,158 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixCopy] class. +var MatrixCopyClass = _MatrixCopyClass{objc.GetClass("MPSMatrixCopy")} + +type _MatrixCopyClass struct { + objc.Class +} + +// An interface definition for the [MatrixCopy] class. +type IMatrixCopy interface { + IKernel + EncodeToCommandBufferCopyDescriptor(commandBuffer metal.PCommandBuffer, copyDescriptor IMatrixCopyDescriptor) + EncodeToCommandBufferObjectCopyDescriptor(commandBufferObject objc.IObject, copyDescriptor IMatrixCopyDescriptor) + SourcesAreTransposed() bool + DestinationsAreTransposed() bool + CopyRows() uint + CopyColumns() uint +} + +// A class that can perform multiple matrix copy operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy?language=objc +type MatrixCopy struct { + Kernel +} + +func MatrixCopyFrom(ptr unsafe.Pointer) MatrixCopy { + return MatrixCopy{ + Kernel: KernelFrom(ptr), + } +} + +func (m_ MatrixCopy) InitWithDeviceCopyRowsCopyColumnsSourcesAreTransposedDestinationsAreTransposed(device metal.PDevice, copyRows uint, copyColumns uint, sourcesAreTransposed bool, destinationsAreTransposed bool) MatrixCopy { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixCopy](m_, objc.Sel("initWithDevice:copyRows:copyColumns:sourcesAreTransposed:destinationsAreTransposed:"), po0, copyRows, copyColumns, sourcesAreTransposed, destinationsAreTransposed) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy/2915345-initwithdevice?language=objc +func NewMatrixCopyWithDeviceCopyRowsCopyColumnsSourcesAreTransposedDestinationsAreTransposed(device metal.PDevice, copyRows uint, copyColumns uint, sourcesAreTransposed bool, destinationsAreTransposed bool) MatrixCopy { + instance := MatrixCopyClass.Alloc().InitWithDeviceCopyRowsCopyColumnsSourcesAreTransposedDestinationsAreTransposed(device, copyRows, copyColumns, sourcesAreTransposed, destinationsAreTransposed) + instance.Autorelease() + return instance +} + +func (mc _MatrixCopyClass) Alloc() MatrixCopy { + rv := objc.Call[MatrixCopy](mc, objc.Sel("alloc")) + return rv +} + +func MatrixCopy_Alloc() MatrixCopy { + return MatrixCopyClass.Alloc() +} + +func (mc _MatrixCopyClass) New() MatrixCopy { + rv := objc.Call[MatrixCopy](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixCopy() MatrixCopy { + return MatrixCopyClass.New() +} + +func (m_ MatrixCopy) Init() MatrixCopy { + rv := objc.Call[MatrixCopy](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixCopy) InitWithDevice(device metal.PDevice) MatrixCopy { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixCopy](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixCopyWithDevice(device metal.PDevice) MatrixCopy { + instance := MatrixCopyClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixCopy) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixCopy { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixCopy](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixCopy_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixCopy { + instance := MatrixCopyClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy/2915341-encodetocommandbuffer?language=objc +func (m_ MatrixCopy) EncodeToCommandBufferCopyDescriptor(commandBuffer metal.PCommandBuffer, copyDescriptor IMatrixCopyDescriptor) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:copyDescriptor:"), po0, objc.Ptr(copyDescriptor)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy/2915341-encodetocommandbuffer?language=objc +func (m_ MatrixCopy) EncodeToCommandBufferObjectCopyDescriptor(commandBufferObject objc.IObject, copyDescriptor IMatrixCopyDescriptor) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:copyDescriptor:"), objc.Ptr(commandBufferObject), objc.Ptr(copyDescriptor)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy/2915340-sourcesaretransposed?language=objc +func (m_ MatrixCopy) SourcesAreTransposed() bool { + rv := objc.Call[bool](m_, objc.Sel("sourcesAreTransposed")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy/2915326-destinationsaretransposed?language=objc +func (m_ MatrixCopy) DestinationsAreTransposed() bool { + rv := objc.Call[bool](m_, objc.Sel("destinationsAreTransposed")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy/2915342-copyrows?language=objc +func (m_ MatrixCopy) CopyRows() uint { + rv := objc.Call[uint](m_, objc.Sel("copyRows")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopy/2915325-copycolumns?language=objc +func (m_ MatrixCopy) CopyColumns() uint { + rv := objc.Call[uint](m_, objc.Sel("copyColumns")) + return rv +} diff --git a/macos/mps/matrix_copy_descriptor.gen.go b/macos/mps/matrix_copy_descriptor.gen.go new file mode 100644 index 00000000..b7e08171 --- /dev/null +++ b/macos/mps/matrix_copy_descriptor.gen.go @@ -0,0 +1,108 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixCopyDescriptor] class. +var MatrixCopyDescriptorClass = _MatrixCopyDescriptorClass{objc.GetClass("MPSMatrixCopyDescriptor")} + +type _MatrixCopyDescriptorClass struct { + objc.Class +} + +// An interface definition for the [MatrixCopyDescriptor] class. +type IMatrixCopyDescriptor interface { + objc.IObject + SetCopyOperationAtIndexSourceMatrixDestinationMatrixOffsets(index uint, sourceMatrix IMatrix, destinationMatrix IMatrix, offsets MatrixCopyOffsets) +} + +// A description of multiple matrix copy operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopydescriptor?language=objc +type MatrixCopyDescriptor struct { + objc.Object +} + +func MatrixCopyDescriptorFrom(ptr unsafe.Pointer) MatrixCopyDescriptor { + return MatrixCopyDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MatrixCopyDescriptorClass) DescriptorWithSourceMatrixDestinationMatrixOffsets(sourceMatrix IMatrix, destinationMatrix IMatrix, offsets MatrixCopyOffsets) MatrixCopyDescriptor { + rv := objc.Call[MatrixCopyDescriptor](mc, objc.Sel("descriptorWithSourceMatrix:destinationMatrix:offsets:"), objc.Ptr(sourceMatrix), objc.Ptr(destinationMatrix), offsets) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopydescriptor/2915333-descriptorwithsourcematrix?language=objc +func MatrixCopyDescriptor_DescriptorWithSourceMatrixDestinationMatrixOffsets(sourceMatrix IMatrix, destinationMatrix IMatrix, offsets MatrixCopyOffsets) MatrixCopyDescriptor { + return MatrixCopyDescriptorClass.DescriptorWithSourceMatrixDestinationMatrixOffsets(sourceMatrix, destinationMatrix, offsets) +} + +func (m_ MatrixCopyDescriptor) InitWithDeviceCount(device metal.PDevice, count uint) MatrixCopyDescriptor { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixCopyDescriptor](m_, objc.Sel("initWithDevice:count:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopydescriptor/2915324-initwithdevice?language=objc +func NewMatrixCopyDescriptorWithDeviceCount(device metal.PDevice, count uint) MatrixCopyDescriptor { + instance := MatrixCopyDescriptorClass.Alloc().InitWithDeviceCount(device, count) + instance.Autorelease() + return instance +} + +func (m_ MatrixCopyDescriptor) InitWithSourceMatricesDestinationMatricesOffsetVectorOffset(sourceMatrices []IMatrix, destinationMatrices []IMatrix, offsets IVector, byteOffset uint) MatrixCopyDescriptor { + rv := objc.Call[MatrixCopyDescriptor](m_, objc.Sel("initWithSourceMatrices:destinationMatrices:offsetVector:offset:"), sourceMatrices, destinationMatrices, objc.Ptr(offsets), byteOffset) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopydescriptor/2915344-initwithsourcematrices?language=objc +func NewMatrixCopyDescriptorWithSourceMatricesDestinationMatricesOffsetVectorOffset(sourceMatrices []IMatrix, destinationMatrices []IMatrix, offsets IVector, byteOffset uint) MatrixCopyDescriptor { + instance := MatrixCopyDescriptorClass.Alloc().InitWithSourceMatricesDestinationMatricesOffsetVectorOffset(sourceMatrices, destinationMatrices, offsets, byteOffset) + instance.Autorelease() + return instance +} + +func (mc _MatrixCopyDescriptorClass) Alloc() MatrixCopyDescriptor { + rv := objc.Call[MatrixCopyDescriptor](mc, objc.Sel("alloc")) + return rv +} + +func MatrixCopyDescriptor_Alloc() MatrixCopyDescriptor { + return MatrixCopyDescriptorClass.Alloc() +} + +func (mc _MatrixCopyDescriptorClass) New() MatrixCopyDescriptor { + rv := objc.Call[MatrixCopyDescriptor](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixCopyDescriptor() MatrixCopyDescriptor { + return MatrixCopyDescriptorClass.New() +} + +func (m_ MatrixCopyDescriptor) Init() MatrixCopyDescriptor { + rv := objc.Call[MatrixCopyDescriptor](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopydescriptor/2915331-setcopyoperationatindex?language=objc +func (m_ MatrixCopyDescriptor) SetCopyOperationAtIndexSourceMatrixDestinationMatrixOffsets(index uint, sourceMatrix IMatrix, destinationMatrix IMatrix, offsets MatrixCopyOffsets) { + objc.Call[objc.Void](m_, objc.Sel("setCopyOperationAtIndex:sourceMatrix:destinationMatrix:offsets:"), index, objc.Ptr(sourceMatrix), objc.Ptr(destinationMatrix), offsets) +} diff --git a/macos/mps/matrix_copy_to_image.gen.go b/macos/mps/matrix_copy_to_image.gen.go new file mode 100644 index 00000000..4237dd41 --- /dev/null +++ b/macos/mps/matrix_copy_to_image.gen.go @@ -0,0 +1,183 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixCopyToImage] class. +var MatrixCopyToImageClass = _MatrixCopyToImageClass{objc.GetClass("MPSMatrixCopyToImage")} + +type _MatrixCopyToImageClass struct { + objc.Class +} + +// An interface definition for the [MatrixCopyToImage] class. +type IMatrixCopyToImage interface { + IKernel + EncodeBatchToCommandBufferSourceMatrixDestinationImages(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, destinationImages *foundation.Array) + EncodeBatchToCommandBufferObjectSourceMatrixDestinationImages(commandBufferObject objc.IObject, sourceMatrix IMatrix, destinationImages *foundation.Array) + EncodeToCommandBufferSourceMatrixDestinationImage(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, destinationImage IImage) + EncodeToCommandBufferObjectSourceMatrixDestinationImage(commandBufferObject objc.IObject, sourceMatrix IMatrix, destinationImage IImage) + DataLayout() DataLayout + SourceMatrixBatchIndex() uint + SetSourceMatrixBatchIndex(value uint) + SourceMatrixOrigin() metal.Origin + SetSourceMatrixOrigin(value metal.Origin) +} + +// A kernel that copies matrix data to a Metal Performance Shaders image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage?language=objc +type MatrixCopyToImage struct { + Kernel +} + +func MatrixCopyToImageFrom(ptr unsafe.Pointer) MatrixCopyToImage { + return MatrixCopyToImage{ + Kernel: KernelFrom(ptr), + } +} + +func (m_ MatrixCopyToImage) InitWithDeviceDataLayout(device metal.PDevice, dataLayout DataLayout) MatrixCopyToImage { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixCopyToImage](m_, objc.Sel("initWithDevice:dataLayout:"), po0, dataLayout) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976460-initwithdevice?language=objc +func NewMatrixCopyToImageWithDeviceDataLayout(device metal.PDevice, dataLayout DataLayout) MatrixCopyToImage { + instance := MatrixCopyToImageClass.Alloc().InitWithDeviceDataLayout(device, dataLayout) + instance.Autorelease() + return instance +} + +func (mc _MatrixCopyToImageClass) Alloc() MatrixCopyToImage { + rv := objc.Call[MatrixCopyToImage](mc, objc.Sel("alloc")) + return rv +} + +func MatrixCopyToImage_Alloc() MatrixCopyToImage { + return MatrixCopyToImageClass.Alloc() +} + +func (mc _MatrixCopyToImageClass) New() MatrixCopyToImage { + rv := objc.Call[MatrixCopyToImage](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixCopyToImage() MatrixCopyToImage { + return MatrixCopyToImageClass.New() +} + +func (m_ MatrixCopyToImage) Init() MatrixCopyToImage { + rv := objc.Call[MatrixCopyToImage](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixCopyToImage) InitWithDevice(device metal.PDevice) MatrixCopyToImage { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixCopyToImage](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixCopyToImageWithDevice(device metal.PDevice) MatrixCopyToImage { + instance := MatrixCopyToImageClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixCopyToImage) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixCopyToImage { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixCopyToImage](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixCopyToImage_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixCopyToImage { + instance := MatrixCopyToImageClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/3013770-encodebatchtocommandbuffer?language=objc +func (m_ MatrixCopyToImage) EncodeBatchToCommandBufferSourceMatrixDestinationImages(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, destinationImages *foundation.Array) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeBatchToCommandBuffer:sourceMatrix:destinationImages:"), po0, objc.Ptr(sourceMatrix), destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/3013770-encodebatchtocommandbuffer?language=objc +func (m_ MatrixCopyToImage) EncodeBatchToCommandBufferObjectSourceMatrixDestinationImages(commandBufferObject objc.IObject, sourceMatrix IMatrix, destinationImages *foundation.Array) { + objc.Call[objc.Void](m_, objc.Sel("encodeBatchToCommandBuffer:sourceMatrix:destinationImages:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceMatrix), destinationImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976458-encodetocommandbuffer?language=objc +func (m_ MatrixCopyToImage) EncodeToCommandBufferSourceMatrixDestinationImage(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, destinationImage IImage) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:destinationImage:"), po0, objc.Ptr(sourceMatrix), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976458-encodetocommandbuffer?language=objc +func (m_ MatrixCopyToImage) EncodeToCommandBufferObjectSourceMatrixDestinationImage(commandBufferObject objc.IObject, sourceMatrix IMatrix, destinationImage IImage) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:destinationImage:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceMatrix), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976457-datalayout?language=objc +func (m_ MatrixCopyToImage) DataLayout() DataLayout { + rv := objc.Call[DataLayout](m_, objc.Sel("dataLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976461-sourcematrixbatchindex?language=objc +func (m_ MatrixCopyToImage) SourceMatrixBatchIndex() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceMatrixBatchIndex")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976461-sourcematrixbatchindex?language=objc +func (m_ MatrixCopyToImage) SetSourceMatrixBatchIndex(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceMatrixBatchIndex:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976462-sourcematrixorigin?language=objc +func (m_ MatrixCopyToImage) SourceMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("sourceMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopytoimage/2976462-sourcematrixorigin?language=objc +func (m_ MatrixCopyToImage) SetSourceMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setSourceMatrixOrigin:"), value) +} diff --git a/macos/mps/matrix_decomposition_cholesky.gen.go b/macos/mps/matrix_decomposition_cholesky.gen.go new file mode 100644 index 00000000..e22e1ed7 --- /dev/null +++ b/macos/mps/matrix_decomposition_cholesky.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixDecompositionCholesky] class. +var MatrixDecompositionCholeskyClass = _MatrixDecompositionCholeskyClass{objc.GetClass("MPSMatrixDecompositionCholesky")} + +type _MatrixDecompositionCholeskyClass struct { + objc.Class +} + +// An interface definition for the [MatrixDecompositionCholesky] class. +type IMatrixDecompositionCholesky interface { + IMatrixUnaryKernel + EncodeToCommandBufferSourceMatrixResultMatrixStatus(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, resultMatrix IMatrix, status metal.PBuffer) + EncodeToCommandBufferObjectSourceMatrixResultMatrixStatusObject(commandBufferObject objc.IObject, sourceMatrix IMatrix, resultMatrix IMatrix, statusObject objc.IObject) +} + +// A kernel for computing the Cholesky factorization of a matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositioncholesky?language=objc +type MatrixDecompositionCholesky struct { + MatrixUnaryKernel +} + +func MatrixDecompositionCholeskyFrom(ptr unsafe.Pointer) MatrixDecompositionCholesky { + return MatrixDecompositionCholesky{ + MatrixUnaryKernel: MatrixUnaryKernelFrom(ptr), + } +} + +func (m_ MatrixDecompositionCholesky) InitWithDeviceLowerOrder(device metal.PDevice, lower bool, order uint) MatrixDecompositionCholesky { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixDecompositionCholesky](m_, objc.Sel("initWithDevice:lower:order:"), po0, lower, order) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositioncholesky/2867119-initwithdevice?language=objc +func NewMatrixDecompositionCholeskyWithDeviceLowerOrder(device metal.PDevice, lower bool, order uint) MatrixDecompositionCholesky { + instance := MatrixDecompositionCholeskyClass.Alloc().InitWithDeviceLowerOrder(device, lower, order) + instance.Autorelease() + return instance +} + +func (mc _MatrixDecompositionCholeskyClass) Alloc() MatrixDecompositionCholesky { + rv := objc.Call[MatrixDecompositionCholesky](mc, objc.Sel("alloc")) + return rv +} + +func MatrixDecompositionCholesky_Alloc() MatrixDecompositionCholesky { + return MatrixDecompositionCholeskyClass.Alloc() +} + +func (mc _MatrixDecompositionCholeskyClass) New() MatrixDecompositionCholesky { + rv := objc.Call[MatrixDecompositionCholesky](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixDecompositionCholesky() MatrixDecompositionCholesky { + return MatrixDecompositionCholeskyClass.New() +} + +func (m_ MatrixDecompositionCholesky) Init() MatrixDecompositionCholesky { + rv := objc.Call[MatrixDecompositionCholesky](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixDecompositionCholesky) InitWithDevice(device metal.PDevice) MatrixDecompositionCholesky { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixDecompositionCholesky](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixDecompositionCholeskyWithDevice(device metal.PDevice) MatrixDecompositionCholesky { + instance := MatrixDecompositionCholeskyClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixDecompositionCholesky) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixDecompositionCholesky { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixDecompositionCholesky](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixDecompositionCholesky_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixDecompositionCholesky { + instance := MatrixDecompositionCholeskyClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositioncholesky/2867004-encodetocommandbuffer?language=objc +func (m_ MatrixDecompositionCholesky) EncodeToCommandBufferSourceMatrixResultMatrixStatus(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, resultMatrix IMatrix, status metal.PBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po3 := objc.WrapAsProtocol("MTLBuffer", status) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:resultMatrix:status:"), po0, objc.Ptr(sourceMatrix), objc.Ptr(resultMatrix), po3) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositioncholesky/2867004-encodetocommandbuffer?language=objc +func (m_ MatrixDecompositionCholesky) EncodeToCommandBufferObjectSourceMatrixResultMatrixStatusObject(commandBufferObject objc.IObject, sourceMatrix IMatrix, resultMatrix IMatrix, statusObject objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:resultMatrix:status:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceMatrix), objc.Ptr(resultMatrix), objc.Ptr(statusObject)) +} diff --git a/macos/mps/matrix_decomposition_lu.gen.go b/macos/mps/matrix_decomposition_lu.gen.go new file mode 100644 index 00000000..a7fc3476 --- /dev/null +++ b/macos/mps/matrix_decomposition_lu.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixDecompositionLU] class. +var MatrixDecompositionLUClass = _MatrixDecompositionLUClass{objc.GetClass("MPSMatrixDecompositionLU")} + +type _MatrixDecompositionLUClass struct { + objc.Class +} + +// An interface definition for the [MatrixDecompositionLU] class. +type IMatrixDecompositionLU interface { + IMatrixUnaryKernel + EncodeToCommandBufferSourceMatrixResultMatrixPivotIndicesStatus(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, resultMatrix IMatrix, pivotIndices IMatrix, status metal.PBuffer) + EncodeToCommandBufferObjectSourceMatrixResultMatrixPivotIndicesStatusObject(commandBufferObject objc.IObject, sourceMatrix IMatrix, resultMatrix IMatrix, pivotIndices IMatrix, statusObject objc.IObject) +} + +// A kernel for computing the LU factorization of a matrix using partial pivoting with row interchanges. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositionlu?language=objc +type MatrixDecompositionLU struct { + MatrixUnaryKernel +} + +func MatrixDecompositionLUFrom(ptr unsafe.Pointer) MatrixDecompositionLU { + return MatrixDecompositionLU{ + MatrixUnaryKernel: MatrixUnaryKernelFrom(ptr), + } +} + +func (m_ MatrixDecompositionLU) InitWithDeviceRowsColumns(device metal.PDevice, rows uint, columns uint) MatrixDecompositionLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixDecompositionLU](m_, objc.Sel("initWithDevice:rows:columns:"), po0, rows, columns) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositionlu/2866960-initwithdevice?language=objc +func NewMatrixDecompositionLUWithDeviceRowsColumns(device metal.PDevice, rows uint, columns uint) MatrixDecompositionLU { + instance := MatrixDecompositionLUClass.Alloc().InitWithDeviceRowsColumns(device, rows, columns) + instance.Autorelease() + return instance +} + +func (mc _MatrixDecompositionLUClass) Alloc() MatrixDecompositionLU { + rv := objc.Call[MatrixDecompositionLU](mc, objc.Sel("alloc")) + return rv +} + +func MatrixDecompositionLU_Alloc() MatrixDecompositionLU { + return MatrixDecompositionLUClass.Alloc() +} + +func (mc _MatrixDecompositionLUClass) New() MatrixDecompositionLU { + rv := objc.Call[MatrixDecompositionLU](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixDecompositionLU() MatrixDecompositionLU { + return MatrixDecompositionLUClass.New() +} + +func (m_ MatrixDecompositionLU) Init() MatrixDecompositionLU { + rv := objc.Call[MatrixDecompositionLU](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixDecompositionLU) InitWithDevice(device metal.PDevice) MatrixDecompositionLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixDecompositionLU](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixDecompositionLUWithDevice(device metal.PDevice) MatrixDecompositionLU { + instance := MatrixDecompositionLUClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixDecompositionLU) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixDecompositionLU { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixDecompositionLU](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixDecompositionLU_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixDecompositionLU { + instance := MatrixDecompositionLUClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositionlu/2867184-encodetocommandbuffer?language=objc +func (m_ MatrixDecompositionLU) EncodeToCommandBufferSourceMatrixResultMatrixPivotIndicesStatus(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, resultMatrix IMatrix, pivotIndices IMatrix, status metal.PBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po4 := objc.WrapAsProtocol("MTLBuffer", status) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:resultMatrix:pivotIndices:status:"), po0, objc.Ptr(sourceMatrix), objc.Ptr(resultMatrix), objc.Ptr(pivotIndices), po4) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdecompositionlu/2867184-encodetocommandbuffer?language=objc +func (m_ MatrixDecompositionLU) EncodeToCommandBufferObjectSourceMatrixResultMatrixPivotIndicesStatusObject(commandBufferObject objc.IObject, sourceMatrix IMatrix, resultMatrix IMatrix, pivotIndices IMatrix, statusObject objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:resultMatrix:pivotIndices:status:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceMatrix), objc.Ptr(resultMatrix), objc.Ptr(pivotIndices), objc.Ptr(statusObject)) +} diff --git a/macos/mps/matrix_descriptor.gen.go b/macos/mps/matrix_descriptor.gen.go new file mode 100644 index 00000000..308af12b --- /dev/null +++ b/macos/mps/matrix_descriptor.gen.go @@ -0,0 +1,198 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixDescriptor] class. +var MatrixDescriptorClass = _MatrixDescriptorClass{objc.GetClass("MPSMatrixDescriptor")} + +type _MatrixDescriptorClass struct { + objc.Class +} + +// An interface definition for the [MatrixDescriptor] class. +type IMatrixDescriptor interface { + objc.IObject + RowBytes() uint + SetRowBytes(value uint) + Columns() uint + SetColumns(value uint) + DataType() DataType + SetDataType(value DataType) + Rows() uint + SetRows(value uint) + Matrices() uint + MatrixBytes() uint +} + +// A description of attributes used to create an MPS matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor?language=objc +type MatrixDescriptor struct { + objc.Object +} + +func MatrixDescriptorFrom(ptr unsafe.Pointer) MatrixDescriptor { + return MatrixDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MatrixDescriptorClass) MatrixDescriptorWithDimensionsColumnsRowBytesDataType(rows uint, columns uint, rowBytes uint, dataType DataType) MatrixDescriptor { + rv := objc.Call[MatrixDescriptor](mc, objc.Sel("matrixDescriptorWithDimensions:columns:rowBytes:dataType:"), rows, columns, rowBytes, dataType) + return rv +} + +// Creates a matrix descriptor with the specified dimensions and data type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143206-matrixdescriptorwithdimensions?language=objc +func MatrixDescriptor_MatrixDescriptorWithDimensionsColumnsRowBytesDataType(rows uint, columns uint, rowBytes uint, dataType DataType) MatrixDescriptor { + return MatrixDescriptorClass.MatrixDescriptorWithDimensionsColumnsRowBytesDataType(rows, columns, rowBytes, dataType) +} + +func (mc _MatrixDescriptorClass) MatrixDescriptorWithRowsColumnsMatricesRowBytesMatrixBytesDataType(rows uint, columns uint, matrices uint, rowBytes uint, matrixBytes uint, dataType DataType) MatrixDescriptor { + rv := objc.Call[MatrixDescriptor](mc, objc.Sel("matrixDescriptorWithRows:columns:matrices:rowBytes:matrixBytes:dataType:"), rows, columns, matrices, rowBytes, matrixBytes, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2873350-matrixdescriptorwithrows?language=objc +func MatrixDescriptor_MatrixDescriptorWithRowsColumnsMatricesRowBytesMatrixBytesDataType(rows uint, columns uint, matrices uint, rowBytes uint, matrixBytes uint, dataType DataType) MatrixDescriptor { + return MatrixDescriptorClass.MatrixDescriptorWithRowsColumnsMatricesRowBytesMatrixBytesDataType(rows, columns, matrices, rowBytes, matrixBytes, dataType) +} + +func (mc _MatrixDescriptorClass) Alloc() MatrixDescriptor { + rv := objc.Call[MatrixDescriptor](mc, objc.Sel("alloc")) + return rv +} + +func MatrixDescriptor_Alloc() MatrixDescriptor { + return MatrixDescriptorClass.Alloc() +} + +func (mc _MatrixDescriptorClass) New() MatrixDescriptor { + rv := objc.Call[MatrixDescriptor](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixDescriptor() MatrixDescriptor { + return MatrixDescriptorClass.New() +} + +func (m_ MatrixDescriptor) Init() MatrixDescriptor { + rv := objc.Call[MatrixDescriptor](m_, objc.Sel("init")) + return rv +} + +// Determines the recommended matrix row stride, in bytes, for a given number of columns. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143204-rowbytesfromcolumns?language=objc +func (mc _MatrixDescriptorClass) RowBytesFromColumnsDataType(columns uint, dataType DataType) uint { + rv := objc.Call[uint](mc, objc.Sel("rowBytesFromColumns:dataType:"), columns, dataType) + return rv +} + +// Determines the recommended matrix row stride, in bytes, for a given number of columns. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143204-rowbytesfromcolumns?language=objc +func MatrixDescriptor_RowBytesFromColumnsDataType(columns uint, dataType DataType) uint { + return MatrixDescriptorClass.RowBytesFromColumnsDataType(columns, dataType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2873394-rowbytesforcolumns?language=objc +func (mc _MatrixDescriptorClass) RowBytesForColumnsDataType(columns uint, dataType DataType) uint { + rv := objc.Call[uint](mc, objc.Sel("rowBytesForColumns:dataType:"), columns, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2873394-rowbytesforcolumns?language=objc +func MatrixDescriptor_RowBytesForColumnsDataType(columns uint, dataType DataType) uint { + return MatrixDescriptorClass.RowBytesForColumnsDataType(columns, dataType) +} + +// The stride, in bytes, between corresponding elements of consecutive rows in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143199-rowbytes?language=objc +func (m_ MatrixDescriptor) RowBytes() uint { + rv := objc.Call[uint](m_, objc.Sel("rowBytes")) + return rv +} + +// The stride, in bytes, between corresponding elements of consecutive rows in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143199-rowbytes?language=objc +func (m_ MatrixDescriptor) SetRowBytes(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setRowBytes:"), value) +} + +// The number of columns in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143196-columns?language=objc +func (m_ MatrixDescriptor) Columns() uint { + rv := objc.Call[uint](m_, objc.Sel("columns")) + return rv +} + +// The number of columns in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143196-columns?language=objc +func (m_ MatrixDescriptor) SetColumns(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setColumns:"), value) +} + +// The type of the values in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143202-datatype?language=objc +func (m_ MatrixDescriptor) DataType() DataType { + rv := objc.Call[DataType](m_, objc.Sel("dataType")) + return rv +} + +// The type of the values in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143202-datatype?language=objc +func (m_ MatrixDescriptor) SetDataType(value DataType) { + objc.Call[objc.Void](m_, objc.Sel("setDataType:"), value) +} + +// The number of rows in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143203-rows?language=objc +func (m_ MatrixDescriptor) Rows() uint { + rv := objc.Call[uint](m_, objc.Sel("rows")) + return rv +} + +// The number of rows in the matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2143203-rows?language=objc +func (m_ MatrixDescriptor) SetRows(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setRows:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2873351-matrices?language=objc +func (m_ MatrixDescriptor) Matrices() uint { + rv := objc.Call[uint](m_, objc.Sel("matrices")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixdescriptor/2873387-matrixbytes?language=objc +func (m_ MatrixDescriptor) MatrixBytes() uint { + rv := objc.Call[uint](m_, objc.Sel("matrixBytes")) + return rv +} diff --git a/macos/mps/matrix_find_top_k.gen.go b/macos/mps/matrix_find_top_k.gen.go new file mode 100644 index 00000000..a42ab163 --- /dev/null +++ b/macos/mps/matrix_find_top_k.gen.go @@ -0,0 +1,190 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixFindTopK] class. +var MatrixFindTopKClass = _MatrixFindTopKClass{objc.GetClass("MPSMatrixFindTopK")} + +type _MatrixFindTopKClass struct { + objc.Class +} + +// An interface definition for the [MatrixFindTopK] class. +type IMatrixFindTopK interface { + IMatrixUnaryKernel + EncodeToCommandBufferInputMatrixResultIndexMatrixResultValueMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, resultIndexMatrix IMatrix, resultValueMatrix IMatrix) + EncodeToCommandBufferObjectInputMatrixResultIndexMatrixResultValueMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, resultIndexMatrix IMatrix, resultValueMatrix IMatrix) + SourceRows() uint + SetSourceRows(value uint) + SourceColumns() uint + SetSourceColumns(value uint) + NumberOfTopKValues() uint + SetNumberOfTopKValues(value uint) + IndexOffset() uint + SetIndexOffset(value uint) +} + +// A kernel for computing the top-K values and their corresponding indices in a matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk?language=objc +type MatrixFindTopK struct { + MatrixUnaryKernel +} + +func MatrixFindTopKFrom(ptr unsafe.Pointer) MatrixFindTopK { + return MatrixFindTopK{ + MatrixUnaryKernel: MatrixUnaryKernelFrom(ptr), + } +} + +func (m_ MatrixFindTopK) InitWithDeviceNumberOfTopKValues(device metal.PDevice, numberOfTopKValues uint) MatrixFindTopK { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixFindTopK](m_, objc.Sel("initWithDevice:numberOfTopKValues:"), po0, numberOfTopKValues) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935575-initwithdevice?language=objc +func NewMatrixFindTopKWithDeviceNumberOfTopKValues(device metal.PDevice, numberOfTopKValues uint) MatrixFindTopK { + instance := MatrixFindTopKClass.Alloc().InitWithDeviceNumberOfTopKValues(device, numberOfTopKValues) + instance.Autorelease() + return instance +} + +func (m_ MatrixFindTopK) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixFindTopK { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixFindTopK](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935581-copywithzone?language=objc +func MatrixFindTopK_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixFindTopK { + instance := MatrixFindTopKClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixFindTopKClass) Alloc() MatrixFindTopK { + rv := objc.Call[MatrixFindTopK](mc, objc.Sel("alloc")) + return rv +} + +func MatrixFindTopK_Alloc() MatrixFindTopK { + return MatrixFindTopKClass.Alloc() +} + +func (mc _MatrixFindTopKClass) New() MatrixFindTopK { + rv := objc.Call[MatrixFindTopK](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixFindTopK() MatrixFindTopK { + return MatrixFindTopKClass.New() +} + +func (m_ MatrixFindTopK) Init() MatrixFindTopK { + rv := objc.Call[MatrixFindTopK](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixFindTopK) InitWithDevice(device metal.PDevice) MatrixFindTopK { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixFindTopK](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixFindTopKWithDevice(device metal.PDevice) MatrixFindTopK { + instance := MatrixFindTopKClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935579-encodetocommandbuffer?language=objc +func (m_ MatrixFindTopK) EncodeToCommandBufferInputMatrixResultIndexMatrixResultValueMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, resultIndexMatrix IMatrix, resultValueMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:resultIndexMatrix:resultValueMatrix:"), po0, objc.Ptr(inputMatrix), objc.Ptr(resultIndexMatrix), objc.Ptr(resultValueMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935579-encodetocommandbuffer?language=objc +func (m_ MatrixFindTopK) EncodeToCommandBufferObjectInputMatrixResultIndexMatrixResultValueMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, resultIndexMatrix IMatrix, resultValueMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:resultIndexMatrix:resultValueMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputMatrix), objc.Ptr(resultIndexMatrix), objc.Ptr(resultValueMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935580-sourcerows?language=objc +func (m_ MatrixFindTopK) SourceRows() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceRows")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935580-sourcerows?language=objc +func (m_ MatrixFindTopK) SetSourceRows(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceRows:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935573-sourcecolumns?language=objc +func (m_ MatrixFindTopK) SourceColumns() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceColumns")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935573-sourcecolumns?language=objc +func (m_ MatrixFindTopK) SetSourceColumns(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceColumns:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935577-numberoftopkvalues?language=objc +func (m_ MatrixFindTopK) NumberOfTopKValues() uint { + rv := objc.Call[uint](m_, objc.Sel("numberOfTopKValues")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935577-numberoftopkvalues?language=objc +func (m_ MatrixFindTopK) SetNumberOfTopKValues(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setNumberOfTopKValues:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935574-indexoffset?language=objc +func (m_ MatrixFindTopK) IndexOffset() uint { + rv := objc.Call[uint](m_, objc.Sel("indexOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfindtopk/2935574-indexoffset?language=objc +func (m_ MatrixFindTopK) SetIndexOffset(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setIndexOffset:"), value) +} diff --git a/macos/mps/matrix_fully_connected.gen.go b/macos/mps/matrix_fully_connected.gen.go new file mode 100644 index 00000000..ceff9b35 --- /dev/null +++ b/macos/mps/matrix_fully_connected.gen.go @@ -0,0 +1,219 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixFullyConnected] class. +var MatrixFullyConnectedClass = _MatrixFullyConnectedClass{objc.GetClass("MPSMatrixFullyConnected")} + +type _MatrixFullyConnectedClass struct { + objc.Class +} + +// An interface definition for the [MatrixFullyConnected] class. +type IMatrixFullyConnected interface { + IMatrixBinaryKernel + NeuronParameterA() float64 + NeuronType() CNNNeuronType + SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) + NeuronParameterB() float64 + EncodeToCommandBufferInputMatrixWeightMatrixBiasVectorResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, weightMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) + EncodeToCommandBufferObjectInputMatrixWeightMatrixBiasVectorResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, weightMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) + NeuronParameterC() float64 + SourceOutputFeatureChannels() uint + SetSourceOutputFeatureChannels(value uint) + Alpha() float64 + SetAlpha(value float64) + SourceNumberOfFeatureVectors() uint + SetSourceNumberOfFeatureVectors(value uint) + SourceInputFeatureChannels() uint + SetSourceInputFeatureChannels(value uint) +} + +// A kernel for applying a fully connected neural network layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected?language=objc +type MatrixFullyConnected struct { + MatrixBinaryKernel +} + +func MatrixFullyConnectedFrom(ptr unsafe.Pointer) MatrixFullyConnected { + return MatrixFullyConnected{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixFullyConnected) InitWithDevice(device metal.PDevice) MatrixFullyConnected { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixFullyConnected](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935584-initwithdevice?language=objc +func NewMatrixFullyConnectedWithDevice(device metal.PDevice) MatrixFullyConnected { + instance := MatrixFullyConnectedClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixFullyConnected) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixFullyConnected { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixFullyConnected](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935595-copywithzone?language=objc +func MatrixFullyConnected_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixFullyConnected { + instance := MatrixFullyConnectedClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixFullyConnectedClass) Alloc() MatrixFullyConnected { + rv := objc.Call[MatrixFullyConnected](mc, objc.Sel("alloc")) + return rv +} + +func MatrixFullyConnected_Alloc() MatrixFullyConnected { + return MatrixFullyConnectedClass.Alloc() +} + +func (mc _MatrixFullyConnectedClass) New() MatrixFullyConnected { + rv := objc.Call[MatrixFullyConnected](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixFullyConnected() MatrixFullyConnected { + return MatrixFullyConnectedClass.New() +} + +func (m_ MatrixFullyConnected) Init() MatrixFullyConnected { + rv := objc.Call[MatrixFullyConnected](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935602-neuronparametera?language=objc +func (m_ MatrixFullyConnected) NeuronParameterA() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterA")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935588-neurontype?language=objc +func (m_ MatrixFullyConnected) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](m_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935593-setneurontype?language=objc +func (m_ MatrixFullyConnected) SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronType:parameterA:parameterB:parameterC:"), neuronType, parameterA, parameterB, parameterC) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935591-neuronparameterb?language=objc +func (m_ MatrixFullyConnected) NeuronParameterB() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterB")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935596-encodetocommandbuffer?language=objc +func (m_ MatrixFullyConnected) EncodeToCommandBufferInputMatrixWeightMatrixBiasVectorResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, weightMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:weightMatrix:biasVector:resultMatrix:"), po0, objc.Ptr(inputMatrix), objc.Ptr(weightMatrix), objc.Ptr(biasVector), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935596-encodetocommandbuffer?language=objc +func (m_ MatrixFullyConnected) EncodeToCommandBufferObjectInputMatrixWeightMatrixBiasVectorResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, weightMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:weightMatrix:biasVector:resultMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputMatrix), objc.Ptr(weightMatrix), objc.Ptr(biasVector), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935594-neuronparameterc?language=objc +func (m_ MatrixFullyConnected) NeuronParameterC() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterC")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935592-sourceoutputfeaturechannels?language=objc +func (m_ MatrixFullyConnected) SourceOutputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceOutputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935592-sourceoutputfeaturechannels?language=objc +func (m_ MatrixFullyConnected) SetSourceOutputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceOutputFeatureChannels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935608-alpha?language=objc +func (m_ MatrixFullyConnected) Alpha() float64 { + rv := objc.Call[float64](m_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935608-alpha?language=objc +func (m_ MatrixFullyConnected) SetAlpha(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setAlpha:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935609-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixFullyConnected) SourceNumberOfFeatureVectors() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceNumberOfFeatureVectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935609-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixFullyConnected) SetSourceNumberOfFeatureVectors(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceNumberOfFeatureVectors:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935597-sourceinputfeaturechannels?language=objc +func (m_ MatrixFullyConnected) SourceInputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceInputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnected/2935597-sourceinputfeaturechannels?language=objc +func (m_ MatrixFullyConnected) SetSourceInputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceInputFeatureChannels:"), value) +} diff --git a/macos/mps/matrix_fully_connected_gradient.gen.go b/macos/mps/matrix_fully_connected_gradient.gen.go new file mode 100644 index 00000000..248ee691 --- /dev/null +++ b/macos/mps/matrix_fully_connected_gradient.gen.go @@ -0,0 +1,192 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixFullyConnectedGradient] class. +var MatrixFullyConnectedGradientClass = _MatrixFullyConnectedGradientClass{objc.GetClass("MPSMatrixFullyConnectedGradient")} + +type _MatrixFullyConnectedGradientClass struct { + objc.Class +} + +// An interface definition for the [MatrixFullyConnectedGradient] class. +type IMatrixFullyConnectedGradient interface { + IMatrixBinaryKernel + EncodeGradientForWeightsAndBiasToCommandBufferGradientMatrixInputMatrixResultGradientForWeightMatrixResultGradientForBiasVector(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, inputMatrix IMatrix, resultGradientForWeightMatrix IMatrix, resultGradientForBiasVector IVector) + EncodeGradientForWeightsAndBiasToCommandBufferObjectGradientMatrixInputMatrixResultGradientForWeightMatrixResultGradientForBiasVector(commandBufferObject objc.IObject, gradientMatrix IMatrix, inputMatrix IMatrix, resultGradientForWeightMatrix IMatrix, resultGradientForBiasVector IVector) + EncodeGradientForDataToCommandBufferGradientMatrixWeightMatrixResultGradientForDataMatrix(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, weightMatrix IMatrix, resultGradientForDataMatrix IMatrix) + EncodeGradientForDataToCommandBufferObjectGradientMatrixWeightMatrixResultGradientForDataMatrix(commandBufferObject objc.IObject, gradientMatrix IMatrix, weightMatrix IMatrix, resultGradientForDataMatrix IMatrix) + SourceOutputFeatureChannels() uint + SetSourceOutputFeatureChannels(value uint) + Alpha() float64 + SetAlpha(value float64) + SourceNumberOfFeatureVectors() uint + SetSourceNumberOfFeatureVectors(value uint) + SourceInputFeatureChannels() uint + SetSourceInputFeatureChannels(value uint) +} + +// A kernel for applying a fully gradient connected neural network layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient?language=objc +type MatrixFullyConnectedGradient struct { + MatrixBinaryKernel +} + +func MatrixFullyConnectedGradientFrom(ptr unsafe.Pointer) MatrixFullyConnectedGradient { + return MatrixFullyConnectedGradient{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixFullyConnectedGradient) InitWithDevice(device metal.PDevice) MatrixFullyConnectedGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixFullyConnectedGradient](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966668-initwithdevice?language=objc +func NewMatrixFullyConnectedGradientWithDevice(device metal.PDevice) MatrixFullyConnectedGradient { + instance := MatrixFullyConnectedGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixFullyConnectedGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixFullyConnectedGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixFullyConnectedGradient](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966664-copywithzone?language=objc +func MatrixFullyConnectedGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixFullyConnectedGradient { + instance := MatrixFullyConnectedGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixFullyConnectedGradientClass) Alloc() MatrixFullyConnectedGradient { + rv := objc.Call[MatrixFullyConnectedGradient](mc, objc.Sel("alloc")) + return rv +} + +func MatrixFullyConnectedGradient_Alloc() MatrixFullyConnectedGradient { + return MatrixFullyConnectedGradientClass.Alloc() +} + +func (mc _MatrixFullyConnectedGradientClass) New() MatrixFullyConnectedGradient { + rv := objc.Call[MatrixFullyConnectedGradient](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixFullyConnectedGradient() MatrixFullyConnectedGradient { + return MatrixFullyConnectedGradientClass.New() +} + +func (m_ MatrixFullyConnectedGradient) Init() MatrixFullyConnectedGradient { + rv := objc.Call[MatrixFullyConnectedGradient](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966666-encodegradientforweightsandbiast?language=objc +func (m_ MatrixFullyConnectedGradient) EncodeGradientForWeightsAndBiasToCommandBufferGradientMatrixInputMatrixResultGradientForWeightMatrixResultGradientForBiasVector(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, inputMatrix IMatrix, resultGradientForWeightMatrix IMatrix, resultGradientForBiasVector IVector) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeGradientForWeightsAndBiasToCommandBuffer:gradientMatrix:inputMatrix:resultGradientForWeightMatrix:resultGradientForBiasVector:"), po0, objc.Ptr(gradientMatrix), objc.Ptr(inputMatrix), objc.Ptr(resultGradientForWeightMatrix), objc.Ptr(resultGradientForBiasVector)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966666-encodegradientforweightsandbiast?language=objc +func (m_ MatrixFullyConnectedGradient) EncodeGradientForWeightsAndBiasToCommandBufferObjectGradientMatrixInputMatrixResultGradientForWeightMatrixResultGradientForBiasVector(commandBufferObject objc.IObject, gradientMatrix IMatrix, inputMatrix IMatrix, resultGradientForWeightMatrix IMatrix, resultGradientForBiasVector IVector) { + objc.Call[objc.Void](m_, objc.Sel("encodeGradientForWeightsAndBiasToCommandBuffer:gradientMatrix:inputMatrix:resultGradientForWeightMatrix:resultGradientForBiasVector:"), objc.Ptr(commandBufferObject), objc.Ptr(gradientMatrix), objc.Ptr(inputMatrix), objc.Ptr(resultGradientForWeightMatrix), objc.Ptr(resultGradientForBiasVector)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966665-encodegradientfordatatocommandbu?language=objc +func (m_ MatrixFullyConnectedGradient) EncodeGradientForDataToCommandBufferGradientMatrixWeightMatrixResultGradientForDataMatrix(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, weightMatrix IMatrix, resultGradientForDataMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeGradientForDataToCommandBuffer:gradientMatrix:weightMatrix:resultGradientForDataMatrix:"), po0, objc.Ptr(gradientMatrix), objc.Ptr(weightMatrix), objc.Ptr(resultGradientForDataMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966665-encodegradientfordatatocommandbu?language=objc +func (m_ MatrixFullyConnectedGradient) EncodeGradientForDataToCommandBufferObjectGradientMatrixWeightMatrixResultGradientForDataMatrix(commandBufferObject objc.IObject, gradientMatrix IMatrix, weightMatrix IMatrix, resultGradientForDataMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeGradientForDataToCommandBuffer:gradientMatrix:weightMatrix:resultGradientForDataMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(gradientMatrix), objc.Ptr(weightMatrix), objc.Ptr(resultGradientForDataMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966671-sourceoutputfeaturechannels?language=objc +func (m_ MatrixFullyConnectedGradient) SourceOutputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceOutputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966671-sourceoutputfeaturechannels?language=objc +func (m_ MatrixFullyConnectedGradient) SetSourceOutputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceOutputFeatureChannels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966663-alpha?language=objc +func (m_ MatrixFullyConnectedGradient) Alpha() float64 { + rv := objc.Call[float64](m_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966663-alpha?language=objc +func (m_ MatrixFullyConnectedGradient) SetAlpha(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setAlpha:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966670-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixFullyConnectedGradient) SourceNumberOfFeatureVectors() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceNumberOfFeatureVectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966670-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixFullyConnectedGradient) SetSourceNumberOfFeatureVectors(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceNumberOfFeatureVectors:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966669-sourceinputfeaturechannels?language=objc +func (m_ MatrixFullyConnectedGradient) SourceInputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceInputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixfullyconnectedgradient/2966669-sourceinputfeaturechannels?language=objc +func (m_ MatrixFullyConnectedGradient) SetSourceInputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceInputFeatureChannels:"), value) +} diff --git a/macos/mps/matrix_log_soft_max.gen.go b/macos/mps/matrix_log_soft_max.gen.go new file mode 100644 index 00000000..33ee084b --- /dev/null +++ b/macos/mps/matrix_log_soft_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixLogSoftMax] class. +var MatrixLogSoftMaxClass = _MatrixLogSoftMaxClass{objc.GetClass("MPSMatrixLogSoftMax")} + +type _MatrixLogSoftMaxClass struct { + objc.Class +} + +// An interface definition for the [MatrixLogSoftMax] class. +type IMatrixLogSoftMax interface { + IMatrixSoftMax +} + +// A logarithmic softmax kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixlogsoftmax?language=objc +type MatrixLogSoftMax struct { + MatrixSoftMax +} + +func MatrixLogSoftMaxFrom(ptr unsafe.Pointer) MatrixLogSoftMax { + return MatrixLogSoftMax{ + MatrixSoftMax: MatrixSoftMaxFrom(ptr), + } +} + +func (mc _MatrixLogSoftMaxClass) Alloc() MatrixLogSoftMax { + rv := objc.Call[MatrixLogSoftMax](mc, objc.Sel("alloc")) + return rv +} + +func MatrixLogSoftMax_Alloc() MatrixLogSoftMax { + return MatrixLogSoftMaxClass.Alloc() +} + +func (mc _MatrixLogSoftMaxClass) New() MatrixLogSoftMax { + rv := objc.Call[MatrixLogSoftMax](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixLogSoftMax() MatrixLogSoftMax { + return MatrixLogSoftMaxClass.New() +} + +func (m_ MatrixLogSoftMax) Init() MatrixLogSoftMax { + rv := objc.Call[MatrixLogSoftMax](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixLogSoftMax) InitWithDevice(device metal.PDevice) MatrixLogSoftMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixLogSoftMax](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935562-initwithdevice?language=objc +func NewMatrixLogSoftMaxWithDevice(device metal.PDevice) MatrixLogSoftMax { + instance := MatrixLogSoftMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixLogSoftMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixLogSoftMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixLogSoftMax](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935566-copywithzone?language=objc +func MatrixLogSoftMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixLogSoftMax { + instance := MatrixLogSoftMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/matrix_log_soft_max_gradient.gen.go b/macos/mps/matrix_log_soft_max_gradient.gen.go new file mode 100644 index 00000000..bff2d178 --- /dev/null +++ b/macos/mps/matrix_log_soft_max_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixLogSoftMaxGradient] class. +var MatrixLogSoftMaxGradientClass = _MatrixLogSoftMaxGradientClass{objc.GetClass("MPSMatrixLogSoftMaxGradient")} + +type _MatrixLogSoftMaxGradientClass struct { + objc.Class +} + +// An interface definition for the [MatrixLogSoftMaxGradient] class. +type IMatrixLogSoftMaxGradient interface { + IMatrixSoftMaxGradient +} + +// A logarithmic gradient softmax kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixlogsoftmaxgradient?language=objc +type MatrixLogSoftMaxGradient struct { + MatrixSoftMaxGradient +} + +func MatrixLogSoftMaxGradientFrom(ptr unsafe.Pointer) MatrixLogSoftMaxGradient { + return MatrixLogSoftMaxGradient{ + MatrixSoftMaxGradient: MatrixSoftMaxGradientFrom(ptr), + } +} + +func (mc _MatrixLogSoftMaxGradientClass) Alloc() MatrixLogSoftMaxGradient { + rv := objc.Call[MatrixLogSoftMaxGradient](mc, objc.Sel("alloc")) + return rv +} + +func MatrixLogSoftMaxGradient_Alloc() MatrixLogSoftMaxGradient { + return MatrixLogSoftMaxGradientClass.Alloc() +} + +func (mc _MatrixLogSoftMaxGradientClass) New() MatrixLogSoftMaxGradient { + rv := objc.Call[MatrixLogSoftMaxGradient](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixLogSoftMaxGradient() MatrixLogSoftMaxGradient { + return MatrixLogSoftMaxGradientClass.New() +} + +func (m_ MatrixLogSoftMaxGradient) Init() MatrixLogSoftMaxGradient { + rv := objc.Call[MatrixLogSoftMaxGradient](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixLogSoftMaxGradient) InitWithDevice(device metal.PDevice) MatrixLogSoftMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixLogSoftMaxGradient](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966654-initwithdevice?language=objc +func NewMatrixLogSoftMaxGradientWithDevice(device metal.PDevice) MatrixLogSoftMaxGradient { + instance := MatrixLogSoftMaxGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixLogSoftMaxGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixLogSoftMaxGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixLogSoftMaxGradient](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966651-copywithzone?language=objc +func MatrixLogSoftMaxGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixLogSoftMaxGradient { + instance := MatrixLogSoftMaxGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/matrix_multiplication.gen.go b/macos/mps/matrix_multiplication.gen.go new file mode 100644 index 00000000..a4a76585 --- /dev/null +++ b/macos/mps/matrix_multiplication.gen.go @@ -0,0 +1,207 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixMultiplication] class. +var MatrixMultiplicationClass = _MatrixMultiplicationClass{objc.GetClass("MPSMatrixMultiplication")} + +type _MatrixMultiplicationClass struct { + objc.Class +} + +// An interface definition for the [MatrixMultiplication] class. +type IMatrixMultiplication interface { + IKernel + EncodeToCommandBufferLeftMatrixRightMatrixResultMatrix(commandBuffer metal.PCommandBuffer, leftMatrix IMatrix, rightMatrix IMatrix, resultMatrix IMatrix) + EncodeToCommandBufferObjectLeftMatrixRightMatrixResultMatrix(commandBufferObject objc.IObject, leftMatrix IMatrix, rightMatrix IMatrix, resultMatrix IMatrix) + ResultMatrixOrigin() metal.Origin + SetResultMatrixOrigin(value metal.Origin) + RightMatrixOrigin() metal.Origin + SetRightMatrixOrigin(value metal.Origin) + BatchStart() uint + SetBatchStart(value uint) + BatchSize() uint + SetBatchSize(value uint) + LeftMatrixOrigin() metal.Origin + SetLeftMatrixOrigin(value metal.Origin) +} + +// A matrix multiplication kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication?language=objc +type MatrixMultiplication struct { + Kernel +} + +func MatrixMultiplicationFrom(ptr unsafe.Pointer) MatrixMultiplication { + return MatrixMultiplication{ + Kernel: KernelFrom(ptr), + } +} + +func (m_ MatrixMultiplication) InitWithDeviceResultRowsResultColumnsInteriorColumns(device metal.PDevice, resultRows uint, resultColumns uint, interiorColumns uint) MatrixMultiplication { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixMultiplication](m_, objc.Sel("initWithDevice:resultRows:resultColumns:interiorColumns:"), po0, resultRows, resultColumns, interiorColumns) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2909034-initwithdevice?language=objc +func NewMatrixMultiplicationWithDeviceResultRowsResultColumnsInteriorColumns(device metal.PDevice, resultRows uint, resultColumns uint, interiorColumns uint) MatrixMultiplication { + instance := MatrixMultiplicationClass.Alloc().InitWithDeviceResultRowsResultColumnsInteriorColumns(device, resultRows, resultColumns, interiorColumns) + instance.Autorelease() + return instance +} + +func (mc _MatrixMultiplicationClass) Alloc() MatrixMultiplication { + rv := objc.Call[MatrixMultiplication](mc, objc.Sel("alloc")) + return rv +} + +func MatrixMultiplication_Alloc() MatrixMultiplication { + return MatrixMultiplicationClass.Alloc() +} + +func (mc _MatrixMultiplicationClass) New() MatrixMultiplication { + rv := objc.Call[MatrixMultiplication](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixMultiplication() MatrixMultiplication { + return MatrixMultiplicationClass.New() +} + +func (m_ MatrixMultiplication) Init() MatrixMultiplication { + rv := objc.Call[MatrixMultiplication](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixMultiplication) InitWithDevice(device metal.PDevice) MatrixMultiplication { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixMultiplication](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixMultiplicationWithDevice(device metal.PDevice) MatrixMultiplication { + instance := MatrixMultiplicationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixMultiplication) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixMultiplication { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixMultiplication](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixMultiplication_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixMultiplication { + instance := MatrixMultiplicationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Encodes a matrix multiplication kernel to a command buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147848-encodetocommandbuffer?language=objc +func (m_ MatrixMultiplication) EncodeToCommandBufferLeftMatrixRightMatrixResultMatrix(commandBuffer metal.PCommandBuffer, leftMatrix IMatrix, rightMatrix IMatrix, resultMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:leftMatrix:rightMatrix:resultMatrix:"), po0, objc.Ptr(leftMatrix), objc.Ptr(rightMatrix), objc.Ptr(resultMatrix)) +} + +// Encodes a matrix multiplication kernel to a command buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147848-encodetocommandbuffer?language=objc +func (m_ MatrixMultiplication) EncodeToCommandBufferObjectLeftMatrixRightMatrixResultMatrix(commandBufferObject objc.IObject, leftMatrix IMatrix, rightMatrix IMatrix, resultMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:leftMatrix:rightMatrix:resultMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(leftMatrix), objc.Ptr(rightMatrix), objc.Ptr(resultMatrix)) +} + +// The origin of the result matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147847-resultmatrixorigin?language=objc +func (m_ MatrixMultiplication) ResultMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("resultMatrixOrigin")) + return rv +} + +// The origin of the result matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147847-resultmatrixorigin?language=objc +func (m_ MatrixMultiplication) SetResultMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setResultMatrixOrigin:"), value) +} + +// The origin of the right input matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147851-rightmatrixorigin?language=objc +func (m_ MatrixMultiplication) RightMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("rightMatrixOrigin")) + return rv +} + +// The origin of the right input matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147851-rightmatrixorigin?language=objc +func (m_ MatrixMultiplication) SetRightMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setRightMatrixOrigin:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2873081-batchstart?language=objc +func (m_ MatrixMultiplication) BatchStart() uint { + rv := objc.Call[uint](m_, objc.Sel("batchStart")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2873081-batchstart?language=objc +func (m_ MatrixMultiplication) SetBatchStart(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchStart:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2873082-batchsize?language=objc +func (m_ MatrixMultiplication) BatchSize() uint { + rv := objc.Call[uint](m_, objc.Sel("batchSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2873082-batchsize?language=objc +func (m_ MatrixMultiplication) SetBatchSize(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchSize:"), value) +} + +// The origin of the left input matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147846-leftmatrixorigin?language=objc +func (m_ MatrixMultiplication) LeftMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("leftMatrixOrigin")) + return rv +} + +// The origin of the left input matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixmultiplication/2147846-leftmatrixorigin?language=objc +func (m_ MatrixMultiplication) SetLeftMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setLeftMatrixOrigin:"), value) +} diff --git a/macos/mps/matrix_neuron.gen.go b/macos/mps/matrix_neuron.gen.go new file mode 100644 index 00000000..45afc786 --- /dev/null +++ b/macos/mps/matrix_neuron.gen.go @@ -0,0 +1,210 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixNeuron] class. +var MatrixNeuronClass = _MatrixNeuronClass{objc.GetClass("MPSMatrixNeuron")} + +type _MatrixNeuronClass struct { + objc.Class +} + +// An interface definition for the [MatrixNeuron] class. +type IMatrixNeuron interface { + IMatrixUnaryKernel + NeuronParameterA() float64 + NeuronType() CNNNeuronType + SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) + NeuronParameterB() float64 + EncodeToCommandBufferInputMatrixBiasVectorResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) + EncodeToCommandBufferObjectInputMatrixBiasVectorResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) + SetNeuronToPReLUWithParametersA(A []byte) + NeuronParameterC() float64 + Alpha() float64 + SetAlpha(value float64) + SourceNumberOfFeatureVectors() uint + SetSourceNumberOfFeatureVectors(value uint) + SourceInputFeatureChannels() uint + SetSourceInputFeatureChannels(value uint) +} + +// A neuron activation kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron?language=objc +type MatrixNeuron struct { + MatrixUnaryKernel +} + +func MatrixNeuronFrom(ptr unsafe.Pointer) MatrixNeuron { + return MatrixNeuron{ + MatrixUnaryKernel: MatrixUnaryKernelFrom(ptr), + } +} + +func (m_ MatrixNeuron) InitWithDevice(device metal.PDevice) MatrixNeuron { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixNeuron](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935603-initwithdevice?language=objc +func NewMatrixNeuronWithDevice(device metal.PDevice) MatrixNeuron { + instance := MatrixNeuronClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixNeuron) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixNeuron { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixNeuron](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935604-copywithzone?language=objc +func MatrixNeuron_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixNeuron { + instance := MatrixNeuronClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixNeuronClass) Alloc() MatrixNeuron { + rv := objc.Call[MatrixNeuron](mc, objc.Sel("alloc")) + return rv +} + +func MatrixNeuron_Alloc() MatrixNeuron { + return MatrixNeuronClass.Alloc() +} + +func (mc _MatrixNeuronClass) New() MatrixNeuron { + rv := objc.Call[MatrixNeuron](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixNeuron() MatrixNeuron { + return MatrixNeuronClass.New() +} + +func (m_ MatrixNeuron) Init() MatrixNeuron { + rv := objc.Call[MatrixNeuron](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935583-neuronparametera?language=objc +func (m_ MatrixNeuron) NeuronParameterA() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterA")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935587-neurontype?language=objc +func (m_ MatrixNeuron) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](m_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935590-setneurontype?language=objc +func (m_ MatrixNeuron) SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronType:parameterA:parameterB:parameterC:"), neuronType, parameterA, parameterB, parameterC) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935585-neuronparameterb?language=objc +func (m_ MatrixNeuron) NeuronParameterB() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterB")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935606-encodetocommandbuffer?language=objc +func (m_ MatrixNeuron) EncodeToCommandBufferInputMatrixBiasVectorResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:biasVector:resultMatrix:"), po0, objc.Ptr(inputMatrix), objc.Ptr(biasVector), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935606-encodetocommandbuffer?language=objc +func (m_ MatrixNeuron) EncodeToCommandBufferObjectInputMatrixBiasVectorResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, biasVector IVector, resultMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:biasVector:resultMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputMatrix), objc.Ptr(biasVector), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935610-setneurontopreluwithparametersa?language=objc +func (m_ MatrixNeuron) SetNeuronToPReLUWithParametersA(A []byte) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronToPReLUWithParametersA:"), A) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935598-neuronparameterc?language=objc +func (m_ MatrixNeuron) NeuronParameterC() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterC")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935605-alpha?language=objc +func (m_ MatrixNeuron) Alpha() float64 { + rv := objc.Call[float64](m_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935605-alpha?language=objc +func (m_ MatrixNeuron) SetAlpha(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setAlpha:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935607-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixNeuron) SourceNumberOfFeatureVectors() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceNumberOfFeatureVectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935607-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixNeuron) SetSourceNumberOfFeatureVectors(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceNumberOfFeatureVectors:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935599-sourceinputfeaturechannels?language=objc +func (m_ MatrixNeuron) SourceInputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceInputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneuron/2935599-sourceinputfeaturechannels?language=objc +func (m_ MatrixNeuron) SetSourceInputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceInputFeatureChannels:"), value) +} diff --git a/macos/mps/matrix_neuron_gradient.gen.go b/macos/mps/matrix_neuron_gradient.gen.go new file mode 100644 index 00000000..155cc573 --- /dev/null +++ b/macos/mps/matrix_neuron_gradient.gen.go @@ -0,0 +1,210 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixNeuronGradient] class. +var MatrixNeuronGradientClass = _MatrixNeuronGradientClass{objc.GetClass("MPSMatrixNeuronGradient")} + +type _MatrixNeuronGradientClass struct { + objc.Class +} + +// An interface definition for the [MatrixNeuronGradient] class. +type IMatrixNeuronGradient interface { + IMatrixBinaryKernel + NeuronParameterA() float64 + NeuronType() CNNNeuronType + SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) + NeuronParameterB() float64 + EncodeToCommandBufferGradientMatrixInputMatrixBiasVectorResultGradientForDataMatrixResultGradientForBiasVector(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, inputMatrix IMatrix, biasVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForBiasVector IVector) + EncodeToCommandBufferObjectGradientMatrixInputMatrixBiasVectorResultGradientForDataMatrixResultGradientForBiasVector(commandBufferObject objc.IObject, gradientMatrix IMatrix, inputMatrix IMatrix, biasVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForBiasVector IVector) + SetNeuronToPReLUWithParametersA(A []byte) + NeuronParameterC() float64 + Alpha() float64 + SetAlpha(value float64) + SourceNumberOfFeatureVectors() uint + SetSourceNumberOfFeatureVectors(value uint) + SourceInputFeatureChannels() uint + SetSourceInputFeatureChannels(value uint) +} + +// A gradient neuron activation kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient?language=objc +type MatrixNeuronGradient struct { + MatrixBinaryKernel +} + +func MatrixNeuronGradientFrom(ptr unsafe.Pointer) MatrixNeuronGradient { + return MatrixNeuronGradient{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixNeuronGradient) InitWithDevice(device metal.PDevice) MatrixNeuronGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixNeuronGradient](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966677-initwithdevice?language=objc +func NewMatrixNeuronGradientWithDevice(device metal.PDevice) MatrixNeuronGradient { + instance := MatrixNeuronGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixNeuronGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixNeuronGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixNeuronGradient](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966674-copywithzone?language=objc +func MatrixNeuronGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixNeuronGradient { + instance := MatrixNeuronGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixNeuronGradientClass) Alloc() MatrixNeuronGradient { + rv := objc.Call[MatrixNeuronGradient](mc, objc.Sel("alloc")) + return rv +} + +func MatrixNeuronGradient_Alloc() MatrixNeuronGradient { + return MatrixNeuronGradientClass.Alloc() +} + +func (mc _MatrixNeuronGradientClass) New() MatrixNeuronGradient { + rv := objc.Call[MatrixNeuronGradient](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixNeuronGradient() MatrixNeuronGradient { + return MatrixNeuronGradientClass.New() +} + +func (m_ MatrixNeuronGradient) Init() MatrixNeuronGradient { + rv := objc.Call[MatrixNeuronGradient](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966678-neuronparametera?language=objc +func (m_ MatrixNeuronGradient) NeuronParameterA() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterA")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966681-neurontype?language=objc +func (m_ MatrixNeuronGradient) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](m_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966683-setneurontype?language=objc +func (m_ MatrixNeuronGradient) SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronType:parameterA:parameterB:parameterC:"), neuronType, parameterA, parameterB, parameterC) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966679-neuronparameterb?language=objc +func (m_ MatrixNeuronGradient) NeuronParameterB() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterB")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966675-encodetocommandbuffer?language=objc +func (m_ MatrixNeuronGradient) EncodeToCommandBufferGradientMatrixInputMatrixBiasVectorResultGradientForDataMatrixResultGradientForBiasVector(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, inputMatrix IMatrix, biasVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForBiasVector IVector) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:gradientMatrix:inputMatrix:biasVector:resultGradientForDataMatrix:resultGradientForBiasVector:"), po0, objc.Ptr(gradientMatrix), objc.Ptr(inputMatrix), objc.Ptr(biasVector), objc.Ptr(resultGradientForDataMatrix), objc.Ptr(resultGradientForBiasVector)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966675-encodetocommandbuffer?language=objc +func (m_ MatrixNeuronGradient) EncodeToCommandBufferObjectGradientMatrixInputMatrixBiasVectorResultGradientForDataMatrixResultGradientForBiasVector(commandBufferObject objc.IObject, gradientMatrix IMatrix, inputMatrix IMatrix, biasVector IVector, resultGradientForDataMatrix IMatrix, resultGradientForBiasVector IVector) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:gradientMatrix:inputMatrix:biasVector:resultGradientForDataMatrix:resultGradientForBiasVector:"), objc.Ptr(commandBufferObject), objc.Ptr(gradientMatrix), objc.Ptr(inputMatrix), objc.Ptr(biasVector), objc.Ptr(resultGradientForDataMatrix), objc.Ptr(resultGradientForBiasVector)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966682-setneurontopreluwithparametersa?language=objc +func (m_ MatrixNeuronGradient) SetNeuronToPReLUWithParametersA(A []byte) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronToPReLUWithParametersA:"), A) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966680-neuronparameterc?language=objc +func (m_ MatrixNeuronGradient) NeuronParameterC() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterC")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966673-alpha?language=objc +func (m_ MatrixNeuronGradient) Alpha() float64 { + rv := objc.Call[float64](m_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966673-alpha?language=objc +func (m_ MatrixNeuronGradient) SetAlpha(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setAlpha:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966685-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixNeuronGradient) SourceNumberOfFeatureVectors() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceNumberOfFeatureVectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966685-sourcenumberoffeaturevectors?language=objc +func (m_ MatrixNeuronGradient) SetSourceNumberOfFeatureVectors(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceNumberOfFeatureVectors:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966684-sourceinputfeaturechannels?language=objc +func (m_ MatrixNeuronGradient) SourceInputFeatureChannels() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceInputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixneurongradient/2966684-sourceinputfeaturechannels?language=objc +func (m_ MatrixNeuronGradient) SetSourceInputFeatureChannels(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceInputFeatureChannels:"), value) +} diff --git a/macos/mps/matrix_random.gen.go b/macos/mps/matrix_random.gen.go new file mode 100644 index 00000000..1ef8c5b2 --- /dev/null +++ b/macos/mps/matrix_random.gen.go @@ -0,0 +1,159 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixRandom] class. +var MatrixRandomClass = _MatrixRandomClass{objc.GetClass("MPSMatrixRandom")} + +type _MatrixRandomClass struct { + objc.Class +} + +// An interface definition for the [MatrixRandom] class. +type IMatrixRandom interface { + IKernel + EncodeToCommandBufferDestinationMatrix(commandBuffer metal.PCommandBuffer, destinationMatrix IMatrix) + EncodeToCommandBufferObjectDestinationMatrix(commandBufferObject objc.IObject, destinationMatrix IMatrix) + DistributionType() MatrixRandomDistribution + DestinationDataType() DataType + BatchStart() uint + SetBatchStart(value uint) + BatchSize() uint + SetBatchSize(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom?language=objc +type MatrixRandom struct { + Kernel +} + +func MatrixRandomFrom(ptr unsafe.Pointer) MatrixRandom { + return MatrixRandom{ + Kernel: KernelFrom(ptr), + } +} + +func (mc _MatrixRandomClass) Alloc() MatrixRandom { + rv := objc.Call[MatrixRandom](mc, objc.Sel("alloc")) + return rv +} + +func MatrixRandom_Alloc() MatrixRandom { + return MatrixRandomClass.Alloc() +} + +func (mc _MatrixRandomClass) New() MatrixRandom { + rv := objc.Call[MatrixRandom](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixRandom() MatrixRandom { + return MatrixRandomClass.New() +} + +func (m_ MatrixRandom) Init() MatrixRandom { + rv := objc.Call[MatrixRandom](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixRandom) InitWithDevice(device metal.PDevice) MatrixRandom { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixRandom](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixRandomWithDevice(device metal.PDevice) MatrixRandom { + instance := MatrixRandomClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixRandom) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixRandom { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixRandom](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixRandom_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixRandom { + instance := MatrixRandomClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3325839-encodetocommandbuffer?language=objc +func (m_ MatrixRandom) EncodeToCommandBufferDestinationMatrix(commandBuffer metal.PCommandBuffer, destinationMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:destinationMatrix:"), po0, objc.Ptr(destinationMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3325839-encodetocommandbuffer?language=objc +func (m_ MatrixRandom) EncodeToCommandBufferObjectDestinationMatrix(commandBufferObject objc.IObject, destinationMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:destinationMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(destinationMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3242850-distributiontype?language=objc +func (m_ MatrixRandom) DistributionType() MatrixRandomDistribution { + rv := objc.Call[MatrixRandomDistribution](m_, objc.Sel("distributionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3242849-destinationdatatype?language=objc +func (m_ MatrixRandom) DestinationDataType() DataType { + rv := objc.Call[DataType](m_, objc.Sel("destinationDataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3242848-batchstart?language=objc +func (m_ MatrixRandom) BatchStart() uint { + rv := objc.Call[uint](m_, objc.Sel("batchStart")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3242848-batchstart?language=objc +func (m_ MatrixRandom) SetBatchStart(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchStart:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3242847-batchsize?language=objc +func (m_ MatrixRandom) BatchSize() uint { + rv := objc.Call[uint](m_, objc.Sel("batchSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom/3242847-batchsize?language=objc +func (m_ MatrixRandom) SetBatchSize(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchSize:"), value) +} diff --git a/macos/mps/matrix_random_distribution_descriptor.gen.go b/macos/mps/matrix_random_distribution_descriptor.gen.go new file mode 100644 index 00000000..27939901 --- /dev/null +++ b/macos/mps/matrix_random_distribution_descriptor.gen.go @@ -0,0 +1,188 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixRandomDistributionDescriptor] class. +var MatrixRandomDistributionDescriptorClass = _MatrixRandomDistributionDescriptorClass{objc.GetClass("MPSMatrixRandomDistributionDescriptor")} + +type _MatrixRandomDistributionDescriptorClass struct { + objc.Class +} + +// An interface definition for the [MatrixRandomDistributionDescriptor] class. +type IMatrixRandomDistributionDescriptor interface { + objc.IObject + DistributionType() MatrixRandomDistribution + SetDistributionType(value MatrixRandomDistribution) + Minimum() float64 + SetMinimum(value float64) + StandardDeviation() float64 + SetStandardDeviation(value float64) + Maximum() float64 + SetMaximum(value float64) + Mean() float64 + SetMean(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor?language=objc +type MatrixRandomDistributionDescriptor struct { + objc.Object +} + +func MatrixRandomDistributionDescriptorFrom(ptr unsafe.Pointer) MatrixRandomDistributionDescriptor { + return MatrixRandomDistributionDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (mc _MatrixRandomDistributionDescriptorClass) Alloc() MatrixRandomDistributionDescriptor { + rv := objc.Call[MatrixRandomDistributionDescriptor](mc, objc.Sel("alloc")) + return rv +} + +func MatrixRandomDistributionDescriptor_Alloc() MatrixRandomDistributionDescriptor { + return MatrixRandomDistributionDescriptorClass.Alloc() +} + +func (mc _MatrixRandomDistributionDescriptorClass) New() MatrixRandomDistributionDescriptor { + rv := objc.Call[MatrixRandomDistributionDescriptor](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixRandomDistributionDescriptor() MatrixRandomDistributionDescriptor { + return MatrixRandomDistributionDescriptorClass.New() +} + +func (m_ MatrixRandomDistributionDescriptor) Init() MatrixRandomDistributionDescriptor { + rv := objc.Call[MatrixRandomDistributionDescriptor](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242862-uniformdistributiondescriptorwit?language=objc +func (mc _MatrixRandomDistributionDescriptorClass) UniformDistributionDescriptorWithMinimumMaximum(minimum float64, maximum float64) MatrixRandomDistributionDescriptor { + rv := objc.Call[MatrixRandomDistributionDescriptor](mc, objc.Sel("uniformDistributionDescriptorWithMinimum:maximum:"), minimum, maximum) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242862-uniformdistributiondescriptorwit?language=objc +func MatrixRandomDistributionDescriptor_UniformDistributionDescriptorWithMinimumMaximum(minimum float64, maximum float64) MatrixRandomDistributionDescriptor { + return MatrixRandomDistributionDescriptorClass.UniformDistributionDescriptorWithMinimumMaximum(minimum, maximum) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3547979-normaldistributiondescriptorwith?language=objc +func (mc _MatrixRandomDistributionDescriptorClass) NormalDistributionDescriptorWithMeanStandardDeviation(mean float64, standardDeviation float64) MatrixRandomDistributionDescriptor { + rv := objc.Call[MatrixRandomDistributionDescriptor](mc, objc.Sel("normalDistributionDescriptorWithMean:standardDeviation:"), mean, standardDeviation) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3547979-normaldistributiondescriptorwith?language=objc +func MatrixRandomDistributionDescriptor_NormalDistributionDescriptorWithMeanStandardDeviation(mean float64, standardDeviation float64) MatrixRandomDistributionDescriptor { + return MatrixRandomDistributionDescriptorClass.NormalDistributionDescriptorWithMeanStandardDeviation(mean, standardDeviation) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242856-defaultdistributiondescriptor?language=objc +func (mc _MatrixRandomDistributionDescriptorClass) DefaultDistributionDescriptor() MatrixRandomDistributionDescriptor { + rv := objc.Call[MatrixRandomDistributionDescriptor](mc, objc.Sel("defaultDistributionDescriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242856-defaultdistributiondescriptor?language=objc +func MatrixRandomDistributionDescriptor_DefaultDistributionDescriptor() MatrixRandomDistributionDescriptor { + return MatrixRandomDistributionDescriptorClass.DefaultDistributionDescriptor() +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242857-distributiontype?language=objc +func (m_ MatrixRandomDistributionDescriptor) DistributionType() MatrixRandomDistribution { + rv := objc.Call[MatrixRandomDistribution](m_, objc.Sel("distributionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242857-distributiontype?language=objc +func (m_ MatrixRandomDistributionDescriptor) SetDistributionType(value MatrixRandomDistribution) { + objc.Call[objc.Void](m_, objc.Sel("setDistributionType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242860-minimum?language=objc +func (m_ MatrixRandomDistributionDescriptor) Minimum() float64 { + rv := objc.Call[float64](m_, objc.Sel("minimum")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242860-minimum?language=objc +func (m_ MatrixRandomDistributionDescriptor) SetMinimum(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setMinimum:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242861-standarddeviation?language=objc +func (m_ MatrixRandomDistributionDescriptor) StandardDeviation() float64 { + rv := objc.Call[float64](m_, objc.Sel("standardDeviation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242861-standarddeviation?language=objc +func (m_ MatrixRandomDistributionDescriptor) SetStandardDeviation(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setStandardDeviation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242858-maximum?language=objc +func (m_ MatrixRandomDistributionDescriptor) Maximum() float64 { + rv := objc.Call[float64](m_, objc.Sel("maximum")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242858-maximum?language=objc +func (m_ MatrixRandomDistributionDescriptor) SetMaximum(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setMaximum:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242859-mean?language=objc +func (m_ MatrixRandomDistributionDescriptor) Mean() float64 { + rv := objc.Call[float64](m_, objc.Sel("mean")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor/3242859-mean?language=objc +func (m_ MatrixRandomDistributionDescriptor) SetMean(value float64) { + objc.Call[objc.Void](m_, objc.Sel("setMean:"), value) +} diff --git a/macos/mps/matrix_random_mtg_p32.gen.go b/macos/mps/matrix_random_mtg_p32.gen.go new file mode 100644 index 00000000..c5456c57 --- /dev/null +++ b/macos/mps/matrix_random_mtg_p32.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixRandomMTGP32] class. +var MatrixRandomMTGP32Class = _MatrixRandomMTGP32Class{objc.GetClass("MPSMatrixRandomMTGP32")} + +type _MatrixRandomMTGP32Class struct { + objc.Class +} + +// An interface definition for the [MatrixRandomMTGP32] class. +type IMatrixRandomMTGP32 interface { + IMatrixRandom + SynchronizeStateOnCommandBuffer(commandBuffer metal.PCommandBuffer) + SynchronizeStateOnCommandBufferObject(commandBufferObject objc.IObject) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandommtgp32?language=objc +type MatrixRandomMTGP32 struct { + MatrixRandom +} + +func MatrixRandomMTGP32From(ptr unsafe.Pointer) MatrixRandomMTGP32 { + return MatrixRandomMTGP32{ + MatrixRandom: MatrixRandomFrom(ptr), + } +} + +func (m_ MatrixRandomMTGP32) InitWithDevice(device metal.PDevice) MatrixRandomMTGP32 { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixRandomMTGP32](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandommtgp32/3242865-initwithdevice?language=objc +func NewMatrixRandomMTGP32WithDevice(device metal.PDevice) MatrixRandomMTGP32 { + instance := MatrixRandomMTGP32Class.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (mc _MatrixRandomMTGP32Class) Alloc() MatrixRandomMTGP32 { + rv := objc.Call[MatrixRandomMTGP32](mc, objc.Sel("alloc")) + return rv +} + +func MatrixRandomMTGP32_Alloc() MatrixRandomMTGP32 { + return MatrixRandomMTGP32Class.Alloc() +} + +func (mc _MatrixRandomMTGP32Class) New() MatrixRandomMTGP32 { + rv := objc.Call[MatrixRandomMTGP32](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixRandomMTGP32() MatrixRandomMTGP32 { + return MatrixRandomMTGP32Class.New() +} + +func (m_ MatrixRandomMTGP32) Init() MatrixRandomMTGP32 { + rv := objc.Call[MatrixRandomMTGP32](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixRandomMTGP32) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixRandomMTGP32 { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixRandomMTGP32](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixRandomMTGP32_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixRandomMTGP32 { + instance := MatrixRandomMTGP32Class.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandommtgp32/3242868-synchronizestateoncommandbuffer?language=objc +func (m_ MatrixRandomMTGP32) SynchronizeStateOnCommandBuffer(commandBuffer metal.PCommandBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("synchronizeStateOnCommandBuffer:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandommtgp32/3242868-synchronizestateoncommandbuffer?language=objc +func (m_ MatrixRandomMTGP32) SynchronizeStateOnCommandBufferObject(commandBufferObject objc.IObject) { + objc.Call[objc.Void](m_, objc.Sel("synchronizeStateOnCommandBuffer:"), objc.Ptr(commandBufferObject)) +} diff --git a/macos/mps/matrix_random_philox.gen.go b/macos/mps/matrix_random_philox.gen.go new file mode 100644 index 00000000..cff6e1b6 --- /dev/null +++ b/macos/mps/matrix_random_philox.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixRandomPhilox] class. +var MatrixRandomPhiloxClass = _MatrixRandomPhiloxClass{objc.GetClass("MPSMatrixRandomPhilox")} + +type _MatrixRandomPhiloxClass struct { + objc.Class +} + +// An interface definition for the [MatrixRandomPhilox] class. +type IMatrixRandomPhilox interface { + IMatrixRandom +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomphilox?language=objc +type MatrixRandomPhilox struct { + MatrixRandom +} + +func MatrixRandomPhiloxFrom(ptr unsafe.Pointer) MatrixRandomPhilox { + return MatrixRandomPhilox{ + MatrixRandom: MatrixRandomFrom(ptr), + } +} + +func (m_ MatrixRandomPhilox) InitWithDevice(device metal.PDevice) MatrixRandomPhilox { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixRandomPhilox](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomphilox/3242871-initwithdevice?language=objc +func NewMatrixRandomPhiloxWithDevice(device metal.PDevice) MatrixRandomPhilox { + instance := MatrixRandomPhiloxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (mc _MatrixRandomPhiloxClass) Alloc() MatrixRandomPhilox { + rv := objc.Call[MatrixRandomPhilox](mc, objc.Sel("alloc")) + return rv +} + +func MatrixRandomPhilox_Alloc() MatrixRandomPhilox { + return MatrixRandomPhiloxClass.Alloc() +} + +func (mc _MatrixRandomPhiloxClass) New() MatrixRandomPhilox { + rv := objc.Call[MatrixRandomPhilox](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixRandomPhilox() MatrixRandomPhilox { + return MatrixRandomPhiloxClass.New() +} + +func (m_ MatrixRandomPhilox) Init() MatrixRandomPhilox { + rv := objc.Call[MatrixRandomPhilox](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixRandomPhilox) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixRandomPhilox { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixRandomPhilox](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixRandomPhilox_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixRandomPhilox { + instance := MatrixRandomPhiloxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/matrix_soft_max.gen.go b/macos/mps/matrix_soft_max.gen.go new file mode 100644 index 00000000..62b816d9 --- /dev/null +++ b/macos/mps/matrix_soft_max.gen.go @@ -0,0 +1,141 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixSoftMax] class. +var MatrixSoftMaxClass = _MatrixSoftMaxClass{objc.GetClass("MPSMatrixSoftMax")} + +type _MatrixSoftMaxClass struct { + objc.Class +} + +// An interface definition for the [MatrixSoftMax] class. +type IMatrixSoftMax interface { + IMatrixUnaryKernel + EncodeToCommandBufferInputMatrixResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, resultMatrix IMatrix) + EncodeToCommandBufferObjectInputMatrixResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, resultMatrix IMatrix) + SourceRows() uint + SetSourceRows(value uint) + SourceColumns() uint + SetSourceColumns(value uint) +} + +// A softmax kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax?language=objc +type MatrixSoftMax struct { + MatrixUnaryKernel +} + +func MatrixSoftMaxFrom(ptr unsafe.Pointer) MatrixSoftMax { + return MatrixSoftMax{ + MatrixUnaryKernel: MatrixUnaryKernelFrom(ptr), + } +} + +func (m_ MatrixSoftMax) InitWithDevice(device metal.PDevice) MatrixSoftMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSoftMax](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935562-initwithdevice?language=objc +func NewMatrixSoftMaxWithDevice(device metal.PDevice) MatrixSoftMax { + instance := MatrixSoftMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixSoftMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSoftMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSoftMax](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935566-copywithzone?language=objc +func MatrixSoftMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSoftMax { + instance := MatrixSoftMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixSoftMaxClass) Alloc() MatrixSoftMax { + rv := objc.Call[MatrixSoftMax](mc, objc.Sel("alloc")) + return rv +} + +func MatrixSoftMax_Alloc() MatrixSoftMax { + return MatrixSoftMaxClass.Alloc() +} + +func (mc _MatrixSoftMaxClass) New() MatrixSoftMax { + rv := objc.Call[MatrixSoftMax](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixSoftMax() MatrixSoftMax { + return MatrixSoftMaxClass.New() +} + +func (m_ MatrixSoftMax) Init() MatrixSoftMax { + rv := objc.Call[MatrixSoftMax](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935563-encodetocommandbuffer?language=objc +func (m_ MatrixSoftMax) EncodeToCommandBufferInputMatrixResultMatrix(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, resultMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:resultMatrix:"), po0, objc.Ptr(inputMatrix), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935563-encodetocommandbuffer?language=objc +func (m_ MatrixSoftMax) EncodeToCommandBufferObjectInputMatrixResultMatrix(commandBufferObject objc.IObject, inputMatrix IMatrix, resultMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:resultMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputMatrix), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935561-sourcerows?language=objc +func (m_ MatrixSoftMax) SourceRows() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceRows")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935561-sourcerows?language=objc +func (m_ MatrixSoftMax) SetSourceRows(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceRows:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935560-sourcecolumns?language=objc +func (m_ MatrixSoftMax) SourceColumns() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceColumns")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmax/2935560-sourcecolumns?language=objc +func (m_ MatrixSoftMax) SetSourceColumns(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceColumns:"), value) +} diff --git a/macos/mps/matrix_soft_max_gradient.gen.go b/macos/mps/matrix_soft_max_gradient.gen.go new file mode 100644 index 00000000..01257be8 --- /dev/null +++ b/macos/mps/matrix_soft_max_gradient.gen.go @@ -0,0 +1,141 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixSoftMaxGradient] class. +var MatrixSoftMaxGradientClass = _MatrixSoftMaxGradientClass{objc.GetClass("MPSMatrixSoftMaxGradient")} + +type _MatrixSoftMaxGradientClass struct { + objc.Class +} + +// An interface definition for the [MatrixSoftMaxGradient] class. +type IMatrixSoftMaxGradient interface { + IMatrixBinaryKernel + EncodeToCommandBufferGradientMatrixForwardOutputMatrixResultMatrix(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, forwardOutputMatrix IMatrix, resultMatrix IMatrix) + EncodeToCommandBufferObjectGradientMatrixForwardOutputMatrixResultMatrix(commandBufferObject objc.IObject, gradientMatrix IMatrix, forwardOutputMatrix IMatrix, resultMatrix IMatrix) + SourceRows() uint + SetSourceRows(value uint) + SourceColumns() uint + SetSourceColumns(value uint) +} + +// A gradient softmax kernel that operates on matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient?language=objc +type MatrixSoftMaxGradient struct { + MatrixBinaryKernel +} + +func MatrixSoftMaxGradientFrom(ptr unsafe.Pointer) MatrixSoftMaxGradient { + return MatrixSoftMaxGradient{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixSoftMaxGradient) InitWithDevice(device metal.PDevice) MatrixSoftMaxGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSoftMaxGradient](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966654-initwithdevice?language=objc +func NewMatrixSoftMaxGradientWithDevice(device metal.PDevice) MatrixSoftMaxGradient { + instance := MatrixSoftMaxGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixSoftMaxGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSoftMaxGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSoftMaxGradient](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966651-copywithzone?language=objc +func MatrixSoftMaxGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSoftMaxGradient { + instance := MatrixSoftMaxGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (mc _MatrixSoftMaxGradientClass) Alloc() MatrixSoftMaxGradient { + rv := objc.Call[MatrixSoftMaxGradient](mc, objc.Sel("alloc")) + return rv +} + +func MatrixSoftMaxGradient_Alloc() MatrixSoftMaxGradient { + return MatrixSoftMaxGradientClass.Alloc() +} + +func (mc _MatrixSoftMaxGradientClass) New() MatrixSoftMaxGradient { + rv := objc.Call[MatrixSoftMaxGradient](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixSoftMaxGradient() MatrixSoftMaxGradient { + return MatrixSoftMaxGradientClass.New() +} + +func (m_ MatrixSoftMaxGradient) Init() MatrixSoftMaxGradient { + rv := objc.Call[MatrixSoftMaxGradient](m_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966652-encodetocommandbuffer?language=objc +func (m_ MatrixSoftMaxGradient) EncodeToCommandBufferGradientMatrixForwardOutputMatrixResultMatrix(commandBuffer metal.PCommandBuffer, gradientMatrix IMatrix, forwardOutputMatrix IMatrix, resultMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:gradientMatrix:forwardOutputMatrix:resultMatrix:"), po0, objc.Ptr(gradientMatrix), objc.Ptr(forwardOutputMatrix), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966652-encodetocommandbuffer?language=objc +func (m_ MatrixSoftMaxGradient) EncodeToCommandBufferObjectGradientMatrixForwardOutputMatrixResultMatrix(commandBufferObject objc.IObject, gradientMatrix IMatrix, forwardOutputMatrix IMatrix, resultMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:gradientMatrix:forwardOutputMatrix:resultMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(gradientMatrix), objc.Ptr(forwardOutputMatrix), objc.Ptr(resultMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966656-sourcerows?language=objc +func (m_ MatrixSoftMaxGradient) SourceRows() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceRows")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966656-sourcerows?language=objc +func (m_ MatrixSoftMaxGradient) SetSourceRows(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceRows:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966655-sourcecolumns?language=objc +func (m_ MatrixSoftMaxGradient) SourceColumns() uint { + rv := objc.Call[uint](m_, objc.Sel("sourceColumns")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsoftmaxgradient/2966655-sourcecolumns?language=objc +func (m_ MatrixSoftMaxGradient) SetSourceColumns(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setSourceColumns:"), value) +} diff --git a/macos/mps/matrix_solve_cholesky.gen.go b/macos/mps/matrix_solve_cholesky.gen.go new file mode 100644 index 00000000..48d3c52b --- /dev/null +++ b/macos/mps/matrix_solve_cholesky.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixSolveCholesky] class. +var MatrixSolveCholeskyClass = _MatrixSolveCholeskyClass{objc.GetClass("MPSMatrixSolveCholesky")} + +type _MatrixSolveCholeskyClass struct { + objc.Class +} + +// An interface definition for the [MatrixSolveCholesky] class. +type IMatrixSolveCholesky interface { + IMatrixBinaryKernel + EncodeToCommandBufferSourceMatrixRightHandSideMatrixSolutionMatrix(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) + EncodeToCommandBufferObjectSourceMatrixRightHandSideMatrixSolutionMatrix(commandBufferObject objc.IObject, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) +} + +// A kernel for computing the solution of a linear system of equations using a Cholesky factorization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvecholesky?language=objc +type MatrixSolveCholesky struct { + MatrixBinaryKernel +} + +func MatrixSolveCholeskyFrom(ptr unsafe.Pointer) MatrixSolveCholesky { + return MatrixSolveCholesky{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixSolveCholesky) InitWithDeviceUpperOrderNumberOfRightHandSides(device metal.PDevice, upper bool, order uint, numberOfRightHandSides uint) MatrixSolveCholesky { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveCholesky](m_, objc.Sel("initWithDevice:upper:order:numberOfRightHandSides:"), po0, upper, order, numberOfRightHandSides) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvecholesky/2873006-initwithdevice?language=objc +func NewMatrixSolveCholeskyWithDeviceUpperOrderNumberOfRightHandSides(device metal.PDevice, upper bool, order uint, numberOfRightHandSides uint) MatrixSolveCholesky { + instance := MatrixSolveCholeskyClass.Alloc().InitWithDeviceUpperOrderNumberOfRightHandSides(device, upper, order, numberOfRightHandSides) + instance.Autorelease() + return instance +} + +func (mc _MatrixSolveCholeskyClass) Alloc() MatrixSolveCholesky { + rv := objc.Call[MatrixSolveCholesky](mc, objc.Sel("alloc")) + return rv +} + +func MatrixSolveCholesky_Alloc() MatrixSolveCholesky { + return MatrixSolveCholeskyClass.Alloc() +} + +func (mc _MatrixSolveCholeskyClass) New() MatrixSolveCholesky { + rv := objc.Call[MatrixSolveCholesky](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixSolveCholesky() MatrixSolveCholesky { + return MatrixSolveCholeskyClass.New() +} + +func (m_ MatrixSolveCholesky) Init() MatrixSolveCholesky { + rv := objc.Call[MatrixSolveCholesky](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixSolveCholesky) InitWithDevice(device metal.PDevice) MatrixSolveCholesky { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveCholesky](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixSolveCholeskyWithDevice(device metal.PDevice) MatrixSolveCholesky { + instance := MatrixSolveCholeskyClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixSolveCholesky) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSolveCholesky { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveCholesky](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixSolveCholesky_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSolveCholesky { + instance := MatrixSolveCholeskyClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvecholesky/2866957-encodetocommandbuffer?language=objc +func (m_ MatrixSolveCholesky) EncodeToCommandBufferSourceMatrixRightHandSideMatrixSolutionMatrix(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:"), po0, objc.Ptr(sourceMatrix), objc.Ptr(rightHandSideMatrix), objc.Ptr(solutionMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvecholesky/2866957-encodetocommandbuffer?language=objc +func (m_ MatrixSolveCholesky) EncodeToCommandBufferObjectSourceMatrixRightHandSideMatrixSolutionMatrix(commandBufferObject objc.IObject, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceMatrix), objc.Ptr(rightHandSideMatrix), objc.Ptr(solutionMatrix)) +} diff --git a/macos/mps/matrix_solve_lu.gen.go b/macos/mps/matrix_solve_lu.gen.go new file mode 100644 index 00000000..73fcfe61 --- /dev/null +++ b/macos/mps/matrix_solve_lu.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixSolveLU] class. +var MatrixSolveLUClass = _MatrixSolveLUClass{objc.GetClass("MPSMatrixSolveLU")} + +type _MatrixSolveLUClass struct { + objc.Class +} + +// An interface definition for the [MatrixSolveLU] class. +type IMatrixSolveLU interface { + IMatrixBinaryKernel + EncodeToCommandBufferSourceMatrixRightHandSideMatrixPivotIndicesSolutionMatrix(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, pivotIndices IMatrix, solutionMatrix IMatrix) + EncodeToCommandBufferObjectSourceMatrixRightHandSideMatrixPivotIndicesSolutionMatrix(commandBufferObject objc.IObject, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, pivotIndices IMatrix, solutionMatrix IMatrix) +} + +// A kernel for computing the solution of a linear system of equations using an LU factorization. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvelu?language=objc +type MatrixSolveLU struct { + MatrixBinaryKernel +} + +func MatrixSolveLUFrom(ptr unsafe.Pointer) MatrixSolveLU { + return MatrixSolveLU{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixSolveLU) InitWithDeviceTransposeOrderNumberOfRightHandSides(device metal.PDevice, transpose bool, order uint, numberOfRightHandSides uint) MatrixSolveLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveLU](m_, objc.Sel("initWithDevice:transpose:order:numberOfRightHandSides:"), po0, transpose, order, numberOfRightHandSides) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvelu/2873005-initwithdevice?language=objc +func NewMatrixSolveLUWithDeviceTransposeOrderNumberOfRightHandSides(device metal.PDevice, transpose bool, order uint, numberOfRightHandSides uint) MatrixSolveLU { + instance := MatrixSolveLUClass.Alloc().InitWithDeviceTransposeOrderNumberOfRightHandSides(device, transpose, order, numberOfRightHandSides) + instance.Autorelease() + return instance +} + +func (mc _MatrixSolveLUClass) Alloc() MatrixSolveLU { + rv := objc.Call[MatrixSolveLU](mc, objc.Sel("alloc")) + return rv +} + +func MatrixSolveLU_Alloc() MatrixSolveLU { + return MatrixSolveLUClass.Alloc() +} + +func (mc _MatrixSolveLUClass) New() MatrixSolveLU { + rv := objc.Call[MatrixSolveLU](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixSolveLU() MatrixSolveLU { + return MatrixSolveLUClass.New() +} + +func (m_ MatrixSolveLU) Init() MatrixSolveLU { + rv := objc.Call[MatrixSolveLU](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixSolveLU) InitWithDevice(device metal.PDevice) MatrixSolveLU { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveLU](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixSolveLUWithDevice(device metal.PDevice) MatrixSolveLU { + instance := MatrixSolveLUClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixSolveLU) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSolveLU { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveLU](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixSolveLU_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSolveLU { + instance := MatrixSolveLUClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvelu/2867074-encodetocommandbuffer?language=objc +func (m_ MatrixSolveLU) EncodeToCommandBufferSourceMatrixRightHandSideMatrixPivotIndicesSolutionMatrix(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, pivotIndices IMatrix, solutionMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:pivotIndices:solutionMatrix:"), po0, objc.Ptr(sourceMatrix), objc.Ptr(rightHandSideMatrix), objc.Ptr(pivotIndices), objc.Ptr(solutionMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvelu/2867074-encodetocommandbuffer?language=objc +func (m_ MatrixSolveLU) EncodeToCommandBufferObjectSourceMatrixRightHandSideMatrixPivotIndicesSolutionMatrix(commandBufferObject objc.IObject, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, pivotIndices IMatrix, solutionMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:pivotIndices:solutionMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceMatrix), objc.Ptr(rightHandSideMatrix), objc.Ptr(pivotIndices), objc.Ptr(solutionMatrix)) +} diff --git a/macos/mps/matrix_solve_triangular.gen.go b/macos/mps/matrix_solve_triangular.gen.go new file mode 100644 index 00000000..70704119 --- /dev/null +++ b/macos/mps/matrix_solve_triangular.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixSolveTriangular] class. +var MatrixSolveTriangularClass = _MatrixSolveTriangularClass{objc.GetClass("MPSMatrixSolveTriangular")} + +type _MatrixSolveTriangularClass struct { + objc.Class +} + +// An interface definition for the [MatrixSolveTriangular] class. +type IMatrixSolveTriangular interface { + IMatrixBinaryKernel + EncodeToCommandBufferSourceMatrixRightHandSideMatrixSolutionMatrix(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) + EncodeToCommandBufferObjectSourceMatrixRightHandSideMatrixSolutionMatrix(commandBufferObject objc.IObject, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) +} + +// A kernel for computing the solution of a linear system of equations using a triangular coefficient matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvetriangular?language=objc +type MatrixSolveTriangular struct { + MatrixBinaryKernel +} + +func MatrixSolveTriangularFrom(ptr unsafe.Pointer) MatrixSolveTriangular { + return MatrixSolveTriangular{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixSolveTriangular) InitWithDeviceRightUpperTransposeUnitOrderNumberOfRightHandSidesAlpha(device metal.PDevice, right bool, upper bool, transpose bool, unit bool, order uint, numberOfRightHandSides uint, alpha float64) MatrixSolveTriangular { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveTriangular](m_, objc.Sel("initWithDevice:right:upper:transpose:unit:order:numberOfRightHandSides:alpha:"), po0, right, upper, transpose, unit, order, numberOfRightHandSides, alpha) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvetriangular/2873007-initwithdevice?language=objc +func NewMatrixSolveTriangularWithDeviceRightUpperTransposeUnitOrderNumberOfRightHandSidesAlpha(device metal.PDevice, right bool, upper bool, transpose bool, unit bool, order uint, numberOfRightHandSides uint, alpha float64) MatrixSolveTriangular { + instance := MatrixSolveTriangularClass.Alloc().InitWithDeviceRightUpperTransposeUnitOrderNumberOfRightHandSidesAlpha(device, right, upper, transpose, unit, order, numberOfRightHandSides, alpha) + instance.Autorelease() + return instance +} + +func (mc _MatrixSolveTriangularClass) Alloc() MatrixSolveTriangular { + rv := objc.Call[MatrixSolveTriangular](mc, objc.Sel("alloc")) + return rv +} + +func MatrixSolveTriangular_Alloc() MatrixSolveTriangular { + return MatrixSolveTriangularClass.Alloc() +} + +func (mc _MatrixSolveTriangularClass) New() MatrixSolveTriangular { + rv := objc.Call[MatrixSolveTriangular](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixSolveTriangular() MatrixSolveTriangular { + return MatrixSolveTriangularClass.New() +} + +func (m_ MatrixSolveTriangular) Init() MatrixSolveTriangular { + rv := objc.Call[MatrixSolveTriangular](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixSolveTriangular) InitWithDevice(device metal.PDevice) MatrixSolveTriangular { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveTriangular](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixSolveTriangularWithDevice(device metal.PDevice) MatrixSolveTriangular { + instance := MatrixSolveTriangularClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixSolveTriangular) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSolveTriangular { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSolveTriangular](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixSolveTriangular_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSolveTriangular { + instance := MatrixSolveTriangularClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvetriangular/2867027-encodetocommandbuffer?language=objc +func (m_ MatrixSolveTriangular) EncodeToCommandBufferSourceMatrixRightHandSideMatrixSolutionMatrix(commandBuffer metal.PCommandBuffer, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:"), po0, objc.Ptr(sourceMatrix), objc.Ptr(rightHandSideMatrix), objc.Ptr(solutionMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvetriangular/2867027-encodetocommandbuffer?language=objc +func (m_ MatrixSolveTriangular) EncodeToCommandBufferObjectSourceMatrixRightHandSideMatrixSolutionMatrix(commandBufferObject objc.IObject, sourceMatrix IMatrix, rightHandSideMatrix IMatrix, solutionMatrix IMatrix) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceMatrix), objc.Ptr(rightHandSideMatrix), objc.Ptr(solutionMatrix)) +} diff --git a/macos/mps/matrix_sum.gen.go b/macos/mps/matrix_sum.gen.go new file mode 100644 index 00000000..4b7dd8d4 --- /dev/null +++ b/macos/mps/matrix_sum.gen.go @@ -0,0 +1,219 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixSum] class. +var MatrixSumClass = _MatrixSumClass{objc.GetClass("MPSMatrixSum")} + +type _MatrixSumClass struct { + objc.Class +} + +// An interface definition for the [MatrixSum] class. +type IMatrixSum interface { + IKernel + NeuronType() CNNNeuronType + SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) + EncodeToCommandBufferSourceMatricesResultMatrixScaleVectorOffsetVectorBiasVectorStartIndex(buffer metal.PCommandBuffer, sourceMatrices []IMatrix, resultMatrix IMatrix, scaleVector IVector, offsetVector IVector, biasVector IVector, startIndex uint) + EncodeToCommandBufferObjectSourceMatricesResultMatrixScaleVectorOffsetVectorBiasVectorStartIndex(bufferObject objc.IObject, sourceMatrices []IMatrix, resultMatrix IMatrix, scaleVector IVector, offsetVector IVector, biasVector IVector, startIndex uint) + NeuronParameterA() float64 + ResultMatrixOrigin() metal.Origin + SetResultMatrixOrigin(value metal.Origin) + Transpose() bool + Columns() uint + Count() uint + Rows() uint + NeuronParameterB() float64 + NeuronParameterC() float64 +} + +// A kernel for performing a pointwise summation of a matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum?language=objc +type MatrixSum struct { + Kernel +} + +func MatrixSumFrom(ptr unsafe.Pointer) MatrixSum { + return MatrixSum{ + Kernel: KernelFrom(ptr), + } +} + +func (m_ MatrixSum) InitWithDeviceCountRowsColumnsTranspose(device metal.PDevice, count uint, rows uint, columns uint, transpose bool) MatrixSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSum](m_, objc.Sel("initWithDevice:count:rows:columns:transpose:"), po0, count, rows, columns, transpose) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935623-initwithdevice?language=objc +func NewMatrixSumWithDeviceCountRowsColumnsTranspose(device metal.PDevice, count uint, rows uint, columns uint, transpose bool) MatrixSum { + instance := MatrixSumClass.Alloc().InitWithDeviceCountRowsColumnsTranspose(device, count, rows, columns, transpose) + instance.Autorelease() + return instance +} + +func (mc _MatrixSumClass) Alloc() MatrixSum { + rv := objc.Call[MatrixSum](mc, objc.Sel("alloc")) + return rv +} + +func MatrixSum_Alloc() MatrixSum { + return MatrixSumClass.Alloc() +} + +func (mc _MatrixSumClass) New() MatrixSum { + rv := objc.Call[MatrixSum](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixSum() MatrixSum { + return MatrixSumClass.New() +} + +func (m_ MatrixSum) Init() MatrixSum { + rv := objc.Call[MatrixSum](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixSum) InitWithDevice(device metal.PDevice) MatrixSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSum](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixSumWithDevice(device metal.PDevice) MatrixSum { + instance := MatrixSumClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixSum) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSum { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixSum](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixSum_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixSum { + instance := MatrixSumClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935625-neurontype?language=objc +func (m_ MatrixSum) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](m_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935617-setneurontype?language=objc +func (m_ MatrixSum) SetNeuronTypeParameterAParameterBParameterC(neuronType CNNNeuronType, parameterA float64, parameterB float64, parameterC float64) { + objc.Call[objc.Void](m_, objc.Sel("setNeuronType:parameterA:parameterB:parameterC:"), neuronType, parameterA, parameterB, parameterC) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935613-encodetocommandbuffer?language=objc +func (m_ MatrixSum) EncodeToCommandBufferSourceMatricesResultMatrixScaleVectorOffsetVectorBiasVectorStartIndex(buffer metal.PCommandBuffer, sourceMatrices []IMatrix, resultMatrix IMatrix, scaleVector IVector, offsetVector IVector, biasVector IVector, startIndex uint) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", buffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrices:resultMatrix:scaleVector:offsetVector:biasVector:startIndex:"), po0, sourceMatrices, objc.Ptr(resultMatrix), objc.Ptr(scaleVector), objc.Ptr(offsetVector), objc.Ptr(biasVector), startIndex) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935613-encodetocommandbuffer?language=objc +func (m_ MatrixSum) EncodeToCommandBufferObjectSourceMatricesResultMatrixScaleVectorOffsetVectorBiasVectorStartIndex(bufferObject objc.IObject, sourceMatrices []IMatrix, resultMatrix IMatrix, scaleVector IVector, offsetVector IVector, biasVector IVector, startIndex uint) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:sourceMatrices:resultMatrix:scaleVector:offsetVector:biasVector:startIndex:"), objc.Ptr(bufferObject), sourceMatrices, objc.Ptr(resultMatrix), objc.Ptr(scaleVector), objc.Ptr(offsetVector), objc.Ptr(biasVector), startIndex) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935624-neuronparametera?language=objc +func (m_ MatrixSum) NeuronParameterA() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterA")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/3152564-resultmatrixorigin?language=objc +func (m_ MatrixSum) ResultMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("resultMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/3152564-resultmatrixorigin?language=objc +func (m_ MatrixSum) SetResultMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setResultMatrixOrigin:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935621-transpose?language=objc +func (m_ MatrixSum) Transpose() bool { + rv := objc.Call[bool](m_, objc.Sel("transpose")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935615-columns?language=objc +func (m_ MatrixSum) Columns() uint { + rv := objc.Call[uint](m_, objc.Sel("columns")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935620-count?language=objc +func (m_ MatrixSum) Count() uint { + rv := objc.Call[uint](m_, objc.Sel("count")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935622-rows?language=objc +func (m_ MatrixSum) Rows() uint { + rv := objc.Call[uint](m_, objc.Sel("rows")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935616-neuronparameterb?language=objc +func (m_ MatrixSum) NeuronParameterB() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterB")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum/2935618-neuronparameterc?language=objc +func (m_ MatrixSum) NeuronParameterC() float64 { + rv := objc.Call[float64](m_, objc.Sel("neuronParameterC")) + return rv +} diff --git a/macos/mps/matrix_unary_kernel.gen.go b/macos/mps/matrix_unary_kernel.gen.go new file mode 100644 index 00000000..4e3b69f3 --- /dev/null +++ b/macos/mps/matrix_unary_kernel.gen.go @@ -0,0 +1,158 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixUnaryKernel] class. +var MatrixUnaryKernelClass = _MatrixUnaryKernelClass{objc.GetClass("MPSMatrixUnaryKernel")} + +type _MatrixUnaryKernelClass struct { + objc.Class +} + +// An interface definition for the [MatrixUnaryKernel] class. +type IMatrixUnaryKernel interface { + IKernel + ResultMatrixOrigin() metal.Origin + SetResultMatrixOrigin(value metal.Origin) + BatchStart() uint + SetBatchStart(value uint) + BatchSize() uint + SetBatchSize(value uint) + SourceMatrixOrigin() metal.Origin + SetSourceMatrixOrigin(value metal.Origin) +} + +// A kernel that consumes one matrix and produces one matrix. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel?language=objc +type MatrixUnaryKernel struct { + Kernel +} + +func MatrixUnaryKernelFrom(ptr unsafe.Pointer) MatrixUnaryKernel { + return MatrixUnaryKernel{ + Kernel: KernelFrom(ptr), + } +} + +func (mc _MatrixUnaryKernelClass) Alloc() MatrixUnaryKernel { + rv := objc.Call[MatrixUnaryKernel](mc, objc.Sel("alloc")) + return rv +} + +func MatrixUnaryKernel_Alloc() MatrixUnaryKernel { + return MatrixUnaryKernelClass.Alloc() +} + +func (mc _MatrixUnaryKernelClass) New() MatrixUnaryKernel { + rv := objc.Call[MatrixUnaryKernel](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixUnaryKernel() MatrixUnaryKernel { + return MatrixUnaryKernelClass.New() +} + +func (m_ MatrixUnaryKernel) Init() MatrixUnaryKernel { + rv := objc.Call[MatrixUnaryKernel](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixUnaryKernel) InitWithDevice(device metal.PDevice) MatrixUnaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixUnaryKernel](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixUnaryKernelWithDevice(device metal.PDevice) MatrixUnaryKernel { + instance := MatrixUnaryKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixUnaryKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixUnaryKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixUnaryKernel](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixUnaryKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixUnaryKernel { + instance := MatrixUnaryKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2867150-resultmatrixorigin?language=objc +func (m_ MatrixUnaryKernel) ResultMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("resultMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2867150-resultmatrixorigin?language=objc +func (m_ MatrixUnaryKernel) SetResultMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setResultMatrixOrigin:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2866990-batchstart?language=objc +func (m_ MatrixUnaryKernel) BatchStart() uint { + rv := objc.Call[uint](m_, objc.Sel("batchStart")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2866990-batchstart?language=objc +func (m_ MatrixUnaryKernel) SetBatchStart(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchStart:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2867118-batchsize?language=objc +func (m_ MatrixUnaryKernel) BatchSize() uint { + rv := objc.Call[uint](m_, objc.Sel("batchSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2867118-batchsize?language=objc +func (m_ MatrixUnaryKernel) SetBatchSize(value uint) { + objc.Call[objc.Void](m_, objc.Sel("setBatchSize:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2867053-sourcematrixorigin?language=objc +func (m_ MatrixUnaryKernel) SourceMatrixOrigin() metal.Origin { + rv := objc.Call[metal.Origin](m_, objc.Sel("sourceMatrixOrigin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixunarykernel/2867053-sourcematrixorigin?language=objc +func (m_ MatrixUnaryKernel) SetSourceMatrixOrigin(value metal.Origin) { + objc.Call[objc.Void](m_, objc.Sel("setSourceMatrixOrigin:"), value) +} diff --git a/macos/mps/matrix_vector_multiplication.gen.go b/macos/mps/matrix_vector_multiplication.gen.go new file mode 100644 index 00000000..5fcbb3be --- /dev/null +++ b/macos/mps/matrix_vector_multiplication.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [MatrixVectorMultiplication] class. +var MatrixVectorMultiplicationClass = _MatrixVectorMultiplicationClass{objc.GetClass("MPSMatrixVectorMultiplication")} + +type _MatrixVectorMultiplicationClass struct { + objc.Class +} + +// An interface definition for the [MatrixVectorMultiplication] class. +type IMatrixVectorMultiplication interface { + IMatrixBinaryKernel + EncodeToCommandBufferInputMatrixInputVectorResultVector(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, inputVector IVector, resultVector IVector) + EncodeToCommandBufferObjectInputMatrixInputVectorResultVector(commandBufferObject objc.IObject, inputMatrix IMatrix, inputVector IVector, resultVector IVector) +} + +// A matrix-vector multiplication kernel [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixvectormultiplication?language=objc +type MatrixVectorMultiplication struct { + MatrixBinaryKernel +} + +func MatrixVectorMultiplicationFrom(ptr unsafe.Pointer) MatrixVectorMultiplication { + return MatrixVectorMultiplication{ + MatrixBinaryKernel: MatrixBinaryKernelFrom(ptr), + } +} + +func (m_ MatrixVectorMultiplication) InitWithDeviceRowsColumns(device metal.PDevice, rows uint, columns uint) MatrixVectorMultiplication { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixVectorMultiplication](m_, objc.Sel("initWithDevice:rows:columns:"), po0, rows, columns) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixvectormultiplication/2909035-initwithdevice?language=objc +func NewMatrixVectorMultiplicationWithDeviceRowsColumns(device metal.PDevice, rows uint, columns uint) MatrixVectorMultiplication { + instance := MatrixVectorMultiplicationClass.Alloc().InitWithDeviceRowsColumns(device, rows, columns) + instance.Autorelease() + return instance +} + +func (mc _MatrixVectorMultiplicationClass) Alloc() MatrixVectorMultiplication { + rv := objc.Call[MatrixVectorMultiplication](mc, objc.Sel("alloc")) + return rv +} + +func MatrixVectorMultiplication_Alloc() MatrixVectorMultiplication { + return MatrixVectorMultiplicationClass.Alloc() +} + +func (mc _MatrixVectorMultiplicationClass) New() MatrixVectorMultiplication { + rv := objc.Call[MatrixVectorMultiplication](mc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewMatrixVectorMultiplication() MatrixVectorMultiplication { + return MatrixVectorMultiplicationClass.New() +} + +func (m_ MatrixVectorMultiplication) Init() MatrixVectorMultiplication { + rv := objc.Call[MatrixVectorMultiplication](m_, objc.Sel("init")) + return rv +} + +func (m_ MatrixVectorMultiplication) InitWithDevice(device metal.PDevice) MatrixVectorMultiplication { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixVectorMultiplication](m_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewMatrixVectorMultiplicationWithDevice(device metal.PDevice) MatrixVectorMultiplication { + instance := MatrixVectorMultiplicationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (m_ MatrixVectorMultiplication) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixVectorMultiplication { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[MatrixVectorMultiplication](m_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func MatrixVectorMultiplication_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) MatrixVectorMultiplication { + instance := MatrixVectorMultiplicationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixvectormultiplication/2873084-encodetocommandbuffer?language=objc +func (m_ MatrixVectorMultiplication) EncodeToCommandBufferInputMatrixInputVectorResultVector(commandBuffer metal.PCommandBuffer, inputMatrix IMatrix, inputVector IVector, resultVector IVector) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:inputVector:resultVector:"), po0, objc.Ptr(inputMatrix), objc.Ptr(inputVector), objc.Ptr(resultVector)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixvectormultiplication/2873084-encodetocommandbuffer?language=objc +func (m_ MatrixVectorMultiplication) EncodeToCommandBufferObjectInputMatrixInputVectorResultVector(commandBufferObject objc.IObject, inputMatrix IMatrix, inputVector IVector, resultVector IVector) { + objc.Call[objc.Void](m_, objc.Sel("encodeToCommandBuffer:inputMatrix:inputVector:resultVector:"), objc.Ptr(commandBufferObject), objc.Ptr(inputMatrix), objc.Ptr(inputVector), objc.Ptr(resultVector)) +} diff --git a/macos/mps/mps_structs.go b/macos/mps/mps_structs.go new file mode 100644 index 00000000..9672a21a --- /dev/null +++ b/macos/mps/mps_structs.go @@ -0,0 +1,33 @@ +package mps + +// TODO: + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsregion?language=objc +type Region struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsoffset?language=objc +type Offset struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsstatetextureinfo?language=objc +type StateTextureInfo struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsimagekeypointrangeinfo?language=objc +type ImageKeypointRangeInfo struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsimagehistograminfo?language=objc +type ImageHistogramInfo struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsscaletransform?language=objc +type ScaleTransform struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixcopyoffsets?language=objc +type MatrixCopyOffsets struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsdimensionslice?language=objc +type DimensionSlice struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsimagecoordinate?language=objc +type ImageCoordinate struct{} + +// https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayoffsets?language=objc +type NDArrayOffsets struct{} diff --git a/macos/mps/nd_array.gen.go b/macos/mps/nd_array.gen.go new file mode 100644 index 00000000..b3de935c --- /dev/null +++ b/macos/mps/nd_array.gen.go @@ -0,0 +1,265 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArray] class. +var NDArrayClass = _NDArrayClass{objc.GetClass("MPSNDArray")} + +type _NDArrayClass struct { + objc.Class +} + +// An interface definition for the [NDArray] class. +type INDArray interface { + objc.IObject + ArrayViewWithCommandBufferDescriptorAliasing(cmdBuf metal.PCommandBuffer, descriptor INDArrayDescriptor, aliasing AliasingStrategy) NDArray + ArrayViewWithCommandBufferObjectDescriptorAliasing(cmdBufObject objc.IObject, descriptor INDArrayDescriptor, aliasing AliasingStrategy) NDArray + ResourceSize() uint + WriteBytesStrideBytes(buffer unsafe.Pointer, strideBytesPerDimension *int) + LengthOfDimension(dimensionIndex uint) uint + ReadBytesStrideBytes(buffer unsafe.Pointer, strideBytesPerDimension *int) + ExportDataWithCommandBufferToImagesOffset(cmdBuf metal.PCommandBuffer, images *foundation.Array, offset ImageCoordinate) + ExportDataWithCommandBufferObjectToImagesOffset(cmdBufObject objc.IObject, images *foundation.Array, offset ImageCoordinate) + SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) + SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) + Descriptor() NDArrayDescriptor + ImportDataWithCommandBufferFromImagesOffset(cmdBuf metal.PCommandBuffer, images *foundation.Array, offset ImageCoordinate) + ImportDataWithCommandBufferObjectFromImagesOffset(cmdBufObject objc.IObject, images *foundation.Array, offset ImageCoordinate) + Parent() NDArray + Device() metal.DeviceWrapper + DataTypeSize() uint + DataType() DataType + Label() string + SetLabel(value string) + NumberOfDimensions() uint +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray?language=objc +type NDArray struct { + objc.Object +} + +func NDArrayFrom(ptr unsafe.Pointer) NDArray { + return NDArray{ + Object: objc.ObjectFrom(ptr), + } +} + +func (n_ NDArray) InitWithDeviceScalar(device metal.PDevice, value float64) NDArray { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArray](n_, objc.Sel("initWithDevice:scalar:"), po0, value) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114051-initwithdevice?language=objc +func NewNDArrayWithDeviceScalar(device metal.PDevice, value float64) NDArray { + instance := NDArrayClass.Alloc().InitWithDeviceScalar(device, value) + instance.Autorelease() + return instance +} + +func (nc _NDArrayClass) Alloc() NDArray { + rv := objc.Call[NDArray](nc, objc.Sel("alloc")) + return rv +} + +func NDArray_Alloc() NDArray { + return NDArrayClass.Alloc() +} + +func (nc _NDArrayClass) New() NDArray { + rv := objc.Call[NDArray](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArray() NDArray { + return NDArrayClass.New() +} + +func (n_ NDArray) Init() NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114040-arrayviewwithcommandbuffer?language=objc +func (n_ NDArray) ArrayViewWithCommandBufferDescriptorAliasing(cmdBuf metal.PCommandBuffer, descriptor INDArrayDescriptor, aliasing AliasingStrategy) NDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[NDArray](n_, objc.Sel("arrayViewWithCommandBuffer:descriptor:aliasing:"), po0, objc.Ptr(descriptor), aliasing) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114040-arrayviewwithcommandbuffer?language=objc +func (n_ NDArray) ArrayViewWithCommandBufferObjectDescriptorAliasing(cmdBufObject objc.IObject, descriptor INDArrayDescriptor, aliasing AliasingStrategy) NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("arrayViewWithCommandBuffer:descriptor:aliasing:"), objc.Ptr(cmdBufObject), objc.Ptr(descriptor), aliasing) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114058-resourcesize?language=objc +func (n_ NDArray) ResourceSize() uint { + rv := objc.Call[uint](n_, objc.Sel("resourceSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114060-writebytes?language=objc +func (n_ NDArray) WriteBytesStrideBytes(buffer unsafe.Pointer, strideBytesPerDimension *int) { + objc.Call[objc.Void](n_, objc.Sel("writeBytes:strideBytes:"), buffer, strideBytesPerDimension) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114053-lengthofdimension?language=objc +func (n_ NDArray) LengthOfDimension(dimensionIndex uint) uint { + rv := objc.Call[uint](n_, objc.Sel("lengthOfDimension:"), dimensionIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114057-readbytes?language=objc +func (n_ NDArray) ReadBytesStrideBytes(buffer unsafe.Pointer, strideBytesPerDimension *int) { + objc.Call[objc.Void](n_, objc.Sel("readBytes:strideBytes:"), buffer, strideBytesPerDimension) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3152526-exportdatawithcommandbuffer?language=objc +func (n_ NDArray) ExportDataWithCommandBufferToImagesOffset(cmdBuf metal.PCommandBuffer, images *foundation.Array, offset ImageCoordinate) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + objc.Call[objc.Void](n_, objc.Sel("exportDataWithCommandBuffer:toImages:offset:"), po0, images, offset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3152526-exportdatawithcommandbuffer?language=objc +func (n_ NDArray) ExportDataWithCommandBufferObjectToImagesOffset(cmdBufObject objc.IObject, images *foundation.Array, offset ImageCoordinate) { + objc.Call[objc.Void](n_, objc.Sel("exportDataWithCommandBuffer:toImages:offset:"), objc.Ptr(cmdBufObject), images, offset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114059-synchronizeoncommandbuffer?language=objc +func (n_ NDArray) SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](n_, objc.Sel("synchronizeOnCommandBuffer:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114059-synchronizeoncommandbuffer?language=objc +func (n_ NDArray) SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("synchronizeOnCommandBuffer:"), objc.Ptr(commandBufferObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114044-descriptor?language=objc +func (n_ NDArray) Descriptor() NDArrayDescriptor { + rv := objc.Call[NDArrayDescriptor](n_, objc.Sel("descriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3152527-importdatawithcommandbuffer?language=objc +func (n_ NDArray) ImportDataWithCommandBufferFromImagesOffset(cmdBuf metal.PCommandBuffer, images *foundation.Array, offset ImageCoordinate) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + objc.Call[objc.Void](n_, objc.Sel("importDataWithCommandBuffer:fromImages:offset:"), po0, images, offset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3152527-importdatawithcommandbuffer?language=objc +func (n_ NDArray) ImportDataWithCommandBufferObjectFromImagesOffset(cmdBufObject objc.IObject, images *foundation.Array, offset ImageCoordinate) { + objc.Call[objc.Void](n_, objc.Sel("importDataWithCommandBuffer:fromImages:offset:"), objc.Ptr(cmdBufObject), images, offset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3131728-defaultallocator?language=objc +func (nc _NDArrayClass) DefaultAllocator() NDArrayAllocatorWrapper { + rv := objc.Call[NDArrayAllocatorWrapper](nc, objc.Sel("defaultAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3131728-defaultallocator?language=objc +func NDArray_DefaultAllocator() NDArrayAllocatorWrapper { + return NDArrayClass.DefaultAllocator() +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114056-parent?language=objc +func (n_ NDArray) Parent() NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("parent")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114045-device?language=objc +func (n_ NDArray) Device() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](n_, objc.Sel("device")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114042-datatypesize?language=objc +func (n_ NDArray) DataTypeSize() uint { + rv := objc.Call[uint](n_, objc.Sel("dataTypeSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114041-datatype?language=objc +func (n_ NDArray) DataType() DataType { + rv := objc.Call[DataType](n_, objc.Sel("dataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114052-label?language=objc +func (n_ NDArray) Label() string { + rv := objc.Call[string](n_, objc.Sel("label")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114052-label?language=objc +func (n_ NDArray) SetLabel(value string) { + objc.Call[objc.Void](n_, objc.Sel("setLabel:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114055-numberofdimensions?language=objc +func (n_ NDArray) NumberOfDimensions() uint { + rv := objc.Call[uint](n_, objc.Sel("numberOfDimensions")) + return rv +} diff --git a/macos/mps/nd_array_allocator.gen.go b/macos/mps/nd_array_allocator.gen.go new file mode 100644 index 00000000..4da75c89 --- /dev/null +++ b/macos/mps/nd_array_allocator.gen.go @@ -0,0 +1,35 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayallocator?language=objc +type PNDArrayAllocator interface { + // optional + ArrayForCommandBufferArrayDescriptorKernel(cmdBuf metal.CommandBufferWrapper, descriptor NDArrayDescriptor, kernel Kernel) INDArray + HasArrayForCommandBufferArrayDescriptorKernel() bool +} + +// A concrete type wrapper for the [PNDArrayAllocator] protocol. +type NDArrayAllocatorWrapper struct { + objc.Object +} + +func (n_ NDArrayAllocatorWrapper) HasArrayForCommandBufferArrayDescriptorKernel() bool { + return n_.RespondsToSelector(objc.Sel("arrayForCommandBuffer:arrayDescriptor:kernel:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayallocator/3143490-arrayforcommandbuffer?language=objc +func (n_ NDArrayAllocatorWrapper) ArrayForCommandBufferArrayDescriptorKernel(cmdBuf metal.PCommandBuffer, descriptor INDArrayDescriptor, kernel IKernel) NDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[NDArray](n_, objc.Sel("arrayForCommandBuffer:arrayDescriptor:kernel:"), po0, objc.Ptr(descriptor), objc.Ptr(kernel)) + return rv +} diff --git a/macos/mps/nd_array_binary_kernel.gen.go b/macos/mps/nd_array_binary_kernel.gen.go new file mode 100644 index 00000000..54c62b6c --- /dev/null +++ b/macos/mps/nd_array_binary_kernel.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayBinaryKernel] class. +var NDArrayBinaryKernelClass = _NDArrayBinaryKernelClass{objc.GetClass("MPSNDArrayBinaryKernel")} + +type _NDArrayBinaryKernelClass struct { + objc.Class +} + +// An interface definition for the [NDArrayBinaryKernel] class. +type INDArrayBinaryKernel interface { + INDArrayMultiaryKernel + EncodeToCommandBufferPrimarySourceArraySecondarySourceArrayResultStateDestinationArray(cmdBuf metal.PCommandBuffer, primarySourceArray INDArray, secondarySourceArray INDArray, outGradientState IState, destination INDArray) + EncodeToCommandBufferObjectPrimarySourceArraySecondarySourceArrayResultStateDestinationArray(cmdBufObject objc.IObject, primarySourceArray INDArray, secondarySourceArray INDArray, outGradientState IState, destination INDArray) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarykernel?language=objc +type NDArrayBinaryKernel struct { + NDArrayMultiaryKernel +} + +func NDArrayBinaryKernelFrom(ptr unsafe.Pointer) NDArrayBinaryKernel { + return NDArrayBinaryKernel{ + NDArrayMultiaryKernel: NDArrayMultiaryKernelFrom(ptr), + } +} + +func (n_ NDArrayBinaryKernel) InitWithDevice(device metal.PDevice) NDArrayBinaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinaryKernel](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarykernel/3143501-initwithdevice?language=objc +func NewNDArrayBinaryKernelWithDevice(device metal.PDevice) NDArrayBinaryKernel { + instance := NDArrayBinaryKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NDArrayBinaryKernelClass) Alloc() NDArrayBinaryKernel { + rv := objc.Call[NDArrayBinaryKernel](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayBinaryKernel_Alloc() NDArrayBinaryKernel { + return NDArrayBinaryKernelClass.Alloc() +} + +func (nc _NDArrayBinaryKernelClass) New() NDArrayBinaryKernel { + rv := objc.Call[NDArrayBinaryKernel](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayBinaryKernel() NDArrayBinaryKernel { + return NDArrayBinaryKernelClass.New() +} + +func (n_ NDArrayBinaryKernel) Init() NDArrayBinaryKernel { + rv := objc.Call[NDArrayBinaryKernel](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayBinaryKernel) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayBinaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinaryKernel](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3175010-initwithdevice?language=objc +func NewNDArrayBinaryKernelWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayBinaryKernel { + instance := NDArrayBinaryKernelClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayBinaryKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayBinaryKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinaryKernel](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayBinaryKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayBinaryKernel { + instance := NDArrayBinaryKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarykernel/3143499-encodetocommandbuffer?language=objc +func (n_ NDArrayBinaryKernel) EncodeToCommandBufferPrimarySourceArraySecondarySourceArrayResultStateDestinationArray(cmdBuf metal.PCommandBuffer, primarySourceArray INDArray, secondarySourceArray INDArray, outGradientState IState, destination INDArray) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:primarySourceArray:secondarySourceArray:resultState:destinationArray:"), po0, objc.Ptr(primarySourceArray), objc.Ptr(secondarySourceArray), objc.Ptr(outGradientState), objc.Ptr(destination)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarykernel/3143499-encodetocommandbuffer?language=objc +func (n_ NDArrayBinaryKernel) EncodeToCommandBufferObjectPrimarySourceArraySecondarySourceArrayResultStateDestinationArray(cmdBufObject objc.IObject, primarySourceArray INDArray, secondarySourceArray INDArray, outGradientState IState, destination INDArray) { + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:primarySourceArray:secondarySourceArray:resultState:destinationArray:"), objc.Ptr(cmdBufObject), objc.Ptr(primarySourceArray), objc.Ptr(secondarySourceArray), objc.Ptr(outGradientState), objc.Ptr(destination)) +} diff --git a/macos/mps/nd_array_binary_primary_gradient_kernel.gen.go b/macos/mps/nd_array_binary_primary_gradient_kernel.gen.go new file mode 100644 index 00000000..594c0a12 --- /dev/null +++ b/macos/mps/nd_array_binary_primary_gradient_kernel.gen.go @@ -0,0 +1,139 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayBinaryPrimaryGradientKernel] class. +var NDArrayBinaryPrimaryGradientKernelClass = _NDArrayBinaryPrimaryGradientKernelClass{objc.GetClass("MPSNDArrayBinaryPrimaryGradientKernel")} + +type _NDArrayBinaryPrimaryGradientKernelClass struct { + objc.Class +} + +// An interface definition for the [NDArrayBinaryPrimaryGradientKernel] class. +type INDArrayBinaryPrimaryGradientKernel interface { + INDArrayMultiaryGradientKernel + EncodeToCommandBufferPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBuf metal.PCommandBuffer, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray + EncodeToCommandBufferObjectPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBufObject objc.IObject, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinaryprimarygradientkernel?language=objc +type NDArrayBinaryPrimaryGradientKernel struct { + NDArrayMultiaryGradientKernel +} + +func NDArrayBinaryPrimaryGradientKernelFrom(ptr unsafe.Pointer) NDArrayBinaryPrimaryGradientKernel { + return NDArrayBinaryPrimaryGradientKernel{ + NDArrayMultiaryGradientKernel: NDArrayMultiaryGradientKernelFrom(ptr), + } +} + +func (n_ NDArrayBinaryPrimaryGradientKernel) InitWithDevice(device metal.PDevice) NDArrayBinaryPrimaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinaryPrimaryGradientKernel](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinaryprimarygradientkernel/3143515-initwithdevice?language=objc +func NewNDArrayBinaryPrimaryGradientKernelWithDevice(device metal.PDevice) NDArrayBinaryPrimaryGradientKernel { + instance := NDArrayBinaryPrimaryGradientKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NDArrayBinaryPrimaryGradientKernelClass) Alloc() NDArrayBinaryPrimaryGradientKernel { + rv := objc.Call[NDArrayBinaryPrimaryGradientKernel](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayBinaryPrimaryGradientKernel_Alloc() NDArrayBinaryPrimaryGradientKernel { + return NDArrayBinaryPrimaryGradientKernelClass.Alloc() +} + +func (nc _NDArrayBinaryPrimaryGradientKernelClass) New() NDArrayBinaryPrimaryGradientKernel { + rv := objc.Call[NDArrayBinaryPrimaryGradientKernel](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayBinaryPrimaryGradientKernel() NDArrayBinaryPrimaryGradientKernel { + return NDArrayBinaryPrimaryGradientKernelClass.New() +} + +func (n_ NDArrayBinaryPrimaryGradientKernel) Init() NDArrayBinaryPrimaryGradientKernel { + rv := objc.Call[NDArrayBinaryPrimaryGradientKernel](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayBinaryPrimaryGradientKernel) InitWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayBinaryPrimaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinaryPrimaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:sourceGradientIndex:"), po0, count, sourceGradientIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143524-initwithdevice?language=objc +func NewNDArrayBinaryPrimaryGradientKernelWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayBinaryPrimaryGradientKernel { + instance := NDArrayBinaryPrimaryGradientKernelClass.Alloc().InitWithDeviceSourceCountSourceGradientIndex(device, count, sourceGradientIndex) + instance.Autorelease() + return instance +} + +func (n_ NDArrayBinaryPrimaryGradientKernel) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayBinaryPrimaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinaryPrimaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131741-initwithdevice?language=objc +func NewNDArrayBinaryPrimaryGradientKernelWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayBinaryPrimaryGradientKernel { + instance := NDArrayBinaryPrimaryGradientKernelClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayBinaryPrimaryGradientKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayBinaryPrimaryGradientKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinaryPrimaryGradientKernel](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayBinaryPrimaryGradientKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayBinaryPrimaryGradientKernel { + instance := NDArrayBinaryPrimaryGradientKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinaryprimarygradientkernel/3143513-encodetocommandbuffer?language=objc +func (n_ NDArrayBinaryPrimaryGradientKernel) EncodeToCommandBufferPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBuf metal.PCommandBuffer, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:"), po0, objc.Ptr(primarySourceArray), objc.Ptr(secondarySourceArray), objc.Ptr(gradient), objc.Ptr(state)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinaryprimarygradientkernel/3143513-encodetocommandbuffer?language=objc +func (n_ NDArrayBinaryPrimaryGradientKernel) EncodeToCommandBufferObjectPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBufObject objc.IObject, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:"), objc.Ptr(cmdBufObject), objc.Ptr(primarySourceArray), objc.Ptr(secondarySourceArray), objc.Ptr(gradient), objc.Ptr(state)) + return rv +} diff --git a/macos/mps/nd_array_binary_secondary_gradient_kernel.gen.go b/macos/mps/nd_array_binary_secondary_gradient_kernel.gen.go new file mode 100644 index 00000000..6f17e015 --- /dev/null +++ b/macos/mps/nd_array_binary_secondary_gradient_kernel.gen.go @@ -0,0 +1,139 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayBinarySecondaryGradientKernel] class. +var NDArrayBinarySecondaryGradientKernelClass = _NDArrayBinarySecondaryGradientKernelClass{objc.GetClass("MPSNDArrayBinarySecondaryGradientKernel")} + +type _NDArrayBinarySecondaryGradientKernelClass struct { + objc.Class +} + +// An interface definition for the [NDArrayBinarySecondaryGradientKernel] class. +type INDArrayBinarySecondaryGradientKernel interface { + INDArrayMultiaryGradientKernel + EncodeToCommandBufferPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBuf metal.PCommandBuffer, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray + EncodeToCommandBufferObjectPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBufObject objc.IObject, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarysecondarygradientkernel?language=objc +type NDArrayBinarySecondaryGradientKernel struct { + NDArrayMultiaryGradientKernel +} + +func NDArrayBinarySecondaryGradientKernelFrom(ptr unsafe.Pointer) NDArrayBinarySecondaryGradientKernel { + return NDArrayBinarySecondaryGradientKernel{ + NDArrayMultiaryGradientKernel: NDArrayMultiaryGradientKernelFrom(ptr), + } +} + +func (n_ NDArrayBinarySecondaryGradientKernel) InitWithDevice(device metal.PDevice) NDArrayBinarySecondaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinarySecondaryGradientKernel](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarysecondarygradientkernel/3143519-initwithdevice?language=objc +func NewNDArrayBinarySecondaryGradientKernelWithDevice(device metal.PDevice) NDArrayBinarySecondaryGradientKernel { + instance := NDArrayBinarySecondaryGradientKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NDArrayBinarySecondaryGradientKernelClass) Alloc() NDArrayBinarySecondaryGradientKernel { + rv := objc.Call[NDArrayBinarySecondaryGradientKernel](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayBinarySecondaryGradientKernel_Alloc() NDArrayBinarySecondaryGradientKernel { + return NDArrayBinarySecondaryGradientKernelClass.Alloc() +} + +func (nc _NDArrayBinarySecondaryGradientKernelClass) New() NDArrayBinarySecondaryGradientKernel { + rv := objc.Call[NDArrayBinarySecondaryGradientKernel](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayBinarySecondaryGradientKernel() NDArrayBinarySecondaryGradientKernel { + return NDArrayBinarySecondaryGradientKernelClass.New() +} + +func (n_ NDArrayBinarySecondaryGradientKernel) Init() NDArrayBinarySecondaryGradientKernel { + rv := objc.Call[NDArrayBinarySecondaryGradientKernel](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayBinarySecondaryGradientKernel) InitWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayBinarySecondaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinarySecondaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:sourceGradientIndex:"), po0, count, sourceGradientIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143524-initwithdevice?language=objc +func NewNDArrayBinarySecondaryGradientKernelWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayBinarySecondaryGradientKernel { + instance := NDArrayBinarySecondaryGradientKernelClass.Alloc().InitWithDeviceSourceCountSourceGradientIndex(device, count, sourceGradientIndex) + instance.Autorelease() + return instance +} + +func (n_ NDArrayBinarySecondaryGradientKernel) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayBinarySecondaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinarySecondaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131741-initwithdevice?language=objc +func NewNDArrayBinarySecondaryGradientKernelWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayBinarySecondaryGradientKernel { + instance := NDArrayBinarySecondaryGradientKernelClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayBinarySecondaryGradientKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayBinarySecondaryGradientKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayBinarySecondaryGradientKernel](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayBinarySecondaryGradientKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayBinarySecondaryGradientKernel { + instance := NDArrayBinarySecondaryGradientKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarysecondarygradientkernel/3143517-encodetocommandbuffer?language=objc +func (n_ NDArrayBinarySecondaryGradientKernel) EncodeToCommandBufferPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBuf metal.PCommandBuffer, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:"), po0, objc.Ptr(primarySourceArray), objc.Ptr(secondarySourceArray), objc.Ptr(gradient), objc.Ptr(state)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarysecondarygradientkernel/3143517-encodetocommandbuffer?language=objc +func (n_ NDArrayBinarySecondaryGradientKernel) EncodeToCommandBufferObjectPrimarySourceArraySecondarySourceArraySourceGradientGradientState(cmdBufObject objc.IObject, primarySourceArray INDArray, secondarySourceArray INDArray, gradient INDArray, state IState) NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:"), objc.Ptr(cmdBufObject), objc.Ptr(primarySourceArray), objc.Ptr(secondarySourceArray), objc.Ptr(gradient), objc.Ptr(state)) + return rv +} diff --git a/macos/mps/nd_array_descriptor.gen.go b/macos/mps/nd_array_descriptor.gen.go new file mode 100644 index 00000000..15beab63 --- /dev/null +++ b/macos/mps/nd_array_descriptor.gen.go @@ -0,0 +1,165 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/kernel" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayDescriptor] class. +var NDArrayDescriptorClass = _NDArrayDescriptorClass{objc.GetClass("MPSNDArrayDescriptor")} + +type _NDArrayDescriptorClass struct { + objc.Class +} + +// An interface definition for the [NDArrayDescriptor] class. +type INDArrayDescriptor interface { + objc.IObject + SliceDimensionWithSubrange(dimensionIndex uint, subRange DimensionSlice) + TransposeDimensionWithDimension(dimensionIndex uint, dimensionIndex2 uint) + SliceRangeForDimension(dimensionIndex uint) DimensionSlice + DimensionOrder() kernel.Vector_uchar16 + LengthOfDimension(dimensionIndex uint) uint + ReshapeWithDimensionCountDimensionSizes(numberOfDimensions uint, dimensionSizes *uint) + ReshapeWithShape(shape []foundation.INumber) + DataType() DataType + SetDataType(value DataType) + NumberOfDimensions() uint + SetNumberOfDimensions(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor?language=objc +type NDArrayDescriptor struct { + objc.Object +} + +func NDArrayDescriptorFrom(ptr unsafe.Pointer) NDArrayDescriptor { + return NDArrayDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NDArrayDescriptorClass) DescriptorWithDataTypeDimensionSizes(dataType DataType, dimension0 uint, args ...any) NDArrayDescriptor { + rv := objc.Call[NDArrayDescriptor](nc, objc.Sel("descriptorWithDataType:dimensionSizes:"), append([]any{dataType, dimension0}, args...)...) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114064-descriptorwithdatatype?language=objc +func NDArrayDescriptor_DescriptorWithDataTypeDimensionSizes(dataType DataType, dimension0 uint, args ...any) NDArrayDescriptor { + return NDArrayDescriptorClass.DescriptorWithDataTypeDimensionSizes(dataType, dimension0, args...) +} + +func (nc _NDArrayDescriptorClass) Alloc() NDArrayDescriptor { + rv := objc.Call[NDArrayDescriptor](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayDescriptor_Alloc() NDArrayDescriptor { + return NDArrayDescriptorClass.Alloc() +} + +func (nc _NDArrayDescriptorClass) New() NDArrayDescriptor { + rv := objc.Call[NDArrayDescriptor](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayDescriptor() NDArrayDescriptor { + return NDArrayDescriptorClass.New() +} + +func (n_ NDArrayDescriptor) Init() NDArrayDescriptor { + rv := objc.Call[NDArrayDescriptor](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114069-slicedimension?language=objc +func (n_ NDArrayDescriptor) SliceDimensionWithSubrange(dimensionIndex uint, subRange DimensionSlice) { + objc.Call[objc.Void](n_, objc.Sel("sliceDimension:withSubrange:"), dimensionIndex, subRange) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114071-transposedimension?language=objc +func (n_ NDArrayDescriptor) TransposeDimensionWithDimension(dimensionIndex uint, dimensionIndex2 uint) { + objc.Call[objc.Void](n_, objc.Sel("transposeDimension:withDimension:"), dimensionIndex, dimensionIndex2) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114070-slicerangefordimension?language=objc +func (n_ NDArrayDescriptor) SliceRangeForDimension(dimensionIndex uint) DimensionSlice { + rv := objc.Call[DimensionSlice](n_, objc.Sel("sliceRangeForDimension:"), dimensionIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114065-dimensionorder?language=objc +func (n_ NDArrayDescriptor) DimensionOrder() kernel.Vector_uchar16 { + rv := objc.Call[kernel.Vector_uchar16](n_, objc.Sel("dimensionOrder")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114066-lengthofdimension?language=objc +func (n_ NDArrayDescriptor) LengthOfDimension(dimensionIndex uint) uint { + rv := objc.Call[uint](n_, objc.Sel("lengthOfDimension:"), dimensionIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3143492-reshapewithdimensioncount?language=objc +func (n_ NDArrayDescriptor) ReshapeWithDimensionCountDimensionSizes(numberOfDimensions uint, dimensionSizes *uint) { + objc.Call[objc.Void](n_, objc.Sel("reshapeWithDimensionCount:dimensionSizes:"), numberOfDimensions, dimensionSizes) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3143493-reshapewithshape?language=objc +func (n_ NDArrayDescriptor) ReshapeWithShape(shape []foundation.INumber) { + objc.Call[objc.Void](n_, objc.Sel("reshapeWithShape:"), shape) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114062-datatype?language=objc +func (n_ NDArrayDescriptor) DataType() DataType { + rv := objc.Call[DataType](n_, objc.Sel("dataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114062-datatype?language=objc +func (n_ NDArrayDescriptor) SetDataType(value DataType) { + objc.Call[objc.Void](n_, objc.Sel("setDataType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114067-numberofdimensions?language=objc +func (n_ NDArrayDescriptor) NumberOfDimensions() uint { + rv := objc.Call[uint](n_, objc.Sel("numberOfDimensions")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraydescriptor/3114067-numberofdimensions?language=objc +func (n_ NDArrayDescriptor) SetNumberOfDimensions(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setNumberOfDimensions:"), value) +} diff --git a/macos/mps/nd_array_gather.gen.go b/macos/mps/nd_array_gather.gen.go new file mode 100644 index 00000000..1edb868e --- /dev/null +++ b/macos/mps/nd_array_gather.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayGather] class. +var NDArrayGatherClass = _NDArrayGatherClass{objc.GetClass("MPSNDArrayGather")} + +type _NDArrayGatherClass struct { + objc.Class +} + +// An interface definition for the [NDArrayGather] class. +type INDArrayGather interface { + INDArrayBinaryKernel + Axis() uint + SetAxis(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraygather?language=objc +type NDArrayGather struct { + NDArrayBinaryKernel +} + +func NDArrayGatherFrom(ptr unsafe.Pointer) NDArrayGather { + return NDArrayGather{ + NDArrayBinaryKernel: NDArrayBinaryKernelFrom(ptr), + } +} + +func (nc _NDArrayGatherClass) Alloc() NDArrayGather { + rv := objc.Call[NDArrayGather](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayGather_Alloc() NDArrayGather { + return NDArrayGatherClass.Alloc() +} + +func (nc _NDArrayGatherClass) New() NDArrayGather { + rv := objc.Call[NDArrayGather](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayGather() NDArrayGather { + return NDArrayGatherClass.New() +} + +func (n_ NDArrayGather) Init() NDArrayGather { + rv := objc.Call[NDArrayGather](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayGather) InitWithDevice(device metal.PDevice) NDArrayGather { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGather](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinarykernel/3143501-initwithdevice?language=objc +func NewNDArrayGatherWithDevice(device metal.PDevice) NDArrayGather { + instance := NDArrayGatherClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGather) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayGather { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGather](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3175010-initwithdevice?language=objc +func NewNDArrayGatherWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayGather { + instance := NDArrayGatherClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGather) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayGather { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGather](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayGather_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayGather { + instance := NDArrayGatherClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraygather/3152529-axis?language=objc +func (n_ NDArrayGather) Axis() uint { + rv := objc.Call[uint](n_, objc.Sel("axis")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraygather/3152529-axis?language=objc +func (n_ NDArrayGather) SetAxis(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setAxis:"), value) +} diff --git a/macos/mps/nd_array_gather_gradient.gen.go b/macos/mps/nd_array_gather_gradient.gen.go new file mode 100644 index 00000000..df36ef14 --- /dev/null +++ b/macos/mps/nd_array_gather_gradient.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayGatherGradient] class. +var NDArrayGatherGradientClass = _NDArrayGatherGradientClass{objc.GetClass("MPSNDArrayGatherGradient")} + +type _NDArrayGatherGradientClass struct { + objc.Class +} + +// An interface definition for the [NDArrayGatherGradient] class. +type INDArrayGatherGradient interface { + INDArrayBinaryPrimaryGradientKernel +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraygathergradient?language=objc +type NDArrayGatherGradient struct { + NDArrayBinaryPrimaryGradientKernel +} + +func NDArrayGatherGradientFrom(ptr unsafe.Pointer) NDArrayGatherGradient { + return NDArrayGatherGradient{ + NDArrayBinaryPrimaryGradientKernel: NDArrayBinaryPrimaryGradientKernelFrom(ptr), + } +} + +func (nc _NDArrayGatherGradientClass) Alloc() NDArrayGatherGradient { + rv := objc.Call[NDArrayGatherGradient](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayGatherGradient_Alloc() NDArrayGatherGradient { + return NDArrayGatherGradientClass.Alloc() +} + +func (nc _NDArrayGatherGradientClass) New() NDArrayGatherGradient { + rv := objc.Call[NDArrayGatherGradient](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayGatherGradient() NDArrayGatherGradient { + return NDArrayGatherGradientClass.New() +} + +func (n_ NDArrayGatherGradient) Init() NDArrayGatherGradient { + rv := objc.Call[NDArrayGatherGradient](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayGatherGradient) InitWithDevice(device metal.PDevice) NDArrayGatherGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGatherGradient](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraybinaryprimarygradientkernel/3143515-initwithdevice?language=objc +func NewNDArrayGatherGradientWithDevice(device metal.PDevice) NDArrayGatherGradient { + instance := NDArrayGatherGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGatherGradient) InitWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayGatherGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGatherGradient](n_, objc.Sel("initWithDevice:sourceCount:sourceGradientIndex:"), po0, count, sourceGradientIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143524-initwithdevice?language=objc +func NewNDArrayGatherGradientWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayGatherGradient { + instance := NDArrayGatherGradientClass.Alloc().InitWithDeviceSourceCountSourceGradientIndex(device, count, sourceGradientIndex) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGatherGradient) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayGatherGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGatherGradient](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131741-initwithdevice?language=objc +func NewNDArrayGatherGradientWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayGatherGradient { + instance := NDArrayGatherGradientClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGatherGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayGatherGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGatherGradient](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayGatherGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayGatherGradient { + instance := NDArrayGatherGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nd_array_gather_gradient_state.gen.go b/macos/mps/nd_array_gather_gradient_state.gen.go new file mode 100644 index 00000000..093bfa8d --- /dev/null +++ b/macos/mps/nd_array_gather_gradient_state.gen.go @@ -0,0 +1,116 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayGatherGradientState] class. +var NDArrayGatherGradientStateClass = _NDArrayGatherGradientStateClass{objc.GetClass("MPSNDArrayGatherGradientState")} + +type _NDArrayGatherGradientStateClass struct { + objc.Class +} + +// An interface definition for the [NDArrayGatherGradientState] class. +type INDArrayGatherGradientState interface { + INDArrayGradientState +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraygathergradientstate?language=objc +type NDArrayGatherGradientState struct { + NDArrayGradientState +} + +func NDArrayGatherGradientStateFrom(ptr unsafe.Pointer) NDArrayGatherGradientState { + return NDArrayGatherGradientState{ + NDArrayGradientState: NDArrayGradientStateFrom(ptr), + } +} + +func (nc _NDArrayGatherGradientStateClass) Alloc() NDArrayGatherGradientState { + rv := objc.Call[NDArrayGatherGradientState](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayGatherGradientState_Alloc() NDArrayGatherGradientState { + return NDArrayGatherGradientStateClass.Alloc() +} + +func (nc _NDArrayGatherGradientStateClass) New() NDArrayGatherGradientState { + rv := objc.Call[NDArrayGatherGradientState](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayGatherGradientState() NDArrayGatherGradientState { + return NDArrayGatherGradientStateClass.New() +} + +func (n_ NDArrayGatherGradientState) Init() NDArrayGatherGradientState { + rv := objc.Call[NDArrayGatherGradientState](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayGatherGradientState) InitWithResources(resources []metal.PResource) NDArrayGatherGradientState { + rv := objc.Call[NDArrayGatherGradientState](n_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewNDArrayGatherGradientStateWithResources(resources []metal.PResource) NDArrayGatherGradientState { + instance := NDArrayGatherGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGatherGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NDArrayGatherGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGatherGradientState](n_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewNDArrayGatherGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NDArrayGatherGradientState { + instance := NDArrayGatherGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGatherGradientState) InitWithResource(resource metal.PResource) NDArrayGatherGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[NDArrayGatherGradientState](n_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewNDArrayGatherGradientStateWithResource(resource metal.PResource) NDArrayGatherGradientState { + instance := NDArrayGatherGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (nc _NDArrayGatherGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NDArrayGatherGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[NDArrayGatherGradientState](nc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func NDArrayGatherGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NDArrayGatherGradientState { + return NDArrayGatherGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} diff --git a/macos/mps/nd_array_gradient_state.gen.go b/macos/mps/nd_array_gradient_state.gen.go new file mode 100644 index 00000000..f2f76960 --- /dev/null +++ b/macos/mps/nd_array_gradient_state.gen.go @@ -0,0 +1,116 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayGradientState] class. +var NDArrayGradientStateClass = _NDArrayGradientStateClass{objc.GetClass("MPSNDArrayGradientState")} + +type _NDArrayGradientStateClass struct { + objc.Class +} + +// An interface definition for the [NDArrayGradientState] class. +type INDArrayGradientState interface { + IState +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraygradientstate?language=objc +type NDArrayGradientState struct { + State +} + +func NDArrayGradientStateFrom(ptr unsafe.Pointer) NDArrayGradientState { + return NDArrayGradientState{ + State: StateFrom(ptr), + } +} + +func (nc _NDArrayGradientStateClass) Alloc() NDArrayGradientState { + rv := objc.Call[NDArrayGradientState](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayGradientState_Alloc() NDArrayGradientState { + return NDArrayGradientStateClass.Alloc() +} + +func (nc _NDArrayGradientStateClass) New() NDArrayGradientState { + rv := objc.Call[NDArrayGradientState](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayGradientState() NDArrayGradientState { + return NDArrayGradientStateClass.New() +} + +func (n_ NDArrayGradientState) Init() NDArrayGradientState { + rv := objc.Call[NDArrayGradientState](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayGradientState) InitWithResources(resources []metal.PResource) NDArrayGradientState { + rv := objc.Call[NDArrayGradientState](n_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewNDArrayGradientStateWithResources(resources []metal.PResource) NDArrayGradientState { + instance := NDArrayGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NDArrayGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayGradientState](n_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewNDArrayGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NDArrayGradientState { + instance := NDArrayGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (n_ NDArrayGradientState) InitWithResource(resource metal.PResource) NDArrayGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[NDArrayGradientState](n_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewNDArrayGradientStateWithResource(resource metal.PResource) NDArrayGradientState { + instance := NDArrayGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (nc _NDArrayGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NDArrayGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[NDArrayGradientState](nc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func NDArrayGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NDArrayGradientState { + return NDArrayGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} diff --git a/macos/mps/nd_array_matrix_multiplication.gen.go b/macos/mps/nd_array_matrix_multiplication.gen.go new file mode 100644 index 00000000..94d76380 --- /dev/null +++ b/macos/mps/nd_array_matrix_multiplication.gen.go @@ -0,0 +1,139 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayMatrixMultiplication] class. +var NDArrayMatrixMultiplicationClass = _NDArrayMatrixMultiplicationClass{objc.GetClass("MPSNDArrayMatrixMultiplication")} + +type _NDArrayMatrixMultiplicationClass struct { + objc.Class +} + +// An interface definition for the [NDArrayMatrixMultiplication] class. +type INDArrayMatrixMultiplication interface { + INDArrayMultiaryKernel + Beta() float64 + SetBeta(value float64) + Alpha() float64 + SetAlpha(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymatrixmultiplication?language=objc +type NDArrayMatrixMultiplication struct { + NDArrayMultiaryKernel +} + +func NDArrayMatrixMultiplicationFrom(ptr unsafe.Pointer) NDArrayMatrixMultiplication { + return NDArrayMatrixMultiplication{ + NDArrayMultiaryKernel: NDArrayMultiaryKernelFrom(ptr), + } +} + +func (nc _NDArrayMatrixMultiplicationClass) Alloc() NDArrayMatrixMultiplication { + rv := objc.Call[NDArrayMatrixMultiplication](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayMatrixMultiplication_Alloc() NDArrayMatrixMultiplication { + return NDArrayMatrixMultiplicationClass.Alloc() +} + +func (nc _NDArrayMatrixMultiplicationClass) New() NDArrayMatrixMultiplication { + rv := objc.Call[NDArrayMatrixMultiplication](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayMatrixMultiplication() NDArrayMatrixMultiplication { + return NDArrayMatrixMultiplicationClass.New() +} + +func (n_ NDArrayMatrixMultiplication) Init() NDArrayMatrixMultiplication { + rv := objc.Call[NDArrayMatrixMultiplication](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayMatrixMultiplication) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMatrixMultiplication { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMatrixMultiplication](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3175010-initwithdevice?language=objc +func NewNDArrayMatrixMultiplicationWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMatrixMultiplication { + instance := NDArrayMatrixMultiplicationClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayMatrixMultiplication) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMatrixMultiplication { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMatrixMultiplication](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayMatrixMultiplication_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMatrixMultiplication { + instance := NDArrayMatrixMultiplicationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (n_ NDArrayMatrixMultiplication) InitWithDevice(device metal.PDevice) NDArrayMatrixMultiplication { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMatrixMultiplication](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNDArrayMatrixMultiplicationWithDevice(device metal.PDevice) NDArrayMatrixMultiplication { + instance := NDArrayMatrixMultiplicationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymatrixmultiplication/3131761-beta?language=objc +func (n_ NDArrayMatrixMultiplication) Beta() float64 { + rv := objc.Call[float64](n_, objc.Sel("beta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymatrixmultiplication/3131761-beta?language=objc +func (n_ NDArrayMatrixMultiplication) SetBeta(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setBeta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymatrixmultiplication/3131760-alpha?language=objc +func (n_ NDArrayMatrixMultiplication) Alpha() float64 { + rv := objc.Call[float64](n_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymatrixmultiplication/3131760-alpha?language=objc +func (n_ NDArrayMatrixMultiplication) SetAlpha(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/nd_array_multiary_base.gen.go b/macos/mps/nd_array_multiary_base.gen.go new file mode 100644 index 00000000..590fd6ad --- /dev/null +++ b/macos/mps/nd_array_multiary_base.gen.go @@ -0,0 +1,158 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayMultiaryBase] class. +var NDArrayMultiaryBaseClass = _NDArrayMultiaryBaseClass{objc.GetClass("MPSNDArrayMultiaryBase")} + +type _NDArrayMultiaryBaseClass struct { + objc.Class +} + +// An interface definition for the [NDArrayMultiaryBase] class. +type INDArrayMultiaryBase interface { + IKernel + EncodeWithCoder(coder foundation.ICoder) + ResultStateForSourceArraysSourceStatesDestinationArray(sourceArrays []INDArray, sourceStates []IState, destinationArray INDArray) State + DestinationArrayDescriptorForSourceArraysSourceState(sources []INDArray, state IState) NDArrayDescriptor + DestinationArrayAllocator() NDArrayAllocatorWrapper + SetDestinationArrayAllocator(value PNDArrayAllocator) + SetDestinationArrayAllocatorObject(valueObject objc.IObject) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase?language=objc +type NDArrayMultiaryBase struct { + Kernel +} + +func NDArrayMultiaryBaseFrom(ptr unsafe.Pointer) NDArrayMultiaryBase { + return NDArrayMultiaryBase{ + Kernel: KernelFrom(ptr), + } +} + +func (n_ NDArrayMultiaryBase) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMultiaryBase { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryBase](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131741-initwithdevice?language=objc +func NewNDArrayMultiaryBaseWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMultiaryBase { + instance := NDArrayMultiaryBaseClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayMultiaryBase) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMultiaryBase { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryBase](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayMultiaryBase_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMultiaryBase { + instance := NDArrayMultiaryBaseClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (nc _NDArrayMultiaryBaseClass) Alloc() NDArrayMultiaryBase { + rv := objc.Call[NDArrayMultiaryBase](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayMultiaryBase_Alloc() NDArrayMultiaryBase { + return NDArrayMultiaryBaseClass.Alloc() +} + +func (nc _NDArrayMultiaryBaseClass) New() NDArrayMultiaryBase { + rv := objc.Call[NDArrayMultiaryBase](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayMultiaryBase() NDArrayMultiaryBase { + return NDArrayMultiaryBaseClass.New() +} + +func (n_ NDArrayMultiaryBase) Init() NDArrayMultiaryBase { + rv := objc.Call[NDArrayMultiaryBase](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayMultiaryBase) InitWithDevice(device metal.PDevice) NDArrayMultiaryBase { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryBase](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNDArrayMultiaryBaseWithDevice(device metal.PDevice) NDArrayMultiaryBase { + instance := NDArrayMultiaryBaseClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131739-encodewithcoder?language=objc +func (n_ NDArrayMultiaryBase) EncodeWithCoder(coder foundation.ICoder) { + objc.Call[objc.Void](n_, objc.Sel("encodeWithCoder:"), objc.Ptr(coder)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3143521-resultstateforsourcearrays?language=objc +func (n_ NDArrayMultiaryBase) ResultStateForSourceArraysSourceStatesDestinationArray(sourceArrays []INDArray, sourceStates []IState, destinationArray INDArray) State { + rv := objc.Call[State](n_, objc.Sel("resultStateForSourceArrays:sourceStates:destinationArray:"), sourceArrays, sourceStates, objc.Ptr(destinationArray)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131736-destinationarraydescriptorforsou?language=objc +func (n_ NDArrayMultiaryBase) DestinationArrayDescriptorForSourceArraysSourceState(sources []INDArray, state IState) NDArrayDescriptor { + rv := objc.Call[NDArrayDescriptor](n_, objc.Sel("destinationArrayDescriptorForSourceArrays:sourceState:"), sources, objc.Ptr(state)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131735-destinationarrayallocator?language=objc +func (n_ NDArrayMultiaryBase) DestinationArrayAllocator() NDArrayAllocatorWrapper { + rv := objc.Call[NDArrayAllocatorWrapper](n_, objc.Sel("destinationArrayAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131735-destinationarrayallocator?language=objc +func (n_ NDArrayMultiaryBase) SetDestinationArrayAllocator(value PNDArrayAllocator) { + po0 := objc.WrapAsProtocol("MPSNDArrayAllocator", value) + objc.Call[objc.Void](n_, objc.Sel("setDestinationArrayAllocator:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131735-destinationarrayallocator?language=objc +func (n_ NDArrayMultiaryBase) SetDestinationArrayAllocatorObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setDestinationArrayAllocator:"), objc.Ptr(valueObject)) +} diff --git a/macos/mps/nd_array_multiary_gradient_kernel.gen.go b/macos/mps/nd_array_multiary_gradient_kernel.gen.go new file mode 100644 index 00000000..84b0e34d --- /dev/null +++ b/macos/mps/nd_array_multiary_gradient_kernel.gen.go @@ -0,0 +1,139 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayMultiaryGradientKernel] class. +var NDArrayMultiaryGradientKernelClass = _NDArrayMultiaryGradientKernelClass{objc.GetClass("MPSNDArrayMultiaryGradientKernel")} + +type _NDArrayMultiaryGradientKernelClass struct { + objc.Class +} + +// An interface definition for the [NDArrayMultiaryGradientKernel] class. +type INDArrayMultiaryGradientKernel interface { + INDArrayMultiaryBase + EncodeToCommandBufferSourceArraysSourceGradientGradientState(cmdBuf metal.PCommandBuffer, sources []INDArray, gradient INDArray, state IState) NDArray + EncodeToCommandBufferObjectSourceArraysSourceGradientGradientState(cmdBufObject objc.IObject, sources []INDArray, gradient INDArray, state IState) NDArray +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel?language=objc +type NDArrayMultiaryGradientKernel struct { + NDArrayMultiaryBase +} + +func NDArrayMultiaryGradientKernelFrom(ptr unsafe.Pointer) NDArrayMultiaryGradientKernel { + return NDArrayMultiaryGradientKernel{ + NDArrayMultiaryBase: NDArrayMultiaryBaseFrom(ptr), + } +} + +func (n_ NDArrayMultiaryGradientKernel) InitWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayMultiaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:sourceGradientIndex:"), po0, count, sourceGradientIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143524-initwithdevice?language=objc +func NewNDArrayMultiaryGradientKernelWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayMultiaryGradientKernel { + instance := NDArrayMultiaryGradientKernelClass.Alloc().InitWithDeviceSourceCountSourceGradientIndex(device, count, sourceGradientIndex) + instance.Autorelease() + return instance +} + +func (nc _NDArrayMultiaryGradientKernelClass) Alloc() NDArrayMultiaryGradientKernel { + rv := objc.Call[NDArrayMultiaryGradientKernel](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayMultiaryGradientKernel_Alloc() NDArrayMultiaryGradientKernel { + return NDArrayMultiaryGradientKernelClass.Alloc() +} + +func (nc _NDArrayMultiaryGradientKernelClass) New() NDArrayMultiaryGradientKernel { + rv := objc.Call[NDArrayMultiaryGradientKernel](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayMultiaryGradientKernel() NDArrayMultiaryGradientKernel { + return NDArrayMultiaryGradientKernelClass.New() +} + +func (n_ NDArrayMultiaryGradientKernel) Init() NDArrayMultiaryGradientKernel { + rv := objc.Call[NDArrayMultiaryGradientKernel](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayMultiaryGradientKernel) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMultiaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131741-initwithdevice?language=objc +func NewNDArrayMultiaryGradientKernelWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMultiaryGradientKernel { + instance := NDArrayMultiaryGradientKernelClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayMultiaryGradientKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMultiaryGradientKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryGradientKernel](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayMultiaryGradientKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMultiaryGradientKernel { + instance := NDArrayMultiaryGradientKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (n_ NDArrayMultiaryGradientKernel) InitWithDevice(device metal.PDevice) NDArrayMultiaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryGradientKernel](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNDArrayMultiaryGradientKernelWithDevice(device metal.PDevice) NDArrayMultiaryGradientKernel { + instance := NDArrayMultiaryGradientKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143522-encodetocommandbuffer?language=objc +func (n_ NDArrayMultiaryGradientKernel) EncodeToCommandBufferSourceArraysSourceGradientGradientState(cmdBuf metal.PCommandBuffer, sources []INDArray, gradient INDArray, state IState) NDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:sourceArrays:sourceGradient:gradientState:"), po0, sources, objc.Ptr(gradient), objc.Ptr(state)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143522-encodetocommandbuffer?language=objc +func (n_ NDArrayMultiaryGradientKernel) EncodeToCommandBufferObjectSourceArraysSourceGradientGradientState(cmdBufObject objc.IObject, sources []INDArray, gradient INDArray, state IState) NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:sourceArrays:sourceGradient:gradientState:"), objc.Ptr(cmdBufObject), sources, objc.Ptr(gradient), objc.Ptr(state)) + return rv +} diff --git a/macos/mps/nd_array_multiary_kernel.gen.go b/macos/mps/nd_array_multiary_kernel.gen.go new file mode 100644 index 00000000..2a96f290 --- /dev/null +++ b/macos/mps/nd_array_multiary_kernel.gen.go @@ -0,0 +1,124 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayMultiaryKernel] class. +var NDArrayMultiaryKernelClass = _NDArrayMultiaryKernelClass{objc.GetClass("MPSNDArrayMultiaryKernel")} + +type _NDArrayMultiaryKernelClass struct { + objc.Class +} + +// An interface definition for the [NDArrayMultiaryKernel] class. +type INDArrayMultiaryKernel interface { + INDArrayMultiaryBase + EncodeToCommandBufferSourceArrays(cmdBuf metal.PCommandBuffer, sourceArrays []INDArray) NDArray + EncodeToCommandBufferObjectSourceArrays(cmdBufObject objc.IObject, sourceArrays []INDArray) NDArray +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel?language=objc +type NDArrayMultiaryKernel struct { + NDArrayMultiaryBase +} + +func NDArrayMultiaryKernelFrom(ptr unsafe.Pointer) NDArrayMultiaryKernel { + return NDArrayMultiaryKernel{ + NDArrayMultiaryBase: NDArrayMultiaryBaseFrom(ptr), + } +} + +func (n_ NDArrayMultiaryKernel) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMultiaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryKernel](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3175010-initwithdevice?language=objc +func NewNDArrayMultiaryKernelWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayMultiaryKernel { + instance := NDArrayMultiaryKernelClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (nc _NDArrayMultiaryKernelClass) Alloc() NDArrayMultiaryKernel { + rv := objc.Call[NDArrayMultiaryKernel](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayMultiaryKernel_Alloc() NDArrayMultiaryKernel { + return NDArrayMultiaryKernelClass.Alloc() +} + +func (nc _NDArrayMultiaryKernelClass) New() NDArrayMultiaryKernel { + rv := objc.Call[NDArrayMultiaryKernel](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayMultiaryKernel() NDArrayMultiaryKernel { + return NDArrayMultiaryKernelClass.New() +} + +func (n_ NDArrayMultiaryKernel) Init() NDArrayMultiaryKernel { + rv := objc.Call[NDArrayMultiaryKernel](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayMultiaryKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMultiaryKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryKernel](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayMultiaryKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayMultiaryKernel { + instance := NDArrayMultiaryKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (n_ NDArrayMultiaryKernel) InitWithDevice(device metal.PDevice) NDArrayMultiaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayMultiaryKernel](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNDArrayMultiaryKernelWithDevice(device metal.PDevice) NDArrayMultiaryKernel { + instance := NDArrayMultiaryKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3143525-encodetocommandbuffer?language=objc +func (n_ NDArrayMultiaryKernel) EncodeToCommandBufferSourceArrays(cmdBuf metal.PCommandBuffer, sourceArrays []INDArray) NDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:sourceArrays:"), po0, sourceArrays) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3143525-encodetocommandbuffer?language=objc +func (n_ NDArrayMultiaryKernel) EncodeToCommandBufferObjectSourceArrays(cmdBufObject objc.IObject, sourceArrays []INDArray) NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:sourceArrays:"), objc.Ptr(cmdBufObject), sourceArrays) + return rv +} diff --git a/macos/mps/nd_array_strided_slice.gen.go b/macos/mps/nd_array_strided_slice.gen.go new file mode 100644 index 00000000..79053ac5 --- /dev/null +++ b/macos/mps/nd_array_strided_slice.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayStridedSlice] class. +var NDArrayStridedSliceClass = _NDArrayStridedSliceClass{objc.GetClass("MPSNDArrayStridedSlice")} + +type _NDArrayStridedSliceClass struct { + objc.Class +} + +// An interface definition for the [NDArrayStridedSlice] class. +type INDArrayStridedSlice interface { + INDArrayUnaryKernel + Strides() NDArrayOffsets + SetStrides(value NDArrayOffsets) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraystridedslice?language=objc +type NDArrayStridedSlice struct { + NDArrayUnaryKernel +} + +func NDArrayStridedSliceFrom(ptr unsafe.Pointer) NDArrayStridedSlice { + return NDArrayStridedSlice{ + NDArrayUnaryKernel: NDArrayUnaryKernelFrom(ptr), + } +} + +func (nc _NDArrayStridedSliceClass) Alloc() NDArrayStridedSlice { + rv := objc.Call[NDArrayStridedSlice](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayStridedSlice_Alloc() NDArrayStridedSlice { + return NDArrayStridedSliceClass.Alloc() +} + +func (nc _NDArrayStridedSliceClass) New() NDArrayStridedSlice { + rv := objc.Call[NDArrayStridedSlice](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayStridedSlice() NDArrayStridedSlice { + return NDArrayStridedSliceClass.New() +} + +func (n_ NDArrayStridedSlice) Init() NDArrayStridedSlice { + rv := objc.Call[NDArrayStridedSlice](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayStridedSlice) InitWithDevice(device metal.PDevice) NDArrayStridedSlice { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayStridedSlice](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarykernel/3143540-initwithdevice?language=objc +func NewNDArrayStridedSliceWithDevice(device metal.PDevice) NDArrayStridedSlice { + instance := NDArrayStridedSliceClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NDArrayStridedSlice) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayStridedSlice { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayStridedSlice](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3175010-initwithdevice?language=objc +func NewNDArrayStridedSliceWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayStridedSlice { + instance := NDArrayStridedSliceClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayStridedSlice) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayStridedSlice { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayStridedSlice](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayStridedSlice_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayStridedSlice { + instance := NDArrayStridedSliceClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraystridedslice/3143546-strides?language=objc +func (n_ NDArrayStridedSlice) Strides() NDArrayOffsets { + rv := objc.Call[NDArrayOffsets](n_, objc.Sel("strides")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraystridedslice/3143546-strides?language=objc +func (n_ NDArrayStridedSlice) SetStrides(value NDArrayOffsets) { + objc.Call[objc.Void](n_, objc.Sel("setStrides:"), value) +} diff --git a/macos/mps/nd_array_strided_slice_gradient.gen.go b/macos/mps/nd_array_strided_slice_gradient.gen.go new file mode 100644 index 00000000..c029256d --- /dev/null +++ b/macos/mps/nd_array_strided_slice_gradient.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayStridedSliceGradient] class. +var NDArrayStridedSliceGradientClass = _NDArrayStridedSliceGradientClass{objc.GetClass("MPSNDArrayStridedSliceGradient")} + +type _NDArrayStridedSliceGradientClass struct { + objc.Class +} + +// An interface definition for the [NDArrayStridedSliceGradient] class. +type INDArrayStridedSliceGradient interface { + INDArrayUnaryGradientKernel +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraystridedslicegradient?language=objc +type NDArrayStridedSliceGradient struct { + NDArrayUnaryGradientKernel +} + +func NDArrayStridedSliceGradientFrom(ptr unsafe.Pointer) NDArrayStridedSliceGradient { + return NDArrayStridedSliceGradient{ + NDArrayUnaryGradientKernel: NDArrayUnaryGradientKernelFrom(ptr), + } +} + +func (nc _NDArrayStridedSliceGradientClass) Alloc() NDArrayStridedSliceGradient { + rv := objc.Call[NDArrayStridedSliceGradient](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayStridedSliceGradient_Alloc() NDArrayStridedSliceGradient { + return NDArrayStridedSliceGradientClass.Alloc() +} + +func (nc _NDArrayStridedSliceGradientClass) New() NDArrayStridedSliceGradient { + rv := objc.Call[NDArrayStridedSliceGradient](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayStridedSliceGradient() NDArrayStridedSliceGradient { + return NDArrayStridedSliceGradientClass.New() +} + +func (n_ NDArrayStridedSliceGradient) Init() NDArrayStridedSliceGradient { + rv := objc.Call[NDArrayStridedSliceGradient](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayStridedSliceGradient) InitWithDevice(device metal.PDevice) NDArrayStridedSliceGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayStridedSliceGradient](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarygradientkernel/3143532-initwithdevice?language=objc +func NewNDArrayStridedSliceGradientWithDevice(device metal.PDevice) NDArrayStridedSliceGradient { + instance := NDArrayStridedSliceGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NDArrayStridedSliceGradient) InitWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayStridedSliceGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayStridedSliceGradient](n_, objc.Sel("initWithDevice:sourceCount:sourceGradientIndex:"), po0, count, sourceGradientIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143524-initwithdevice?language=objc +func NewNDArrayStridedSliceGradientWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayStridedSliceGradient { + instance := NDArrayStridedSliceGradientClass.Alloc().InitWithDeviceSourceCountSourceGradientIndex(device, count, sourceGradientIndex) + instance.Autorelease() + return instance +} + +func (n_ NDArrayStridedSliceGradient) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayStridedSliceGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayStridedSliceGradient](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131741-initwithdevice?language=objc +func NewNDArrayStridedSliceGradientWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayStridedSliceGradient { + instance := NDArrayStridedSliceGradientClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayStridedSliceGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayStridedSliceGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayStridedSliceGradient](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayStridedSliceGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayStridedSliceGradient { + instance := NDArrayStridedSliceGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nd_array_unary_gradient_kernel.gen.go b/macos/mps/nd_array_unary_gradient_kernel.gen.go new file mode 100644 index 00000000..e16a71ef --- /dev/null +++ b/macos/mps/nd_array_unary_gradient_kernel.gen.go @@ -0,0 +1,139 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayUnaryGradientKernel] class. +var NDArrayUnaryGradientKernelClass = _NDArrayUnaryGradientKernelClass{objc.GetClass("MPSNDArrayUnaryGradientKernel")} + +type _NDArrayUnaryGradientKernelClass struct { + objc.Class +} + +// An interface definition for the [NDArrayUnaryGradientKernel] class. +type INDArrayUnaryGradientKernel interface { + INDArrayMultiaryGradientKernel + EncodeToCommandBufferSourceArraySourceGradientGradientState(cmdBuf metal.PCommandBuffer, sourceArray INDArray, gradient INDArray, state IState) NDArray + EncodeToCommandBufferObjectSourceArraySourceGradientGradientState(cmdBufObject objc.IObject, sourceArray INDArray, gradient INDArray, state IState) NDArray +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarygradientkernel?language=objc +type NDArrayUnaryGradientKernel struct { + NDArrayMultiaryGradientKernel +} + +func NDArrayUnaryGradientKernelFrom(ptr unsafe.Pointer) NDArrayUnaryGradientKernel { + return NDArrayUnaryGradientKernel{ + NDArrayMultiaryGradientKernel: NDArrayMultiaryGradientKernelFrom(ptr), + } +} + +func (n_ NDArrayUnaryGradientKernel) InitWithDevice(device metal.PDevice) NDArrayUnaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayUnaryGradientKernel](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarygradientkernel/3143532-initwithdevice?language=objc +func NewNDArrayUnaryGradientKernelWithDevice(device metal.PDevice) NDArrayUnaryGradientKernel { + instance := NDArrayUnaryGradientKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NDArrayUnaryGradientKernelClass) Alloc() NDArrayUnaryGradientKernel { + rv := objc.Call[NDArrayUnaryGradientKernel](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayUnaryGradientKernel_Alloc() NDArrayUnaryGradientKernel { + return NDArrayUnaryGradientKernelClass.Alloc() +} + +func (nc _NDArrayUnaryGradientKernelClass) New() NDArrayUnaryGradientKernel { + rv := objc.Call[NDArrayUnaryGradientKernel](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayUnaryGradientKernel() NDArrayUnaryGradientKernel { + return NDArrayUnaryGradientKernelClass.New() +} + +func (n_ NDArrayUnaryGradientKernel) Init() NDArrayUnaryGradientKernel { + rv := objc.Call[NDArrayUnaryGradientKernel](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayUnaryGradientKernel) InitWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayUnaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayUnaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:sourceGradientIndex:"), po0, count, sourceGradientIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarygradientkernel/3143524-initwithdevice?language=objc +func NewNDArrayUnaryGradientKernelWithDeviceSourceCountSourceGradientIndex(device metal.PDevice, count uint, sourceGradientIndex uint) NDArrayUnaryGradientKernel { + instance := NDArrayUnaryGradientKernelClass.Alloc().InitWithDeviceSourceCountSourceGradientIndex(device, count, sourceGradientIndex) + instance.Autorelease() + return instance +} + +func (n_ NDArrayUnaryGradientKernel) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayUnaryGradientKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayUnaryGradientKernel](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131741-initwithdevice?language=objc +func NewNDArrayUnaryGradientKernelWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayUnaryGradientKernel { + instance := NDArrayUnaryGradientKernelClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayUnaryGradientKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayUnaryGradientKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayUnaryGradientKernel](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayUnaryGradientKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayUnaryGradientKernel { + instance := NDArrayUnaryGradientKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarygradientkernel/3143530-encodetocommandbuffer?language=objc +func (n_ NDArrayUnaryGradientKernel) EncodeToCommandBufferSourceArraySourceGradientGradientState(cmdBuf metal.PCommandBuffer, sourceArray INDArray, gradient INDArray, state IState) NDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:sourceArray:sourceGradient:gradientState:"), po0, objc.Ptr(sourceArray), objc.Ptr(gradient), objc.Ptr(state)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarygradientkernel/3143530-encodetocommandbuffer?language=objc +func (n_ NDArrayUnaryGradientKernel) EncodeToCommandBufferObjectSourceArraySourceGradientGradientState(cmdBufObject objc.IObject, sourceArray INDArray, gradient INDArray, state IState) NDArray { + rv := objc.Call[NDArray](n_, objc.Sel("encodeToCommandBuffer:sourceArray:sourceGradient:gradientState:"), objc.Ptr(cmdBufObject), objc.Ptr(sourceArray), objc.Ptr(gradient), objc.Ptr(state)) + return rv +} diff --git a/macos/mps/nd_array_unary_kernel.gen.go b/macos/mps/nd_array_unary_kernel.gen.go new file mode 100644 index 00000000..9904501d --- /dev/null +++ b/macos/mps/nd_array_unary_kernel.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NDArrayUnaryKernel] class. +var NDArrayUnaryKernelClass = _NDArrayUnaryKernelClass{objc.GetClass("MPSNDArrayUnaryKernel")} + +type _NDArrayUnaryKernelClass struct { + objc.Class +} + +// An interface definition for the [NDArrayUnaryKernel] class. +type INDArrayUnaryKernel interface { + INDArrayMultiaryKernel + EncodeToCommandBufferSourceArrayResultStateDestinationArray(cmdBuf metal.PCommandBuffer, sourceArray INDArray, outGradientState IState, destination INDArray) + EncodeToCommandBufferObjectSourceArrayResultStateDestinationArray(cmdBufObject objc.IObject, sourceArray INDArray, outGradientState IState, destination INDArray) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarykernel?language=objc +type NDArrayUnaryKernel struct { + NDArrayMultiaryKernel +} + +func NDArrayUnaryKernelFrom(ptr unsafe.Pointer) NDArrayUnaryKernel { + return NDArrayUnaryKernel{ + NDArrayMultiaryKernel: NDArrayMultiaryKernelFrom(ptr), + } +} + +func (n_ NDArrayUnaryKernel) InitWithDevice(device metal.PDevice) NDArrayUnaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayUnaryKernel](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarykernel/3143540-initwithdevice?language=objc +func NewNDArrayUnaryKernelWithDevice(device metal.PDevice) NDArrayUnaryKernel { + instance := NDArrayUnaryKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NDArrayUnaryKernelClass) Alloc() NDArrayUnaryKernel { + rv := objc.Call[NDArrayUnaryKernel](nc, objc.Sel("alloc")) + return rv +} + +func NDArrayUnaryKernel_Alloc() NDArrayUnaryKernel { + return NDArrayUnaryKernelClass.Alloc() +} + +func (nc _NDArrayUnaryKernelClass) New() NDArrayUnaryKernel { + rv := objc.Call[NDArrayUnaryKernel](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNDArrayUnaryKernel() NDArrayUnaryKernel { + return NDArrayUnaryKernelClass.New() +} + +func (n_ NDArrayUnaryKernel) Init() NDArrayUnaryKernel { + rv := objc.Call[NDArrayUnaryKernel](n_, objc.Sel("init")) + return rv +} + +func (n_ NDArrayUnaryKernel) InitWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayUnaryKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayUnaryKernel](n_, objc.Sel("initWithDevice:sourceCount:"), po0, count) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarykernel/3175010-initwithdevice?language=objc +func NewNDArrayUnaryKernelWithDeviceSourceCount(device metal.PDevice, count uint) NDArrayUnaryKernel { + instance := NDArrayUnaryKernelClass.Alloc().InitWithDeviceSourceCount(device, count) + instance.Autorelease() + return instance +} + +func (n_ NDArrayUnaryKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayUnaryKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NDArrayUnaryKernel](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarraymultiarybase/3131734-copywithzone?language=objc +func NDArrayUnaryKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NDArrayUnaryKernel { + instance := NDArrayUnaryKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarykernel/3143538-encodetocommandbuffer?language=objc +func (n_ NDArrayUnaryKernel) EncodeToCommandBufferSourceArrayResultStateDestinationArray(cmdBuf metal.PCommandBuffer, sourceArray INDArray, outGradientState IState, destination INDArray) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", cmdBuf) + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:sourceArray:resultState:destinationArray:"), po0, objc.Ptr(sourceArray), objc.Ptr(outGradientState), objc.Ptr(destination)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarrayunarykernel/3143538-encodetocommandbuffer?language=objc +func (n_ NDArrayUnaryKernel) EncodeToCommandBufferObjectSourceArrayResultStateDestinationArray(cmdBufObject objc.IObject, sourceArray INDArray, outGradientState IState, destination INDArray) { + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:sourceArray:resultState:destinationArray:"), objc.Ptr(cmdBufObject), objc.Ptr(sourceArray), objc.Ptr(outGradientState), objc.Ptr(destination)) +} diff --git a/macos/mps/nn_addition_gradient_node.gen.go b/macos/mps/nn_addition_gradient_node.gen.go new file mode 100644 index 00000000..597d26f9 --- /dev/null +++ b/macos/mps/nn_addition_gradient_node.gen.go @@ -0,0 +1,98 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNAdditionGradientNode] class. +var NNAdditionGradientNodeClass = _NNAdditionGradientNodeClass{objc.GetClass("MPSNNAdditionGradientNode")} + +type _NNAdditionGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNAdditionGradientNode] class. +type INNAdditionGradientNode interface { + INNArithmeticGradientNode +} + +// A representation of a gradient addition operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnadditiongradientnode?language=objc +type NNAdditionGradientNode struct { + NNArithmeticGradientNode +} + +func NNAdditionGradientNodeFrom(ptr unsafe.Pointer) NNAdditionGradientNode { + return NNAdditionGradientNode{ + NNArithmeticGradientNode: NNArithmeticGradientNodeFrom(ptr), + } +} + +func (nc _NNAdditionGradientNodeClass) Alloc() NNAdditionGradientNode { + rv := objc.Call[NNAdditionGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNAdditionGradientNode_Alloc() NNAdditionGradientNode { + return NNAdditionGradientNodeClass.Alloc() +} + +func (nc _NNAdditionGradientNodeClass) New() NNAdditionGradientNode { + rv := objc.Call[NNAdditionGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNAdditionGradientNode() NNAdditionGradientNode { + return NNAdditionGradientNodeClass.New() +} + +func (n_ NNAdditionGradientNode) Init() NNAdditionGradientNode { + rv := objc.Call[NNAdditionGradientNode](n_, objc.Sel("init")) + return rv +} + +func (n_ NNAdditionGradientNode) InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNAdditionGradientNode { + rv := objc.Call[NNAdditionGradientNode](n_, objc.Sel("initWithGradientImages:forwardFilter:isSecondarySourceFilter:"), gradientImages, objc.Ptr(filter), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952980-initwithgradientimages?language=objc +func NewNNAdditionGradientNodeWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNAdditionGradientNode { + instance := NNAdditionGradientNodeClass.Alloc().InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages, filter, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (n_ NNAdditionGradientNode) InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNAdditionGradientNode { + rv := objc.Call[NNAdditionGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956166-initwithsourcegradient?language=objc +func NewNNAdditionGradientNodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNAdditionGradientNode { + instance := NNAdditionGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (nc _NNAdditionGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNAdditionGradientNode { + rv := objc.Call[NNAdditionGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956167-nodewithsourcegradient?language=objc +func NNAdditionGradientNode_NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNAdditionGradientNode { + return NNAdditionGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) +} diff --git a/macos/mps/nn_addition_node.gen.go b/macos/mps/nn_addition_node.gen.go new file mode 100644 index 00000000..1a511c7f --- /dev/null +++ b/macos/mps/nn_addition_node.gen.go @@ -0,0 +1,110 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNAdditionNode] class. +var NNAdditionNodeClass = _NNAdditionNodeClass{objc.GetClass("MPSNNAdditionNode")} + +type _NNAdditionNodeClass struct { + objc.Class +} + +// An interface definition for the [NNAdditionNode] class. +type INNAdditionNode interface { + INNBinaryArithmeticNode +} + +// A representation of an addition operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnadditionnode?language=objc +type NNAdditionNode struct { + NNBinaryArithmeticNode +} + +func NNAdditionNodeFrom(ptr unsafe.Pointer) NNAdditionNode { + return NNAdditionNode{ + NNBinaryArithmeticNode: NNBinaryArithmeticNodeFrom(ptr), + } +} + +func (nc _NNAdditionNodeClass) Alloc() NNAdditionNode { + rv := objc.Call[NNAdditionNode](nc, objc.Sel("alloc")) + return rv +} + +func NNAdditionNode_Alloc() NNAdditionNode { + return NNAdditionNodeClass.Alloc() +} + +func (nc _NNAdditionNodeClass) New() NNAdditionNode { + rv := objc.Call[NNAdditionNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNAdditionNode() NNAdditionNode { + return NNAdditionNodeClass.New() +} + +func (n_ NNAdditionNode) Init() NNAdditionNode { + rv := objc.Call[NNAdditionNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNAdditionNodeClass) NodeWithSources(sourceNodes []INNImageNode) NNAdditionNode { + rv := objc.Call[NNAdditionNode](nc, objc.Sel("nodeWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890829-nodewithsources?language=objc +func NNAdditionNode_NodeWithSources(sourceNodes []INNImageNode) NNAdditionNode { + return NNAdditionNodeClass.NodeWithSources(sourceNodes) +} + +func (nc _NNAdditionNodeClass) NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNAdditionNode { + rv := objc.Call[NNAdditionNode](nc, objc.Sel("nodeWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890830-nodewithleftsource?language=objc +func NNAdditionNode_NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNAdditionNode { + return NNAdditionNodeClass.NodeWithLeftSourceRightSource(left, right) +} + +func (n_ NNAdditionNode) InitWithSources(sourceNodes []INNImageNode) NNAdditionNode { + rv := objc.Call[NNAdditionNode](n_, objc.Sel("initWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890820-initwithsources?language=objc +func NewNNAdditionNodeWithSources(sourceNodes []INNImageNode) NNAdditionNode { + instance := NNAdditionNodeClass.Alloc().InitWithSources(sourceNodes) + instance.Autorelease() + return instance +} + +func (n_ NNAdditionNode) InitWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNAdditionNode { + rv := objc.Call[NNAdditionNode](n_, objc.Sel("initWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890825-initwithleftsource?language=objc +func NewNNAdditionNodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNAdditionNode { + instance := NNAdditionNodeClass.Alloc().InitWithLeftSourceRightSource(left, right) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_arithmetic_gradient_node.gen.go b/macos/mps/nn_arithmetic_gradient_node.gen.go new file mode 100644 index 00000000..6676e864 --- /dev/null +++ b/macos/mps/nn_arithmetic_gradient_node.gen.go @@ -0,0 +1,243 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNArithmeticGradientNode] class. +var NNArithmeticGradientNodeClass = _NNArithmeticGradientNodeClass{objc.GetClass("MPSNNArithmeticGradientNode")} + +type _NNArithmeticGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNArithmeticGradientNode] class. +type INNArithmeticGradientNode interface { + INNGradientFilterNode + SecondaryScale() float64 + SetSecondaryScale(value float64) + IsSecondarySourceFilter() bool + SecondaryStrideInPixelsY() uint + SetSecondaryStrideInPixelsY(value uint) + SecondaryStrideInPixelsX() uint + SetSecondaryStrideInPixelsX(value uint) + MaximumValue() float64 + SetMaximumValue(value float64) + PrimaryScale() float64 + SetPrimaryScale(value float64) + MinimumValue() float64 + SetMinimumValue(value float64) + Bias() float64 + SetBias(value float64) + SecondaryStrideInFeatureChannels() uint + SetSecondaryStrideInFeatureChannels(value uint) +} + +// A representation of the base class for gradient arithmetic operators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode?language=objc +type NNArithmeticGradientNode struct { + NNGradientFilterNode +} + +func NNArithmeticGradientNodeFrom(ptr unsafe.Pointer) NNArithmeticGradientNode { + return NNArithmeticGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (n_ NNArithmeticGradientNode) InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNArithmeticGradientNode { + rv := objc.Call[NNArithmeticGradientNode](n_, objc.Sel("initWithGradientImages:forwardFilter:isSecondarySourceFilter:"), gradientImages, objc.Ptr(filter), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952980-initwithgradientimages?language=objc +func NewNNArithmeticGradientNodeWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNArithmeticGradientNode { + instance := NNArithmeticGradientNodeClass.Alloc().InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages, filter, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (n_ NNArithmeticGradientNode) InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNArithmeticGradientNode { + rv := objc.Call[NNArithmeticGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956166-initwithsourcegradient?language=objc +func NewNNArithmeticGradientNodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNArithmeticGradientNode { + instance := NNArithmeticGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (nc _NNArithmeticGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNArithmeticGradientNode { + rv := objc.Call[NNArithmeticGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956167-nodewithsourcegradient?language=objc +func NNArithmeticGradientNode_NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNArithmeticGradientNode { + return NNArithmeticGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) +} + +func (nc _NNArithmeticGradientNodeClass) Alloc() NNArithmeticGradientNode { + rv := objc.Call[NNArithmeticGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNArithmeticGradientNode_Alloc() NNArithmeticGradientNode { + return NNArithmeticGradientNodeClass.Alloc() +} + +func (nc _NNArithmeticGradientNodeClass) New() NNArithmeticGradientNode { + rv := objc.Call[NNArithmeticGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNArithmeticGradientNode() NNArithmeticGradientNode { + return NNArithmeticGradientNodeClass.New() +} + +func (n_ NNArithmeticGradientNode) Init() NNArithmeticGradientNode { + rv := objc.Call[NNArithmeticGradientNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952981-secondaryscale?language=objc +func (n_ NNArithmeticGradientNode) SecondaryScale() float64 { + rv := objc.Call[float64](n_, objc.Sel("secondaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952981-secondaryscale?language=objc +func (n_ NNArithmeticGradientNode) SetSecondaryScale(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952987-issecondarysourcefilter?language=objc +func (n_ NNArithmeticGradientNode) IsSecondarySourceFilter() bool { + rv := objc.Call[bool](n_, objc.Sel("isSecondarySourceFilter")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952994-secondarystrideinpixelsy?language=objc +func (n_ NNArithmeticGradientNode) SecondaryStrideInPixelsY() uint { + rv := objc.Call[uint](n_, objc.Sel("secondaryStrideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952994-secondarystrideinpixelsy?language=objc +func (n_ NNArithmeticGradientNode) SetSecondaryStrideInPixelsY(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryStrideInPixelsY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952968-secondarystrideinpixelsx?language=objc +func (n_ NNArithmeticGradientNode) SecondaryStrideInPixelsX() uint { + rv := objc.Call[uint](n_, objc.Sel("secondaryStrideInPixelsX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952968-secondarystrideinpixelsx?language=objc +func (n_ NNArithmeticGradientNode) SetSecondaryStrideInPixelsX(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryStrideInPixelsX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952986-maximumvalue?language=objc +func (n_ NNArithmeticGradientNode) MaximumValue() float64 { + rv := objc.Call[float64](n_, objc.Sel("maximumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952986-maximumvalue?language=objc +func (n_ NNArithmeticGradientNode) SetMaximumValue(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setMaximumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952993-primaryscale?language=objc +func (n_ NNArithmeticGradientNode) PrimaryScale() float64 { + rv := objc.Call[float64](n_, objc.Sel("primaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952993-primaryscale?language=objc +func (n_ NNArithmeticGradientNode) SetPrimaryScale(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setPrimaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952989-minimumvalue?language=objc +func (n_ NNArithmeticGradientNode) MinimumValue() float64 { + rv := objc.Call[float64](n_, objc.Sel("minimumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952989-minimumvalue?language=objc +func (n_ NNArithmeticGradientNode) SetMinimumValue(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setMinimumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952988-bias?language=objc +func (n_ NNArithmeticGradientNode) Bias() float64 { + rv := objc.Call[float64](n_, objc.Sel("bias")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952988-bias?language=objc +func (n_ NNArithmeticGradientNode) SetBias(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setBias:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952984-secondarystrideinfeaturechannels?language=objc +func (n_ NNArithmeticGradientNode) SecondaryStrideInFeatureChannels() uint { + rv := objc.Call[uint](n_, objc.Sel("secondaryStrideInFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952984-secondarystrideinfeaturechannels?language=objc +func (n_ NNArithmeticGradientNode) SetSecondaryStrideInFeatureChannels(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryStrideInFeatureChannels:"), value) +} diff --git a/macos/mps/nn_arithmetic_gradient_state_node.gen.go b/macos/mps/nn_arithmetic_gradient_state_node.gen.go new file mode 100644 index 00000000..9207b907 --- /dev/null +++ b/macos/mps/nn_arithmetic_gradient_state_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNArithmeticGradientStateNode] class. +var NNArithmeticGradientStateNodeClass = _NNArithmeticGradientStateNodeClass{objc.GetClass("MPSNNArithmeticGradientStateNode")} + +type _NNArithmeticGradientStateNodeClass struct { + objc.Class +} + +// An interface definition for the [NNArithmeticGradientStateNode] class. +type INNArithmeticGradientStateNode interface { + INNBinaryGradientStateNode +} + +// A representation of the clamp mask used by gradient arithmetic operators. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientstatenode?language=objc +type NNArithmeticGradientStateNode struct { + NNBinaryGradientStateNode +} + +func NNArithmeticGradientStateNodeFrom(ptr unsafe.Pointer) NNArithmeticGradientStateNode { + return NNArithmeticGradientStateNode{ + NNBinaryGradientStateNode: NNBinaryGradientStateNodeFrom(ptr), + } +} + +func (nc _NNArithmeticGradientStateNodeClass) Alloc() NNArithmeticGradientStateNode { + rv := objc.Call[NNArithmeticGradientStateNode](nc, objc.Sel("alloc")) + return rv +} + +func NNArithmeticGradientStateNode_Alloc() NNArithmeticGradientStateNode { + return NNArithmeticGradientStateNodeClass.Alloc() +} + +func (nc _NNArithmeticGradientStateNodeClass) New() NNArithmeticGradientStateNode { + rv := objc.Call[NNArithmeticGradientStateNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNArithmeticGradientStateNode() NNArithmeticGradientStateNode { + return NNArithmeticGradientStateNodeClass.New() +} + +func (n_ NNArithmeticGradientStateNode) Init() NNArithmeticGradientStateNode { + rv := objc.Call[NNArithmeticGradientStateNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_bilinear_scale_node.gen.go b/macos/mps/nn_bilinear_scale_node.gen.go new file mode 100644 index 00000000..8806796d --- /dev/null +++ b/macos/mps/nn_bilinear_scale_node.gen.go @@ -0,0 +1,85 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNBilinearScaleNode] class. +var NNBilinearScaleNodeClass = _NNBilinearScaleNodeClass{objc.GetClass("MPSNNBilinearScaleNode")} + +type _NNBilinearScaleNodeClass struct { + objc.Class +} + +// An interface definition for the [NNBilinearScaleNode] class. +type INNBilinearScaleNode interface { + INNScaleNode +} + +// A representation of a bilinear resampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbilinearscalenode?language=objc +type NNBilinearScaleNode struct { + NNScaleNode +} + +func NNBilinearScaleNodeFrom(ptr unsafe.Pointer) NNBilinearScaleNode { + return NNBilinearScaleNode{ + NNScaleNode: NNScaleNodeFrom(ptr), + } +} + +func (nc _NNBilinearScaleNodeClass) Alloc() NNBilinearScaleNode { + rv := objc.Call[NNBilinearScaleNode](nc, objc.Sel("alloc")) + return rv +} + +func NNBilinearScaleNode_Alloc() NNBilinearScaleNode { + return NNBilinearScaleNodeClass.Alloc() +} + +func (nc _NNBilinearScaleNodeClass) New() NNBilinearScaleNode { + rv := objc.Call[NNBilinearScaleNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNBilinearScaleNode() NNBilinearScaleNode { + return NNBilinearScaleNodeClass.New() +} + +func (n_ NNBilinearScaleNode) Init() NNBilinearScaleNode { + rv := objc.Call[NNBilinearScaleNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNBilinearScaleNodeClass) NodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNBilinearScaleNode { + rv := objc.Call[NNBilinearScaleNode](nc, objc.Sel("nodeWithSource:outputSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnscalenode/2915280-nodewithsource?language=objc +func NNBilinearScaleNode_NodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNBilinearScaleNode { + return NNBilinearScaleNodeClass.NodeWithSourceOutputSize(sourceNode, size) +} + +func (n_ NNBilinearScaleNode) InitWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNBilinearScaleNode { + rv := objc.Call[NNBilinearScaleNode](n_, objc.Sel("initWithSource:outputSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnscalenode/2915285-initwithsource?language=objc +func NewNNBilinearScaleNodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNBilinearScaleNode { + instance := NNBilinearScaleNodeClass.Alloc().InitWithSourceOutputSize(sourceNode, size) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_binary_arithmetic_node.gen.go b/macos/mps/nn_binary_arithmetic_node.gen.go new file mode 100644 index 00000000..e0b2ad1d --- /dev/null +++ b/macos/mps/nn_binary_arithmetic_node.gen.go @@ -0,0 +1,306 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNBinaryArithmeticNode] class. +var NNBinaryArithmeticNodeClass = _NNBinaryArithmeticNodeClass{objc.GetClass("MPSNNBinaryArithmeticNode")} + +type _NNBinaryArithmeticNodeClass struct { + objc.Class +} + +// An interface definition for the [NNBinaryArithmeticNode] class. +type INNBinaryArithmeticNode interface { + INNFilterNode + GradientClass() objc.Class + SecondaryScale() float64 + SetSecondaryScale(value float64) + SecondaryStrideInPixelsY() uint + SetSecondaryStrideInPixelsY(value uint) + SecondaryStrideInPixelsX() uint + SetSecondaryStrideInPixelsX(value uint) + PrimaryStrideInPixelsY() uint + SetPrimaryStrideInPixelsY(value uint) + MaximumValue() float64 + SetMaximumValue(value float64) + PrimaryStrideInPixelsX() uint + SetPrimaryStrideInPixelsX(value uint) + PrimaryScale() float64 + SetPrimaryScale(value float64) + MinimumValue() float64 + SetMinimumValue(value float64) + Bias() float64 + SetBias(value float64) + SecondaryStrideInFeatureChannels() uint + SetSecondaryStrideInFeatureChannels(value uint) + PrimaryStrideInFeatureChannels() uint + SetPrimaryStrideInFeatureChannels(value uint) +} + +// Virtual base class for basic arithmetic nodes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode?language=objc +type NNBinaryArithmeticNode struct { + NNFilterNode +} + +func NNBinaryArithmeticNodeFrom(ptr unsafe.Pointer) NNBinaryArithmeticNode { + return NNBinaryArithmeticNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNBinaryArithmeticNodeClass) NodeWithSources(sourceNodes []INNImageNode) NNBinaryArithmeticNode { + rv := objc.Call[NNBinaryArithmeticNode](nc, objc.Sel("nodeWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890829-nodewithsources?language=objc +func NNBinaryArithmeticNode_NodeWithSources(sourceNodes []INNImageNode) NNBinaryArithmeticNode { + return NNBinaryArithmeticNodeClass.NodeWithSources(sourceNodes) +} + +func (nc _NNBinaryArithmeticNodeClass) NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNBinaryArithmeticNode { + rv := objc.Call[NNBinaryArithmeticNode](nc, objc.Sel("nodeWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890830-nodewithleftsource?language=objc +func NNBinaryArithmeticNode_NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNBinaryArithmeticNode { + return NNBinaryArithmeticNodeClass.NodeWithLeftSourceRightSource(left, right) +} + +func (n_ NNBinaryArithmeticNode) InitWithSources(sourceNodes []INNImageNode) NNBinaryArithmeticNode { + rv := objc.Call[NNBinaryArithmeticNode](n_, objc.Sel("initWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890820-initwithsources?language=objc +func NewNNBinaryArithmeticNodeWithSources(sourceNodes []INNImageNode) NNBinaryArithmeticNode { + instance := NNBinaryArithmeticNodeClass.Alloc().InitWithSources(sourceNodes) + instance.Autorelease() + return instance +} + +func (n_ NNBinaryArithmeticNode) InitWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNBinaryArithmeticNode { + rv := objc.Call[NNBinaryArithmeticNode](n_, objc.Sel("initWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890825-initwithleftsource?language=objc +func NewNNBinaryArithmeticNodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNBinaryArithmeticNode { + instance := NNBinaryArithmeticNodeClass.Alloc().InitWithLeftSourceRightSource(left, right) + instance.Autorelease() + return instance +} + +func (nc _NNBinaryArithmeticNodeClass) Alloc() NNBinaryArithmeticNode { + rv := objc.Call[NNBinaryArithmeticNode](nc, objc.Sel("alloc")) + return rv +} + +func NNBinaryArithmeticNode_Alloc() NNBinaryArithmeticNode { + return NNBinaryArithmeticNodeClass.Alloc() +} + +func (nc _NNBinaryArithmeticNodeClass) New() NNBinaryArithmeticNode { + rv := objc.Call[NNBinaryArithmeticNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNBinaryArithmeticNode() NNBinaryArithmeticNode { + return NNBinaryArithmeticNodeClass.New() +} + +func (n_ NNBinaryArithmeticNode) Init() NNBinaryArithmeticNode { + rv := objc.Call[NNBinaryArithmeticNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952978-gradientclass?language=objc +func (n_ NNBinaryArithmeticNode) GradientClass() objc.Class { + rv := objc.Call[objc.Class](n_, objc.Sel("gradientClass")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952976-secondaryscale?language=objc +func (n_ NNBinaryArithmeticNode) SecondaryScale() float64 { + rv := objc.Call[float64](n_, objc.Sel("secondaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952976-secondaryscale?language=objc +func (n_ NNBinaryArithmeticNode) SetSecondaryScale(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952985-secondarystrideinpixelsy?language=objc +func (n_ NNBinaryArithmeticNode) SecondaryStrideInPixelsY() uint { + rv := objc.Call[uint](n_, objc.Sel("secondaryStrideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952985-secondarystrideinpixelsy?language=objc +func (n_ NNBinaryArithmeticNode) SetSecondaryStrideInPixelsY(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryStrideInPixelsY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952972-secondarystrideinpixelsx?language=objc +func (n_ NNBinaryArithmeticNode) SecondaryStrideInPixelsX() uint { + rv := objc.Call[uint](n_, objc.Sel("secondaryStrideInPixelsX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952972-secondarystrideinpixelsx?language=objc +func (n_ NNBinaryArithmeticNode) SetSecondaryStrideInPixelsX(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryStrideInPixelsX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952996-primarystrideinpixelsy?language=objc +func (n_ NNBinaryArithmeticNode) PrimaryStrideInPixelsY() uint { + rv := objc.Call[uint](n_, objc.Sel("primaryStrideInPixelsY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952996-primarystrideinpixelsy?language=objc +func (n_ NNBinaryArithmeticNode) SetPrimaryStrideInPixelsY(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setPrimaryStrideInPixelsY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952979-maximumvalue?language=objc +func (n_ NNBinaryArithmeticNode) MaximumValue() float64 { + rv := objc.Call[float64](n_, objc.Sel("maximumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952979-maximumvalue?language=objc +func (n_ NNBinaryArithmeticNode) SetMaximumValue(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setMaximumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952973-primarystrideinpixelsx?language=objc +func (n_ NNBinaryArithmeticNode) PrimaryStrideInPixelsX() uint { + rv := objc.Call[uint](n_, objc.Sel("primaryStrideInPixelsX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952973-primarystrideinpixelsx?language=objc +func (n_ NNBinaryArithmeticNode) SetPrimaryStrideInPixelsX(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setPrimaryStrideInPixelsX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952966-primaryscale?language=objc +func (n_ NNBinaryArithmeticNode) PrimaryScale() float64 { + rv := objc.Call[float64](n_, objc.Sel("primaryScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952966-primaryscale?language=objc +func (n_ NNBinaryArithmeticNode) SetPrimaryScale(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setPrimaryScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952970-minimumvalue?language=objc +func (n_ NNBinaryArithmeticNode) MinimumValue() float64 { + rv := objc.Call[float64](n_, objc.Sel("minimumValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952970-minimumvalue?language=objc +func (n_ NNBinaryArithmeticNode) SetMinimumValue(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setMinimumValue:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952964-bias?language=objc +func (n_ NNBinaryArithmeticNode) Bias() float64 { + rv := objc.Call[float64](n_, objc.Sel("bias")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952964-bias?language=objc +func (n_ NNBinaryArithmeticNode) SetBias(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setBias:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952974-secondarystrideinfeaturechannels?language=objc +func (n_ NNBinaryArithmeticNode) SecondaryStrideInFeatureChannels() uint { + rv := objc.Call[uint](n_, objc.Sel("secondaryStrideInFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952974-secondarystrideinfeaturechannels?language=objc +func (n_ NNBinaryArithmeticNode) SetSecondaryStrideInFeatureChannels(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setSecondaryStrideInFeatureChannels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952983-primarystrideinfeaturechannels?language=objc +func (n_ NNBinaryArithmeticNode) PrimaryStrideInFeatureChannels() uint { + rv := objc.Call[uint](n_, objc.Sel("primaryStrideInFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2952983-primarystrideinfeaturechannels?language=objc +func (n_ NNBinaryArithmeticNode) SetPrimaryStrideInFeatureChannels(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setPrimaryStrideInFeatureChannels:"), value) +} diff --git a/macos/mps/nn_binary_gradient_state.gen.go b/macos/mps/nn_binary_gradient_state.gen.go new file mode 100644 index 00000000..46f11bbe --- /dev/null +++ b/macos/mps/nn_binary_gradient_state.gen.go @@ -0,0 +1,116 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNBinaryGradientState] class. +var NNBinaryGradientStateClass = _NNBinaryGradientStateClass{objc.GetClass("MPSNNBinaryGradientState")} + +type _NNBinaryGradientStateClass struct { + objc.Class +} + +// An interface definition for the [NNBinaryGradientState] class. +type INNBinaryGradientState interface { + IState +} + +// A class representing the state of a gradient binary kernel when it was encoded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinarygradientstate?language=objc +type NNBinaryGradientState struct { + State +} + +func NNBinaryGradientStateFrom(ptr unsafe.Pointer) NNBinaryGradientState { + return NNBinaryGradientState{ + State: StateFrom(ptr), + } +} + +func (nc _NNBinaryGradientStateClass) Alloc() NNBinaryGradientState { + rv := objc.Call[NNBinaryGradientState](nc, objc.Sel("alloc")) + return rv +} + +func NNBinaryGradientState_Alloc() NNBinaryGradientState { + return NNBinaryGradientStateClass.Alloc() +} + +func (nc _NNBinaryGradientStateClass) New() NNBinaryGradientState { + rv := objc.Call[NNBinaryGradientState](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNBinaryGradientState() NNBinaryGradientState { + return NNBinaryGradientStateClass.New() +} + +func (n_ NNBinaryGradientState) Init() NNBinaryGradientState { + rv := objc.Call[NNBinaryGradientState](n_, objc.Sel("init")) + return rv +} + +func (n_ NNBinaryGradientState) InitWithResources(resources []metal.PResource) NNBinaryGradientState { + rv := objc.Call[NNBinaryGradientState](n_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewNNBinaryGradientStateWithResources(resources []metal.PResource) NNBinaryGradientState { + instance := NNBinaryGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (n_ NNBinaryGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NNBinaryGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNBinaryGradientState](n_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewNNBinaryGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NNBinaryGradientState { + instance := NNBinaryGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (n_ NNBinaryGradientState) InitWithResource(resource metal.PResource) NNBinaryGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[NNBinaryGradientState](n_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewNNBinaryGradientStateWithResource(resource metal.PResource) NNBinaryGradientState { + instance := NNBinaryGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (nc _NNBinaryGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NNBinaryGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[NNBinaryGradientState](nc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func NNBinaryGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NNBinaryGradientState { + return NNBinaryGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} diff --git a/macos/mps/nn_binary_gradient_state_node.gen.go b/macos/mps/nn_binary_gradient_state_node.gen.go new file mode 100644 index 00000000..d7a746eb --- /dev/null +++ b/macos/mps/nn_binary_gradient_state_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNBinaryGradientStateNode] class. +var NNBinaryGradientStateNodeClass = _NNBinaryGradientStateNodeClass{objc.GetClass("MPSNNBinaryGradientStateNode")} + +type _NNBinaryGradientStateNodeClass struct { + objc.Class +} + +// An interface definition for the [NNBinaryGradientStateNode] class. +type INNBinaryGradientStateNode interface { + INNStateNode +} + +// A representation of the state created to record the properties of a binary gradient kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinarygradientstatenode?language=objc +type NNBinaryGradientStateNode struct { + NNStateNode +} + +func NNBinaryGradientStateNodeFrom(ptr unsafe.Pointer) NNBinaryGradientStateNode { + return NNBinaryGradientStateNode{ + NNStateNode: NNStateNodeFrom(ptr), + } +} + +func (nc _NNBinaryGradientStateNodeClass) Alloc() NNBinaryGradientStateNode { + rv := objc.Call[NNBinaryGradientStateNode](nc, objc.Sel("alloc")) + return rv +} + +func NNBinaryGradientStateNode_Alloc() NNBinaryGradientStateNode { + return NNBinaryGradientStateNodeClass.Alloc() +} + +func (nc _NNBinaryGradientStateNodeClass) New() NNBinaryGradientStateNode { + rv := objc.Call[NNBinaryGradientStateNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNBinaryGradientStateNode() NNBinaryGradientStateNode { + return NNBinaryGradientStateNodeClass.New() +} + +func (n_ NNBinaryGradientStateNode) Init() NNBinaryGradientStateNode { + rv := objc.Call[NNBinaryGradientStateNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_compare.gen.go b/macos/mps/nn_compare.gen.go new file mode 100644 index 00000000..d06f481a --- /dev/null +++ b/macos/mps/nn_compare.gen.go @@ -0,0 +1,124 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNCompare] class. +var NNCompareClass = _NNCompareClass{objc.GetClass("MPSNNCompare")} + +type _NNCompareClass struct { + objc.Class +} + +// An interface definition for the [NNCompare] class. +type INNCompare interface { + ICNNArithmetic + ComparisonType() NNComparisonType + SetComparisonType(value NNComparisonType) + Threshold() float64 + SetThreshold(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncompare?language=objc +type NNCompare struct { + CNNArithmetic +} + +func NNCompareFrom(ptr unsafe.Pointer) NNCompare { + return NNCompare{ + CNNArithmetic: CNNArithmeticFrom(ptr), + } +} + +func (n_ NNCompare) InitWithDevice(device metal.PDevice) NNCompare { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNCompare](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncompare/3037375-initwithdevice?language=objc +func NewNNCompareWithDevice(device metal.PDevice) NNCompare { + instance := NNCompareClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNCompareClass) Alloc() NNCompare { + rv := objc.Call[NNCompare](nc, objc.Sel("alloc")) + return rv +} + +func NNCompare_Alloc() NNCompare { + return NNCompareClass.Alloc() +} + +func (nc _NNCompareClass) New() NNCompare { + rv := objc.Call[NNCompare](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNCompare() NNCompare { + return NNCompareClass.New() +} + +func (n_ NNCompare) Init() NNCompare { + rv := objc.Call[NNCompare](n_, objc.Sel("init")) + return rv +} + +func (n_ NNCompare) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNCompare { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNCompare](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNCompare_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNCompare { + instance := NNCompareClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncompare/3037374-comparisontype?language=objc +func (n_ NNCompare) ComparisonType() NNComparisonType { + rv := objc.Call[NNComparisonType](n_, objc.Sel("comparisonType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncompare/3037374-comparisontype?language=objc +func (n_ NNCompare) SetComparisonType(value NNComparisonType) { + objc.Call[objc.Void](n_, objc.Sel("setComparisonType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncompare/3037376-threshold?language=objc +func (n_ NNCompare) Threshold() float64 { + rv := objc.Call[float64](n_, objc.Sel("threshold")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncompare/3037376-threshold?language=objc +func (n_ NNCompare) SetThreshold(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setThreshold:"), value) +} diff --git a/macos/mps/nn_comparison_node.gen.go b/macos/mps/nn_comparison_node.gen.go new file mode 100644 index 00000000..a8ac452b --- /dev/null +++ b/macos/mps/nn_comparison_node.gen.go @@ -0,0 +1,127 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNComparisonNode] class. +var NNComparisonNodeClass = _NNComparisonNodeClass{objc.GetClass("MPSNNComparisonNode")} + +type _NNComparisonNodeClass struct { + objc.Class +} + +// An interface definition for the [NNComparisonNode] class. +type INNComparisonNode interface { + INNBinaryArithmeticNode + ComparisonType() NNComparisonType + SetComparisonType(value NNComparisonType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncomparisonnode?language=objc +type NNComparisonNode struct { + NNBinaryArithmeticNode +} + +func NNComparisonNodeFrom(ptr unsafe.Pointer) NNComparisonNode { + return NNComparisonNode{ + NNBinaryArithmeticNode: NNBinaryArithmeticNodeFrom(ptr), + } +} + +func (nc _NNComparisonNodeClass) Alloc() NNComparisonNode { + rv := objc.Call[NNComparisonNode](nc, objc.Sel("alloc")) + return rv +} + +func NNComparisonNode_Alloc() NNComparisonNode { + return NNComparisonNodeClass.Alloc() +} + +func (nc _NNComparisonNodeClass) New() NNComparisonNode { + rv := objc.Call[NNComparisonNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNComparisonNode() NNComparisonNode { + return NNComparisonNodeClass.New() +} + +func (n_ NNComparisonNode) Init() NNComparisonNode { + rv := objc.Call[NNComparisonNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNComparisonNodeClass) NodeWithSources(sourceNodes []INNImageNode) NNComparisonNode { + rv := objc.Call[NNComparisonNode](nc, objc.Sel("nodeWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890829-nodewithsources?language=objc +func NNComparisonNode_NodeWithSources(sourceNodes []INNImageNode) NNComparisonNode { + return NNComparisonNodeClass.NodeWithSources(sourceNodes) +} + +func (nc _NNComparisonNodeClass) NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNComparisonNode { + rv := objc.Call[NNComparisonNode](nc, objc.Sel("nodeWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890830-nodewithleftsource?language=objc +func NNComparisonNode_NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNComparisonNode { + return NNComparisonNodeClass.NodeWithLeftSourceRightSource(left, right) +} + +func (n_ NNComparisonNode) InitWithSources(sourceNodes []INNImageNode) NNComparisonNode { + rv := objc.Call[NNComparisonNode](n_, objc.Sel("initWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890820-initwithsources?language=objc +func NewNNComparisonNodeWithSources(sourceNodes []INNImageNode) NNComparisonNode { + instance := NNComparisonNodeClass.Alloc().InitWithSources(sourceNodes) + instance.Autorelease() + return instance +} + +func (n_ NNComparisonNode) InitWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNComparisonNode { + rv := objc.Call[NNComparisonNode](n_, objc.Sel("initWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890825-initwithleftsource?language=objc +func NewNNComparisonNodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNComparisonNode { + instance := NNComparisonNodeClass.Alloc().InitWithLeftSourceRightSource(left, right) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncomparisonnode/3037389-comparisontype?language=objc +func (n_ NNComparisonNode) ComparisonType() NNComparisonType { + rv := objc.Call[NNComparisonType](n_, objc.Sel("comparisonType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncomparisonnode/3037389-comparisontype?language=objc +func (n_ NNComparisonNode) SetComparisonType(value NNComparisonType) { + objc.Call[objc.Void](n_, objc.Sel("setComparisonType:"), value) +} diff --git a/macos/mps/nn_concatenation_gradient_node.gen.go b/macos/mps/nn_concatenation_gradient_node.gen.go new file mode 100644 index 00000000..ee6a3056 --- /dev/null +++ b/macos/mps/nn_concatenation_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNConcatenationGradientNode] class. +var NNConcatenationGradientNodeClass = _NNConcatenationGradientNodeClass{objc.GetClass("MPSNNConcatenationGradientNode")} + +type _NNConcatenationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNConcatenationGradientNode] class. +type INNConcatenationGradientNode interface { + INNGradientFilterNode +} + +// A representation of the results from one or more gradient kernels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnconcatenationgradientnode?language=objc +type NNConcatenationGradientNode struct { + NNGradientFilterNode +} + +func NNConcatenationGradientNodeFrom(ptr unsafe.Pointer) NNConcatenationGradientNode { + return NNConcatenationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (n_ NNConcatenationGradientNode) InitWithSourceGradientSourceImageGradientState(gradientSourceNode INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNConcatenationGradientNode { + rv := objc.Call[NNConcatenationGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(gradientSourceNode), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnconcatenationgradientnode/2951934-initwithsourcegradient?language=objc +func NewNNConcatenationGradientNodeWithSourceGradientSourceImageGradientState(gradientSourceNode INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNConcatenationGradientNode { + instance := NNConcatenationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(gradientSourceNode, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (nc _NNConcatenationGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(gradientSourceNode INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNConcatenationGradientNode { + rv := objc.Call[NNConcatenationGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(gradientSourceNode), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnconcatenationgradientnode/2951948-nodewithsourcegradient?language=objc +func NNConcatenationGradientNode_NodeWithSourceGradientSourceImageGradientState(gradientSourceNode INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNConcatenationGradientNode { + return NNConcatenationGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(gradientSourceNode, sourceImage, gradientState) +} + +func (nc _NNConcatenationGradientNodeClass) Alloc() NNConcatenationGradientNode { + rv := objc.Call[NNConcatenationGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNConcatenationGradientNode_Alloc() NNConcatenationGradientNode { + return NNConcatenationGradientNodeClass.Alloc() +} + +func (nc _NNConcatenationGradientNodeClass) New() NNConcatenationGradientNode { + rv := objc.Call[NNConcatenationGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNConcatenationGradientNode() NNConcatenationGradientNode { + return NNConcatenationGradientNodeClass.New() +} + +func (n_ NNConcatenationGradientNode) Init() NNConcatenationGradientNode { + rv := objc.Call[NNConcatenationGradientNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_concatenation_node.gen.go b/macos/mps/nn_concatenation_node.gen.go new file mode 100644 index 00000000..955d88d4 --- /dev/null +++ b/macos/mps/nn_concatenation_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNConcatenationNode] class. +var NNConcatenationNodeClass = _NNConcatenationNodeClass{objc.GetClass("MPSNNConcatenationNode")} + +type _NNConcatenationNodeClass struct { + objc.Class +} + +// An interface definition for the [NNConcatenationNode] class. +type INNConcatenationNode interface { + INNFilterNode +} + +// A representation of the results from one or more kernels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnconcatenationnode?language=objc +type NNConcatenationNode struct { + NNFilterNode +} + +func NNConcatenationNodeFrom(ptr unsafe.Pointer) NNConcatenationNode { + return NNConcatenationNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNConcatenationNodeClass) NodeWithSources(sourceNodes []INNImageNode) NNConcatenationNode { + rv := objc.Call[NNConcatenationNode](nc, objc.Sel("nodeWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnconcatenationnode/2866432-nodewithsources?language=objc +func NNConcatenationNode_NodeWithSources(sourceNodes []INNImageNode) NNConcatenationNode { + return NNConcatenationNodeClass.NodeWithSources(sourceNodes) +} + +func (n_ NNConcatenationNode) InitWithSources(sourceNodes []INNImageNode) NNConcatenationNode { + rv := objc.Call[NNConcatenationNode](n_, objc.Sel("initWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnconcatenationnode/2866423-initwithsources?language=objc +func NewNNConcatenationNodeWithSources(sourceNodes []INNImageNode) NNConcatenationNode { + instance := NNConcatenationNodeClass.Alloc().InitWithSources(sourceNodes) + instance.Autorelease() + return instance +} + +func (nc _NNConcatenationNodeClass) Alloc() NNConcatenationNode { + rv := objc.Call[NNConcatenationNode](nc, objc.Sel("alloc")) + return rv +} + +func NNConcatenationNode_Alloc() NNConcatenationNode { + return NNConcatenationNodeClass.Alloc() +} + +func (nc _NNConcatenationNodeClass) New() NNConcatenationNode { + rv := objc.Call[NNConcatenationNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNConcatenationNode() NNConcatenationNode { + return NNConcatenationNodeClass.New() +} + +func (n_ NNConcatenationNode) Init() NNConcatenationNode { + rv := objc.Call[NNConcatenationNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_crop_and_resize_bilinear.gen.go b/macos/mps/nn_crop_and_resize_bilinear.gen.go new file mode 100644 index 00000000..5615b86a --- /dev/null +++ b/macos/mps/nn_crop_and_resize_bilinear.gen.go @@ -0,0 +1,141 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNCropAndResizeBilinear] class. +var NNCropAndResizeBilinearClass = _NNCropAndResizeBilinearClass{objc.GetClass("MPSNNCropAndResizeBilinear")} + +type _NNCropAndResizeBilinearClass struct { + objc.Class +} + +// An interface definition for the [NNCropAndResizeBilinear] class. +type INNCropAndResizeBilinear interface { + ICNNKernel + ResizeHeight() uint + ResizeWidth() uint + Regions() *Region + NumberOfRegions() uint +} + +// A cropping and bilinear resizing filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncropandresizebilinear?language=objc +type NNCropAndResizeBilinear struct { + CNNKernel +} + +func NNCropAndResizeBilinearFrom(ptr unsafe.Pointer) NNCropAndResizeBilinear { + return NNCropAndResizeBilinear{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNCropAndResizeBilinear) InitWithDeviceResizeWidthResizeHeightNumberOfRegionsRegions(device metal.PDevice, resizeWidth uint, resizeHeight uint, numberOfRegions uint, regions *Region) NNCropAndResizeBilinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNCropAndResizeBilinear](n_, objc.Sel("initWithDevice:resizeWidth:resizeHeight:numberOfRegions:regions:"), po0, resizeWidth, resizeHeight, numberOfRegions, regions) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncropandresizebilinear/3013789-initwithdevice?language=objc +func NewNNCropAndResizeBilinearWithDeviceResizeWidthResizeHeightNumberOfRegionsRegions(device metal.PDevice, resizeWidth uint, resizeHeight uint, numberOfRegions uint, regions *Region) NNCropAndResizeBilinear { + instance := NNCropAndResizeBilinearClass.Alloc().InitWithDeviceResizeWidthResizeHeightNumberOfRegionsRegions(device, resizeWidth, resizeHeight, numberOfRegions, regions) + instance.Autorelease() + return instance +} + +func (nc _NNCropAndResizeBilinearClass) Alloc() NNCropAndResizeBilinear { + rv := objc.Call[NNCropAndResizeBilinear](nc, objc.Sel("alloc")) + return rv +} + +func NNCropAndResizeBilinear_Alloc() NNCropAndResizeBilinear { + return NNCropAndResizeBilinearClass.Alloc() +} + +func (nc _NNCropAndResizeBilinearClass) New() NNCropAndResizeBilinear { + rv := objc.Call[NNCropAndResizeBilinear](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNCropAndResizeBilinear() NNCropAndResizeBilinear { + return NNCropAndResizeBilinearClass.New() +} + +func (n_ NNCropAndResizeBilinear) Init() NNCropAndResizeBilinear { + rv := objc.Call[NNCropAndResizeBilinear](n_, objc.Sel("init")) + return rv +} + +func (n_ NNCropAndResizeBilinear) InitWithDevice(device metal.PDevice) NNCropAndResizeBilinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNCropAndResizeBilinear](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewNNCropAndResizeBilinearWithDevice(device metal.PDevice) NNCropAndResizeBilinear { + instance := NNCropAndResizeBilinearClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNCropAndResizeBilinear) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNCropAndResizeBilinear { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNCropAndResizeBilinear](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNCropAndResizeBilinear_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNCropAndResizeBilinear { + instance := NNCropAndResizeBilinearClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncropandresizebilinear/3013792-resizeheight?language=objc +func (n_ NNCropAndResizeBilinear) ResizeHeight() uint { + rv := objc.Call[uint](n_, objc.Sel("resizeHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncropandresizebilinear/3013793-resizewidth?language=objc +func (n_ NNCropAndResizeBilinear) ResizeWidth() uint { + rv := objc.Call[uint](n_, objc.Sel("resizeWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncropandresizebilinear/3013791-regions?language=objc +func (n_ NNCropAndResizeBilinear) Regions() *Region { + rv := objc.Call[*Region](n_, objc.Sel("regions")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnncropandresizebilinear/3013790-numberofregions?language=objc +func (n_ NNCropAndResizeBilinear) NumberOfRegions() uint { + rv := objc.Call[uint](n_, objc.Sel("numberOfRegions")) + return rv +} diff --git a/macos/mps/nn_default_padding.gen.go b/macos/mps/nn_default_padding.gen.go new file mode 100644 index 00000000..8c045ab3 --- /dev/null +++ b/macos/mps/nn_default_padding.gen.go @@ -0,0 +1,91 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNDefaultPadding] class. +var NNDefaultPaddingClass = _NNDefaultPaddingClass{objc.GetClass("MPSNNDefaultPadding")} + +type _NNDefaultPaddingClass struct { + objc.Class +} + +// An interface definition for the [NNDefaultPadding] class. +type INNDefaultPadding interface { + objc.IObject + Label() string +} + +// A class that provides predefined padding policies for common tasks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnndefaultpadding?language=objc +type NNDefaultPadding struct { + objc.Object +} + +func NNDefaultPaddingFrom(ptr unsafe.Pointer) NNDefaultPadding { + return NNDefaultPadding{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NNDefaultPaddingClass) PaddingForTensorflowAveragePooling() NNDefaultPadding { + rv := objc.Call[NNDefaultPadding](nc, objc.Sel("paddingForTensorflowAveragePooling")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnndefaultpadding/2867164-paddingfortensorflowaveragepooli?language=objc +func NNDefaultPadding_PaddingForTensorflowAveragePooling() NNDefaultPadding { + return NNDefaultPaddingClass.PaddingForTensorflowAveragePooling() +} + +func (nc _NNDefaultPaddingClass) PaddingWithMethod(method NNPaddingMethod) NNDefaultPadding { + rv := objc.Call[NNDefaultPadding](nc, objc.Sel("paddingWithMethod:"), method) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnndefaultpadding/2867160-paddingwithmethod?language=objc +func NNDefaultPadding_PaddingWithMethod(method NNPaddingMethod) NNDefaultPadding { + return NNDefaultPaddingClass.PaddingWithMethod(method) +} + +func (nc _NNDefaultPaddingClass) Alloc() NNDefaultPadding { + rv := objc.Call[NNDefaultPadding](nc, objc.Sel("alloc")) + return rv +} + +func NNDefaultPadding_Alloc() NNDefaultPadding { + return NNDefaultPaddingClass.Alloc() +} + +func (nc _NNDefaultPaddingClass) New() NNDefaultPadding { + rv := objc.Call[NNDefaultPadding](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNDefaultPadding() NNDefaultPadding { + return NNDefaultPaddingClass.New() +} + +func (n_ NNDefaultPadding) Init() NNDefaultPadding { + rv := objc.Call[NNDefaultPadding](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnndefaultpadding/2889871-label?language=objc +func (n_ NNDefaultPadding) Label() string { + rv := objc.Call[string](n_, objc.Sel("label")) + return rv +} diff --git a/macos/mps/nn_division_node.gen.go b/macos/mps/nn_division_node.gen.go new file mode 100644 index 00000000..42fb1aa3 --- /dev/null +++ b/macos/mps/nn_division_node.gen.go @@ -0,0 +1,110 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNDivisionNode] class. +var NNDivisionNodeClass = _NNDivisionNodeClass{objc.GetClass("MPSNNDivisionNode")} + +type _NNDivisionNodeClass struct { + objc.Class +} + +// An interface definition for the [NNDivisionNode] class. +type INNDivisionNode interface { + INNBinaryArithmeticNode +} + +// A representation of a division operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnndivisionnode?language=objc +type NNDivisionNode struct { + NNBinaryArithmeticNode +} + +func NNDivisionNodeFrom(ptr unsafe.Pointer) NNDivisionNode { + return NNDivisionNode{ + NNBinaryArithmeticNode: NNBinaryArithmeticNodeFrom(ptr), + } +} + +func (nc _NNDivisionNodeClass) Alloc() NNDivisionNode { + rv := objc.Call[NNDivisionNode](nc, objc.Sel("alloc")) + return rv +} + +func NNDivisionNode_Alloc() NNDivisionNode { + return NNDivisionNodeClass.Alloc() +} + +func (nc _NNDivisionNodeClass) New() NNDivisionNode { + rv := objc.Call[NNDivisionNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNDivisionNode() NNDivisionNode { + return NNDivisionNodeClass.New() +} + +func (n_ NNDivisionNode) Init() NNDivisionNode { + rv := objc.Call[NNDivisionNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNDivisionNodeClass) NodeWithSources(sourceNodes []INNImageNode) NNDivisionNode { + rv := objc.Call[NNDivisionNode](nc, objc.Sel("nodeWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890829-nodewithsources?language=objc +func NNDivisionNode_NodeWithSources(sourceNodes []INNImageNode) NNDivisionNode { + return NNDivisionNodeClass.NodeWithSources(sourceNodes) +} + +func (nc _NNDivisionNodeClass) NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNDivisionNode { + rv := objc.Call[NNDivisionNode](nc, objc.Sel("nodeWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890830-nodewithleftsource?language=objc +func NNDivisionNode_NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNDivisionNode { + return NNDivisionNodeClass.NodeWithLeftSourceRightSource(left, right) +} + +func (n_ NNDivisionNode) InitWithSources(sourceNodes []INNImageNode) NNDivisionNode { + rv := objc.Call[NNDivisionNode](n_, objc.Sel("initWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890820-initwithsources?language=objc +func NewNNDivisionNodeWithSources(sourceNodes []INNImageNode) NNDivisionNode { + instance := NNDivisionNodeClass.Alloc().InitWithSources(sourceNodes) + instance.Autorelease() + return instance +} + +func (n_ NNDivisionNode) InitWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNDivisionNode { + rv := objc.Call[NNDivisionNode](n_, objc.Sel("initWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890825-initwithleftsource?language=objc +func NewNNDivisionNodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNDivisionNode { + instance := NNDivisionNodeClass.Alloc().InitWithLeftSourceRightSource(left, right) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_filter_node.gen.go b/macos/mps/nn_filter_node.gen.go new file mode 100644 index 00000000..1e8aee28 --- /dev/null +++ b/macos/mps/nn_filter_node.gen.go @@ -0,0 +1,173 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNFilterNode] class. +var NNFilterNodeClass = _NNFilterNodeClass{objc.GetClass("MPSNNFilterNode")} + +type _NNFilterNodeClass struct { + objc.Class +} + +// An interface definition for the [NNFilterNode] class. +type INNFilterNode interface { + objc.IObject + GradientFiltersWithSources(gradientImages []INNImageNode) []NNGradientFilterNode + GradientFiltersWithSource(gradientImage INNImageNode) []NNGradientFilterNode + GradientFilterWithSource(gradientImage INNImageNode) NNGradientFilterNode + TrainingGraphWithSourceGradientNodeHandler(gradientImage INNImageNode, nodeHandler GradientNodeBlock) []NNFilterNode + GradientFilterWithSources(gradientImages []INNImageNode) NNGradientFilterNode + ResultState() NNStateNode + ResultImage() NNImageNode + ResultStates() []NNStateNode + PaddingPolicy() NNPaddingWrapper + SetPaddingPolicy(value PNNPadding) + SetPaddingPolicyObject(valueObject objc.IObject) + Label() string + SetLabel(value string) +} + +// A placeholder node denoting a neural network filter stage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode?language=objc +type NNFilterNode struct { + objc.Object +} + +func NNFilterNodeFrom(ptr unsafe.Pointer) NNFilterNode { + return NNFilterNode{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NNFilterNodeClass) Alloc() NNFilterNode { + rv := objc.Call[NNFilterNode](nc, objc.Sel("alloc")) + return rv +} + +func NNFilterNode_Alloc() NNFilterNode { + return NNFilterNodeClass.Alloc() +} + +func (nc _NNFilterNodeClass) New() NNFilterNode { + rv := objc.Call[NNFilterNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNFilterNode() NNFilterNode { + return NNFilterNodeClass.New() +} + +func (n_ NNFilterNode) Init() NNFilterNode { + rv := objc.Call[NNFilterNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2951955-gradientfilterswithsources?language=objc +func (n_ NNFilterNode) GradientFiltersWithSources(gradientImages []INNImageNode) []NNGradientFilterNode { + rv := objc.Call[[]NNGradientFilterNode](n_, objc.Sel("gradientFiltersWithSources:"), gradientImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2953944-gradientfilterswithsource?language=objc +func (n_ NNFilterNode) GradientFiltersWithSource(gradientImage INNImageNode) []NNGradientFilterNode { + rv := objc.Call[[]NNGradientFilterNode](n_, objc.Sel("gradientFiltersWithSource:"), objc.Ptr(gradientImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2953941-gradientfilterwithsource?language=objc +func (n_ NNFilterNode) GradientFilterWithSource(gradientImage INNImageNode) NNGradientFilterNode { + rv := objc.Call[NNGradientFilterNode](n_, objc.Sel("gradientFilterWithSource:"), objc.Ptr(gradientImage)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/3020688-traininggraphwithsourcegradient?language=objc +func (n_ NNFilterNode) TrainingGraphWithSourceGradientNodeHandler(gradientImage INNImageNode, nodeHandler GradientNodeBlock) []NNFilterNode { + rv := objc.Call[[]NNFilterNode](n_, objc.Sel("trainingGraphWithSourceGradient:nodeHandler:"), objc.Ptr(gradientImage), nodeHandler) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2948052-gradientfilterwithsources?language=objc +func (n_ NNFilterNode) GradientFilterWithSources(gradientImages []INNImageNode) NNGradientFilterNode { + rv := objc.Call[NNGradientFilterNode](n_, objc.Sel("gradientFilterWithSources:"), gradientImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866503-resultstate?language=objc +func (n_ NNFilterNode) ResultState() NNStateNode { + rv := objc.Call[NNStateNode](n_, objc.Sel("resultState")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866492-resultimage?language=objc +func (n_ NNFilterNode) ResultImage() NNImageNode { + rv := objc.Call[NNImageNode](n_, objc.Sel("resultImage")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866486-resultstates?language=objc +func (n_ NNFilterNode) ResultStates() []NNStateNode { + rv := objc.Call[[]NNStateNode](n_, objc.Sel("resultStates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866496-paddingpolicy?language=objc +func (n_ NNFilterNode) PaddingPolicy() NNPaddingWrapper { + rv := objc.Call[NNPaddingWrapper](n_, objc.Sel("paddingPolicy")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866496-paddingpolicy?language=objc +func (n_ NNFilterNode) SetPaddingPolicy(value PNNPadding) { + po0 := objc.WrapAsProtocol("MPSNNPadding", value) + objc.Call[objc.Void](n_, objc.Sel("setPaddingPolicy:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866496-paddingpolicy?language=objc +func (n_ NNFilterNode) SetPaddingPolicyObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setPaddingPolicy:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866465-label?language=objc +func (n_ NNFilterNode) Label() string { + rv := objc.Call[string](n_, objc.Sel("label")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnfilternode/2866465-label?language=objc +func (n_ NNFilterNode) SetLabel(value string) { + objc.Call[objc.Void](n_, objc.Sel("setLabel:"), value) +} diff --git a/macos/mps/nn_forward_loss.gen.go b/macos/mps/nn_forward_loss.gen.go new file mode 100644 index 00000000..7aed7fda --- /dev/null +++ b/macos/mps/nn_forward_loss.gen.go @@ -0,0 +1,229 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNForwardLoss] class. +var NNForwardLossClass = _NNForwardLossClass{objc.GetClass("MPSNNForwardLoss")} + +type _NNForwardLossClass struct { + objc.Class +} + +// An interface definition for the [NNForwardLoss] class. +type INNForwardLoss interface { + ICNNKernel + EncodeBatchToCommandBufferSourceImagesLabelsWeightsDestinationStatesDestinationStateIsTemporary(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, outStates *foundation.Array, isTemporary bool) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImagesLabelsWeightsDestinationStatesDestinationStateIsTemporary(commandBufferObject objc.IObject, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, outStates *foundation.Array, isTemporary bool) *foundation.Array + NumberOfClasses() uint + Weight() float64 + SetWeight(value float64) + Epsilon() float64 + SetEpsilon(value float64) + Delta() float64 + SetDelta(value float64) + ReductionType() CNNReductionType + ReduceAcrossBatch() bool + LossType() CNNLossType + LabelSmoothing() float64 + SetLabelSmoothing(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss?language=objc +type NNForwardLoss struct { + CNNKernel +} + +func NNForwardLossFrom(ptr unsafe.Pointer) NNForwardLoss { + return NNForwardLoss{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNForwardLoss) InitWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNLossDescriptor) NNForwardLoss { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNForwardLoss](n_, objc.Sel("initWithDevice:lossDescriptor:"), po0, objc.Ptr(lossDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131802-initwithdevice?language=objc +func NewNNForwardLossWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNLossDescriptor) NNForwardLoss { + instance := NNForwardLossClass.Alloc().InitWithDeviceLossDescriptor(device, lossDescriptor) + instance.Autorelease() + return instance +} + +func (nc _NNForwardLossClass) Alloc() NNForwardLoss { + rv := objc.Call[NNForwardLoss](nc, objc.Sel("alloc")) + return rv +} + +func NNForwardLoss_Alloc() NNForwardLoss { + return NNForwardLossClass.Alloc() +} + +func (nc _NNForwardLossClass) New() NNForwardLoss { + rv := objc.Call[NNForwardLoss](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNForwardLoss() NNForwardLoss { + return NNForwardLossClass.New() +} + +func (n_ NNForwardLoss) Init() NNForwardLoss { + rv := objc.Call[NNForwardLoss](n_, objc.Sel("init")) + return rv +} + +func (n_ NNForwardLoss) InitWithDevice(device metal.PDevice) NNForwardLoss { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNForwardLoss](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewNNForwardLossWithDevice(device metal.PDevice) NNForwardLoss { + instance := NNForwardLossClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNForwardLoss) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNForwardLoss { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNForwardLoss](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNForwardLoss_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNForwardLoss { + instance := NNForwardLossClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131799-encodebatchtocommandbuffer?language=objc +func (n_ NNForwardLoss) EncodeBatchToCommandBufferSourceImagesLabelsWeightsDestinationStatesDestinationStateIsTemporary(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, outStates *foundation.Array, isTemporary bool) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](n_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:labels:weights:destinationStates:destinationStateIsTemporary:"), po0, sourceImages, labels, weights, outStates, isTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131799-encodebatchtocommandbuffer?language=objc +func (n_ NNForwardLoss) EncodeBatchToCommandBufferObjectSourceImagesLabelsWeightsDestinationStatesDestinationStateIsTemporary(commandBufferObject objc.IObject, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, outStates *foundation.Array, isTemporary bool) *foundation.Array { + rv := objc.Call[*foundation.Array](n_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:labels:weights:destinationStates:destinationStateIsTemporary:"), objc.Ptr(commandBufferObject), sourceImages, labels, weights, outStates, isTemporary) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131805-numberofclasses?language=objc +func (n_ NNForwardLoss) NumberOfClasses() uint { + rv := objc.Call[uint](n_, objc.Sel("numberOfClasses")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131807-weight?language=objc +func (n_ NNForwardLoss) Weight() float64 { + rv := objc.Call[float64](n_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131807-weight?language=objc +func (n_ NNForwardLoss) SetWeight(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setWeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131800-epsilon?language=objc +func (n_ NNForwardLoss) Epsilon() float64 { + rv := objc.Call[float64](n_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131800-epsilon?language=objc +func (n_ NNForwardLoss) SetEpsilon(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setEpsilon:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131797-delta?language=objc +func (n_ NNForwardLoss) Delta() float64 { + rv := objc.Call[float64](n_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131797-delta?language=objc +func (n_ NNForwardLoss) SetDelta(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131806-reductiontype?language=objc +func (n_ NNForwardLoss) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](n_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3547985-reduceacrossbatch?language=objc +func (n_ NNForwardLoss) ReduceAcrossBatch() bool { + rv := objc.Call[bool](n_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131804-losstype?language=objc +func (n_ NNForwardLoss) LossType() CNNLossType { + rv := objc.Call[CNNLossType](n_, objc.Sel("lossType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131803-labelsmoothing?language=objc +func (n_ NNForwardLoss) LabelSmoothing() float64 { + rv := objc.Call[float64](n_, objc.Sel("labelSmoothing")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardloss/3131803-labelsmoothing?language=objc +func (n_ NNForwardLoss) SetLabelSmoothing(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setLabelSmoothing:"), value) +} diff --git a/macos/mps/nn_forward_loss_node.gen.go b/macos/mps/nn_forward_loss_node.gen.go new file mode 100644 index 00000000..df743be8 --- /dev/null +++ b/macos/mps/nn_forward_loss_node.gen.go @@ -0,0 +1,208 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNForwardLossNode] class. +var NNForwardLossNodeClass = _NNForwardLossNodeClass{objc.GetClass("MPSNNForwardLossNode")} + +type _NNForwardLossNodeClass struct { + objc.Class +} + +// An interface definition for the [NNForwardLossNode] class. +type INNForwardLossNode interface { + INNFilterNode + NumberOfClasses() uint + Weight() float64 + PropertyCallBack() NNLossCallbackWrapper + SetPropertyCallBack(value PNNLossCallback) + SetPropertyCallBackObject(valueObject objc.IObject) + Epsilon() float64 + Delta() float64 + ReductionType() CNNReductionType + ReduceAcrossBatch() bool + LossType() CNNLossType + LabelSmoothing() float64 +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode?language=objc +type NNForwardLossNode struct { + NNFilterNode +} + +func NNForwardLossNodeFrom(ptr unsafe.Pointer) NNForwardLossNode { + return NNForwardLossNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNForwardLossNodeClass) NodeWithSourcesLossDescriptor(sourceNodes []INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + rv := objc.Call[NNForwardLossNode](nc, objc.Sel("nodeWithSources:lossDescriptor:"), sourceNodes, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131839-nodewithsources?language=objc +func NNForwardLossNode_NodeWithSourcesLossDescriptor(sourceNodes []INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + return NNForwardLossNodeClass.NodeWithSourcesLossDescriptor(sourceNodes, descriptor) +} + +func (nc _NNForwardLossNodeClass) NodeWithSourceLabelsLossDescriptor(source INNImageNode, labels INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + rv := objc.Call[NNForwardLossNode](nc, objc.Sel("nodeWithSource:labels:lossDescriptor:"), objc.Ptr(source), objc.Ptr(labels), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131837-nodewithsource?language=objc +func NNForwardLossNode_NodeWithSourceLabelsLossDescriptor(source INNImageNode, labels INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + return NNForwardLossNodeClass.NodeWithSourceLabelsLossDescriptor(source, labels, descriptor) +} + +func (n_ NNForwardLossNode) InitWithSourcesLossDescriptor(sourceNodes []INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + rv := objc.Call[NNForwardLossNode](n_, objc.Sel("initWithSources:lossDescriptor:"), sourceNodes, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131834-initwithsources?language=objc +func NewNNForwardLossNodeWithSourcesLossDescriptor(sourceNodes []INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + instance := NNForwardLossNodeClass.Alloc().InitWithSourcesLossDescriptor(sourceNodes, descriptor) + instance.Autorelease() + return instance +} + +func (n_ NNForwardLossNode) InitWithSourceLabelsLossDescriptor(source INNImageNode, labels INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + rv := objc.Call[NNForwardLossNode](n_, objc.Sel("initWithSource:labels:lossDescriptor:"), objc.Ptr(source), objc.Ptr(labels), objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131832-initwithsource?language=objc +func NewNNForwardLossNodeWithSourceLabelsLossDescriptor(source INNImageNode, labels INNImageNode, descriptor ICNNLossDescriptor) NNForwardLossNode { + instance := NNForwardLossNodeClass.Alloc().InitWithSourceLabelsLossDescriptor(source, labels, descriptor) + instance.Autorelease() + return instance +} + +func (nc _NNForwardLossNodeClass) Alloc() NNForwardLossNode { + rv := objc.Call[NNForwardLossNode](nc, objc.Sel("alloc")) + return rv +} + +func NNForwardLossNode_Alloc() NNForwardLossNode { + return NNForwardLossNodeClass.Alloc() +} + +func (nc _NNForwardLossNodeClass) New() NNForwardLossNode { + rv := objc.Call[NNForwardLossNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNForwardLossNode() NNForwardLossNode { + return NNForwardLossNodeClass.New() +} + +func (n_ NNForwardLossNode) Init() NNForwardLossNode { + rv := objc.Call[NNForwardLossNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131840-numberofclasses?language=objc +func (n_ NNForwardLossNode) NumberOfClasses() uint { + rv := objc.Call[uint](n_, objc.Sel("numberOfClasses")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131843-weight?language=objc +func (n_ NNForwardLossNode) Weight() float64 { + rv := objc.Call[float64](n_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131841-propertycallback?language=objc +func (n_ NNForwardLossNode) PropertyCallBack() NNLossCallbackWrapper { + rv := objc.Call[NNLossCallbackWrapper](n_, objc.Sel("propertyCallBack")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131841-propertycallback?language=objc +func (n_ NNForwardLossNode) SetPropertyCallBack(value PNNLossCallback) { + po0 := objc.WrapAsProtocol("MPSNNLossCallback", value) + objc.Call[objc.Void](n_, objc.Sel("setPropertyCallBack:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131841-propertycallback?language=objc +func (n_ NNForwardLossNode) SetPropertyCallBackObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setPropertyCallBack:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131827-epsilon?language=objc +func (n_ NNForwardLossNode) Epsilon() float64 { + rv := objc.Call[float64](n_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131826-delta?language=objc +func (n_ NNForwardLossNode) Delta() float64 { + rv := objc.Call[float64](n_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131842-reductiontype?language=objc +func (n_ NNForwardLossNode) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](n_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3547987-reduceacrossbatch?language=objc +func (n_ NNForwardLossNode) ReduceAcrossBatch() bool { + rv := objc.Call[bool](n_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131836-losstype?language=objc +func (n_ NNForwardLossNode) LossType() CNNLossType { + rv := objc.Call[CNNLossType](n_, objc.Sel("lossType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnforwardlossnode/3131835-labelsmoothing?language=objc +func (n_ NNForwardLossNode) LabelSmoothing() float64 { + rv := objc.Call[float64](n_, objc.Sel("labelSmoothing")) + return rv +} diff --git a/macos/mps/nn_gradient_filter_node.gen.go b/macos/mps/nn_gradient_filter_node.gen.go new file mode 100644 index 00000000..55257b1f --- /dev/null +++ b/macos/mps/nn_gradient_filter_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGradientFilterNode] class. +var NNGradientFilterNodeClass = _NNGradientFilterNodeClass{objc.GetClass("MPSNNGradientFilterNode")} + +type _NNGradientFilterNodeClass struct { + objc.Class +} + +// An interface definition for the [NNGradientFilterNode] class. +type INNGradientFilterNode interface { + INNFilterNode +} + +// A representation of a gradient filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngradientfilternode?language=objc +type NNGradientFilterNode struct { + NNFilterNode +} + +func NNGradientFilterNodeFrom(ptr unsafe.Pointer) NNGradientFilterNode { + return NNGradientFilterNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNGradientFilterNodeClass) Alloc() NNGradientFilterNode { + rv := objc.Call[NNGradientFilterNode](nc, objc.Sel("alloc")) + return rv +} + +func NNGradientFilterNode_Alloc() NNGradientFilterNode { + return NNGradientFilterNodeClass.Alloc() +} + +func (nc _NNGradientFilterNodeClass) New() NNGradientFilterNode { + rv := objc.Call[NNGradientFilterNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGradientFilterNode() NNGradientFilterNode { + return NNGradientFilterNodeClass.New() +} + +func (n_ NNGradientFilterNode) Init() NNGradientFilterNode { + rv := objc.Call[NNGradientFilterNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_gradient_state.gen.go b/macos/mps/nn_gradient_state.gen.go new file mode 100644 index 00000000..9ae0602f --- /dev/null +++ b/macos/mps/nn_gradient_state.gen.go @@ -0,0 +1,116 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGradientState] class. +var NNGradientStateClass = _NNGradientStateClass{objc.GetClass("MPSNNGradientState")} + +type _NNGradientStateClass struct { + objc.Class +} + +// An interface definition for the [NNGradientState] class. +type INNGradientState interface { + IState +} + +// A class representing the state of a gradient kernel when it was encoded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngradientstate?language=objc +type NNGradientState struct { + State +} + +func NNGradientStateFrom(ptr unsafe.Pointer) NNGradientState { + return NNGradientState{ + State: StateFrom(ptr), + } +} + +func (nc _NNGradientStateClass) Alloc() NNGradientState { + rv := objc.Call[NNGradientState](nc, objc.Sel("alloc")) + return rv +} + +func NNGradientState_Alloc() NNGradientState { + return NNGradientStateClass.Alloc() +} + +func (nc _NNGradientStateClass) New() NNGradientState { + rv := objc.Call[NNGradientState](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGradientState() NNGradientState { + return NNGradientStateClass.New() +} + +func (n_ NNGradientState) Init() NNGradientState { + rv := objc.Call[NNGradientState](n_, objc.Sel("init")) + return rv +} + +func (n_ NNGradientState) InitWithResources(resources []metal.PResource) NNGradientState { + rv := objc.Call[NNGradientState](n_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewNNGradientStateWithResources(resources []metal.PResource) NNGradientState { + instance := NNGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (n_ NNGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NNGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGradientState](n_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewNNGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NNGradientState { + instance := NNGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (n_ NNGradientState) InitWithResource(resource metal.PResource) NNGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[NNGradientState](n_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewNNGradientStateWithResource(resource metal.PResource) NNGradientState { + instance := NNGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (nc _NNGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NNGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[NNGradientState](nc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func NNGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NNGradientState { + return NNGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} diff --git a/macos/mps/nn_gradient_state_node.gen.go b/macos/mps/nn_gradient_state_node.gen.go new file mode 100644 index 00000000..563a4ef8 --- /dev/null +++ b/macos/mps/nn_gradient_state_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGradientStateNode] class. +var NNGradientStateNodeClass = _NNGradientStateNodeClass{objc.GetClass("MPSNNGradientStateNode")} + +type _NNGradientStateNodeClass struct { + objc.Class +} + +// An interface definition for the [NNGradientStateNode] class. +type INNGradientStateNode interface { + INNStateNode +} + +// A representation of the state created to record the properties of a gradient kernel at the time it was encoded. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngradientstatenode?language=objc +type NNGradientStateNode struct { + NNStateNode +} + +func NNGradientStateNodeFrom(ptr unsafe.Pointer) NNGradientStateNode { + return NNGradientStateNode{ + NNStateNode: NNStateNodeFrom(ptr), + } +} + +func (nc _NNGradientStateNodeClass) Alloc() NNGradientStateNode { + rv := objc.Call[NNGradientStateNode](nc, objc.Sel("alloc")) + return rv +} + +func NNGradientStateNode_Alloc() NNGradientStateNode { + return NNGradientStateNodeClass.Alloc() +} + +func (nc _NNGradientStateNodeClass) New() NNGradientStateNode { + rv := objc.Call[NNGradientStateNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGradientStateNode() NNGradientStateNode { + return NNGradientStateNodeClass.New() +} + +func (n_ NNGradientStateNode) Init() NNGradientStateNode { + rv := objc.Call[NNGradientStateNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_gram_matrix_calculation.gen.go b/macos/mps/nn_gram_matrix_calculation.gen.go new file mode 100644 index 00000000..e21e86e8 --- /dev/null +++ b/macos/mps/nn_gram_matrix_calculation.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGramMatrixCalculation] class. +var NNGramMatrixCalculationClass = _NNGramMatrixCalculationClass{objc.GetClass("MPSNNGramMatrixCalculation")} + +type _NNGramMatrixCalculationClass struct { + objc.Class +} + +// An interface definition for the [NNGramMatrixCalculation] class. +type INNGramMatrixCalculation interface { + ICNNKernel + Alpha() float64 + SetAlpha(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculation?language=objc +type NNGramMatrixCalculation struct { + CNNKernel +} + +func NNGramMatrixCalculationFrom(ptr unsafe.Pointer) NNGramMatrixCalculation { + return NNGramMatrixCalculation{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNGramMatrixCalculation) InitWithDevice(device metal.PDevice) NNGramMatrixCalculation { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGramMatrixCalculation](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculation/3114079-initwithdevice?language=objc +func NewNNGramMatrixCalculationWithDevice(device metal.PDevice) NNGramMatrixCalculation { + instance := NNGramMatrixCalculationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNGramMatrixCalculationClass) Alloc() NNGramMatrixCalculation { + rv := objc.Call[NNGramMatrixCalculation](nc, objc.Sel("alloc")) + return rv +} + +func NNGramMatrixCalculation_Alloc() NNGramMatrixCalculation { + return NNGramMatrixCalculationClass.Alloc() +} + +func (nc _NNGramMatrixCalculationClass) New() NNGramMatrixCalculation { + rv := objc.Call[NNGramMatrixCalculation](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGramMatrixCalculation() NNGramMatrixCalculation { + return NNGramMatrixCalculationClass.New() +} + +func (n_ NNGramMatrixCalculation) Init() NNGramMatrixCalculation { + rv := objc.Call[NNGramMatrixCalculation](n_, objc.Sel("init")) + return rv +} + +func (n_ NNGramMatrixCalculation) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGramMatrixCalculation { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGramMatrixCalculation](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNGramMatrixCalculation_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGramMatrixCalculation { + instance := NNGramMatrixCalculationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculation/3114077-alpha?language=objc +func (n_ NNGramMatrixCalculation) Alpha() float64 { + rv := objc.Call[float64](n_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculation/3114077-alpha?language=objc +func (n_ NNGramMatrixCalculation) SetAlpha(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/nn_gram_matrix_calculation_gradient.gen.go b/macos/mps/nn_gram_matrix_calculation_gradient.gen.go new file mode 100644 index 00000000..0cba608b --- /dev/null +++ b/macos/mps/nn_gram_matrix_calculation_gradient.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGramMatrixCalculationGradient] class. +var NNGramMatrixCalculationGradientClass = _NNGramMatrixCalculationGradientClass{objc.GetClass("MPSNNGramMatrixCalculationGradient")} + +type _NNGramMatrixCalculationGradientClass struct { + objc.Class +} + +// An interface definition for the [NNGramMatrixCalculationGradient] class. +type INNGramMatrixCalculationGradient interface { + ICNNGradientKernel + Alpha() float64 + SetAlpha(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradient?language=objc +type NNGramMatrixCalculationGradient struct { + CNNGradientKernel +} + +func NNGramMatrixCalculationGradientFrom(ptr unsafe.Pointer) NNGramMatrixCalculationGradient { + return NNGramMatrixCalculationGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (n_ NNGramMatrixCalculationGradient) InitWithDevice(device metal.PDevice) NNGramMatrixCalculationGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGramMatrixCalculationGradient](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradient/3114084-initwithdevice?language=objc +func NewNNGramMatrixCalculationGradientWithDevice(device metal.PDevice) NNGramMatrixCalculationGradient { + instance := NNGramMatrixCalculationGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNGramMatrixCalculationGradientClass) Alloc() NNGramMatrixCalculationGradient { + rv := objc.Call[NNGramMatrixCalculationGradient](nc, objc.Sel("alloc")) + return rv +} + +func NNGramMatrixCalculationGradient_Alloc() NNGramMatrixCalculationGradient { + return NNGramMatrixCalculationGradientClass.Alloc() +} + +func (nc _NNGramMatrixCalculationGradientClass) New() NNGramMatrixCalculationGradient { + rv := objc.Call[NNGramMatrixCalculationGradient](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGramMatrixCalculationGradient() NNGramMatrixCalculationGradient { + return NNGramMatrixCalculationGradientClass.New() +} + +func (n_ NNGramMatrixCalculationGradient) Init() NNGramMatrixCalculationGradient { + rv := objc.Call[NNGramMatrixCalculationGradient](n_, objc.Sel("init")) + return rv +} + +func (n_ NNGramMatrixCalculationGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGramMatrixCalculationGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGramMatrixCalculationGradient](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNGramMatrixCalculationGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGramMatrixCalculationGradient { + instance := NNGramMatrixCalculationGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradient/3114082-alpha?language=objc +func (n_ NNGramMatrixCalculationGradient) Alpha() float64 { + rv := objc.Call[float64](n_, objc.Sel("alpha")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradient/3114082-alpha?language=objc +func (n_ NNGramMatrixCalculationGradient) SetAlpha(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setAlpha:"), value) +} diff --git a/macos/mps/nn_gram_matrix_calculation_gradient_node.gen.go b/macos/mps/nn_gram_matrix_calculation_gradient_node.gen.go new file mode 100644 index 00000000..f59a639c --- /dev/null +++ b/macos/mps/nn_gram_matrix_calculation_gradient_node.gen.go @@ -0,0 +1,93 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGramMatrixCalculationGradientNode] class. +var NNGramMatrixCalculationGradientNodeClass = _NNGramMatrixCalculationGradientNodeClass{objc.GetClass("MPSNNGramMatrixCalculationGradientNode")} + +type _NNGramMatrixCalculationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNGramMatrixCalculationGradientNode] class. +type INNGramMatrixCalculationGradientNode interface { + INNGradientFilterNode + Alpha() float64 +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradientnode?language=objc +type NNGramMatrixCalculationGradientNode struct { + NNGradientFilterNode +} + +func NNGramMatrixCalculationGradientNodeFrom(ptr unsafe.Pointer) NNGramMatrixCalculationGradientNode { + return NNGramMatrixCalculationGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (n_ NNGramMatrixCalculationGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNGramMatrixCalculationGradientNode { + rv := objc.Call[NNGramMatrixCalculationGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradientnode/3114089-initwithsourcegradient?language=objc +func NewNNGramMatrixCalculationGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNGramMatrixCalculationGradientNode { + instance := NNGramMatrixCalculationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (nc _NNGramMatrixCalculationGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNGramMatrixCalculationGradientNode { + rv := objc.Call[NNGramMatrixCalculationGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradientnode/3114091-nodewithsourcegradient?language=objc +func NNGramMatrixCalculationGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNGramMatrixCalculationGradientNode { + return NNGramMatrixCalculationGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (nc _NNGramMatrixCalculationGradientNodeClass) Alloc() NNGramMatrixCalculationGradientNode { + rv := objc.Call[NNGramMatrixCalculationGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNGramMatrixCalculationGradientNode_Alloc() NNGramMatrixCalculationGradientNode { + return NNGramMatrixCalculationGradientNodeClass.Alloc() +} + +func (nc _NNGramMatrixCalculationGradientNodeClass) New() NNGramMatrixCalculationGradientNode { + rv := objc.Call[NNGramMatrixCalculationGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGramMatrixCalculationGradientNode() NNGramMatrixCalculationGradientNode { + return NNGramMatrixCalculationGradientNodeClass.New() +} + +func (n_ NNGramMatrixCalculationGradientNode) Init() NNGramMatrixCalculationGradientNode { + rv := objc.Call[NNGramMatrixCalculationGradientNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationgradientnode/3114088-alpha?language=objc +func (n_ NNGramMatrixCalculationGradientNode) Alpha() float64 { + rv := objc.Call[float64](n_, objc.Sel("alpha")) + return rv +} diff --git a/macos/mps/nn_gram_matrix_calculation_node.gen.go b/macos/mps/nn_gram_matrix_calculation_node.gen.go new file mode 100644 index 00000000..a5a493f4 --- /dev/null +++ b/macos/mps/nn_gram_matrix_calculation_node.gen.go @@ -0,0 +1,119 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGramMatrixCalculationNode] class. +var NNGramMatrixCalculationNodeClass = _NNGramMatrixCalculationNodeClass{objc.GetClass("MPSNNGramMatrixCalculationNode")} + +type _NNGramMatrixCalculationNodeClass struct { + objc.Class +} + +// An interface definition for the [NNGramMatrixCalculationNode] class. +type INNGramMatrixCalculationNode interface { + INNFilterNode + PropertyCallBack() NNGramMatrixCallbackWrapper + SetPropertyCallBack(value PNNGramMatrixCallback) + SetPropertyCallBackObject(valueObject objc.IObject) + Alpha() float64 +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationnode?language=objc +type NNGramMatrixCalculationNode struct { + NNFilterNode +} + +func NNGramMatrixCalculationNodeFrom(ptr unsafe.Pointer) NNGramMatrixCalculationNode { + return NNGramMatrixCalculationNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNGramMatrixCalculationNodeClass) NodeWithSource(sourceNode INNImageNode) NNGramMatrixCalculationNode { + rv := objc.Call[NNGramMatrixCalculationNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationnode/3114097-nodewithsource?language=objc +func NNGramMatrixCalculationNode_NodeWithSource(sourceNode INNImageNode) NNGramMatrixCalculationNode { + return NNGramMatrixCalculationNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNGramMatrixCalculationNode) InitWithSource(sourceNode INNImageNode) NNGramMatrixCalculationNode { + rv := objc.Call[NNGramMatrixCalculationNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationnode/3114095-initwithsource?language=objc +func NewNNGramMatrixCalculationNodeWithSource(sourceNode INNImageNode) NNGramMatrixCalculationNode { + instance := NNGramMatrixCalculationNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (nc _NNGramMatrixCalculationNodeClass) Alloc() NNGramMatrixCalculationNode { + rv := objc.Call[NNGramMatrixCalculationNode](nc, objc.Sel("alloc")) + return rv +} + +func NNGramMatrixCalculationNode_Alloc() NNGramMatrixCalculationNode { + return NNGramMatrixCalculationNodeClass.Alloc() +} + +func (nc _NNGramMatrixCalculationNodeClass) New() NNGramMatrixCalculationNode { + rv := objc.Call[NNGramMatrixCalculationNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGramMatrixCalculationNode() NNGramMatrixCalculationNode { + return NNGramMatrixCalculationNodeClass.New() +} + +func (n_ NNGramMatrixCalculationNode) Init() NNGramMatrixCalculationNode { + rv := objc.Call[NNGramMatrixCalculationNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationnode/3131844-propertycallback?language=objc +func (n_ NNGramMatrixCalculationNode) PropertyCallBack() NNGramMatrixCallbackWrapper { + rv := objc.Call[NNGramMatrixCallbackWrapper](n_, objc.Sel("propertyCallBack")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationnode/3131844-propertycallback?language=objc +func (n_ NNGramMatrixCalculationNode) SetPropertyCallBack(value PNNGramMatrixCallback) { + po0 := objc.WrapAsProtocol("MPSNNGramMatrixCallback", value) + objc.Call[objc.Void](n_, objc.Sel("setPropertyCallBack:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationnode/3131844-propertycallback?language=objc +func (n_ NNGramMatrixCalculationNode) SetPropertyCallBackObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setPropertyCallBack:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcalculationnode/3114094-alpha?language=objc +func (n_ NNGramMatrixCalculationNode) Alpha() float64 { + rv := objc.Call[float64](n_, objc.Sel("alpha")) + return rv +} diff --git a/macos/mps/nn_gram_matrix_callback.gen.go b/macos/mps/nn_gram_matrix_callback.gen.go new file mode 100644 index 00000000..e91fe717 --- /dev/null +++ b/macos/mps/nn_gram_matrix_callback.gen.go @@ -0,0 +1,33 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcallback?language=objc +type PNNGramMatrixCallback interface { + // optional + AlphaForSourceImageDestinationImage(sourceImage Image, destinationImage Image) float64 + HasAlphaForSourceImageDestinationImage() bool +} + +// A concrete type wrapper for the [PNNGramMatrixCallback] protocol. +type NNGramMatrixCallbackWrapper struct { + objc.Object +} + +func (n_ NNGramMatrixCallbackWrapper) HasAlphaForSourceImageDestinationImage() bool { + return n_.RespondsToSelector(objc.Sel("alphaForSourceImage:destinationImage:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngrammatrixcallback/3131846-alphaforsourceimage?language=objc +func (n_ NNGramMatrixCallbackWrapper) AlphaForSourceImageDestinationImage(sourceImage IImage, destinationImage IImage) float64 { + rv := objc.Call[float64](n_, objc.Sel("alphaForSourceImage:destinationImage:"), objc.Ptr(sourceImage), objc.Ptr(destinationImage)) + return rv +} diff --git a/macos/mps/nn_graph.gen.go b/macos/mps/nn_graph.gen.go new file mode 100644 index 00000000..5ae9823a --- /dev/null +++ b/macos/mps/nn_graph.gen.go @@ -0,0 +1,278 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGraph] class. +var NNGraphClass = _NNGraphClass{objc.GetClass("MPSNNGraph")} + +type _NNGraphClass struct { + objc.Class +} + +// An interface definition for the [NNGraph] class. +type INNGraph interface { + IKernel + EncodeBatchToCommandBufferSourceImagesSourceStates(commandBuffer metal.PCommandBuffer, sourceImages []*foundation.Array, sourceStates []*foundation.Array) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImagesSourceStates(commandBufferObject objc.IObject, sourceImages []*foundation.Array, sourceStates []*foundation.Array) *foundation.Array + ReadCountForSourceStateAtIndex(index uint) uint + ReadCountForSourceImageAtIndex(index uint) uint + ExecuteAsyncWithSourceImagesCompletionHandler(sourceImages []IImage, handler NNGraphCompletionHandler) Image + EncodeToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImages []IImage) Image + EncodeToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImages []IImage) Image + ReloadFromDataSources() + IntermediateImageHandles() []HandleWrapper + SourceStateHandles() []HandleWrapper + ResultStateHandles() []HandleWrapper + SourceImageHandles() []HandleWrapper + ResultHandle() HandleWrapper + DestinationImageAllocator() ImageAllocatorWrapper + SetDestinationImageAllocator(value PImageAllocator) + SetDestinationImageAllocatorObject(valueObject objc.IObject) + ResultImageIsNeeded() bool + Format() ImageFeatureChannelFormat + SetFormat(value ImageFeatureChannelFormat) + OutputStateIsTemporary() bool + SetOutputStateIsTemporary(value bool) +} + +// An optimized representation of a graph of neural network image and filter nodes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph?language=objc +type NNGraph struct { + Kernel +} + +func NNGraphFrom(ptr unsafe.Pointer) NNGraph { + return NNGraph{ + Kernel: KernelFrom(ptr), + } +} + +func (nc _NNGraphClass) Alloc() NNGraph { + rv := objc.Call[NNGraph](nc, objc.Sel("alloc")) + return rv +} + +func NNGraph_Alloc() NNGraph { + return NNGraphClass.Alloc() +} + +func (nc _NNGraphClass) New() NNGraph { + rv := objc.Call[NNGraph](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGraph() NNGraph { + return NNGraphClass.New() +} + +func (n_ NNGraph) Init() NNGraph { + rv := objc.Call[NNGraph](n_, objc.Sel("init")) + return rv +} + +func (n_ NNGraph) InitWithDevice(device metal.PDevice) NNGraph { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGraph](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNNGraphWithDevice(device metal.PDevice) NNGraph { + instance := NNGraphClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNGraph) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGraph { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGraph](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNGraph_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGraph { + instance := NNGraphClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2953952-encodebatchtocommandbuffer?language=objc +func (n_ NNGraph) EncodeBatchToCommandBufferSourceImagesSourceStates(commandBuffer metal.PCommandBuffer, sourceImages []*foundation.Array, sourceStates []*foundation.Array) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](n_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:sourceStates:"), po0, sourceImages, sourceStates) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2953952-encodebatchtocommandbuffer?language=objc +func (n_ NNGraph) EncodeBatchToCommandBufferObjectSourceImagesSourceStates(commandBufferObject objc.IObject, sourceImages []*foundation.Array, sourceStates []*foundation.Array) *foundation.Array { + rv := objc.Call[*foundation.Array](n_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:sourceStates:"), objc.Ptr(commandBufferObject), sourceImages, sourceStates) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/3037387-readcountforsourcestateatindex?language=objc +func (n_ NNGraph) ReadCountForSourceStateAtIndex(index uint) uint { + rv := objc.Call[uint](n_, objc.Sel("readCountForSourceStateAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/3037386-readcountforsourceimageatindex?language=objc +func (n_ NNGraph) ReadCountForSourceImageAtIndex(index uint) uint { + rv := objc.Call[uint](n_, objc.Sel("readCountForSourceImageAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2890826-executeasyncwithsourceimages?language=objc +func (n_ NNGraph) ExecuteAsyncWithSourceImagesCompletionHandler(sourceImages []IImage, handler NNGraphCompletionHandler) Image { + rv := objc.Call[Image](n_, objc.Sel("executeAsyncWithSourceImages:completionHandler:"), sourceImages, handler) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867036-encodetocommandbuffer?language=objc +func (n_ NNGraph) EncodeToCommandBufferSourceImages(commandBuffer metal.PCommandBuffer, sourceImages []IImage) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](n_, objc.Sel("encodeToCommandBuffer:sourceImages:"), po0, sourceImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867036-encodetocommandbuffer?language=objc +func (n_ NNGraph) EncodeToCommandBufferObjectSourceImages(commandBufferObject objc.IObject, sourceImages []IImage) Image { + rv := objc.Call[Image](n_, objc.Sel("encodeToCommandBuffer:sourceImages:"), objc.Ptr(commandBufferObject), sourceImages) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2976512-reloadfromdatasources?language=objc +func (n_ NNGraph) ReloadFromDataSources() { + objc.Call[objc.Void](n_, objc.Sel("reloadFromDataSources")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867000-intermediateimagehandles?language=objc +func (n_ NNGraph) IntermediateImageHandles() []HandleWrapper { + rv := objc.Call[[]HandleWrapper](n_, objc.Sel("intermediateImageHandles")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867056-sourcestatehandles?language=objc +func (n_ NNGraph) SourceStateHandles() []HandleWrapper { + rv := objc.Call[[]HandleWrapper](n_, objc.Sel("sourceStateHandles")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867149-resultstatehandles?language=objc +func (n_ NNGraph) ResultStateHandles() []HandleWrapper { + rv := objc.Call[[]HandleWrapper](n_, objc.Sel("resultStateHandles")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867012-sourceimagehandles?language=objc +func (n_ NNGraph) SourceImageHandles() []HandleWrapper { + rv := objc.Call[[]HandleWrapper](n_, objc.Sel("sourceImageHandles")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867123-resulthandle?language=objc +func (n_ NNGraph) ResultHandle() HandleWrapper { + rv := objc.Call[HandleWrapper](n_, objc.Sel("resultHandle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2866998-destinationimageallocator?language=objc +func (n_ NNGraph) DestinationImageAllocator() ImageAllocatorWrapper { + rv := objc.Call[ImageAllocatorWrapper](n_, objc.Sel("destinationImageAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2866998-destinationimageallocator?language=objc +func (n_ NNGraph) SetDestinationImageAllocator(value PImageAllocator) { + po0 := objc.WrapAsProtocol("MPSImageAllocator", value) + objc.Call[objc.Void](n_, objc.Sel("setDestinationImageAllocator:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2866998-destinationimageallocator?language=objc +func (n_ NNGraph) SetDestinationImageAllocatorObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setDestinationImageAllocator:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2953954-resultimageisneeded?language=objc +func (n_ NNGraph) ResultImageIsNeeded() bool { + rv := objc.Call[bool](n_, objc.Sel("resultImageIsNeeded")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2953133-format?language=objc +func (n_ NNGraph) Format() ImageFeatureChannelFormat { + rv := objc.Call[ImageFeatureChannelFormat](n_, objc.Sel("format")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2953133-format?language=objc +func (n_ NNGraph) SetFormat(value ImageFeatureChannelFormat) { + objc.Call[objc.Void](n_, objc.Sel("setFormat:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867094-outputstateistemporary?language=objc +func (n_ NNGraph) OutputStateIsTemporary() bool { + rv := objc.Call[bool](n_, objc.Sel("outputStateIsTemporary")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngraph/2867094-outputstateistemporary?language=objc +func (n_ NNGraph) SetOutputStateIsTemporary(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setOutputStateIsTemporary:"), value) +} diff --git a/macos/mps/nn_grid_sample.gen.go b/macos/mps/nn_grid_sample.gen.go new file mode 100644 index 00000000..d546d840 --- /dev/null +++ b/macos/mps/nn_grid_sample.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNGridSample] class. +var NNGridSampleClass = _NNGridSampleClass{objc.GetClass("MPSNNGridSample")} + +type _NNGridSampleClass struct { + objc.Class +} + +// An interface definition for the [NNGridSample] class. +type INNGridSample interface { + ICNNBinaryKernel + UseGridValueAsInputCoordinate() bool + SetUseGridValueAsInputCoordinate(value bool) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngridsample?language=objc +type NNGridSample struct { + CNNBinaryKernel +} + +func NNGridSampleFrom(ptr unsafe.Pointer) NNGridSample { + return NNGridSample{ + CNNBinaryKernel: CNNBinaryKernelFrom(ptr), + } +} + +func (n_ NNGridSample) InitWithDevice(device metal.PDevice) NNGridSample { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGridSample](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngridsample/3131871-initwithdevice?language=objc +func NewNNGridSampleWithDevice(device metal.PDevice) NNGridSample { + instance := NNGridSampleClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNGridSampleClass) Alloc() NNGridSample { + rv := objc.Call[NNGridSample](nc, objc.Sel("alloc")) + return rv +} + +func NNGridSample_Alloc() NNGridSample { + return NNGridSampleClass.Alloc() +} + +func (nc _NNGridSampleClass) New() NNGridSample { + rv := objc.Call[NNGridSample](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNGridSample() NNGridSample { + return NNGridSampleClass.New() +} + +func (n_ NNGridSample) Init() NNGridSample { + rv := objc.Call[NNGridSample](n_, objc.Sel("init")) + return rv +} + +func (n_ NNGridSample) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGridSample { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNGridSample](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNGridSample_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNGridSample { + instance := NNGridSampleClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngridsample/3131872-usegridvalueasinputcoordinate?language=objc +func (n_ NNGridSample) UseGridValueAsInputCoordinate() bool { + rv := objc.Call[bool](n_, objc.Sel("useGridValueAsInputCoordinate")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnngridsample/3131872-usegridvalueasinputcoordinate?language=objc +func (n_ NNGridSample) SetUseGridValueAsInputCoordinate(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setUseGridValueAsInputCoordinate:"), value) +} diff --git a/macos/mps/nn_image_node.gen.go b/macos/mps/nn_image_node.gen.go new file mode 100644 index 00000000..ea4717ee --- /dev/null +++ b/macos/mps/nn_image_node.gen.go @@ -0,0 +1,216 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNImageNode] class. +var NNImageNodeClass = _NNImageNodeClass{objc.GetClass("MPSNNImageNode")} + +type _NNImageNodeClass struct { + objc.Class +} + +// An interface definition for the [NNImageNode] class. +type INNImageNode interface { + objc.IObject + Handle() HandleWrapper + SetHandle(value PHandle) + SetHandleObject(valueObject objc.IObject) + ExportFromGraph() bool + SetExportFromGraph(value bool) + StopGradient() bool + SetStopGradient(value bool) + SynchronizeResource() bool + SetSynchronizeResource(value bool) + ImageAllocator() ImageAllocatorWrapper + SetImageAllocator(value PImageAllocator) + SetImageAllocatorObject(valueObject objc.IObject) + Format() ImageFeatureChannelFormat + SetFormat(value ImageFeatureChannelFormat) +} + +// A placeholder node denoting the position of a neural network image in a graph. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode?language=objc +type NNImageNode struct { + objc.Object +} + +func NNImageNodeFrom(ptr unsafe.Pointer) NNImageNode { + return NNImageNode{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NNImageNodeClass) ExportedNodeWithHandle(handle objc.IObject) NNImageNode { + rv := objc.Call[NNImageNode](nc, objc.Sel("exportedNodeWithHandle:"), objc.Ptr(handle)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866440-exportednodewithhandle?language=objc +func NNImageNode_ExportedNodeWithHandle(handle objc.IObject) NNImageNode { + return NNImageNodeClass.ExportedNodeWithHandle(handle) +} + +func (nc _NNImageNodeClass) NodeWithHandle(handle objc.IObject) NNImageNode { + rv := objc.Call[NNImageNode](nc, objc.Sel("nodeWithHandle:"), objc.Ptr(handle)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866447-nodewithhandle?language=objc +func NNImageNode_NodeWithHandle(handle objc.IObject) NNImageNode { + return NNImageNodeClass.NodeWithHandle(handle) +} + +func (n_ NNImageNode) InitWithHandle(handle objc.IObject) NNImageNode { + rv := objc.Call[NNImageNode](n_, objc.Sel("initWithHandle:"), objc.Ptr(handle)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866483-initwithhandle?language=objc +func NewNNImageNodeWithHandle(handle objc.IObject) NNImageNode { + instance := NNImageNodeClass.Alloc().InitWithHandle(handle) + instance.Autorelease() + return instance +} + +func (nc _NNImageNodeClass) Alloc() NNImageNode { + rv := objc.Call[NNImageNode](nc, objc.Sel("alloc")) + return rv +} + +func NNImageNode_Alloc() NNImageNode { + return NNImageNodeClass.Alloc() +} + +func (nc _NNImageNodeClass) New() NNImageNode { + rv := objc.Call[NNImageNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNImageNode() NNImageNode { + return NNImageNodeClass.New() +} + +func (n_ NNImageNode) Init() NNImageNode { + rv := objc.Call[NNImageNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866406-handle?language=objc +func (n_ NNImageNode) Handle() HandleWrapper { + rv := objc.Call[HandleWrapper](n_, objc.Sel("handle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866406-handle?language=objc +func (n_ NNImageNode) SetHandle(value PHandle) { + po0 := objc.WrapAsProtocol("MPSHandle", value) + objc.Call[objc.Void](n_, objc.Sel("setHandle:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866406-handle?language=objc +func (n_ NNImageNode) SetHandleObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setHandle:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866478-exportfromgraph?language=objc +func (n_ NNImageNode) ExportFromGraph() bool { + rv := objc.Call[bool](n_, objc.Sel("exportFromGraph")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866478-exportfromgraph?language=objc +func (n_ NNImageNode) SetExportFromGraph(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setExportFromGraph:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/3020689-stopgradient?language=objc +func (n_ NNImageNode) StopGradient() bool { + rv := objc.Call[bool](n_, objc.Sel("stopGradient")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/3020689-stopgradient?language=objc +func (n_ NNImageNode) SetStopGradient(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setStopGradient:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2942638-synchronizeresource?language=objc +func (n_ NNImageNode) SynchronizeResource() bool { + rv := objc.Call[bool](n_, objc.Sel("synchronizeResource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2942638-synchronizeresource?language=objc +func (n_ NNImageNode) SetSynchronizeResource(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setSynchronizeResource:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866490-imageallocator?language=objc +func (n_ NNImageNode) ImageAllocator() ImageAllocatorWrapper { + rv := objc.Call[ImageAllocatorWrapper](n_, objc.Sel("imageAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866490-imageallocator?language=objc +func (n_ NNImageNode) SetImageAllocator(value PImageAllocator) { + po0 := objc.WrapAsProtocol("MPSImageAllocator", value) + objc.Call[objc.Void](n_, objc.Sel("setImageAllocator:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866490-imageallocator?language=objc +func (n_ NNImageNode) SetImageAllocatorObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setImageAllocator:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866498-format?language=objc +func (n_ NNImageNode) Format() ImageFeatureChannelFormat { + rv := objc.Call[ImageFeatureChannelFormat](n_, objc.Sel("format")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnimagenode/2866498-format?language=objc +func (n_ NNImageNode) SetFormat(value ImageFeatureChannelFormat) { + objc.Call[objc.Void](n_, objc.Sel("setFormat:"), value) +} diff --git a/macos/mps/nn_initial_gradient.gen.go b/macos/mps/nn_initial_gradient.gen.go new file mode 100644 index 00000000..1a43ac68 --- /dev/null +++ b/macos/mps/nn_initial_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNInitialGradient] class. +var NNInitialGradientClass = _NNInitialGradientClass{objc.GetClass("MPSNNInitialGradient")} + +type _NNInitialGradientClass struct { + objc.Class +} + +// An interface definition for the [NNInitialGradient] class. +type INNInitialGradient interface { + ICNNKernel +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnninitialgradient?language=objc +type NNInitialGradient struct { + CNNKernel +} + +func NNInitialGradientFrom(ptr unsafe.Pointer) NNInitialGradient { + return NNInitialGradient{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNInitialGradient) InitWithDevice(device metal.PDevice) NNInitialGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNInitialGradient](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnninitialgradient/3131809-initwithdevice?language=objc +func NewNNInitialGradientWithDevice(device metal.PDevice) NNInitialGradient { + instance := NNInitialGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNInitialGradientClass) Alloc() NNInitialGradient { + rv := objc.Call[NNInitialGradient](nc, objc.Sel("alloc")) + return rv +} + +func NNInitialGradient_Alloc() NNInitialGradient { + return NNInitialGradientClass.Alloc() +} + +func (nc _NNInitialGradientClass) New() NNInitialGradient { + rv := objc.Call[NNInitialGradient](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNInitialGradient() NNInitialGradient { + return NNInitialGradientClass.New() +} + +func (n_ NNInitialGradient) Init() NNInitialGradient { + rv := objc.Call[NNInitialGradient](n_, objc.Sel("init")) + return rv +} + +func (n_ NNInitialGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNInitialGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNInitialGradient](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNInitialGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNInitialGradient { + instance := NNInitialGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_initial_gradient_node.gen.go b/macos/mps/nn_initial_gradient_node.gen.go new file mode 100644 index 00000000..782bffef --- /dev/null +++ b/macos/mps/nn_initial_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNInitialGradientNode] class. +var NNInitialGradientNodeClass = _NNInitialGradientNodeClass{objc.GetClass("MPSNNInitialGradientNode")} + +type _NNInitialGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNInitialGradientNode] class. +type INNInitialGradientNode interface { + INNFilterNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnninitialgradientnode?language=objc +type NNInitialGradientNode struct { + NNFilterNode +} + +func NNInitialGradientNodeFrom(ptr unsafe.Pointer) NNInitialGradientNode { + return NNInitialGradientNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNInitialGradientNodeClass) NodeWithSource(source INNImageNode) NNInitialGradientNode { + rv := objc.Call[NNInitialGradientNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(source)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnninitialgradientnode/3131849-nodewithsource?language=objc +func NNInitialGradientNode_NodeWithSource(source INNImageNode) NNInitialGradientNode { + return NNInitialGradientNodeClass.NodeWithSource(source) +} + +func (n_ NNInitialGradientNode) InitWithSource(source INNImageNode) NNInitialGradientNode { + rv := objc.Call[NNInitialGradientNode](n_, objc.Sel("initWithSource:"), objc.Ptr(source)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnninitialgradientnode/3131848-initwithsource?language=objc +func NewNNInitialGradientNodeWithSource(source INNImageNode) NNInitialGradientNode { + instance := NNInitialGradientNodeClass.Alloc().InitWithSource(source) + instance.Autorelease() + return instance +} + +func (nc _NNInitialGradientNodeClass) Alloc() NNInitialGradientNode { + rv := objc.Call[NNInitialGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNInitialGradientNode_Alloc() NNInitialGradientNode { + return NNInitialGradientNodeClass.Alloc() +} + +func (nc _NNInitialGradientNodeClass) New() NNInitialGradientNode { + rv := objc.Call[NNInitialGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNInitialGradientNode() NNInitialGradientNode { + return NNInitialGradientNodeClass.New() +} + +func (n_ NNInitialGradientNode) Init() NNInitialGradientNode { + rv := objc.Call[NNInitialGradientNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_labels_node.gen.go b/macos/mps/nn_labels_node.gen.go new file mode 100644 index 00000000..7f5884af --- /dev/null +++ b/macos/mps/nn_labels_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNLabelsNode] class. +var NNLabelsNodeClass = _NNLabelsNodeClass{objc.GetClass("MPSNNLabelsNode")} + +type _NNLabelsNodeClass struct { + objc.Class +} + +// An interface definition for the [NNLabelsNode] class. +type INNLabelsNode interface { + INNStateNode +} + +// A placeholder node denoting the per-element weight buffer used by loss and gradient loss kernels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlabelsnode?language=objc +type NNLabelsNode struct { + NNStateNode +} + +func NNLabelsNodeFrom(ptr unsafe.Pointer) NNLabelsNode { + return NNLabelsNode{ + NNStateNode: NNStateNodeFrom(ptr), + } +} + +func (nc _NNLabelsNodeClass) Alloc() NNLabelsNode { + rv := objc.Call[NNLabelsNode](nc, objc.Sel("alloc")) + return rv +} + +func NNLabelsNode_Alloc() NNLabelsNode { + return NNLabelsNodeClass.Alloc() +} + +func (nc _NNLabelsNodeClass) New() NNLabelsNode { + rv := objc.Call[NNLabelsNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNLabelsNode() NNLabelsNode { + return NNLabelsNodeClass.New() +} + +func (n_ NNLabelsNode) Init() NNLabelsNode { + rv := objc.Call[NNLabelsNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_lanczos_scale_node.gen.go b/macos/mps/nn_lanczos_scale_node.gen.go new file mode 100644 index 00000000..365b6b6e --- /dev/null +++ b/macos/mps/nn_lanczos_scale_node.gen.go @@ -0,0 +1,85 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNLanczosScaleNode] class. +var NNLanczosScaleNodeClass = _NNLanczosScaleNodeClass{objc.GetClass("MPSNNLanczosScaleNode")} + +type _NNLanczosScaleNodeClass struct { + objc.Class +} + +// An interface definition for the [NNLanczosScaleNode] class. +type INNLanczosScaleNode interface { + INNScaleNode +} + +// A representation of a Lanczos resampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlanczosscalenode?language=objc +type NNLanczosScaleNode struct { + NNScaleNode +} + +func NNLanczosScaleNodeFrom(ptr unsafe.Pointer) NNLanczosScaleNode { + return NNLanczosScaleNode{ + NNScaleNode: NNScaleNodeFrom(ptr), + } +} + +func (nc _NNLanczosScaleNodeClass) Alloc() NNLanczosScaleNode { + rv := objc.Call[NNLanczosScaleNode](nc, objc.Sel("alloc")) + return rv +} + +func NNLanczosScaleNode_Alloc() NNLanczosScaleNode { + return NNLanczosScaleNodeClass.Alloc() +} + +func (nc _NNLanczosScaleNodeClass) New() NNLanczosScaleNode { + rv := objc.Call[NNLanczosScaleNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNLanczosScaleNode() NNLanczosScaleNode { + return NNLanczosScaleNodeClass.New() +} + +func (n_ NNLanczosScaleNode) Init() NNLanczosScaleNode { + rv := objc.Call[NNLanczosScaleNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNLanczosScaleNodeClass) NodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNLanczosScaleNode { + rv := objc.Call[NNLanczosScaleNode](nc, objc.Sel("nodeWithSource:outputSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnscalenode/2915280-nodewithsource?language=objc +func NNLanczosScaleNode_NodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNLanczosScaleNode { + return NNLanczosScaleNodeClass.NodeWithSourceOutputSize(sourceNode, size) +} + +func (n_ NNLanczosScaleNode) InitWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNLanczosScaleNode { + rv := objc.Call[NNLanczosScaleNode](n_, objc.Sel("initWithSource:outputSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnscalenode/2915285-initwithsource?language=objc +func NewNNLanczosScaleNodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNLanczosScaleNode { + instance := NNLanczosScaleNodeClass.Alloc().InitWithSourceOutputSize(sourceNode, size) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_local_correlation.gen.go b/macos/mps/nn_local_correlation.gen.go new file mode 100644 index 00000000..ab71cb25 --- /dev/null +++ b/macos/mps/nn_local_correlation.gen.go @@ -0,0 +1,158 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNLocalCorrelation] class. +var NNLocalCorrelationClass = _NNLocalCorrelationClass{objc.GetClass("MPSNNLocalCorrelation")} + +type _NNLocalCorrelationClass struct { + objc.Class +} + +// An interface definition for the [NNLocalCorrelation] class. +type INNLocalCorrelation interface { + INNReduceBinary + StrideInX() uint + SetStrideInX(value uint) + StrideInY() uint + SetStrideInY(value uint) + WindowInX() uint + SetWindowInX(value uint) + WindowInY() uint + SetWindowInY(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation?language=objc +type NNLocalCorrelation struct { + NNReduceBinary +} + +func NNLocalCorrelationFrom(ptr unsafe.Pointer) NNLocalCorrelation { + return NNLocalCorrelation{ + NNReduceBinary: NNReduceBinaryFrom(ptr), + } +} + +func (n_ NNLocalCorrelation) InitWithDevice(device metal.PDevice) NNLocalCorrelation { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNLocalCorrelation](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131875-initwithdevice?language=objc +func NewNNLocalCorrelationWithDevice(device metal.PDevice) NNLocalCorrelation { + instance := NNLocalCorrelationClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNLocalCorrelationClass) Alloc() NNLocalCorrelation { + rv := objc.Call[NNLocalCorrelation](nc, objc.Sel("alloc")) + return rv +} + +func NNLocalCorrelation_Alloc() NNLocalCorrelation { + return NNLocalCorrelationClass.Alloc() +} + +func (nc _NNLocalCorrelationClass) New() NNLocalCorrelation { + rv := objc.Call[NNLocalCorrelation](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNLocalCorrelation() NNLocalCorrelation { + return NNLocalCorrelationClass.New() +} + +func (n_ NNLocalCorrelation) Init() NNLocalCorrelation { + rv := objc.Call[NNLocalCorrelation](n_, objc.Sel("init")) + return rv +} + +func (n_ NNLocalCorrelation) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNLocalCorrelation { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNLocalCorrelation](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNLocalCorrelation_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNLocalCorrelation { + instance := NNLocalCorrelationClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131877-strideinx?language=objc +func (n_ NNLocalCorrelation) StrideInX() uint { + rv := objc.Call[uint](n_, objc.Sel("strideInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131877-strideinx?language=objc +func (n_ NNLocalCorrelation) SetStrideInX(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setStrideInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131878-strideiny?language=objc +func (n_ NNLocalCorrelation) StrideInY() uint { + rv := objc.Call[uint](n_, objc.Sel("strideInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131878-strideiny?language=objc +func (n_ NNLocalCorrelation) SetStrideInY(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setStrideInY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131879-windowinx?language=objc +func (n_ NNLocalCorrelation) WindowInX() uint { + rv := objc.Call[uint](n_, objc.Sel("windowInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131879-windowinx?language=objc +func (n_ NNLocalCorrelation) SetWindowInX(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setWindowInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131880-windowiny?language=objc +func (n_ NNLocalCorrelation) WindowInY() uint { + rv := objc.Call[uint](n_, objc.Sel("windowInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation/3131880-windowiny?language=objc +func (n_ NNLocalCorrelation) SetWindowInY(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setWindowInY:"), value) +} diff --git a/macos/mps/nn_loss_callback.gen.go b/macos/mps/nn_loss_callback.gen.go new file mode 100644 index 00000000..4ff2f0be --- /dev/null +++ b/macos/mps/nn_loss_callback.gen.go @@ -0,0 +1,33 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlosscallback?language=objc +type PNNLossCallback interface { + // optional + ScalarWeightForSourceImageDestinationImage(sourceImage Image, destinationImage Image) float64 + HasScalarWeightForSourceImageDestinationImage() bool +} + +// A concrete type wrapper for the [PNNLossCallback] protocol. +type NNLossCallbackWrapper struct { + objc.Object +} + +func (n_ NNLossCallbackWrapper) HasScalarWeightForSourceImageDestinationImage() bool { + return n_.RespondsToSelector(objc.Sel("scalarWeightForSourceImage:destinationImage:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlosscallback/3131851-scalarweightforsourceimage?language=objc +func (n_ NNLossCallbackWrapper) ScalarWeightForSourceImageDestinationImage(sourceImage IImage, destinationImage IImage) float64 { + rv := objc.Call[float64](n_, objc.Sel("scalarWeightForSourceImage:destinationImage:"), objc.Ptr(sourceImage), objc.Ptr(destinationImage)) + return rv +} diff --git a/macos/mps/nn_loss_gradient.gen.go b/macos/mps/nn_loss_gradient.gen.go new file mode 100644 index 00000000..d69b0e31 --- /dev/null +++ b/macos/mps/nn_loss_gradient.gen.go @@ -0,0 +1,244 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNLossGradient] class. +var NNLossGradientClass = _NNLossGradientClass{objc.GetClass("MPSNNLossGradient")} + +type _NNLossGradientClass struct { + objc.Class +} + +// An interface definition for the [NNLossGradient] class. +type INNLossGradient interface { + ICNNBinaryKernel + EncodeBatchToCommandBufferSourceGradientsSourceImagesLabelsWeightsSourceStatesDestinationGradients(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, sourceStates *foundation.Array, destinationGradients *foundation.Array) + EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesLabelsWeightsSourceStatesDestinationGradients(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, sourceStates *foundation.Array, destinationGradients *foundation.Array) + NumberOfClasses() uint + Weight() float64 + SetWeight(value float64) + Epsilon() float64 + SetEpsilon(value float64) + Delta() float64 + SetDelta(value float64) + ComputeLabelGradients() bool + SetComputeLabelGradients(value bool) + ReductionType() CNNReductionType + ReduceAcrossBatch() bool + LossType() CNNLossType + LabelSmoothing() float64 + SetLabelSmoothing(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient?language=objc +type NNLossGradient struct { + CNNBinaryKernel +} + +func NNLossGradientFrom(ptr unsafe.Pointer) NNLossGradient { + return NNLossGradient{ + CNNBinaryKernel: CNNBinaryKernelFrom(ptr), + } +} + +func (n_ NNLossGradient) InitWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNLossDescriptor) NNLossGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNLossGradient](n_, objc.Sel("initWithDevice:lossDescriptor:"), po0, objc.Ptr(lossDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131817-initwithdevice?language=objc +func NewNNLossGradientWithDeviceLossDescriptor(device metal.PDevice, lossDescriptor ICNNLossDescriptor) NNLossGradient { + instance := NNLossGradientClass.Alloc().InitWithDeviceLossDescriptor(device, lossDescriptor) + instance.Autorelease() + return instance +} + +func (nc _NNLossGradientClass) Alloc() NNLossGradient { + rv := objc.Call[NNLossGradient](nc, objc.Sel("alloc")) + return rv +} + +func NNLossGradient_Alloc() NNLossGradient { + return NNLossGradientClass.Alloc() +} + +func (nc _NNLossGradientClass) New() NNLossGradient { + rv := objc.Call[NNLossGradient](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNLossGradient() NNLossGradient { + return NNLossGradientClass.New() +} + +func (n_ NNLossGradient) Init() NNLossGradient { + rv := objc.Call[NNLossGradient](n_, objc.Sel("init")) + return rv +} + +func (n_ NNLossGradient) InitWithDevice(device metal.PDevice) NNLossGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNLossGradient](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865629-initwithdevice?language=objc +func NewNNLossGradientWithDevice(device metal.PDevice) NNLossGradient { + instance := NNLossGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNLossGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNLossGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNLossGradient](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNLossGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNLossGradient { + instance := NNLossGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131814-encodebatchtocommandbuffer?language=objc +func (n_ NNLossGradient) EncodeBatchToCommandBufferSourceGradientsSourceImagesLabelsWeightsSourceStatesDestinationGradients(commandBuffer metal.PCommandBuffer, sourceGradients *foundation.Array, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, sourceStates *foundation.Array, destinationGradients *foundation.Array) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](n_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:labels:weights:sourceStates:destinationGradients:"), po0, sourceGradients, sourceImages, labels, weights, sourceStates, destinationGradients) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131814-encodebatchtocommandbuffer?language=objc +func (n_ NNLossGradient) EncodeBatchToCommandBufferObjectSourceGradientsSourceImagesLabelsWeightsSourceStatesDestinationGradients(commandBufferObject objc.IObject, sourceGradients *foundation.Array, sourceImages *foundation.Array, labels *foundation.Array, weights *foundation.Array, sourceStates *foundation.Array, destinationGradients *foundation.Array) { + objc.Call[objc.Void](n_, objc.Sel("encodeBatchToCommandBuffer:sourceGradients:sourceImages:labels:weights:sourceStates:destinationGradients:"), objc.Ptr(commandBufferObject), sourceGradients, sourceImages, labels, weights, sourceStates, destinationGradients) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131820-numberofclasses?language=objc +func (n_ NNLossGradient) NumberOfClasses() uint { + rv := objc.Call[uint](n_, objc.Sel("numberOfClasses")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131822-weight?language=objc +func (n_ NNLossGradient) Weight() float64 { + rv := objc.Call[float64](n_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131822-weight?language=objc +func (n_ NNLossGradient) SetWeight(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setWeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131815-epsilon?language=objc +func (n_ NNLossGradient) Epsilon() float64 { + rv := objc.Call[float64](n_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131815-epsilon?language=objc +func (n_ NNLossGradient) SetEpsilon(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setEpsilon:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131812-delta?language=objc +func (n_ NNLossGradient) Delta() float64 { + rv := objc.Call[float64](n_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131812-delta?language=objc +func (n_ NNLossGradient) SetDelta(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setDelta:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131811-computelabelgradients?language=objc +func (n_ NNLossGradient) ComputeLabelGradients() bool { + rv := objc.Call[bool](n_, objc.Sel("computeLabelGradients")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131811-computelabelgradients?language=objc +func (n_ NNLossGradient) SetComputeLabelGradients(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setComputeLabelGradients:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131821-reductiontype?language=objc +func (n_ NNLossGradient) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](n_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3547986-reduceacrossbatch?language=objc +func (n_ NNLossGradient) ReduceAcrossBatch() bool { + rv := objc.Call[bool](n_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131819-losstype?language=objc +func (n_ NNLossGradient) LossType() CNNLossType { + rv := objc.Call[CNNLossType](n_, objc.Sel("lossType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131818-labelsmoothing?language=objc +func (n_ NNLossGradient) LabelSmoothing() float64 { + rv := objc.Call[float64](n_, objc.Sel("labelSmoothing")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradient/3131818-labelsmoothing?language=objc +func (n_ NNLossGradient) SetLabelSmoothing(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setLabelSmoothing:"), value) +} diff --git a/macos/mps/nn_loss_gradient_node.gen.go b/macos/mps/nn_loss_gradient_node.gen.go new file mode 100644 index 00000000..af32da5c --- /dev/null +++ b/macos/mps/nn_loss_gradient_node.gen.go @@ -0,0 +1,217 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNLossGradientNode] class. +var NNLossGradientNodeClass = _NNLossGradientNodeClass{objc.GetClass("MPSNNLossGradientNode")} + +type _NNLossGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNLossGradientNode] class. +type INNLossGradientNode interface { + INNGradientFilterNode + NumberOfClasses() uint + Weight() float64 + IsLabelsGradientFilter() bool + PropertyCallBack() NNLossCallbackWrapper + SetPropertyCallBack(value PNNLossCallback) + SetPropertyCallBackObject(valueObject objc.IObject) + Epsilon() float64 + Delta() float64 + ReductionType() CNNReductionType + ReduceAcrossBatch() bool + LossType() CNNLossType + LabelSmoothing() float64 +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode?language=objc +type NNLossGradientNode struct { + NNGradientFilterNode +} + +func NNLossGradientNodeFrom(ptr unsafe.Pointer) NNLossGradientNode { + return NNLossGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (nc _NNLossGradientNodeClass) NodeWithSourcesGradientStateLossDescriptorIsLabelsGradientFilter(sourceNodes []INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + rv := objc.Call[NNLossGradientNode](nc, objc.Sel("nodeWithSources:gradientState:lossDescriptor:isLabelsGradientFilter:"), sourceNodes, objc.Ptr(gradientState), objc.Ptr(descriptor), isLabelsGradientFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131863-nodewithsources?language=objc +func NNLossGradientNode_NodeWithSourcesGradientStateLossDescriptorIsLabelsGradientFilter(sourceNodes []INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + return NNLossGradientNodeClass.NodeWithSourcesGradientStateLossDescriptorIsLabelsGradientFilter(sourceNodes, gradientState, descriptor, isLabelsGradientFilter) +} + +func (n_ NNLossGradientNode) InitWithSourceGradientSourceImageLabelsGradientStateLossDescriptorIsLabelsGradientFilter(sourceGradient INNImageNode, sourceImage INNImageNode, labels INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + rv := objc.Call[NNLossGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:labels:gradientState:lossDescriptor:isLabelsGradientFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(labels), objc.Ptr(gradientState), objc.Ptr(descriptor), isLabelsGradientFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131855-initwithsourcegradient?language=objc +func NewNNLossGradientNodeWithSourceGradientSourceImageLabelsGradientStateLossDescriptorIsLabelsGradientFilter(sourceGradient INNImageNode, sourceImage INNImageNode, labels INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + instance := NNLossGradientNodeClass.Alloc().InitWithSourceGradientSourceImageLabelsGradientStateLossDescriptorIsLabelsGradientFilter(sourceGradient, sourceImage, labels, gradientState, descriptor, isLabelsGradientFilter) + instance.Autorelease() + return instance +} + +func (nc _NNLossGradientNodeClass) NodeWithSourceGradientSourceImageLabelsGradientStateLossDescriptorIsLabelsGradientFilter(sourceGradient INNImageNode, sourceImage INNImageNode, labels INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + rv := objc.Call[NNLossGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:labels:gradientState:lossDescriptor:isLabelsGradientFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(labels), objc.Ptr(gradientState), objc.Ptr(descriptor), isLabelsGradientFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131861-nodewithsourcegradient?language=objc +func NNLossGradientNode_NodeWithSourceGradientSourceImageLabelsGradientStateLossDescriptorIsLabelsGradientFilter(sourceGradient INNImageNode, sourceImage INNImageNode, labels INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + return NNLossGradientNodeClass.NodeWithSourceGradientSourceImageLabelsGradientStateLossDescriptorIsLabelsGradientFilter(sourceGradient, sourceImage, labels, gradientState, descriptor, isLabelsGradientFilter) +} + +func (n_ NNLossGradientNode) InitWithSourcesGradientStateLossDescriptorIsLabelsGradientFilter(sourceNodes []INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + rv := objc.Call[NNLossGradientNode](n_, objc.Sel("initWithSources:gradientState:lossDescriptor:isLabelsGradientFilter:"), sourceNodes, objc.Ptr(gradientState), objc.Ptr(descriptor), isLabelsGradientFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131857-initwithsources?language=objc +func NewNNLossGradientNodeWithSourcesGradientStateLossDescriptorIsLabelsGradientFilter(sourceNodes []INNImageNode, gradientState INNGradientStateNode, descriptor ICNNLossDescriptor, isLabelsGradientFilter bool) NNLossGradientNode { + instance := NNLossGradientNodeClass.Alloc().InitWithSourcesGradientStateLossDescriptorIsLabelsGradientFilter(sourceNodes, gradientState, descriptor, isLabelsGradientFilter) + instance.Autorelease() + return instance +} + +func (nc _NNLossGradientNodeClass) Alloc() NNLossGradientNode { + rv := objc.Call[NNLossGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNLossGradientNode_Alloc() NNLossGradientNode { + return NNLossGradientNodeClass.Alloc() +} + +func (nc _NNLossGradientNodeClass) New() NNLossGradientNode { + rv := objc.Call[NNLossGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNLossGradientNode() NNLossGradientNode { + return NNLossGradientNodeClass.New() +} + +func (n_ NNLossGradientNode) Init() NNLossGradientNode { + rv := objc.Call[NNLossGradientNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131864-numberofclasses?language=objc +func (n_ NNLossGradientNode) NumberOfClasses() uint { + rv := objc.Call[uint](n_, objc.Sel("numberOfClasses")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131867-weight?language=objc +func (n_ NNLossGradientNode) Weight() float64 { + rv := objc.Call[float64](n_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131858-islabelsgradientfilter?language=objc +func (n_ NNLossGradientNode) IsLabelsGradientFilter() bool { + rv := objc.Call[bool](n_, objc.Sel("isLabelsGradientFilter")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131865-propertycallback?language=objc +func (n_ NNLossGradientNode) PropertyCallBack() NNLossCallbackWrapper { + rv := objc.Call[NNLossCallbackWrapper](n_, objc.Sel("propertyCallBack")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131865-propertycallback?language=objc +func (n_ NNLossGradientNode) SetPropertyCallBack(value PNNLossCallback) { + po0 := objc.WrapAsProtocol("MPSNNLossCallback", value) + objc.Call[objc.Void](n_, objc.Sel("setPropertyCallBack:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131865-propertycallback?language=objc +func (n_ NNLossGradientNode) SetPropertyCallBackObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setPropertyCallBack:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131854-epsilon?language=objc +func (n_ NNLossGradientNode) Epsilon() float64 { + rv := objc.Call[float64](n_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131853-delta?language=objc +func (n_ NNLossGradientNode) Delta() float64 { + rv := objc.Call[float64](n_, objc.Sel("delta")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131866-reductiontype?language=objc +func (n_ NNLossGradientNode) ReductionType() CNNReductionType { + rv := objc.Call[CNNReductionType](n_, objc.Sel("reductionType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3547988-reduceacrossbatch?language=objc +func (n_ NNLossGradientNode) ReduceAcrossBatch() bool { + rv := objc.Call[bool](n_, objc.Sel("reduceAcrossBatch")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131860-losstype?language=objc +func (n_ NNLossGradientNode) LossType() CNNLossType { + rv := objc.Call[CNNLossType](n_, objc.Sel("lossType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlossgradientnode/3131859-labelsmoothing?language=objc +func (n_ NNLossGradientNode) LabelSmoothing() float64 { + rv := objc.Call[float64](n_, objc.Sel("labelSmoothing")) + return rv +} diff --git a/macos/mps/nn_multiary_gradient_state.gen.go b/macos/mps/nn_multiary_gradient_state.gen.go new file mode 100644 index 00000000..034849a1 --- /dev/null +++ b/macos/mps/nn_multiary_gradient_state.gen.go @@ -0,0 +1,116 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNMultiaryGradientState] class. +var NNMultiaryGradientStateClass = _NNMultiaryGradientStateClass{objc.GetClass("MPSNNMultiaryGradientState")} + +type _NNMultiaryGradientStateClass struct { + objc.Class +} + +// An interface definition for the [NNMultiaryGradientState] class. +type INNMultiaryGradientState interface { + IState +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnmultiarygradientstate?language=objc +type NNMultiaryGradientState struct { + State +} + +func NNMultiaryGradientStateFrom(ptr unsafe.Pointer) NNMultiaryGradientState { + return NNMultiaryGradientState{ + State: StateFrom(ptr), + } +} + +func (nc _NNMultiaryGradientStateClass) Alloc() NNMultiaryGradientState { + rv := objc.Call[NNMultiaryGradientState](nc, objc.Sel("alloc")) + return rv +} + +func NNMultiaryGradientState_Alloc() NNMultiaryGradientState { + return NNMultiaryGradientStateClass.Alloc() +} + +func (nc _NNMultiaryGradientStateClass) New() NNMultiaryGradientState { + rv := objc.Call[NNMultiaryGradientState](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNMultiaryGradientState() NNMultiaryGradientState { + return NNMultiaryGradientStateClass.New() +} + +func (n_ NNMultiaryGradientState) Init() NNMultiaryGradientState { + rv := objc.Call[NNMultiaryGradientState](n_, objc.Sel("init")) + return rv +} + +func (n_ NNMultiaryGradientState) InitWithResources(resources []metal.PResource) NNMultiaryGradientState { + rv := objc.Call[NNMultiaryGradientState](n_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewNNMultiaryGradientStateWithResources(resources []metal.PResource) NNMultiaryGradientState { + instance := NNMultiaryGradientStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (n_ NNMultiaryGradientState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NNMultiaryGradientState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNMultiaryGradientState](n_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewNNMultiaryGradientStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) NNMultiaryGradientState { + instance := NNMultiaryGradientStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (n_ NNMultiaryGradientState) InitWithResource(resource metal.PResource) NNMultiaryGradientState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[NNMultiaryGradientState](n_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewNNMultiaryGradientStateWithResource(resource metal.PResource) NNMultiaryGradientState { + instance := NNMultiaryGradientStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (nc _NNMultiaryGradientStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NNMultiaryGradientState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[NNMultiaryGradientState](nc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func NNMultiaryGradientState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) NNMultiaryGradientState { + return NNMultiaryGradientStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} diff --git a/macos/mps/nn_multiary_gradient_state_node.gen.go b/macos/mps/nn_multiary_gradient_state_node.gen.go new file mode 100644 index 00000000..8fbbcb36 --- /dev/null +++ b/macos/mps/nn_multiary_gradient_state_node.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNMultiaryGradientStateNode] class. +var NNMultiaryGradientStateNodeClass = _NNMultiaryGradientStateNodeClass{objc.GetClass("MPSNNMultiaryGradientStateNode")} + +type _NNMultiaryGradientStateNodeClass struct { + objc.Class +} + +// An interface definition for the [NNMultiaryGradientStateNode] class. +type INNMultiaryGradientStateNode interface { + INNStateNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnmultiarygradientstatenode?language=objc +type NNMultiaryGradientStateNode struct { + NNStateNode +} + +func NNMultiaryGradientStateNodeFrom(ptr unsafe.Pointer) NNMultiaryGradientStateNode { + return NNMultiaryGradientStateNode{ + NNStateNode: NNStateNodeFrom(ptr), + } +} + +func (nc _NNMultiaryGradientStateNodeClass) Alloc() NNMultiaryGradientStateNode { + rv := objc.Call[NNMultiaryGradientStateNode](nc, objc.Sel("alloc")) + return rv +} + +func NNMultiaryGradientStateNode_Alloc() NNMultiaryGradientStateNode { + return NNMultiaryGradientStateNodeClass.Alloc() +} + +func (nc _NNMultiaryGradientStateNodeClass) New() NNMultiaryGradientStateNode { + rv := objc.Call[NNMultiaryGradientStateNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNMultiaryGradientStateNode() NNMultiaryGradientStateNode { + return NNMultiaryGradientStateNodeClass.New() +} + +func (n_ NNMultiaryGradientStateNode) Init() NNMultiaryGradientStateNode { + rv := objc.Call[NNMultiaryGradientStateNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_multiplication_gradient_node.gen.go b/macos/mps/nn_multiplication_gradient_node.gen.go new file mode 100644 index 00000000..94176280 --- /dev/null +++ b/macos/mps/nn_multiplication_gradient_node.gen.go @@ -0,0 +1,98 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNMultiplicationGradientNode] class. +var NNMultiplicationGradientNodeClass = _NNMultiplicationGradientNodeClass{objc.GetClass("MPSNNMultiplicationGradientNode")} + +type _NNMultiplicationGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNMultiplicationGradientNode] class. +type INNMultiplicationGradientNode interface { + INNArithmeticGradientNode +} + +// A representation of a gradient multiplication operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnmultiplicationgradientnode?language=objc +type NNMultiplicationGradientNode struct { + NNArithmeticGradientNode +} + +func NNMultiplicationGradientNodeFrom(ptr unsafe.Pointer) NNMultiplicationGradientNode { + return NNMultiplicationGradientNode{ + NNArithmeticGradientNode: NNArithmeticGradientNodeFrom(ptr), + } +} + +func (nc _NNMultiplicationGradientNodeClass) Alloc() NNMultiplicationGradientNode { + rv := objc.Call[NNMultiplicationGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNMultiplicationGradientNode_Alloc() NNMultiplicationGradientNode { + return NNMultiplicationGradientNodeClass.Alloc() +} + +func (nc _NNMultiplicationGradientNodeClass) New() NNMultiplicationGradientNode { + rv := objc.Call[NNMultiplicationGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNMultiplicationGradientNode() NNMultiplicationGradientNode { + return NNMultiplicationGradientNodeClass.New() +} + +func (n_ NNMultiplicationGradientNode) Init() NNMultiplicationGradientNode { + rv := objc.Call[NNMultiplicationGradientNode](n_, objc.Sel("init")) + return rv +} + +func (n_ NNMultiplicationGradientNode) InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNMultiplicationGradientNode { + rv := objc.Call[NNMultiplicationGradientNode](n_, objc.Sel("initWithGradientImages:forwardFilter:isSecondarySourceFilter:"), gradientImages, objc.Ptr(filter), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952980-initwithgradientimages?language=objc +func NewNNMultiplicationGradientNodeWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNMultiplicationGradientNode { + instance := NNMultiplicationGradientNodeClass.Alloc().InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages, filter, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (n_ NNMultiplicationGradientNode) InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNMultiplicationGradientNode { + rv := objc.Call[NNMultiplicationGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956166-initwithsourcegradient?language=objc +func NewNNMultiplicationGradientNodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNMultiplicationGradientNode { + instance := NNMultiplicationGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (nc _NNMultiplicationGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNMultiplicationGradientNode { + rv := objc.Call[NNMultiplicationGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956167-nodewithsourcegradient?language=objc +func NNMultiplicationGradientNode_NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNMultiplicationGradientNode { + return NNMultiplicationGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) +} diff --git a/macos/mps/nn_multiplication_node.gen.go b/macos/mps/nn_multiplication_node.gen.go new file mode 100644 index 00000000..82c4082f --- /dev/null +++ b/macos/mps/nn_multiplication_node.gen.go @@ -0,0 +1,110 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNMultiplicationNode] class. +var NNMultiplicationNodeClass = _NNMultiplicationNodeClass{objc.GetClass("MPSNNMultiplicationNode")} + +type _NNMultiplicationNodeClass struct { + objc.Class +} + +// An interface definition for the [NNMultiplicationNode] class. +type INNMultiplicationNode interface { + INNBinaryArithmeticNode +} + +// A representation of a multiplication operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnmultiplicationnode?language=objc +type NNMultiplicationNode struct { + NNBinaryArithmeticNode +} + +func NNMultiplicationNodeFrom(ptr unsafe.Pointer) NNMultiplicationNode { + return NNMultiplicationNode{ + NNBinaryArithmeticNode: NNBinaryArithmeticNodeFrom(ptr), + } +} + +func (nc _NNMultiplicationNodeClass) Alloc() NNMultiplicationNode { + rv := objc.Call[NNMultiplicationNode](nc, objc.Sel("alloc")) + return rv +} + +func NNMultiplicationNode_Alloc() NNMultiplicationNode { + return NNMultiplicationNodeClass.Alloc() +} + +func (nc _NNMultiplicationNodeClass) New() NNMultiplicationNode { + rv := objc.Call[NNMultiplicationNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNMultiplicationNode() NNMultiplicationNode { + return NNMultiplicationNodeClass.New() +} + +func (n_ NNMultiplicationNode) Init() NNMultiplicationNode { + rv := objc.Call[NNMultiplicationNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNMultiplicationNodeClass) NodeWithSources(sourceNodes []INNImageNode) NNMultiplicationNode { + rv := objc.Call[NNMultiplicationNode](nc, objc.Sel("nodeWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890829-nodewithsources?language=objc +func NNMultiplicationNode_NodeWithSources(sourceNodes []INNImageNode) NNMultiplicationNode { + return NNMultiplicationNodeClass.NodeWithSources(sourceNodes) +} + +func (nc _NNMultiplicationNodeClass) NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNMultiplicationNode { + rv := objc.Call[NNMultiplicationNode](nc, objc.Sel("nodeWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890830-nodewithleftsource?language=objc +func NNMultiplicationNode_NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNMultiplicationNode { + return NNMultiplicationNodeClass.NodeWithLeftSourceRightSource(left, right) +} + +func (n_ NNMultiplicationNode) InitWithSources(sourceNodes []INNImageNode) NNMultiplicationNode { + rv := objc.Call[NNMultiplicationNode](n_, objc.Sel("initWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890820-initwithsources?language=objc +func NewNNMultiplicationNodeWithSources(sourceNodes []INNImageNode) NNMultiplicationNode { + instance := NNMultiplicationNodeClass.Alloc().InitWithSources(sourceNodes) + instance.Autorelease() + return instance +} + +func (n_ NNMultiplicationNode) InitWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNMultiplicationNode { + rv := objc.Call[NNMultiplicationNode](n_, objc.Sel("initWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890825-initwithleftsource?language=objc +func NewNNMultiplicationNodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNMultiplicationNode { + instance := NNMultiplicationNodeClass.Alloc().InitWithLeftSourceRightSource(left, right) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_neuron_descriptor.gen.go b/macos/mps/nn_neuron_descriptor.gen.go new file mode 100644 index 00000000..a0b6b330 --- /dev/null +++ b/macos/mps/nn_neuron_descriptor.gen.go @@ -0,0 +1,173 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNNeuronDescriptor] class. +var NNNeuronDescriptorClass = _NNNeuronDescriptorClass{objc.GetClass("MPSNNNeuronDescriptor")} + +type _NNNeuronDescriptorClass struct { + objc.Class +} + +// An interface definition for the [NNNeuronDescriptor] class. +type INNNeuronDescriptor interface { + objc.IObject + A() float64 + SetA(value float64) + Data() []byte + SetData(value []byte) + NeuronType() CNNNeuronType + SetNeuronType(value CNNNeuronType) + C() float64 + SetC(value float64) + B() float64 + SetB(value float64) +} + +// An object that specifies properties used by a neuron kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor?language=objc +type NNNeuronDescriptor struct { + objc.Object +} + +func NNNeuronDescriptorFrom(ptr unsafe.Pointer) NNNeuronDescriptor { + return NNNeuronDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NNNeuronDescriptorClass) Alloc() NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](nc, objc.Sel("alloc")) + return rv +} + +func NNNeuronDescriptor_Alloc() NNNeuronDescriptor { + return NNNeuronDescriptorClass.Alloc() +} + +func (nc _NNNeuronDescriptorClass) New() NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNNeuronDescriptor() NNNeuronDescriptor { + return NNNeuronDescriptorClass.New() +} + +func (n_ NNNeuronDescriptor) Init() NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942307-cnnneurondescriptorwithtype?language=objc +func (nc _NNNeuronDescriptorClass) CnnNeuronDescriptorWithType(neuronType CNNNeuronType) NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](nc, objc.Sel("cnnNeuronDescriptorWithType:"), neuronType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942307-cnnneurondescriptorwithtype?language=objc +func NNNeuronDescriptor_CnnNeuronDescriptorWithType(neuronType CNNNeuronType) NNNeuronDescriptor { + return NNNeuronDescriptorClass.CnnNeuronDescriptorWithType(neuronType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942317-cnnneuronpreludescriptorwithdata?language=objc +func (nc _NNNeuronDescriptorClass) CnnNeuronPReLUDescriptorWithDataNoCopy(data []byte, noCopy bool) NNNeuronDescriptor { + rv := objc.Call[NNNeuronDescriptor](nc, objc.Sel("cnnNeuronPReLUDescriptorWithData:noCopy:"), data, noCopy) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942317-cnnneuronpreludescriptorwithdata?language=objc +func NNNeuronDescriptor_CnnNeuronPReLUDescriptorWithDataNoCopy(data []byte, noCopy bool) NNNeuronDescriptor { + return NNNeuronDescriptorClass.CnnNeuronPReLUDescriptorWithDataNoCopy(data, noCopy) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942316-a?language=objc +func (n_ NNNeuronDescriptor) A() float64 { + rv := objc.Call[float64](n_, objc.Sel("a")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942316-a?language=objc +func (n_ NNNeuronDescriptor) SetA(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setA:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942299-data?language=objc +func (n_ NNNeuronDescriptor) Data() []byte { + rv := objc.Call[[]byte](n_, objc.Sel("data")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942299-data?language=objc +func (n_ NNNeuronDescriptor) SetData(value []byte) { + objc.Call[objc.Void](n_, objc.Sel("setData:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942292-neurontype?language=objc +func (n_ NNNeuronDescriptor) NeuronType() CNNNeuronType { + rv := objc.Call[CNNNeuronType](n_, objc.Sel("neuronType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942292-neurontype?language=objc +func (n_ NNNeuronDescriptor) SetNeuronType(value CNNNeuronType) { + objc.Call[objc.Void](n_, objc.Sel("setNeuronType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942305-c?language=objc +func (n_ NNNeuronDescriptor) C() float64 { + rv := objc.Call[float64](n_, objc.Sel("c")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942305-c?language=objc +func (n_ NNNeuronDescriptor) SetC(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setC:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942302-b?language=objc +func (n_ NNNeuronDescriptor) B() float64 { + rv := objc.Call[float64](n_, objc.Sel("b")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnneurondescriptor/2942302-b?language=objc +func (n_ NNNeuronDescriptor) SetB(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setB:"), value) +} diff --git a/macos/mps/nn_optimizer.gen.go b/macos/mps/nn_optimizer.gen.go new file mode 100644 index 00000000..b7ffb05f --- /dev/null +++ b/macos/mps/nn_optimizer.gen.go @@ -0,0 +1,169 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNOptimizer] class. +var NNOptimizerClass = _NNOptimizerClass{objc.GetClass("MPSNNOptimizer")} + +type _NNOptimizerClass struct { + objc.Class +} + +// An interface definition for the [NNOptimizer] class. +type INNOptimizer interface { + IKernel + SetLearningRate(newLearningRate float64) + GradientRescale() float64 + ApplyGradientClipping() bool + SetApplyGradientClipping(value bool) + RegularizationScale() float64 + GradientClipMax() float64 + RegularizationType() NNRegularizationType + LearningRate() float64 + GradientClipMin() float64 +} + +// The base class for optimization layers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer?language=objc +type NNOptimizer struct { + Kernel +} + +func NNOptimizerFrom(ptr unsafe.Pointer) NNOptimizer { + return NNOptimizer{ + Kernel: KernelFrom(ptr), + } +} + +func (nc _NNOptimizerClass) Alloc() NNOptimizer { + rv := objc.Call[NNOptimizer](nc, objc.Sel("alloc")) + return rv +} + +func NNOptimizer_Alloc() NNOptimizer { + return NNOptimizerClass.Alloc() +} + +func (nc _NNOptimizerClass) New() NNOptimizer { + rv := objc.Call[NNOptimizer](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNOptimizer() NNOptimizer { + return NNOptimizerClass.New() +} + +func (n_ NNOptimizer) Init() NNOptimizer { + rv := objc.Call[NNOptimizer](n_, objc.Sel("init")) + return rv +} + +func (n_ NNOptimizer) InitWithDevice(device metal.PDevice) NNOptimizer { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizer](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNNOptimizerWithDevice(device metal.PDevice) NNOptimizer { + instance := NNOptimizerClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNOptimizer) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizer { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizer](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNOptimizer_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizer { + instance := NNOptimizerClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966712-setlearningrate?language=objc +func (n_ NNOptimizer) SetLearningRate(newLearningRate float64) { + objc.Call[objc.Void](n_, objc.Sel("setLearningRate:"), newLearningRate) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966708-gradientrescale?language=objc +func (n_ NNOptimizer) GradientRescale() float64 { + rv := objc.Call[float64](n_, objc.Sel("gradientRescale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966705-applygradientclipping?language=objc +func (n_ NNOptimizer) ApplyGradientClipping() bool { + rv := objc.Call[bool](n_, objc.Sel("applyGradientClipping")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966705-applygradientclipping?language=objc +func (n_ NNOptimizer) SetApplyGradientClipping(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setApplyGradientClipping:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966710-regularizationscale?language=objc +func (n_ NNOptimizer) RegularizationScale() float64 { + rv := objc.Call[float64](n_, objc.Sel("regularizationScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966706-gradientclipmax?language=objc +func (n_ NNOptimizer) GradientClipMax() float64 { + rv := objc.Call[float64](n_, objc.Sel("gradientClipMax")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966711-regularizationtype?language=objc +func (n_ NNOptimizer) RegularizationType() NNRegularizationType { + rv := objc.Call[NNRegularizationType](n_, objc.Sel("regularizationType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966709-learningrate?language=objc +func (n_ NNOptimizer) LearningRate() float64 { + rv := objc.Call[float64](n_, objc.Sel("learningRate")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizer/2966707-gradientclipmin?language=objc +func (n_ NNOptimizer) GradientClipMin() float64 { + rv := objc.Call[float64](n_, objc.Sel("gradientClipMin")) + return rv +} diff --git a/macos/mps/nn_optimizer_adam.gen.go b/macos/mps/nn_optimizer_adam.gen.go new file mode 100644 index 00000000..e5018d96 --- /dev/null +++ b/macos/mps/nn_optimizer_adam.gen.go @@ -0,0 +1,166 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNOptimizerAdam] class. +var NNOptimizerAdamClass = _NNOptimizerAdamClass{objc.GetClass("MPSNNOptimizerAdam")} + +type _NNOptimizerAdamClass struct { + objc.Class +} + +// An interface definition for the [NNOptimizerAdam] class. +type INNOptimizerAdam interface { + INNOptimizer + EncodeToCommandBufferInputGradientMatrixInputValuesMatrixInputMomentumMatrixInputVelocityMatrixResultValuesMatrix(commandBuffer metal.PCommandBuffer, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, inputVelocityMatrix IMatrix, resultValuesMatrix IMatrix) + EncodeToCommandBufferObjectInputGradientMatrixInputValuesMatrixInputMomentumMatrixInputVelocityMatrixResultValuesMatrix(commandBufferObject objc.IObject, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, inputVelocityMatrix IMatrix, resultValuesMatrix IMatrix) + Epsilon() float64 + Beta2() float64 + Beta1() float64 + TimeStep() uint + SetTimeStep(value uint) +} + +// An optimization layer that performs an Adam pdate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam?language=objc +type NNOptimizerAdam struct { + NNOptimizer +} + +func NNOptimizerAdamFrom(ptr unsafe.Pointer) NNOptimizerAdam { + return NNOptimizerAdam{ + NNOptimizer: NNOptimizerFrom(ptr), + } +} + +func (n_ NNOptimizerAdam) InitWithDeviceLearningRate(device metal.PDevice, learningRate float64) NNOptimizerAdam { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerAdam](n_, objc.Sel("initWithDevice:learningRate:"), po0, learningRate) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/2966719-initwithdevice?language=objc +func NewNNOptimizerAdamWithDeviceLearningRate(device metal.PDevice, learningRate float64) NNOptimizerAdam { + instance := NNOptimizerAdamClass.Alloc().InitWithDeviceLearningRate(device, learningRate) + instance.Autorelease() + return instance +} + +func (nc _NNOptimizerAdamClass) Alloc() NNOptimizerAdam { + rv := objc.Call[NNOptimizerAdam](nc, objc.Sel("alloc")) + return rv +} + +func NNOptimizerAdam_Alloc() NNOptimizerAdam { + return NNOptimizerAdamClass.Alloc() +} + +func (nc _NNOptimizerAdamClass) New() NNOptimizerAdam { + rv := objc.Call[NNOptimizerAdam](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNOptimizerAdam() NNOptimizerAdam { + return NNOptimizerAdamClass.New() +} + +func (n_ NNOptimizerAdam) Init() NNOptimizerAdam { + rv := objc.Call[NNOptimizerAdam](n_, objc.Sel("init")) + return rv +} + +func (n_ NNOptimizerAdam) InitWithDevice(device metal.PDevice) NNOptimizerAdam { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerAdam](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNNOptimizerAdamWithDevice(device metal.PDevice) NNOptimizerAdam { + instance := NNOptimizerAdamClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNOptimizerAdam) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizerAdam { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerAdam](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNOptimizerAdam_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizerAdam { + instance := NNOptimizerAdamClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/3197826-encodetocommandbuffer?language=objc +func (n_ NNOptimizerAdam) EncodeToCommandBufferInputGradientMatrixInputValuesMatrixInputMomentumMatrixInputVelocityMatrixResultValuesMatrix(commandBuffer metal.PCommandBuffer, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, inputVelocityMatrix IMatrix, resultValuesMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:inputGradientMatrix:inputValuesMatrix:inputMomentumMatrix:inputVelocityMatrix:resultValuesMatrix:"), po0, objc.Ptr(inputGradientMatrix), objc.Ptr(inputValuesMatrix), objc.Ptr(inputMomentumMatrix), objc.Ptr(inputVelocityMatrix), objc.Ptr(resultValuesMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/3197826-encodetocommandbuffer?language=objc +func (n_ NNOptimizerAdam) EncodeToCommandBufferObjectInputGradientMatrixInputValuesMatrixInputMomentumMatrixInputVelocityMatrixResultValuesMatrix(commandBufferObject objc.IObject, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, inputVelocityMatrix IMatrix, resultValuesMatrix IMatrix) { + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:inputGradientMatrix:inputValuesMatrix:inputMomentumMatrix:inputVelocityMatrix:resultValuesMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputGradientMatrix), objc.Ptr(inputValuesMatrix), objc.Ptr(inputMomentumMatrix), objc.Ptr(inputVelocityMatrix), objc.Ptr(resultValuesMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/2966717-epsilon?language=objc +func (n_ NNOptimizerAdam) Epsilon() float64 { + rv := objc.Call[float64](n_, objc.Sel("epsilon")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/2966715-beta2?language=objc +func (n_ NNOptimizerAdam) Beta2() float64 { + rv := objc.Call[float64](n_, objc.Sel("beta2")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/2966714-beta1?language=objc +func (n_ NNOptimizerAdam) Beta1() float64 { + rv := objc.Call[float64](n_, objc.Sel("beta1")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/2966720-timestep?language=objc +func (n_ NNOptimizerAdam) TimeStep() uint { + rv := objc.Call[uint](n_, objc.Sel("timeStep")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizeradam/2966720-timestep?language=objc +func (n_ NNOptimizerAdam) SetTimeStep(value uint) { + objc.Call[objc.Void](n_, objc.Sel("setTimeStep:"), value) +} diff --git a/macos/mps/nn_optimizer_descriptor.gen.go b/macos/mps/nn_optimizer_descriptor.gen.go new file mode 100644 index 00000000..bcc5be90 --- /dev/null +++ b/macos/mps/nn_optimizer_descriptor.gen.go @@ -0,0 +1,203 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNOptimizerDescriptor] class. +var NNOptimizerDescriptorClass = _NNOptimizerDescriptorClass{objc.GetClass("MPSNNOptimizerDescriptor")} + +type _NNOptimizerDescriptorClass struct { + objc.Class +} + +// An interface definition for the [NNOptimizerDescriptor] class. +type INNOptimizerDescriptor interface { + objc.IObject + GradientRescale() float64 + SetGradientRescale(value float64) + ApplyGradientClipping() bool + SetApplyGradientClipping(value bool) + RegularizationScale() float64 + SetRegularizationScale(value float64) + GradientClipMax() float64 + SetGradientClipMax(value float64) + RegularizationType() NNRegularizationType + SetRegularizationType(value NNRegularizationType) + LearningRate() float64 + SetLearningRate(value float64) + GradientClipMin() float64 + SetGradientClipMin(value float64) +} + +// An object that specifies properties used by an optimizer kernel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor?language=objc +type NNOptimizerDescriptor struct { + objc.Object +} + +func NNOptimizerDescriptorFrom(ptr unsafe.Pointer) NNOptimizerDescriptor { + return NNOptimizerDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (n_ NNOptimizerDescriptor) InitWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float64, gradientRescale float64, regularizationType NNRegularizationType, regularizationScale float64) NNOptimizerDescriptor { + rv := objc.Call[NNOptimizerDescriptor](n_, objc.Sel("initWithLearningRate:gradientRescale:regularizationType:regularizationScale:"), learningRate, gradientRescale, regularizationType, regularizationScale) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966727-initwithlearningrate?language=objc +func NewNNOptimizerDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float64, gradientRescale float64, regularizationType NNRegularizationType, regularizationScale float64) NNOptimizerDescriptor { + instance := NNOptimizerDescriptorClass.Alloc().InitWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate, gradientRescale, regularizationType, regularizationScale) + instance.Autorelease() + return instance +} + +func (nc _NNOptimizerDescriptorClass) OptimizerDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float64, gradientRescale float64, regularizationType NNRegularizationType, regularizationScale float64) NNOptimizerDescriptor { + rv := objc.Call[NNOptimizerDescriptor](nc, objc.Sel("optimizerDescriptorWithLearningRate:gradientRescale:regularizationType:regularizationScale:"), learningRate, gradientRescale, regularizationType, regularizationScale) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966730-optimizerdescriptorwithlearningr?language=objc +func NNOptimizerDescriptor_OptimizerDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float64, gradientRescale float64, regularizationType NNRegularizationType, regularizationScale float64) NNOptimizerDescriptor { + return NNOptimizerDescriptorClass.OptimizerDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate, gradientRescale, regularizationType, regularizationScale) +} + +func (nc _NNOptimizerDescriptorClass) Alloc() NNOptimizerDescriptor { + rv := objc.Call[NNOptimizerDescriptor](nc, objc.Sel("alloc")) + return rv +} + +func NNOptimizerDescriptor_Alloc() NNOptimizerDescriptor { + return NNOptimizerDescriptorClass.Alloc() +} + +func (nc _NNOptimizerDescriptorClass) New() NNOptimizerDescriptor { + rv := objc.Call[NNOptimizerDescriptor](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNOptimizerDescriptor() NNOptimizerDescriptor { + return NNOptimizerDescriptorClass.New() +} + +func (n_ NNOptimizerDescriptor) Init() NNOptimizerDescriptor { + rv := objc.Call[NNOptimizerDescriptor](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966725-gradientrescale?language=objc +func (n_ NNOptimizerDescriptor) GradientRescale() float64 { + rv := objc.Call[float64](n_, objc.Sel("gradientRescale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966725-gradientrescale?language=objc +func (n_ NNOptimizerDescriptor) SetGradientRescale(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setGradientRescale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966722-applygradientclipping?language=objc +func (n_ NNOptimizerDescriptor) ApplyGradientClipping() bool { + rv := objc.Call[bool](n_, objc.Sel("applyGradientClipping")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966722-applygradientclipping?language=objc +func (n_ NNOptimizerDescriptor) SetApplyGradientClipping(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setApplyGradientClipping:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966731-regularizationscale?language=objc +func (n_ NNOptimizerDescriptor) RegularizationScale() float64 { + rv := objc.Call[float64](n_, objc.Sel("regularizationScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966731-regularizationscale?language=objc +func (n_ NNOptimizerDescriptor) SetRegularizationScale(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setRegularizationScale:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966723-gradientclipmax?language=objc +func (n_ NNOptimizerDescriptor) GradientClipMax() float64 { + rv := objc.Call[float64](n_, objc.Sel("gradientClipMax")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966723-gradientclipmax?language=objc +func (n_ NNOptimizerDescriptor) SetGradientClipMax(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setGradientClipMax:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966732-regularizationtype?language=objc +func (n_ NNOptimizerDescriptor) RegularizationType() NNRegularizationType { + rv := objc.Call[NNRegularizationType](n_, objc.Sel("regularizationType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966732-regularizationtype?language=objc +func (n_ NNOptimizerDescriptor) SetRegularizationType(value NNRegularizationType) { + objc.Call[objc.Void](n_, objc.Sel("setRegularizationType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966728-learningrate?language=objc +func (n_ NNOptimizerDescriptor) LearningRate() float64 { + rv := objc.Call[float64](n_, objc.Sel("learningRate")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966728-learningrate?language=objc +func (n_ NNOptimizerDescriptor) SetLearningRate(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setLearningRate:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966724-gradientclipmin?language=objc +func (n_ NNOptimizerDescriptor) GradientClipMin() float64 { + rv := objc.Call[float64](n_, objc.Sel("gradientClipMin")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerdescriptor/2966724-gradientclipmin?language=objc +func (n_ NNOptimizerDescriptor) SetGradientClipMin(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setGradientClipMin:"), value) +} diff --git a/macos/mps/nn_optimizer_rms_prop.gen.go b/macos/mps/nn_optimizer_rms_prop.gen.go new file mode 100644 index 00000000..26ed3730 --- /dev/null +++ b/macos/mps/nn_optimizer_rms_prop.gen.go @@ -0,0 +1,140 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNOptimizerRMSProp] class. +var NNOptimizerRMSPropClass = _NNOptimizerRMSPropClass{objc.GetClass("MPSNNOptimizerRMSProp")} + +type _NNOptimizerRMSPropClass struct { + objc.Class +} + +// An interface definition for the [NNOptimizerRMSProp] class. +type INNOptimizerRMSProp interface { + INNOptimizer + EncodeToCommandBufferInputGradientMatrixInputValuesMatrixInputSumOfSquaresMatrixResultValuesMatrix(commandBuffer metal.PCommandBuffer, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputSumOfSquaresMatrix IMatrix, resultValuesMatrix IMatrix) + EncodeToCommandBufferObjectInputGradientMatrixInputValuesMatrixInputSumOfSquaresMatrixResultValuesMatrix(commandBufferObject objc.IObject, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputSumOfSquaresMatrix IMatrix, resultValuesMatrix IMatrix) + Decay() float64 + Epsilon() float64 +} + +// An optimization layer that performs a root mean square propagation update. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerrmsprop?language=objc +type NNOptimizerRMSProp struct { + NNOptimizer +} + +func NNOptimizerRMSPropFrom(ptr unsafe.Pointer) NNOptimizerRMSProp { + return NNOptimizerRMSProp{ + NNOptimizer: NNOptimizerFrom(ptr), + } +} + +func (n_ NNOptimizerRMSProp) InitWithDeviceLearningRate(device metal.PDevice, learningRate float64) NNOptimizerRMSProp { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerRMSProp](n_, objc.Sel("initWithDevice:learningRate:"), po0, learningRate) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerrmsprop/2966738-initwithdevice?language=objc +func NewNNOptimizerRMSPropWithDeviceLearningRate(device metal.PDevice, learningRate float64) NNOptimizerRMSProp { + instance := NNOptimizerRMSPropClass.Alloc().InitWithDeviceLearningRate(device, learningRate) + instance.Autorelease() + return instance +} + +func (nc _NNOptimizerRMSPropClass) Alloc() NNOptimizerRMSProp { + rv := objc.Call[NNOptimizerRMSProp](nc, objc.Sel("alloc")) + return rv +} + +func NNOptimizerRMSProp_Alloc() NNOptimizerRMSProp { + return NNOptimizerRMSPropClass.Alloc() +} + +func (nc _NNOptimizerRMSPropClass) New() NNOptimizerRMSProp { + rv := objc.Call[NNOptimizerRMSProp](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNOptimizerRMSProp() NNOptimizerRMSProp { + return NNOptimizerRMSPropClass.New() +} + +func (n_ NNOptimizerRMSProp) Init() NNOptimizerRMSProp { + rv := objc.Call[NNOptimizerRMSProp](n_, objc.Sel("init")) + return rv +} + +func (n_ NNOptimizerRMSProp) InitWithDevice(device metal.PDevice) NNOptimizerRMSProp { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerRMSProp](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNNOptimizerRMSPropWithDevice(device metal.PDevice) NNOptimizerRMSProp { + instance := NNOptimizerRMSPropClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNOptimizerRMSProp) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizerRMSProp { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerRMSProp](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNOptimizerRMSProp_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizerRMSProp { + instance := NNOptimizerRMSPropClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerrmsprop/3197827-encodetocommandbuffer?language=objc +func (n_ NNOptimizerRMSProp) EncodeToCommandBufferInputGradientMatrixInputValuesMatrixInputSumOfSquaresMatrixResultValuesMatrix(commandBuffer metal.PCommandBuffer, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputSumOfSquaresMatrix IMatrix, resultValuesMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:inputGradientMatrix:inputValuesMatrix:inputSumOfSquaresMatrix:resultValuesMatrix:"), po0, objc.Ptr(inputGradientMatrix), objc.Ptr(inputValuesMatrix), objc.Ptr(inputSumOfSquaresMatrix), objc.Ptr(resultValuesMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerrmsprop/3197827-encodetocommandbuffer?language=objc +func (n_ NNOptimizerRMSProp) EncodeToCommandBufferObjectInputGradientMatrixInputValuesMatrixInputSumOfSquaresMatrixResultValuesMatrix(commandBufferObject objc.IObject, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputSumOfSquaresMatrix IMatrix, resultValuesMatrix IMatrix) { + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:inputGradientMatrix:inputValuesMatrix:inputSumOfSquaresMatrix:resultValuesMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputGradientMatrix), objc.Ptr(inputValuesMatrix), objc.Ptr(inputSumOfSquaresMatrix), objc.Ptr(resultValuesMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerrmsprop/2966734-decay?language=objc +func (n_ NNOptimizerRMSProp) Decay() float64 { + rv := objc.Call[float64](n_, objc.Sel("decay")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerrmsprop/2966736-epsilon?language=objc +func (n_ NNOptimizerRMSProp) Epsilon() float64 { + rv := objc.Call[float64](n_, objc.Sel("epsilon")) + return rv +} diff --git a/macos/mps/nn_optimizer_stochastic_gradient_descent.gen.go b/macos/mps/nn_optimizer_stochastic_gradient_descent.gen.go new file mode 100644 index 00000000..8a7fe57b --- /dev/null +++ b/macos/mps/nn_optimizer_stochastic_gradient_descent.gen.go @@ -0,0 +1,149 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNOptimizerStochasticGradientDescent] class. +var NNOptimizerStochasticGradientDescentClass = _NNOptimizerStochasticGradientDescentClass{objc.GetClass("MPSNNOptimizerStochasticGradientDescent")} + +type _NNOptimizerStochasticGradientDescentClass struct { + objc.Class +} + +// An interface definition for the [NNOptimizerStochasticGradientDescent] class. +type INNOptimizerStochasticGradientDescent interface { + INNOptimizer + EncodeToCommandBufferInputGradientMatrixInputValuesMatrixInputMomentumMatrixResultValuesMatrix(commandBuffer metal.PCommandBuffer, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, resultValuesMatrix IMatrix) + EncodeToCommandBufferObjectInputGradientMatrixInputValuesMatrixInputMomentumMatrixResultValuesMatrix(commandBufferObject objc.IObject, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, resultValuesMatrix IMatrix) + UseNesterovMomentum() bool + MomentumScale() float64 + UseNestrovMomentum() bool +} + +// An optimization layer that performs a gradient descent with an optional momentum update. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerstochasticgradientdescent?language=objc +type NNOptimizerStochasticGradientDescent struct { + NNOptimizer +} + +func NNOptimizerStochasticGradientDescentFrom(ptr unsafe.Pointer) NNOptimizerStochasticGradientDescent { + return NNOptimizerStochasticGradientDescent{ + NNOptimizer: NNOptimizerFrom(ptr), + } +} + +func (n_ NNOptimizerStochasticGradientDescent) InitWithDeviceLearningRate(device metal.PDevice, learningRate float64) NNOptimizerStochasticGradientDescent { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerStochasticGradientDescent](n_, objc.Sel("initWithDevice:learningRate:"), po0, learningRate) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerstochasticgradientdescent/2966741-initwithdevice?language=objc +func NewNNOptimizerStochasticGradientDescentWithDeviceLearningRate(device metal.PDevice, learningRate float64) NNOptimizerStochasticGradientDescent { + instance := NNOptimizerStochasticGradientDescentClass.Alloc().InitWithDeviceLearningRate(device, learningRate) + instance.Autorelease() + return instance +} + +func (nc _NNOptimizerStochasticGradientDescentClass) Alloc() NNOptimizerStochasticGradientDescent { + rv := objc.Call[NNOptimizerStochasticGradientDescent](nc, objc.Sel("alloc")) + return rv +} + +func NNOptimizerStochasticGradientDescent_Alloc() NNOptimizerStochasticGradientDescent { + return NNOptimizerStochasticGradientDescentClass.Alloc() +} + +func (nc _NNOptimizerStochasticGradientDescentClass) New() NNOptimizerStochasticGradientDescent { + rv := objc.Call[NNOptimizerStochasticGradientDescent](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNOptimizerStochasticGradientDescent() NNOptimizerStochasticGradientDescent { + return NNOptimizerStochasticGradientDescentClass.New() +} + +func (n_ NNOptimizerStochasticGradientDescent) Init() NNOptimizerStochasticGradientDescent { + rv := objc.Call[NNOptimizerStochasticGradientDescent](n_, objc.Sel("init")) + return rv +} + +func (n_ NNOptimizerStochasticGradientDescent) InitWithDevice(device metal.PDevice) NNOptimizerStochasticGradientDescent { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerStochasticGradientDescent](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewNNOptimizerStochasticGradientDescentWithDevice(device metal.PDevice) NNOptimizerStochasticGradientDescent { + instance := NNOptimizerStochasticGradientDescentClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNOptimizerStochasticGradientDescent) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizerStochasticGradientDescent { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNOptimizerStochasticGradientDescent](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNOptimizerStochasticGradientDescent_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNOptimizerStochasticGradientDescent { + instance := NNOptimizerStochasticGradientDescentClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerstochasticgradientdescent/3197828-encodetocommandbuffer?language=objc +func (n_ NNOptimizerStochasticGradientDescent) EncodeToCommandBufferInputGradientMatrixInputValuesMatrixInputMomentumMatrixResultValuesMatrix(commandBuffer metal.PCommandBuffer, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, resultValuesMatrix IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:inputGradientMatrix:inputValuesMatrix:inputMomentumMatrix:resultValuesMatrix:"), po0, objc.Ptr(inputGradientMatrix), objc.Ptr(inputValuesMatrix), objc.Ptr(inputMomentumMatrix), objc.Ptr(resultValuesMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerstochasticgradientdescent/3197828-encodetocommandbuffer?language=objc +func (n_ NNOptimizerStochasticGradientDescent) EncodeToCommandBufferObjectInputGradientMatrixInputValuesMatrixInputMomentumMatrixResultValuesMatrix(commandBufferObject objc.IObject, inputGradientMatrix IMatrix, inputValuesMatrix IMatrix, inputMomentumMatrix IMatrix, resultValuesMatrix IMatrix) { + objc.Call[objc.Void](n_, objc.Sel("encodeToCommandBuffer:inputGradientMatrix:inputValuesMatrix:inputMomentumMatrix:resultValuesMatrix:"), objc.Ptr(commandBufferObject), objc.Ptr(inputGradientMatrix), objc.Ptr(inputValuesMatrix), objc.Ptr(inputMomentumMatrix), objc.Ptr(resultValuesMatrix)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerstochasticgradientdescent/3675592-usenesterovmomentum?language=objc +func (n_ NNOptimizerStochasticGradientDescent) UseNesterovMomentum() bool { + rv := objc.Call[bool](n_, objc.Sel("useNesterovMomentum")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerstochasticgradientdescent/2966743-momentumscale?language=objc +func (n_ NNOptimizerStochasticGradientDescent) MomentumScale() float64 { + rv := objc.Call[float64](n_, objc.Sel("momentumScale")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnoptimizerstochasticgradientdescent/2966744-usenestrovmomentum?language=objc +func (n_ NNOptimizerStochasticGradientDescent) UseNestrovMomentum() bool { + rv := objc.Call[bool](n_, objc.Sel("useNestrovMomentum")) + return rv +} diff --git a/macos/mps/nn_pad.gen.go b/macos/mps/nn_pad.gen.go new file mode 100644 index 00000000..3de1bf0a --- /dev/null +++ b/macos/mps/nn_pad.gen.go @@ -0,0 +1,141 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNPad] class. +var NNPadClass = _NNPadClass{objc.GetClass("MPSNNPad")} + +type _NNPadClass struct { + objc.Class +} + +// An interface definition for the [NNPad] class. +type INNPad interface { + ICNNKernel + PaddingSizeBefore() ImageCoordinate + SetPaddingSizeBefore(value ImageCoordinate) + PaddingSizeAfter() ImageCoordinate + SetPaddingSizeAfter(value ImageCoordinate) + FillValue() float64 + SetFillValue(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad?language=objc +type NNPad struct { + CNNKernel +} + +func NNPadFrom(ptr unsafe.Pointer) NNPad { + return NNPad{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNPad) InitWithDevice(device metal.PDevice) NNPad { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNPad](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad/3037429-initwithdevice?language=objc +func NewNNPadWithDevice(device metal.PDevice) NNPad { + instance := NNPadClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNPadClass) Alloc() NNPad { + rv := objc.Call[NNPad](nc, objc.Sel("alloc")) + return rv +} + +func NNPad_Alloc() NNPad { + return NNPadClass.Alloc() +} + +func (nc _NNPadClass) New() NNPad { + rv := objc.Call[NNPad](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNPad() NNPad { + return NNPadClass.New() +} + +func (n_ NNPad) Init() NNPad { + rv := objc.Call[NNPad](n_, objc.Sel("init")) + return rv +} + +func (n_ NNPad) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNPad { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNPad](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNPad_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNPad { + instance := NNPadClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad/3037433-paddingsizebefore?language=objc +func (n_ NNPad) PaddingSizeBefore() ImageCoordinate { + rv := objc.Call[ImageCoordinate](n_, objc.Sel("paddingSizeBefore")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad/3037433-paddingsizebefore?language=objc +func (n_ NNPad) SetPaddingSizeBefore(value ImageCoordinate) { + objc.Call[objc.Void](n_, objc.Sel("setPaddingSizeBefore:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad/3037432-paddingsizeafter?language=objc +func (n_ NNPad) PaddingSizeAfter() ImageCoordinate { + rv := objc.Call[ImageCoordinate](n_, objc.Sel("paddingSizeAfter")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad/3037432-paddingsizeafter?language=objc +func (n_ NNPad) SetPaddingSizeAfter(value ImageCoordinate) { + objc.Call[objc.Void](n_, objc.Sel("setPaddingSizeAfter:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad/3037427-fillvalue?language=objc +func (n_ NNPad) FillValue() float64 { + rv := objc.Call[float64](n_, objc.Sel("fillValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpad/3037427-fillvalue?language=objc +func (n_ NNPad) SetFillValue(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setFillValue:"), value) +} diff --git a/macos/mps/nn_pad_gradient.gen.go b/macos/mps/nn_pad_gradient.gen.go new file mode 100644 index 00000000..2652cc19 --- /dev/null +++ b/macos/mps/nn_pad_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNPadGradient] class. +var NNPadGradientClass = _NNPadGradientClass{objc.GetClass("MPSNNPadGradient")} + +type _NNPadGradientClass struct { + objc.Class +} + +// An interface definition for the [NNPadGradient] class. +type INNPadGradient interface { + ICNNGradientKernel +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadgradient?language=objc +type NNPadGradient struct { + CNNGradientKernel +} + +func NNPadGradientFrom(ptr unsafe.Pointer) NNPadGradient { + return NNPadGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (n_ NNPadGradient) InitWithDevice(device metal.PDevice) NNPadGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNPadGradient](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadgradient/3037436-initwithdevice?language=objc +func NewNNPadGradientWithDevice(device metal.PDevice) NNPadGradient { + instance := NNPadGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNPadGradientClass) Alloc() NNPadGradient { + rv := objc.Call[NNPadGradient](nc, objc.Sel("alloc")) + return rv +} + +func NNPadGradient_Alloc() NNPadGradient { + return NNPadGradientClass.Alloc() +} + +func (nc _NNPadGradientClass) New() NNPadGradient { + rv := objc.Call[NNPadGradient](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNPadGradient() NNPadGradient { + return NNPadGradientClass.New() +} + +func (n_ NNPadGradient) Init() NNPadGradient { + rv := objc.Call[NNPadGradient](n_, objc.Sel("init")) + return rv +} + +func (n_ NNPadGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNPadGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNPadGradient](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNPadGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNPadGradient { + instance := NNPadGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_pad_gradient_node.gen.go b/macos/mps/nn_pad_gradient_node.gen.go new file mode 100644 index 00000000..e6ed16f4 --- /dev/null +++ b/macos/mps/nn_pad_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNPadGradientNode] class. +var NNPadGradientNodeClass = _NNPadGradientNodeClass{objc.GetClass("MPSNNPadGradientNode")} + +type _NNPadGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNPadGradientNode] class. +type INNPadGradientNode interface { + INNGradientFilterNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadgradientnode?language=objc +type NNPadGradientNode struct { + NNGradientFilterNode +} + +func NNPadGradientNodeFrom(ptr unsafe.Pointer) NNPadGradientNode { + return NNPadGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (n_ NNPadGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNPadGradientNode { + rv := objc.Call[NNPadGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadgradientnode/3037391-initwithsourcegradient?language=objc +func NewNNPadGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNPadGradientNode { + instance := NNPadGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (nc _NNPadGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNPadGradientNode { + rv := objc.Call[NNPadGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadgradientnode/3037392-nodewithsourcegradient?language=objc +func NNPadGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNPadGradientNode { + return NNPadGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (nc _NNPadGradientNodeClass) Alloc() NNPadGradientNode { + rv := objc.Call[NNPadGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNPadGradientNode_Alloc() NNPadGradientNode { + return NNPadGradientNodeClass.Alloc() +} + +func (nc _NNPadGradientNodeClass) New() NNPadGradientNode { + rv := objc.Call[NNPadGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNPadGradientNode() NNPadGradientNode { + return NNPadGradientNodeClass.New() +} + +func (n_ NNPadGradientNode) Init() NNPadGradientNode { + rv := objc.Call[NNPadGradientNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_pad_node.gen.go b/macos/mps/nn_pad_node.gen.go new file mode 100644 index 00000000..0e9a159d --- /dev/null +++ b/macos/mps/nn_pad_node.gen.go @@ -0,0 +1,101 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNPadNode] class. +var NNPadNodeClass = _NNPadNodeClass{objc.GetClass("MPSNNPadNode")} + +type _NNPadNodeClass struct { + objc.Class +} + +// An interface definition for the [NNPadNode] class. +type INNPadNode interface { + INNFilterNode + FillValue() float64 + SetFillValue(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadnode?language=objc +type NNPadNode struct { + NNFilterNode +} + +func NNPadNodeFrom(ptr unsafe.Pointer) NNPadNode { + return NNPadNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNPadNodeClass) NodeWithSourcePaddingSizeBeforePaddingSizeAfterEdgeMode(source INNImageNode, paddingSizeBefore ImageCoordinate, paddingSizeAfter ImageCoordinate, edgeMode ImageEdgeMode) NNPadNode { + rv := objc.Call[NNPadNode](nc, objc.Sel("nodeWithSource:paddingSizeBefore:paddingSizeAfter:edgeMode:"), objc.Ptr(source), paddingSizeBefore, paddingSizeAfter, edgeMode) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadnode/3037396-nodewithsource?language=objc +func NNPadNode_NodeWithSourcePaddingSizeBeforePaddingSizeAfterEdgeMode(source INNImageNode, paddingSizeBefore ImageCoordinate, paddingSizeAfter ImageCoordinate, edgeMode ImageEdgeMode) NNPadNode { + return NNPadNodeClass.NodeWithSourcePaddingSizeBeforePaddingSizeAfterEdgeMode(source, paddingSizeBefore, paddingSizeAfter, edgeMode) +} + +func (n_ NNPadNode) InitWithSourcePaddingSizeBeforePaddingSizeAfterEdgeMode(source INNImageNode, paddingSizeBefore ImageCoordinate, paddingSizeAfter ImageCoordinate, edgeMode ImageEdgeMode) NNPadNode { + rv := objc.Call[NNPadNode](n_, objc.Sel("initWithSource:paddingSizeBefore:paddingSizeAfter:edgeMode:"), objc.Ptr(source), paddingSizeBefore, paddingSizeAfter, edgeMode) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadnode/3037395-initwithsource?language=objc +func NewNNPadNodeWithSourcePaddingSizeBeforePaddingSizeAfterEdgeMode(source INNImageNode, paddingSizeBefore ImageCoordinate, paddingSizeAfter ImageCoordinate, edgeMode ImageEdgeMode) NNPadNode { + instance := NNPadNodeClass.Alloc().InitWithSourcePaddingSizeBeforePaddingSizeAfterEdgeMode(source, paddingSizeBefore, paddingSizeAfter, edgeMode) + instance.Autorelease() + return instance +} + +func (nc _NNPadNodeClass) Alloc() NNPadNode { + rv := objc.Call[NNPadNode](nc, objc.Sel("alloc")) + return rv +} + +func NNPadNode_Alloc() NNPadNode { + return NNPadNodeClass.Alloc() +} + +func (nc _NNPadNodeClass) New() NNPadNode { + rv := objc.Call[NNPadNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNPadNode() NNPadNode { + return NNPadNodeClass.New() +} + +func (n_ NNPadNode) Init() NNPadNode { + rv := objc.Call[NNPadNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadnode/3037394-fillvalue?language=objc +func (n_ NNPadNode) FillValue() float64 { + rv := objc.Call[float64](n_, objc.Sel("fillValue")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadnode/3037394-fillvalue?language=objc +func (n_ NNPadNode) SetFillValue(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setFillValue:"), value) +} diff --git a/macos/mps/nn_padding.gen.go b/macos/mps/nn_padding.gen.go new file mode 100644 index 00000000..5e82ed8c --- /dev/null +++ b/macos/mps/nn_padding.gen.go @@ -0,0 +1,81 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/objc" +) + +// The protocol that provides a description of how kernels should pad images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadding?language=objc +type PNNPadding interface { + // optional + DestinationImageDescriptorForSourceImagesSourceStatesForKernelSuggestedDescriptor(sourceImages []Image, sourceStates []State, kernel Kernel, inDescriptor ImageDescriptor) IImageDescriptor + HasDestinationImageDescriptorForSourceImagesSourceStatesForKernelSuggestedDescriptor() bool + + // optional + PaddingMethod() NNPaddingMethod + HasPaddingMethod() bool + + // optional + Inverse() objc.IObject + HasInverse() bool + + // optional + Label() string + HasLabel() bool +} + +// A concrete type wrapper for the [PNNPadding] protocol. +type NNPaddingWrapper struct { + objc.Object +} + +func (n_ NNPaddingWrapper) HasDestinationImageDescriptorForSourceImagesSourceStatesForKernelSuggestedDescriptor() bool { + return n_.RespondsToSelector(objc.Sel("destinationImageDescriptorForSourceImages:sourceStates:forKernel:suggestedDescriptor:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadding/2867167-destinationimagedescriptorforsou?language=objc +func (n_ NNPaddingWrapper) DestinationImageDescriptorForSourceImagesSourceStatesForKernelSuggestedDescriptor(sourceImages []IImage, sourceStates []IState, kernel IKernel, inDescriptor IImageDescriptor) ImageDescriptor { + rv := objc.Call[ImageDescriptor](n_, objc.Sel("destinationImageDescriptorForSourceImages:sourceStates:forKernel:suggestedDescriptor:"), sourceImages, sourceStates, objc.Ptr(kernel), objc.Ptr(inDescriptor)) + return rv +} + +func (n_ NNPaddingWrapper) HasPaddingMethod() bool { + return n_.RespondsToSelector(objc.Sel("paddingMethod")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadding/2866950-paddingmethod?language=objc +func (n_ NNPaddingWrapper) PaddingMethod() NNPaddingMethod { + rv := objc.Call[NNPaddingMethod](n_, objc.Sel("paddingMethod")) + return rv +} + +func (n_ NNPaddingWrapper) HasInverse() bool { + return n_.RespondsToSelector(objc.Sel("inverse")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadding/2942456-inverse?language=objc +func (n_ NNPaddingWrapper) Inverse() objc.Object { + rv := objc.Call[objc.Object](n_, objc.Sel("inverse")) + return rv +} + +func (n_ NNPaddingWrapper) HasLabel() bool { + return n_.RespondsToSelector(objc.Sel("label")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnpadding/2889870-label?language=objc +func (n_ NNPaddingWrapper) Label() string { + rv := objc.Call[string](n_, objc.Sel("label")) + return rv +} diff --git a/macos/mps/nn_reduce_binary.gen.go b/macos/mps/nn_reduce_binary.gen.go new file mode 100644 index 00000000..c4d286af --- /dev/null +++ b/macos/mps/nn_reduce_binary.gen.go @@ -0,0 +1,124 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceBinary] class. +var NNReduceBinaryClass = _NNReduceBinaryClass{objc.GetClass("MPSNNReduceBinary")} + +type _NNReduceBinaryClass struct { + objc.Class +} + +// An interface definition for the [NNReduceBinary] class. +type INNReduceBinary interface { + ICNNBinaryKernel + PrimarySourceClipRect() metal.Region + SetPrimarySourceClipRect(value metal.Region) + SecondarySourceClipRect() metal.Region + SetSecondarySourceClipRect(value metal.Region) +} + +// The base class for binary reduction filters. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducebinary?language=objc +type NNReduceBinary struct { + CNNBinaryKernel +} + +func NNReduceBinaryFrom(ptr unsafe.Pointer) NNReduceBinary { + return NNReduceBinary{ + CNNBinaryKernel: CNNBinaryKernelFrom(ptr), + } +} + +func (nc _NNReduceBinaryClass) Alloc() NNReduceBinary { + rv := objc.Call[NNReduceBinary](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceBinary_Alloc() NNReduceBinary { + return NNReduceBinaryClass.Alloc() +} + +func (nc _NNReduceBinaryClass) New() NNReduceBinary { + rv := objc.Call[NNReduceBinary](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceBinary() NNReduceBinary { + return NNReduceBinaryClass.New() +} + +func (n_ NNReduceBinary) Init() NNReduceBinary { + rv := objc.Call[NNReduceBinary](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceBinary) InitWithDevice(device metal.PDevice) NNReduceBinary { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceBinary](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnbinarykernel/2865629-initwithdevice?language=objc +func NewNNReduceBinaryWithDevice(device metal.PDevice) NNReduceBinary { + instance := NNReduceBinaryClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNReduceBinary) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceBinary { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceBinary](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceBinary_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceBinary { + instance := NNReduceBinaryClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducebinary/2942561-primarysourcecliprect?language=objc +func (n_ NNReduceBinary) PrimarySourceClipRect() metal.Region { + rv := objc.Call[metal.Region](n_, objc.Sel("primarySourceClipRect")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducebinary/2942561-primarysourcecliprect?language=objc +func (n_ NNReduceBinary) SetPrimarySourceClipRect(value metal.Region) { + objc.Call[objc.Void](n_, objc.Sel("setPrimarySourceClipRect:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducebinary/2942556-secondarysourcecliprect?language=objc +func (n_ NNReduceBinary) SecondarySourceClipRect() metal.Region { + rv := objc.Call[metal.Region](n_, objc.Sel("secondarySourceClipRect")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducebinary/2942556-secondarysourcecliprect?language=objc +func (n_ NNReduceBinary) SetSecondarySourceClipRect(value metal.Region) { + objc.Call[objc.Void](n_, objc.Sel("setSecondarySourceClipRect:"), value) +} diff --git a/macos/mps/nn_reduce_column_max.gen.go b/macos/mps/nn_reduce_column_max.gen.go new file mode 100644 index 00000000..8c96f96d --- /dev/null +++ b/macos/mps/nn_reduce_column_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceColumnMax] class. +var NNReduceColumnMaxClass = _NNReduceColumnMaxClass{objc.GetClass("MPSNNReduceColumnMax")} + +type _NNReduceColumnMaxClass struct { + objc.Class +} + +// An interface definition for the [NNReduceColumnMax] class. +type INNReduceColumnMax interface { + INNReduceUnary +} + +// A reduction filter that returns the maximum value for each column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmax?language=objc +type NNReduceColumnMax struct { + NNReduceUnary +} + +func NNReduceColumnMaxFrom(ptr unsafe.Pointer) NNReduceColumnMax { + return NNReduceColumnMax{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceColumnMax) InitWithDevice(device metal.PDevice) NNReduceColumnMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnMax](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmax/2942541-initwithdevice?language=objc +func NewNNReduceColumnMaxWithDevice(device metal.PDevice) NNReduceColumnMax { + instance := NNReduceColumnMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceColumnMaxClass) Alloc() NNReduceColumnMax { + rv := objc.Call[NNReduceColumnMax](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceColumnMax_Alloc() NNReduceColumnMax { + return NNReduceColumnMaxClass.Alloc() +} + +func (nc _NNReduceColumnMaxClass) New() NNReduceColumnMax { + rv := objc.Call[NNReduceColumnMax](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceColumnMax() NNReduceColumnMax { + return NNReduceColumnMaxClass.New() +} + +func (n_ NNReduceColumnMax) Init() NNReduceColumnMax { + rv := objc.Call[NNReduceColumnMax](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceColumnMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnMax](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceColumnMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnMax { + instance := NNReduceColumnMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_column_mean.gen.go b/macos/mps/nn_reduce_column_mean.gen.go new file mode 100644 index 00000000..eb4bce3b --- /dev/null +++ b/macos/mps/nn_reduce_column_mean.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceColumnMean] class. +var NNReduceColumnMeanClass = _NNReduceColumnMeanClass{objc.GetClass("MPSNNReduceColumnMean")} + +type _NNReduceColumnMeanClass struct { + objc.Class +} + +// An interface definition for the [NNReduceColumnMean] class. +type INNReduceColumnMean interface { + INNReduceUnary +} + +// A reduction filter that returns the mean value for each column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmean?language=objc +type NNReduceColumnMean struct { + NNReduceUnary +} + +func NNReduceColumnMeanFrom(ptr unsafe.Pointer) NNReduceColumnMean { + return NNReduceColumnMean{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceColumnMean) InitWithDevice(device metal.PDevice) NNReduceColumnMean { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnMean](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmean/2942546-initwithdevice?language=objc +func NewNNReduceColumnMeanWithDevice(device metal.PDevice) NNReduceColumnMean { + instance := NNReduceColumnMeanClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceColumnMeanClass) Alloc() NNReduceColumnMean { + rv := objc.Call[NNReduceColumnMean](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceColumnMean_Alloc() NNReduceColumnMean { + return NNReduceColumnMeanClass.Alloc() +} + +func (nc _NNReduceColumnMeanClass) New() NNReduceColumnMean { + rv := objc.Call[NNReduceColumnMean](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceColumnMean() NNReduceColumnMean { + return NNReduceColumnMeanClass.New() +} + +func (n_ NNReduceColumnMean) Init() NNReduceColumnMean { + rv := objc.Call[NNReduceColumnMean](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceColumnMean) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnMean { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnMean](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceColumnMean_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnMean { + instance := NNReduceColumnMeanClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_column_min.gen.go b/macos/mps/nn_reduce_column_min.gen.go new file mode 100644 index 00000000..96ced084 --- /dev/null +++ b/macos/mps/nn_reduce_column_min.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceColumnMin] class. +var NNReduceColumnMinClass = _NNReduceColumnMinClass{objc.GetClass("MPSNNReduceColumnMin")} + +type _NNReduceColumnMinClass struct { + objc.Class +} + +// An interface definition for the [NNReduceColumnMin] class. +type INNReduceColumnMin interface { + INNReduceUnary +} + +// A reduction filter that returns the minimum value for each column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmin?language=objc +type NNReduceColumnMin struct { + NNReduceUnary +} + +func NNReduceColumnMinFrom(ptr unsafe.Pointer) NNReduceColumnMin { + return NNReduceColumnMin{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceColumnMin) InitWithDevice(device metal.PDevice) NNReduceColumnMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnMin](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmin/2942542-initwithdevice?language=objc +func NewNNReduceColumnMinWithDevice(device metal.PDevice) NNReduceColumnMin { + instance := NNReduceColumnMinClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceColumnMinClass) Alloc() NNReduceColumnMin { + rv := objc.Call[NNReduceColumnMin](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceColumnMin_Alloc() NNReduceColumnMin { + return NNReduceColumnMinClass.Alloc() +} + +func (nc _NNReduceColumnMinClass) New() NNReduceColumnMin { + rv := objc.Call[NNReduceColumnMin](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceColumnMin() NNReduceColumnMin { + return NNReduceColumnMinClass.New() +} + +func (n_ NNReduceColumnMin) Init() NNReduceColumnMin { + rv := objc.Call[NNReduceColumnMin](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceColumnMin) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnMin { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnMin](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceColumnMin_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnMin { + instance := NNReduceColumnMinClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_column_sum.gen.go b/macos/mps/nn_reduce_column_sum.gen.go new file mode 100644 index 00000000..e97cd573 --- /dev/null +++ b/macos/mps/nn_reduce_column_sum.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceColumnSum] class. +var NNReduceColumnSumClass = _NNReduceColumnSumClass{objc.GetClass("MPSNNReduceColumnSum")} + +type _NNReduceColumnSumClass struct { + objc.Class +} + +// An interface definition for the [NNReduceColumnSum] class. +type INNReduceColumnSum interface { + INNReduceUnary +} + +// A reduction filter that returns the sum of all values for each column in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnsum?language=objc +type NNReduceColumnSum struct { + NNReduceUnary +} + +func NNReduceColumnSumFrom(ptr unsafe.Pointer) NNReduceColumnSum { + return NNReduceColumnSum{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceColumnSum) InitWithDevice(device metal.PDevice) NNReduceColumnSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnSum](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnsum/2942540-initwithdevice?language=objc +func NewNNReduceColumnSumWithDevice(device metal.PDevice) NNReduceColumnSum { + instance := NNReduceColumnSumClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceColumnSumClass) Alloc() NNReduceColumnSum { + rv := objc.Call[NNReduceColumnSum](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceColumnSum_Alloc() NNReduceColumnSum { + return NNReduceColumnSumClass.Alloc() +} + +func (nc _NNReduceColumnSumClass) New() NNReduceColumnSum { + rv := objc.Call[NNReduceColumnSum](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceColumnSum() NNReduceColumnSum { + return NNReduceColumnSumClass.New() +} + +func (n_ NNReduceColumnSum) Init() NNReduceColumnSum { + rv := objc.Call[NNReduceColumnSum](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceColumnSum) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnSum { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceColumnSum](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceColumnSum_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceColumnSum { + instance := NNReduceColumnSumClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_feature_channels_and_weights_mean.gen.go b/macos/mps/nn_reduce_feature_channels_and_weights_mean.gen.go new file mode 100644 index 00000000..288b547d --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_and_weights_mean.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsAndWeightsMean] class. +var NNReduceFeatureChannelsAndWeightsMeanClass = _NNReduceFeatureChannelsAndWeightsMeanClass{objc.GetClass("MPSNNReduceFeatureChannelsAndWeightsMean")} + +type _NNReduceFeatureChannelsAndWeightsMeanClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsAndWeightsMean] class. +type INNReduceFeatureChannelsAndWeightsMean interface { + INNReduceBinary +} + +// A reduction filter that returns the weighted sum for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsandweightsmean?language=objc +type NNReduceFeatureChannelsAndWeightsMean struct { + NNReduceBinary +} + +func NNReduceFeatureChannelsAndWeightsMeanFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsAndWeightsMean { + return NNReduceFeatureChannelsAndWeightsMean{ + NNReduceBinary: NNReduceBinaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsAndWeightsMean) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsAndWeightsMean { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsAndWeightsMean](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsandweightsmean/2942537-initwithdevice?language=objc +func NewNNReduceFeatureChannelsAndWeightsMeanWithDevice(device metal.PDevice) NNReduceFeatureChannelsAndWeightsMean { + instance := NNReduceFeatureChannelsAndWeightsMeanClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsAndWeightsMeanClass) Alloc() NNReduceFeatureChannelsAndWeightsMean { + rv := objc.Call[NNReduceFeatureChannelsAndWeightsMean](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsAndWeightsMean_Alloc() NNReduceFeatureChannelsAndWeightsMean { + return NNReduceFeatureChannelsAndWeightsMeanClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsAndWeightsMeanClass) New() NNReduceFeatureChannelsAndWeightsMean { + rv := objc.Call[NNReduceFeatureChannelsAndWeightsMean](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsAndWeightsMean() NNReduceFeatureChannelsAndWeightsMean { + return NNReduceFeatureChannelsAndWeightsMeanClass.New() +} + +func (n_ NNReduceFeatureChannelsAndWeightsMean) Init() NNReduceFeatureChannelsAndWeightsMean { + rv := objc.Call[NNReduceFeatureChannelsAndWeightsMean](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsAndWeightsMean) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsAndWeightsMean { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsAndWeightsMean](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsAndWeightsMean_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsAndWeightsMean { + instance := NNReduceFeatureChannelsAndWeightsMeanClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_feature_channels_and_weights_sum.gen.go b/macos/mps/nn_reduce_feature_channels_and_weights_sum.gen.go new file mode 100644 index 00000000..b07b0ab3 --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_and_weights_sum.gen.go @@ -0,0 +1,99 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsAndWeightsSum] class. +var NNReduceFeatureChannelsAndWeightsSumClass = _NNReduceFeatureChannelsAndWeightsSumClass{objc.GetClass("MPSNNReduceFeatureChannelsAndWeightsSum")} + +type _NNReduceFeatureChannelsAndWeightsSumClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsAndWeightsSum] class. +type INNReduceFeatureChannelsAndWeightsSum interface { + INNReduceBinary + DoWeightedSumByNonZeroWeights() bool +} + +// A reduction filter that returns the weighted sum of all values for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsandweightssum?language=objc +type NNReduceFeatureChannelsAndWeightsSum struct { + NNReduceBinary +} + +func NNReduceFeatureChannelsAndWeightsSumFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsAndWeightsSum { + return NNReduceFeatureChannelsAndWeightsSum{ + NNReduceBinary: NNReduceBinaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsAndWeightsSum) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsAndWeightsSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsAndWeightsSum](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsandweightssum/2942562-initwithdevice?language=objc +func NewNNReduceFeatureChannelsAndWeightsSumWithDevice(device metal.PDevice) NNReduceFeatureChannelsAndWeightsSum { + instance := NNReduceFeatureChannelsAndWeightsSumClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsAndWeightsSumClass) Alloc() NNReduceFeatureChannelsAndWeightsSum { + rv := objc.Call[NNReduceFeatureChannelsAndWeightsSum](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsAndWeightsSum_Alloc() NNReduceFeatureChannelsAndWeightsSum { + return NNReduceFeatureChannelsAndWeightsSumClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsAndWeightsSumClass) New() NNReduceFeatureChannelsAndWeightsSum { + rv := objc.Call[NNReduceFeatureChannelsAndWeightsSum](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsAndWeightsSum() NNReduceFeatureChannelsAndWeightsSum { + return NNReduceFeatureChannelsAndWeightsSumClass.New() +} + +func (n_ NNReduceFeatureChannelsAndWeightsSum) Init() NNReduceFeatureChannelsAndWeightsSum { + rv := objc.Call[NNReduceFeatureChannelsAndWeightsSum](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsAndWeightsSum) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsAndWeightsSum { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsAndWeightsSum](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsAndWeightsSum_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsAndWeightsSum { + instance := NNReduceFeatureChannelsAndWeightsSumClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsandweightssum/2942543-doweightedsumbynonzeroweights?language=objc +func (n_ NNReduceFeatureChannelsAndWeightsSum) DoWeightedSumByNonZeroWeights() bool { + rv := objc.Call[bool](n_, objc.Sel("doWeightedSumByNonZeroWeights")) + return rv +} diff --git a/macos/mps/nn_reduce_feature_channels_argument_max.gen.go b/macos/mps/nn_reduce_feature_channels_argument_max.gen.go new file mode 100644 index 00000000..1672f096 --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_argument_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsArgumentMax] class. +var NNReduceFeatureChannelsArgumentMaxClass = _NNReduceFeatureChannelsArgumentMaxClass{objc.GetClass("MPSNNReduceFeatureChannelsArgumentMax")} + +type _NNReduceFeatureChannelsArgumentMaxClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsArgumentMax] class. +type INNReduceFeatureChannelsArgumentMax interface { + INNReduceUnary +} + +// A reduction filter that returns the index of the location of the maximum value for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsargumentmax?language=objc +type NNReduceFeatureChannelsArgumentMax struct { + NNReduceUnary +} + +func NNReduceFeatureChannelsArgumentMaxFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsArgumentMax { + return NNReduceFeatureChannelsArgumentMax{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsArgumentMax) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsArgumentMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsArgumentMax](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsargumentmax/2976518-initwithdevice?language=objc +func NewNNReduceFeatureChannelsArgumentMaxWithDevice(device metal.PDevice) NNReduceFeatureChannelsArgumentMax { + instance := NNReduceFeatureChannelsArgumentMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsArgumentMaxClass) Alloc() NNReduceFeatureChannelsArgumentMax { + rv := objc.Call[NNReduceFeatureChannelsArgumentMax](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsArgumentMax_Alloc() NNReduceFeatureChannelsArgumentMax { + return NNReduceFeatureChannelsArgumentMaxClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsArgumentMaxClass) New() NNReduceFeatureChannelsArgumentMax { + rv := objc.Call[NNReduceFeatureChannelsArgumentMax](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsArgumentMax() NNReduceFeatureChannelsArgumentMax { + return NNReduceFeatureChannelsArgumentMaxClass.New() +} + +func (n_ NNReduceFeatureChannelsArgumentMax) Init() NNReduceFeatureChannelsArgumentMax { + rv := objc.Call[NNReduceFeatureChannelsArgumentMax](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsArgumentMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsArgumentMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsArgumentMax](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsArgumentMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsArgumentMax { + instance := NNReduceFeatureChannelsArgumentMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_feature_channels_argument_min.gen.go b/macos/mps/nn_reduce_feature_channels_argument_min.gen.go new file mode 100644 index 00000000..53d23dde --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_argument_min.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsArgumentMin] class. +var NNReduceFeatureChannelsArgumentMinClass = _NNReduceFeatureChannelsArgumentMinClass{objc.GetClass("MPSNNReduceFeatureChannelsArgumentMin")} + +type _NNReduceFeatureChannelsArgumentMinClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsArgumentMin] class. +type INNReduceFeatureChannelsArgumentMin interface { + INNReduceUnary +} + +// A reduction filter that returns the index of the location of the minimum value for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsargumentmin?language=objc +type NNReduceFeatureChannelsArgumentMin struct { + NNReduceUnary +} + +func NNReduceFeatureChannelsArgumentMinFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsArgumentMin { + return NNReduceFeatureChannelsArgumentMin{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsArgumentMin) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsArgumentMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsArgumentMin](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsargumentmin/2976520-initwithdevice?language=objc +func NewNNReduceFeatureChannelsArgumentMinWithDevice(device metal.PDevice) NNReduceFeatureChannelsArgumentMin { + instance := NNReduceFeatureChannelsArgumentMinClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsArgumentMinClass) Alloc() NNReduceFeatureChannelsArgumentMin { + rv := objc.Call[NNReduceFeatureChannelsArgumentMin](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsArgumentMin_Alloc() NNReduceFeatureChannelsArgumentMin { + return NNReduceFeatureChannelsArgumentMinClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsArgumentMinClass) New() NNReduceFeatureChannelsArgumentMin { + rv := objc.Call[NNReduceFeatureChannelsArgumentMin](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsArgumentMin() NNReduceFeatureChannelsArgumentMin { + return NNReduceFeatureChannelsArgumentMinClass.New() +} + +func (n_ NNReduceFeatureChannelsArgumentMin) Init() NNReduceFeatureChannelsArgumentMin { + rv := objc.Call[NNReduceFeatureChannelsArgumentMin](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsArgumentMin) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsArgumentMin { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsArgumentMin](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsArgumentMin_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsArgumentMin { + instance := NNReduceFeatureChannelsArgumentMinClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_feature_channels_max.gen.go b/macos/mps/nn_reduce_feature_channels_max.gen.go new file mode 100644 index 00000000..9fa36ba9 --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsMax] class. +var NNReduceFeatureChannelsMaxClass = _NNReduceFeatureChannelsMaxClass{objc.GetClass("MPSNNReduceFeatureChannelsMax")} + +type _NNReduceFeatureChannelsMaxClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsMax] class. +type INNReduceFeatureChannelsMax interface { + INNReduceUnary +} + +// A reduction filter that returns the maximum value for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmax?language=objc +type NNReduceFeatureChannelsMax struct { + NNReduceUnary +} + +func NNReduceFeatureChannelsMaxFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsMax { + return NNReduceFeatureChannelsMax{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsMax) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsMax](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmax/2942532-initwithdevice?language=objc +func NewNNReduceFeatureChannelsMaxWithDevice(device metal.PDevice) NNReduceFeatureChannelsMax { + instance := NNReduceFeatureChannelsMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsMaxClass) Alloc() NNReduceFeatureChannelsMax { + rv := objc.Call[NNReduceFeatureChannelsMax](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsMax_Alloc() NNReduceFeatureChannelsMax { + return NNReduceFeatureChannelsMaxClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsMaxClass) New() NNReduceFeatureChannelsMax { + rv := objc.Call[NNReduceFeatureChannelsMax](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsMax() NNReduceFeatureChannelsMax { + return NNReduceFeatureChannelsMaxClass.New() +} + +func (n_ NNReduceFeatureChannelsMax) Init() NNReduceFeatureChannelsMax { + rv := objc.Call[NNReduceFeatureChannelsMax](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsMax](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsMax { + instance := NNReduceFeatureChannelsMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_feature_channels_mean.gen.go b/macos/mps/nn_reduce_feature_channels_mean.gen.go new file mode 100644 index 00000000..ff40f646 --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_mean.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsMean] class. +var NNReduceFeatureChannelsMeanClass = _NNReduceFeatureChannelsMeanClass{objc.GetClass("MPSNNReduceFeatureChannelsMean")} + +type _NNReduceFeatureChannelsMeanClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsMean] class. +type INNReduceFeatureChannelsMean interface { + INNReduceUnary +} + +// A reduction filter that returns the mean value for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmean?language=objc +type NNReduceFeatureChannelsMean struct { + NNReduceUnary +} + +func NNReduceFeatureChannelsMeanFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsMean { + return NNReduceFeatureChannelsMean{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsMean) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsMean { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsMean](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmean/2942557-initwithdevice?language=objc +func NewNNReduceFeatureChannelsMeanWithDevice(device metal.PDevice) NNReduceFeatureChannelsMean { + instance := NNReduceFeatureChannelsMeanClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsMeanClass) Alloc() NNReduceFeatureChannelsMean { + rv := objc.Call[NNReduceFeatureChannelsMean](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsMean_Alloc() NNReduceFeatureChannelsMean { + return NNReduceFeatureChannelsMeanClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsMeanClass) New() NNReduceFeatureChannelsMean { + rv := objc.Call[NNReduceFeatureChannelsMean](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsMean() NNReduceFeatureChannelsMean { + return NNReduceFeatureChannelsMeanClass.New() +} + +func (n_ NNReduceFeatureChannelsMean) Init() NNReduceFeatureChannelsMean { + rv := objc.Call[NNReduceFeatureChannelsMean](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsMean) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsMean { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsMean](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsMean_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsMean { + instance := NNReduceFeatureChannelsMeanClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_feature_channels_min.gen.go b/macos/mps/nn_reduce_feature_channels_min.gen.go new file mode 100644 index 00000000..41990c37 --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_min.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsMin] class. +var NNReduceFeatureChannelsMinClass = _NNReduceFeatureChannelsMinClass{objc.GetClass("MPSNNReduceFeatureChannelsMin")} + +type _NNReduceFeatureChannelsMinClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsMin] class. +type INNReduceFeatureChannelsMin interface { + INNReduceUnary +} + +// A reduction filter that returns the minimum value for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmin?language=objc +type NNReduceFeatureChannelsMin struct { + NNReduceUnary +} + +func NNReduceFeatureChannelsMinFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsMin { + return NNReduceFeatureChannelsMin{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsMin) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsMin](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmin/2942565-initwithdevice?language=objc +func NewNNReduceFeatureChannelsMinWithDevice(device metal.PDevice) NNReduceFeatureChannelsMin { + instance := NNReduceFeatureChannelsMinClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsMinClass) Alloc() NNReduceFeatureChannelsMin { + rv := objc.Call[NNReduceFeatureChannelsMin](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsMin_Alloc() NNReduceFeatureChannelsMin { + return NNReduceFeatureChannelsMinClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsMinClass) New() NNReduceFeatureChannelsMin { + rv := objc.Call[NNReduceFeatureChannelsMin](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsMin() NNReduceFeatureChannelsMin { + return NNReduceFeatureChannelsMinClass.New() +} + +func (n_ NNReduceFeatureChannelsMin) Init() NNReduceFeatureChannelsMin { + rv := objc.Call[NNReduceFeatureChannelsMin](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsMin) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsMin { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsMin](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsMin_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsMin { + instance := NNReduceFeatureChannelsMinClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_feature_channels_sum.gen.go b/macos/mps/nn_reduce_feature_channels_sum.gen.go new file mode 100644 index 00000000..14f4447e --- /dev/null +++ b/macos/mps/nn_reduce_feature_channels_sum.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceFeatureChannelsSum] class. +var NNReduceFeatureChannelsSumClass = _NNReduceFeatureChannelsSumClass{objc.GetClass("MPSNNReduceFeatureChannelsSum")} + +type _NNReduceFeatureChannelsSumClass struct { + objc.Class +} + +// An interface definition for the [NNReduceFeatureChannelsSum] class. +type INNReduceFeatureChannelsSum interface { + INNReduceUnary + Weight() float64 + SetWeight(value float64) +} + +// A reduction filter that returns the sum of all values for each feature channel in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelssum?language=objc +type NNReduceFeatureChannelsSum struct { + NNReduceUnary +} + +func NNReduceFeatureChannelsSumFrom(ptr unsafe.Pointer) NNReduceFeatureChannelsSum { + return NNReduceFeatureChannelsSum{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceFeatureChannelsSum) InitWithDevice(device metal.PDevice) NNReduceFeatureChannelsSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsSum](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelssum/2942538-initwithdevice?language=objc +func NewNNReduceFeatureChannelsSumWithDevice(device metal.PDevice) NNReduceFeatureChannelsSum { + instance := NNReduceFeatureChannelsSumClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceFeatureChannelsSumClass) Alloc() NNReduceFeatureChannelsSum { + rv := objc.Call[NNReduceFeatureChannelsSum](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceFeatureChannelsSum_Alloc() NNReduceFeatureChannelsSum { + return NNReduceFeatureChannelsSumClass.Alloc() +} + +func (nc _NNReduceFeatureChannelsSumClass) New() NNReduceFeatureChannelsSum { + rv := objc.Call[NNReduceFeatureChannelsSum](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceFeatureChannelsSum() NNReduceFeatureChannelsSum { + return NNReduceFeatureChannelsSumClass.New() +} + +func (n_ NNReduceFeatureChannelsSum) Init() NNReduceFeatureChannelsSum { + rv := objc.Call[NNReduceFeatureChannelsSum](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceFeatureChannelsSum) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsSum { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceFeatureChannelsSum](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceFeatureChannelsSum_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceFeatureChannelsSum { + instance := NNReduceFeatureChannelsSumClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelssum/2942545-weight?language=objc +func (n_ NNReduceFeatureChannelsSum) Weight() float64 { + rv := objc.Call[float64](n_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelssum/2942545-weight?language=objc +func (n_ NNReduceFeatureChannelsSum) SetWeight(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setWeight:"), value) +} diff --git a/macos/mps/nn_reduce_row_max.gen.go b/macos/mps/nn_reduce_row_max.gen.go new file mode 100644 index 00000000..db01d941 --- /dev/null +++ b/macos/mps/nn_reduce_row_max.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceRowMax] class. +var NNReduceRowMaxClass = _NNReduceRowMaxClass{objc.GetClass("MPSNNReduceRowMax")} + +type _NNReduceRowMaxClass struct { + objc.Class +} + +// An interface definition for the [NNReduceRowMax] class. +type INNReduceRowMax interface { + INNReduceUnary +} + +// A reduction filter that returns the maximum value for each row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmax?language=objc +type NNReduceRowMax struct { + NNReduceUnary +} + +func NNReduceRowMaxFrom(ptr unsafe.Pointer) NNReduceRowMax { + return NNReduceRowMax{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceRowMax) InitWithDevice(device metal.PDevice) NNReduceRowMax { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowMax](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmax/2942559-initwithdevice?language=objc +func NewNNReduceRowMaxWithDevice(device metal.PDevice) NNReduceRowMax { + instance := NNReduceRowMaxClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceRowMaxClass) Alloc() NNReduceRowMax { + rv := objc.Call[NNReduceRowMax](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceRowMax_Alloc() NNReduceRowMax { + return NNReduceRowMaxClass.Alloc() +} + +func (nc _NNReduceRowMaxClass) New() NNReduceRowMax { + rv := objc.Call[NNReduceRowMax](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceRowMax() NNReduceRowMax { + return NNReduceRowMaxClass.New() +} + +func (n_ NNReduceRowMax) Init() NNReduceRowMax { + rv := objc.Call[NNReduceRowMax](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceRowMax) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowMax { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowMax](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceRowMax_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowMax { + instance := NNReduceRowMaxClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_row_mean.gen.go b/macos/mps/nn_reduce_row_mean.gen.go new file mode 100644 index 00000000..c7d3faf1 --- /dev/null +++ b/macos/mps/nn_reduce_row_mean.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceRowMean] class. +var NNReduceRowMeanClass = _NNReduceRowMeanClass{objc.GetClass("MPSNNReduceRowMean")} + +type _NNReduceRowMeanClass struct { + objc.Class +} + +// An interface definition for the [NNReduceRowMean] class. +type INNReduceRowMean interface { + INNReduceUnary +} + +// A reduction filter that returns the mean value for each row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmean?language=objc +type NNReduceRowMean struct { + NNReduceUnary +} + +func NNReduceRowMeanFrom(ptr unsafe.Pointer) NNReduceRowMean { + return NNReduceRowMean{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceRowMean) InitWithDevice(device metal.PDevice) NNReduceRowMean { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowMean](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmean/2942548-initwithdevice?language=objc +func NewNNReduceRowMeanWithDevice(device metal.PDevice) NNReduceRowMean { + instance := NNReduceRowMeanClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceRowMeanClass) Alloc() NNReduceRowMean { + rv := objc.Call[NNReduceRowMean](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceRowMean_Alloc() NNReduceRowMean { + return NNReduceRowMeanClass.Alloc() +} + +func (nc _NNReduceRowMeanClass) New() NNReduceRowMean { + rv := objc.Call[NNReduceRowMean](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceRowMean() NNReduceRowMean { + return NNReduceRowMeanClass.New() +} + +func (n_ NNReduceRowMean) Init() NNReduceRowMean { + rv := objc.Call[NNReduceRowMean](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceRowMean) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowMean { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowMean](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceRowMean_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowMean { + instance := NNReduceRowMeanClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_row_min.gen.go b/macos/mps/nn_reduce_row_min.gen.go new file mode 100644 index 00000000..fc360c16 --- /dev/null +++ b/macos/mps/nn_reduce_row_min.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceRowMin] class. +var NNReduceRowMinClass = _NNReduceRowMinClass{objc.GetClass("MPSNNReduceRowMin")} + +type _NNReduceRowMinClass struct { + objc.Class +} + +// An interface definition for the [NNReduceRowMin] class. +type INNReduceRowMin interface { + INNReduceUnary +} + +// A reduction filter that returns the minimum value for each row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmin?language=objc +type NNReduceRowMin struct { + NNReduceUnary +} + +func NNReduceRowMinFrom(ptr unsafe.Pointer) NNReduceRowMin { + return NNReduceRowMin{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceRowMin) InitWithDevice(device metal.PDevice) NNReduceRowMin { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowMin](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmin/2942555-initwithdevice?language=objc +func NewNNReduceRowMinWithDevice(device metal.PDevice) NNReduceRowMin { + instance := NNReduceRowMinClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceRowMinClass) Alloc() NNReduceRowMin { + rv := objc.Call[NNReduceRowMin](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceRowMin_Alloc() NNReduceRowMin { + return NNReduceRowMinClass.Alloc() +} + +func (nc _NNReduceRowMinClass) New() NNReduceRowMin { + rv := objc.Call[NNReduceRowMin](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceRowMin() NNReduceRowMin { + return NNReduceRowMinClass.New() +} + +func (n_ NNReduceRowMin) Init() NNReduceRowMin { + rv := objc.Call[NNReduceRowMin](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceRowMin) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowMin { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowMin](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceRowMin_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowMin { + instance := NNReduceRowMinClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_row_sum.gen.go b/macos/mps/nn_reduce_row_sum.gen.go new file mode 100644 index 00000000..cc008b2d --- /dev/null +++ b/macos/mps/nn_reduce_row_sum.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceRowSum] class. +var NNReduceRowSumClass = _NNReduceRowSumClass{objc.GetClass("MPSNNReduceRowSum")} + +type _NNReduceRowSumClass struct { + objc.Class +} + +// An interface definition for the [NNReduceRowSum] class. +type INNReduceRowSum interface { + INNReduceUnary +} + +// A reduction filter that returns the sum of all values for each row in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowsum?language=objc +type NNReduceRowSum struct { + NNReduceUnary +} + +func NNReduceRowSumFrom(ptr unsafe.Pointer) NNReduceRowSum { + return NNReduceRowSum{ + NNReduceUnary: NNReduceUnaryFrom(ptr), + } +} + +func (n_ NNReduceRowSum) InitWithDevice(device metal.PDevice) NNReduceRowSum { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowSum](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowsum/2942536-initwithdevice?language=objc +func NewNNReduceRowSumWithDevice(device metal.PDevice) NNReduceRowSum { + instance := NNReduceRowSumClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReduceRowSumClass) Alloc() NNReduceRowSum { + rv := objc.Call[NNReduceRowSum](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceRowSum_Alloc() NNReduceRowSum { + return NNReduceRowSumClass.Alloc() +} + +func (nc _NNReduceRowSumClass) New() NNReduceRowSum { + rv := objc.Call[NNReduceRowSum](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceRowSum() NNReduceRowSum { + return NNReduceRowSumClass.New() +} + +func (n_ NNReduceRowSum) Init() NNReduceRowSum { + rv := objc.Call[NNReduceRowSum](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceRowSum) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowSum { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceRowSum](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceRowSum_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceRowSum { + instance := NNReduceRowSumClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduce_unary.gen.go b/macos/mps/nn_reduce_unary.gen.go new file mode 100644 index 00000000..87927e65 --- /dev/null +++ b/macos/mps/nn_reduce_unary.gen.go @@ -0,0 +1,107 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReduceUnary] class. +var NNReduceUnaryClass = _NNReduceUnaryClass{objc.GetClass("MPSNNReduceUnary")} + +type _NNReduceUnaryClass struct { + objc.Class +} + +// An interface definition for the [NNReduceUnary] class. +type INNReduceUnary interface { + ICNNKernel + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// The base class for unary reduction filters. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreduceunary?language=objc +type NNReduceUnary struct { + CNNKernel +} + +func NNReduceUnaryFrom(ptr unsafe.Pointer) NNReduceUnary { + return NNReduceUnary{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (nc _NNReduceUnaryClass) Alloc() NNReduceUnary { + rv := objc.Call[NNReduceUnary](nc, objc.Sel("alloc")) + return rv +} + +func NNReduceUnary_Alloc() NNReduceUnary { + return NNReduceUnaryClass.Alloc() +} + +func (nc _NNReduceUnaryClass) New() NNReduceUnary { + rv := objc.Call[NNReduceUnary](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReduceUnary() NNReduceUnary { + return NNReduceUnaryClass.New() +} + +func (n_ NNReduceUnary) Init() NNReduceUnary { + rv := objc.Call[NNReduceUnary](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReduceUnary) InitWithDevice(device metal.PDevice) NNReduceUnary { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceUnary](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewNNReduceUnaryWithDevice(device metal.PDevice) NNReduceUnary { + instance := NNReduceUnaryClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNReduceUnary) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceUnary { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReduceUnary](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReduceUnary_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReduceUnary { + instance := NNReduceUnaryClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreduceunary/2942547-cliprectsource?language=objc +func (n_ NNReduceUnary) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](n_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreduceunary/2942547-cliprectsource?language=objc +func (n_ NNReduceUnary) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](n_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/nn_reduction_column_max_node.gen.go b/macos/mps/nn_reduction_column_max_node.gen.go new file mode 100644 index 00000000..185f30e6 --- /dev/null +++ b/macos/mps/nn_reduction_column_max_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionColumnMaxNode] class. +var NNReductionColumnMaxNodeClass = _NNReductionColumnMaxNodeClass{objc.GetClass("MPSNNReductionColumnMaxNode")} + +type _NNReductionColumnMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionColumnMaxNode] class. +type INNReductionColumnMaxNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductioncolumnmaxnode?language=objc +type NNReductionColumnMaxNode struct { + NNUnaryReductionNode +} + +func NNReductionColumnMaxNodeFrom(ptr unsafe.Pointer) NNReductionColumnMaxNode { + return NNReductionColumnMaxNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionColumnMaxNodeClass) Alloc() NNReductionColumnMaxNode { + rv := objc.Call[NNReductionColumnMaxNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionColumnMaxNode_Alloc() NNReductionColumnMaxNode { + return NNReductionColumnMaxNodeClass.Alloc() +} + +func (nc _NNReductionColumnMaxNodeClass) New() NNReductionColumnMaxNode { + rv := objc.Call[NNReductionColumnMaxNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionColumnMaxNode() NNReductionColumnMaxNode { + return NNReductionColumnMaxNodeClass.New() +} + +func (n_ NNReductionColumnMaxNode) Init() NNReductionColumnMaxNode { + rv := objc.Call[NNReductionColumnMaxNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionColumnMaxNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionColumnMaxNode { + rv := objc.Call[NNReductionColumnMaxNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionColumnMaxNode_NodeWithSource(sourceNode INNImageNode) NNReductionColumnMaxNode { + return NNReductionColumnMaxNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionColumnMaxNode) InitWithSource(sourceNode INNImageNode) NNReductionColumnMaxNode { + rv := objc.Call[NNReductionColumnMaxNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionColumnMaxNodeWithSource(sourceNode INNImageNode) NNReductionColumnMaxNode { + instance := NNReductionColumnMaxNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_column_mean_node.gen.go b/macos/mps/nn_reduction_column_mean_node.gen.go new file mode 100644 index 00000000..ac7b41bb --- /dev/null +++ b/macos/mps/nn_reduction_column_mean_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionColumnMeanNode] class. +var NNReductionColumnMeanNodeClass = _NNReductionColumnMeanNodeClass{objc.GetClass("MPSNNReductionColumnMeanNode")} + +type _NNReductionColumnMeanNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionColumnMeanNode] class. +type INNReductionColumnMeanNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductioncolumnmeannode?language=objc +type NNReductionColumnMeanNode struct { + NNUnaryReductionNode +} + +func NNReductionColumnMeanNodeFrom(ptr unsafe.Pointer) NNReductionColumnMeanNode { + return NNReductionColumnMeanNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionColumnMeanNodeClass) Alloc() NNReductionColumnMeanNode { + rv := objc.Call[NNReductionColumnMeanNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionColumnMeanNode_Alloc() NNReductionColumnMeanNode { + return NNReductionColumnMeanNodeClass.Alloc() +} + +func (nc _NNReductionColumnMeanNodeClass) New() NNReductionColumnMeanNode { + rv := objc.Call[NNReductionColumnMeanNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionColumnMeanNode() NNReductionColumnMeanNode { + return NNReductionColumnMeanNodeClass.New() +} + +func (n_ NNReductionColumnMeanNode) Init() NNReductionColumnMeanNode { + rv := objc.Call[NNReductionColumnMeanNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionColumnMeanNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionColumnMeanNode { + rv := objc.Call[NNReductionColumnMeanNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionColumnMeanNode_NodeWithSource(sourceNode INNImageNode) NNReductionColumnMeanNode { + return NNReductionColumnMeanNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionColumnMeanNode) InitWithSource(sourceNode INNImageNode) NNReductionColumnMeanNode { + rv := objc.Call[NNReductionColumnMeanNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionColumnMeanNodeWithSource(sourceNode INNImageNode) NNReductionColumnMeanNode { + instance := NNReductionColumnMeanNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_column_min_node.gen.go b/macos/mps/nn_reduction_column_min_node.gen.go new file mode 100644 index 00000000..cccf9658 --- /dev/null +++ b/macos/mps/nn_reduction_column_min_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionColumnMinNode] class. +var NNReductionColumnMinNodeClass = _NNReductionColumnMinNodeClass{objc.GetClass("MPSNNReductionColumnMinNode")} + +type _NNReductionColumnMinNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionColumnMinNode] class. +type INNReductionColumnMinNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductioncolumnminnode?language=objc +type NNReductionColumnMinNode struct { + NNUnaryReductionNode +} + +func NNReductionColumnMinNodeFrom(ptr unsafe.Pointer) NNReductionColumnMinNode { + return NNReductionColumnMinNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionColumnMinNodeClass) Alloc() NNReductionColumnMinNode { + rv := objc.Call[NNReductionColumnMinNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionColumnMinNode_Alloc() NNReductionColumnMinNode { + return NNReductionColumnMinNodeClass.Alloc() +} + +func (nc _NNReductionColumnMinNodeClass) New() NNReductionColumnMinNode { + rv := objc.Call[NNReductionColumnMinNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionColumnMinNode() NNReductionColumnMinNode { + return NNReductionColumnMinNodeClass.New() +} + +func (n_ NNReductionColumnMinNode) Init() NNReductionColumnMinNode { + rv := objc.Call[NNReductionColumnMinNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionColumnMinNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionColumnMinNode { + rv := objc.Call[NNReductionColumnMinNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionColumnMinNode_NodeWithSource(sourceNode INNImageNode) NNReductionColumnMinNode { + return NNReductionColumnMinNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionColumnMinNode) InitWithSource(sourceNode INNImageNode) NNReductionColumnMinNode { + rv := objc.Call[NNReductionColumnMinNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionColumnMinNodeWithSource(sourceNode INNImageNode) NNReductionColumnMinNode { + instance := NNReductionColumnMinNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_column_sum_node.gen.go b/macos/mps/nn_reduction_column_sum_node.gen.go new file mode 100644 index 00000000..4b9fd682 --- /dev/null +++ b/macos/mps/nn_reduction_column_sum_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionColumnSumNode] class. +var NNReductionColumnSumNodeClass = _NNReductionColumnSumNodeClass{objc.GetClass("MPSNNReductionColumnSumNode")} + +type _NNReductionColumnSumNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionColumnSumNode] class. +type INNReductionColumnSumNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductioncolumnsumnode?language=objc +type NNReductionColumnSumNode struct { + NNUnaryReductionNode +} + +func NNReductionColumnSumNodeFrom(ptr unsafe.Pointer) NNReductionColumnSumNode { + return NNReductionColumnSumNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionColumnSumNodeClass) Alloc() NNReductionColumnSumNode { + rv := objc.Call[NNReductionColumnSumNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionColumnSumNode_Alloc() NNReductionColumnSumNode { + return NNReductionColumnSumNodeClass.Alloc() +} + +func (nc _NNReductionColumnSumNodeClass) New() NNReductionColumnSumNode { + rv := objc.Call[NNReductionColumnSumNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionColumnSumNode() NNReductionColumnSumNode { + return NNReductionColumnSumNodeClass.New() +} + +func (n_ NNReductionColumnSumNode) Init() NNReductionColumnSumNode { + rv := objc.Call[NNReductionColumnSumNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionColumnSumNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionColumnSumNode { + rv := objc.Call[NNReductionColumnSumNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionColumnSumNode_NodeWithSource(sourceNode INNImageNode) NNReductionColumnSumNode { + return NNReductionColumnSumNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionColumnSumNode) InitWithSource(sourceNode INNImageNode) NNReductionColumnSumNode { + rv := objc.Call[NNReductionColumnSumNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionColumnSumNodeWithSource(sourceNode INNImageNode) NNReductionColumnSumNode { + instance := NNReductionColumnSumNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_feature_channels_argument_max_node.gen.go b/macos/mps/nn_reduction_feature_channels_argument_max_node.gen.go new file mode 100644 index 00000000..eaef0721 --- /dev/null +++ b/macos/mps/nn_reduction_feature_channels_argument_max_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionFeatureChannelsArgumentMaxNode] class. +var NNReductionFeatureChannelsArgumentMaxNodeClass = _NNReductionFeatureChannelsArgumentMaxNodeClass{objc.GetClass("MPSNNReductionFeatureChannelsArgumentMaxNode")} + +type _NNReductionFeatureChannelsArgumentMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionFeatureChannelsArgumentMaxNode] class. +type INNReductionFeatureChannelsArgumentMaxNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelsargumentmaxnode?language=objc +type NNReductionFeatureChannelsArgumentMaxNode struct { + NNUnaryReductionNode +} + +func NNReductionFeatureChannelsArgumentMaxNodeFrom(ptr unsafe.Pointer) NNReductionFeatureChannelsArgumentMaxNode { + return NNReductionFeatureChannelsArgumentMaxNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionFeatureChannelsArgumentMaxNodeClass) Alloc() NNReductionFeatureChannelsArgumentMaxNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMaxNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionFeatureChannelsArgumentMaxNode_Alloc() NNReductionFeatureChannelsArgumentMaxNode { + return NNReductionFeatureChannelsArgumentMaxNodeClass.Alloc() +} + +func (nc _NNReductionFeatureChannelsArgumentMaxNodeClass) New() NNReductionFeatureChannelsArgumentMaxNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMaxNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionFeatureChannelsArgumentMaxNode() NNReductionFeatureChannelsArgumentMaxNode { + return NNReductionFeatureChannelsArgumentMaxNodeClass.New() +} + +func (n_ NNReductionFeatureChannelsArgumentMaxNode) Init() NNReductionFeatureChannelsArgumentMaxNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMaxNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionFeatureChannelsArgumentMaxNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMaxNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMaxNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionFeatureChannelsArgumentMaxNode_NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMaxNode { + return NNReductionFeatureChannelsArgumentMaxNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionFeatureChannelsArgumentMaxNode) InitWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMaxNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMaxNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionFeatureChannelsArgumentMaxNodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMaxNode { + instance := NNReductionFeatureChannelsArgumentMaxNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_feature_channels_argument_min_node.gen.go b/macos/mps/nn_reduction_feature_channels_argument_min_node.gen.go new file mode 100644 index 00000000..df44437a --- /dev/null +++ b/macos/mps/nn_reduction_feature_channels_argument_min_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionFeatureChannelsArgumentMinNode] class. +var NNReductionFeatureChannelsArgumentMinNodeClass = _NNReductionFeatureChannelsArgumentMinNodeClass{objc.GetClass("MPSNNReductionFeatureChannelsArgumentMinNode")} + +type _NNReductionFeatureChannelsArgumentMinNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionFeatureChannelsArgumentMinNode] class. +type INNReductionFeatureChannelsArgumentMinNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelsargumentminnode?language=objc +type NNReductionFeatureChannelsArgumentMinNode struct { + NNUnaryReductionNode +} + +func NNReductionFeatureChannelsArgumentMinNodeFrom(ptr unsafe.Pointer) NNReductionFeatureChannelsArgumentMinNode { + return NNReductionFeatureChannelsArgumentMinNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionFeatureChannelsArgumentMinNodeClass) Alloc() NNReductionFeatureChannelsArgumentMinNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMinNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionFeatureChannelsArgumentMinNode_Alloc() NNReductionFeatureChannelsArgumentMinNode { + return NNReductionFeatureChannelsArgumentMinNodeClass.Alloc() +} + +func (nc _NNReductionFeatureChannelsArgumentMinNodeClass) New() NNReductionFeatureChannelsArgumentMinNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMinNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionFeatureChannelsArgumentMinNode() NNReductionFeatureChannelsArgumentMinNode { + return NNReductionFeatureChannelsArgumentMinNodeClass.New() +} + +func (n_ NNReductionFeatureChannelsArgumentMinNode) Init() NNReductionFeatureChannelsArgumentMinNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMinNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionFeatureChannelsArgumentMinNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMinNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMinNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionFeatureChannelsArgumentMinNode_NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMinNode { + return NNReductionFeatureChannelsArgumentMinNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionFeatureChannelsArgumentMinNode) InitWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMinNode { + rv := objc.Call[NNReductionFeatureChannelsArgumentMinNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionFeatureChannelsArgumentMinNodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsArgumentMinNode { + instance := NNReductionFeatureChannelsArgumentMinNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_feature_channels_max_node.gen.go b/macos/mps/nn_reduction_feature_channels_max_node.gen.go new file mode 100644 index 00000000..008a5c6d --- /dev/null +++ b/macos/mps/nn_reduction_feature_channels_max_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionFeatureChannelsMaxNode] class. +var NNReductionFeatureChannelsMaxNodeClass = _NNReductionFeatureChannelsMaxNodeClass{objc.GetClass("MPSNNReductionFeatureChannelsMaxNode")} + +type _NNReductionFeatureChannelsMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionFeatureChannelsMaxNode] class. +type INNReductionFeatureChannelsMaxNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelsmaxnode?language=objc +type NNReductionFeatureChannelsMaxNode struct { + NNUnaryReductionNode +} + +func NNReductionFeatureChannelsMaxNodeFrom(ptr unsafe.Pointer) NNReductionFeatureChannelsMaxNode { + return NNReductionFeatureChannelsMaxNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionFeatureChannelsMaxNodeClass) Alloc() NNReductionFeatureChannelsMaxNode { + rv := objc.Call[NNReductionFeatureChannelsMaxNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionFeatureChannelsMaxNode_Alloc() NNReductionFeatureChannelsMaxNode { + return NNReductionFeatureChannelsMaxNodeClass.Alloc() +} + +func (nc _NNReductionFeatureChannelsMaxNodeClass) New() NNReductionFeatureChannelsMaxNode { + rv := objc.Call[NNReductionFeatureChannelsMaxNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionFeatureChannelsMaxNode() NNReductionFeatureChannelsMaxNode { + return NNReductionFeatureChannelsMaxNodeClass.New() +} + +func (n_ NNReductionFeatureChannelsMaxNode) Init() NNReductionFeatureChannelsMaxNode { + rv := objc.Call[NNReductionFeatureChannelsMaxNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionFeatureChannelsMaxNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMaxNode { + rv := objc.Call[NNReductionFeatureChannelsMaxNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionFeatureChannelsMaxNode_NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMaxNode { + return NNReductionFeatureChannelsMaxNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionFeatureChannelsMaxNode) InitWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMaxNode { + rv := objc.Call[NNReductionFeatureChannelsMaxNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionFeatureChannelsMaxNodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMaxNode { + instance := NNReductionFeatureChannelsMaxNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_feature_channels_mean_node.gen.go b/macos/mps/nn_reduction_feature_channels_mean_node.gen.go new file mode 100644 index 00000000..c4a1debd --- /dev/null +++ b/macos/mps/nn_reduction_feature_channels_mean_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionFeatureChannelsMeanNode] class. +var NNReductionFeatureChannelsMeanNodeClass = _NNReductionFeatureChannelsMeanNodeClass{objc.GetClass("MPSNNReductionFeatureChannelsMeanNode")} + +type _NNReductionFeatureChannelsMeanNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionFeatureChannelsMeanNode] class. +type INNReductionFeatureChannelsMeanNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelsmeannode?language=objc +type NNReductionFeatureChannelsMeanNode struct { + NNUnaryReductionNode +} + +func NNReductionFeatureChannelsMeanNodeFrom(ptr unsafe.Pointer) NNReductionFeatureChannelsMeanNode { + return NNReductionFeatureChannelsMeanNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionFeatureChannelsMeanNodeClass) Alloc() NNReductionFeatureChannelsMeanNode { + rv := objc.Call[NNReductionFeatureChannelsMeanNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionFeatureChannelsMeanNode_Alloc() NNReductionFeatureChannelsMeanNode { + return NNReductionFeatureChannelsMeanNodeClass.Alloc() +} + +func (nc _NNReductionFeatureChannelsMeanNodeClass) New() NNReductionFeatureChannelsMeanNode { + rv := objc.Call[NNReductionFeatureChannelsMeanNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionFeatureChannelsMeanNode() NNReductionFeatureChannelsMeanNode { + return NNReductionFeatureChannelsMeanNodeClass.New() +} + +func (n_ NNReductionFeatureChannelsMeanNode) Init() NNReductionFeatureChannelsMeanNode { + rv := objc.Call[NNReductionFeatureChannelsMeanNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionFeatureChannelsMeanNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMeanNode { + rv := objc.Call[NNReductionFeatureChannelsMeanNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionFeatureChannelsMeanNode_NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMeanNode { + return NNReductionFeatureChannelsMeanNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionFeatureChannelsMeanNode) InitWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMeanNode { + rv := objc.Call[NNReductionFeatureChannelsMeanNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionFeatureChannelsMeanNodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMeanNode { + instance := NNReductionFeatureChannelsMeanNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_feature_channels_min_node.gen.go b/macos/mps/nn_reduction_feature_channels_min_node.gen.go new file mode 100644 index 00000000..f52715a6 --- /dev/null +++ b/macos/mps/nn_reduction_feature_channels_min_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionFeatureChannelsMinNode] class. +var NNReductionFeatureChannelsMinNodeClass = _NNReductionFeatureChannelsMinNodeClass{objc.GetClass("MPSNNReductionFeatureChannelsMinNode")} + +type _NNReductionFeatureChannelsMinNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionFeatureChannelsMinNode] class. +type INNReductionFeatureChannelsMinNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelsminnode?language=objc +type NNReductionFeatureChannelsMinNode struct { + NNUnaryReductionNode +} + +func NNReductionFeatureChannelsMinNodeFrom(ptr unsafe.Pointer) NNReductionFeatureChannelsMinNode { + return NNReductionFeatureChannelsMinNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionFeatureChannelsMinNodeClass) Alloc() NNReductionFeatureChannelsMinNode { + rv := objc.Call[NNReductionFeatureChannelsMinNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionFeatureChannelsMinNode_Alloc() NNReductionFeatureChannelsMinNode { + return NNReductionFeatureChannelsMinNodeClass.Alloc() +} + +func (nc _NNReductionFeatureChannelsMinNodeClass) New() NNReductionFeatureChannelsMinNode { + rv := objc.Call[NNReductionFeatureChannelsMinNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionFeatureChannelsMinNode() NNReductionFeatureChannelsMinNode { + return NNReductionFeatureChannelsMinNodeClass.New() +} + +func (n_ NNReductionFeatureChannelsMinNode) Init() NNReductionFeatureChannelsMinNode { + rv := objc.Call[NNReductionFeatureChannelsMinNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionFeatureChannelsMinNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMinNode { + rv := objc.Call[NNReductionFeatureChannelsMinNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionFeatureChannelsMinNode_NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMinNode { + return NNReductionFeatureChannelsMinNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionFeatureChannelsMinNode) InitWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMinNode { + rv := objc.Call[NNReductionFeatureChannelsMinNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionFeatureChannelsMinNodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsMinNode { + instance := NNReductionFeatureChannelsMinNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_feature_channels_sum_node.gen.go b/macos/mps/nn_reduction_feature_channels_sum_node.gen.go new file mode 100644 index 00000000..a2abb822 --- /dev/null +++ b/macos/mps/nn_reduction_feature_channels_sum_node.gen.go @@ -0,0 +1,101 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionFeatureChannelsSumNode] class. +var NNReductionFeatureChannelsSumNodeClass = _NNReductionFeatureChannelsSumNodeClass{objc.GetClass("MPSNNReductionFeatureChannelsSumNode")} + +type _NNReductionFeatureChannelsSumNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionFeatureChannelsSumNode] class. +type INNReductionFeatureChannelsSumNode interface { + INNUnaryReductionNode + Weight() float64 + SetWeight(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelssumnode?language=objc +type NNReductionFeatureChannelsSumNode struct { + NNUnaryReductionNode +} + +func NNReductionFeatureChannelsSumNodeFrom(ptr unsafe.Pointer) NNReductionFeatureChannelsSumNode { + return NNReductionFeatureChannelsSumNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionFeatureChannelsSumNodeClass) Alloc() NNReductionFeatureChannelsSumNode { + rv := objc.Call[NNReductionFeatureChannelsSumNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionFeatureChannelsSumNode_Alloc() NNReductionFeatureChannelsSumNode { + return NNReductionFeatureChannelsSumNodeClass.Alloc() +} + +func (nc _NNReductionFeatureChannelsSumNodeClass) New() NNReductionFeatureChannelsSumNode { + rv := objc.Call[NNReductionFeatureChannelsSumNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionFeatureChannelsSumNode() NNReductionFeatureChannelsSumNode { + return NNReductionFeatureChannelsSumNodeClass.New() +} + +func (n_ NNReductionFeatureChannelsSumNode) Init() NNReductionFeatureChannelsSumNode { + rv := objc.Call[NNReductionFeatureChannelsSumNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionFeatureChannelsSumNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsSumNode { + rv := objc.Call[NNReductionFeatureChannelsSumNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionFeatureChannelsSumNode_NodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsSumNode { + return NNReductionFeatureChannelsSumNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionFeatureChannelsSumNode) InitWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsSumNode { + rv := objc.Call[NNReductionFeatureChannelsSumNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionFeatureChannelsSumNodeWithSource(sourceNode INNImageNode) NNReductionFeatureChannelsSumNode { + instance := NNReductionFeatureChannelsSumNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelssumnode/3037407-weight?language=objc +func (n_ NNReductionFeatureChannelsSumNode) Weight() float64 { + rv := objc.Call[float64](n_, objc.Sel("weight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionfeaturechannelssumnode/3037407-weight?language=objc +func (n_ NNReductionFeatureChannelsSumNode) SetWeight(value float64) { + objc.Call[objc.Void](n_, objc.Sel("setWeight:"), value) +} diff --git a/macos/mps/nn_reduction_row_max_node.gen.go b/macos/mps/nn_reduction_row_max_node.gen.go new file mode 100644 index 00000000..56324135 --- /dev/null +++ b/macos/mps/nn_reduction_row_max_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionRowMaxNode] class. +var NNReductionRowMaxNodeClass = _NNReductionRowMaxNodeClass{objc.GetClass("MPSNNReductionRowMaxNode")} + +type _NNReductionRowMaxNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionRowMaxNode] class. +type INNReductionRowMaxNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionrowmaxnode?language=objc +type NNReductionRowMaxNode struct { + NNUnaryReductionNode +} + +func NNReductionRowMaxNodeFrom(ptr unsafe.Pointer) NNReductionRowMaxNode { + return NNReductionRowMaxNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionRowMaxNodeClass) Alloc() NNReductionRowMaxNode { + rv := objc.Call[NNReductionRowMaxNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionRowMaxNode_Alloc() NNReductionRowMaxNode { + return NNReductionRowMaxNodeClass.Alloc() +} + +func (nc _NNReductionRowMaxNodeClass) New() NNReductionRowMaxNode { + rv := objc.Call[NNReductionRowMaxNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionRowMaxNode() NNReductionRowMaxNode { + return NNReductionRowMaxNodeClass.New() +} + +func (n_ NNReductionRowMaxNode) Init() NNReductionRowMaxNode { + rv := objc.Call[NNReductionRowMaxNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionRowMaxNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionRowMaxNode { + rv := objc.Call[NNReductionRowMaxNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionRowMaxNode_NodeWithSource(sourceNode INNImageNode) NNReductionRowMaxNode { + return NNReductionRowMaxNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionRowMaxNode) InitWithSource(sourceNode INNImageNode) NNReductionRowMaxNode { + rv := objc.Call[NNReductionRowMaxNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionRowMaxNodeWithSource(sourceNode INNImageNode) NNReductionRowMaxNode { + instance := NNReductionRowMaxNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_row_mean_node.gen.go b/macos/mps/nn_reduction_row_mean_node.gen.go new file mode 100644 index 00000000..71eb761a --- /dev/null +++ b/macos/mps/nn_reduction_row_mean_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionRowMeanNode] class. +var NNReductionRowMeanNodeClass = _NNReductionRowMeanNodeClass{objc.GetClass("MPSNNReductionRowMeanNode")} + +type _NNReductionRowMeanNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionRowMeanNode] class. +type INNReductionRowMeanNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionrowmeannode?language=objc +type NNReductionRowMeanNode struct { + NNUnaryReductionNode +} + +func NNReductionRowMeanNodeFrom(ptr unsafe.Pointer) NNReductionRowMeanNode { + return NNReductionRowMeanNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionRowMeanNodeClass) Alloc() NNReductionRowMeanNode { + rv := objc.Call[NNReductionRowMeanNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionRowMeanNode_Alloc() NNReductionRowMeanNode { + return NNReductionRowMeanNodeClass.Alloc() +} + +func (nc _NNReductionRowMeanNodeClass) New() NNReductionRowMeanNode { + rv := objc.Call[NNReductionRowMeanNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionRowMeanNode() NNReductionRowMeanNode { + return NNReductionRowMeanNodeClass.New() +} + +func (n_ NNReductionRowMeanNode) Init() NNReductionRowMeanNode { + rv := objc.Call[NNReductionRowMeanNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionRowMeanNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionRowMeanNode { + rv := objc.Call[NNReductionRowMeanNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionRowMeanNode_NodeWithSource(sourceNode INNImageNode) NNReductionRowMeanNode { + return NNReductionRowMeanNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionRowMeanNode) InitWithSource(sourceNode INNImageNode) NNReductionRowMeanNode { + rv := objc.Call[NNReductionRowMeanNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionRowMeanNodeWithSource(sourceNode INNImageNode) NNReductionRowMeanNode { + instance := NNReductionRowMeanNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_row_min_node.gen.go b/macos/mps/nn_reduction_row_min_node.gen.go new file mode 100644 index 00000000..bb2c0caf --- /dev/null +++ b/macos/mps/nn_reduction_row_min_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionRowMinNode] class. +var NNReductionRowMinNodeClass = _NNReductionRowMinNodeClass{objc.GetClass("MPSNNReductionRowMinNode")} + +type _NNReductionRowMinNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionRowMinNode] class. +type INNReductionRowMinNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionrowminnode?language=objc +type NNReductionRowMinNode struct { + NNUnaryReductionNode +} + +func NNReductionRowMinNodeFrom(ptr unsafe.Pointer) NNReductionRowMinNode { + return NNReductionRowMinNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionRowMinNodeClass) Alloc() NNReductionRowMinNode { + rv := objc.Call[NNReductionRowMinNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionRowMinNode_Alloc() NNReductionRowMinNode { + return NNReductionRowMinNodeClass.Alloc() +} + +func (nc _NNReductionRowMinNodeClass) New() NNReductionRowMinNode { + rv := objc.Call[NNReductionRowMinNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionRowMinNode() NNReductionRowMinNode { + return NNReductionRowMinNodeClass.New() +} + +func (n_ NNReductionRowMinNode) Init() NNReductionRowMinNode { + rv := objc.Call[NNReductionRowMinNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionRowMinNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionRowMinNode { + rv := objc.Call[NNReductionRowMinNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionRowMinNode_NodeWithSource(sourceNode INNImageNode) NNReductionRowMinNode { + return NNReductionRowMinNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionRowMinNode) InitWithSource(sourceNode INNImageNode) NNReductionRowMinNode { + rv := objc.Call[NNReductionRowMinNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionRowMinNodeWithSource(sourceNode INNImageNode) NNReductionRowMinNode { + instance := NNReductionRowMinNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_row_sum_node.gen.go b/macos/mps/nn_reduction_row_sum_node.gen.go new file mode 100644 index 00000000..c1a4ed4d --- /dev/null +++ b/macos/mps/nn_reduction_row_sum_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionRowSumNode] class. +var NNReductionRowSumNodeClass = _NNReductionRowSumNodeClass{objc.GetClass("MPSNNReductionRowSumNode")} + +type _NNReductionRowSumNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionRowSumNode] class. +type INNReductionRowSumNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionrowsumnode?language=objc +type NNReductionRowSumNode struct { + NNUnaryReductionNode +} + +func NNReductionRowSumNodeFrom(ptr unsafe.Pointer) NNReductionRowSumNode { + return NNReductionRowSumNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionRowSumNodeClass) Alloc() NNReductionRowSumNode { + rv := objc.Call[NNReductionRowSumNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionRowSumNode_Alloc() NNReductionRowSumNode { + return NNReductionRowSumNodeClass.Alloc() +} + +func (nc _NNReductionRowSumNodeClass) New() NNReductionRowSumNode { + rv := objc.Call[NNReductionRowSumNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionRowSumNode() NNReductionRowSumNode { + return NNReductionRowSumNodeClass.New() +} + +func (n_ NNReductionRowSumNode) Init() NNReductionRowSumNode { + rv := objc.Call[NNReductionRowSumNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionRowSumNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionRowSumNode { + rv := objc.Call[NNReductionRowSumNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionRowSumNode_NodeWithSource(sourceNode INNImageNode) NNReductionRowSumNode { + return NNReductionRowSumNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionRowSumNode) InitWithSource(sourceNode INNImageNode) NNReductionRowSumNode { + rv := objc.Call[NNReductionRowSumNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionRowSumNodeWithSource(sourceNode INNImageNode) NNReductionRowSumNode { + instance := NNReductionRowSumNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reduction_spatial_mean_gradient_node.gen.go b/macos/mps/nn_reduction_spatial_mean_gradient_node.gen.go new file mode 100644 index 00000000..0ece9d6a --- /dev/null +++ b/macos/mps/nn_reduction_spatial_mean_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionSpatialMeanGradientNode] class. +var NNReductionSpatialMeanGradientNodeClass = _NNReductionSpatialMeanGradientNodeClass{objc.GetClass("MPSNNReductionSpatialMeanGradientNode")} + +type _NNReductionSpatialMeanGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionSpatialMeanGradientNode] class. +type INNReductionSpatialMeanGradientNode interface { + INNGradientFilterNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionspatialmeangradientnode?language=objc +type NNReductionSpatialMeanGradientNode struct { + NNGradientFilterNode +} + +func NNReductionSpatialMeanGradientNodeFrom(ptr unsafe.Pointer) NNReductionSpatialMeanGradientNode { + return NNReductionSpatialMeanGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (n_ NNReductionSpatialMeanGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReductionSpatialMeanGradientNode { + rv := objc.Call[NNReductionSpatialMeanGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionspatialmeangradientnode/3037413-initwithsourcegradient?language=objc +func NewNNReductionSpatialMeanGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReductionSpatialMeanGradientNode { + instance := NNReductionSpatialMeanGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (nc _NNReductionSpatialMeanGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReductionSpatialMeanGradientNode { + rv := objc.Call[NNReductionSpatialMeanGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionspatialmeangradientnode/3037414-nodewithsourcegradient?language=objc +func NNReductionSpatialMeanGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReductionSpatialMeanGradientNode { + return NNReductionSpatialMeanGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (nc _NNReductionSpatialMeanGradientNodeClass) Alloc() NNReductionSpatialMeanGradientNode { + rv := objc.Call[NNReductionSpatialMeanGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionSpatialMeanGradientNode_Alloc() NNReductionSpatialMeanGradientNode { + return NNReductionSpatialMeanGradientNodeClass.Alloc() +} + +func (nc _NNReductionSpatialMeanGradientNodeClass) New() NNReductionSpatialMeanGradientNode { + rv := objc.Call[NNReductionSpatialMeanGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionSpatialMeanGradientNode() NNReductionSpatialMeanGradientNode { + return NNReductionSpatialMeanGradientNodeClass.New() +} + +func (n_ NNReductionSpatialMeanGradientNode) Init() NNReductionSpatialMeanGradientNode { + rv := objc.Call[NNReductionSpatialMeanGradientNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_reduction_spatial_mean_node.gen.go b/macos/mps/nn_reduction_spatial_mean_node.gen.go new file mode 100644 index 00000000..e605d264 --- /dev/null +++ b/macos/mps/nn_reduction_spatial_mean_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReductionSpatialMeanNode] class. +var NNReductionSpatialMeanNodeClass = _NNReductionSpatialMeanNodeClass{objc.GetClass("MPSNNReductionSpatialMeanNode")} + +type _NNReductionSpatialMeanNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReductionSpatialMeanNode] class. +type INNReductionSpatialMeanNode interface { + INNUnaryReductionNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreductionspatialmeannode?language=objc +type NNReductionSpatialMeanNode struct { + NNUnaryReductionNode +} + +func NNReductionSpatialMeanNodeFrom(ptr unsafe.Pointer) NNReductionSpatialMeanNode { + return NNReductionSpatialMeanNode{ + NNUnaryReductionNode: NNUnaryReductionNodeFrom(ptr), + } +} + +func (nc _NNReductionSpatialMeanNodeClass) Alloc() NNReductionSpatialMeanNode { + rv := objc.Call[NNReductionSpatialMeanNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReductionSpatialMeanNode_Alloc() NNReductionSpatialMeanNode { + return NNReductionSpatialMeanNodeClass.Alloc() +} + +func (nc _NNReductionSpatialMeanNodeClass) New() NNReductionSpatialMeanNode { + rv := objc.Call[NNReductionSpatialMeanNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReductionSpatialMeanNode() NNReductionSpatialMeanNode { + return NNReductionSpatialMeanNodeClass.New() +} + +func (n_ NNReductionSpatialMeanNode) Init() NNReductionSpatialMeanNode { + rv := objc.Call[NNReductionSpatialMeanNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNReductionSpatialMeanNodeClass) NodeWithSource(sourceNode INNImageNode) NNReductionSpatialMeanNode { + rv := objc.Call[NNReductionSpatialMeanNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNReductionSpatialMeanNode_NodeWithSource(sourceNode INNImageNode) NNReductionSpatialMeanNode { + return NNReductionSpatialMeanNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNReductionSpatialMeanNode) InitWithSource(sourceNode INNImageNode) NNReductionSpatialMeanNode { + rv := objc.Call[NNReductionSpatialMeanNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNReductionSpatialMeanNodeWithSource(sourceNode INNImageNode) NNReductionSpatialMeanNode { + instance := NNReductionSpatialMeanNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reshape.gen.go b/macos/mps/nn_reshape.gen.go new file mode 100644 index 00000000..ef83fbed --- /dev/null +++ b/macos/mps/nn_reshape.gen.go @@ -0,0 +1,129 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReshape] class. +var NNReshapeClass = _NNReshapeClass{objc.GetClass("MPSNNReshape")} + +type _NNReshapeClass struct { + objc.Class +} + +// An interface definition for the [NNReshape] class. +type INNReshape interface { + ICNNKernel + EncodeBatchToCommandBufferSourceImagesReshapedWidthReshapedHeightReshapedFeatureChannels(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) *foundation.Array + EncodeBatchToCommandBufferObjectSourceImagesReshapedWidthReshapedHeightReshapedFeatureChannels(commandBufferObject objc.IObject, sourceImages *foundation.Array, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) *foundation.Array + EncodeToCommandBufferSourceImageReshapedWidthReshapedHeightReshapedFeatureChannels(commandBuffer metal.PCommandBuffer, sourceImage IImage, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) Image + EncodeToCommandBufferObjectSourceImageReshapedWidthReshapedHeightReshapedFeatureChannels(commandBufferObject objc.IObject, sourceImage IImage, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) Image +} + +// The base class for reshape operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshape?language=objc +type NNReshape struct { + CNNKernel +} + +func NNReshapeFrom(ptr unsafe.Pointer) NNReshape { + return NNReshape{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNReshape) InitWithDevice(device metal.PDevice) NNReshape { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReshape](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshape/2951929-initwithdevice?language=objc +func NewNNReshapeWithDevice(device metal.PDevice) NNReshape { + instance := NNReshapeClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReshapeClass) Alloc() NNReshape { + rv := objc.Call[NNReshape](nc, objc.Sel("alloc")) + return rv +} + +func NNReshape_Alloc() NNReshape { + return NNReshapeClass.Alloc() +} + +func (nc _NNReshapeClass) New() NNReshape { + rv := objc.Call[NNReshape](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReshape() NNReshape { + return NNReshapeClass.New() +} + +func (n_ NNReshape) Init() NNReshape { + rv := objc.Call[NNReshape](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReshape) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReshape { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReshape](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReshape_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReshape { + instance := NNReshapeClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshape/3547990-encodebatchtocommandbuffer?language=objc +func (n_ NNReshape) EncodeBatchToCommandBufferSourceImagesReshapedWidthReshapedHeightReshapedFeatureChannels(commandBuffer metal.PCommandBuffer, sourceImages *foundation.Array, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) *foundation.Array { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[*foundation.Array](n_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:reshapedWidth:reshapedHeight:reshapedFeatureChannels:"), po0, sourceImages, reshapedWidth, reshapedHeight, reshapedFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshape/3547990-encodebatchtocommandbuffer?language=objc +func (n_ NNReshape) EncodeBatchToCommandBufferObjectSourceImagesReshapedWidthReshapedHeightReshapedFeatureChannels(commandBufferObject objc.IObject, sourceImages *foundation.Array, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) *foundation.Array { + rv := objc.Call[*foundation.Array](n_, objc.Sel("encodeBatchToCommandBuffer:sourceImages:reshapedWidth:reshapedHeight:reshapedFeatureChannels:"), objc.Ptr(commandBufferObject), sourceImages, reshapedWidth, reshapedHeight, reshapedFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshape/3547992-encodetocommandbuffer?language=objc +func (n_ NNReshape) EncodeToCommandBufferSourceImageReshapedWidthReshapedHeightReshapedFeatureChannels(commandBuffer metal.PCommandBuffer, sourceImage IImage, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) Image { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[Image](n_, objc.Sel("encodeToCommandBuffer:sourceImage:reshapedWidth:reshapedHeight:reshapedFeatureChannels:"), po0, objc.Ptr(sourceImage), reshapedWidth, reshapedHeight, reshapedFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshape/3547992-encodetocommandbuffer?language=objc +func (n_ NNReshape) EncodeToCommandBufferObjectSourceImageReshapedWidthReshapedHeightReshapedFeatureChannels(commandBufferObject objc.IObject, sourceImage IImage, reshapedWidth uint, reshapedHeight uint, reshapedFeatureChannels uint) Image { + rv := objc.Call[Image](n_, objc.Sel("encodeToCommandBuffer:sourceImage:reshapedWidth:reshapedHeight:reshapedFeatureChannels:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), reshapedWidth, reshapedHeight, reshapedFeatureChannels) + return rv +} diff --git a/macos/mps/nn_reshape_gradient.gen.go b/macos/mps/nn_reshape_gradient.gen.go new file mode 100644 index 00000000..f1283c02 --- /dev/null +++ b/macos/mps/nn_reshape_gradient.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReshapeGradient] class. +var NNReshapeGradientClass = _NNReshapeGradientClass{objc.GetClass("MPSNNReshapeGradient")} + +type _NNReshapeGradientClass struct { + objc.Class +} + +// An interface definition for the [NNReshapeGradient] class. +type INNReshapeGradient interface { + ICNNGradientKernel +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapegradient?language=objc +type NNReshapeGradient struct { + CNNGradientKernel +} + +func NNReshapeGradientFrom(ptr unsafe.Pointer) NNReshapeGradient { + return NNReshapeGradient{ + CNNGradientKernel: CNNGradientKernelFrom(ptr), + } +} + +func (n_ NNReshapeGradient) InitWithDevice(device metal.PDevice) NNReshapeGradient { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReshapeGradient](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapegradient/3037439-initwithdevice?language=objc +func NewNNReshapeGradientWithDevice(device metal.PDevice) NNReshapeGradient { + instance := NNReshapeGradientClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNReshapeGradientClass) Alloc() NNReshapeGradient { + rv := objc.Call[NNReshapeGradient](nc, objc.Sel("alloc")) + return rv +} + +func NNReshapeGradient_Alloc() NNReshapeGradient { + return NNReshapeGradientClass.Alloc() +} + +func (nc _NNReshapeGradientClass) New() NNReshapeGradient { + rv := objc.Call[NNReshapeGradient](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReshapeGradient() NNReshapeGradient { + return NNReshapeGradientClass.New() +} + +func (n_ NNReshapeGradient) Init() NNReshapeGradient { + rv := objc.Call[NNReshapeGradient](n_, objc.Sel("init")) + return rv +} + +func (n_ NNReshapeGradient) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReshapeGradient { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNReshapeGradient](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNReshapeGradient_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNReshapeGradient { + instance := NNReshapeGradientClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_reshape_gradient_node.gen.go b/macos/mps/nn_reshape_gradient_node.gen.go new file mode 100644 index 00000000..11c465b9 --- /dev/null +++ b/macos/mps/nn_reshape_gradient_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReshapeGradientNode] class. +var NNReshapeGradientNodeClass = _NNReshapeGradientNodeClass{objc.GetClass("MPSNNReshapeGradientNode")} + +type _NNReshapeGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReshapeGradientNode] class. +type INNReshapeGradientNode interface { + INNGradientFilterNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapegradientnode?language=objc +type NNReshapeGradientNode struct { + NNGradientFilterNode +} + +func NNReshapeGradientNodeFrom(ptr unsafe.Pointer) NNReshapeGradientNode { + return NNReshapeGradientNode{ + NNGradientFilterNode: NNGradientFilterNodeFrom(ptr), + } +} + +func (n_ NNReshapeGradientNode) InitWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReshapeGradientNode { + rv := objc.Call[NNReshapeGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapegradientnode/3037417-initwithsourcegradient?language=objc +func NewNNReshapeGradientNodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReshapeGradientNode { + instance := NNReshapeGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) + instance.Autorelease() + return instance +} + +func (nc _NNReshapeGradientNodeClass) NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReshapeGradientNode { + rv := objc.Call[NNReshapeGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapegradientnode/3037418-nodewithsourcegradient?language=objc +func NNReshapeGradientNode_NodeWithSourceGradientSourceImageGradientState(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNGradientStateNode) NNReshapeGradientNode { + return NNReshapeGradientNodeClass.NodeWithSourceGradientSourceImageGradientState(sourceGradient, sourceImage, gradientState) +} + +func (nc _NNReshapeGradientNodeClass) Alloc() NNReshapeGradientNode { + rv := objc.Call[NNReshapeGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReshapeGradientNode_Alloc() NNReshapeGradientNode { + return NNReshapeGradientNodeClass.Alloc() +} + +func (nc _NNReshapeGradientNodeClass) New() NNReshapeGradientNode { + rv := objc.Call[NNReshapeGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReshapeGradientNode() NNReshapeGradientNode { + return NNReshapeGradientNodeClass.New() +} + +func (n_ NNReshapeGradientNode) Init() NNReshapeGradientNode { + rv := objc.Call[NNReshapeGradientNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_reshape_node.gen.go b/macos/mps/nn_reshape_node.gen.go new file mode 100644 index 00000000..492e1357 --- /dev/null +++ b/macos/mps/nn_reshape_node.gen.go @@ -0,0 +1,84 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNReshapeNode] class. +var NNReshapeNodeClass = _NNReshapeNodeClass{objc.GetClass("MPSNNReshapeNode")} + +type _NNReshapeNodeClass struct { + objc.Class +} + +// An interface definition for the [NNReshapeNode] class. +type INNReshapeNode interface { + INNFilterNode +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapenode?language=objc +type NNReshapeNode struct { + NNFilterNode +} + +func NNReshapeNodeFrom(ptr unsafe.Pointer) NNReshapeNode { + return NNReshapeNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNReshapeNodeClass) NodeWithSourceResultWidthResultHeightResultFeatureChannels(source INNImageNode, resultWidth uint, resultHeight uint, resultFeatureChannels uint) NNReshapeNode { + rv := objc.Call[NNReshapeNode](nc, objc.Sel("nodeWithSource:resultWidth:resultHeight:resultFeatureChannels:"), objc.Ptr(source), resultWidth, resultHeight, resultFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapenode/3037421-nodewithsource?language=objc +func NNReshapeNode_NodeWithSourceResultWidthResultHeightResultFeatureChannels(source INNImageNode, resultWidth uint, resultHeight uint, resultFeatureChannels uint) NNReshapeNode { + return NNReshapeNodeClass.NodeWithSourceResultWidthResultHeightResultFeatureChannels(source, resultWidth, resultHeight, resultFeatureChannels) +} + +func (n_ NNReshapeNode) InitWithSourceResultWidthResultHeightResultFeatureChannels(source INNImageNode, resultWidth uint, resultHeight uint, resultFeatureChannels uint) NNReshapeNode { + rv := objc.Call[NNReshapeNode](n_, objc.Sel("initWithSource:resultWidth:resultHeight:resultFeatureChannels:"), objc.Ptr(source), resultWidth, resultHeight, resultFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreshapenode/3037420-initwithsource?language=objc +func NewNNReshapeNodeWithSourceResultWidthResultHeightResultFeatureChannels(source INNImageNode, resultWidth uint, resultHeight uint, resultFeatureChannels uint) NNReshapeNode { + instance := NNReshapeNodeClass.Alloc().InitWithSourceResultWidthResultHeightResultFeatureChannels(source, resultWidth, resultHeight, resultFeatureChannels) + instance.Autorelease() + return instance +} + +func (nc _NNReshapeNodeClass) Alloc() NNReshapeNode { + rv := objc.Call[NNReshapeNode](nc, objc.Sel("alloc")) + return rv +} + +func NNReshapeNode_Alloc() NNReshapeNode { + return NNReshapeNodeClass.Alloc() +} + +func (nc _NNReshapeNodeClass) New() NNReshapeNode { + rv := objc.Call[NNReshapeNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNReshapeNode() NNReshapeNode { + return NNReshapeNodeClass.New() +} + +func (n_ NNReshapeNode) Init() NNReshapeNode { + rv := objc.Call[NNReshapeNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_resize_bilinear.gen.go b/macos/mps/nn_resize_bilinear.gen.go new file mode 100644 index 00000000..9cf36d97 --- /dev/null +++ b/macos/mps/nn_resize_bilinear.gen.go @@ -0,0 +1,132 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNResizeBilinear] class. +var NNResizeBilinearClass = _NNResizeBilinearClass{objc.GetClass("MPSNNResizeBilinear")} + +type _NNResizeBilinearClass struct { + objc.Class +} + +// An interface definition for the [NNResizeBilinear] class. +type INNResizeBilinear interface { + ICNNKernel + ResizeHeight() uint + AlignCorners() bool + ResizeWidth() uint +} + +// A bilinear resizing filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnresizebilinear?language=objc +type NNResizeBilinear struct { + CNNKernel +} + +func NNResizeBilinearFrom(ptr unsafe.Pointer) NNResizeBilinear { + return NNResizeBilinear{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNResizeBilinear) InitWithDeviceResizeWidthResizeHeightAlignCorners(device metal.PDevice, resizeWidth uint, resizeHeight uint, alignCorners bool) NNResizeBilinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNResizeBilinear](n_, objc.Sel("initWithDevice:resizeWidth:resizeHeight:alignCorners:"), po0, resizeWidth, resizeHeight, alignCorners) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnresizebilinear/3012966-initwithdevice?language=objc +func NewNNResizeBilinearWithDeviceResizeWidthResizeHeightAlignCorners(device metal.PDevice, resizeWidth uint, resizeHeight uint, alignCorners bool) NNResizeBilinear { + instance := NNResizeBilinearClass.Alloc().InitWithDeviceResizeWidthResizeHeightAlignCorners(device, resizeWidth, resizeHeight, alignCorners) + instance.Autorelease() + return instance +} + +func (nc _NNResizeBilinearClass) Alloc() NNResizeBilinear { + rv := objc.Call[NNResizeBilinear](nc, objc.Sel("alloc")) + return rv +} + +func NNResizeBilinear_Alloc() NNResizeBilinear { + return NNResizeBilinearClass.Alloc() +} + +func (nc _NNResizeBilinearClass) New() NNResizeBilinear { + rv := objc.Call[NNResizeBilinear](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNResizeBilinear() NNResizeBilinear { + return NNResizeBilinearClass.New() +} + +func (n_ NNResizeBilinear) Init() NNResizeBilinear { + rv := objc.Call[NNResizeBilinear](n_, objc.Sel("init")) + return rv +} + +func (n_ NNResizeBilinear) InitWithDevice(device metal.PDevice) NNResizeBilinear { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNResizeBilinear](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewNNResizeBilinearWithDevice(device metal.PDevice) NNResizeBilinear { + instance := NNResizeBilinearClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (n_ NNResizeBilinear) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNResizeBilinear { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNResizeBilinear](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNResizeBilinear_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNResizeBilinear { + instance := NNResizeBilinearClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnresizebilinear/3012968-resizeheight?language=objc +func (n_ NNResizeBilinear) ResizeHeight() uint { + rv := objc.Call[uint](n_, objc.Sel("resizeHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnresizebilinear/3012965-aligncorners?language=objc +func (n_ NNResizeBilinear) AlignCorners() bool { + rv := objc.Call[bool](n_, objc.Sel("alignCorners")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnresizebilinear/3012969-resizewidth?language=objc +func (n_ NNResizeBilinear) ResizeWidth() uint { + rv := objc.Call[uint](n_, objc.Sel("resizeWidth")) + return rv +} diff --git a/macos/mps/nn_scale_node.gen.go b/macos/mps/nn_scale_node.gen.go new file mode 100644 index 00000000..2e42eea8 --- /dev/null +++ b/macos/mps/nn_scale_node.gen.go @@ -0,0 +1,85 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNScaleNode] class. +var NNScaleNodeClass = _NNScaleNodeClass{objc.GetClass("MPSNNScaleNode")} + +type _NNScaleNodeClass struct { + objc.Class +} + +// An interface definition for the [NNScaleNode] class. +type INNScaleNode interface { + INNFilterNode +} + +// Abstract node representing an image resampling filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnscalenode?language=objc +type NNScaleNode struct { + NNFilterNode +} + +func NNScaleNodeFrom(ptr unsafe.Pointer) NNScaleNode { + return NNScaleNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNScaleNodeClass) NodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNScaleNode { + rv := objc.Call[NNScaleNode](nc, objc.Sel("nodeWithSource:outputSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnscalenode/2915280-nodewithsource?language=objc +func NNScaleNode_NodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNScaleNode { + return NNScaleNodeClass.NodeWithSourceOutputSize(sourceNode, size) +} + +func (n_ NNScaleNode) InitWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNScaleNode { + rv := objc.Call[NNScaleNode](n_, objc.Sel("initWithSource:outputSize:"), objc.Ptr(sourceNode), size) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnscalenode/2915285-initwithsource?language=objc +func NewNNScaleNodeWithSourceOutputSize(sourceNode INNImageNode, size metal.Size) NNScaleNode { + instance := NNScaleNodeClass.Alloc().InitWithSourceOutputSize(sourceNode, size) + instance.Autorelease() + return instance +} + +func (nc _NNScaleNodeClass) Alloc() NNScaleNode { + rv := objc.Call[NNScaleNode](nc, objc.Sel("alloc")) + return rv +} + +func NNScaleNode_Alloc() NNScaleNode { + return NNScaleNodeClass.Alloc() +} + +func (nc _NNScaleNodeClass) New() NNScaleNode { + rv := objc.Call[NNScaleNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNScaleNode() NNScaleNode { + return NNScaleNodeClass.New() +} + +func (n_ NNScaleNode) Init() NNScaleNode { + rv := objc.Call[NNScaleNode](n_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/nn_slice.gen.go b/macos/mps/nn_slice.gen.go new file mode 100644 index 00000000..a2b6d39a --- /dev/null +++ b/macos/mps/nn_slice.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNSlice] class. +var NNSliceClass = _NNSliceClass{objc.GetClass("MPSNNSlice")} + +type _NNSliceClass struct { + objc.Class +} + +// An interface definition for the [NNSlice] class. +type INNSlice interface { + ICNNKernel +} + +// A kernel that extracts a slice from an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnslice?language=objc +type NNSlice struct { + CNNKernel +} + +func NNSliceFrom(ptr unsafe.Pointer) NNSlice { + return NNSlice{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (n_ NNSlice) InitWithDevice(device metal.PDevice) NNSlice { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNSlice](n_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnslice/2942401-initwithdevice?language=objc +func NewNNSliceWithDevice(device metal.PDevice) NNSlice { + instance := NNSliceClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (nc _NNSliceClass) Alloc() NNSlice { + rv := objc.Call[NNSlice](nc, objc.Sel("alloc")) + return rv +} + +func NNSlice_Alloc() NNSlice { + return NNSliceClass.Alloc() +} + +func (nc _NNSliceClass) New() NNSlice { + rv := objc.Call[NNSlice](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNSlice() NNSlice { + return NNSliceClass.New() +} + +func (n_ NNSlice) Init() NNSlice { + rv := objc.Call[NNSlice](n_, objc.Sel("init")) + return rv +} + +func (n_ NNSlice) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNSlice { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[NNSlice](n_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func NNSlice_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) NNSlice { + instance := NNSliceClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_state_node.gen.go b/macos/mps/nn_state_node.gen.go new file mode 100644 index 00000000..f45ad66c --- /dev/null +++ b/macos/mps/nn_state_node.gen.go @@ -0,0 +1,118 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNStateNode] class. +var NNStateNodeClass = _NNStateNodeClass{objc.GetClass("MPSNNStateNode")} + +type _NNStateNodeClass struct { + objc.Class +} + +// An interface definition for the [NNStateNode] class. +type INNStateNode interface { + objc.IObject + Handle() HandleWrapper + SetHandle(value PHandle) + SetHandleObject(valueObject objc.IObject) + ExportFromGraph() bool + SetExportFromGraph(value bool) + SynchronizeResource() bool + SetSynchronizeResource(value bool) +} + +// A placeholder node denoting the position in the graph of a state object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode?language=objc +type NNStateNode struct { + objc.Object +} + +func NNStateNodeFrom(ptr unsafe.Pointer) NNStateNode { + return NNStateNode{ + Object: objc.ObjectFrom(ptr), + } +} + +func (nc _NNStateNodeClass) Alloc() NNStateNode { + rv := objc.Call[NNStateNode](nc, objc.Sel("alloc")) + return rv +} + +func NNStateNode_Alloc() NNStateNode { + return NNStateNodeClass.Alloc() +} + +func (nc _NNStateNodeClass) New() NNStateNode { + rv := objc.Call[NNStateNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNStateNode() NNStateNode { + return NNStateNodeClass.New() +} + +func (n_ NNStateNode) Init() NNStateNode { + rv := objc.Call[NNStateNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode/2866426-handle?language=objc +func (n_ NNStateNode) Handle() HandleWrapper { + rv := objc.Call[HandleWrapper](n_, objc.Sel("handle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode/2866426-handle?language=objc +func (n_ NNStateNode) SetHandle(value PHandle) { + po0 := objc.WrapAsProtocol("MPSHandle", value) + objc.Call[objc.Void](n_, objc.Sel("setHandle:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode/2866426-handle?language=objc +func (n_ NNStateNode) SetHandleObject(valueObject objc.IObject) { + objc.Call[objc.Void](n_, objc.Sel("setHandle:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode/2942640-exportfromgraph?language=objc +func (n_ NNStateNode) ExportFromGraph() bool { + rv := objc.Call[bool](n_, objc.Sel("exportFromGraph")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode/2942640-exportfromgraph?language=objc +func (n_ NNStateNode) SetExportFromGraph(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setExportFromGraph:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode/2942639-synchronizeresource?language=objc +func (n_ NNStateNode) SynchronizeResource() bool { + rv := objc.Call[bool](n_, objc.Sel("synchronizeResource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnstatenode/2942639-synchronizeresource?language=objc +func (n_ NNStateNode) SetSynchronizeResource(value bool) { + objc.Call[objc.Void](n_, objc.Sel("setSynchronizeResource:"), value) +} diff --git a/macos/mps/nn_subtraction_gradient_node.gen.go b/macos/mps/nn_subtraction_gradient_node.gen.go new file mode 100644 index 00000000..1e275317 --- /dev/null +++ b/macos/mps/nn_subtraction_gradient_node.gen.go @@ -0,0 +1,98 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNSubtractionGradientNode] class. +var NNSubtractionGradientNodeClass = _NNSubtractionGradientNodeClass{objc.GetClass("MPSNNSubtractionGradientNode")} + +type _NNSubtractionGradientNodeClass struct { + objc.Class +} + +// An interface definition for the [NNSubtractionGradientNode] class. +type INNSubtractionGradientNode interface { + INNArithmeticGradientNode +} + +// A representation of a gradient subtraction operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnsubtractiongradientnode?language=objc +type NNSubtractionGradientNode struct { + NNArithmeticGradientNode +} + +func NNSubtractionGradientNodeFrom(ptr unsafe.Pointer) NNSubtractionGradientNode { + return NNSubtractionGradientNode{ + NNArithmeticGradientNode: NNArithmeticGradientNodeFrom(ptr), + } +} + +func (nc _NNSubtractionGradientNodeClass) Alloc() NNSubtractionGradientNode { + rv := objc.Call[NNSubtractionGradientNode](nc, objc.Sel("alloc")) + return rv +} + +func NNSubtractionGradientNode_Alloc() NNSubtractionGradientNode { + return NNSubtractionGradientNodeClass.Alloc() +} + +func (nc _NNSubtractionGradientNodeClass) New() NNSubtractionGradientNode { + rv := objc.Call[NNSubtractionGradientNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNSubtractionGradientNode() NNSubtractionGradientNode { + return NNSubtractionGradientNodeClass.New() +} + +func (n_ NNSubtractionGradientNode) Init() NNSubtractionGradientNode { + rv := objc.Call[NNSubtractionGradientNode](n_, objc.Sel("init")) + return rv +} + +func (n_ NNSubtractionGradientNode) InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNSubtractionGradientNode { + rv := objc.Call[NNSubtractionGradientNode](n_, objc.Sel("initWithGradientImages:forwardFilter:isSecondarySourceFilter:"), gradientImages, objc.Ptr(filter), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2952980-initwithgradientimages?language=objc +func NewNNSubtractionGradientNodeWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages []INNImageNode, filter INNFilterNode, isSecondarySourceFilter bool) NNSubtractionGradientNode { + instance := NNSubtractionGradientNodeClass.Alloc().InitWithGradientImagesForwardFilterIsSecondarySourceFilter(gradientImages, filter, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (n_ NNSubtractionGradientNode) InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNSubtractionGradientNode { + rv := objc.Call[NNSubtractionGradientNode](n_, objc.Sel("initWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956166-initwithsourcegradient?language=objc +func NewNNSubtractionGradientNodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNSubtractionGradientNode { + instance := NNSubtractionGradientNodeClass.Alloc().InitWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) + instance.Autorelease() + return instance +} + +func (nc _NNSubtractionGradientNodeClass) NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNSubtractionGradientNode { + rv := objc.Call[NNSubtractionGradientNode](nc, objc.Sel("nodeWithSourceGradient:sourceImage:gradientState:isSecondarySourceFilter:"), objc.Ptr(sourceGradient), objc.Ptr(sourceImage), objc.Ptr(gradientState), isSecondarySourceFilter) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnarithmeticgradientnode/2956167-nodewithsourcegradient?language=objc +func NNSubtractionGradientNode_NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient INNImageNode, sourceImage INNImageNode, gradientState INNBinaryGradientStateNode, isSecondarySourceFilter bool) NNSubtractionGradientNode { + return NNSubtractionGradientNodeClass.NodeWithSourceGradientSourceImageGradientStateIsSecondarySourceFilter(sourceGradient, sourceImage, gradientState, isSecondarySourceFilter) +} diff --git a/macos/mps/nn_subtraction_node.gen.go b/macos/mps/nn_subtraction_node.gen.go new file mode 100644 index 00000000..d2710d8b --- /dev/null +++ b/macos/mps/nn_subtraction_node.gen.go @@ -0,0 +1,110 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNSubtractionNode] class. +var NNSubtractionNodeClass = _NNSubtractionNodeClass{objc.GetClass("MPSNNSubtractionNode")} + +type _NNSubtractionNodeClass struct { + objc.Class +} + +// An interface definition for the [NNSubtractionNode] class. +type INNSubtractionNode interface { + INNBinaryArithmeticNode +} + +// A representation of an subtraction operator. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnsubtractionnode?language=objc +type NNSubtractionNode struct { + NNBinaryArithmeticNode +} + +func NNSubtractionNodeFrom(ptr unsafe.Pointer) NNSubtractionNode { + return NNSubtractionNode{ + NNBinaryArithmeticNode: NNBinaryArithmeticNodeFrom(ptr), + } +} + +func (nc _NNSubtractionNodeClass) Alloc() NNSubtractionNode { + rv := objc.Call[NNSubtractionNode](nc, objc.Sel("alloc")) + return rv +} + +func NNSubtractionNode_Alloc() NNSubtractionNode { + return NNSubtractionNodeClass.Alloc() +} + +func (nc _NNSubtractionNodeClass) New() NNSubtractionNode { + rv := objc.Call[NNSubtractionNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNSubtractionNode() NNSubtractionNode { + return NNSubtractionNodeClass.New() +} + +func (n_ NNSubtractionNode) Init() NNSubtractionNode { + rv := objc.Call[NNSubtractionNode](n_, objc.Sel("init")) + return rv +} + +func (nc _NNSubtractionNodeClass) NodeWithSources(sourceNodes []INNImageNode) NNSubtractionNode { + rv := objc.Call[NNSubtractionNode](nc, objc.Sel("nodeWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890829-nodewithsources?language=objc +func NNSubtractionNode_NodeWithSources(sourceNodes []INNImageNode) NNSubtractionNode { + return NNSubtractionNodeClass.NodeWithSources(sourceNodes) +} + +func (nc _NNSubtractionNodeClass) NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNSubtractionNode { + rv := objc.Call[NNSubtractionNode](nc, objc.Sel("nodeWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890830-nodewithleftsource?language=objc +func NNSubtractionNode_NodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNSubtractionNode { + return NNSubtractionNodeClass.NodeWithLeftSourceRightSource(left, right) +} + +func (n_ NNSubtractionNode) InitWithSources(sourceNodes []INNImageNode) NNSubtractionNode { + rv := objc.Call[NNSubtractionNode](n_, objc.Sel("initWithSources:"), sourceNodes) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890820-initwithsources?language=objc +func NewNNSubtractionNodeWithSources(sourceNodes []INNImageNode) NNSubtractionNode { + instance := NNSubtractionNodeClass.Alloc().InitWithSources(sourceNodes) + instance.Autorelease() + return instance +} + +func (n_ NNSubtractionNode) InitWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNSubtractionNode { + rv := objc.Call[NNSubtractionNode](n_, objc.Sel("initWithLeftSource:rightSource:"), objc.Ptr(left), objc.Ptr(right)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnbinaryarithmeticnode/2890825-initwithleftsource?language=objc +func NewNNSubtractionNodeWithLeftSourceRightSource(left INNImageNode, right INNImageNode) NNSubtractionNode { + instance := NNSubtractionNodeClass.Alloc().InitWithLeftSourceRightSource(left, right) + instance.Autorelease() + return instance +} diff --git a/macos/mps/nn_trainable_node.gen.go b/macos/mps/nn_trainable_node.gen.go new file mode 100644 index 00000000..3be24c91 --- /dev/null +++ b/macos/mps/nn_trainable_node.gen.go @@ -0,0 +1,48 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol that defines methods that determine whether and when neural network training parameters are updated. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnntrainablenode?language=objc +type PNNTrainableNode interface { + // optional + SetTrainingStyle(value NNTrainingStyle) + HasSetTrainingStyle() bool + + // optional + TrainingStyle() NNTrainingStyle + HasTrainingStyle() bool +} + +// A concrete type wrapper for the [PNNTrainableNode] protocol. +type NNTrainableNodeWrapper struct { + objc.Object +} + +func (n_ NNTrainableNodeWrapper) HasSetTrainingStyle() bool { + return n_.RespondsToSelector(objc.Sel("setTrainingStyle:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnntrainablenode/2952971-trainingstyle?language=objc +func (n_ NNTrainableNodeWrapper) SetTrainingStyle(value NNTrainingStyle) { + objc.Call[objc.Void](n_, objc.Sel("setTrainingStyle:"), value) +} + +func (n_ NNTrainableNodeWrapper) HasTrainingStyle() bool { + return n_.RespondsToSelector(objc.Sel("trainingStyle")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnntrainablenode/2952971-trainingstyle?language=objc +func (n_ NNTrainableNodeWrapper) TrainingStyle() NNTrainingStyle { + rv := objc.Call[NNTrainingStyle](n_, objc.Sel("trainingStyle")) + return rv +} diff --git a/macos/mps/nn_unary_reduction_node.gen.go b/macos/mps/nn_unary_reduction_node.gen.go new file mode 100644 index 00000000..078e885c --- /dev/null +++ b/macos/mps/nn_unary_reduction_node.gen.go @@ -0,0 +1,102 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [NNUnaryReductionNode] class. +var NNUnaryReductionNodeClass = _NNUnaryReductionNodeClass{objc.GetClass("MPSNNUnaryReductionNode")} + +type _NNUnaryReductionNodeClass struct { + objc.Class +} + +// An interface definition for the [NNUnaryReductionNode] class. +type INNUnaryReductionNode interface { + INNFilterNode + ClipRectSource() metal.Region + SetClipRectSource(value metal.Region) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode?language=objc +type NNUnaryReductionNode struct { + NNFilterNode +} + +func NNUnaryReductionNodeFrom(ptr unsafe.Pointer) NNUnaryReductionNode { + return NNUnaryReductionNode{ + NNFilterNode: NNFilterNodeFrom(ptr), + } +} + +func (nc _NNUnaryReductionNodeClass) NodeWithSource(sourceNode INNImageNode) NNUnaryReductionNode { + rv := objc.Call[NNUnaryReductionNode](nc, objc.Sel("nodeWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037425-nodewithsource?language=objc +func NNUnaryReductionNode_NodeWithSource(sourceNode INNImageNode) NNUnaryReductionNode { + return NNUnaryReductionNodeClass.NodeWithSource(sourceNode) +} + +func (n_ NNUnaryReductionNode) InitWithSource(sourceNode INNImageNode) NNUnaryReductionNode { + rv := objc.Call[NNUnaryReductionNode](n_, objc.Sel("initWithSource:"), objc.Ptr(sourceNode)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037424-initwithsource?language=objc +func NewNNUnaryReductionNodeWithSource(sourceNode INNImageNode) NNUnaryReductionNode { + instance := NNUnaryReductionNodeClass.Alloc().InitWithSource(sourceNode) + instance.Autorelease() + return instance +} + +func (nc _NNUnaryReductionNodeClass) Alloc() NNUnaryReductionNode { + rv := objc.Call[NNUnaryReductionNode](nc, objc.Sel("alloc")) + return rv +} + +func NNUnaryReductionNode_Alloc() NNUnaryReductionNode { + return NNUnaryReductionNodeClass.Alloc() +} + +func (nc _NNUnaryReductionNodeClass) New() NNUnaryReductionNode { + rv := objc.Call[NNUnaryReductionNode](nc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewNNUnaryReductionNode() NNUnaryReductionNode { + return NNUnaryReductionNodeClass.New() +} + +func (n_ NNUnaryReductionNode) Init() NNUnaryReductionNode { + rv := objc.Call[NNUnaryReductionNode](n_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037423-cliprectsource?language=objc +func (n_ NNUnaryReductionNode) ClipRectSource() metal.Region { + rv := objc.Call[metal.Region](n_, objc.Sel("clipRectSource")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsnnunaryreductionnode/3037423-cliprectsource?language=objc +func (n_ NNUnaryReductionNode) SetClipRectSource(value metal.Region) { + objc.Call[objc.Void](n_, objc.Sel("setClipRectSource:"), value) +} diff --git a/macos/mps/polygon_acceleration_structure.gen.go b/macos/mps/polygon_acceleration_structure.gen.go new file mode 100644 index 00000000..0be73b77 --- /dev/null +++ b/macos/mps/polygon_acceleration_structure.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PolygonAccelerationStructure] class. +var PolygonAccelerationStructureClass = _PolygonAccelerationStructureClass{objc.GetClass("MPSPolygonAccelerationStructure")} + +type _PolygonAccelerationStructureClass struct { + objc.Class +} + +// An interface definition for the [PolygonAccelerationStructure] class. +type IPolygonAccelerationStructure interface { + IAccelerationStructure +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspolygonaccelerationstructure?language=objc +type PolygonAccelerationStructure struct { + AccelerationStructure +} + +func PolygonAccelerationStructureFrom(ptr unsafe.Pointer) PolygonAccelerationStructure { + return PolygonAccelerationStructure{ + AccelerationStructure: AccelerationStructureFrom(ptr), + } +} + +func (pc _PolygonAccelerationStructureClass) Alloc() PolygonAccelerationStructure { + rv := objc.Call[PolygonAccelerationStructure](pc, objc.Sel("alloc")) + return rv +} + +func PolygonAccelerationStructure_Alloc() PolygonAccelerationStructure { + return PolygonAccelerationStructureClass.Alloc() +} + +func (pc _PolygonAccelerationStructureClass) New() PolygonAccelerationStructure { + rv := objc.Call[PolygonAccelerationStructure](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPolygonAccelerationStructure() PolygonAccelerationStructure { + return PolygonAccelerationStructureClass.New() +} + +func (p_ PolygonAccelerationStructure) Init() PolygonAccelerationStructure { + rv := objc.Call[PolygonAccelerationStructure](p_, objc.Sel("init")) + return rv +} + +func (p_ PolygonAccelerationStructure) InitWithDevice(device metal.PDevice) PolygonAccelerationStructure { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[PolygonAccelerationStructure](p_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewPolygonAccelerationStructureWithDevice(device metal.PDevice) PolygonAccelerationStructure { + instance := PolygonAccelerationStructureClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (p_ PolygonAccelerationStructure) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) PolygonAccelerationStructure { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[PolygonAccelerationStructure](p_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func PolygonAccelerationStructure_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) PolygonAccelerationStructure { + instance := PolygonAccelerationStructureClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/polygon_buffer.gen.go b/macos/mps/polygon_buffer.gen.go new file mode 100644 index 00000000..5cd3a50e --- /dev/null +++ b/macos/mps/polygon_buffer.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PolygonBuffer] class. +var PolygonBufferClass = _PolygonBufferClass{objc.GetClass("MPSPolygonBuffer")} + +type _PolygonBufferClass struct { + objc.Class +} + +// An interface definition for the [PolygonBuffer] class. +type IPolygonBuffer interface { + objc.IObject +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspolygonbuffer?language=objc +type PolygonBuffer struct { + objc.Object +} + +func PolygonBufferFrom(ptr unsafe.Pointer) PolygonBuffer { + return PolygonBuffer{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PolygonBufferClass) Alloc() PolygonBuffer { + rv := objc.Call[PolygonBuffer](pc, objc.Sel("alloc")) + return rv +} + +func PolygonBuffer_Alloc() PolygonBuffer { + return PolygonBufferClass.Alloc() +} + +func (pc _PolygonBufferClass) New() PolygonBuffer { + rv := objc.Call[PolygonBuffer](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPolygonBuffer() PolygonBuffer { + return PolygonBufferClass.New() +} + +func (p_ PolygonBuffer) Init() PolygonBuffer { + rv := objc.Call[PolygonBuffer](p_, objc.Sel("init")) + return rv +} diff --git a/macos/mps/predicate.gen.go b/macos/mps/predicate.gen.go new file mode 100644 index 00000000..31b05281 --- /dev/null +++ b/macos/mps/predicate.gen.go @@ -0,0 +1,120 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Predicate] class. +var PredicateClass = _PredicateClass{objc.GetClass("MPSPredicate")} + +type _PredicateClass struct { + objc.Class +} + +// An interface definition for the [Predicate] class. +type IPredicate interface { + objc.IObject + PredicateOffset() uint + PredicateBuffer() metal.BufferWrapper +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspredicate?language=objc +type Predicate struct { + objc.Object +} + +func PredicateFrom(ptr unsafe.Pointer) Predicate { + return Predicate{ + Object: objc.ObjectFrom(ptr), + } +} + +func (p_ Predicate) InitWithDevice(device metal.PDevice) Predicate { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[Predicate](p_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspredicate/3114035-initwithdevice?language=objc +func NewPredicateWithDevice(device metal.PDevice) Predicate { + instance := PredicateClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (pc _PredicateClass) PredicateWithBufferOffset(buffer metal.PBuffer, offset uint) Predicate { + po0 := objc.WrapAsProtocol("MTLBuffer", buffer) + rv := objc.Call[Predicate](pc, objc.Sel("predicateWithBuffer:offset:"), po0, offset) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspredicate/3114038-predicatewithbuffer?language=objc +func Predicate_PredicateWithBufferOffset(buffer metal.PBuffer, offset uint) Predicate { + return PredicateClass.PredicateWithBufferOffset(buffer, offset) +} + +func (p_ Predicate) InitWithBufferOffset(buffer metal.PBuffer, offset uint) Predicate { + po0 := objc.WrapAsProtocol("MTLBuffer", buffer) + rv := objc.Call[Predicate](p_, objc.Sel("initWithBuffer:offset:"), po0, offset) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspredicate/3114034-initwithbuffer?language=objc +func NewPredicateWithBufferOffset(buffer metal.PBuffer, offset uint) Predicate { + instance := PredicateClass.Alloc().InitWithBufferOffset(buffer, offset) + instance.Autorelease() + return instance +} + +func (pc _PredicateClass) Alloc() Predicate { + rv := objc.Call[Predicate](pc, objc.Sel("alloc")) + return rv +} + +func Predicate_Alloc() Predicate { + return PredicateClass.Alloc() +} + +func (pc _PredicateClass) New() Predicate { + rv := objc.Call[Predicate](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPredicate() Predicate { + return PredicateClass.New() +} + +func (p_ Predicate) Init() Predicate { + rv := objc.Call[Predicate](p_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspredicate/3114037-predicateoffset?language=objc +func (p_ Predicate) PredicateOffset() uint { + rv := objc.Call[uint](p_, objc.Sel("predicateOffset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpspredicate/3114036-predicatebuffer?language=objc +func (p_ Predicate) PredicateBuffer() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](p_, objc.Sel("predicateBuffer")) + return rv +} diff --git a/macos/mps/protocols.gen.m b/macos/mps/protocols.gen.m new file mode 100644 index 00000000..25374c3e --- /dev/null +++ b/macos/mps/protocols.gen.m @@ -0,0 +1,23 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "MetalPerformanceShaders/MetalPerformanceShaders.h" + +void importMetalPerformanceShadersProtocols() { + id o; + o = @protocol(MPSCNNBatchNormalizationDataSource); + o = @protocol(MPSCNNConvolutionDataSource); + o = @protocol(MPSCNNGroupNormalizationDataSource); + o = @protocol(MPSCNNInstanceNormalizationDataSource); + o = @protocol(MPSDeviceProvider); + o = @protocol(MPSHandle); + o = @protocol(MPSHeapProvider); + o = @protocol(MPSImageAllocator); + o = @protocol(MPSImageSizeEncodingState); + o = @protocol(MPSImageTransformProvider); + o = @protocol(MPSNDArrayAllocator); + o = @protocol(MPSNNGramMatrixCallback); + o = @protocol(MPSNNLossCallback); + o = @protocol(MPSNNPadding); + o = @protocol(MPSNNTrainableNode); + o = @protocol(MPSSVGFTextureAllocator); +} diff --git a/macos/mps/quadrilateral_acceleration_structure.gen.go b/macos/mps/quadrilateral_acceleration_structure.gen.go new file mode 100644 index 00000000..52eb0087 --- /dev/null +++ b/macos/mps/quadrilateral_acceleration_structure.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [QuadrilateralAccelerationStructure] class. +var QuadrilateralAccelerationStructureClass = _QuadrilateralAccelerationStructureClass{objc.GetClass("MPSQuadrilateralAccelerationStructure")} + +type _QuadrilateralAccelerationStructureClass struct { + objc.Class +} + +// An interface definition for the [QuadrilateralAccelerationStructure] class. +type IQuadrilateralAccelerationStructure interface { + IPolygonAccelerationStructure +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsquadrilateralaccelerationstructure?language=objc +type QuadrilateralAccelerationStructure struct { + PolygonAccelerationStructure +} + +func QuadrilateralAccelerationStructureFrom(ptr unsafe.Pointer) QuadrilateralAccelerationStructure { + return QuadrilateralAccelerationStructure{ + PolygonAccelerationStructure: PolygonAccelerationStructureFrom(ptr), + } +} + +func (qc _QuadrilateralAccelerationStructureClass) Alloc() QuadrilateralAccelerationStructure { + rv := objc.Call[QuadrilateralAccelerationStructure](qc, objc.Sel("alloc")) + return rv +} + +func QuadrilateralAccelerationStructure_Alloc() QuadrilateralAccelerationStructure { + return QuadrilateralAccelerationStructureClass.Alloc() +} + +func (qc _QuadrilateralAccelerationStructureClass) New() QuadrilateralAccelerationStructure { + rv := objc.Call[QuadrilateralAccelerationStructure](qc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewQuadrilateralAccelerationStructure() QuadrilateralAccelerationStructure { + return QuadrilateralAccelerationStructureClass.New() +} + +func (q_ QuadrilateralAccelerationStructure) Init() QuadrilateralAccelerationStructure { + rv := objc.Call[QuadrilateralAccelerationStructure](q_, objc.Sel("init")) + return rv +} + +func (q_ QuadrilateralAccelerationStructure) InitWithDevice(device metal.PDevice) QuadrilateralAccelerationStructure { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[QuadrilateralAccelerationStructure](q_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewQuadrilateralAccelerationStructureWithDevice(device metal.PDevice) QuadrilateralAccelerationStructure { + instance := QuadrilateralAccelerationStructureClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (q_ QuadrilateralAccelerationStructure) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) QuadrilateralAccelerationStructure { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[QuadrilateralAccelerationStructure](q_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func QuadrilateralAccelerationStructure_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) QuadrilateralAccelerationStructure { + instance := QuadrilateralAccelerationStructureClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/ray_intersector.gen.go b/macos/mps/ray_intersector.gen.go new file mode 100644 index 00000000..9f50d6d2 --- /dev/null +++ b/macos/mps/ray_intersector.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RayIntersector] class. +var RayIntersectorClass = _RayIntersectorClass{objc.GetClass("MPSRayIntersector")} + +type _RayIntersectorClass struct { + objc.Class +} + +// An interface definition for the [RayIntersector] class. +type IRayIntersector interface { + IKernel +} + +// A kernel that performs intersection tests between rays and geometry. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrayintersector?language=objc +type RayIntersector struct { + Kernel +} + +func RayIntersectorFrom(ptr unsafe.Pointer) RayIntersector { + return RayIntersector{ + Kernel: KernelFrom(ptr), + } +} + +func (rc _RayIntersectorClass) Alloc() RayIntersector { + rv := objc.Call[RayIntersector](rc, objc.Sel("alloc")) + return rv +} + +func RayIntersector_Alloc() RayIntersector { + return RayIntersectorClass.Alloc() +} + +func (rc _RayIntersectorClass) New() RayIntersector { + rv := objc.Call[RayIntersector](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRayIntersector() RayIntersector { + return RayIntersectorClass.New() +} + +func (r_ RayIntersector) Init() RayIntersector { + rv := objc.Call[RayIntersector](r_, objc.Sel("init")) + return rv +} + +func (r_ RayIntersector) InitWithDevice(device metal.PDevice) RayIntersector { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RayIntersector](r_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewRayIntersectorWithDevice(device metal.PDevice) RayIntersector { + instance := RayIntersectorClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (r_ RayIntersector) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RayIntersector { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RayIntersector](r_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func RayIntersector_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RayIntersector { + instance := RayIntersectorClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/rnn_descriptor.gen.go b/macos/mps/rnn_descriptor.gen.go new file mode 100644 index 00000000..9c14c312 --- /dev/null +++ b/macos/mps/rnn_descriptor.gen.go @@ -0,0 +1,143 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNDescriptor] class. +var RNNDescriptorClass = _RNNDescriptorClass{objc.GetClass("MPSRNNDescriptor")} + +type _RNNDescriptorClass struct { + objc.Class +} + +// An interface definition for the [RNNDescriptor] class. +type IRNNDescriptor interface { + objc.IObject + LayerSequenceDirection() RNNSequenceDirection + SetLayerSequenceDirection(value RNNSequenceDirection) + OutputFeatureChannels() uint + SetOutputFeatureChannels(value uint) + UseLayerInputUnitTransformMode() bool + SetUseLayerInputUnitTransformMode(value bool) + InputFeatureChannels() uint + SetInputFeatureChannels(value uint) + UseFloat32Weights() bool + SetUseFloat32Weights(value bool) +} + +// A description of a recursive neural network block or layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor?language=objc +type RNNDescriptor struct { + objc.Object +} + +func RNNDescriptorFrom(ptr unsafe.Pointer) RNNDescriptor { + return RNNDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RNNDescriptorClass) Alloc() RNNDescriptor { + rv := objc.Call[RNNDescriptor](rc, objc.Sel("alloc")) + return rv +} + +func RNNDescriptor_Alloc() RNNDescriptor { + return RNNDescriptorClass.Alloc() +} + +func (rc _RNNDescriptorClass) New() RNNDescriptor { + rv := objc.Call[RNNDescriptor](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNDescriptor() RNNDescriptor { + return RNNDescriptorClass.New() +} + +func (r_ RNNDescriptor) Init() RNNDescriptor { + rv := objc.Call[RNNDescriptor](r_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865730-layersequencedirection?language=objc +func (r_ RNNDescriptor) LayerSequenceDirection() RNNSequenceDirection { + rv := objc.Call[RNNSequenceDirection](r_, objc.Sel("layerSequenceDirection")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865730-layersequencedirection?language=objc +func (r_ RNNDescriptor) SetLayerSequenceDirection(value RNNSequenceDirection) { + objc.Call[objc.Void](r_, objc.Sel("setLayerSequenceDirection:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865702-outputfeaturechannels?language=objc +func (r_ RNNDescriptor) OutputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("outputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865702-outputfeaturechannels?language=objc +func (r_ RNNDescriptor) SetOutputFeatureChannels(value uint) { + objc.Call[objc.Void](r_, objc.Sel("setOutputFeatureChannels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865687-uselayerinputunittransformmode?language=objc +func (r_ RNNDescriptor) UseLayerInputUnitTransformMode() bool { + rv := objc.Call[bool](r_, objc.Sel("useLayerInputUnitTransformMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865687-uselayerinputunittransformmode?language=objc +func (r_ RNNDescriptor) SetUseLayerInputUnitTransformMode(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setUseLayerInputUnitTransformMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865707-inputfeaturechannels?language=objc +func (r_ RNNDescriptor) InputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("inputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2865707-inputfeaturechannels?language=objc +func (r_ RNNDescriptor) SetInputFeatureChannels(value uint) { + objc.Call[objc.Void](r_, objc.Sel("setInputFeatureChannels:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2881202-usefloat32weights?language=objc +func (r_ RNNDescriptor) UseFloat32Weights() bool { + rv := objc.Call[bool](r_, objc.Sel("useFloat32Weights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnndescriptor/2881202-usefloat32weights?language=objc +func (r_ RNNDescriptor) SetUseFloat32Weights(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setUseFloat32Weights:"), value) +} diff --git a/macos/mps/rnn_image_inference_layer.gen.go b/macos/mps/rnn_image_inference_layer.gen.go new file mode 100644 index 00000000..9f22ff54 --- /dev/null +++ b/macos/mps/rnn_image_inference_layer.gen.go @@ -0,0 +1,218 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNImageInferenceLayer] class. +var RNNImageInferenceLayerClass = _RNNImageInferenceLayerClass{objc.GetClass("MPSRNNImageInferenceLayer")} + +type _RNNImageInferenceLayerClass struct { + objc.Class +} + +// An interface definition for the [RNNImageInferenceLayer] class. +type IRNNImageInferenceLayer interface { + ICNNKernel + EncodeBidirectionalSequenceToCommandBufferSourceSequenceDestinationForwardImagesDestinationBackwardImages(commandBuffer metal.PCommandBuffer, sourceSequence []IImage, destinationForwardImages []IImage, destinationBackwardImages []IImage) + EncodeBidirectionalSequenceToCommandBufferObjectSourceSequenceDestinationForwardImagesDestinationBackwardImages(commandBufferObject objc.IObject, sourceSequence []IImage, destinationForwardImages []IImage, destinationBackwardImages []IImage) + EncodeSequenceToCommandBufferSourceImagesDestinationImagesRecurrentInputStateRecurrentOutputStates(commandBuffer metal.PCommandBuffer, sourceImages []IImage, destinationImages []IImage, recurrentInputState IRNNRecurrentImageState, recurrentOutputStates foundation.IMutableArray) + EncodeSequenceToCommandBufferObjectSourceImagesDestinationImagesRecurrentInputStateRecurrentOutputStates(commandBufferObject objc.IObject, sourceImages []IImage, destinationImages []IImage, recurrentInputState IRNNRecurrentImageState, recurrentOutputStates foundation.IMutableArray) + RecurrentOutputIsTemporary() bool + SetRecurrentOutputIsTemporary(value bool) + OutputFeatureChannels() uint + InputFeatureChannels() uint + BidirectionalCombineMode() RNNBidirectionalCombineMode + SetBidirectionalCombineMode(value RNNBidirectionalCombineMode) + StoreAllIntermediateStates() bool + SetStoreAllIntermediateStates(value bool) + NumberOfLayers() uint +} + +// A recurrent neural network layer for inference on Metal Performance Shaders images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer?language=objc +type RNNImageInferenceLayer struct { + CNNKernel +} + +func RNNImageInferenceLayerFrom(ptr unsafe.Pointer) RNNImageInferenceLayer { + return RNNImageInferenceLayer{ + CNNKernel: CNNKernelFrom(ptr), + } +} + +func (r_ RNNImageInferenceLayer) InitWithDeviceRnnDescriptor(device metal.PDevice, rnnDescriptor IRNNDescriptor) RNNImageInferenceLayer { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNImageInferenceLayer](r_, objc.Sel("initWithDevice:rnnDescriptor:"), po0, objc.Ptr(rnnDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865691-initwithdevice?language=objc +func NewRNNImageInferenceLayerWithDeviceRnnDescriptor(device metal.PDevice, rnnDescriptor IRNNDescriptor) RNNImageInferenceLayer { + instance := RNNImageInferenceLayerClass.Alloc().InitWithDeviceRnnDescriptor(device, rnnDescriptor) + instance.Autorelease() + return instance +} + +func (r_ RNNImageInferenceLayer) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RNNImageInferenceLayer { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNImageInferenceLayer](r_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865728-copywithzone?language=objc +func RNNImageInferenceLayer_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RNNImageInferenceLayer { + instance := RNNImageInferenceLayerClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (rc _RNNImageInferenceLayerClass) Alloc() RNNImageInferenceLayer { + rv := objc.Call[RNNImageInferenceLayer](rc, objc.Sel("alloc")) + return rv +} + +func RNNImageInferenceLayer_Alloc() RNNImageInferenceLayer { + return RNNImageInferenceLayerClass.Alloc() +} + +func (rc _RNNImageInferenceLayerClass) New() RNNImageInferenceLayer { + rv := objc.Call[RNNImageInferenceLayer](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNImageInferenceLayer() RNNImageInferenceLayer { + return RNNImageInferenceLayerClass.New() +} + +func (r_ RNNImageInferenceLayer) Init() RNNImageInferenceLayer { + rv := objc.Call[RNNImageInferenceLayer](r_, objc.Sel("init")) + return rv +} + +func (r_ RNNImageInferenceLayer) InitWithDevice(device metal.PDevice) RNNImageInferenceLayer { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNImageInferenceLayer](r_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnkernel/2865653-initwithdevice?language=objc +func NewRNNImageInferenceLayerWithDevice(device metal.PDevice) RNNImageInferenceLayer { + instance := RNNImageInferenceLayerClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865693-encodebidirectionalsequencetocom?language=objc +func (r_ RNNImageInferenceLayer) EncodeBidirectionalSequenceToCommandBufferSourceSequenceDestinationForwardImagesDestinationBackwardImages(commandBuffer metal.PCommandBuffer, sourceSequence []IImage, destinationForwardImages []IImage, destinationBackwardImages []IImage) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("encodeBidirectionalSequenceToCommandBuffer:sourceSequence:destinationForwardImages:destinationBackwardImages:"), po0, sourceSequence, destinationForwardImages, destinationBackwardImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865693-encodebidirectionalsequencetocom?language=objc +func (r_ RNNImageInferenceLayer) EncodeBidirectionalSequenceToCommandBufferObjectSourceSequenceDestinationForwardImagesDestinationBackwardImages(commandBufferObject objc.IObject, sourceSequence []IImage, destinationForwardImages []IImage, destinationBackwardImages []IImage) { + objc.Call[objc.Void](r_, objc.Sel("encodeBidirectionalSequenceToCommandBuffer:sourceSequence:destinationForwardImages:destinationBackwardImages:"), objc.Ptr(commandBufferObject), sourceSequence, destinationForwardImages, destinationBackwardImages) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865717-encodesequencetocommandbuffer?language=objc +func (r_ RNNImageInferenceLayer) EncodeSequenceToCommandBufferSourceImagesDestinationImagesRecurrentInputStateRecurrentOutputStates(commandBuffer metal.PCommandBuffer, sourceImages []IImage, destinationImages []IImage, recurrentInputState IRNNRecurrentImageState, recurrentOutputStates foundation.IMutableArray) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("encodeSequenceToCommandBuffer:sourceImages:destinationImages:recurrentInputState:recurrentOutputStates:"), po0, sourceImages, destinationImages, objc.Ptr(recurrentInputState), objc.Ptr(recurrentOutputStates)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865717-encodesequencetocommandbuffer?language=objc +func (r_ RNNImageInferenceLayer) EncodeSequenceToCommandBufferObjectSourceImagesDestinationImagesRecurrentInputStateRecurrentOutputStates(commandBufferObject objc.IObject, sourceImages []IImage, destinationImages []IImage, recurrentInputState IRNNRecurrentImageState, recurrentOutputStates foundation.IMutableArray) { + objc.Call[objc.Void](r_, objc.Sel("encodeSequenceToCommandBuffer:sourceImages:destinationImages:recurrentInputState:recurrentOutputStates:"), objc.Ptr(commandBufferObject), sourceImages, destinationImages, objc.Ptr(recurrentInputState), objc.Ptr(recurrentOutputStates)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865749-recurrentoutputistemporary?language=objc +func (r_ RNNImageInferenceLayer) RecurrentOutputIsTemporary() bool { + rv := objc.Call[bool](r_, objc.Sel("recurrentOutputIsTemporary")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865749-recurrentoutputistemporary?language=objc +func (r_ RNNImageInferenceLayer) SetRecurrentOutputIsTemporary(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setRecurrentOutputIsTemporary:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2890140-outputfeaturechannels?language=objc +func (r_ RNNImageInferenceLayer) OutputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("outputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2890141-inputfeaturechannels?language=objc +func (r_ RNNImageInferenceLayer) InputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("inputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865737-bidirectionalcombinemode?language=objc +func (r_ RNNImageInferenceLayer) BidirectionalCombineMode() RNNBidirectionalCombineMode { + rv := objc.Call[RNNBidirectionalCombineMode](r_, objc.Sel("bidirectionalCombineMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865737-bidirectionalcombinemode?language=objc +func (r_ RNNImageInferenceLayer) SetBidirectionalCombineMode(value RNNBidirectionalCombineMode) { + objc.Call[objc.Void](r_, objc.Sel("setBidirectionalCombineMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865706-storeallintermediatestates?language=objc +func (r_ RNNImageInferenceLayer) StoreAllIntermediateStates() bool { + rv := objc.Call[bool](r_, objc.Sel("storeAllIntermediateStates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865706-storeallintermediatestates?language=objc +func (r_ RNNImageInferenceLayer) SetStoreAllIntermediateStates(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setStoreAllIntermediateStates:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnimageinferencelayer/2865697-numberoflayers?language=objc +func (r_ RNNImageInferenceLayer) NumberOfLayers() uint { + rv := objc.Call[uint](r_, objc.Sel("numberOfLayers")) + return rv +} diff --git a/macos/mps/rnn_matrix_inference_layer.gen.go b/macos/mps/rnn_matrix_inference_layer.gen.go new file mode 100644 index 00000000..4b8bc7aa --- /dev/null +++ b/macos/mps/rnn_matrix_inference_layer.gen.go @@ -0,0 +1,218 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNMatrixInferenceLayer] class. +var RNNMatrixInferenceLayerClass = _RNNMatrixInferenceLayerClass{objc.GetClass("MPSRNNMatrixInferenceLayer")} + +type _RNNMatrixInferenceLayerClass struct { + objc.Class +} + +// An interface definition for the [RNNMatrixInferenceLayer] class. +type IRNNMatrixInferenceLayer interface { + IKernel + EncodeBidirectionalSequenceToCommandBufferSourceSequenceDestinationForwardMatricesDestinationBackwardMatrices(commandBuffer metal.PCommandBuffer, sourceSequence []IMatrix, destinationForwardMatrices []IMatrix, destinationBackwardMatrices []IMatrix) + EncodeBidirectionalSequenceToCommandBufferObjectSourceSequenceDestinationForwardMatricesDestinationBackwardMatrices(commandBufferObject objc.IObject, sourceSequence []IMatrix, destinationForwardMatrices []IMatrix, destinationBackwardMatrices []IMatrix) + EncodeSequenceToCommandBufferSourceMatricesSourceOffsetsDestinationMatricesDestinationOffsetsRecurrentInputStateRecurrentOutputStates(commandBuffer metal.PCommandBuffer, sourceMatrices []IMatrix, sourceOffsets *uint, destinationMatrices []IMatrix, destinationOffsets *uint, recurrentInputState IRNNRecurrentMatrixState, recurrentOutputStates foundation.IMutableArray) + EncodeSequenceToCommandBufferObjectSourceMatricesSourceOffsetsDestinationMatricesDestinationOffsetsRecurrentInputStateRecurrentOutputStates(commandBufferObject objc.IObject, sourceMatrices []IMatrix, sourceOffsets *uint, destinationMatrices []IMatrix, destinationOffsets *uint, recurrentInputState IRNNRecurrentMatrixState, recurrentOutputStates foundation.IMutableArray) + RecurrentOutputIsTemporary() bool + SetRecurrentOutputIsTemporary(value bool) + OutputFeatureChannels() uint + InputFeatureChannels() uint + BidirectionalCombineMode() RNNBidirectionalCombineMode + SetBidirectionalCombineMode(value RNNBidirectionalCombineMode) + StoreAllIntermediateStates() bool + SetStoreAllIntermediateStates(value bool) + NumberOfLayers() uint +} + +// A recurrent neural network layer for inference on Metal Performance Shaders matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer?language=objc +type RNNMatrixInferenceLayer struct { + Kernel +} + +func RNNMatrixInferenceLayerFrom(ptr unsafe.Pointer) RNNMatrixInferenceLayer { + return RNNMatrixInferenceLayer{ + Kernel: KernelFrom(ptr), + } +} + +func (r_ RNNMatrixInferenceLayer) InitWithDeviceRnnDescriptors(device metal.PDevice, rnnDescriptors []IRNNDescriptor) RNNMatrixInferenceLayer { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNMatrixInferenceLayer](r_, objc.Sel("initWithDevice:rnnDescriptors:"), po0, rnnDescriptors) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865751-initwithdevice?language=objc +func NewRNNMatrixInferenceLayerWithDeviceRnnDescriptors(device metal.PDevice, rnnDescriptors []IRNNDescriptor) RNNMatrixInferenceLayer { + instance := RNNMatrixInferenceLayerClass.Alloc().InitWithDeviceRnnDescriptors(device, rnnDescriptors) + instance.Autorelease() + return instance +} + +func (r_ RNNMatrixInferenceLayer) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RNNMatrixInferenceLayer { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNMatrixInferenceLayer](r_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865746-copywithzone?language=objc +func RNNMatrixInferenceLayer_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RNNMatrixInferenceLayer { + instance := RNNMatrixInferenceLayerClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (rc _RNNMatrixInferenceLayerClass) Alloc() RNNMatrixInferenceLayer { + rv := objc.Call[RNNMatrixInferenceLayer](rc, objc.Sel("alloc")) + return rv +} + +func RNNMatrixInferenceLayer_Alloc() RNNMatrixInferenceLayer { + return RNNMatrixInferenceLayerClass.Alloc() +} + +func (rc _RNNMatrixInferenceLayerClass) New() RNNMatrixInferenceLayer { + rv := objc.Call[RNNMatrixInferenceLayer](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNMatrixInferenceLayer() RNNMatrixInferenceLayer { + return RNNMatrixInferenceLayerClass.New() +} + +func (r_ RNNMatrixInferenceLayer) Init() RNNMatrixInferenceLayer { + rv := objc.Call[RNNMatrixInferenceLayer](r_, objc.Sel("init")) + return rv +} + +func (r_ RNNMatrixInferenceLayer) InitWithDevice(device metal.PDevice) RNNMatrixInferenceLayer { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNMatrixInferenceLayer](r_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewRNNMatrixInferenceLayerWithDevice(device metal.PDevice) RNNMatrixInferenceLayer { + instance := RNNMatrixInferenceLayerClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865698-encodebidirectionalsequencetocom?language=objc +func (r_ RNNMatrixInferenceLayer) EncodeBidirectionalSequenceToCommandBufferSourceSequenceDestinationForwardMatricesDestinationBackwardMatrices(commandBuffer metal.PCommandBuffer, sourceSequence []IMatrix, destinationForwardMatrices []IMatrix, destinationBackwardMatrices []IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("encodeBidirectionalSequenceToCommandBuffer:sourceSequence:destinationForwardMatrices:destinationBackwardMatrices:"), po0, sourceSequence, destinationForwardMatrices, destinationBackwardMatrices) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865698-encodebidirectionalsequencetocom?language=objc +func (r_ RNNMatrixInferenceLayer) EncodeBidirectionalSequenceToCommandBufferObjectSourceSequenceDestinationForwardMatricesDestinationBackwardMatrices(commandBufferObject objc.IObject, sourceSequence []IMatrix, destinationForwardMatrices []IMatrix, destinationBackwardMatrices []IMatrix) { + objc.Call[objc.Void](r_, objc.Sel("encodeBidirectionalSequenceToCommandBuffer:sourceSequence:destinationForwardMatrices:destinationBackwardMatrices:"), objc.Ptr(commandBufferObject), sourceSequence, destinationForwardMatrices, destinationBackwardMatrices) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2966781-encodesequencetocommandbuffer?language=objc +func (r_ RNNMatrixInferenceLayer) EncodeSequenceToCommandBufferSourceMatricesSourceOffsetsDestinationMatricesDestinationOffsetsRecurrentInputStateRecurrentOutputStates(commandBuffer metal.PCommandBuffer, sourceMatrices []IMatrix, sourceOffsets *uint, destinationMatrices []IMatrix, destinationOffsets *uint, recurrentInputState IRNNRecurrentMatrixState, recurrentOutputStates foundation.IMutableArray) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("encodeSequenceToCommandBuffer:sourceMatrices:sourceOffsets:destinationMatrices:destinationOffsets:recurrentInputState:recurrentOutputStates:"), po0, sourceMatrices, sourceOffsets, destinationMatrices, destinationOffsets, objc.Ptr(recurrentInputState), objc.Ptr(recurrentOutputStates)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2966781-encodesequencetocommandbuffer?language=objc +func (r_ RNNMatrixInferenceLayer) EncodeSequenceToCommandBufferObjectSourceMatricesSourceOffsetsDestinationMatricesDestinationOffsetsRecurrentInputStateRecurrentOutputStates(commandBufferObject objc.IObject, sourceMatrices []IMatrix, sourceOffsets *uint, destinationMatrices []IMatrix, destinationOffsets *uint, recurrentInputState IRNNRecurrentMatrixState, recurrentOutputStates foundation.IMutableArray) { + objc.Call[objc.Void](r_, objc.Sel("encodeSequenceToCommandBuffer:sourceMatrices:sourceOffsets:destinationMatrices:destinationOffsets:recurrentInputState:recurrentOutputStates:"), objc.Ptr(commandBufferObject), sourceMatrices, sourceOffsets, destinationMatrices, destinationOffsets, objc.Ptr(recurrentInputState), objc.Ptr(recurrentOutputStates)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865714-recurrentoutputistemporary?language=objc +func (r_ RNNMatrixInferenceLayer) RecurrentOutputIsTemporary() bool { + rv := objc.Call[bool](r_, objc.Sel("recurrentOutputIsTemporary")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865714-recurrentoutputistemporary?language=objc +func (r_ RNNMatrixInferenceLayer) SetRecurrentOutputIsTemporary(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setRecurrentOutputIsTemporary:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2890142-outputfeaturechannels?language=objc +func (r_ RNNMatrixInferenceLayer) OutputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("outputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2890143-inputfeaturechannels?language=objc +func (r_ RNNMatrixInferenceLayer) InputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("inputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865739-bidirectionalcombinemode?language=objc +func (r_ RNNMatrixInferenceLayer) BidirectionalCombineMode() RNNBidirectionalCombineMode { + rv := objc.Call[RNNBidirectionalCombineMode](r_, objc.Sel("bidirectionalCombineMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865739-bidirectionalcombinemode?language=objc +func (r_ RNNMatrixInferenceLayer) SetBidirectionalCombineMode(value RNNBidirectionalCombineMode) { + objc.Call[objc.Void](r_, objc.Sel("setBidirectionalCombineMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865729-storeallintermediatestates?language=objc +func (r_ RNNMatrixInferenceLayer) StoreAllIntermediateStates() bool { + rv := objc.Call[bool](r_, objc.Sel("storeAllIntermediateStates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2865729-storeallintermediatestates?language=objc +func (r_ RNNMatrixInferenceLayer) SetStoreAllIntermediateStates(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setStoreAllIntermediateStates:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixinferencelayer/2873347-numberoflayers?language=objc +func (r_ RNNMatrixInferenceLayer) NumberOfLayers() uint { + rv := objc.Call[uint](r_, objc.Sel("numberOfLayers")) + return rv +} diff --git a/macos/mps/rnn_matrix_training_layer.gen.go b/macos/mps/rnn_matrix_training_layer.gen.go new file mode 100644 index 00000000..a10aed11 --- /dev/null +++ b/macos/mps/rnn_matrix_training_layer.gen.go @@ -0,0 +1,276 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNMatrixTrainingLayer] class. +var RNNMatrixTrainingLayerClass = _RNNMatrixTrainingLayerClass{objc.GetClass("MPSRNNMatrixTrainingLayer")} + +type _RNNMatrixTrainingLayerClass struct { + objc.Class +} + +// An interface definition for the [RNNMatrixTrainingLayer] class. +type IRNNMatrixTrainingLayer interface { + IKernel + CreateTemporaryWeightGradientMatricesDataTypeCommandBuffer(matricesOut foundation.IMutableArray, dataType DataType, commandBuffer metal.PCommandBuffer) + CreateTemporaryWeightGradientMatricesDataTypeCommandBufferObject(matricesOut foundation.IMutableArray, dataType DataType, commandBufferObject objc.IObject) + EncodeCopyWeightsToCommandBufferWeightsMatrixIdMatrixCopyFromWeightsToMatrixMatrixOffset(commandBuffer metal.PCommandBuffer, weights []IMatrix, matrixId RNNMatrixId, matrix IMatrix, copyFromWeightsToMatrix bool, matrixOffset metal.Origin) + EncodeCopyWeightsToCommandBufferObjectWeightsMatrixIdMatrixCopyFromWeightsToMatrixMatrixOffset(commandBufferObject objc.IObject, weights []IMatrix, matrixId RNNMatrixId, matrix IMatrix, copyFromWeightsToMatrix bool, matrixOffset metal.Origin) + EncodeForwardSequenceToCommandBufferSourceMatricesDestinationMatricesTrainingStatesWeights(commandBuffer metal.PCommandBuffer, sourceMatrices []IMatrix, destinationMatrices []IMatrix, trainingStates foundation.IMutableArray, weights []IMatrix) + EncodeForwardSequenceToCommandBufferObjectSourceMatricesDestinationMatricesTrainingStatesWeights(commandBufferObject objc.IObject, sourceMatrices []IMatrix, destinationMatrices []IMatrix, trainingStates foundation.IMutableArray, weights []IMatrix) + EncodeGradientSequenceToCommandBufferForwardSourcesSourceGradientsDestinationGradientsWeightGradientsTrainingStatesWeights(commandBuffer metal.PCommandBuffer, forwardSources []IMatrix, sourceGradients []IMatrix, destinationGradients []IMatrix, weightGradients []IMatrix, trainingStates []IRNNMatrixTrainingState, weights []IMatrix) + EncodeGradientSequenceToCommandBufferObjectForwardSourcesSourceGradientsDestinationGradientsWeightGradientsTrainingStatesWeights(commandBufferObject objc.IObject, forwardSources []IMatrix, sourceGradients []IMatrix, destinationGradients []IMatrix, weightGradients []IMatrix, trainingStates []IRNNMatrixTrainingState, weights []IMatrix) + CreateWeightMatrices(matricesOut foundation.IMutableArray) + CreateWeightGradientMatricesDataType(matricesOut foundation.IMutableArray, dataType DataType) + RecurrentOutputIsTemporary() bool + SetRecurrentOutputIsTemporary(value bool) + AccumulateWeightGradients() bool + SetAccumulateWeightGradients(value bool) + OutputFeatureChannels() uint + InputFeatureChannels() uint + TrainingStateIsTemporary() bool + SetTrainingStateIsTemporary(value bool) + StoreAllIntermediateStates() bool + SetStoreAllIntermediateStates(value bool) +} + +// A layer for training recurrent neural networks on Metal Performance Shaders matrices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer?language=objc +type RNNMatrixTrainingLayer struct { + Kernel +} + +func RNNMatrixTrainingLayerFrom(ptr unsafe.Pointer) RNNMatrixTrainingLayer { + return RNNMatrixTrainingLayer{ + Kernel: KernelFrom(ptr), + } +} + +func (r_ RNNMatrixTrainingLayer) InitWithDeviceRnnDescriptorTrainableWeights(device metal.PDevice, rnnDescriptor IRNNDescriptor, trainableWeights foundation.IMutableArray) RNNMatrixTrainingLayer { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNMatrixTrainingLayer](r_, objc.Sel("initWithDevice:rnnDescriptor:trainableWeights:"), po0, objc.Ptr(rnnDescriptor), objc.Ptr(trainableWeights)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966794-initwithdevice?language=objc +func NewRNNMatrixTrainingLayerWithDeviceRnnDescriptorTrainableWeights(device metal.PDevice, rnnDescriptor IRNNDescriptor, trainableWeights foundation.IMutableArray) RNNMatrixTrainingLayer { + instance := RNNMatrixTrainingLayerClass.Alloc().InitWithDeviceRnnDescriptorTrainableWeights(device, rnnDescriptor, trainableWeights) + instance.Autorelease() + return instance +} + +func (r_ RNNMatrixTrainingLayer) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RNNMatrixTrainingLayer { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNMatrixTrainingLayer](r_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966784-copywithzone?language=objc +func RNNMatrixTrainingLayer_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) RNNMatrixTrainingLayer { + instance := RNNMatrixTrainingLayerClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (rc _RNNMatrixTrainingLayerClass) Alloc() RNNMatrixTrainingLayer { + rv := objc.Call[RNNMatrixTrainingLayer](rc, objc.Sel("alloc")) + return rv +} + +func RNNMatrixTrainingLayer_Alloc() RNNMatrixTrainingLayer { + return RNNMatrixTrainingLayerClass.Alloc() +} + +func (rc _RNNMatrixTrainingLayerClass) New() RNNMatrixTrainingLayer { + rv := objc.Call[RNNMatrixTrainingLayer](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNMatrixTrainingLayer() RNNMatrixTrainingLayer { + return RNNMatrixTrainingLayerClass.New() +} + +func (r_ RNNMatrixTrainingLayer) Init() RNNMatrixTrainingLayer { + rv := objc.Call[RNNMatrixTrainingLayer](r_, objc.Sel("init")) + return rv +} + +func (r_ RNNMatrixTrainingLayer) InitWithDevice(device metal.PDevice) RNNMatrixTrainingLayer { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNMatrixTrainingLayer](r_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewRNNMatrixTrainingLayerWithDevice(device metal.PDevice) RNNMatrixTrainingLayer { + instance := RNNMatrixTrainingLayerClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966785-createtemporaryweightgradientmat?language=objc +func (r_ RNNMatrixTrainingLayer) CreateTemporaryWeightGradientMatricesDataTypeCommandBuffer(matricesOut foundation.IMutableArray, dataType DataType, commandBuffer metal.PCommandBuffer) { + po2 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("createTemporaryWeightGradientMatrices:dataType:commandBuffer:"), objc.Ptr(matricesOut), dataType, po2) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966785-createtemporaryweightgradientmat?language=objc +func (r_ RNNMatrixTrainingLayer) CreateTemporaryWeightGradientMatricesDataTypeCommandBufferObject(matricesOut foundation.IMutableArray, dataType DataType, commandBufferObject objc.IObject) { + objc.Call[objc.Void](r_, objc.Sel("createTemporaryWeightGradientMatrices:dataType:commandBuffer:"), objc.Ptr(matricesOut), dataType, objc.Ptr(commandBufferObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966788-encodecopyweightstocommandbuffer?language=objc +func (r_ RNNMatrixTrainingLayer) EncodeCopyWeightsToCommandBufferWeightsMatrixIdMatrixCopyFromWeightsToMatrixMatrixOffset(commandBuffer metal.PCommandBuffer, weights []IMatrix, matrixId RNNMatrixId, matrix IMatrix, copyFromWeightsToMatrix bool, matrixOffset metal.Origin) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("encodeCopyWeightsToCommandBuffer:weights:matrixId:matrix:copyFromWeightsToMatrix:matrixOffset:"), po0, weights, matrixId, objc.Ptr(matrix), copyFromWeightsToMatrix, matrixOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966788-encodecopyweightstocommandbuffer?language=objc +func (r_ RNNMatrixTrainingLayer) EncodeCopyWeightsToCommandBufferObjectWeightsMatrixIdMatrixCopyFromWeightsToMatrixMatrixOffset(commandBufferObject objc.IObject, weights []IMatrix, matrixId RNNMatrixId, matrix IMatrix, copyFromWeightsToMatrix bool, matrixOffset metal.Origin) { + objc.Call[objc.Void](r_, objc.Sel("encodeCopyWeightsToCommandBuffer:weights:matrixId:matrix:copyFromWeightsToMatrix:matrixOffset:"), objc.Ptr(commandBufferObject), weights, matrixId, objc.Ptr(matrix), copyFromWeightsToMatrix, matrixOffset) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966789-encodeforwardsequencetocommandbu?language=objc +func (r_ RNNMatrixTrainingLayer) EncodeForwardSequenceToCommandBufferSourceMatricesDestinationMatricesTrainingStatesWeights(commandBuffer metal.PCommandBuffer, sourceMatrices []IMatrix, destinationMatrices []IMatrix, trainingStates foundation.IMutableArray, weights []IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("encodeForwardSequenceToCommandBuffer:sourceMatrices:destinationMatrices:trainingStates:weights:"), po0, sourceMatrices, destinationMatrices, objc.Ptr(trainingStates), weights) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966789-encodeforwardsequencetocommandbu?language=objc +func (r_ RNNMatrixTrainingLayer) EncodeForwardSequenceToCommandBufferObjectSourceMatricesDestinationMatricesTrainingStatesWeights(commandBufferObject objc.IObject, sourceMatrices []IMatrix, destinationMatrices []IMatrix, trainingStates foundation.IMutableArray, weights []IMatrix) { + objc.Call[objc.Void](r_, objc.Sel("encodeForwardSequenceToCommandBuffer:sourceMatrices:destinationMatrices:trainingStates:weights:"), objc.Ptr(commandBufferObject), sourceMatrices, destinationMatrices, objc.Ptr(trainingStates), weights) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966792-encodegradientsequencetocommandb?language=objc +func (r_ RNNMatrixTrainingLayer) EncodeGradientSequenceToCommandBufferForwardSourcesSourceGradientsDestinationGradientsWeightGradientsTrainingStatesWeights(commandBuffer metal.PCommandBuffer, forwardSources []IMatrix, sourceGradients []IMatrix, destinationGradients []IMatrix, weightGradients []IMatrix, trainingStates []IRNNMatrixTrainingState, weights []IMatrix) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](r_, objc.Sel("encodeGradientSequenceToCommandBuffer:forwardSources:sourceGradients:destinationGradients:weightGradients:trainingStates:weights:"), po0, forwardSources, sourceGradients, destinationGradients, weightGradients, trainingStates, weights) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966792-encodegradientsequencetocommandb?language=objc +func (r_ RNNMatrixTrainingLayer) EncodeGradientSequenceToCommandBufferObjectForwardSourcesSourceGradientsDestinationGradientsWeightGradientsTrainingStatesWeights(commandBufferObject objc.IObject, forwardSources []IMatrix, sourceGradients []IMatrix, destinationGradients []IMatrix, weightGradients []IMatrix, trainingStates []IRNNMatrixTrainingState, weights []IMatrix) { + objc.Call[objc.Void](r_, objc.Sel("encodeGradientSequenceToCommandBuffer:forwardSources:sourceGradients:destinationGradients:weightGradients:trainingStates:weights:"), objc.Ptr(commandBufferObject), forwardSources, sourceGradients, destinationGradients, weightGradients, trainingStates, weights) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966787-createweightmatrices?language=objc +func (r_ RNNMatrixTrainingLayer) CreateWeightMatrices(matricesOut foundation.IMutableArray) { + objc.Call[objc.Void](r_, objc.Sel("createWeightMatrices:"), objc.Ptr(matricesOut)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966786-createweightgradientmatrices?language=objc +func (r_ RNNMatrixTrainingLayer) CreateWeightGradientMatricesDataType(matricesOut foundation.IMutableArray, dataType DataType) { + objc.Call[objc.Void](r_, objc.Sel("createWeightGradientMatrices:dataType:"), objc.Ptr(matricesOut), dataType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966797-recurrentoutputistemporary?language=objc +func (r_ RNNMatrixTrainingLayer) RecurrentOutputIsTemporary() bool { + rv := objc.Call[bool](r_, objc.Sel("recurrentOutputIsTemporary")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966797-recurrentoutputistemporary?language=objc +func (r_ RNNMatrixTrainingLayer) SetRecurrentOutputIsTemporary(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setRecurrentOutputIsTemporary:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966783-accumulateweightgradients?language=objc +func (r_ RNNMatrixTrainingLayer) AccumulateWeightGradients() bool { + rv := objc.Call[bool](r_, objc.Sel("accumulateWeightGradients")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966783-accumulateweightgradients?language=objc +func (r_ RNNMatrixTrainingLayer) SetAccumulateWeightGradients(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setAccumulateWeightGradients:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966796-outputfeaturechannels?language=objc +func (r_ RNNMatrixTrainingLayer) OutputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("outputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966795-inputfeaturechannels?language=objc +func (r_ RNNMatrixTrainingLayer) InputFeatureChannels() uint { + rv := objc.Call[uint](r_, objc.Sel("inputFeatureChannels")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966799-trainingstateistemporary?language=objc +func (r_ RNNMatrixTrainingLayer) TrainingStateIsTemporary() bool { + rv := objc.Call[bool](r_, objc.Sel("trainingStateIsTemporary")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966799-trainingstateistemporary?language=objc +func (r_ RNNMatrixTrainingLayer) SetTrainingStateIsTemporary(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setTrainingStateIsTemporary:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966798-storeallintermediatestates?language=objc +func (r_ RNNMatrixTrainingLayer) StoreAllIntermediateStates() bool { + rv := objc.Call[bool](r_, objc.Sel("storeAllIntermediateStates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtraininglayer/2966798-storeallintermediatestates?language=objc +func (r_ RNNMatrixTrainingLayer) SetStoreAllIntermediateStates(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setStoreAllIntermediateStates:"), value) +} diff --git a/macos/mps/rnn_matrix_training_state.gen.go b/macos/mps/rnn_matrix_training_state.gen.go new file mode 100644 index 00000000..57dce928 --- /dev/null +++ b/macos/mps/rnn_matrix_training_state.gen.go @@ -0,0 +1,116 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNMatrixTrainingState] class. +var RNNMatrixTrainingStateClass = _RNNMatrixTrainingStateClass{objc.GetClass("MPSRNNMatrixTrainingState")} + +type _RNNMatrixTrainingStateClass struct { + objc.Class +} + +// An interface definition for the [RNNMatrixTrainingState] class. +type IRNNMatrixTrainingState interface { + IState +} + +// A class that holds data from a forward pass to be used in a backward pass. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnmatrixtrainingstate?language=objc +type RNNMatrixTrainingState struct { + State +} + +func RNNMatrixTrainingStateFrom(ptr unsafe.Pointer) RNNMatrixTrainingState { + return RNNMatrixTrainingState{ + State: StateFrom(ptr), + } +} + +func (rc _RNNMatrixTrainingStateClass) Alloc() RNNMatrixTrainingState { + rv := objc.Call[RNNMatrixTrainingState](rc, objc.Sel("alloc")) + return rv +} + +func RNNMatrixTrainingState_Alloc() RNNMatrixTrainingState { + return RNNMatrixTrainingStateClass.Alloc() +} + +func (rc _RNNMatrixTrainingStateClass) New() RNNMatrixTrainingState { + rv := objc.Call[RNNMatrixTrainingState](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNMatrixTrainingState() RNNMatrixTrainingState { + return RNNMatrixTrainingStateClass.New() +} + +func (r_ RNNMatrixTrainingState) Init() RNNMatrixTrainingState { + rv := objc.Call[RNNMatrixTrainingState](r_, objc.Sel("init")) + return rv +} + +func (r_ RNNMatrixTrainingState) InitWithResources(resources []metal.PResource) RNNMatrixTrainingState { + rv := objc.Call[RNNMatrixTrainingState](r_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewRNNMatrixTrainingStateWithResources(resources []metal.PResource) RNNMatrixTrainingState { + instance := RNNMatrixTrainingStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (r_ RNNMatrixTrainingState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) RNNMatrixTrainingState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNMatrixTrainingState](r_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewRNNMatrixTrainingStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) RNNMatrixTrainingState { + instance := RNNMatrixTrainingStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (r_ RNNMatrixTrainingState) InitWithResource(resource metal.PResource) RNNMatrixTrainingState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[RNNMatrixTrainingState](r_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewRNNMatrixTrainingStateWithResource(resource metal.PResource) RNNMatrixTrainingState { + instance := RNNMatrixTrainingStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (rc _RNNMatrixTrainingStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) RNNMatrixTrainingState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[RNNMatrixTrainingState](rc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func RNNMatrixTrainingState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) RNNMatrixTrainingState { + return RNNMatrixTrainingStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} diff --git a/macos/mps/rnn_recurrent_image_state.gen.go b/macos/mps/rnn_recurrent_image_state.gen.go new file mode 100644 index 00000000..996b3a58 --- /dev/null +++ b/macos/mps/rnn_recurrent_image_state.gen.go @@ -0,0 +1,134 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNRecurrentImageState] class. +var RNNRecurrentImageStateClass = _RNNRecurrentImageStateClass{objc.GetClass("MPSRNNRecurrentImageState")} + +type _RNNRecurrentImageStateClass struct { + objc.Class +} + +// An interface definition for the [RNNRecurrentImageState] class. +type IRNNRecurrentImageState interface { + IState + GetRecurrentOutputImageForLayerIndex(layerIndex uint) Image + GetMemoryCellImageForLayerIndex(layerIndex uint) Image +} + +// A class that holds all the data that's passed from one sequence iteration of the image-based recurrent neural network layer (stack) to the next. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnrecurrentimagestate?language=objc +type RNNRecurrentImageState struct { + State +} + +func RNNRecurrentImageStateFrom(ptr unsafe.Pointer) RNNRecurrentImageState { + return RNNRecurrentImageState{ + State: StateFrom(ptr), + } +} + +func (rc _RNNRecurrentImageStateClass) Alloc() RNNRecurrentImageState { + rv := objc.Call[RNNRecurrentImageState](rc, objc.Sel("alloc")) + return rv +} + +func RNNRecurrentImageState_Alloc() RNNRecurrentImageState { + return RNNRecurrentImageStateClass.Alloc() +} + +func (rc _RNNRecurrentImageStateClass) New() RNNRecurrentImageState { + rv := objc.Call[RNNRecurrentImageState](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNRecurrentImageState() RNNRecurrentImageState { + return RNNRecurrentImageStateClass.New() +} + +func (r_ RNNRecurrentImageState) Init() RNNRecurrentImageState { + rv := objc.Call[RNNRecurrentImageState](r_, objc.Sel("init")) + return rv +} + +func (r_ RNNRecurrentImageState) InitWithResources(resources []metal.PResource) RNNRecurrentImageState { + rv := objc.Call[RNNRecurrentImageState](r_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewRNNRecurrentImageStateWithResources(resources []metal.PResource) RNNRecurrentImageState { + instance := RNNRecurrentImageStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (r_ RNNRecurrentImageState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) RNNRecurrentImageState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNRecurrentImageState](r_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewRNNRecurrentImageStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) RNNRecurrentImageState { + instance := RNNRecurrentImageStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (r_ RNNRecurrentImageState) InitWithResource(resource metal.PResource) RNNRecurrentImageState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[RNNRecurrentImageState](r_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewRNNRecurrentImageStateWithResource(resource metal.PResource) RNNRecurrentImageState { + instance := RNNRecurrentImageStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (rc _RNNRecurrentImageStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) RNNRecurrentImageState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[RNNRecurrentImageState](rc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func RNNRecurrentImageState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) RNNRecurrentImageState { + return RNNRecurrentImageStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnrecurrentimagestate/2865742-getrecurrentoutputimageforlayeri?language=objc +func (r_ RNNRecurrentImageState) GetRecurrentOutputImageForLayerIndex(layerIndex uint) Image { + rv := objc.Call[Image](r_, objc.Sel("getRecurrentOutputImageForLayerIndex:"), layerIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnrecurrentimagestate/2865740-getmemorycellimageforlayerindex?language=objc +func (r_ RNNRecurrentImageState) GetMemoryCellImageForLayerIndex(layerIndex uint) Image { + rv := objc.Call[Image](r_, objc.Sel("getMemoryCellImageForLayerIndex:"), layerIndex) + return rv +} diff --git a/macos/mps/rnn_recurrent_matrix_state.gen.go b/macos/mps/rnn_recurrent_matrix_state.gen.go new file mode 100644 index 00000000..14d54855 --- /dev/null +++ b/macos/mps/rnn_recurrent_matrix_state.gen.go @@ -0,0 +1,134 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNRecurrentMatrixState] class. +var RNNRecurrentMatrixStateClass = _RNNRecurrentMatrixStateClass{objc.GetClass("MPSRNNRecurrentMatrixState")} + +type _RNNRecurrentMatrixStateClass struct { + objc.Class +} + +// An interface definition for the [RNNRecurrentMatrixState] class. +type IRNNRecurrentMatrixState interface { + IState + GetMemoryCellMatrixForLayerIndex(layerIndex uint) Matrix + GetRecurrentOutputMatrixForLayerIndex(layerIndex uint) Matrix +} + +// A class holds all the data that's passed from one sequence iteration of the matrix-based recurrent neural network layer to the next. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnrecurrentmatrixstate?language=objc +type RNNRecurrentMatrixState struct { + State +} + +func RNNRecurrentMatrixStateFrom(ptr unsafe.Pointer) RNNRecurrentMatrixState { + return RNNRecurrentMatrixState{ + State: StateFrom(ptr), + } +} + +func (rc _RNNRecurrentMatrixStateClass) Alloc() RNNRecurrentMatrixState { + rv := objc.Call[RNNRecurrentMatrixState](rc, objc.Sel("alloc")) + return rv +} + +func RNNRecurrentMatrixState_Alloc() RNNRecurrentMatrixState { + return RNNRecurrentMatrixStateClass.Alloc() +} + +func (rc _RNNRecurrentMatrixStateClass) New() RNNRecurrentMatrixState { + rv := objc.Call[RNNRecurrentMatrixState](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNRecurrentMatrixState() RNNRecurrentMatrixState { + return RNNRecurrentMatrixStateClass.New() +} + +func (r_ RNNRecurrentMatrixState) Init() RNNRecurrentMatrixState { + rv := objc.Call[RNNRecurrentMatrixState](r_, objc.Sel("init")) + return rv +} + +func (r_ RNNRecurrentMatrixState) InitWithResources(resources []metal.PResource) RNNRecurrentMatrixState { + rv := objc.Call[RNNRecurrentMatrixState](r_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewRNNRecurrentMatrixStateWithResources(resources []metal.PResource) RNNRecurrentMatrixState { + instance := RNNRecurrentMatrixStateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (r_ RNNRecurrentMatrixState) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) RNNRecurrentMatrixState { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[RNNRecurrentMatrixState](r_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewRNNRecurrentMatrixStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) RNNRecurrentMatrixState { + instance := RNNRecurrentMatrixStateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (r_ RNNRecurrentMatrixState) InitWithResource(resource metal.PResource) RNNRecurrentMatrixState { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[RNNRecurrentMatrixState](r_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewRNNRecurrentMatrixStateWithResource(resource metal.PResource) RNNRecurrentMatrixState { + instance := RNNRecurrentMatrixStateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (rc _RNNRecurrentMatrixStateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) RNNRecurrentMatrixState { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[RNNRecurrentMatrixState](rc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func RNNRecurrentMatrixState_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) RNNRecurrentMatrixState { + return RNNRecurrentMatrixStateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnrecurrentmatrixstate/2873390-getmemorycellmatrixforlayerindex?language=objc +func (r_ RNNRecurrentMatrixState) GetMemoryCellMatrixForLayerIndex(layerIndex uint) Matrix { + rv := objc.Call[Matrix](r_, objc.Sel("getMemoryCellMatrixForLayerIndex:"), layerIndex) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnrecurrentmatrixstate/2873339-getrecurrentoutputmatrixforlayer?language=objc +func (r_ RNNRecurrentMatrixState) GetRecurrentOutputMatrixForLayerIndex(layerIndex uint) Matrix { + rv := objc.Call[Matrix](r_, objc.Sel("getRecurrentOutputMatrixForLayerIndex:"), layerIndex) + return rv +} diff --git a/macos/mps/rnn_single_gate_descriptor.gen.go b/macos/mps/rnn_single_gate_descriptor.gen.go new file mode 100644 index 00000000..0887f139 --- /dev/null +++ b/macos/mps/rnn_single_gate_descriptor.gen.go @@ -0,0 +1,122 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RNNSingleGateDescriptor] class. +var RNNSingleGateDescriptorClass = _RNNSingleGateDescriptorClass{objc.GetClass("MPSRNNSingleGateDescriptor")} + +type _RNNSingleGateDescriptorClass struct { + objc.Class +} + +// An interface definition for the [RNNSingleGateDescriptor] class. +type IRNNSingleGateDescriptor interface { + IRNNDescriptor + RecurrentWeights() CNNConvolutionDataSourceWrapper + SetRecurrentWeights(value PCNNConvolutionDataSource) + SetRecurrentWeightsObject(valueObject objc.IObject) + InputWeights() CNNConvolutionDataSourceWrapper + SetInputWeights(value PCNNConvolutionDataSource) + SetInputWeightsObject(valueObject objc.IObject) +} + +// A description of a simple recurrent block or layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor?language=objc +type RNNSingleGateDescriptor struct { + RNNDescriptor +} + +func RNNSingleGateDescriptorFrom(ptr unsafe.Pointer) RNNSingleGateDescriptor { + return RNNSingleGateDescriptor{ + RNNDescriptor: RNNDescriptorFrom(ptr), + } +} + +func (rc _RNNSingleGateDescriptorClass) CreateRNNSingleGateDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels uint, outputFeatureChannels uint) RNNSingleGateDescriptor { + rv := objc.Call[RNNSingleGateDescriptor](rc, objc.Sel("createRNNSingleGateDescriptorWithInputFeatureChannels:outputFeatureChannels:"), inputFeatureChannels, outputFeatureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor/2865703-creaternnsinglegatedescriptorwit?language=objc +func RNNSingleGateDescriptor_CreateRNNSingleGateDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels uint, outputFeatureChannels uint) RNNSingleGateDescriptor { + return RNNSingleGateDescriptorClass.CreateRNNSingleGateDescriptorWithInputFeatureChannelsOutputFeatureChannels(inputFeatureChannels, outputFeatureChannels) +} + +func (rc _RNNSingleGateDescriptorClass) Alloc() RNNSingleGateDescriptor { + rv := objc.Call[RNNSingleGateDescriptor](rc, objc.Sel("alloc")) + return rv +} + +func RNNSingleGateDescriptor_Alloc() RNNSingleGateDescriptor { + return RNNSingleGateDescriptorClass.Alloc() +} + +func (rc _RNNSingleGateDescriptorClass) New() RNNSingleGateDescriptor { + rv := objc.Call[RNNSingleGateDescriptor](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRNNSingleGateDescriptor() RNNSingleGateDescriptor { + return RNNSingleGateDescriptorClass.New() +} + +func (r_ RNNSingleGateDescriptor) Init() RNNSingleGateDescriptor { + rv := objc.Call[RNNSingleGateDescriptor](r_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor/2865686-recurrentweights?language=objc +func (r_ RNNSingleGateDescriptor) RecurrentWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](r_, objc.Sel("recurrentWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor/2865686-recurrentweights?language=objc +func (r_ RNNSingleGateDescriptor) SetRecurrentWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](r_, objc.Sel("setRecurrentWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor/2865686-recurrentweights?language=objc +func (r_ RNNSingleGateDescriptor) SetRecurrentWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](r_, objc.Sel("setRecurrentWeights:"), objc.Ptr(valueObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor/2865723-inputweights?language=objc +func (r_ RNNSingleGateDescriptor) InputWeights() CNNConvolutionDataSourceWrapper { + rv := objc.Call[CNNConvolutionDataSourceWrapper](r_, objc.Sel("inputWeights")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor/2865723-inputweights?language=objc +func (r_ RNNSingleGateDescriptor) SetInputWeights(value PCNNConvolutionDataSource) { + po0 := objc.WrapAsProtocol("MPSCNNConvolutionDataSource", value) + objc.Call[objc.Void](r_, objc.Sel("setInputWeights:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsrnnsinglegatedescriptor/2865723-inputweights?language=objc +func (r_ RNNSingleGateDescriptor) SetInputWeightsObject(valueObject objc.IObject) { + objc.Call[objc.Void](r_, objc.Sel("setInputWeights:"), objc.Ptr(valueObject)) +} diff --git a/macos/mps/state.gen.go b/macos/mps/state.gen.go new file mode 100644 index 00000000..92778a2c --- /dev/null +++ b/macos/mps/state.gen.go @@ -0,0 +1,239 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [State] class. +var StateClass = _StateClass{objc.GetClass("MPSState")} + +type _StateClass struct { + objc.Class +} + +// An interface definition for the [State] class. +type IState interface { + objc.IObject + ResourceTypeAtIndex(index uint) StateResourceType + DestinationImageDescriptorForSourceImagesSourceStatesForKernelSuggestedDescriptor(sourceImages []IImage, sourceStates []IState, kernel IKernel, inDescriptor IImageDescriptor) ImageDescriptor + BufferSizeAtIndex(index uint) uint + ResourceSize() uint + TextureInfoAtIndex(index uint) StateTextureInfo + ResourceAtIndexAllocateMemory(index uint, allocateMemory bool) metal.ResourceWrapper + SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) + SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) + ResourceCount() uint + IsTemporary() bool + ReadCount() uint + SetReadCount(value uint) + Label() string + SetLabel(value string) +} + +// An opaque data container for large storage in MPS CNN filters. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate?language=objc +type State struct { + objc.Object +} + +func StateFrom(ptr unsafe.Pointer) State { + return State{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ State) InitWithResources(resources []metal.PResource) State { + rv := objc.Call[State](s_, objc.Sel("initWithResources:"), resources) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947895-initwithresources?language=objc +func NewStateWithResources(resources []metal.PResource) State { + instance := StateClass.Alloc().InitWithResources(resources) + instance.Autorelease() + return instance +} + +func (s_ State) InitWithDeviceBufferSize(device metal.PDevice, bufferSize uint) State { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[State](s_, objc.Sel("initWithDevice:bufferSize:"), po0, bufferSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942392-initwithdevice?language=objc +func NewStateWithDeviceBufferSize(device metal.PDevice, bufferSize uint) State { + instance := StateClass.Alloc().InitWithDeviceBufferSize(device, bufferSize) + instance.Autorelease() + return instance +} + +func (s_ State) InitWithResource(resource metal.PResource) State { + po0 := objc.WrapAsProtocol("MTLResource", resource) + rv := objc.Call[State](s_, objc.Sel("initWithResource:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942390-initwithresource?language=objc +func NewStateWithResource(resource metal.PResource) State { + instance := StateClass.Alloc().InitWithResource(resource) + instance.Autorelease() + return instance +} + +func (sc _StateClass) TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) State { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[State](sc, objc.Sel("temporaryStateWithCommandBuffer:resourceList:"), po0, objc.Ptr(resourceList)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947915-temporarystatewithcommandbuffer?language=objc +func State_TemporaryStateWithCommandBufferResourceList(commandBuffer metal.PCommandBuffer, resourceList IStateResourceList) State { + return StateClass.TemporaryStateWithCommandBufferResourceList(commandBuffer, resourceList) +} + +func (sc _StateClass) Alloc() State { + rv := objc.Call[State](sc, objc.Sel("alloc")) + return rv +} + +func State_Alloc() State { + return StateClass.Alloc() +} + +func (sc _StateClass) New() State { + rv := objc.Call[State](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewState() State { + return StateClass.New() +} + +func (s_ State) Init() State { + rv := objc.Call[State](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947902-resourcetypeatindex?language=objc +func (s_ State) ResourceTypeAtIndex(index uint) StateResourceType { + rv := objc.Call[StateResourceType](s_, objc.Sel("resourceTypeAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942394-destinationimagedescriptorforsou?language=objc +func (s_ State) DestinationImageDescriptorForSourceImagesSourceStatesForKernelSuggestedDescriptor(sourceImages []IImage, sourceStates []IState, kernel IKernel, inDescriptor IImageDescriptor) ImageDescriptor { + rv := objc.Call[ImageDescriptor](s_, objc.Sel("destinationImageDescriptorForSourceImages:sourceStates:forKernel:suggestedDescriptor:"), sourceImages, sourceStates, objc.Ptr(kernel), objc.Ptr(inDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947913-buffersizeatindex?language=objc +func (s_ State) BufferSizeAtIndex(index uint) uint { + rv := objc.Call[uint](s_, objc.Sel("bufferSizeAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942397-resourcesize?language=objc +func (s_ State) ResourceSize() uint { + rv := objc.Call[uint](s_, objc.Sel("resourceSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947899-textureinfoatindex?language=objc +func (s_ State) TextureInfoAtIndex(index uint) StateTextureInfo { + rv := objc.Call[StateTextureInfo](s_, objc.Sel("textureInfoAtIndex:"), index) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947916-resourceatindex?language=objc +func (s_ State) ResourceAtIndexAllocateMemory(index uint, allocateMemory bool) metal.ResourceWrapper { + rv := objc.Call[metal.ResourceWrapper](s_, objc.Sel("resourceAtIndex:allocateMemory:"), index, allocateMemory) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942396-synchronizeoncommandbuffer?language=objc +func (s_ State) SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](s_, objc.Sel("synchronizeOnCommandBuffer:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2942396-synchronizeoncommandbuffer?language=objc +func (s_ State) SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("synchronizeOnCommandBuffer:"), objc.Ptr(commandBufferObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2947900-resourcecount?language=objc +func (s_ State) ResourceCount() uint { + rv := objc.Call[uint](s_, objc.Sel("resourceCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2867114-istemporary?language=objc +func (s_ State) IsTemporary() bool { + rv := objc.Call[bool](s_, objc.Sel("isTemporary")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2867042-readcount?language=objc +func (s_ State) ReadCount() uint { + rv := objc.Call[uint](s_, objc.Sel("readCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2867042-readcount?language=objc +func (s_ State) SetReadCount(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setReadCount:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2867179-label?language=objc +func (s_ State) Label() string { + rv := objc.Call[string](s_, objc.Sel("label")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstate/2867179-label?language=objc +func (s_ State) SetLabel(value string) { + objc.Call[objc.Void](s_, objc.Sel("setLabel:"), value) +} diff --git a/macos/mps/state_resource_list.gen.go b/macos/mps/state_resource_list.gen.go new file mode 100644 index 00000000..7fc6ff29 --- /dev/null +++ b/macos/mps/state_resource_list.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [StateResourceList] class. +var StateResourceListClass = _StateResourceListClass{objc.GetClass("MPSStateResourceList")} + +type _StateResourceListClass struct { + objc.Class +} + +// An interface definition for the [StateResourceList] class. +type IStateResourceList interface { + objc.IObject + AppendTexture(descriptor metal.ITextureDescriptor) + AppendBuffer(size uint) +} + +// An interface for objects that define resources for Metal Performance Shaders state containers. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstateresourcelist?language=objc +type StateResourceList struct { + objc.Object +} + +func StateResourceListFrom(ptr unsafe.Pointer) StateResourceList { + return StateResourceList{ + Object: objc.ObjectFrom(ptr), + } +} + +func (sc _StateResourceListClass) ResourceList() StateResourceList { + rv := objc.Call[StateResourceList](sc, objc.Sel("resourceList")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstateresourcelist/2947904-resourcelist?language=objc +func StateResourceList_ResourceList() StateResourceList { + return StateResourceListClass.ResourceList() +} + +func (sc _StateResourceListClass) ResourceListWithTextureDescriptors(d metal.ITextureDescriptor, args ...any) StateResourceList { + rv := objc.Call[StateResourceList](sc, objc.Sel("resourceListWithTextureDescriptors:"), append([]any{objc.Ptr(d)}, args...)...) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstateresourcelist/2947890-resourcelistwithtexturedescripto?language=objc +func StateResourceList_ResourceListWithTextureDescriptors(d metal.ITextureDescriptor, args ...any) StateResourceList { + return StateResourceListClass.ResourceListWithTextureDescriptors(d, args...) +} + +func (s_ StateResourceList) Init() StateResourceList { + rv := objc.Call[StateResourceList](s_, objc.Sel("init")) + return rv +} + +func (sc _StateResourceListClass) ResourceListWithBufferSizes(firstSize uint, args ...any) StateResourceList { + rv := objc.Call[StateResourceList](sc, objc.Sel("resourceListWithBufferSizes:"), append([]any{firstSize}, args...)...) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstateresourcelist/2947903-resourcelistwithbuffersizes?language=objc +func StateResourceList_ResourceListWithBufferSizes(firstSize uint, args ...any) StateResourceList { + return StateResourceListClass.ResourceListWithBufferSizes(firstSize, args...) +} + +func (sc _StateResourceListClass) Alloc() StateResourceList { + rv := objc.Call[StateResourceList](sc, objc.Sel("alloc")) + return rv +} + +func StateResourceList_Alloc() StateResourceList { + return StateResourceListClass.Alloc() +} + +func (sc _StateResourceListClass) New() StateResourceList { + rv := objc.Call[StateResourceList](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewStateResourceList() StateResourceList { + return StateResourceListClass.New() +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstateresourcelist/2947894-appendtexture?language=objc +func (s_ StateResourceList) AppendTexture(descriptor metal.ITextureDescriptor) { + objc.Call[objc.Void](s_, objc.Sel("appendTexture:"), objc.Ptr(descriptor)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsstateresourcelist/2947905-appendbuffer?language=objc +func (s_ StateResourceList) AppendBuffer(size uint) { + objc.Call[objc.Void](s_, objc.Sel("appendBuffer:"), size) +} diff --git a/macos/mps/svgf.gen.go b/macos/mps/svgf.gen.go new file mode 100644 index 00000000..81f5f8b0 --- /dev/null +++ b/macos/mps/svgf.gen.go @@ -0,0 +1,423 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SVGF] class. +var SVGFClass = _SVGFClass{objc.GetClass("MPSSVGF")} + +type _SVGFClass struct { + objc.Class +} + +// An interface definition for the [SVGF] class. +type ISVGF interface { + IKernel + EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureDepthNormalTexture(commandBuffer metal.PCommandBuffer, stepDistance uint, sourceTexture metal.PTexture, destinationTexture metal.PTexture, depthNormalTexture metal.PTexture) + EncodeBilateralFilterToCommandBufferObjectStepDistanceSourceTextureObjectDestinationTextureObjectDepthNormalTextureObject(commandBufferObject objc.IObject, stepDistance uint, sourceTextureObject objc.IObject, destinationTextureObject objc.IObject, depthNormalTextureObject objc.IObject) + EncodeWithCoder(coder foundation.ICoder) + EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureFrameCountTextureDepthNormalTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, luminanceMomentsTexture metal.PTexture, destinationTexture metal.PTexture, frameCountTexture metal.PTexture, depthNormalTexture metal.PTexture) + EncodeVarianceEstimationToCommandBufferObjectSourceTextureObjectLuminanceMomentsTextureObjectDestinationTextureObjectFrameCountTextureObjectDepthNormalTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, luminanceMomentsTextureObject objc.IObject, destinationTextureObject objc.IObject, frameCountTextureObject objc.IObject, depthNormalTextureObject objc.IObject) + EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTexturePreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, previousTexture metal.PTexture, destinationTexture metal.PTexture, previousLuminanceMomentsTexture metal.PTexture, destinationLuminanceMomentsTexture metal.PTexture, previousFrameCountTexture metal.PTexture, destinationFrameCountTexture metal.PTexture, motionVectorTexture metal.PTexture, depthNormalTexture metal.PTexture, previousDepthNormalTexture metal.PTexture) + EncodeReprojectionToCommandBufferObjectSourceTextureObjectPreviousTextureObjectDestinationTextureObjectPreviousLuminanceMomentsTextureObjectDestinationLuminanceMomentsTextureObjectPreviousFrameCountTextureObjectDestinationFrameCountTextureObjectMotionVectorTextureObjectDepthNormalTextureObjectPreviousDepthNormalTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, previousTextureObject objc.IObject, destinationTextureObject objc.IObject, previousLuminanceMomentsTextureObject objc.IObject, destinationLuminanceMomentsTextureObject objc.IObject, previousFrameCountTextureObject objc.IObject, destinationFrameCountTextureObject objc.IObject, motionVectorTextureObject objc.IObject, depthNormalTextureObject objc.IObject, previousDepthNormalTextureObject objc.IObject) + ChannelCount() uint + SetChannelCount(value uint) + VarianceEstimationSigma() float64 + SetVarianceEstimationSigma(value float64) + BilateralFilterSigma() float64 + SetBilateralFilterSigma(value float64) + MinimumFramesForVarianceEstimation() uint + SetMinimumFramesForVarianceEstimation(value uint) + BilateralFilterRadius() uint + SetBilateralFilterRadius(value uint) + ChannelCount2() uint + SetChannelCount2(value uint) + VariancePrefilterRadius() uint + SetVariancePrefilterRadius(value uint) + TemporalReprojectionBlendFactor() float64 + SetTemporalReprojectionBlendFactor(value float64) + LuminanceWeight() float64 + SetLuminanceWeight(value float64) + NormalWeight() float64 + SetNormalWeight(value float64) + TemporalWeighting() TemporalWeighting + SetTemporalWeighting(value TemporalWeighting) + VarianceEstimationRadius() uint + SetVarianceEstimationRadius(value uint) + VariancePrefilterSigma() float64 + SetVariancePrefilterSigma(value float64) + DepthWeight() float64 + SetDepthWeight(value float64) + ReprojectionThreshold() float64 + SetReprojectionThreshold(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf?language=objc +type SVGF struct { + Kernel +} + +func SVGFFrom(ptr unsafe.Pointer) SVGF { + return SVGF{ + Kernel: KernelFrom(ptr), + } +} + +func (s_ SVGF) InitWithDevice(device metal.PDevice) SVGF { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[SVGF](s_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143566-initwithdevice?language=objc +func NewSVGFWithDevice(device metal.PDevice) SVGF { + instance := SVGFClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (s_ SVGF) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) SVGF { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[SVGF](s_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143559-copywithzone?language=objc +func SVGF_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) SVGF { + instance := SVGFClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (sc _SVGFClass) Alloc() SVGF { + rv := objc.Call[SVGF](sc, objc.Sel("alloc")) + return rv +} + +func SVGF_Alloc() SVGF { + return SVGFClass.Alloc() +} + +func (sc _SVGFClass) New() SVGF { + rv := objc.Call[SVGF](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSVGF() SVGF { + return SVGFClass.New() +} + +func (s_ SVGF) Init() SVGF { + rv := objc.Call[SVGF](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3242891-encodebilateralfiltertocommandbu?language=objc +func (s_ SVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureDepthNormalTexture(commandBuffer metal.PCommandBuffer, stepDistance uint, sourceTexture metal.PTexture, destinationTexture metal.PTexture, depthNormalTexture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po2 := objc.WrapAsProtocol("MTLTexture", sourceTexture) + po3 := objc.WrapAsProtocol("MTLTexture", destinationTexture) + po4 := objc.WrapAsProtocol("MTLTexture", depthNormalTexture) + objc.Call[objc.Void](s_, objc.Sel("encodeBilateralFilterToCommandBuffer:stepDistance:sourceTexture:destinationTexture:depthNormalTexture:"), po0, stepDistance, po2, po3, po4) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3242891-encodebilateralfiltertocommandbu?language=objc +func (s_ SVGF) EncodeBilateralFilterToCommandBufferObjectStepDistanceSourceTextureObjectDestinationTextureObjectDepthNormalTextureObject(commandBufferObject objc.IObject, stepDistance uint, sourceTextureObject objc.IObject, destinationTextureObject objc.IObject, depthNormalTextureObject objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("encodeBilateralFilterToCommandBuffer:stepDistance:sourceTexture:destinationTexture:depthNormalTexture:"), objc.Ptr(commandBufferObject), stepDistance, objc.Ptr(sourceTextureObject), objc.Ptr(destinationTextureObject), objc.Ptr(depthNormalTextureObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143564-encodewithcoder?language=objc +func (s_ SVGF) EncodeWithCoder(coder foundation.ICoder) { + objc.Call[objc.Void](s_, objc.Sel("encodeWithCoder:"), objc.Ptr(coder)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3242893-encodevarianceestimationtocomman?language=objc +func (s_ SVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureFrameCountTextureDepthNormalTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, luminanceMomentsTexture metal.PTexture, destinationTexture metal.PTexture, frameCountTexture metal.PTexture, depthNormalTexture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", sourceTexture) + po2 := objc.WrapAsProtocol("MTLTexture", luminanceMomentsTexture) + po3 := objc.WrapAsProtocol("MTLTexture", destinationTexture) + po4 := objc.WrapAsProtocol("MTLTexture", frameCountTexture) + po5 := objc.WrapAsProtocol("MTLTexture", depthNormalTexture) + objc.Call[objc.Void](s_, objc.Sel("encodeVarianceEstimationToCommandBuffer:sourceTexture:luminanceMomentsTexture:destinationTexture:frameCountTexture:depthNormalTexture:"), po0, po1, po2, po3, po4, po5) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3242893-encodevarianceestimationtocomman?language=objc +func (s_ SVGF) EncodeVarianceEstimationToCommandBufferObjectSourceTextureObjectLuminanceMomentsTextureObjectDestinationTextureObjectFrameCountTextureObjectDepthNormalTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, luminanceMomentsTextureObject objc.IObject, destinationTextureObject objc.IObject, frameCountTextureObject objc.IObject, depthNormalTextureObject objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("encodeVarianceEstimationToCommandBuffer:sourceTexture:luminanceMomentsTexture:destinationTexture:frameCountTexture:depthNormalTexture:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceTextureObject), objc.Ptr(luminanceMomentsTextureObject), objc.Ptr(destinationTextureObject), objc.Ptr(frameCountTextureObject), objc.Ptr(depthNormalTextureObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3242892-encodereprojectiontocommandbuffe?language=objc +func (s_ SVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTexturePreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, previousTexture metal.PTexture, destinationTexture metal.PTexture, previousLuminanceMomentsTexture metal.PTexture, destinationLuminanceMomentsTexture metal.PTexture, previousFrameCountTexture metal.PTexture, destinationFrameCountTexture metal.PTexture, motionVectorTexture metal.PTexture, depthNormalTexture metal.PTexture, previousDepthNormalTexture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", sourceTexture) + po2 := objc.WrapAsProtocol("MTLTexture", previousTexture) + po3 := objc.WrapAsProtocol("MTLTexture", destinationTexture) + po4 := objc.WrapAsProtocol("MTLTexture", previousLuminanceMomentsTexture) + po5 := objc.WrapAsProtocol("MTLTexture", destinationLuminanceMomentsTexture) + po6 := objc.WrapAsProtocol("MTLTexture", previousFrameCountTexture) + po7 := objc.WrapAsProtocol("MTLTexture", destinationFrameCountTexture) + po8 := objc.WrapAsProtocol("MTLTexture", motionVectorTexture) + po9 := objc.WrapAsProtocol("MTLTexture", depthNormalTexture) + po10 := objc.WrapAsProtocol("MTLTexture", previousDepthNormalTexture) + objc.Call[objc.Void](s_, objc.Sel("encodeReprojectionToCommandBuffer:sourceTexture:previousTexture:destinationTexture:previousLuminanceMomentsTexture:destinationLuminanceMomentsTexture:previousFrameCountTexture:destinationFrameCountTexture:motionVectorTexture:depthNormalTexture:previousDepthNormalTexture:"), po0, po1, po2, po3, po4, po5, po6, po7, po8, po9, po10) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3242892-encodereprojectiontocommandbuffe?language=objc +func (s_ SVGF) EncodeReprojectionToCommandBufferObjectSourceTextureObjectPreviousTextureObjectDestinationTextureObjectPreviousLuminanceMomentsTextureObjectDestinationLuminanceMomentsTextureObjectPreviousFrameCountTextureObjectDestinationFrameCountTextureObjectMotionVectorTextureObjectDepthNormalTextureObjectPreviousDepthNormalTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, previousTextureObject objc.IObject, destinationTextureObject objc.IObject, previousLuminanceMomentsTextureObject objc.IObject, destinationLuminanceMomentsTextureObject objc.IObject, previousFrameCountTextureObject objc.IObject, destinationFrameCountTextureObject objc.IObject, motionVectorTextureObject objc.IObject, depthNormalTextureObject objc.IObject, previousDepthNormalTextureObject objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("encodeReprojectionToCommandBuffer:sourceTexture:previousTexture:destinationTexture:previousLuminanceMomentsTexture:destinationLuminanceMomentsTexture:previousFrameCountTexture:destinationFrameCountTexture:motionVectorTexture:depthNormalTexture:previousDepthNormalTexture:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceTextureObject), objc.Ptr(previousTextureObject), objc.Ptr(destinationTextureObject), objc.Ptr(previousLuminanceMomentsTextureObject), objc.Ptr(destinationLuminanceMomentsTextureObject), objc.Ptr(previousFrameCountTextureObject), objc.Ptr(destinationFrameCountTextureObject), objc.Ptr(motionVectorTextureObject), objc.Ptr(depthNormalTextureObject), objc.Ptr(previousDepthNormalTextureObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143557-channelcount?language=objc +func (s_ SVGF) ChannelCount() uint { + rv := objc.Call[uint](s_, objc.Sel("channelCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143557-channelcount?language=objc +func (s_ SVGF) SetChannelCount(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setChannelCount:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143574-varianceestimationsigma?language=objc +func (s_ SVGF) VarianceEstimationSigma() float64 { + rv := objc.Call[float64](s_, objc.Sel("varianceEstimationSigma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143574-varianceestimationsigma?language=objc +func (s_ SVGF) SetVarianceEstimationSigma(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setVarianceEstimationSigma:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143556-bilateralfiltersigma?language=objc +func (s_ SVGF) BilateralFilterSigma() float64 { + rv := objc.Call[float64](s_, objc.Sel("bilateralFilterSigma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143556-bilateralfiltersigma?language=objc +func (s_ SVGF) SetBilateralFilterSigma(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setBilateralFilterSigma:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143568-minimumframesforvarianceestimati?language=objc +func (s_ SVGF) MinimumFramesForVarianceEstimation() uint { + rv := objc.Call[uint](s_, objc.Sel("minimumFramesForVarianceEstimation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143568-minimumframesforvarianceestimati?language=objc +func (s_ SVGF) SetMinimumFramesForVarianceEstimation(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setMinimumFramesForVarianceEstimation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143555-bilateralfilterradius?language=objc +func (s_ SVGF) BilateralFilterRadius() uint { + rv := objc.Call[uint](s_, objc.Sel("bilateralFilterRadius")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143555-bilateralfilterradius?language=objc +func (s_ SVGF) SetBilateralFilterRadius(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setBilateralFilterRadius:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143558-channelcount2?language=objc +func (s_ SVGF) ChannelCount2() uint { + rv := objc.Call[uint](s_, objc.Sel("channelCount2")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143558-channelcount2?language=objc +func (s_ SVGF) SetChannelCount2(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setChannelCount2:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143575-varianceprefilterradius?language=objc +func (s_ SVGF) VariancePrefilterRadius() uint { + rv := objc.Call[uint](s_, objc.Sel("variancePrefilterRadius")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143575-varianceprefilterradius?language=objc +func (s_ SVGF) SetVariancePrefilterRadius(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setVariancePrefilterRadius:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143571-temporalreprojectionblendfactor?language=objc +func (s_ SVGF) TemporalReprojectionBlendFactor() float64 { + rv := objc.Call[float64](s_, objc.Sel("temporalReprojectionBlendFactor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143571-temporalreprojectionblendfactor?language=objc +func (s_ SVGF) SetTemporalReprojectionBlendFactor(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setTemporalReprojectionBlendFactor:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143567-luminanceweight?language=objc +func (s_ SVGF) LuminanceWeight() float64 { + rv := objc.Call[float64](s_, objc.Sel("luminanceWeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143567-luminanceweight?language=objc +func (s_ SVGF) SetLuminanceWeight(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setLuminanceWeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143569-normalweight?language=objc +func (s_ SVGF) NormalWeight() float64 { + rv := objc.Call[float64](s_, objc.Sel("normalWeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143569-normalweight?language=objc +func (s_ SVGF) SetNormalWeight(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setNormalWeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143572-temporalweighting?language=objc +func (s_ SVGF) TemporalWeighting() TemporalWeighting { + rv := objc.Call[TemporalWeighting](s_, objc.Sel("temporalWeighting")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143572-temporalweighting?language=objc +func (s_ SVGF) SetTemporalWeighting(value TemporalWeighting) { + objc.Call[objc.Void](s_, objc.Sel("setTemporalWeighting:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143573-varianceestimationradius?language=objc +func (s_ SVGF) VarianceEstimationRadius() uint { + rv := objc.Call[uint](s_, objc.Sel("varianceEstimationRadius")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143573-varianceestimationradius?language=objc +func (s_ SVGF) SetVarianceEstimationRadius(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setVarianceEstimationRadius:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143576-varianceprefiltersigma?language=objc +func (s_ SVGF) VariancePrefilterSigma() float64 { + rv := objc.Call[float64](s_, objc.Sel("variancePrefilterSigma")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143576-varianceprefiltersigma?language=objc +func (s_ SVGF) SetVariancePrefilterSigma(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setVariancePrefilterSigma:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143560-depthweight?language=objc +func (s_ SVGF) DepthWeight() float64 { + rv := objc.Call[float64](s_, objc.Sel("depthWeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143560-depthweight?language=objc +func (s_ SVGF) SetDepthWeight(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setDepthWeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143570-reprojectionthreshold?language=objc +func (s_ SVGF) ReprojectionThreshold() float64 { + rv := objc.Call[float64](s_, objc.Sel("reprojectionThreshold")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgf/3143570-reprojectionthreshold?language=objc +func (s_ SVGF) SetReprojectionThreshold(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setReprojectionThreshold:"), value) +} diff --git a/macos/mps/svgf_default_texture_allocator.gen.go b/macos/mps/svgf_default_texture_allocator.gen.go new file mode 100644 index 00000000..f98f322e --- /dev/null +++ b/macos/mps/svgf_default_texture_allocator.gen.go @@ -0,0 +1,126 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SVGFDefaultTextureAllocator] class. +var SVGFDefaultTextureAllocatorClass = _SVGFDefaultTextureAllocatorClass{objc.GetClass("MPSSVGFDefaultTextureAllocator")} + +type _SVGFDefaultTextureAllocatorClass struct { + objc.Class +} + +// An interface definition for the [SVGFDefaultTextureAllocator] class. +type ISVGFDefaultTextureAllocator interface { + objc.IObject + ReturnTexture(texture metal.PTexture) + ReturnTextureObject(textureObject objc.IObject) + TextureWithPixelFormatWidthHeight(pixelFormat metal.PixelFormat, width uint, height uint) metal.TextureWrapper + Reset() + Device() metal.DeviceWrapper + AllocatedTextureCount() uint +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator?language=objc +type SVGFDefaultTextureAllocator struct { + objc.Object +} + +func SVGFDefaultTextureAllocatorFrom(ptr unsafe.Pointer) SVGFDefaultTextureAllocator { + return SVGFDefaultTextureAllocator{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ SVGFDefaultTextureAllocator) InitWithDevice(device metal.PDevice) SVGFDefaultTextureAllocator { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[SVGFDefaultTextureAllocator](s_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator/3242897-initwithdevice?language=objc +func NewSVGFDefaultTextureAllocatorWithDevice(device metal.PDevice) SVGFDefaultTextureAllocator { + instance := SVGFDefaultTextureAllocatorClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (sc _SVGFDefaultTextureAllocatorClass) Alloc() SVGFDefaultTextureAllocator { + rv := objc.Call[SVGFDefaultTextureAllocator](sc, objc.Sel("alloc")) + return rv +} + +func SVGFDefaultTextureAllocator_Alloc() SVGFDefaultTextureAllocator { + return SVGFDefaultTextureAllocatorClass.Alloc() +} + +func (sc _SVGFDefaultTextureAllocatorClass) New() SVGFDefaultTextureAllocator { + rv := objc.Call[SVGFDefaultTextureAllocator](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSVGFDefaultTextureAllocator() SVGFDefaultTextureAllocator { + return SVGFDefaultTextureAllocatorClass.New() +} + +func (s_ SVGFDefaultTextureAllocator) Init() SVGFDefaultTextureAllocator { + rv := objc.Call[SVGFDefaultTextureAllocator](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator/3242899-returntexture?language=objc +func (s_ SVGFDefaultTextureAllocator) ReturnTexture(texture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLTexture", texture) + objc.Call[objc.Void](s_, objc.Sel("returnTexture:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator/3242899-returntexture?language=objc +func (s_ SVGFDefaultTextureAllocator) ReturnTextureObject(textureObject objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("returnTexture:"), objc.Ptr(textureObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator/3242900-texturewithpixelformat?language=objc +func (s_ SVGFDefaultTextureAllocator) TextureWithPixelFormatWidthHeight(pixelFormat metal.PixelFormat, width uint, height uint) metal.TextureWrapper { + rv := objc.Call[metal.TextureWrapper](s_, objc.Sel("textureWithPixelFormat:width:height:"), pixelFormat, width, height) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator/3242898-reset?language=objc +func (s_ SVGFDefaultTextureAllocator) Reset() { + objc.Call[objc.Void](s_, objc.Sel("reset")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator/3242896-device?language=objc +func (s_ SVGFDefaultTextureAllocator) Device() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](s_, objc.Sel("device")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdefaulttextureallocator/3242895-allocatedtexturecount?language=objc +func (s_ SVGFDefaultTextureAllocator) AllocatedTextureCount() uint { + rv := objc.Call[uint](s_, objc.Sel("allocatedTextureCount")) + return rv +} diff --git a/macos/mps/svgf_denoiser.gen.go b/macos/mps/svgf_denoiser.gen.go new file mode 100644 index 00000000..95a7db75 --- /dev/null +++ b/macos/mps/svgf_denoiser.gen.go @@ -0,0 +1,163 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SVGFDenoiser] class. +var SVGFDenoiserClass = _SVGFDenoiserClass{objc.GetClass("MPSSVGFDenoiser")} + +type _SVGFDenoiserClass struct { + objc.Class +} + +// An interface definition for the [SVGFDenoiser] class. +type ISVGFDenoiser interface { + objc.IObject + ClearTemporalHistory() + ReleaseTemporaryTextures() + EncodeToCommandBufferSourceTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, motionVectorTexture metal.PTexture, depthNormalTexture metal.PTexture, previousDepthNormalTexture metal.PTexture) metal.TextureWrapper + EncodeToCommandBufferObjectSourceTextureObjectMotionVectorTextureObjectDepthNormalTextureObjectPreviousDepthNormalTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, motionVectorTextureObject objc.IObject, depthNormalTextureObject objc.IObject, previousDepthNormalTextureObject objc.IObject) metal.TextureWrapper + TextureAllocator() SVGFTextureAllocatorWrapper + Svgf() SVGF + BilateralFilterIterations() uint + SetBilateralFilterIterations(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser?language=objc +type SVGFDenoiser struct { + objc.Object +} + +func SVGFDenoiserFrom(ptr unsafe.Pointer) SVGFDenoiser { + return SVGFDenoiser{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ SVGFDenoiser) InitWithSVGFTextureAllocator(svgf ISVGF, textureAllocator PSVGFTextureAllocator) SVGFDenoiser { + po1 := objc.WrapAsProtocol("MPSSVGFTextureAllocator", textureAllocator) + rv := objc.Call[SVGFDenoiser](s_, objc.Sel("initWithSVGF:textureAllocator:"), objc.Ptr(svgf), po1) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3242908-initwithsvgf?language=objc +func NewSVGFDenoiserWithSVGFTextureAllocator(svgf ISVGF, textureAllocator PSVGFTextureAllocator) SVGFDenoiser { + instance := SVGFDenoiserClass.Alloc().InitWithSVGFTextureAllocator(svgf, textureAllocator) + instance.Autorelease() + return instance +} + +func (s_ SVGFDenoiser) InitWithDevice(device metal.PDevice) SVGFDenoiser { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[SVGFDenoiser](s_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3353094-initwithdevice?language=objc +func NewSVGFDenoiserWithDevice(device metal.PDevice) SVGFDenoiser { + instance := SVGFDenoiserClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (sc _SVGFDenoiserClass) Alloc() SVGFDenoiser { + rv := objc.Call[SVGFDenoiser](sc, objc.Sel("alloc")) + return rv +} + +func SVGFDenoiser_Alloc() SVGFDenoiser { + return SVGFDenoiserClass.Alloc() +} + +func (sc _SVGFDenoiserClass) New() SVGFDenoiser { + rv := objc.Call[SVGFDenoiser](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSVGFDenoiser() SVGFDenoiser { + return SVGFDenoiserClass.New() +} + +func (s_ SVGFDenoiser) Init() SVGFDenoiser { + rv := objc.Call[SVGFDenoiser](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3242903-cleartemporalhistory?language=objc +func (s_ SVGFDenoiser) ClearTemporalHistory() { + objc.Call[objc.Void](s_, objc.Sel("clearTemporalHistory")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3242911-releasetemporarytextures?language=objc +func (s_ SVGFDenoiser) ReleaseTemporaryTextures() { + objc.Call[objc.Void](s_, objc.Sel("releaseTemporaryTextures")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3353093-encodetocommandbuffer?language=objc +func (s_ SVGFDenoiser) EncodeToCommandBufferSourceTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, motionVectorTexture metal.PTexture, depthNormalTexture metal.PTexture, previousDepthNormalTexture metal.PTexture) metal.TextureWrapper { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", sourceTexture) + po2 := objc.WrapAsProtocol("MTLTexture", motionVectorTexture) + po3 := objc.WrapAsProtocol("MTLTexture", depthNormalTexture) + po4 := objc.WrapAsProtocol("MTLTexture", previousDepthNormalTexture) + rv := objc.Call[metal.TextureWrapper](s_, objc.Sel("encodeToCommandBuffer:sourceTexture:motionVectorTexture:depthNormalTexture:previousDepthNormalTexture:"), po0, po1, po2, po3, po4) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3353093-encodetocommandbuffer?language=objc +func (s_ SVGFDenoiser) EncodeToCommandBufferObjectSourceTextureObjectMotionVectorTextureObjectDepthNormalTextureObjectPreviousDepthNormalTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, motionVectorTextureObject objc.IObject, depthNormalTextureObject objc.IObject, previousDepthNormalTextureObject objc.IObject) metal.TextureWrapper { + rv := objc.Call[metal.TextureWrapper](s_, objc.Sel("encodeToCommandBuffer:sourceTexture:motionVectorTexture:depthNormalTexture:previousDepthNormalTexture:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceTextureObject), objc.Ptr(motionVectorTextureObject), objc.Ptr(depthNormalTextureObject), objc.Ptr(previousDepthNormalTextureObject)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3242915-textureallocator?language=objc +func (s_ SVGFDenoiser) TextureAllocator() SVGFTextureAllocatorWrapper { + rv := objc.Call[SVGFTextureAllocatorWrapper](s_, objc.Sel("textureAllocator")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3242914-svgf?language=objc +func (s_ SVGFDenoiser) Svgf() SVGF { + rv := objc.Call[SVGF](s_, objc.Sel("svgf")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3242902-bilateralfilteriterations?language=objc +func (s_ SVGFDenoiser) BilateralFilterIterations() uint { + rv := objc.Call[uint](s_, objc.Sel("bilateralFilterIterations")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgfdenoiser/3242902-bilateralfilteriterations?language=objc +func (s_ SVGFDenoiser) SetBilateralFilterIterations(value uint) { + objc.Call[objc.Void](s_, objc.Sel("setBilateralFilterIterations:"), value) +} diff --git a/macos/mps/svgf_texture_allocator.gen.go b/macos/mps/svgf_texture_allocator.gen.go new file mode 100644 index 00000000..fcea11ce --- /dev/null +++ b/macos/mps/svgf_texture_allocator.gen.go @@ -0,0 +1,50 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgftextureallocator?language=objc +type PSVGFTextureAllocator interface { + // optional + ReturnTexture(texture metal.TextureWrapper) + HasReturnTexture() bool + + // optional + TextureWithPixelFormatWidthHeight(pixelFormat metal.PixelFormat, width uint, height uint) metal.PTexture + HasTextureWithPixelFormatWidthHeight() bool +} + +// A concrete type wrapper for the [PSVGFTextureAllocator] protocol. +type SVGFTextureAllocatorWrapper struct { + objc.Object +} + +func (s_ SVGFTextureAllocatorWrapper) HasReturnTexture() bool { + return s_.RespondsToSelector(objc.Sel("returnTexture:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgftextureallocator/3242917-returntexture?language=objc +func (s_ SVGFTextureAllocatorWrapper) ReturnTexture(texture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLTexture", texture) + objc.Call[objc.Void](s_, objc.Sel("returnTexture:"), po0) +} + +func (s_ SVGFTextureAllocatorWrapper) HasTextureWithPixelFormatWidthHeight() bool { + return s_.RespondsToSelector(objc.Sel("textureWithPixelFormat:width:height:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpssvgftextureallocator/3242918-texturewithpixelformat?language=objc +func (s_ SVGFTextureAllocatorWrapper) TextureWithPixelFormatWidthHeight(pixelFormat metal.PixelFormat, width uint, height uint) metal.TextureWrapper { + rv := objc.Call[metal.TextureWrapper](s_, objc.Sel("textureWithPixelFormat:width:height:"), pixelFormat, width, height) + return rv +} diff --git a/macos/mps/temporal_aa.gen.go b/macos/mps/temporal_aa.gen.go new file mode 100644 index 00000000..aff651f9 --- /dev/null +++ b/macos/mps/temporal_aa.gen.go @@ -0,0 +1,138 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TemporalAA] class. +var TemporalAAClass = _TemporalAAClass{objc.GetClass("MPSTemporalAA")} + +type _TemporalAAClass struct { + objc.Class +} + +// An interface definition for the [TemporalAA] class. +type ITemporalAA interface { + IKernel + EncodeWithCoder(coder foundation.ICoder) + EncodeToCommandBufferSourceTexturePreviousTextureDestinationTextureMotionVectorTextureDepthTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, previousTexture metal.PTexture, destinationTexture metal.PTexture, motionVectorTexture metal.PTexture, depthTexture metal.PTexture) + EncodeToCommandBufferObjectSourceTextureObjectPreviousTextureObjectDestinationTextureObjectMotionVectorTextureObjectDepthTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, previousTextureObject objc.IObject, destinationTextureObject objc.IObject, motionVectorTextureObject objc.IObject, depthTextureObject objc.IObject) + BlendFactor() float64 + SetBlendFactor(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa?language=objc +type TemporalAA struct { + Kernel +} + +func TemporalAAFrom(ptr unsafe.Pointer) TemporalAA { + return TemporalAA{ + Kernel: KernelFrom(ptr), + } +} + +func (t_ TemporalAA) InitWithDevice(device metal.PDevice) TemporalAA { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TemporalAA](t_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa/3143587-initwithdevice?language=objc +func NewTemporalAAWithDevice(device metal.PDevice) TemporalAA { + instance := TemporalAAClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (t_ TemporalAA) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) TemporalAA { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TemporalAA](t_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa/3143583-copywithzone?language=objc +func TemporalAA_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) TemporalAA { + instance := TemporalAAClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +func (tc _TemporalAAClass) Alloc() TemporalAA { + rv := objc.Call[TemporalAA](tc, objc.Sel("alloc")) + return rv +} + +func TemporalAA_Alloc() TemporalAA { + return TemporalAAClass.Alloc() +} + +func (tc _TemporalAAClass) New() TemporalAA { + rv := objc.Call[TemporalAA](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTemporalAA() TemporalAA { + return TemporalAAClass.New() +} + +func (t_ TemporalAA) Init() TemporalAA { + rv := objc.Call[TemporalAA](t_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa/3143585-encodewithcoder?language=objc +func (t_ TemporalAA) EncodeWithCoder(coder foundation.ICoder) { + objc.Call[objc.Void](t_, objc.Sel("encodeWithCoder:"), objc.Ptr(coder)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa/3143584-encodetocommandbuffer?language=objc +func (t_ TemporalAA) EncodeToCommandBufferSourceTexturePreviousTextureDestinationTextureMotionVectorTextureDepthTexture(commandBuffer metal.PCommandBuffer, sourceTexture metal.PTexture, previousTexture metal.PTexture, destinationTexture metal.PTexture, motionVectorTexture metal.PTexture, depthTexture metal.PTexture) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + po1 := objc.WrapAsProtocol("MTLTexture", sourceTexture) + po2 := objc.WrapAsProtocol("MTLTexture", previousTexture) + po3 := objc.WrapAsProtocol("MTLTexture", destinationTexture) + po4 := objc.WrapAsProtocol("MTLTexture", motionVectorTexture) + po5 := objc.WrapAsProtocol("MTLTexture", depthTexture) + objc.Call[objc.Void](t_, objc.Sel("encodeToCommandBuffer:sourceTexture:previousTexture:destinationTexture:motionVectorTexture:depthTexture:"), po0, po1, po2, po3, po4, po5) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa/3143584-encodetocommandbuffer?language=objc +func (t_ TemporalAA) EncodeToCommandBufferObjectSourceTextureObjectPreviousTextureObjectDestinationTextureObjectMotionVectorTextureObjectDepthTextureObject(commandBufferObject objc.IObject, sourceTextureObject objc.IObject, previousTextureObject objc.IObject, destinationTextureObject objc.IObject, motionVectorTextureObject objc.IObject, depthTextureObject objc.IObject) { + objc.Call[objc.Void](t_, objc.Sel("encodeToCommandBuffer:sourceTexture:previousTexture:destinationTexture:motionVectorTexture:depthTexture:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceTextureObject), objc.Ptr(previousTextureObject), objc.Ptr(destinationTextureObject), objc.Ptr(motionVectorTextureObject), objc.Ptr(depthTextureObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa/3143582-blendfactor?language=objc +func (t_ TemporalAA) BlendFactor() float64 { + rv := objc.Call[float64](t_, objc.Sel("blendFactor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporalaa/3143582-blendfactor?language=objc +func (t_ TemporalAA) SetBlendFactor(value float64) { + objc.Call[objc.Void](t_, objc.Sel("setBlendFactor:"), value) +} diff --git a/macos/mps/temporary_image.gen.go b/macos/mps/temporary_image.gen.go new file mode 100644 index 00000000..2a0f2d77 --- /dev/null +++ b/macos/mps/temporary_image.gen.go @@ -0,0 +1,149 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TemporaryImage] class. +var TemporaryImageClass = _TemporaryImageClass{objc.GetClass("MPSTemporaryImage")} + +type _TemporaryImageClass struct { + objc.Class +} + +// An interface definition for the [TemporaryImage] class. +type ITemporaryImage interface { + IImage + ReadCount() uint + SetReadCount(value uint) +} + +// A texture for use in convolutional neural networks that stores transient data to be used and discarded promptly. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryimage?language=objc +type TemporaryImage struct { + Image +} + +func TemporaryImageFrom(ptr unsafe.Pointer) TemporaryImage { + return TemporaryImage{ + Image: ImageFrom(ptr), + } +} + +func (tc _TemporaryImageClass) TemporaryImageWithCommandBufferTextureDescriptorFeatureChannels(commandBuffer metal.PCommandBuffer, textureDescriptor metal.ITextureDescriptor, featureChannels uint) TemporaryImage { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[TemporaryImage](tc, objc.Sel("temporaryImageWithCommandBuffer:textureDescriptor:featureChannels:"), po0, objc.Ptr(textureDescriptor), featureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryimage/2942489-temporaryimagewithcommandbuffer?language=objc +func TemporaryImage_TemporaryImageWithCommandBufferTextureDescriptorFeatureChannels(commandBuffer metal.PCommandBuffer, textureDescriptor metal.ITextureDescriptor, featureChannels uint) TemporaryImage { + return TemporaryImageClass.TemporaryImageWithCommandBufferTextureDescriptorFeatureChannels(commandBuffer, textureDescriptor, featureChannels) +} + +func (tc _TemporaryImageClass) Alloc() TemporaryImage { + rv := objc.Call[TemporaryImage](tc, objc.Sel("alloc")) + return rv +} + +func TemporaryImage_Alloc() TemporaryImage { + return TemporaryImageClass.Alloc() +} + +func (tc _TemporaryImageClass) New() TemporaryImage { + rv := objc.Call[TemporaryImage](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTemporaryImage() TemporaryImage { + return TemporaryImageClass.New() +} + +func (t_ TemporaryImage) Init() TemporaryImage { + rv := objc.Call[TemporaryImage](t_, objc.Sel("init")) + return rv +} + +func (t_ TemporaryImage) InitWithParentImageSliceRangeFeatureChannels(parent IImage, sliceRange foundation.Range, featureChannels uint) TemporaryImage { + rv := objc.Call[TemporaryImage](t_, objc.Sel("initWithParentImage:sliceRange:featureChannels:"), objc.Ptr(parent), sliceRange, featureChannels) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2942493-initwithparentimage?language=objc +func NewTemporaryImageWithParentImageSliceRangeFeatureChannels(parent IImage, sliceRange foundation.Range, featureChannels uint) TemporaryImage { + instance := TemporaryImageClass.Alloc().InitWithParentImageSliceRangeFeatureChannels(parent, sliceRange, featureChannels) + instance.Autorelease() + return instance +} + +func (t_ TemporaryImage) InitWithTextureFeatureChannels(texture metal.PTexture, featureChannels uint) TemporaryImage { + po0 := objc.WrapAsProtocol("MTLTexture", texture) + rv := objc.Call[TemporaryImage](t_, objc.Sel("initWithTexture:featureChannels:"), po0, featureChannels) + return rv +} + +// Initializes an image from a texture. The user-allocated texture has been created for a specific number of feature channels and number of images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/2097547-initwithtexture?language=objc +func NewTemporaryImageWithTextureFeatureChannels(texture metal.PTexture, featureChannels uint) TemporaryImage { + instance := TemporaryImageClass.Alloc().InitWithTextureFeatureChannels(texture, featureChannels) + instance.Autorelease() + return instance +} + +func (t_ TemporaryImage) InitWithDeviceImageDescriptor(device metal.PDevice, imageDescriptor IImageDescriptor) TemporaryImage { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TemporaryImage](t_, objc.Sel("initWithDevice:imageDescriptor:"), po0, objc.Ptr(imageDescriptor)) + return rv +} + +// Initializes an empty image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimage/1648920-initwithdevice?language=objc +func NewTemporaryImageWithDeviceImageDescriptor(device metal.PDevice, imageDescriptor IImageDescriptor) TemporaryImage { + instance := TemporaryImageClass.Alloc().InitWithDeviceImageDescriptor(device, imageDescriptor) + instance.Autorelease() + return instance +} + +// A method that helps the framework decide which allocations to make ahead of time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryimage/2097544-prefetchstoragewithcommandbuffer?language=objc +func (tc _TemporaryImageClass) PrefetchStorageWithCommandBufferImageDescriptorList(commandBuffer metal.PCommandBuffer, descriptorList []IImageDescriptor) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](tc, objc.Sel("prefetchStorageWithCommandBuffer:imageDescriptorList:"), po0, descriptorList) +} + +// A method that helps the framework decide which allocations to make ahead of time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryimage/2097544-prefetchstoragewithcommandbuffer?language=objc +func TemporaryImage_PrefetchStorageWithCommandBufferImageDescriptorList(commandBuffer metal.PCommandBuffer, descriptorList []IImageDescriptor) { + TemporaryImageClass.PrefetchStorageWithCommandBufferImageDescriptorList(commandBuffer, descriptorList) +} + +// The number of times a temporary image may be read by a CNN kernel before its contents become undefined. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryimage/2097546-readcount?language=objc +func (t_ TemporaryImage) ReadCount() uint { + rv := objc.Call[uint](t_, objc.Sel("readCount")) + return rv +} + +// The number of times a temporary image may be read by a CNN kernel before its contents become undefined. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryimage/2097546-readcount?language=objc +func (t_ TemporaryImage) SetReadCount(value uint) { + objc.Call[objc.Void](t_, objc.Sel("setReadCount:"), value) +} diff --git a/macos/mps/temporary_matrix.gen.go b/macos/mps/temporary_matrix.gen.go new file mode 100644 index 00000000..890a7876 --- /dev/null +++ b/macos/mps/temporary_matrix.gen.go @@ -0,0 +1,134 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TemporaryMatrix] class. +var TemporaryMatrixClass = _TemporaryMatrixClass{objc.GetClass("MPSTemporaryMatrix")} + +type _TemporaryMatrixClass struct { + objc.Class +} + +// An interface definition for the [TemporaryMatrix] class. +type ITemporaryMatrix interface { + IMatrix + ReadCount() uint + SetReadCount(value uint) +} + +// A matrix allocated on GPU private memory. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporarymatrix?language=objc +type TemporaryMatrix struct { + Matrix +} + +func TemporaryMatrixFrom(ptr unsafe.Pointer) TemporaryMatrix { + return TemporaryMatrix{ + Matrix: MatrixFrom(ptr), + } +} + +func (tc _TemporaryMatrixClass) TemporaryMatrixWithCommandBufferMatrixDescriptor(commandBuffer metal.PCommandBuffer, matrixDescriptor IMatrixDescriptor) TemporaryMatrix { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[TemporaryMatrix](tc, objc.Sel("temporaryMatrixWithCommandBuffer:matrixDescriptor:"), po0, objc.Ptr(matrixDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporarymatrix/2867180-temporarymatrixwithcommandbuffer?language=objc +func TemporaryMatrix_TemporaryMatrixWithCommandBufferMatrixDescriptor(commandBuffer metal.PCommandBuffer, matrixDescriptor IMatrixDescriptor) TemporaryMatrix { + return TemporaryMatrixClass.TemporaryMatrixWithCommandBufferMatrixDescriptor(commandBuffer, matrixDescriptor) +} + +func (tc _TemporaryMatrixClass) Alloc() TemporaryMatrix { + rv := objc.Call[TemporaryMatrix](tc, objc.Sel("alloc")) + return rv +} + +func TemporaryMatrix_Alloc() TemporaryMatrix { + return TemporaryMatrixClass.Alloc() +} + +func (tc _TemporaryMatrixClass) New() TemporaryMatrix { + rv := objc.Call[TemporaryMatrix](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTemporaryMatrix() TemporaryMatrix { + return TemporaryMatrixClass.New() +} + +func (t_ TemporaryMatrix) Init() TemporaryMatrix { + rv := objc.Call[TemporaryMatrix](t_, objc.Sel("init")) + return rv +} + +func (t_ TemporaryMatrix) InitWithDeviceDescriptor(device metal.PDevice, descriptor IMatrixDescriptor) TemporaryMatrix { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TemporaryMatrix](t_, objc.Sel("initWithDevice:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/2942567-initwithdevice?language=objc +func NewTemporaryMatrixWithDeviceDescriptor(device metal.PDevice, descriptor IMatrixDescriptor) TemporaryMatrix { + instance := TemporaryMatrixClass.Alloc().InitWithDeviceDescriptor(device, descriptor) + instance.Autorelease() + return instance +} + +func (t_ TemporaryMatrix) InitWithBufferOffsetDescriptor(buffer metal.PBuffer, offset uint, descriptor IMatrixDescriptor) TemporaryMatrix { + po0 := objc.WrapAsProtocol("MTLBuffer", buffer) + rv := objc.Call[TemporaryMatrix](t_, objc.Sel("initWithBuffer:offset:descriptor:"), po0, offset, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrix/3229863-initwithbuffer?language=objc +func NewTemporaryMatrixWithBufferOffsetDescriptor(buffer metal.PBuffer, offset uint, descriptor IMatrixDescriptor) TemporaryMatrix { + instance := TemporaryMatrixClass.Alloc().InitWithBufferOffsetDescriptor(buffer, offset, descriptor) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporarymatrix/2867073-prefetchstoragewithcommandbuffer?language=objc +func (tc _TemporaryMatrixClass) PrefetchStorageWithCommandBufferMatrixDescriptorList(commandBuffer metal.PCommandBuffer, descriptorList []IMatrixDescriptor) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](tc, objc.Sel("prefetchStorageWithCommandBuffer:matrixDescriptorList:"), po0, descriptorList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporarymatrix/2867073-prefetchstoragewithcommandbuffer?language=objc +func TemporaryMatrix_PrefetchStorageWithCommandBufferMatrixDescriptorList(commandBuffer metal.PCommandBuffer, descriptorList []IMatrixDescriptor) { + TemporaryMatrixClass.PrefetchStorageWithCommandBufferMatrixDescriptorList(commandBuffer, descriptorList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporarymatrix/2867151-readcount?language=objc +func (t_ TemporaryMatrix) ReadCount() uint { + rv := objc.Call[uint](t_, objc.Sel("readCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporarymatrix/2867151-readcount?language=objc +func (t_ TemporaryMatrix) SetReadCount(value uint) { + objc.Call[objc.Void](t_, objc.Sel("setReadCount:"), value) +} diff --git a/macos/mps/temporary_nd_array.gen.go b/macos/mps/temporary_nd_array.gen.go new file mode 100644 index 00000000..1ea46a7f --- /dev/null +++ b/macos/mps/temporary_nd_array.gen.go @@ -0,0 +1,104 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TemporaryNDArray] class. +var TemporaryNDArrayClass = _TemporaryNDArrayClass{objc.GetClass("MPSTemporaryNDArray")} + +type _TemporaryNDArrayClass struct { + objc.Class +} + +// An interface definition for the [TemporaryNDArray] class. +type ITemporaryNDArray interface { + INDArray + ReadCount() uint + SetReadCount(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryndarray?language=objc +type TemporaryNDArray struct { + NDArray +} + +func TemporaryNDArrayFrom(ptr unsafe.Pointer) TemporaryNDArray { + return TemporaryNDArray{ + NDArray: NDArrayFrom(ptr), + } +} + +func (tc _TemporaryNDArrayClass) TemporaryNDArrayWithCommandBufferDescriptor(commandBuffer metal.PCommandBuffer, descriptor INDArrayDescriptor) TemporaryNDArray { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[TemporaryNDArray](tc, objc.Sel("temporaryNDArrayWithCommandBuffer:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryndarray/3114075-temporaryndarraywithcommandbuffe?language=objc +func TemporaryNDArray_TemporaryNDArrayWithCommandBufferDescriptor(commandBuffer metal.PCommandBuffer, descriptor INDArrayDescriptor) TemporaryNDArray { + return TemporaryNDArrayClass.TemporaryNDArrayWithCommandBufferDescriptor(commandBuffer, descriptor) +} + +func (tc _TemporaryNDArrayClass) Alloc() TemporaryNDArray { + rv := objc.Call[TemporaryNDArray](tc, objc.Sel("alloc")) + return rv +} + +func TemporaryNDArray_Alloc() TemporaryNDArray { + return TemporaryNDArrayClass.Alloc() +} + +func (tc _TemporaryNDArrayClass) New() TemporaryNDArray { + rv := objc.Call[TemporaryNDArray](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTemporaryNDArray() TemporaryNDArray { + return TemporaryNDArrayClass.New() +} + +func (t_ TemporaryNDArray) Init() TemporaryNDArray { + rv := objc.Call[TemporaryNDArray](t_, objc.Sel("init")) + return rv +} + +func (t_ TemporaryNDArray) InitWithDeviceScalar(device metal.PDevice, value float64) TemporaryNDArray { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TemporaryNDArray](t_, objc.Sel("initWithDevice:scalar:"), po0, value) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsndarray/3114051-initwithdevice?language=objc +func NewTemporaryNDArrayWithDeviceScalar(device metal.PDevice, value float64) TemporaryNDArray { + instance := TemporaryNDArrayClass.Alloc().InitWithDeviceScalar(device, value) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryndarray/3114074-readcount?language=objc +func (t_ TemporaryNDArray) ReadCount() uint { + rv := objc.Call[uint](t_, objc.Sel("readCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryndarray/3114074-readcount?language=objc +func (t_ TemporaryNDArray) SetReadCount(value uint) { + objc.Call[objc.Void](t_, objc.Sel("setReadCount:"), value) +} diff --git a/macos/mps/temporary_vector.gen.go b/macos/mps/temporary_vector.gen.go new file mode 100644 index 00000000..55231b6f --- /dev/null +++ b/macos/mps/temporary_vector.gen.go @@ -0,0 +1,134 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TemporaryVector] class. +var TemporaryVectorClass = _TemporaryVectorClass{objc.GetClass("MPSTemporaryVector")} + +type _TemporaryVectorClass struct { + objc.Class +} + +// An interface definition for the [TemporaryVector] class. +type ITemporaryVector interface { + IVector + ReadCount() uint + SetReadCount(value uint) +} + +// A vector allocated on GPU private memory. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryvector?language=objc +type TemporaryVector struct { + Vector +} + +func TemporaryVectorFrom(ptr unsafe.Pointer) TemporaryVector { + return TemporaryVector{ + Vector: VectorFrom(ptr), + } +} + +func (tc _TemporaryVectorClass) TemporaryVectorWithCommandBufferDescriptor(commandBuffer metal.PCommandBuffer, descriptor IVectorDescriptor) TemporaryVector { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + rv := objc.Call[TemporaryVector](tc, objc.Sel("temporaryVectorWithCommandBuffer:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryvector/2935550-temporaryvectorwithcommandbuffer?language=objc +func TemporaryVector_TemporaryVectorWithCommandBufferDescriptor(commandBuffer metal.PCommandBuffer, descriptor IVectorDescriptor) TemporaryVector { + return TemporaryVectorClass.TemporaryVectorWithCommandBufferDescriptor(commandBuffer, descriptor) +} + +func (tc _TemporaryVectorClass) Alloc() TemporaryVector { + rv := objc.Call[TemporaryVector](tc, objc.Sel("alloc")) + return rv +} + +func TemporaryVector_Alloc() TemporaryVector { + return TemporaryVectorClass.Alloc() +} + +func (tc _TemporaryVectorClass) New() TemporaryVector { + rv := objc.Call[TemporaryVector](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTemporaryVector() TemporaryVector { + return TemporaryVectorClass.New() +} + +func (t_ TemporaryVector) Init() TemporaryVector { + rv := objc.Call[TemporaryVector](t_, objc.Sel("init")) + return rv +} + +func (t_ TemporaryVector) InitWithDeviceDescriptor(device metal.PDevice, descriptor IVectorDescriptor) TemporaryVector { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TemporaryVector](t_, objc.Sel("initWithDevice:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2942566-initwithdevice?language=objc +func NewTemporaryVectorWithDeviceDescriptor(device metal.PDevice, descriptor IVectorDescriptor) TemporaryVector { + instance := TemporaryVectorClass.Alloc().InitWithDeviceDescriptor(device, descriptor) + instance.Autorelease() + return instance +} + +func (t_ TemporaryVector) InitWithBufferDescriptor(buffer metal.PBuffer, descriptor IVectorDescriptor) TemporaryVector { + po0 := objc.WrapAsProtocol("MTLBuffer", buffer) + rv := objc.Call[TemporaryVector](t_, objc.Sel("initWithBuffer:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873346-initwithbuffer?language=objc +func NewTemporaryVectorWithBufferDescriptor(buffer metal.PBuffer, descriptor IVectorDescriptor) TemporaryVector { + instance := TemporaryVectorClass.Alloc().InitWithBufferDescriptor(buffer, descriptor) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryvector/2935544-prefetchstoragewithcommandbuffer?language=objc +func (tc _TemporaryVectorClass) PrefetchStorageWithCommandBufferDescriptorList(commandBuffer metal.PCommandBuffer, descriptorList []IVectorDescriptor) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](tc, objc.Sel("prefetchStorageWithCommandBuffer:descriptorList:"), po0, descriptorList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryvector/2935544-prefetchstoragewithcommandbuffer?language=objc +func TemporaryVector_PrefetchStorageWithCommandBufferDescriptorList(commandBuffer metal.PCommandBuffer, descriptorList []IVectorDescriptor) { + TemporaryVectorClass.PrefetchStorageWithCommandBufferDescriptorList(commandBuffer, descriptorList) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryvector/2935547-readcount?language=objc +func (t_ TemporaryVector) ReadCount() uint { + rv := objc.Call[uint](t_, objc.Sel("readCount")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstemporaryvector/2935547-readcount?language=objc +func (t_ TemporaryVector) SetReadCount(value uint) { + objc.Call[objc.Void](t_, objc.Sel("setReadCount:"), value) +} diff --git a/macos/mps/triangle_acceleration_structure.gen.go b/macos/mps/triangle_acceleration_structure.gen.go new file mode 100644 index 00000000..8a53a731 --- /dev/null +++ b/macos/mps/triangle_acceleration_structure.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TriangleAccelerationStructure] class. +var TriangleAccelerationStructureClass = _TriangleAccelerationStructureClass{objc.GetClass("MPSTriangleAccelerationStructure")} + +type _TriangleAccelerationStructureClass struct { + objc.Class +} + +// An interface definition for the [TriangleAccelerationStructure] class. +type ITriangleAccelerationStructure interface { + IPolygonAccelerationStructure +} + +// An acceleration structure built over triangles. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpstriangleaccelerationstructure?language=objc +type TriangleAccelerationStructure struct { + PolygonAccelerationStructure +} + +func TriangleAccelerationStructureFrom(ptr unsafe.Pointer) TriangleAccelerationStructure { + return TriangleAccelerationStructure{ + PolygonAccelerationStructure: PolygonAccelerationStructureFrom(ptr), + } +} + +func (tc _TriangleAccelerationStructureClass) Alloc() TriangleAccelerationStructure { + rv := objc.Call[TriangleAccelerationStructure](tc, objc.Sel("alloc")) + return rv +} + +func TriangleAccelerationStructure_Alloc() TriangleAccelerationStructure { + return TriangleAccelerationStructureClass.Alloc() +} + +func (tc _TriangleAccelerationStructureClass) New() TriangleAccelerationStructure { + rv := objc.Call[TriangleAccelerationStructure](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTriangleAccelerationStructure() TriangleAccelerationStructure { + return TriangleAccelerationStructureClass.New() +} + +func (t_ TriangleAccelerationStructure) Init() TriangleAccelerationStructure { + rv := objc.Call[TriangleAccelerationStructure](t_, objc.Sel("init")) + return rv +} + +func (t_ TriangleAccelerationStructure) InitWithDevice(device metal.PDevice) TriangleAccelerationStructure { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TriangleAccelerationStructure](t_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// Initializes a new kernel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618763-initwithdevice?language=objc +func NewTriangleAccelerationStructureWithDevice(device metal.PDevice) TriangleAccelerationStructure { + instance := TriangleAccelerationStructureClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (t_ TriangleAccelerationStructure) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) TriangleAccelerationStructure { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[TriangleAccelerationStructure](t_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func TriangleAccelerationStructure_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) TriangleAccelerationStructure { + instance := TriangleAccelerationStructureClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} diff --git a/macos/mps/unary_image_kernel.gen.go b/macos/mps/unary_image_kernel.gen.go new file mode 100644 index 00000000..1043bfee --- /dev/null +++ b/macos/mps/unary_image_kernel.gen.go @@ -0,0 +1,167 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [UnaryImageKernel] class. +var UnaryImageKernelClass = _UnaryImageKernelClass{objc.GetClass("MPSUnaryImageKernel")} + +type _UnaryImageKernelClass struct { + objc.Class +} + +// An interface definition for the [UnaryImageKernel] class. +type IUnaryImageKernel interface { + IKernel + SourceRegionForDestinationSize(destinationSize metal.Size) Region + EncodeToCommandBufferSourceImageDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage IImage, destinationImage IImage) + EncodeToCommandBufferObjectSourceImageDestinationImage(commandBufferObject objc.IObject, sourceImage IImage, destinationImage IImage) + EdgeMode() ImageEdgeMode + SetEdgeMode(value ImageEdgeMode) + Offset() Offset + SetOffset(value Offset) + ClipRect() metal.Region + SetClipRect(value metal.Region) +} + +// A kernel that consumes one texture and produces one texture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel?language=objc +type UnaryImageKernel struct { + Kernel +} + +func UnaryImageKernelFrom(ptr unsafe.Pointer) UnaryImageKernel { + return UnaryImageKernel{ + Kernel: KernelFrom(ptr), + } +} + +func (u_ UnaryImageKernel) InitWithDevice(device metal.PDevice) UnaryImageKernel { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[UnaryImageKernel](u_, objc.Sel("initWithDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc +func NewUnaryImageKernelWithDevice(device metal.PDevice) UnaryImageKernel { + instance := UnaryImageKernelClass.Alloc().InitWithDevice(device) + instance.Autorelease() + return instance +} + +func (uc _UnaryImageKernelClass) Alloc() UnaryImageKernel { + rv := objc.Call[UnaryImageKernel](uc, objc.Sel("alloc")) + return rv +} + +func UnaryImageKernel_Alloc() UnaryImageKernel { + return UnaryImageKernelClass.Alloc() +} + +func (uc _UnaryImageKernelClass) New() UnaryImageKernel { + rv := objc.Call[UnaryImageKernel](uc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewUnaryImageKernel() UnaryImageKernel { + return UnaryImageKernelClass.New() +} + +func (u_ UnaryImageKernel) Init() UnaryImageKernel { + rv := objc.Call[UnaryImageKernel](u_, objc.Sel("init")) + return rv +} + +func (u_ UnaryImageKernel) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) UnaryImageKernel { + po1 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[UnaryImageKernel](u_, objc.Sel("copyWithZone:device:"), zone, po1) + rv.Autorelease() + return rv +} + +// Makes a copy of this kernel object for a new device. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc +func UnaryImageKernel_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) UnaryImageKernel { + instance := UnaryImageKernelClass.Alloc().CopyWithZoneDevice(zone, device) + instance.Autorelease() + return instance +} + +// Determines the region of the source texture that will be read for an encode operation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/1618754-sourceregionfordestinationsize?language=objc +func (u_ UnaryImageKernel) SourceRegionForDestinationSize(destinationSize metal.Size) Region { + rv := objc.Call[Region](u_, objc.Sel("sourceRegionForDestinationSize:"), destinationSize) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866328-encodetocommandbuffer?language=objc +func (u_ UnaryImageKernel) EncodeToCommandBufferSourceImageDestinationImage(commandBuffer metal.PCommandBuffer, sourceImage IImage, destinationImage IImage) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](u_, objc.Sel("encodeToCommandBuffer:sourceImage:destinationImage:"), po0, objc.Ptr(sourceImage), objc.Ptr(destinationImage)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866328-encodetocommandbuffer?language=objc +func (u_ UnaryImageKernel) EncodeToCommandBufferObjectSourceImageDestinationImage(commandBufferObject objc.IObject, sourceImage IImage, destinationImage IImage) { + objc.Call[objc.Void](u_, objc.Sel("encodeToCommandBuffer:sourceImage:destinationImage:"), objc.Ptr(commandBufferObject), objc.Ptr(sourceImage), objc.Ptr(destinationImage)) +} + +// The edge mode to use when texture reads stray off the edge of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/1618812-edgemode?language=objc +func (u_ UnaryImageKernel) EdgeMode() ImageEdgeMode { + rv := objc.Call[ImageEdgeMode](u_, objc.Sel("edgeMode")) + return rv +} + +// The edge mode to use when texture reads stray off the edge of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/1618812-edgemode?language=objc +func (u_ UnaryImageKernel) SetEdgeMode(value ImageEdgeMode) { + objc.Call[objc.Void](u_, objc.Sel("setEdgeMode:"), value) +} + +// The position of the destination clip rectangle origin relative to the source buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/1618884-offset?language=objc +func (u_ UnaryImageKernel) Offset() Offset { + rv := objc.Call[Offset](u_, objc.Sel("offset")) + return rv +} + +// The position of the destination clip rectangle origin relative to the source buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/1618884-offset?language=objc +func (u_ UnaryImageKernel) SetOffset(value Offset) { + objc.Call[objc.Void](u_, objc.Sel("setOffset:"), value) +} + +// An optional clip rectangle to use when writing data. Only the pixels in the rectangle will be overwritten. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/1618859-cliprect?language=objc +func (u_ UnaryImageKernel) ClipRect() metal.Region { + rv := objc.Call[metal.Region](u_, objc.Sel("clipRect")) + return rv +} + +// An optional clip rectangle to use when writing data. Only the pixels in the rectangle will be overwritten. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/1618859-cliprect?language=objc +func (u_ UnaryImageKernel) SetClipRect(value metal.Region) { + objc.Call[objc.Void](u_, objc.Sel("setClipRect:"), value) +} diff --git a/macos/mps/vector.gen.go b/macos/mps/vector.gen.go new file mode 100644 index 00000000..3a97f39e --- /dev/null +++ b/macos/mps/vector.gen.go @@ -0,0 +1,178 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Vector] class. +var VectorClass = _VectorClass{objc.GetClass("MPSVector")} + +type _VectorClass struct { + objc.Class +} + +// An interface definition for the [Vector] class. +type IVector interface { + objc.IObject + ResourceSize() uint + SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) + SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) + Device() metal.DeviceWrapper + VectorBytes() uint + Data() metal.BufferWrapper + Vectors() uint + Length() uint + Offset() uint + DataType() DataType +} + +// A 1D array of data that stores the data's values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector?language=objc +type Vector struct { + objc.Object +} + +func VectorFrom(ptr unsafe.Pointer) Vector { + return Vector{ + Object: objc.ObjectFrom(ptr), + } +} + +func (v_ Vector) InitWithDeviceDescriptor(device metal.PDevice, descriptor IVectorDescriptor) Vector { + po0 := objc.WrapAsProtocol("MTLDevice", device) + rv := objc.Call[Vector](v_, objc.Sel("initWithDevice:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2942566-initwithdevice?language=objc +func NewVectorWithDeviceDescriptor(device metal.PDevice, descriptor IVectorDescriptor) Vector { + instance := VectorClass.Alloc().InitWithDeviceDescriptor(device, descriptor) + instance.Autorelease() + return instance +} + +func (v_ Vector) InitWithBufferDescriptor(buffer metal.PBuffer, descriptor IVectorDescriptor) Vector { + po0 := objc.WrapAsProtocol("MTLBuffer", buffer) + rv := objc.Call[Vector](v_, objc.Sel("initWithBuffer:descriptor:"), po0, objc.Ptr(descriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873346-initwithbuffer?language=objc +func NewVectorWithBufferDescriptor(buffer metal.PBuffer, descriptor IVectorDescriptor) Vector { + instance := VectorClass.Alloc().InitWithBufferDescriptor(buffer, descriptor) + instance.Autorelease() + return instance +} + +func (vc _VectorClass) Alloc() Vector { + rv := objc.Call[Vector](vc, objc.Sel("alloc")) + return rv +} + +func Vector_Alloc() Vector { + return VectorClass.Alloc() +} + +func (vc _VectorClass) New() Vector { + rv := objc.Call[Vector](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVector() Vector { + return VectorClass.New() +} + +func (v_ Vector) Init() Vector { + rv := objc.Call[Vector](v_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2942570-resourcesize?language=objc +func (v_ Vector) ResourceSize() uint { + rv := objc.Call[uint](v_, objc.Sel("resourceSize")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2942568-synchronizeoncommandbuffer?language=objc +func (v_ Vector) SynchronizeOnCommandBuffer(commandBuffer metal.PCommandBuffer) { + po0 := objc.WrapAsProtocol("MTLCommandBuffer", commandBuffer) + objc.Call[objc.Void](v_, objc.Sel("synchronizeOnCommandBuffer:"), po0) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2942568-synchronizeoncommandbuffer?language=objc +func (v_ Vector) SynchronizeOnCommandBufferObject(commandBufferObject objc.IObject) { + objc.Call[objc.Void](v_, objc.Sel("synchronizeOnCommandBuffer:"), objc.Ptr(commandBufferObject)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873338-device?language=objc +func (v_ Vector) Device() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](v_, objc.Sel("device")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873340-vectorbytes?language=objc +func (v_ Vector) VectorBytes() uint { + rv := objc.Call[uint](v_, objc.Sel("vectorBytes")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873393-data?language=objc +func (v_ Vector) Data() metal.BufferWrapper { + rv := objc.Call[metal.BufferWrapper](v_, objc.Sel("data")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873388-vectors?language=objc +func (v_ Vector) Vectors() uint { + rv := objc.Call[uint](v_, objc.Sel("vectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873392-length?language=objc +func (v_ Vector) Length() uint { + rv := objc.Call[uint](v_, objc.Sel("length")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/3375741-offset?language=objc +func (v_ Vector) Offset() uint { + rv := objc.Call[uint](v_, objc.Sel("offset")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvector/2873336-datatype?language=objc +func (v_ Vector) DataType() DataType { + rv := objc.Call[DataType](v_, objc.Sel("dataType")) + return rv +} diff --git a/macos/mps/vector_descriptor.gen.go b/macos/mps/vector_descriptor.gen.go new file mode 100644 index 00000000..5f87d003 --- /dev/null +++ b/macos/mps/vector_descriptor.gen.go @@ -0,0 +1,137 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mps + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VectorDescriptor] class. +var VectorDescriptorClass = _VectorDescriptorClass{objc.GetClass("MPSVectorDescriptor")} + +type _VectorDescriptorClass struct { + objc.Class +} + +// An interface definition for the [VectorDescriptor] class. +type IVectorDescriptor interface { + objc.IObject + VectorBytes() uint + Vectors() uint + Length() uint + SetLength(value uint) + DataType() DataType + SetDataType(value DataType) +} + +// A description of the length and data type of a vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor?language=objc +type VectorDescriptor struct { + objc.Object +} + +func VectorDescriptorFrom(ptr unsafe.Pointer) VectorDescriptor { + return VectorDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VectorDescriptorClass) VectorDescriptorWithLengthDataType(length uint, dataType DataType) VectorDescriptor { + rv := objc.Call[VectorDescriptor](vc, objc.Sel("vectorDescriptorWithLength:dataType:"), length, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873328-vectordescriptorwithlength?language=objc +func VectorDescriptor_VectorDescriptorWithLengthDataType(length uint, dataType DataType) VectorDescriptor { + return VectorDescriptorClass.VectorDescriptorWithLengthDataType(length, dataType) +} + +func (vc _VectorDescriptorClass) Alloc() VectorDescriptor { + rv := objc.Call[VectorDescriptor](vc, objc.Sel("alloc")) + return rv +} + +func VectorDescriptor_Alloc() VectorDescriptor { + return VectorDescriptorClass.Alloc() +} + +func (vc _VectorDescriptorClass) New() VectorDescriptor { + rv := objc.Call[VectorDescriptor](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVectorDescriptor() VectorDescriptor { + return VectorDescriptorClass.New() +} + +func (v_ VectorDescriptor) Init() VectorDescriptor { + rv := objc.Call[VectorDescriptor](v_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873337-vectorbytesforlength?language=objc +func (vc _VectorDescriptorClass) VectorBytesForLengthDataType(length uint, dataType DataType) uint { + rv := objc.Call[uint](vc, objc.Sel("vectorBytesForLength:dataType:"), length, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873337-vectorbytesforlength?language=objc +func VectorDescriptor_VectorBytesForLengthDataType(length uint, dataType DataType) uint { + return VectorDescriptorClass.VectorBytesForLengthDataType(length, dataType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873335-vectorbytes?language=objc +func (v_ VectorDescriptor) VectorBytes() uint { + rv := objc.Call[uint](v_, objc.Sel("vectorBytes")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873333-vectors?language=objc +func (v_ VectorDescriptor) Vectors() uint { + rv := objc.Call[uint](v_, objc.Sel("vectors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873345-length?language=objc +func (v_ VectorDescriptor) Length() uint { + rv := objc.Call[uint](v_, objc.Sel("length")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873345-length?language=objc +func (v_ VectorDescriptor) SetLength(value uint) { + objc.Call[objc.Void](v_, objc.Sel("setLength:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873362-datatype?language=objc +func (v_ VectorDescriptor) DataType() DataType { + rv := objc.Call[DataType](v_, objc.Sel("dataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsvectordescriptor/2873362-datatype?language=objc +func (v_ VectorDescriptor) SetDataType(value DataType) { + objc.Call[objc.Void](v_, objc.Sel("setDataType:"), value) +} diff --git a/macos/mpsgraph/aliastypes.gen.go b/macos/mpsgraph/aliastypes.gen.go new file mode 100644 index 00000000..b71f334b --- /dev/null +++ b/macos/mpsgraph/aliastypes.gen.go @@ -0,0 +1,52 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "github.com/progrium/macdriver/macos/foundation" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphscheduledhandler?language=objc +type ScheduledHandler = func(resultsDictionary *foundation.Dictionary, error foundation.Error) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutablescheduledhandler?language=objc +type ExecutableScheduledHandler = func(results []TensorData, error foundation.Error) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcontrolflowdependencyblock?language=objc +type ControlFlowDependencyBlock = func() []Tensor + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphwhilebeforeblock?language=objc +type WhileBeforeBlock = func(inputTensors []Tensor, resultTensors foundation.MutableArray) Tensor + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphifthenelseblock?language=objc +type IfThenElseBlock = func() []Tensor + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphwhileafterblock?language=objc +type WhileAfterBlock = func(bodyBlockArguments []Tensor) []Tensor + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompletionhandler?language=objc +type CompletionHandler = func(resultsDictionary *foundation.Dictionary, error foundation.Error) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutablecompletionhandler?language=objc +type ExecutableCompletionHandler = func(results []TensorData, error foundation.Error) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphforloopbodyblock?language=objc +type ForLoopBodyBlock = func(index Tensor, iterationArguments []Tensor) []Tensor diff --git a/macos/mpsgraph/compilation_descriptor.gen.go b/macos/mpsgraph/compilation_descriptor.gen.go new file mode 100644 index 00000000..59e1e984 --- /dev/null +++ b/macos/mpsgraph/compilation_descriptor.gen.go @@ -0,0 +1,83 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompilationDescriptor] class. +var CompilationDescriptorClass = _CompilationDescriptorClass{objc.GetClass("MPSGraphCompilationDescriptor")} + +type _CompilationDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CompilationDescriptor] class. +type ICompilationDescriptor interface { + objc.IObject + DisableTypeInference() + OptimizationLevel() Optimization + SetOptimizationLevel(value Optimization) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor?language=objc +type CompilationDescriptor struct { + objc.Object +} + +func CompilationDescriptorFrom(ptr unsafe.Pointer) CompilationDescriptor { + return CompilationDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CompilationDescriptorClass) Alloc() CompilationDescriptor { + rv := objc.Call[CompilationDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CompilationDescriptor_Alloc() CompilationDescriptor { + return CompilationDescriptorClass.Alloc() +} + +func (cc _CompilationDescriptorClass) New() CompilationDescriptor { + rv := objc.Call[CompilationDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompilationDescriptor() CompilationDescriptor { + return CompilationDescriptorClass.New() +} + +func (c_ CompilationDescriptor) Init() CompilationDescriptor { + rv := objc.Call[CompilationDescriptor](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3787577-disabletypeinference?language=objc +func (c_ CompilationDescriptor) DisableTypeInference() { + objc.Call[objc.Void](c_, objc.Sel("disableTypeInference")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3922624-optimizationlevel?language=objc +func (c_ CompilationDescriptor) OptimizationLevel() Optimization { + rv := objc.Call[Optimization](c_, objc.Sel("optimizationLevel")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3922624-optimizationlevel?language=objc +func (c_ CompilationDescriptor) SetOptimizationLevel(value Optimization) { + objc.Call[objc.Void](c_, objc.Sel("setOptimizationLevel:"), value) +} diff --git a/macos/mpsgraph/convolution2_d_op_descriptor.gen.go b/macos/mpsgraph/convolution2_d_op_descriptor.gen.go new file mode 100644 index 00000000..a82c06e4 --- /dev/null +++ b/macos/mpsgraph/convolution2_d_op_descriptor.gen.go @@ -0,0 +1,282 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Convolution2DOpDescriptor] class. +var Convolution2DOpDescriptorClass = _Convolution2DOpDescriptorClass{objc.GetClass("MPSGraphConvolution2DOpDescriptor")} + +type _Convolution2DOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [Convolution2DOpDescriptor] class. +type IConvolution2DOpDescriptor interface { + objc.IObject + SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint) + StrideInX() uint + SetStrideInX(value uint) + PaddingStyle() PaddingStyle + SetPaddingStyle(value PaddingStyle) + PaddingBottom() uint + SetPaddingBottom(value uint) + PaddingTop() uint + SetPaddingTop(value uint) + StrideInY() uint + SetStrideInY(value uint) + WeightsLayout() TensorNamedDataLayout + SetWeightsLayout(value TensorNamedDataLayout) + PaddingLeft() uint + SetPaddingLeft(value uint) + DilationRateInX() uint + SetDilationRateInX(value uint) + DataLayout() TensorNamedDataLayout + SetDataLayout(value TensorNamedDataLayout) + Groups() uint + SetGroups(value uint) + DilationRateInY() uint + SetDilationRateInY(value uint) + PaddingRight() uint + SetPaddingRight(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor?language=objc +type Convolution2DOpDescriptor struct { + objc.Object +} + +func Convolution2DOpDescriptorFrom(ptr unsafe.Pointer) Convolution2DOpDescriptor { + return Convolution2DOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _Convolution2DOpDescriptorClass) DescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, groups uint, paddingStyle PaddingStyle, dataLayout TensorNamedDataLayout, weightsLayout TensorNamedDataLayout) Convolution2DOpDescriptor { + rv := objc.Call[Convolution2DOpDescriptor](cc, objc.Sel("descriptorWithStrideInX:strideInY:dilationRateInX:dilationRateInY:groups:paddingStyle:dataLayout:weightsLayout:"), strideInX, strideInY, dilationRateInX, dilationRateInY, groups, paddingStyle, dataLayout, weightsLayout) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564600-descriptorwithstrideinx?language=objc +func Convolution2DOpDescriptor_DescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, groups uint, paddingStyle PaddingStyle, dataLayout TensorNamedDataLayout, weightsLayout TensorNamedDataLayout) Convolution2DOpDescriptor { + return Convolution2DOpDescriptorClass.DescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingStyleDataLayoutWeightsLayout(strideInX, strideInY, dilationRateInX, dilationRateInY, groups, paddingStyle, dataLayout, weightsLayout) +} + +func (cc _Convolution2DOpDescriptorClass) Alloc() Convolution2DOpDescriptor { + rv := objc.Call[Convolution2DOpDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func Convolution2DOpDescriptor_Alloc() Convolution2DOpDescriptor { + return Convolution2DOpDescriptorClass.Alloc() +} + +func (cc _Convolution2DOpDescriptorClass) New() Convolution2DOpDescriptor { + rv := objc.Call[Convolution2DOpDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewConvolution2DOpDescriptor() Convolution2DOpDescriptor { + return Convolution2DOpDescriptorClass.New() +} + +func (c_ Convolution2DOpDescriptor) Init() Convolution2DOpDescriptor { + rv := objc.Call[Convolution2DOpDescriptor](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564609-setexplicitpaddingwithpaddinglef?language=objc +func (c_ Convolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint) { + objc.Call[objc.Void](c_, objc.Sel("setExplicitPaddingWithPaddingLeft:paddingRight:paddingTop:paddingBottom:"), paddingLeft, paddingRight, paddingTop, paddingBottom) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564610-strideinx?language=objc +func (c_ Convolution2DOpDescriptor) StrideInX() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564610-strideinx?language=objc +func (c_ Convolution2DOpDescriptor) SetStrideInX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setStrideInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564607-paddingstyle?language=objc +func (c_ Convolution2DOpDescriptor) PaddingStyle() PaddingStyle { + rv := objc.Call[PaddingStyle](c_, objc.Sel("paddingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564607-paddingstyle?language=objc +func (c_ Convolution2DOpDescriptor) SetPaddingStyle(value PaddingStyle) { + objc.Call[objc.Void](c_, objc.Sel("setPaddingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564604-paddingbottom?language=objc +func (c_ Convolution2DOpDescriptor) PaddingBottom() uint { + rv := objc.Call[uint](c_, objc.Sel("paddingBottom")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564604-paddingbottom?language=objc +func (c_ Convolution2DOpDescriptor) SetPaddingBottom(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPaddingBottom:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564608-paddingtop?language=objc +func (c_ Convolution2DOpDescriptor) PaddingTop() uint { + rv := objc.Call[uint](c_, objc.Sel("paddingTop")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564608-paddingtop?language=objc +func (c_ Convolution2DOpDescriptor) SetPaddingTop(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPaddingTop:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564611-strideiny?language=objc +func (c_ Convolution2DOpDescriptor) StrideInY() uint { + rv := objc.Call[uint](c_, objc.Sel("strideInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564611-strideiny?language=objc +func (c_ Convolution2DOpDescriptor) SetStrideInY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setStrideInY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564612-weightslayout?language=objc +func (c_ Convolution2DOpDescriptor) WeightsLayout() TensorNamedDataLayout { + rv := objc.Call[TensorNamedDataLayout](c_, objc.Sel("weightsLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564612-weightslayout?language=objc +func (c_ Convolution2DOpDescriptor) SetWeightsLayout(value TensorNamedDataLayout) { + objc.Call[objc.Void](c_, objc.Sel("setWeightsLayout:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564605-paddingleft?language=objc +func (c_ Convolution2DOpDescriptor) PaddingLeft() uint { + rv := objc.Call[uint](c_, objc.Sel("paddingLeft")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564605-paddingleft?language=objc +func (c_ Convolution2DOpDescriptor) SetPaddingLeft(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPaddingLeft:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564601-dilationrateinx?language=objc +func (c_ Convolution2DOpDescriptor) DilationRateInX() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564601-dilationrateinx?language=objc +func (c_ Convolution2DOpDescriptor) SetDilationRateInX(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setDilationRateInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564598-datalayout?language=objc +func (c_ Convolution2DOpDescriptor) DataLayout() TensorNamedDataLayout { + rv := objc.Call[TensorNamedDataLayout](c_, objc.Sel("dataLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564598-datalayout?language=objc +func (c_ Convolution2DOpDescriptor) SetDataLayout(value TensorNamedDataLayout) { + objc.Call[objc.Void](c_, objc.Sel("setDataLayout:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564603-groups?language=objc +func (c_ Convolution2DOpDescriptor) Groups() uint { + rv := objc.Call[uint](c_, objc.Sel("groups")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564603-groups?language=objc +func (c_ Convolution2DOpDescriptor) SetGroups(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setGroups:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564602-dilationrateiny?language=objc +func (c_ Convolution2DOpDescriptor) DilationRateInY() uint { + rv := objc.Call[uint](c_, objc.Sel("dilationRateInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564602-dilationrateiny?language=objc +func (c_ Convolution2DOpDescriptor) SetDilationRateInY(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setDilationRateInY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564606-paddingright?language=objc +func (c_ Convolution2DOpDescriptor) PaddingRight() uint { + rv := objc.Call[uint](c_, objc.Sel("paddingRight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor/3564606-paddingright?language=objc +func (c_ Convolution2DOpDescriptor) SetPaddingRight(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setPaddingRight:"), value) +} diff --git a/macos/mpsgraph/create_sparse_op_descriptor.gen.go b/macos/mpsgraph/create_sparse_op_descriptor.gen.go new file mode 100644 index 00000000..f43362cb --- /dev/null +++ b/macos/mpsgraph/create_sparse_op_descriptor.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CreateSparseOpDescriptor] class. +var CreateSparseOpDescriptorClass = _CreateSparseOpDescriptorClass{objc.GetClass("MPSGraphCreateSparseOpDescriptor")} + +type _CreateSparseOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [CreateSparseOpDescriptor] class. +type ICreateSparseOpDescriptor interface { + objc.IObject + SparseStorageType() SparseStorageType + SetSparseStorageType(value SparseStorageType) + DataType() mps.DataType + SetDataType(value mps.DataType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor?language=objc +type CreateSparseOpDescriptor struct { + objc.Object +} + +func CreateSparseOpDescriptorFrom(ptr unsafe.Pointer) CreateSparseOpDescriptor { + return CreateSparseOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CreateSparseOpDescriptorClass) DescriptorWithStorageTypeDataType(sparseStorageType SparseStorageType, dataType mps.DataType) CreateSparseOpDescriptor { + rv := objc.Call[CreateSparseOpDescriptor](cc, objc.Sel("descriptorWithStorageType:dataType:"), sparseStorageType, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor/3763061-descriptorwithstoragetype?language=objc +func CreateSparseOpDescriptor_DescriptorWithStorageTypeDataType(sparseStorageType SparseStorageType, dataType mps.DataType) CreateSparseOpDescriptor { + return CreateSparseOpDescriptorClass.DescriptorWithStorageTypeDataType(sparseStorageType, dataType) +} + +func (cc _CreateSparseOpDescriptorClass) Alloc() CreateSparseOpDescriptor { + rv := objc.Call[CreateSparseOpDescriptor](cc, objc.Sel("alloc")) + return rv +} + +func CreateSparseOpDescriptor_Alloc() CreateSparseOpDescriptor { + return CreateSparseOpDescriptorClass.Alloc() +} + +func (cc _CreateSparseOpDescriptorClass) New() CreateSparseOpDescriptor { + rv := objc.Call[CreateSparseOpDescriptor](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCreateSparseOpDescriptor() CreateSparseOpDescriptor { + return CreateSparseOpDescriptorClass.New() +} + +func (c_ CreateSparseOpDescriptor) Init() CreateSparseOpDescriptor { + rv := objc.Call[CreateSparseOpDescriptor](c_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor/3763062-sparsestoragetype?language=objc +func (c_ CreateSparseOpDescriptor) SparseStorageType() SparseStorageType { + rv := objc.Call[SparseStorageType](c_, objc.Sel("sparseStorageType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor/3763062-sparsestoragetype?language=objc +func (c_ CreateSparseOpDescriptor) SetSparseStorageType(value SparseStorageType) { + objc.Call[objc.Void](c_, objc.Sel("setSparseStorageType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor/3763060-datatype?language=objc +func (c_ CreateSparseOpDescriptor) DataType() mps.DataType { + rv := objc.Call[mps.DataType](c_, objc.Sel("dataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor/3763060-datatype?language=objc +func (c_ CreateSparseOpDescriptor) SetDataType(value mps.DataType) { + objc.Call[objc.Void](c_, objc.Sel("setDataType:"), value) +} diff --git a/macos/mpsgraph/depthwise_convolution2_d_op_descriptor.gen.go b/macos/mpsgraph/depthwise_convolution2_d_op_descriptor.gen.go new file mode 100644 index 00000000..17cda450 --- /dev/null +++ b/macos/mpsgraph/depthwise_convolution2_d_op_descriptor.gen.go @@ -0,0 +1,277 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DepthwiseConvolution2DOpDescriptor] class. +var DepthwiseConvolution2DOpDescriptorClass = _DepthwiseConvolution2DOpDescriptorClass{objc.GetClass("MPSGraphDepthwiseConvolution2DOpDescriptor")} + +type _DepthwiseConvolution2DOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [DepthwiseConvolution2DOpDescriptor] class. +type IDepthwiseConvolution2DOpDescriptor interface { + objc.IObject + SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint) + StrideInX() uint + SetStrideInX(value uint) + PaddingStyle() PaddingStyle + SetPaddingStyle(value PaddingStyle) + PaddingBottom() uint + SetPaddingBottom(value uint) + PaddingTop() uint + SetPaddingTop(value uint) + StrideInY() uint + SetStrideInY(value uint) + WeightsLayout() TensorNamedDataLayout + SetWeightsLayout(value TensorNamedDataLayout) + PaddingLeft() uint + SetPaddingLeft(value uint) + DilationRateInX() uint + SetDilationRateInX(value uint) + DataLayout() TensorNamedDataLayout + SetDataLayout(value TensorNamedDataLayout) + DilationRateInY() uint + SetDilationRateInY(value uint) + PaddingRight() uint + SetPaddingRight(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor?language=objc +type DepthwiseConvolution2DOpDescriptor struct { + objc.Object +} + +func DepthwiseConvolution2DOpDescriptorFrom(ptr unsafe.Pointer) DepthwiseConvolution2DOpDescriptor { + return DepthwiseConvolution2DOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (dc _DepthwiseConvolution2DOpDescriptorClass) DescriptorWithDataLayoutWeightsLayout(dataLayout TensorNamedDataLayout, weightsLayout TensorNamedDataLayout) DepthwiseConvolution2DOpDescriptor { + rv := objc.Call[DepthwiseConvolution2DOpDescriptor](dc, objc.Sel("descriptorWithDataLayout:weightsLayout:"), dataLayout, weightsLayout) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667492-descriptorwithdatalayout?language=objc +func DepthwiseConvolution2DOpDescriptor_DescriptorWithDataLayoutWeightsLayout(dataLayout TensorNamedDataLayout, weightsLayout TensorNamedDataLayout) DepthwiseConvolution2DOpDescriptor { + return DepthwiseConvolution2DOpDescriptorClass.DescriptorWithDataLayoutWeightsLayout(dataLayout, weightsLayout) +} + +func (dc _DepthwiseConvolution2DOpDescriptorClass) DescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingStyle PaddingStyle, dataLayout TensorNamedDataLayout, weightsLayout TensorNamedDataLayout) DepthwiseConvolution2DOpDescriptor { + rv := objc.Call[DepthwiseConvolution2DOpDescriptor](dc, objc.Sel("descriptorWithStrideInX:strideInY:dilationRateInX:dilationRateInY:paddingLeft:paddingRight:paddingTop:paddingBottom:paddingStyle:dataLayout:weightsLayout:"), strideInX, strideInY, dilationRateInX, dilationRateInY, paddingLeft, paddingRight, paddingTop, paddingBottom, paddingStyle, dataLayout, weightsLayout) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667493-descriptorwithstrideinx?language=objc +func DepthwiseConvolution2DOpDescriptor_DescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingStyle PaddingStyle, dataLayout TensorNamedDataLayout, weightsLayout TensorNamedDataLayout) DepthwiseConvolution2DOpDescriptor { + return DepthwiseConvolution2DOpDescriptorClass.DescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout(strideInX, strideInY, dilationRateInX, dilationRateInY, paddingLeft, paddingRight, paddingTop, paddingBottom, paddingStyle, dataLayout, weightsLayout) +} + +func (dc _DepthwiseConvolution2DOpDescriptorClass) Alloc() DepthwiseConvolution2DOpDescriptor { + rv := objc.Call[DepthwiseConvolution2DOpDescriptor](dc, objc.Sel("alloc")) + return rv +} + +func DepthwiseConvolution2DOpDescriptor_Alloc() DepthwiseConvolution2DOpDescriptor { + return DepthwiseConvolution2DOpDescriptorClass.Alloc() +} + +func (dc _DepthwiseConvolution2DOpDescriptorClass) New() DepthwiseConvolution2DOpDescriptor { + rv := objc.Call[DepthwiseConvolution2DOpDescriptor](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDepthwiseConvolution2DOpDescriptor() DepthwiseConvolution2DOpDescriptor { + return DepthwiseConvolution2DOpDescriptorClass.New() +} + +func (d_ DepthwiseConvolution2DOpDescriptor) Init() DepthwiseConvolution2DOpDescriptor { + rv := objc.Call[DepthwiseConvolution2DOpDescriptor](d_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667501-setexplicitpaddingwithpaddinglef?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint) { + objc.Call[objc.Void](d_, objc.Sel("setExplicitPaddingWithPaddingLeft:paddingRight:paddingTop:paddingBottom:"), paddingLeft, paddingRight, paddingTop, paddingBottom) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667502-strideinx?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) StrideInX() uint { + rv := objc.Call[uint](d_, objc.Sel("strideInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667502-strideinx?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetStrideInX(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setStrideInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667499-paddingstyle?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) PaddingStyle() PaddingStyle { + rv := objc.Call[PaddingStyle](d_, objc.Sel("paddingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667499-paddingstyle?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetPaddingStyle(value PaddingStyle) { + objc.Call[objc.Void](d_, objc.Sel("setPaddingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667496-paddingbottom?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) PaddingBottom() uint { + rv := objc.Call[uint](d_, objc.Sel("paddingBottom")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667496-paddingbottom?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetPaddingBottom(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setPaddingBottom:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667500-paddingtop?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) PaddingTop() uint { + rv := objc.Call[uint](d_, objc.Sel("paddingTop")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667500-paddingtop?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetPaddingTop(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setPaddingTop:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667503-strideiny?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) StrideInY() uint { + rv := objc.Call[uint](d_, objc.Sel("strideInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667503-strideiny?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetStrideInY(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setStrideInY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667504-weightslayout?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) WeightsLayout() TensorNamedDataLayout { + rv := objc.Call[TensorNamedDataLayout](d_, objc.Sel("weightsLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667504-weightslayout?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetWeightsLayout(value TensorNamedDataLayout) { + objc.Call[objc.Void](d_, objc.Sel("setWeightsLayout:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667497-paddingleft?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) PaddingLeft() uint { + rv := objc.Call[uint](d_, objc.Sel("paddingLeft")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667497-paddingleft?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetPaddingLeft(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setPaddingLeft:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667494-dilationrateinx?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) DilationRateInX() uint { + rv := objc.Call[uint](d_, objc.Sel("dilationRateInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667494-dilationrateinx?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetDilationRateInX(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setDilationRateInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667491-datalayout?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) DataLayout() TensorNamedDataLayout { + rv := objc.Call[TensorNamedDataLayout](d_, objc.Sel("dataLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667491-datalayout?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetDataLayout(value TensorNamedDataLayout) { + objc.Call[objc.Void](d_, objc.Sel("setDataLayout:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667495-dilationrateiny?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) DilationRateInY() uint { + rv := objc.Call[uint](d_, objc.Sel("dilationRateInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667495-dilationrateiny?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetDilationRateInY(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setDilationRateInY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667498-paddingright?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) PaddingRight() uint { + rv := objc.Call[uint](d_, objc.Sel("paddingRight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor/3667498-paddingright?language=objc +func (d_ DepthwiseConvolution2DOpDescriptor) SetPaddingRight(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setPaddingRight:"), value) +} diff --git a/macos/mpsgraph/depthwise_convolution3_d_op_descriptor.gen.go b/macos/mpsgraph/depthwise_convolution3_d_op_descriptor.gen.go new file mode 100644 index 00000000..198fa41a --- /dev/null +++ b/macos/mpsgraph/depthwise_convolution3_d_op_descriptor.gen.go @@ -0,0 +1,168 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DepthwiseConvolution3DOpDescriptor] class. +var DepthwiseConvolution3DOpDescriptorClass = _DepthwiseConvolution3DOpDescriptorClass{objc.GetClass("MPSGraphDepthwiseConvolution3DOpDescriptor")} + +type _DepthwiseConvolution3DOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [DepthwiseConvolution3DOpDescriptor] class. +type IDepthwiseConvolution3DOpDescriptor interface { + objc.IObject + PaddingStyle() PaddingStyle + SetPaddingStyle(value PaddingStyle) + ChannelDimensionIndex() int + SetChannelDimensionIndex(value int) + PaddingValues() []foundation.Number + SetPaddingValues(value []foundation.INumber) + DilationRates() []foundation.Number + SetDilationRates(value []foundation.INumber) + Strides() []foundation.Number + SetStrides(value []foundation.INumber) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor?language=objc +type DepthwiseConvolution3DOpDescriptor struct { + objc.Object +} + +func DepthwiseConvolution3DOpDescriptorFrom(ptr unsafe.Pointer) DepthwiseConvolution3DOpDescriptor { + return DepthwiseConvolution3DOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (dc _DepthwiseConvolution3DOpDescriptorClass) DescriptorWithStridesDilationRatesPaddingValuesPaddingStyle(strides []foundation.INumber, dilationRates []foundation.INumber, paddingValues []foundation.INumber, paddingStyle PaddingStyle) DepthwiseConvolution3DOpDescriptor { + rv := objc.Call[DepthwiseConvolution3DOpDescriptor](dc, objc.Sel("descriptorWithStrides:dilationRates:paddingValues:paddingStyle:"), strides, dilationRates, paddingValues, paddingStyle) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750684-descriptorwithstrides?language=objc +func DepthwiseConvolution3DOpDescriptor_DescriptorWithStridesDilationRatesPaddingValuesPaddingStyle(strides []foundation.INumber, dilationRates []foundation.INumber, paddingValues []foundation.INumber, paddingStyle PaddingStyle) DepthwiseConvolution3DOpDescriptor { + return DepthwiseConvolution3DOpDescriptorClass.DescriptorWithStridesDilationRatesPaddingValuesPaddingStyle(strides, dilationRates, paddingValues, paddingStyle) +} + +func (dc _DepthwiseConvolution3DOpDescriptorClass) DescriptorWithPaddingStyle(paddingStyle PaddingStyle) DepthwiseConvolution3DOpDescriptor { + rv := objc.Call[DepthwiseConvolution3DOpDescriptor](dc, objc.Sel("descriptorWithPaddingStyle:"), paddingStyle) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750683-descriptorwithpaddingstyle?language=objc +func DepthwiseConvolution3DOpDescriptor_DescriptorWithPaddingStyle(paddingStyle PaddingStyle) DepthwiseConvolution3DOpDescriptor { + return DepthwiseConvolution3DOpDescriptorClass.DescriptorWithPaddingStyle(paddingStyle) +} + +func (dc _DepthwiseConvolution3DOpDescriptorClass) Alloc() DepthwiseConvolution3DOpDescriptor { + rv := objc.Call[DepthwiseConvolution3DOpDescriptor](dc, objc.Sel("alloc")) + return rv +} + +func DepthwiseConvolution3DOpDescriptor_Alloc() DepthwiseConvolution3DOpDescriptor { + return DepthwiseConvolution3DOpDescriptorClass.Alloc() +} + +func (dc _DepthwiseConvolution3DOpDescriptorClass) New() DepthwiseConvolution3DOpDescriptor { + rv := objc.Call[DepthwiseConvolution3DOpDescriptor](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDepthwiseConvolution3DOpDescriptor() DepthwiseConvolution3DOpDescriptor { + return DepthwiseConvolution3DOpDescriptorClass.New() +} + +func (d_ DepthwiseConvolution3DOpDescriptor) Init() DepthwiseConvolution3DOpDescriptor { + rv := objc.Call[DepthwiseConvolution3DOpDescriptor](d_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750686-paddingstyle?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) PaddingStyle() PaddingStyle { + rv := objc.Call[PaddingStyle](d_, objc.Sel("paddingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750686-paddingstyle?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) SetPaddingStyle(value PaddingStyle) { + objc.Call[objc.Void](d_, objc.Sel("setPaddingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3787589-channeldimensionindex?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) ChannelDimensionIndex() int { + rv := objc.Call[int](d_, objc.Sel("channelDimensionIndex")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3787589-channeldimensionindex?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) SetChannelDimensionIndex(value int) { + objc.Call[objc.Void](d_, objc.Sel("setChannelDimensionIndex:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750687-paddingvalues?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) PaddingValues() []foundation.Number { + rv := objc.Call[[]foundation.Number](d_, objc.Sel("paddingValues")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750687-paddingvalues?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) SetPaddingValues(value []foundation.INumber) { + objc.Call[objc.Void](d_, objc.Sel("setPaddingValues:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750685-dilationrates?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) DilationRates() []foundation.Number { + rv := objc.Call[[]foundation.Number](d_, objc.Sel("dilationRates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750685-dilationrates?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) SetDilationRates(value []foundation.INumber) { + objc.Call[objc.Void](d_, objc.Sel("setDilationRates:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750688-strides?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) Strides() []foundation.Number { + rv := objc.Call[[]foundation.Number](d_, objc.Sel("strides")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor/3750688-strides?language=objc +func (d_ DepthwiseConvolution3DOpDescriptor) SetStrides(value []foundation.INumber) { + objc.Call[objc.Void](d_, objc.Sel("setStrides:"), value) +} diff --git a/macos/mpsgraph/device.gen.go b/macos/mpsgraph/device.gen.go new file mode 100644 index 00000000..a5da1e04 --- /dev/null +++ b/macos/mpsgraph/device.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Device] class. +var DeviceClass = _DeviceClass{objc.GetClass("MPSGraphDevice")} + +type _DeviceClass struct { + objc.Class +} + +// An interface definition for the [Device] class. +type IDevice interface { + objc.IObject + MetalDevice() metal.DeviceWrapper + Type() DeviceType +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdevice?language=objc +type Device struct { + objc.Object +} + +func DeviceFrom(ptr unsafe.Pointer) Device { + return Device{ + Object: objc.ObjectFrom(ptr), + } +} + +func (dc _DeviceClass) DeviceWithMTLDevice(metalDevice metal.PDevice) Device { + po0 := objc.WrapAsProtocol("MTLDevice", metalDevice) + rv := objc.Call[Device](dc, objc.Sel("deviceWithMTLDevice:"), po0) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdevice/3564649-devicewithmtldevice?language=objc +func Device_DeviceWithMTLDevice(metalDevice metal.PDevice) Device { + return DeviceClass.DeviceWithMTLDevice(metalDevice) +} + +func (dc _DeviceClass) Alloc() Device { + rv := objc.Call[Device](dc, objc.Sel("alloc")) + return rv +} + +func Device_Alloc() Device { + return DeviceClass.Alloc() +} + +func (dc _DeviceClass) New() Device { + rv := objc.Call[Device](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDevice() Device { + return DeviceClass.New() +} + +func (d_ Device) Init() Device { + rv := objc.Call[Device](d_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdevice/3564650-metaldevice?language=objc +func (d_ Device) MetalDevice() metal.DeviceWrapper { + rv := objc.Call[metal.DeviceWrapper](d_, objc.Sel("metalDevice")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdevice/3564651-type?language=objc +func (d_ Device) Type() DeviceType { + rv := objc.Call[DeviceType](d_, objc.Sel("type")) + return rv +} diff --git a/macos/mpsgraph/doc.gen.go b/macos/mpsgraph/doc.gen.go new file mode 100644 index 00000000..6ec5ac5b --- /dev/null +++ b/macos/mpsgraph/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Build, compile, and execute customized multidimensional compute graphs for linear algebra, machine learning, computer vision, and other similar domains. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/metalperformanceshadersgraph?language=objc +package mpsgraph diff --git a/macos/mpsgraph/enumtypes.gen.go b/macos/mpsgraph/enumtypes.gen.go new file mode 100644 index 00000000..0b133d6e --- /dev/null +++ b/macos/mpsgraph/enumtypes.gen.go @@ -0,0 +1,157 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphdevicetype?language=objc +type DeviceType uint32 + +const ( + DeviceTypeMetal DeviceType = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlossreductiontype?language=objc +type LossReductionType uint64 + +const ( + LossReductionTypeAxis LossReductionType = 0 + LossReductionTypeMean LossReductionType = 2 + LossReductionTypeSum LossReductionType = 1 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoptimization?language=objc +type Optimization uint64 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoptimizationprofile?language=objc +type OptimizationProfile uint64 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoptions?language=objc +type Options uint64 + +const ( + OptionsDefault Options = 1 + OptionsNone Options = 0 + OptionsSynchronizeResults Options = 1 + OptionsVerbose Options = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpaddingmode?language=objc +type PaddingMode int + +const ( + PaddingModeAntiPeriodic PaddingMode = 6 + PaddingModeClampToEdge PaddingMode = 3 + PaddingModeConstant PaddingMode = 0 + PaddingModePeriodic PaddingMode = 5 + PaddingModeReflect PaddingMode = 1 + PaddingModeSymmetric PaddingMode = 2 + PaddingModeZero PaddingMode = 4 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpaddingstyle?language=objc +type PaddingStyle uint + +const ( + PaddingStyleExplicit PaddingStyle = 0 + PaddingStyleExplicitOffset PaddingStyle = 3 + PaddingStyleTF_SAME PaddingStyle = 2 + PaddingStyleTF_VALID PaddingStyle = 1 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpoolingreturnindicesmode?language=objc +type PoolingReturnIndicesMode uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrnnactivation?language=objc +type RNNActivation uint + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomdistribution?language=objc +type RandomDistribution uint64 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomnormalsamplingmethod?language=objc +type RandomNormalSamplingMethod uint64 + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphreductionmode?language=objc +type ReductionMode uint + +const ( + ReductionModeArgumentMax ReductionMode = 5 + ReductionModeArgumentMin ReductionMode = 4 + ReductionModeMax ReductionMode = 1 + ReductionModeMin ReductionMode = 0 + ReductionModeProduct ReductionMode = 3 + ReductionModeSum ReductionMode = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphresizemode?language=objc +type ResizeMode uint + +const ( + ResizeBilinear ResizeMode = 1 + ResizeNearest ResizeMode = 0 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphscattermode?language=objc +type ScatterMode int + +const ( + ScatterModeAdd ScatterMode = 0 + ScatterModeDiv ScatterMode = 3 + ScatterModeMax ScatterMode = 5 + ScatterModeMin ScatterMode = 4 + ScatterModeMul ScatterMode = 2 + ScatterModeSet ScatterMode = 6 + ScatterModeSub ScatterMode = 1 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsparsestoragetype?language=objc +type SparseStorageType uint64 + +const ( + SparseStorageCOO SparseStorageType = 0 + SparseStorageCSC SparseStorageType = 1 + SparseStorageCSR SparseStorageType = 2 +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensornameddatalayout?language=objc +type TensorNamedDataLayout uint + +const ( + TensorNamedDataLayoutCHW TensorNamedDataLayout = 4 + TensorNamedDataLayoutHW TensorNamedDataLayout = 6 + TensorNamedDataLayoutHWC TensorNamedDataLayout = 5 + TensorNamedDataLayoutHWIO TensorNamedDataLayout = 3 + TensorNamedDataLayoutNCHW TensorNamedDataLayout = 0 + TensorNamedDataLayoutNHWC TensorNamedDataLayout = 1 + TensorNamedDataLayoutOIHW TensorNamedDataLayout = 2 +) diff --git a/macos/mpsgraph/executable.gen.go b/macos/mpsgraph/executable.gen.go new file mode 100644 index 00000000..3dbffaed --- /dev/null +++ b/macos/mpsgraph/executable.gen.go @@ -0,0 +1,150 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Executable] class. +var ExecutableClass = _ExecutableClass{objc.GetClass("MPSGraphExecutable")} + +type _ExecutableClass struct { + objc.Class +} + +// An interface definition for the [Executable] class. +type IExecutable interface { + objc.IObject + RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.PCommandQueue, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData + RunWithMTLCommandQueueObjectInputsArrayResultsArrayExecutionDescriptor(commandQueueObject objc.IObject, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData + RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.PCommandQueue, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData + RunAsyncWithMTLCommandQueueObjectInputsArrayResultsArrayExecutionDescriptor(commandQueueObject objc.IObject, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData + SpecializeWithDeviceInputTypesCompilationDescriptor(device IDevice, inputTypes []IType, compilationDescriptor ICompilationDescriptor) + EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor(commandBuffer mps.ICommandBuffer, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData + Options() Options + SetOptions(value Options) + FeedTensors() []Tensor + TargetTensors() []Tensor +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable?language=objc +type Executable struct { + objc.Object +} + +func ExecutableFrom(ptr unsafe.Pointer) Executable { + return Executable{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExecutableClass) Alloc() Executable { + rv := objc.Call[Executable](ec, objc.Sel("alloc")) + return rv +} + +func Executable_Alloc() Executable { + return ExecutableClass.Alloc() +} + +func (ec _ExecutableClass) New() Executable { + rv := objc.Call[Executable](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExecutable() Executable { + return ExecutableClass.New() +} + +func (e_ Executable) Init() Executable { + rv := objc.Call[Executable](e_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787595-runwithmtlcommandqueue?language=objc +func (e_ Executable) RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.PCommandQueue, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData { + po0 := objc.WrapAsProtocol("MTLCommandQueue", commandQueue) + rv := objc.Call[[]TensorData](e_, objc.Sel("runWithMTLCommandQueue:inputsArray:resultsArray:executionDescriptor:"), po0, inputsArray, resultsArray, objc.Ptr(executionDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787595-runwithmtlcommandqueue?language=objc +func (e_ Executable) RunWithMTLCommandQueueObjectInputsArrayResultsArrayExecutionDescriptor(commandQueueObject objc.IObject, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData { + rv := objc.Call[[]TensorData](e_, objc.Sel("runWithMTLCommandQueue:inputsArray:resultsArray:executionDescriptor:"), objc.Ptr(commandQueueObject), inputsArray, resultsArray, objc.Ptr(executionDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787594-runasyncwithmtlcommandqueue?language=objc +func (e_ Executable) RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.PCommandQueue, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData { + po0 := objc.WrapAsProtocol("MTLCommandQueue", commandQueue) + rv := objc.Call[[]TensorData](e_, objc.Sel("runAsyncWithMTLCommandQueue:inputsArray:resultsArray:executionDescriptor:"), po0, inputsArray, resultsArray, objc.Ptr(executionDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787594-runasyncwithmtlcommandqueue?language=objc +func (e_ Executable) RunAsyncWithMTLCommandQueueObjectInputsArrayResultsArrayExecutionDescriptor(commandQueueObject objc.IObject, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData { + rv := objc.Call[[]TensorData](e_, objc.Sel("runAsyncWithMTLCommandQueue:inputsArray:resultsArray:executionDescriptor:"), objc.Ptr(commandQueueObject), inputsArray, resultsArray, objc.Ptr(executionDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787596-specializewithdevice?language=objc +func (e_ Executable) SpecializeWithDeviceInputTypesCompilationDescriptor(device IDevice, inputTypes []IType, compilationDescriptor ICompilationDescriptor) { + objc.Call[objc.Void](e_, objc.Sel("specializeWithDevice:inputTypes:compilationDescriptor:"), objc.Ptr(device), inputTypes, objc.Ptr(compilationDescriptor)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787591-encodetocommandbuffer?language=objc +func (e_ Executable) EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor(commandBuffer mps.ICommandBuffer, inputsArray []ITensorData, resultsArray []ITensorData, executionDescriptor IExecutableExecutionDescriptor) []TensorData { + rv := objc.Call[[]TensorData](e_, objc.Sel("encodeToCommandBuffer:inputsArray:resultsArray:executionDescriptor:"), objc.Ptr(commandBuffer), inputsArray, resultsArray, objc.Ptr(executionDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787593-options?language=objc +func (e_ Executable) Options() Options { + rv := objc.Call[Options](e_, objc.Sel("options")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787593-options?language=objc +func (e_ Executable) SetOptions(value Options) { + objc.Call[objc.Void](e_, objc.Sel("setOptions:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787592-feedtensors?language=objc +func (e_ Executable) FeedTensors() []Tensor { + rv := objc.Call[[]Tensor](e_, objc.Sel("feedTensors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutable/3787597-targettensors?language=objc +func (e_ Executable) TargetTensors() []Tensor { + rv := objc.Call[[]Tensor](e_, objc.Sel("targetTensors")) + return rv +} diff --git a/macos/mpsgraph/executable_execution_descriptor.gen.go b/macos/mpsgraph/executable_execution_descriptor.gen.go new file mode 100644 index 00000000..d468ef65 --- /dev/null +++ b/macos/mpsgraph/executable_execution_descriptor.gen.go @@ -0,0 +1,109 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExecutableExecutionDescriptor] class. +var ExecutableExecutionDescriptorClass = _ExecutableExecutionDescriptorClass{objc.GetClass("MPSGraphExecutableExecutionDescriptor")} + +type _ExecutableExecutionDescriptorClass struct { + objc.Class +} + +// An interface definition for the [ExecutableExecutionDescriptor] class. +type IExecutableExecutionDescriptor interface { + objc.IObject + ScheduledHandler() ExecutableScheduledHandler + SetScheduledHandler(value ExecutableScheduledHandler) + WaitUntilCompleted() bool + SetWaitUntilCompleted(value bool) + CompletionHandler() ExecutableCompletionHandler + SetCompletionHandler(value ExecutableCompletionHandler) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor?language=objc +type ExecutableExecutionDescriptor struct { + objc.Object +} + +func ExecutableExecutionDescriptorFrom(ptr unsafe.Pointer) ExecutableExecutionDescriptor { + return ExecutableExecutionDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExecutableExecutionDescriptorClass) Alloc() ExecutableExecutionDescriptor { + rv := objc.Call[ExecutableExecutionDescriptor](ec, objc.Sel("alloc")) + return rv +} + +func ExecutableExecutionDescriptor_Alloc() ExecutableExecutionDescriptor { + return ExecutableExecutionDescriptorClass.Alloc() +} + +func (ec _ExecutableExecutionDescriptorClass) New() ExecutableExecutionDescriptor { + rv := objc.Call[ExecutableExecutionDescriptor](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExecutableExecutionDescriptor() ExecutableExecutionDescriptor { + return ExecutableExecutionDescriptorClass.New() +} + +func (e_ ExecutableExecutionDescriptor) Init() ExecutableExecutionDescriptor { + rv := objc.Call[ExecutableExecutionDescriptor](e_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor/3787601-scheduledhandler?language=objc +func (e_ ExecutableExecutionDescriptor) ScheduledHandler() ExecutableScheduledHandler { + rv := objc.Call[ExecutableScheduledHandler](e_, objc.Sel("scheduledHandler")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor/3787601-scheduledhandler?language=objc +func (e_ ExecutableExecutionDescriptor) SetScheduledHandler(value ExecutableScheduledHandler) { + objc.Call[objc.Void](e_, objc.Sel("setScheduledHandler:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor/3787602-waituntilcompleted?language=objc +func (e_ ExecutableExecutionDescriptor) WaitUntilCompleted() bool { + rv := objc.Call[bool](e_, objc.Sel("waitUntilCompleted")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor/3787602-waituntilcompleted?language=objc +func (e_ ExecutableExecutionDescriptor) SetWaitUntilCompleted(value bool) { + objc.Call[objc.Void](e_, objc.Sel("setWaitUntilCompleted:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor/3787600-completionhandler?language=objc +func (e_ ExecutableExecutionDescriptor) CompletionHandler() ExecutableCompletionHandler { + rv := objc.Call[ExecutableCompletionHandler](e_, objc.Sel("completionHandler")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor/3787600-completionhandler?language=objc +func (e_ ExecutableExecutionDescriptor) SetCompletionHandler(value ExecutableCompletionHandler) { + objc.Call[objc.Void](e_, objc.Sel("setCompletionHandler:"), value) +} diff --git a/macos/mpsgraph/execution_descriptor.gen.go b/macos/mpsgraph/execution_descriptor.gen.go new file mode 100644 index 00000000..5b72046d --- /dev/null +++ b/macos/mpsgraph/execution_descriptor.gen.go @@ -0,0 +1,126 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ExecutionDescriptor] class. +var ExecutionDescriptorClass = _ExecutionDescriptorClass{objc.GetClass("MPSGraphExecutionDescriptor")} + +type _ExecutionDescriptorClass struct { + objc.Class +} + +// An interface definition for the [ExecutionDescriptor] class. +type IExecutionDescriptor interface { + objc.IObject + ScheduledHandler() ScheduledHandler + SetScheduledHandler(value ScheduledHandler) + WaitUntilCompleted() bool + SetWaitUntilCompleted(value bool) + CompilationDescriptor() CompilationDescriptor + SetCompilationDescriptor(value ICompilationDescriptor) + CompletionHandler() CompletionHandler + SetCompletionHandler(value CompletionHandler) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor?language=objc +type ExecutionDescriptor struct { + objc.Object +} + +func ExecutionDescriptorFrom(ptr unsafe.Pointer) ExecutionDescriptor { + return ExecutionDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ec _ExecutionDescriptorClass) Alloc() ExecutionDescriptor { + rv := objc.Call[ExecutionDescriptor](ec, objc.Sel("alloc")) + return rv +} + +func ExecutionDescriptor_Alloc() ExecutionDescriptor { + return ExecutionDescriptorClass.Alloc() +} + +func (ec _ExecutionDescriptorClass) New() ExecutionDescriptor { + rv := objc.Call[ExecutionDescriptor](ec, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewExecutionDescriptor() ExecutionDescriptor { + return ExecutionDescriptorClass.New() +} + +func (e_ ExecutionDescriptor) Init() ExecutionDescriptor { + rv := objc.Call[ExecutionDescriptor](e_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3564627-scheduledhandler?language=objc +func (e_ ExecutionDescriptor) ScheduledHandler() ScheduledHandler { + rv := objc.Call[ScheduledHandler](e_, objc.Sel("scheduledHandler")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3564627-scheduledhandler?language=objc +func (e_ ExecutionDescriptor) SetScheduledHandler(value ScheduledHandler) { + objc.Call[objc.Void](e_, objc.Sel("setScheduledHandler:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3564628-waituntilcompleted?language=objc +func (e_ ExecutionDescriptor) WaitUntilCompleted() bool { + rv := objc.Call[bool](e_, objc.Sel("waitUntilCompleted")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3564628-waituntilcompleted?language=objc +func (e_ ExecutionDescriptor) SetWaitUntilCompleted(value bool) { + objc.Call[objc.Void](e_, objc.Sel("setWaitUntilCompleted:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3922625-compilationdescriptor?language=objc +func (e_ ExecutionDescriptor) CompilationDescriptor() CompilationDescriptor { + rv := objc.Call[CompilationDescriptor](e_, objc.Sel("compilationDescriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3922625-compilationdescriptor?language=objc +func (e_ ExecutionDescriptor) SetCompilationDescriptor(value ICompilationDescriptor) { + objc.Call[objc.Void](e_, objc.Sel("setCompilationDescriptor:"), objc.Ptr(value)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3564626-completionhandler?language=objc +func (e_ ExecutionDescriptor) CompletionHandler() CompletionHandler { + rv := objc.Call[CompletionHandler](e_, objc.Sel("completionHandler")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphexecutiondescriptor/3564626-completionhandler?language=objc +func (e_ ExecutionDescriptor) SetCompletionHandler(value CompletionHandler) { + objc.Call[objc.Void](e_, objc.Sel("setCompletionHandler:"), value) +} diff --git a/macos/mpsgraph/graph.gen.go b/macos/mpsgraph/graph.gen.go new file mode 100644 index 00000000..5f2f59d9 --- /dev/null +++ b/macos/mpsgraph/graph.gen.go @@ -0,0 +1,1785 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Graph] class. +var GraphClass = _GraphClass{objc.GetClass("MPSGraph")} + +type _GraphClass struct { + objc.Class +} + +// An interface definition for the [Graph] class. +type IGraph interface { + objc.IObject + MaxPooling2DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor + AvgPooling4DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor + LessThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient ITensor, weights ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution2DOpDescriptor, name string) Tensor + SparseTensorWithDescriptorTensorsShapeName(sparseDescriptor ICreateSparseOpDescriptor, inputTensorArray []ITensor, shape *foundation.Array, name string) Tensor + LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName(source ITensor, recurrentWeight ITensor, initState ITensor, initCell ITensor, descriptor ILSTMDescriptor, name string) []Tensor + Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient ITensor, weights ITensor, outputShapeTensor ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor + RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary(commandQueue metal.PCommandQueue, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary) + RunWithMTLCommandQueueObjectFeedsTargetOperationsResultsDictionary(commandQueueObject objc.IObject, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary) + ExpandDimsOfTensorAxesTensorName(tensor ITensor, axesTensor ITensor, name string) Tensor + ReductionAndWithTensorAxisName(tensor ITensor, axis int, name string) Tensor + ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName(imagesTensor ITensor, size ITensor, mode ResizeMode, centerResult bool, alignCorners bool, layout TensorNamedDataLayout, name string) Tensor + TanWithTensorName(tensor ITensor, name string) Tensor + FloorModuloWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradientTensor ITensor, source ITensor, outputShape ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor + CoordinateAlongAxisTensorWithShapeTensorName(axisTensor ITensor, shapeTensor ITensor, name string) Tensor + ReductionProductWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor + AssignVariableWithValueOfTensorName(variable ITensor, tensor ITensor, name string) Operation + RandomUniformTensorWithShapeTensorName(shapeTensor ITensor, name string) Tensor + PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName(tensor ITensor, paddingMode PaddingMode, leftPadding *foundation.Array, rightPadding *foundation.Array, constantValue float64, name string) Tensor + ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName(learningRateTensor ITensor, variable IVariableOp, gradientTensor ITensor, name string) Operation + SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName(predicateTensor ITensor, truePredicateTensor ITensor, falseSelectTensor ITensor, name string) Tensor + DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient ITensor, source ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution3DOpDescriptor, name string) Tensor + LeakyReLUWithTensorAlphaName(tensor ITensor, alpha float64, name string) Tensor + LogicalNORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName(dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, batchDimensions uint, mode ScatterMode, name string) Tensor + SquareWithTensorName(tensor ITensor, name string) Tensor + ForLoopWithNumberOfIterationsInitialBodyArgumentsBodyName(numberOfIterations ITensor, initialBodyArguments []ITensor, body ForLoopBodyBlock, name string) []Tensor + LogicalORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ReductionOrWithTensorAxisName(tensor ITensor, axis int, name string) Tensor + DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor ITensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) Tensor + MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor + AsinWithTensorName(tensor ITensor, name string) Tensor + SigmoidWithTensorName(tensor ITensor, name string) Tensor + TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName(incomingGradientTensor ITensor, sourceTensor ITensor, multiplier *foundation.Array, name string) Tensor + ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName(updatesTensor ITensor, indicesTensor ITensor, shape *foundation.Array, axis int, mode ScatterMode, name string) Tensor + ErfWithTensorName(tensor ITensor, name string) Tensor + TanhWithTensorName(tensor ITensor, name string) Tensor + BandPartWithTensorNumLowerTensorNumUpperTensorName(inputTensor ITensor, numLowerTensor ITensor, numUpperTensor ITensor, name string) Tensor + DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient ITensor, source ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution2DOpDescriptor, name string) Tensor + SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName(sourceTensor ITensor, labelsTensor ITensor, axis int, reductionType LossReductionType, name string) Tensor + SignbitWithTensorName(tensor ITensor, name string) Tensor + StencilWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IStencilOpDescriptor, name string) Tensor + AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor + Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient ITensor, source ITensor, outputShapeTensor ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor + RandomTensorWithShapeDescriptorName(shape *foundation.Array, descriptor IRandomOpDescriptor, name string) Tensor + AtanhWithTensorName(tensor ITensor, name string) Tensor + ReductionArgMinimumWithTensorAxisName(tensor ITensor, axis int, name string) Tensor + ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradient ITensor, weights ITensor, outputShape ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor + IsNaNWithTensorName(tensor ITensor, name string) Tensor + MaximumWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + MaxPooling2DReturnIndicesWithSourceTensorDescriptorName(source ITensor, descriptor IPooling2DOpDescriptor, name string) []Tensor + IfWithPredicateTensorThenBlockElseBlockName(predicateTensor ITensor, thenBlock IfThenElseBlock, elseBlock IfThenElseBlock, name string) []Tensor + LessThanWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName(axis int, dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, mode ScatterMode, name string) Tensor + LogarithmBase10WithTensorName(tensor ITensor, name string) Tensor + SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor ITensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) Tensor + AdditionWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + TileTensorWithMultiplierName(tensor ITensor, multiplier *foundation.Array, name string) Tensor + ExponentWithTensorName(tensor ITensor, name string) Tensor + CastTensorToTypeName(tensor ITensor, type_ mps.DataType, name string) Tensor + MeanOfTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor + ReverseSquareRootWithTensorName(tensor ITensor, name string) Tensor + ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName(updatesTensor ITensor, indicesTensor ITensor, shape *foundation.Array, batchDimensions uint, mode ScatterMode, name string) Tensor + CoordinateAlongAxisWithShapeTensorName(axis int, shapeTensor ITensor, name string) Tensor + GatherAlongAxisWithUpdatesTensorIndicesTensorName(axis int, updatesTensor ITensor, indicesTensor ITensor, name string) Tensor + LogicalXORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + FloorWithTensorName(tensor ITensor, name string) Tensor + DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient ITensor, weights ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution3DOpDescriptor, name string) Tensor + LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName(source ITensor, recurrentWeight ITensor, sourceGradient ITensor, zState ITensor, cellOutputFwd ITensor, descriptor ILSTMDescriptor, name string) []Tensor + SplitTensorSplitSizesTensorAxisName(tensor ITensor, splitSizesTensor ITensor, axis int, name string) []Tensor + TopKWithGradientTensorSourceKTensorName(gradient ITensor, source ITensor, kTensor ITensor, name string) Tensor + IsFiniteWithTensorName(tensor ITensor, name string) Tensor + SubtractionWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ReadVariableName(variable ITensor, name string) Tensor + LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName(gradient ITensor, source ITensor, alphaTensor ITensor, name string) Tensor + SqueezeTensorName(tensor ITensor, name string) Tensor + NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName(incomingGradientTensor ITensor, sourceTensor ITensor, meanTensor ITensor, varianceTensor ITensor, gamma ITensor, gammaGradient ITensor, betaGradient ITensor, axes []foundation.INumber, epsilon float64, name string) Tensor + Convolution2DWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IConvolution2DOpDescriptor, name string) Tensor + ReLUGradientWithIncomingGradientSourceTensorName(gradient ITensor, source ITensor, name string) Tensor + Flatten2DTensorAxisTensorName(tensor ITensor, axisTensor ITensor, name string) Tensor + OneHotWithIndicesTensorDepthName(indicesTensor ITensor, depth uint, name string) Tensor + ConcatTensorsDimensionInterleaveName(tensors []ITensor, dimensionIndex int, interleave bool, name string) Tensor + ReductionMinimumWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor + ReductionMaximumPropagateNaNWithTensorAxisName(tensor ITensor, axis int, name string) Tensor + RintWithTensorName(tensor ITensor, name string) Tensor + Atan2WithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + CosWithTensorName(tensor ITensor, name string) Tensor + MaxPooling4DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor + RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandQueue metal.PCommandQueue, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary, executionDescriptor IExecutionDescriptor) + RunAsyncWithMTLCommandQueueObjectFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandQueueObject objc.IObject, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary, executionDescriptor IExecutionDescriptor) + ForLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName(lowerBound ITensor, upperBound ITensor, step ITensor, initialBodyArguments []ITensor, body ForLoopBodyBlock, name string) []Tensor + ReLUWithTensorName(tensor ITensor, name string) Tensor + SigmoidGradientWithIncomingGradientSourceTensorName(gradient ITensor, source ITensor, name string) Tensor + SliceGradientTensorFwdInShapeTensorStartsEndsStridesName(inputGradientTensor ITensor, fwdInShapeTensor ITensor, starts []foundation.INumber, ends []foundation.INumber, strides []foundation.INumber, name string) Tensor + AvgPooling2DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor + ConstantWithScalarDataType(scalar float64, dataType mps.DataType) Tensor + ReshapeTensorWithShapeTensorName(tensor ITensor, shapeTensor ITensor, name string) Tensor + MatrixMultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ControlDependencyWithOperationsDependentBlockName(operations []IOperation, dependentBlock ControlFlowDependencyBlock, name string) []Tensor + LogicalXNORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName(updatesTensor ITensor, indicesTensor ITensor, axis uint, batchDimensions uint, name string) Tensor + CoshWithTensorName(tensor ITensor, name string) Tensor + AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor + ReductionMinimumPropagateNaNWithTensorAxisName(tensor ITensor, axis int, name string) Tensor + RandomUniformTensorWithShapeName(shape *foundation.Array, name string) Tensor + LogarithmWithTensorName(tensor ITensor, name string) Tensor + SparseTensorWithTypeTensorsShapeDataTypeName(sparseStorageType SparseStorageType, inputTensorArray []ITensor, shape *foundation.Array, dataType mps.DataType, name string) Tensor + AbsoluteWithTensorName(tensor ITensor, name string) Tensor + ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName(source ITensor, weights ITensor, outputShape ITensor, descriptor IConvolution2DOpDescriptor, name string) Tensor + DivisionNoNaNWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + AcosWithTensorName(tensor ITensor, name string) Tensor + MaxPooling4DReturnIndicesWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) []Tensor + RandomTensorWithShapeTensorDescriptorName(shapeTensor ITensor, descriptor IRandomOpDescriptor, name string) Tensor + ConstantWithDataShapeDataType(data []byte, shape *foundation.Array, dataType mps.DataType) Tensor + RandomPhiloxStateTensorWithSeedName(seed uint, name string) Tensor + L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor + ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName(gradient ITensor, input ITensor, mode ResizeMode, centerResult bool, alignCorners bool, layout TensorNamedDataLayout, name string) Tensor + VariableWithDataShapeDataTypeName(data []byte, shape *foundation.Array, dataType mps.DataType, name string) Tensor + GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + GradientForPrimaryTensorWithTensorsName(primaryTensor ITensor, tensors []ITensor, name string) foundation.Dictionary + CeilWithTensorName(tensor ITensor, name string) Tensor + ReverseTensorName(tensor ITensor, name string) Tensor + ExponentBase2WithTensorName(tensor ITensor, name string) Tensor + MinimumWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + IsInfiniteWithTensorName(tensor ITensor, name string) Tensor + DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IDepthwiseConvolution3DOpDescriptor, name string) Tensor + TopKWithSourceTensorKTensorName(source ITensor, kTensor ITensor, name string) []Tensor + GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName(updatesTensor ITensor, indicesTensor ITensor, batchDimensions uint, name string) Tensor + RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor(feeds *foundation.Dictionary, targetTensors []ITensor, targetOperations []IOperation, executionDescriptor IExecutionDescriptor) *foundation.Dictionary + MultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + SinhWithTensorName(tensor ITensor, name string) Tensor + DropoutTensorRateName(tensor ITensor, rate float64, name string) Tensor + SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName(source ITensor, recurrentWeight ITensor, initState ITensor, descriptor ISingleGateRNNDescriptor, name string) []Tensor + MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + LogarithmBase2WithTensorName(tensor ITensor, name string) Tensor + PlaceholderWithShapeName(shape *foundation.Array, name string) Tensor + NegativeWithTensorName(tensor ITensor, name string) Tensor + ShapeOfTensorName(tensor ITensor, name string) Tensor + ExponentBase10WithTensorName(tensor ITensor, name string) Tensor + RunWithFeedsTargetTensorsTargetOperations(feeds *foundation.Dictionary, targetTensors []ITensor, targetOperations []IOperation) *foundation.Dictionary + MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName(dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, axis int, mode ScatterMode, name string) Tensor + GreaterThanWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + RoundWithTensorName(tensor ITensor, name string) Tensor + LogicalANDWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + ReductionMaximumWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor + SignWithTensorName(tensor ITensor, name string) Tensor + EqualWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + AsinhWithTensorName(tensor ITensor, name string) Tensor + DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IDepthwiseConvolution2DOpDescriptor, name string) Tensor + VarianceOfTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor + PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName(incomingGradientTensor ITensor, sourceTensor ITensor, paddingMode PaddingMode, leftPadding *foundation.Array, rightPadding *foundation.Array, name string) Tensor + NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName(tensor ITensor, mean ITensor, variance ITensor, gamma ITensor, beta ITensor, epsilon float64, name string) Tensor + DivisionWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName(source ITensor, recurrentWeight ITensor, sourceGradient ITensor, zState ITensor, initState ITensor, descriptor ISingleGateRNNDescriptor, name string) []Tensor + EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandBuffer mps.ICommandBuffer, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary, executionDescriptor IExecutionDescriptor) + CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor(device IDevice, feeds *foundation.Dictionary, targetTensors []ITensor, targetOperations []IOperation, compilationDescriptor ICompilationDescriptor) Executable + StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName(learningRateTensor ITensor, valuesTensor ITensor, gradientTensor ITensor, name string) Tensor + ReciprocalWithTensorName(tensor ITensor, name string) Tensor + SquareRootWithTensorName(tensor ITensor, name string) Tensor + NotWithTensorName(tensor ITensor, name string) Tensor + SinWithTensorName(tensor ITensor, name string) Tensor + NotEqualWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + SliceTensorStartsEndsStridesName(tensor ITensor, starts []foundation.INumber, ends []foundation.INumber, strides []foundation.INumber, name string) Tensor + PowerWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + LogicalNANDWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName(incomingGradientTensor ITensor, sourceTensor ITensor, axes []foundation.INumber, name string) Tensor + AcoshWithTensorName(tensor ITensor, name string) Tensor + StackTensorsAxisName(inputTensors []ITensor, axis int, name string) Tensor + SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName(gradientTensor ITensor, sourceTensor ITensor, labelsTensor ITensor, axis int, reductionType LossReductionType, name string) Tensor + ReductionArgMaximumWithTensorAxisName(tensor ITensor, axis int, name string) Tensor + ConcatTensorWithTensorDimensionName(tensor ITensor, tensor2 ITensor, dimensionIndex int, name string) Tensor + L2NormPooling4DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor + GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName(axisTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, name string) Tensor + ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName(axisTensor ITensor, dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, mode ScatterMode, name string) Tensor + TransposeTensorDimensionWithDimensionName(tensor ITensor, dimensionIndex uint, dimensionIndex2 uint, name string) Tensor + BroadcastTensorToShapeTensorName(tensor ITensor, shapeTensor ITensor, name string) Tensor + SoftMaxGradientWithIncomingGradientSourceTensorAxisName(gradient ITensor, source ITensor, axis int, name string) Tensor + ClampWithTensorMinValueTensorMaxValueTensorName(tensor ITensor, minValueTensor ITensor, maxValueTensor ITensor, name string) Tensor + MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor + ReductionSumWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor + ModuloWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor + RandomPhiloxStateTensorWithCounterLowCounterHighKeyName(counterLow uint, counterHigh uint, key uint, name string) Tensor + IdentityWithTensorName(tensor ITensor, name string) Tensor + WhileWithInitialInputsBeforeAfterName(initialInputs []ITensor, before WhileBeforeBlock, after WhileAfterBlock, name string) []Tensor + AtanWithTensorName(tensor ITensor, name string) Tensor + NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName(incomingGradientTensor ITensor, sourceTensor ITensor, meanTensor ITensor, varianceTensor ITensor, axes []foundation.INumber, epsilon float64, name string) Tensor + SoftMaxWithTensorAxisName(tensor ITensor, axis int, name string) Tensor + Options() Options + SetOptions(value Options) + PlaceholderTensors() []Tensor +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph?language=objc +type Graph struct { + objc.Object +} + +func GraphFrom(ptr unsafe.Pointer) Graph { + return Graph{ + Object: objc.ObjectFrom(ptr), + } +} + +func (gc _GraphClass) New() Graph { + rv := objc.Call[Graph](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGraph() Graph { + return GraphClass.New() +} + +func (g_ Graph) Init() Graph { + rv := objc.Call[Graph](g_, objc.Sel("init")) + return rv +} + +func (gc _GraphClass) Alloc() Graph { + rv := objc.Call[Graph](gc, objc.Sel("alloc")) + return rv +} + +func Graph_Alloc() Graph { + return GraphClass.Alloc() +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564708-maxpooling2dwithsourcetensor?language=objc +func (g_ Graph) MaxPooling2DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("maxPooling2DWithSourceTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750693-avgpooling4dwithsourcetensor?language=objc +func (g_ Graph) AvgPooling4DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("avgPooling4DWithSourceTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564559-lessthanorequaltowithprimarytens?language=objc +func (g_ Graph) LessThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("lessThanOrEqualToWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3667487-depthwiseconvolution2ddatagradie?language=objc +func (g_ Graph) DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient ITensor, weights ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("depthwiseConvolution2DDataGradientWithIncomingGradientTensor:weightsTensor:outputShape:descriptor:name:"), objc.Ptr(incomingGradient), objc.Ptr(weights), outputShape, objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3763057-sparsetensorwithdescriptor?language=objc +func (g_ Graph) SparseTensorWithDescriptorTensorsShapeName(sparseDescriptor ICreateSparseOpDescriptor, inputTensorArray []ITensor, shape *foundation.Array, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sparseTensorWithDescriptor:tensors:shape:name:"), objc.Ptr(sparseDescriptor), inputTensorArray, shape, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3925432-lstmwithsourcetensor?language=objc +func (g_ Graph) LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName(source ITensor, recurrentWeight ITensor, initState ITensor, initCell ITensor, descriptor ILSTMDescriptor, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("LSTMWithSourceTensor:recurrentWeight:initState:initCell:descriptor:name:"), objc.Ptr(source), objc.Ptr(recurrentWeight), objc.Ptr(initState), objc.Ptr(initCell), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867067-convolution2ddatagradientwithinc?language=objc +func (g_ Graph) Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient ITensor, weights ITensor, outputShapeTensor ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("convolution2DDataGradientWithIncomingGradientTensor:weightsTensor:outputShapeTensor:forwardConvolutionDescriptor:name:"), objc.Ptr(gradient), objc.Ptr(weights), objc.Ptr(outputShapeTensor), objc.Ptr(forwardConvolutionDescriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564622-runwithmtlcommandqueue?language=objc +func (g_ Graph) RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary(commandQueue metal.PCommandQueue, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary) { + po0 := objc.WrapAsProtocol("MTLCommandQueue", commandQueue) + objc.Call[objc.Void](g_, objc.Sel("runWithMTLCommandQueue:feeds:targetOperations:resultsDictionary:"), po0, feeds, targetOperations, resultsDictionary) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564622-runwithmtlcommandqueue?language=objc +func (g_ Graph) RunWithMTLCommandQueueObjectFeedsTargetOperationsResultsDictionary(commandQueueObject objc.IObject, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary) { + objc.Call[objc.Void](g_, objc.Sel("runWithMTLCommandQueue:feeds:targetOperations:resultsDictionary:"), objc.Ptr(commandQueueObject), feeds, targetOperations, resultsDictionary) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3925453-expanddimsoftensor?language=objc +func (g_ Graph) ExpandDimsOfTensorAxesTensorName(tensor ITensor, axesTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("expandDimsOfTensor:axesTensor:name:"), objc.Ptr(tensor), objc.Ptr(axesTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3919778-reductionandwithtensor?language=objc +func (g_ Graph) ReductionAndWithTensorAxisName(tensor ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionAndWithTensor:axis:name:"), objc.Ptr(tensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867072-resizetensor?language=objc +func (g_ Graph) ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName(imagesTensor ITensor, size ITensor, mode ResizeMode, centerResult bool, alignCorners bool, layout TensorNamedDataLayout, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("resizeTensor:sizeTensor:mode:centerResult:alignCorners:layout:name:"), objc.Ptr(imagesTensor), objc.Ptr(size), mode, centerResult, alignCorners, layout, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564591-tanwithtensor?language=objc +func (g_ Graph) TanWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("tanWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3675594-floormodulowithprimarytensor?language=objc +func (g_ Graph) FloorModuloWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("floorModuloWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867070-convolutiontranspose2dweightsgra?language=objc +func (g_ Graph) ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradientTensor ITensor, source ITensor, outputShape ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("convolutionTranspose2DWeightsGradientWithIncomingGradientTensor:sourceTensor:outputShapeTensor:forwardConvolutionDescriptor:name:"), objc.Ptr(incomingGradientTensor), objc.Ptr(source), objc.Ptr(outputShape), objc.Ptr(forwardConvolutionDescriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3925451-coordinatealongaxistensor?language=objc +func (g_ Graph) CoordinateAlongAxisTensorWithShapeTensorName(axisTensor ITensor, shapeTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("coordinateAlongAxisTensor:withShapeTensor:name:"), objc.Ptr(axisTensor), objc.Ptr(shapeTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3589368-reductionproductwithtensor?language=objc +func (g_ Graph) ReductionProductWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionProductWithTensor:axes:name:"), objc.Ptr(tensor), axes, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564686-assignvariable?language=objc +func (g_ Graph) AssignVariableWithValueOfTensorName(variable ITensor, tensor ITensor, name string) Operation { + rv := objc.Call[Operation](g_, objc.Sel("assignVariable:withValueOfTensor:name:"), objc.Ptr(variable), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901487-randomuniformtensorwithshapetens?language=objc +func (g_ Graph) RandomUniformTensorWithShapeTensorName(shapeTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("randomUniformTensorWithShapeTensor:name:"), objc.Ptr(shapeTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580502-padtensor?language=objc +func (g_ Graph) PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName(tensor ITensor, paddingMode PaddingMode, leftPadding *foundation.Array, rightPadding *foundation.Array, constantValue float64, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("padTensor:withPaddingMode:leftPadding:rightPadding:constantValue:name:"), objc.Ptr(tensor), paddingMode, leftPadding, rightPadding, constantValue, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3618936-applystochasticgradientdescentwi?language=objc +func (g_ Graph) ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName(learningRateTensor ITensor, variable IVariableOp, gradientTensor ITensor, name string) Operation { + rv := objc.Call[Operation](g_, objc.Sel("applyStochasticGradientDescentWithLearningRateTensor:variable:gradientTensor:name:"), objc.Ptr(learningRateTensor), objc.Ptr(variable), objc.Ptr(gradientTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564583-selectwithpredicatetensor?language=objc +func (g_ Graph) SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName(predicateTensor ITensor, truePredicateTensor ITensor, falseSelectTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("selectWithPredicateTensor:truePredicateTensor:falsePredicateTensor:name:"), objc.Ptr(predicateTensor), objc.Ptr(truePredicateTensor), objc.Ptr(falseSelectTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750680-depthwiseconvolution3dweightsgra?language=objc +func (g_ Graph) DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient ITensor, source ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution3DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("depthwiseConvolution3DWeightsGradientWithIncomingGradientTensor:sourceTensor:outputShape:descriptor:name:"), objc.Ptr(incomingGradient), objc.Ptr(source), outputShape, objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867065-leakyreluwithtensor?language=objc +func (g_ Graph) LeakyReLUWithTensorAlphaName(tensor ITensor, alpha float64, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("leakyReLUWithTensor:alpha:name:"), objc.Ptr(tensor), alpha, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564566-logicalnorwithprimarytensor?language=objc +func (g_ Graph) LogicalNORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logicalNORWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867073-scatterndwithdatatensor?language=objc +func (g_ Graph) ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName(dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, batchDimensions uint, mode ScatterMode, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("scatterNDWithDataTensor:updatesTensor:indicesTensor:batchDimensions:mode:name:"), objc.Ptr(dataTensor), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), batchDimensions, mode, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564589-squarewithtensor?language=objc +func (g_ Graph) SquareWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("squareWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3816770-forloopwithnumberofiterations?language=objc +func (g_ Graph) ForLoopWithNumberOfIterationsInitialBodyArgumentsBodyName(numberOfIterations ITensor, initialBodyArguments []ITensor, body ForLoopBodyBlock, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("forLoopWithNumberOfIterations:initialBodyArguments:body:name:"), objc.Ptr(numberOfIterations), initialBodyArguments, body, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564567-logicalorwithprimarytensor?language=objc +func (g_ Graph) LogicalORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logicalORWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3919780-reductionorwithtensor?language=objc +func (g_ Graph) ReductionOrWithTensorAxisName(tensor ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionOrWithTensor:axis:name:"), objc.Ptr(tensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750709-depthtospace2dtensor?language=objc +func (g_ Graph) DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor ITensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("depthToSpace2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:"), objc.Ptr(tensor), widthAxis, heightAxis, depthAxis, blockSize, usePixelShuffleOrder, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750694-maxpooling4dgradientwithgradient?language=objc +func (g_ Graph) MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("maxPooling4DGradientWithGradientTensor:sourceTensor:descriptor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656156-asinwithtensor?language=objc +func (g_ Graph) AsinWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("asinWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564471-sigmoidwithtensor?language=objc +func (g_ Graph) SigmoidWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sigmoidWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3618939-tilegradientwithincominggradient?language=objc +func (g_ Graph) TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName(incomingGradientTensor ITensor, sourceTensor ITensor, multiplier *foundation.Array, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("tileGradientWithIncomingGradientTensor:sourceTensor:withMultiplier:name:"), objc.Ptr(incomingGradientTensor), objc.Ptr(sourceTensor), multiplier, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867075-scatterwithupdatestensor?language=objc +func (g_ Graph) ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName(updatesTensor ITensor, indicesTensor ITensor, shape *foundation.Array, axis int, mode ScatterMode, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("scatterWithUpdatesTensor:indicesTensor:shape:axis:mode:name:"), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), shape, axis, mode, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564548-erfwithtensor?language=objc +func (g_ Graph) ErfWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("erfWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564592-tanhwithtensor?language=objc +func (g_ Graph) TanhWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("tanhWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3925427-bandpartwithtensor?language=objc +func (g_ Graph) BandPartWithTensorNumLowerTensorNumUpperTensorName(inputTensor ITensor, numLowerTensor ITensor, numUpperTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("bandPartWithTensor:numLowerTensor:numUpperTensor:name:"), objc.Ptr(inputTensor), objc.Ptr(numLowerTensor), objc.Ptr(numUpperTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3667488-depthwiseconvolution2dweightsgra?language=objc +func (g_ Graph) DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient ITensor, source ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("depthwiseConvolution2DWeightsGradientWithIncomingGradientTensor:sourceTensor:outputShape:descriptor:name:"), objc.Ptr(incomingGradient), objc.Ptr(source), outputShape, objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656161-softmaxcrossentropywithsourceten?language=objc +func (g_ Graph) SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName(sourceTensor ITensor, labelsTensor ITensor, axis int, reductionType LossReductionType, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("softMaxCrossEntropyWithSourceTensor:labelsTensor:axis:reductionType:name:"), objc.Ptr(sourceTensor), objc.Ptr(labelsTensor), axis, reductionType, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564585-signbitwithtensor?language=objc +func (g_ Graph) SignbitWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("signbitWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3787605-stencilwithsourcetensor?language=objc +func (g_ Graph) StencilWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IStencilOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("stencilWithSourceTensor:weightsTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(weights), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750692-avgpooling4dgradientwithgradient?language=objc +func (g_ Graph) AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("avgPooling4DGradientWithGradientTensor:sourceTensor:descriptor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867068-convolution2dweightsgradientwith?language=objc +func (g_ Graph) Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient ITensor, source ITensor, outputShapeTensor ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("convolution2DWeightsGradientWithIncomingGradientTensor:sourceTensor:outputShapeTensor:forwardConvolutionDescriptor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(outputShapeTensor), objc.Ptr(forwardConvolutionDescriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901478-randomtensorwithshape?language=objc +func (g_ Graph) RandomTensorWithShapeDescriptorName(shape *foundation.Array, descriptor IRandomOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("randomTensorWithShape:descriptor:name:"), shape, objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656160-atanhwithtensor?language=objc +func (g_ Graph) AtanhWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("atanhWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750707-reductionargminimumwithtensor?language=objc +func (g_ Graph) ReductionArgMinimumWithTensorAxisName(tensor ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionArgMinimumWithTensor:axis:name:"), objc.Ptr(tensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867069-convolutiontranspose2ddatagradie?language=objc +func (g_ Graph) ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradient ITensor, weights ITensor, outputShape ITensor, forwardConvolutionDescriptor IConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("convolutionTranspose2DDataGradientWithIncomingGradientTensor:weightsTensor:outputShapeTensor:forwardConvolutionDescriptor:name:"), objc.Ptr(incomingGradient), objc.Ptr(weights), objc.Ptr(outputShape), objc.Ptr(forwardConvolutionDescriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564558-isnanwithtensor?language=objc +func (g_ Graph) IsNaNWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("isNaNWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564571-maximumwithprimarytensor?language=objc +func (g_ Graph) MaximumWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("maximumWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3919742-maxpooling2dreturnindiceswithsou?language=objc +func (g_ Graph) MaxPooling2DReturnIndicesWithSourceTensorDescriptorName(source ITensor, descriptor IPooling2DOpDescriptor, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("maxPooling2DReturnIndicesWithSourceTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750669-ifwithpredicatetensor?language=objc +func (g_ Graph) IfWithPredicateTensorThenBlockElseBlockName(predicateTensor ITensor, thenBlock IfThenElseBlock, elseBlock IfThenElseBlock, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("ifWithPredicateTensor:thenBlock:elseBlock:name:"), objc.Ptr(predicateTensor), thenBlock, elseBlock, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564560-lessthanwithprimarytensor?language=objc +func (g_ Graph) LessThanWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("lessThanWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3928155-scatteralongaxis?language=objc +func (g_ Graph) ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName(axis int, dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, mode ScatterMode, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("scatterAlongAxis:withDataTensor:updatesTensor:indicesTensor:mode:name:"), axis, objc.Ptr(dataTensor), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), mode, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564561-logarithmbase10withtensor?language=objc +func (g_ Graph) LogarithmBase10WithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logarithmBase10WithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750716-spacetodepth2dtensor?language=objc +func (g_ Graph) SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor ITensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("spaceToDepth2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:"), objc.Ptr(tensor), widthAxis, heightAxis, depthAxis, blockSize, usePixelShuffleOrder, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564541-additionwithprimarytensor?language=objc +func (g_ Graph) AdditionWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("additionWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564735-tiletensor?language=objc +func (g_ Graph) TileTensorWithMultiplierName(tensor ITensor, multiplier *foundation.Array, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("tileTensor:withMultiplier:name:"), objc.Ptr(tensor), multiplier, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564551-exponentwithtensor?language=objc +func (g_ Graph) ExponentWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("exponentWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867078-casttensor?language=objc +func (g_ Graph) CastTensorToTypeName(tensor ITensor, type_ mps.DataType, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("castTensor:toType:name:"), objc.Ptr(tensor), type_, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656162-meanoftensor?language=objc +func (g_ Graph) MeanOfTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("meanOfTensor:axes:name:"), objc.Ptr(tensor), axes, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564580-reversesquarerootwithtensor?language=objc +func (g_ Graph) ReverseSquareRootWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reverseSquareRootWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3728124-scatterndwithupdatestensor?language=objc +func (g_ Graph) ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName(updatesTensor ITensor, indicesTensor ITensor, shape *foundation.Array, batchDimensions uint, mode ScatterMode, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("scatterNDWithUpdatesTensor:indicesTensor:shape:batchDimensions:mode:name:"), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), shape, batchDimensions, mode, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3925449-coordinatealongaxis?language=objc +func (g_ Graph) CoordinateAlongAxisWithShapeTensorName(axis int, shapeTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("coordinateAlongAxis:withShapeTensor:name:"), axis, objc.Ptr(shapeTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3928153-gatheralongaxis?language=objc +func (g_ Graph) GatherAlongAxisWithUpdatesTensorIndicesTensorName(axis int, updatesTensor ITensor, indicesTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("gatherAlongAxis:withUpdatesTensor:indicesTensor:name:"), axis, objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564569-logicalxorwithprimarytensor?language=objc +func (g_ Graph) LogicalXORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logicalXORWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564552-floorwithtensor?language=objc +func (g_ Graph) FloorWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("floorWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750679-depthwiseconvolution3ddatagradie?language=objc +func (g_ Graph) DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient ITensor, weights ITensor, outputShape *foundation.Array, descriptor IDepthwiseConvolution3DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("depthwiseConvolution3DDataGradientWithIncomingGradientTensor:weightsTensor:outputShape:descriptor:name:"), objc.Ptr(incomingGradient), objc.Ptr(weights), outputShape, objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3925428-lstmgradientswithsourcetensor?language=objc +func (g_ Graph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName(source ITensor, recurrentWeight ITensor, sourceGradient ITensor, zState ITensor, cellOutputFwd ITensor, descriptor ILSTMDescriptor, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("LSTMGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:cellOutputFwd:descriptor:name:"), objc.Ptr(source), objc.Ptr(recurrentWeight), objc.Ptr(sourceGradient), objc.Ptr(zState), objc.Ptr(cellOutputFwd), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3923675-splittensor?language=objc +func (g_ Graph) SplitTensorSplitSizesTensorAxisName(tensor ITensor, splitSizesTensor ITensor, axis int, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("splitTensor:splitSizesTensor:axis:name:"), objc.Ptr(tensor), objc.Ptr(splitSizesTensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867082-topkwithgradienttensor?language=objc +func (g_ Graph) TopKWithGradientTensorSourceKTensorName(gradient ITensor, source ITensor, kTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("topKWithGradientTensor:source:kTensor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(kTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564556-isfinitewithtensor?language=objc +func (g_ Graph) IsFiniteWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("isFiniteWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564590-subtractionwithprimarytensor?language=objc +func (g_ Graph) SubtractionWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("subtractionWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564690-readvariable?language=objc +func (g_ Graph) ReadVariableName(variable ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("readVariable:name:"), objc.Ptr(variable), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867064-leakyrelugradientwithincominggra?language=objc +func (g_ Graph) LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName(gradient ITensor, source ITensor, alphaTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("leakyReLUGradientWithIncomingGradient:sourceTensor:alphaTensor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(alphaTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3925458-squeezetensor?language=objc +func (g_ Graph) SqueezeTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("squeezeTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3618935-normalizationgradientwithincomin?language=objc +func (g_ Graph) NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName(incomingGradientTensor ITensor, sourceTensor ITensor, meanTensor ITensor, varianceTensor ITensor, gamma ITensor, gammaGradient ITensor, betaGradient ITensor, axes []foundation.INumber, epsilon float64, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("normalizationGradientWithIncomingGradientTensor:sourceTensor:meanTensor:varianceTensor:gammaTensor:gammaGradientTensor:betaGradientTensor:reductionAxes:epsilon:name:"), objc.Ptr(incomingGradientTensor), objc.Ptr(sourceTensor), objc.Ptr(meanTensor), objc.Ptr(varianceTensor), objc.Ptr(gamma), objc.Ptr(gammaGradient), objc.Ptr(betaGradient), axes, epsilon, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564596-convolution2dwithsourcetensor?language=objc +func (g_ Graph) Convolution2DWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("convolution2DWithSourceTensor:weightsTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(weights), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564468-relugradientwithincominggradient?language=objc +func (g_ Graph) ReLUGradientWithIncomingGradientSourceTensorName(gradient ITensor, source ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reLUGradientWithIncomingGradient:sourceTensor:name:"), objc.Ptr(gradient), objc.Ptr(source), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750712-flatten2dtensor?language=objc +func (g_ Graph) Flatten2DTensorAxisTensorName(tensor ITensor, axisTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("flatten2DTensor:axisTensor:name:"), objc.Ptr(tensor), objc.Ptr(axisTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580486-onehotwithindicestensor?language=objc +func (g_ Graph) OneHotWithIndicesTensorDepthName(indicesTensor ITensor, depth uint, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("oneHotWithIndicesTensor:depth:name:"), objc.Ptr(indicesTensor), depth, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750708-concattensors?language=objc +func (g_ Graph) ConcatTensorsDimensionInterleaveName(tensors []ITensor, dimensionIndex int, interleave bool, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("concatTensors:dimension:interleave:name:"), tensors, dimensionIndex, interleave, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3589367-reductionminimumwithtensor?language=objc +func (g_ Graph) ReductionMinimumWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionMinimumWithTensor:axes:name:"), objc.Ptr(tensor), axes, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901509-reductionmaximumpropagatenanwith?language=objc +func (g_ Graph) ReductionMaximumPropagateNaNWithTensorAxisName(tensor ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionMaximumPropagateNaNWithTensor:axis:name:"), objc.Ptr(tensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564581-rintwithtensor?language=objc +func (g_ Graph) RintWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("rintWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656158-atan2withprimarytensor?language=objc +func (g_ Graph) Atan2WithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("atan2WithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564544-coswithtensor?language=objc +func (g_ Graph) CosWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("cosWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750695-maxpooling4dwithsourcetensor?language=objc +func (g_ Graph) MaxPooling4DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("maxPooling4DWithSourceTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564619-runasyncwithmtlcommandqueue?language=objc +func (g_ Graph) RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandQueue metal.PCommandQueue, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary, executionDescriptor IExecutionDescriptor) { + po0 := objc.WrapAsProtocol("MTLCommandQueue", commandQueue) + objc.Call[objc.Void](g_, objc.Sel("runAsyncWithMTLCommandQueue:feeds:targetOperations:resultsDictionary:executionDescriptor:"), po0, feeds, targetOperations, resultsDictionary, objc.Ptr(executionDescriptor)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564619-runasyncwithmtlcommandqueue?language=objc +func (g_ Graph) RunAsyncWithMTLCommandQueueObjectFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandQueueObject objc.IObject, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary, executionDescriptor IExecutionDescriptor) { + objc.Call[objc.Void](g_, objc.Sel("runAsyncWithMTLCommandQueue:feeds:targetOperations:resultsDictionary:executionDescriptor:"), objc.Ptr(commandQueueObject), feeds, targetOperations, resultsDictionary, objc.Ptr(executionDescriptor)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3816769-forloopwithlowerbound?language=objc +func (g_ Graph) ForLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName(lowerBound ITensor, upperBound ITensor, step ITensor, initialBodyArguments []ITensor, body ForLoopBodyBlock, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("forLoopWithLowerBound:upperBound:step:initialBodyArguments:body:name:"), objc.Ptr(lowerBound), objc.Ptr(upperBound), objc.Ptr(step), initialBodyArguments, body, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564469-reluwithtensor?language=objc +func (g_ Graph) ReLUWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reLUWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564470-sigmoidgradientwithincominggradi?language=objc +func (g_ Graph) SigmoidGradientWithIncomingGradientSourceTensorName(gradient ITensor, source ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sigmoidGradientWithIncomingGradient:sourceTensor:name:"), objc.Ptr(gradient), objc.Ptr(source), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3728133-slicegradienttensor?language=objc +func (g_ Graph) SliceGradientTensorFwdInShapeTensorStartsEndsStridesName(inputGradientTensor ITensor, fwdInShapeTensor ITensor, starts []foundation.INumber, ends []foundation.INumber, strides []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sliceGradientTensor:fwdInShapeTensor:starts:ends:strides:name:"), objc.Ptr(inputGradientTensor), objc.Ptr(fwdInShapeTensor), starts, ends, strides, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564706-avgpooling2dwithsourcetensor?language=objc +func (g_ Graph) AvgPooling2DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("avgPooling2DWithSourceTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3686986-constantwithscalar?language=objc +func (g_ Graph) ConstantWithScalarDataType(scalar float64, dataType mps.DataType) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("constantWithScalar:dataType:"), scalar, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867079-reshapetensor?language=objc +func (g_ Graph) ReshapeTensorWithShapeTensorName(tensor ITensor, shapeTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reshapeTensor:withShapeTensor:name:"), objc.Ptr(tensor), objc.Ptr(shapeTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564684-matrixmultiplicationwithprimaryt?language=objc +func (g_ Graph) MatrixMultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("matrixMultiplicationWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750667-controldependencywithoperations?language=objc +func (g_ Graph) ControlDependencyWithOperationsDependentBlockName(operations []IOperation, dependentBlock ControlFlowDependencyBlock, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("controlDependencyWithOperations:dependentBlock:name:"), operations, dependentBlock, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564568-logicalxnorwithprimarytensor?language=objc +func (g_ Graph) LogicalXNORWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logicalXNORWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3589364-gatherwithupdatestensor?language=objc +func (g_ Graph) GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName(updatesTensor ITensor, indicesTensor ITensor, axis uint, batchDimensions uint, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("gatherWithUpdatesTensor:indicesTensor:axis:batchDimensions:name:"), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), axis, batchDimensions, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564545-coshwithtensor?language=objc +func (g_ Graph) CoshWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("coshWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564705-avgpooling2dgradientwithgradient?language=objc +func (g_ Graph) AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("avgPooling2DGradientWithGradientTensor:sourceTensor:descriptor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901511-reductionminimumpropagatenanwith?language=objc +func (g_ Graph) ReductionMinimumPropagateNaNWithTensorAxisName(tensor ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionMinimumPropagateNaNWithTensor:axis:name:"), objc.Ptr(tensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901484-randomuniformtensorwithshape?language=objc +func (g_ Graph) RandomUniformTensorWithShapeName(shape *foundation.Array, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("randomUniformTensorWithShape:name:"), shape, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564563-logarithmwithtensor?language=objc +func (g_ Graph) LogarithmWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logarithmWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3763058-sparsetensorwithtype?language=objc +func (g_ Graph) SparseTensorWithTypeTensorsShapeDataTypeName(sparseStorageType SparseStorageType, inputTensorArray []ITensor, shape *foundation.Array, dataType mps.DataType, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sparseTensorWithType:tensors:shape:dataType:name:"), sparseStorageType, inputTensorArray, shape, dataType, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564540-absolutewithtensor?language=objc +func (g_ Graph) AbsoluteWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("absoluteWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867071-convolutiontranspose2dwithsource?language=objc +func (g_ Graph) ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName(source ITensor, weights ITensor, outputShape ITensor, descriptor IConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("convolutionTranspose2DWithSourceTensor:weightsTensor:outputShapeTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(weights), objc.Ptr(outputShape), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3675593-divisionnonanwithprimarytensor?language=objc +func (g_ Graph) DivisionNoNaNWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("divisionNoNaNWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656154-acoswithtensor?language=objc +func (g_ Graph) AcosWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("acosWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3919743-maxpooling4dreturnindiceswithsou?language=objc +func (g_ Graph) MaxPooling4DReturnIndicesWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("maxPooling4DReturnIndicesWithSourceTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901481-randomtensorwithshapetensor?language=objc +func (g_ Graph) RandomTensorWithShapeTensorDescriptorName(shapeTensor ITensor, descriptor IRandomOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("randomTensorWithShapeTensor:descriptor:name:"), objc.Ptr(shapeTensor), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564687-constantwithdata?language=objc +func (g_ Graph) ConstantWithDataShapeDataType(data []byte, shape *foundation.Array, dataType mps.DataType) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("constantWithData:shape:dataType:"), data, shape, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901477-randomphiloxstatetensorwithseed?language=objc +func (g_ Graph) RandomPhiloxStateTensorWithSeedName(seed uint, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("randomPhiloxStateTensorWithSeed:name:"), seed, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750690-l2normpooling4dgradientwithgradi?language=objc +func (g_ Graph) L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("L2NormPooling4DGradientWithGradientTensor:sourceTensor:descriptor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3667506-resizewithgradienttensor?language=objc +func (g_ Graph) ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName(gradient ITensor, input ITensor, mode ResizeMode, centerResult bool, alignCorners bool, layout TensorNamedDataLayout, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("resizeWithGradientTensor:input:mode:centerResult:alignCorners:layout:name:"), objc.Ptr(gradient), objc.Ptr(input), mode, centerResult, alignCorners, layout, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564691-variablewithdata?language=objc +func (g_ Graph) VariableWithDataShapeDataTypeName(data []byte, shape *foundation.Array, dataType mps.DataType, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("variableWithData:shape:dataType:name:"), data, shape, dataType, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564553-greaterthanorequaltowithprimaryt?language=objc +func (g_ Graph) GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("greaterThanOrEqualToWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580451-gradientforprimarytensor?language=objc +func (g_ Graph) GradientForPrimaryTensorWithTensorsName(primaryTensor ITensor, tensors []ITensor, name string) foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](g_, objc.Sel("gradientForPrimaryTensor:withTensors:name:"), objc.Ptr(primaryTensor), tensors, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564542-ceilwithtensor?language=objc +func (g_ Graph) CeilWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("ceilWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750715-reversetensor?language=objc +func (g_ Graph) ReverseTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reverseTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564550-exponentbase2withtensor?language=objc +func (g_ Graph) ExponentBase2WithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("exponentBase2WithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564572-minimumwithprimarytensor?language=objc +func (g_ Graph) MinimumWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("minimumWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564557-isinfinitewithtensor?language=objc +func (g_ Graph) IsInfiniteWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("isInfiniteWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750681-depthwiseconvolution3dwithsource?language=objc +func (g_ Graph) DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IDepthwiseConvolution3DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("depthwiseConvolution3DWithSourceTensor:weightsTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(weights), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867084-topkwithsourcetensor?language=objc +func (g_ Graph) TopKWithSourceTensorKTensorName(source ITensor, kTensor ITensor, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("topKWithSourceTensor:kTensor:name:"), objc.Ptr(source), objc.Ptr(kTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3589362-gatherndwithupdatestensor?language=objc +func (g_ Graph) GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName(updatesTensor ITensor, indicesTensor ITensor, batchDimensions uint, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("gatherNDWithUpdatesTensor:indicesTensor:batchDimensions:name:"), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), batchDimensions, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564618-runasyncwithfeeds?language=objc +func (g_ Graph) RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor(feeds *foundation.Dictionary, targetTensors []ITensor, targetOperations []IOperation, executionDescriptor IExecutionDescriptor) *foundation.Dictionary { + rv := objc.Call[*foundation.Dictionary](g_, objc.Sel("runAsyncWithFeeds:targetTensors:targetOperations:executionDescriptor:"), feeds, targetTensors, targetOperations, objc.Ptr(executionDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564574-multiplicationwithprimarytensor?language=objc +func (g_ Graph) MultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("multiplicationWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564587-sinhwithtensor?language=objc +func (g_ Graph) SinhWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sinhWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3626198-dropouttensor?language=objc +func (g_ Graph) DropoutTensorRateName(tensor ITensor, rate float64, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("dropoutTensor:rate:name:"), objc.Ptr(tensor), rate, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3919762-singlegaternnwithsourcetensor?language=objc +func (g_ Graph) SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName(source ITensor, recurrentWeight ITensor, initState ITensor, descriptor ISingleGateRNNDescriptor, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("singleGateRNNWithSourceTensor:recurrentWeight:initState:descriptor:name:"), objc.Ptr(source), objc.Ptr(recurrentWeight), objc.Ptr(initState), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3857574-minimumwithnanpropagationwithpri?language=objc +func (g_ Graph) MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("minimumWithNaNPropagationWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564562-logarithmbase2withtensor?language=objc +func (g_ Graph) LogarithmBase2WithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logarithmBase2WithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564689-placeholderwithshape?language=objc +func (g_ Graph) PlaceholderWithShapeName(shape *foundation.Array, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("placeholderWithShape:name:"), shape, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564575-negativewithtensor?language=objc +func (g_ Graph) NegativeWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("negativeWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867080-shapeoftensor?language=objc +func (g_ Graph) ShapeOfTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("shapeOfTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564549-exponentbase10withtensor?language=objc +func (g_ Graph) ExponentBase10WithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("exponentBase10WithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564621-runwithfeeds?language=objc +func (g_ Graph) RunWithFeedsTargetTensorsTargetOperations(feeds *foundation.Dictionary, targetTensors []ITensor, targetOperations []IOperation) *foundation.Dictionary { + rv := objc.Call[*foundation.Dictionary](g_, objc.Sel("runWithFeeds:targetTensors:targetOperations:"), feeds, targetTensors, targetOperations) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3857573-maximumwithnanpropagationwithpri?language=objc +func (g_ Graph) MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("maximumWithNaNPropagationWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867074-scatterwithdatatensor?language=objc +func (g_ Graph) ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName(dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, axis int, mode ScatterMode, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("scatterWithDataTensor:updatesTensor:indicesTensor:axis:mode:name:"), objc.Ptr(dataTensor), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), axis, mode, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564554-greaterthanwithprimarytensor?language=objc +func (g_ Graph) GreaterThanWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("greaterThanWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564582-roundwithtensor?language=objc +func (g_ Graph) RoundWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("roundWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564564-logicalandwithprimarytensor?language=objc +func (g_ Graph) LogicalANDWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logicalANDWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3589366-reductionmaximumwithtensor?language=objc +func (g_ Graph) ReductionMaximumWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionMaximumWithTensor:axes:name:"), objc.Ptr(tensor), axes, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564584-signwithtensor?language=objc +func (g_ Graph) SignWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("signWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564547-equalwithprimarytensor?language=objc +func (g_ Graph) EqualWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("equalWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656157-asinhwithtensor?language=objc +func (g_ Graph) AsinhWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("asinhWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3667489-depthwiseconvolution2dwithsource?language=objc +func (g_ Graph) DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName(source ITensor, weights ITensor, descriptor IDepthwiseConvolution2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("depthwiseConvolution2DWithSourceTensor:weightsTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(weights), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656163-varianceoftensor?language=objc +func (g_ Graph) VarianceOfTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("varianceOfTensor:axes:name:"), objc.Ptr(tensor), axes, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3618938-padgradientwithincominggradientt?language=objc +func (g_ Graph) PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName(incomingGradientTensor ITensor, sourceTensor ITensor, paddingMode PaddingMode, leftPadding *foundation.Array, rightPadding *foundation.Array, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("padGradientWithIncomingGradientTensor:sourceTensor:paddingMode:leftPadding:rightPadding:name:"), objc.Ptr(incomingGradientTensor), objc.Ptr(sourceTensor), paddingMode, leftPadding, rightPadding, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564699-normalizationwithtensor?language=objc +func (g_ Graph) NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName(tensor ITensor, mean ITensor, variance ITensor, gamma ITensor, beta ITensor, epsilon float64, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("normalizationWithTensor:meanTensor:varianceTensor:gammaTensor:betaTensor:epsilon:name:"), objc.Ptr(tensor), objc.Ptr(mean), objc.Ptr(variance), objc.Ptr(gamma), objc.Ptr(beta), epsilon, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564546-divisionwithprimarytensor?language=objc +func (g_ Graph) DivisionWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("divisionWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3919758-singlegaternngradientswithsource?language=objc +func (g_ Graph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName(source ITensor, recurrentWeight ITensor, sourceGradient ITensor, zState ITensor, initState ITensor, descriptor ISingleGateRNNDescriptor, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("singleGateRNNGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:initState:descriptor:name:"), objc.Ptr(source), objc.Ptr(recurrentWeight), objc.Ptr(sourceGradient), objc.Ptr(zState), objc.Ptr(initState), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580383-encodetocommandbuffer?language=objc +func (g_ Graph) EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandBuffer mps.ICommandBuffer, feeds *foundation.Dictionary, targetOperations []IOperation, resultsDictionary *foundation.Dictionary, executionDescriptor IExecutionDescriptor) { + objc.Call[objc.Void](g_, objc.Sel("encodeToCommandBuffer:feeds:targetOperations:resultsDictionary:executionDescriptor:"), objc.Ptr(commandBuffer), feeds, targetOperations, resultsDictionary, objc.Ptr(executionDescriptor)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3787575-compilewithdevice?language=objc +func (g_ Graph) CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor(device IDevice, feeds *foundation.Dictionary, targetTensors []ITensor, targetOperations []IOperation, compilationDescriptor ICompilationDescriptor) Executable { + rv := objc.Call[Executable](g_, objc.Sel("compileWithDevice:feeds:targetTensors:targetOperations:compilationDescriptor:"), objc.Ptr(device), feeds, targetTensors, targetOperations, objc.Ptr(compilationDescriptor)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3618937-stochasticgradientdescentwithlea?language=objc +func (g_ Graph) StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName(learningRateTensor ITensor, valuesTensor ITensor, gradientTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("stochasticGradientDescentWithLearningRateTensor:valuesTensor:gradientTensor:name:"), objc.Ptr(learningRateTensor), objc.Ptr(valuesTensor), objc.Ptr(gradientTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564579-reciprocalwithtensor?language=objc +func (g_ Graph) ReciprocalWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reciprocalWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564588-squarerootwithtensor?language=objc +func (g_ Graph) SquareRootWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("squareRootWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564577-notwithtensor?language=objc +func (g_ Graph) NotWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("notWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564586-sinwithtensor?language=objc +func (g_ Graph) SinWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sinWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564576-notequalwithprimarytensor?language=objc +func (g_ Graph) NotEqualWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("notEqualWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3728135-slicetensor?language=objc +func (g_ Graph) SliceTensorStartsEndsStridesName(tensor ITensor, starts []foundation.INumber, ends []foundation.INumber, strides []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("sliceTensor:starts:ends:strides:name:"), objc.Ptr(tensor), starts, ends, strides, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564578-powerwithprimarytensor?language=objc +func (g_ Graph) PowerWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("powerWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564565-logicalnandwithprimarytensor?language=objc +func (g_ Graph) LogicalNANDWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("logicalNANDWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3618933-normalizationbetagradientwithinc?language=objc +func (g_ Graph) NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName(incomingGradientTensor ITensor, sourceTensor ITensor, axes []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("normalizationBetaGradientWithIncomingGradientTensor:sourceTensor:reductionAxes:name:"), objc.Ptr(incomingGradientTensor), objc.Ptr(sourceTensor), axes, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656155-acoshwithtensor?language=objc +func (g_ Graph) AcoshWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("acoshWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3923676-stacktensors?language=objc +func (g_ Graph) StackTensorsAxisName(inputTensors []ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("stackTensors:axis:name:"), inputTensors, axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580468-softmaxcrossentropygradientwithi?language=objc +func (g_ Graph) SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName(gradientTensor ITensor, sourceTensor ITensor, labelsTensor ITensor, axis int, reductionType LossReductionType, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("softMaxCrossEntropyGradientWithIncomingGradientTensor:sourceTensor:labelsTensor:axis:reductionType:name:"), objc.Ptr(gradientTensor), objc.Ptr(sourceTensor), objc.Ptr(labelsTensor), axis, reductionType, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750706-reductionargmaximumwithtensor?language=objc +func (g_ Graph) ReductionArgMaximumWithTensorAxisName(tensor ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionArgMaximumWithTensor:axis:name:"), objc.Ptr(tensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564731-concattensor?language=objc +func (g_ Graph) ConcatTensorWithTensorDimensionName(tensor ITensor, tensor2 ITensor, dimensionIndex int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("concatTensor:withTensor:dimension:name:"), objc.Ptr(tensor), objc.Ptr(tensor2), dimensionIndex, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750691-l2normpooling4dwithsourcetensor?language=objc +func (g_ Graph) L2NormPooling4DWithSourceTensorDescriptorName(source ITensor, descriptor IPooling4DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("L2NormPooling4DWithSourceTensor:descriptor:name:"), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3928154-gatheralongaxistensor?language=objc +func (g_ Graph) GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName(axisTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("gatherAlongAxisTensor:withUpdatesTensor:indicesTensor:name:"), objc.Ptr(axisTensor), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3928157-scatteralongaxistensor?language=objc +func (g_ Graph) ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName(axisTensor ITensor, dataTensor ITensor, updatesTensor ITensor, indicesTensor ITensor, mode ScatterMode, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("scatterAlongAxisTensor:withDataTensor:updatesTensor:indicesTensor:mode:name:"), objc.Ptr(axisTensor), objc.Ptr(dataTensor), objc.Ptr(updatesTensor), objc.Ptr(indicesTensor), mode, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564736-transposetensor?language=objc +func (g_ Graph) TransposeTensorDimensionWithDimensionName(tensor ITensor, dimensionIndex uint, dimensionIndex2 uint, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("transposeTensor:dimension:withDimension:name:"), objc.Ptr(tensor), dimensionIndex, dimensionIndex2, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3867077-broadcasttensor?language=objc +func (g_ Graph) BroadcastTensorToShapeTensorName(tensor ITensor, shapeTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("broadcastTensor:toShapeTensor:name:"), objc.Ptr(tensor), objc.Ptr(shapeTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580386-softmaxgradientwithincominggradi?language=objc +func (g_ Graph) SoftMaxGradientWithIncomingGradientSourceTensorAxisName(gradient ITensor, source ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("softMaxGradientWithIncomingGradient:sourceTensor:axis:name:"), objc.Ptr(gradient), objc.Ptr(source), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564543-clampwithtensor?language=objc +func (g_ Graph) ClampWithTensorMinValueTensorMaxValueTensorName(tensor ITensor, minValueTensor ITensor, maxValueTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("clampWithTensor:minValueTensor:maxValueTensor:name:"), objc.Ptr(tensor), objc.Ptr(minValueTensor), objc.Ptr(maxValueTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564707-maxpooling2dgradientwithgradient?language=objc +func (g_ Graph) MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient ITensor, source ITensor, descriptor IPooling2DOpDescriptor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("maxPooling2DGradientWithGradientTensor:sourceTensor:descriptor:name:"), objc.Ptr(gradient), objc.Ptr(source), objc.Ptr(descriptor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580494-reductionsumwithtensor?language=objc +func (g_ Graph) ReductionSumWithTensorAxesName(tensor ITensor, axes []foundation.INumber, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("reductionSumWithTensor:axes:name:"), objc.Ptr(tensor), axes, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564573-modulowithprimarytensor?language=objc +func (g_ Graph) ModuloWithPrimaryTensorSecondaryTensorName(primaryTensor ITensor, secondaryTensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("moduloWithPrimaryTensor:secondaryTensor:name:"), objc.Ptr(primaryTensor), objc.Ptr(secondaryTensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3901476-randomphiloxstatetensorwithcount?language=objc +func (g_ Graph) RandomPhiloxStateTensorWithCounterLowCounterHighKeyName(counterLow uint, counterHigh uint, key uint, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("randomPhiloxStateTensorWithCounterLow:counterHigh:key:name:"), counterLow, counterHigh, key, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564555-identitywithtensor?language=objc +func (g_ Graph) IdentityWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("identityWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3750670-whilewithinitialinputs?language=objc +func (g_ Graph) WhileWithInitialInputsBeforeAfterName(initialInputs []ITensor, before WhileBeforeBlock, after WhileAfterBlock, name string) []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("whileWithInitialInputs:before:after:name:"), initialInputs, before, after, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3656159-atanwithtensor?language=objc +func (g_ Graph) AtanWithTensorName(tensor ITensor, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("atanWithTensor:name:"), objc.Ptr(tensor), name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3618934-normalizationgammagradientwithin?language=objc +func (g_ Graph) NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName(incomingGradientTensor ITensor, sourceTensor ITensor, meanTensor ITensor, varianceTensor ITensor, axes []foundation.INumber, epsilon float64, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("normalizationGammaGradientWithIncomingGradientTensor:sourceTensor:meanTensor:varianceTensor:reductionAxes:epsilon:name:"), objc.Ptr(incomingGradientTensor), objc.Ptr(sourceTensor), objc.Ptr(meanTensor), objc.Ptr(varianceTensor), axes, epsilon, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3580387-softmaxwithtensor?language=objc +func (g_ Graph) SoftMaxWithTensorAxisName(tensor ITensor, axis int, name string) Tensor { + rv := objc.Call[Tensor](g_, objc.Sel("softMaxWithTensor:axis:name:"), objc.Ptr(tensor), axis, name) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564616-options?language=objc +func (g_ Graph) Options() Options { + rv := objc.Call[Options](g_, objc.Sel("options")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564616-options?language=objc +func (g_ Graph) SetOptions(value Options) { + objc.Call[objc.Void](g_, objc.Sel("setOptions:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraph/3564617-placeholdertensors?language=objc +func (g_ Graph) PlaceholderTensors() []Tensor { + rv := objc.Call[[]Tensor](g_, objc.Sel("placeholderTensors")) + return rv +} diff --git a/macos/mpsgraph/lstm_descriptor.gen.go b/macos/mpsgraph/lstm_descriptor.gen.go new file mode 100644 index 00000000..7414e3c3 --- /dev/null +++ b/macos/mpsgraph/lstm_descriptor.gen.go @@ -0,0 +1,240 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [LSTMDescriptor] class. +var LSTMDescriptorClass = _LSTMDescriptorClass{objc.GetClass("MPSGraphLSTMDescriptor")} + +type _LSTMDescriptorClass struct { + objc.Class +} + +// An interface definition for the [LSTMDescriptor] class. +type ILSTMDescriptor interface { + objc.IObject + Activation() RNNActivation + SetActivation(value RNNActivation) + Training() bool + SetTraining(value bool) + ProduceCell() bool + SetProduceCell(value bool) + CellGateActivation() RNNActivation + SetCellGateActivation(value RNNActivation) + OutputGateActivation() RNNActivation + SetOutputGateActivation(value RNNActivation) + ForgetGateLast() bool + SetForgetGateLast(value bool) + Bidirectional() bool + SetBidirectional(value bool) + ForgetGateActivation() RNNActivation + SetForgetGateActivation(value RNNActivation) + Reverse() bool + SetReverse(value bool) + InputGateActivation() RNNActivation + SetInputGateActivation(value RNNActivation) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor?language=objc +type LSTMDescriptor struct { + objc.Object +} + +func LSTMDescriptorFrom(ptr unsafe.Pointer) LSTMDescriptor { + return LSTMDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (lc _LSTMDescriptorClass) Descriptor() LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](lc, objc.Sel("descriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925439-descriptor?language=objc +func LSTMDescriptor_Descriptor() LSTMDescriptor { + return LSTMDescriptorClass.Descriptor() +} + +func (lc _LSTMDescriptorClass) Alloc() LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](lc, objc.Sel("alloc")) + return rv +} + +func LSTMDescriptor_Alloc() LSTMDescriptor { + return LSTMDescriptorClass.Alloc() +} + +func (lc _LSTMDescriptorClass) New() LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](lc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewLSTMDescriptor() LSTMDescriptor { + return LSTMDescriptorClass.New() +} + +func (l_ LSTMDescriptor) Init() LSTMDescriptor { + rv := objc.Call[LSTMDescriptor](l_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925436-activation?language=objc +func (l_ LSTMDescriptor) Activation() RNNActivation { + rv := objc.Call[RNNActivation](l_, objc.Sel("activation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925436-activation?language=objc +func (l_ LSTMDescriptor) SetActivation(value RNNActivation) { + objc.Call[objc.Void](l_, objc.Sel("setActivation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925446-training?language=objc +func (l_ LSTMDescriptor) Training() bool { + rv := objc.Call[bool](l_, objc.Sel("training")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925446-training?language=objc +func (l_ LSTMDescriptor) SetTraining(value bool) { + objc.Call[objc.Void](l_, objc.Sel("setTraining:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925444-producecell?language=objc +func (l_ LSTMDescriptor) ProduceCell() bool { + rv := objc.Call[bool](l_, objc.Sel("produceCell")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925444-producecell?language=objc +func (l_ LSTMDescriptor) SetProduceCell(value bool) { + objc.Call[objc.Void](l_, objc.Sel("setProduceCell:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925438-cellgateactivation?language=objc +func (l_ LSTMDescriptor) CellGateActivation() RNNActivation { + rv := objc.Call[RNNActivation](l_, objc.Sel("cellGateActivation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925438-cellgateactivation?language=objc +func (l_ LSTMDescriptor) SetCellGateActivation(value RNNActivation) { + objc.Call[objc.Void](l_, objc.Sel("setCellGateActivation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925443-outputgateactivation?language=objc +func (l_ LSTMDescriptor) OutputGateActivation() RNNActivation { + rv := objc.Call[RNNActivation](l_, objc.Sel("outputGateActivation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925443-outputgateactivation?language=objc +func (l_ LSTMDescriptor) SetOutputGateActivation(value RNNActivation) { + objc.Call[objc.Void](l_, objc.Sel("setOutputGateActivation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925441-forgetgatelast?language=objc +func (l_ LSTMDescriptor) ForgetGateLast() bool { + rv := objc.Call[bool](l_, objc.Sel("forgetGateLast")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925441-forgetgatelast?language=objc +func (l_ LSTMDescriptor) SetForgetGateLast(value bool) { + objc.Call[objc.Void](l_, objc.Sel("setForgetGateLast:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925437-bidirectional?language=objc +func (l_ LSTMDescriptor) Bidirectional() bool { + rv := objc.Call[bool](l_, objc.Sel("bidirectional")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925437-bidirectional?language=objc +func (l_ LSTMDescriptor) SetBidirectional(value bool) { + objc.Call[objc.Void](l_, objc.Sel("setBidirectional:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925440-forgetgateactivation?language=objc +func (l_ LSTMDescriptor) ForgetGateActivation() RNNActivation { + rv := objc.Call[RNNActivation](l_, objc.Sel("forgetGateActivation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925440-forgetgateactivation?language=objc +func (l_ LSTMDescriptor) SetForgetGateActivation(value RNNActivation) { + objc.Call[objc.Void](l_, objc.Sel("setForgetGateActivation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925445-reverse?language=objc +func (l_ LSTMDescriptor) Reverse() bool { + rv := objc.Call[bool](l_, objc.Sel("reverse")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925445-reverse?language=objc +func (l_ LSTMDescriptor) SetReverse(value bool) { + objc.Call[objc.Void](l_, objc.Sel("setReverse:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925442-inputgateactivation?language=objc +func (l_ LSTMDescriptor) InputGateActivation() RNNActivation { + rv := objc.Call[RNNActivation](l_, objc.Sel("inputGateActivation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphlstmdescriptor/3925442-inputgateactivation?language=objc +func (l_ LSTMDescriptor) SetInputGateActivation(value RNNActivation) { + objc.Call[objc.Void](l_, objc.Sel("setInputGateActivation:"), value) +} diff --git a/macos/mpsgraph/operation.gen.go b/macos/mpsgraph/operation.gen.go new file mode 100644 index 00000000..a722d339 --- /dev/null +++ b/macos/mpsgraph/operation.gen.go @@ -0,0 +1,103 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Operation] class. +var OperationClass = _OperationClass{objc.GetClass("MPSGraphOperation")} + +type _OperationClass struct { + objc.Class +} + +// An interface definition for the [Operation] class. +type IOperation interface { + objc.IObject + Name() string + ControlDependencies() []Operation + InputTensors() []Tensor + Graph() Graph + OutputTensors() []Tensor +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoperation?language=objc +type Operation struct { + objc.Object +} + +func OperationFrom(ptr unsafe.Pointer) Operation { + return Operation{ + Object: objc.ObjectFrom(ptr), + } +} + +func (oc _OperationClass) Alloc() Operation { + rv := objc.Call[Operation](oc, objc.Sel("alloc")) + return rv +} + +func Operation_Alloc() Operation { + return OperationClass.Alloc() +} + +func (oc _OperationClass) New() Operation { + rv := objc.Call[Operation](oc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewOperation() Operation { + return OperationClass.New() +} + +func (o_ Operation) Init() Operation { + rv := objc.Call[Operation](o_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoperation/3564659-name?language=objc +func (o_ Operation) Name() string { + rv := objc.Call[string](o_, objc.Sel("name")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoperation/3564657-controldependencies?language=objc +func (o_ Operation) ControlDependencies() []Operation { + rv := objc.Call[[]Operation](o_, objc.Sel("controlDependencies")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoperation/3564658-inputtensors?language=objc +func (o_ Operation) InputTensors() []Tensor { + rv := objc.Call[[]Tensor](o_, objc.Sel("inputTensors")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoperation/3580488-graph?language=objc +func (o_ Operation) Graph() Graph { + rv := objc.Call[Graph](o_, objc.Sel("graph")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoperation/3564660-outputtensors?language=objc +func (o_ Operation) OutputTensors() []Tensor { + rv := objc.Call[[]Tensor](o_, objc.Sel("outputTensors")) + return rv +} diff --git a/macos/mpsgraph/pooling2_d_op_descriptor.gen.go b/macos/mpsgraph/pooling2_d_op_descriptor.gen.go new file mode 100644 index 00000000..591acab2 --- /dev/null +++ b/macos/mpsgraph/pooling2_d_op_descriptor.gen.go @@ -0,0 +1,351 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Pooling2DOpDescriptor] class. +var Pooling2DOpDescriptorClass = _Pooling2DOpDescriptorClass{objc.GetClass("MPSGraphPooling2DOpDescriptor")} + +type _Pooling2DOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [Pooling2DOpDescriptor] class. +type IPooling2DOpDescriptor interface { + objc.IObject + SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint) + StrideInX() uint + SetStrideInX(value uint) + PaddingStyle() PaddingStyle + SetPaddingStyle(value PaddingStyle) + PaddingBottom() uint + SetPaddingBottom(value uint) + PaddingTop() uint + SetPaddingTop(value uint) + StrideInY() uint + SetStrideInY(value uint) + CeilMode() bool + SetCeilMode(value bool) + PaddingLeft() uint + SetPaddingLeft(value uint) + DilationRateInX() uint + SetDilationRateInX(value uint) + ReturnIndicesMode() PoolingReturnIndicesMode + SetReturnIndicesMode(value PoolingReturnIndicesMode) + DataLayout() TensorNamedDataLayout + SetDataLayout(value TensorNamedDataLayout) + ReturnIndicesDataType() mps.DataType + SetReturnIndicesDataType(value mps.DataType) + DilationRateInY() uint + SetDilationRateInY(value uint) + KernelHeight() uint + SetKernelHeight(value uint) + IncludeZeroPadToAverage() bool + SetIncludeZeroPadToAverage(value bool) + KernelWidth() uint + SetKernelWidth(value uint) + PaddingRight() uint + SetPaddingRight(value uint) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor?language=objc +type Pooling2DOpDescriptor struct { + objc.Object +} + +func Pooling2DOpDescriptorFrom(ptr unsafe.Pointer) Pooling2DOpDescriptor { + return Pooling2DOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _Pooling2DOpDescriptorClass) DescriptorWithKernelWidthKernelHeightStrideInXStrideInYPaddingStyleDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, paddingStyle PaddingStyle, dataLayout TensorNamedDataLayout) Pooling2DOpDescriptor { + rv := objc.Call[Pooling2DOpDescriptor](pc, objc.Sel("descriptorWithKernelWidth:kernelHeight:strideInX:strideInY:paddingStyle:dataLayout:"), kernelWidth, kernelHeight, strideInX, strideInY, paddingStyle, dataLayout) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564712-descriptorwithkernelwidth?language=objc +func Pooling2DOpDescriptor_DescriptorWithKernelWidthKernelHeightStrideInXStrideInYPaddingStyleDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, paddingStyle PaddingStyle, dataLayout TensorNamedDataLayout) Pooling2DOpDescriptor { + return Pooling2DOpDescriptorClass.DescriptorWithKernelWidthKernelHeightStrideInXStrideInYPaddingStyleDataLayout(kernelWidth, kernelHeight, strideInX, strideInY, paddingStyle, dataLayout) +} + +func (pc _Pooling2DOpDescriptorClass) Alloc() Pooling2DOpDescriptor { + rv := objc.Call[Pooling2DOpDescriptor](pc, objc.Sel("alloc")) + return rv +} + +func Pooling2DOpDescriptor_Alloc() Pooling2DOpDescriptor { + return Pooling2DOpDescriptorClass.Alloc() +} + +func (pc _Pooling2DOpDescriptorClass) New() Pooling2DOpDescriptor { + rv := objc.Call[Pooling2DOpDescriptor](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPooling2DOpDescriptor() Pooling2DOpDescriptor { + return Pooling2DOpDescriptorClass.New() +} + +func (p_ Pooling2DOpDescriptor) Init() Pooling2DOpDescriptor { + rv := objc.Call[Pooling2DOpDescriptor](p_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564722-setexplicitpaddingwithpaddinglef?language=objc +func (p_ Pooling2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint) { + objc.Call[objc.Void](p_, objc.Sel("setExplicitPaddingWithPaddingLeft:paddingRight:paddingTop:paddingBottom:"), paddingLeft, paddingRight, paddingTop, paddingBottom) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564723-strideinx?language=objc +func (p_ Pooling2DOpDescriptor) StrideInX() uint { + rv := objc.Call[uint](p_, objc.Sel("strideInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564723-strideinx?language=objc +func (p_ Pooling2DOpDescriptor) SetStrideInX(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setStrideInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564720-paddingstyle?language=objc +func (p_ Pooling2DOpDescriptor) PaddingStyle() PaddingStyle { + rv := objc.Call[PaddingStyle](p_, objc.Sel("paddingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564720-paddingstyle?language=objc +func (p_ Pooling2DOpDescriptor) SetPaddingStyle(value PaddingStyle) { + objc.Call[objc.Void](p_, objc.Sel("setPaddingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564717-paddingbottom?language=objc +func (p_ Pooling2DOpDescriptor) PaddingBottom() uint { + rv := objc.Call[uint](p_, objc.Sel("paddingBottom")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564717-paddingbottom?language=objc +func (p_ Pooling2DOpDescriptor) SetPaddingBottom(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setPaddingBottom:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564721-paddingtop?language=objc +func (p_ Pooling2DOpDescriptor) PaddingTop() uint { + rv := objc.Call[uint](p_, objc.Sel("paddingTop")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564721-paddingtop?language=objc +func (p_ Pooling2DOpDescriptor) SetPaddingTop(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setPaddingTop:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564724-strideiny?language=objc +func (p_ Pooling2DOpDescriptor) StrideInY() uint { + rv := objc.Call[uint](p_, objc.Sel("strideInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564724-strideiny?language=objc +func (p_ Pooling2DOpDescriptor) SetStrideInY(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setStrideInY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3861842-ceilmode?language=objc +func (p_ Pooling2DOpDescriptor) CeilMode() bool { + rv := objc.Call[bool](p_, objc.Sel("ceilMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3861842-ceilmode?language=objc +func (p_ Pooling2DOpDescriptor) SetCeilMode(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setCeilMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564718-paddingleft?language=objc +func (p_ Pooling2DOpDescriptor) PaddingLeft() uint { + rv := objc.Call[uint](p_, objc.Sel("paddingLeft")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564718-paddingleft?language=objc +func (p_ Pooling2DOpDescriptor) SetPaddingLeft(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setPaddingLeft:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564713-dilationrateinx?language=objc +func (p_ Pooling2DOpDescriptor) DilationRateInX() uint { + rv := objc.Call[uint](p_, objc.Sel("dilationRateInX")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564713-dilationrateinx?language=objc +func (p_ Pooling2DOpDescriptor) SetDilationRateInX(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setDilationRateInX:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3919745-returnindicesmode?language=objc +func (p_ Pooling2DOpDescriptor) ReturnIndicesMode() PoolingReturnIndicesMode { + rv := objc.Call[PoolingReturnIndicesMode](p_, objc.Sel("returnIndicesMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3919745-returnindicesmode?language=objc +func (p_ Pooling2DOpDescriptor) SetReturnIndicesMode(value PoolingReturnIndicesMode) { + objc.Call[objc.Void](p_, objc.Sel("setReturnIndicesMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564710-datalayout?language=objc +func (p_ Pooling2DOpDescriptor) DataLayout() TensorNamedDataLayout { + rv := objc.Call[TensorNamedDataLayout](p_, objc.Sel("dataLayout")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564710-datalayout?language=objc +func (p_ Pooling2DOpDescriptor) SetDataLayout(value TensorNamedDataLayout) { + objc.Call[objc.Void](p_, objc.Sel("setDataLayout:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3919744-returnindicesdatatype?language=objc +func (p_ Pooling2DOpDescriptor) ReturnIndicesDataType() mps.DataType { + rv := objc.Call[mps.DataType](p_, objc.Sel("returnIndicesDataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3919744-returnindicesdatatype?language=objc +func (p_ Pooling2DOpDescriptor) SetReturnIndicesDataType(value mps.DataType) { + objc.Call[objc.Void](p_, objc.Sel("setReturnIndicesDataType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564714-dilationrateiny?language=objc +func (p_ Pooling2DOpDescriptor) DilationRateInY() uint { + rv := objc.Call[uint](p_, objc.Sel("dilationRateInY")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564714-dilationrateiny?language=objc +func (p_ Pooling2DOpDescriptor) SetDilationRateInY(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setDilationRateInY:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564715-kernelheight?language=objc +func (p_ Pooling2DOpDescriptor) KernelHeight() uint { + rv := objc.Call[uint](p_, objc.Sel("kernelHeight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564715-kernelheight?language=objc +func (p_ Pooling2DOpDescriptor) SetKernelHeight(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setKernelHeight:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3861843-includezeropadtoaverage?language=objc +func (p_ Pooling2DOpDescriptor) IncludeZeroPadToAverage() bool { + rv := objc.Call[bool](p_, objc.Sel("includeZeroPadToAverage")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3861843-includezeropadtoaverage?language=objc +func (p_ Pooling2DOpDescriptor) SetIncludeZeroPadToAverage(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setIncludeZeroPadToAverage:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564716-kernelwidth?language=objc +func (p_ Pooling2DOpDescriptor) KernelWidth() uint { + rv := objc.Call[uint](p_, objc.Sel("kernelWidth")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564716-kernelwidth?language=objc +func (p_ Pooling2DOpDescriptor) SetKernelWidth(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setKernelWidth:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564719-paddingright?language=objc +func (p_ Pooling2DOpDescriptor) PaddingRight() uint { + rv := objc.Call[uint](p_, objc.Sel("paddingRight")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/3564719-paddingright?language=objc +func (p_ Pooling2DOpDescriptor) SetPaddingRight(value uint) { + objc.Call[objc.Void](p_, objc.Sel("setPaddingRight:"), value) +} diff --git a/macos/mpsgraph/pooling4_d_op_descriptor.gen.go b/macos/mpsgraph/pooling4_d_op_descriptor.gen.go new file mode 100644 index 00000000..abee42b1 --- /dev/null +++ b/macos/mpsgraph/pooling4_d_op_descriptor.gen.go @@ -0,0 +1,225 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Pooling4DOpDescriptor] class. +var Pooling4DOpDescriptorClass = _Pooling4DOpDescriptorClass{objc.GetClass("MPSGraphPooling4DOpDescriptor")} + +type _Pooling4DOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [Pooling4DOpDescriptor] class. +type IPooling4DOpDescriptor interface { + objc.IObject + PaddingStyle() PaddingStyle + SetPaddingStyle(value PaddingStyle) + CeilMode() bool + SetCeilMode(value bool) + KernelSizes() []foundation.Number + SetKernelSizes(value []foundation.INumber) + PaddingValues() []foundation.Number + SetPaddingValues(value []foundation.INumber) + DilationRates() []foundation.Number + SetDilationRates(value []foundation.INumber) + ReturnIndicesMode() PoolingReturnIndicesMode + SetReturnIndicesMode(value PoolingReturnIndicesMode) + ReturnIndicesDataType() mps.DataType + SetReturnIndicesDataType(value mps.DataType) + IncludeZeroPadToAverage() bool + SetIncludeZeroPadToAverage(value bool) + Strides() []foundation.Number + SetStrides(value []foundation.INumber) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor?language=objc +type Pooling4DOpDescriptor struct { + objc.Object +} + +func Pooling4DOpDescriptorFrom(ptr unsafe.Pointer) Pooling4DOpDescriptor { + return Pooling4DOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _Pooling4DOpDescriptorClass) DescriptorWithKernelSizesPaddingStyle(kernelSizes []foundation.INumber, paddingStyle PaddingStyle) Pooling4DOpDescriptor { + rv := objc.Call[Pooling4DOpDescriptor](pc, objc.Sel("descriptorWithKernelSizes:paddingStyle:"), kernelSizes, paddingStyle) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750698-descriptorwithkernelsizes?language=objc +func Pooling4DOpDescriptor_DescriptorWithKernelSizesPaddingStyle(kernelSizes []foundation.INumber, paddingStyle PaddingStyle) Pooling4DOpDescriptor { + return Pooling4DOpDescriptorClass.DescriptorWithKernelSizesPaddingStyle(kernelSizes, paddingStyle) +} + +func (pc _Pooling4DOpDescriptorClass) Alloc() Pooling4DOpDescriptor { + rv := objc.Call[Pooling4DOpDescriptor](pc, objc.Sel("alloc")) + return rv +} + +func Pooling4DOpDescriptor_Alloc() Pooling4DOpDescriptor { + return Pooling4DOpDescriptorClass.Alloc() +} + +func (pc _Pooling4DOpDescriptorClass) New() Pooling4DOpDescriptor { + rv := objc.Call[Pooling4DOpDescriptor](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPooling4DOpDescriptor() Pooling4DOpDescriptor { + return Pooling4DOpDescriptorClass.New() +} + +func (p_ Pooling4DOpDescriptor) Init() Pooling4DOpDescriptor { + rv := objc.Call[Pooling4DOpDescriptor](p_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750703-paddingstyle?language=objc +func (p_ Pooling4DOpDescriptor) PaddingStyle() PaddingStyle { + rv := objc.Call[PaddingStyle](p_, objc.Sel("paddingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750703-paddingstyle?language=objc +func (p_ Pooling4DOpDescriptor) SetPaddingStyle(value PaddingStyle) { + objc.Call[objc.Void](p_, objc.Sel("setPaddingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750697-ceilmode?language=objc +func (p_ Pooling4DOpDescriptor) CeilMode() bool { + rv := objc.Call[bool](p_, objc.Sel("ceilMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750697-ceilmode?language=objc +func (p_ Pooling4DOpDescriptor) SetCeilMode(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setCeilMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750702-kernelsizes?language=objc +func (p_ Pooling4DOpDescriptor) KernelSizes() []foundation.Number { + rv := objc.Call[[]foundation.Number](p_, objc.Sel("kernelSizes")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750702-kernelsizes?language=objc +func (p_ Pooling4DOpDescriptor) SetKernelSizes(value []foundation.INumber) { + objc.Call[objc.Void](p_, objc.Sel("setKernelSizes:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750704-paddingvalues?language=objc +func (p_ Pooling4DOpDescriptor) PaddingValues() []foundation.Number { + rv := objc.Call[[]foundation.Number](p_, objc.Sel("paddingValues")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750704-paddingvalues?language=objc +func (p_ Pooling4DOpDescriptor) SetPaddingValues(value []foundation.INumber) { + objc.Call[objc.Void](p_, objc.Sel("setPaddingValues:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750700-dilationrates?language=objc +func (p_ Pooling4DOpDescriptor) DilationRates() []foundation.Number { + rv := objc.Call[[]foundation.Number](p_, objc.Sel("dilationRates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750700-dilationrates?language=objc +func (p_ Pooling4DOpDescriptor) SetDilationRates(value []foundation.INumber) { + objc.Call[objc.Void](p_, objc.Sel("setDilationRates:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3919747-returnindicesmode?language=objc +func (p_ Pooling4DOpDescriptor) ReturnIndicesMode() PoolingReturnIndicesMode { + rv := objc.Call[PoolingReturnIndicesMode](p_, objc.Sel("returnIndicesMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3919747-returnindicesmode?language=objc +func (p_ Pooling4DOpDescriptor) SetReturnIndicesMode(value PoolingReturnIndicesMode) { + objc.Call[objc.Void](p_, objc.Sel("setReturnIndicesMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3919746-returnindicesdatatype?language=objc +func (p_ Pooling4DOpDescriptor) ReturnIndicesDataType() mps.DataType { + rv := objc.Call[mps.DataType](p_, objc.Sel("returnIndicesDataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3919746-returnindicesdatatype?language=objc +func (p_ Pooling4DOpDescriptor) SetReturnIndicesDataType(value mps.DataType) { + objc.Call[objc.Void](p_, objc.Sel("setReturnIndicesDataType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750701-includezeropadtoaverage?language=objc +func (p_ Pooling4DOpDescriptor) IncludeZeroPadToAverage() bool { + rv := objc.Call[bool](p_, objc.Sel("includeZeroPadToAverage")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750701-includezeropadtoaverage?language=objc +func (p_ Pooling4DOpDescriptor) SetIncludeZeroPadToAverage(value bool) { + objc.Call[objc.Void](p_, objc.Sel("setIncludeZeroPadToAverage:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750705-strides?language=objc +func (p_ Pooling4DOpDescriptor) Strides() []foundation.Number { + rv := objc.Call[[]foundation.Number](p_, objc.Sel("strides")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor/3750705-strides?language=objc +func (p_ Pooling4DOpDescriptor) SetStrides(value []foundation.INumber) { + objc.Call[objc.Void](p_, objc.Sel("setStrides:"), value) +} diff --git a/macos/mpsgraph/protocols.gen.m b/macos/mpsgraph/protocols.gen.m new file mode 100644 index 00000000..b6720e1e --- /dev/null +++ b/macos/mpsgraph/protocols.gen.m @@ -0,0 +1,7 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "MetalPerformanceShadersGraph/MetalPerformanceShadersGraph.h" + +void importMetalPerformanceShadersGraphProtocols() { + id o; +} diff --git a/macos/mpsgraph/random_op_descriptor.gen.go b/macos/mpsgraph/random_op_descriptor.gen.go new file mode 100644 index 00000000..1b262e19 --- /dev/null +++ b/macos/mpsgraph/random_op_descriptor.gen.go @@ -0,0 +1,224 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RandomOpDescriptor] class. +var RandomOpDescriptorClass = _RandomOpDescriptorClass{objc.GetClass("MPSGraphRandomOpDescriptor")} + +type _RandomOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [RandomOpDescriptor] class. +type IRandomOpDescriptor interface { + objc.IObject + Distribution() RandomDistribution + SetDistribution(value RandomDistribution) + MinInteger() int + SetMinInteger(value int) + Min() float64 + SetMin(value float64) + Max() float64 + SetMax(value float64) + StandardDeviation() float64 + SetStandardDeviation(value float64) + DataType() mps.DataType + SetDataType(value mps.DataType) + MaxInteger() int + SetMaxInteger(value int) + SamplingMethod() RandomNormalSamplingMethod + SetSamplingMethod(value RandomNormalSamplingMethod) + Mean() float64 + SetMean(value float64) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor?language=objc +type RandomOpDescriptor struct { + objc.Object +} + +func RandomOpDescriptorFrom(ptr unsafe.Pointer) RandomOpDescriptor { + return RandomOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RandomOpDescriptorClass) DescriptorWithDistributionDataType(distribution RandomDistribution, dataType mps.DataType) RandomOpDescriptor { + rv := objc.Call[RandomOpDescriptor](rc, objc.Sel("descriptorWithDistribution:dataType:"), distribution, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901499-descriptorwithdistribution?language=objc +func RandomOpDescriptor_DescriptorWithDistributionDataType(distribution RandomDistribution, dataType mps.DataType) RandomOpDescriptor { + return RandomOpDescriptorClass.DescriptorWithDistributionDataType(distribution, dataType) +} + +func (rc _RandomOpDescriptorClass) Alloc() RandomOpDescriptor { + rv := objc.Call[RandomOpDescriptor](rc, objc.Sel("alloc")) + return rv +} + +func RandomOpDescriptor_Alloc() RandomOpDescriptor { + return RandomOpDescriptorClass.Alloc() +} + +func (rc _RandomOpDescriptorClass) New() RandomOpDescriptor { + rv := objc.Call[RandomOpDescriptor](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRandomOpDescriptor() RandomOpDescriptor { + return RandomOpDescriptorClass.New() +} + +func (r_ RandomOpDescriptor) Init() RandomOpDescriptor { + rv := objc.Call[RandomOpDescriptor](r_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901500-distribution?language=objc +func (r_ RandomOpDescriptor) Distribution() RandomDistribution { + rv := objc.Call[RandomDistribution](r_, objc.Sel("distribution")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901500-distribution?language=objc +func (r_ RandomOpDescriptor) SetDistribution(value RandomDistribution) { + objc.Call[objc.Void](r_, objc.Sel("setDistribution:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901505-mininteger?language=objc +func (r_ RandomOpDescriptor) MinInteger() int { + rv := objc.Call[int](r_, objc.Sel("minInteger")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901505-mininteger?language=objc +func (r_ RandomOpDescriptor) SetMinInteger(value int) { + objc.Call[objc.Void](r_, objc.Sel("setMinInteger:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901504-min?language=objc +func (r_ RandomOpDescriptor) Min() float64 { + rv := objc.Call[float64](r_, objc.Sel("min")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901504-min?language=objc +func (r_ RandomOpDescriptor) SetMin(value float64) { + objc.Call[objc.Void](r_, objc.Sel("setMin:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901501-max?language=objc +func (r_ RandomOpDescriptor) Max() float64 { + rv := objc.Call[float64](r_, objc.Sel("max")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901501-max?language=objc +func (r_ RandomOpDescriptor) SetMax(value float64) { + objc.Call[objc.Void](r_, objc.Sel("setMax:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901507-standarddeviation?language=objc +func (r_ RandomOpDescriptor) StandardDeviation() float64 { + rv := objc.Call[float64](r_, objc.Sel("standardDeviation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901507-standarddeviation?language=objc +func (r_ RandomOpDescriptor) SetStandardDeviation(value float64) { + objc.Call[objc.Void](r_, objc.Sel("setStandardDeviation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901498-datatype?language=objc +func (r_ RandomOpDescriptor) DataType() mps.DataType { + rv := objc.Call[mps.DataType](r_, objc.Sel("dataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901498-datatype?language=objc +func (r_ RandomOpDescriptor) SetDataType(value mps.DataType) { + objc.Call[objc.Void](r_, objc.Sel("setDataType:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901502-maxinteger?language=objc +func (r_ RandomOpDescriptor) MaxInteger() int { + rv := objc.Call[int](r_, objc.Sel("maxInteger")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901502-maxinteger?language=objc +func (r_ RandomOpDescriptor) SetMaxInteger(value int) { + objc.Call[objc.Void](r_, objc.Sel("setMaxInteger:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901506-samplingmethod?language=objc +func (r_ RandomOpDescriptor) SamplingMethod() RandomNormalSamplingMethod { + rv := objc.Call[RandomNormalSamplingMethod](r_, objc.Sel("samplingMethod")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901506-samplingmethod?language=objc +func (r_ RandomOpDescriptor) SetSamplingMethod(value RandomNormalSamplingMethod) { + objc.Call[objc.Void](r_, objc.Sel("setSamplingMethod:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901503-mean?language=objc +func (r_ RandomOpDescriptor) Mean() float64 { + rv := objc.Call[float64](r_, objc.Sel("mean")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphrandomopdescriptor/3901503-mean?language=objc +func (r_ RandomOpDescriptor) SetMean(value float64) { + objc.Call[objc.Void](r_, objc.Sel("setMean:"), value) +} diff --git a/macos/mpsgraph/shaped_type.gen.go b/macos/mpsgraph/shaped_type.gen.go new file mode 100644 index 00000000..e712eceb --- /dev/null +++ b/macos/mpsgraph/shaped_type.gen.go @@ -0,0 +1,117 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ShapedType] class. +var ShapedTypeClass = _ShapedTypeClass{objc.GetClass("MPSGraphShapedType")} + +type _ShapedTypeClass struct { + objc.Class +} + +// An interface definition for the [ShapedType] class. +type IShapedType interface { + IType + IsEqualTo(object IShapedType) bool + Shape() *foundation.Array + SetShape(value *foundation.Array) + DataType() mps.DataType + SetDataType(value mps.DataType) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphshapedtype?language=objc +type ShapedType struct { + Type +} + +func ShapedTypeFrom(ptr unsafe.Pointer) ShapedType { + return ShapedType{ + Type: TypeFrom(ptr), + } +} + +func (s_ ShapedType) InitWithShapeDataType(shape *foundation.Array, dataType mps.DataType) ShapedType { + rv := objc.Call[ShapedType](s_, objc.Sel("initWithShape:dataType:"), shape, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphshapedtype/3600280-initwithshape?language=objc +func NewShapedTypeWithShapeDataType(shape *foundation.Array, dataType mps.DataType) ShapedType { + instance := ShapedTypeClass.Alloc().InitWithShapeDataType(shape, dataType) + instance.Autorelease() + return instance +} + +func (sc _ShapedTypeClass) Alloc() ShapedType { + rv := objc.Call[ShapedType](sc, objc.Sel("alloc")) + return rv +} + +func ShapedType_Alloc() ShapedType { + return ShapedTypeClass.Alloc() +} + +func (sc _ShapedTypeClass) New() ShapedType { + rv := objc.Call[ShapedType](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewShapedType() ShapedType { + return ShapedTypeClass.New() +} + +func (s_ ShapedType) Init() ShapedType { + rv := objc.Call[ShapedType](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphshapedtype/3600281-isequalto?language=objc +func (s_ ShapedType) IsEqualTo(object IShapedType) bool { + rv := objc.Call[bool](s_, objc.Sel("isEqualTo:"), objc.Ptr(object)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphshapedtype/3600282-shape?language=objc +func (s_ ShapedType) Shape() *foundation.Array { + rv := objc.Call[*foundation.Array](s_, objc.Sel("shape")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphshapedtype/3600282-shape?language=objc +func (s_ ShapedType) SetShape(value *foundation.Array) { + objc.Call[objc.Void](s_, objc.Sel("setShape:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphshapedtype/3600279-datatype?language=objc +func (s_ ShapedType) DataType() mps.DataType { + rv := objc.Call[mps.DataType](s_, objc.Sel("dataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphshapedtype/3600279-datatype?language=objc +func (s_ ShapedType) SetDataType(value mps.DataType) { + objc.Call[objc.Void](s_, objc.Sel("setDataType:"), value) +} diff --git a/macos/mpsgraph/single_gate_rnn_descriptor.gen.go b/macos/mpsgraph/single_gate_rnn_descriptor.gen.go new file mode 100644 index 00000000..3de32c73 --- /dev/null +++ b/macos/mpsgraph/single_gate_rnn_descriptor.gen.go @@ -0,0 +1,138 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SingleGateRNNDescriptor] class. +var SingleGateRNNDescriptorClass = _SingleGateRNNDescriptorClass{objc.GetClass("MPSGraphSingleGateRNNDescriptor")} + +type _SingleGateRNNDescriptorClass struct { + objc.Class +} + +// An interface definition for the [SingleGateRNNDescriptor] class. +type ISingleGateRNNDescriptor interface { + objc.IObject + Activation() RNNActivation + SetActivation(value RNNActivation) + Training() bool + SetTraining(value bool) + Bidirectional() bool + SetBidirectional(value bool) + Reverse() bool + SetReverse(value bool) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor?language=objc +type SingleGateRNNDescriptor struct { + objc.Object +} + +func SingleGateRNNDescriptorFrom(ptr unsafe.Pointer) SingleGateRNNDescriptor { + return SingleGateRNNDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (sc _SingleGateRNNDescriptorClass) Descriptor() SingleGateRNNDescriptor { + rv := objc.Call[SingleGateRNNDescriptor](sc, objc.Sel("descriptor")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919774-descriptor?language=objc +func SingleGateRNNDescriptor_Descriptor() SingleGateRNNDescriptor { + return SingleGateRNNDescriptorClass.Descriptor() +} + +func (sc _SingleGateRNNDescriptorClass) Alloc() SingleGateRNNDescriptor { + rv := objc.Call[SingleGateRNNDescriptor](sc, objc.Sel("alloc")) + return rv +} + +func SingleGateRNNDescriptor_Alloc() SingleGateRNNDescriptor { + return SingleGateRNNDescriptorClass.Alloc() +} + +func (sc _SingleGateRNNDescriptorClass) New() SingleGateRNNDescriptor { + rv := objc.Call[SingleGateRNNDescriptor](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSingleGateRNNDescriptor() SingleGateRNNDescriptor { + return SingleGateRNNDescriptorClass.New() +} + +func (s_ SingleGateRNNDescriptor) Init() SingleGateRNNDescriptor { + rv := objc.Call[SingleGateRNNDescriptor](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919772-activation?language=objc +func (s_ SingleGateRNNDescriptor) Activation() RNNActivation { + rv := objc.Call[RNNActivation](s_, objc.Sel("activation")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919772-activation?language=objc +func (s_ SingleGateRNNDescriptor) SetActivation(value RNNActivation) { + objc.Call[objc.Void](s_, objc.Sel("setActivation:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919776-training?language=objc +func (s_ SingleGateRNNDescriptor) Training() bool { + rv := objc.Call[bool](s_, objc.Sel("training")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919776-training?language=objc +func (s_ SingleGateRNNDescriptor) SetTraining(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setTraining:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919773-bidirectional?language=objc +func (s_ SingleGateRNNDescriptor) Bidirectional() bool { + rv := objc.Call[bool](s_, objc.Sel("bidirectional")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919773-bidirectional?language=objc +func (s_ SingleGateRNNDescriptor) SetBidirectional(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setBidirectional:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919775-reverse?language=objc +func (s_ SingleGateRNNDescriptor) Reverse() bool { + rv := objc.Call[bool](s_, objc.Sel("reverse")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor/3919775-reverse?language=objc +func (s_ SingleGateRNNDescriptor) SetReverse(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setReverse:"), value) +} diff --git a/macos/mpsgraph/stencil_op_descriptor.gen.go b/macos/mpsgraph/stencil_op_descriptor.gen.go new file mode 100644 index 00000000..333ebb15 --- /dev/null +++ b/macos/mpsgraph/stencil_op_descriptor.gen.go @@ -0,0 +1,243 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [StencilOpDescriptor] class. +var StencilOpDescriptorClass = _StencilOpDescriptorClass{objc.GetClass("MPSGraphStencilOpDescriptor")} + +type _StencilOpDescriptorClass struct { + objc.Class +} + +// An interface definition for the [StencilOpDescriptor] class. +type IStencilOpDescriptor interface { + objc.IObject + PaddingConstant() float64 + SetPaddingConstant(value float64) + Offsets() *foundation.Array + SetOffsets(value *foundation.Array) + PaddingStyle() PaddingStyle + SetPaddingStyle(value PaddingStyle) + DilationRates() *foundation.Array + SetDilationRates(value *foundation.Array) + ExplicitPadding() *foundation.Array + SetExplicitPadding(value *foundation.Array) + BoundaryMode() PaddingMode + SetBoundaryMode(value PaddingMode) + ReductionMode() ReductionMode + SetReductionMode(value ReductionMode) + Strides() *foundation.Array + SetStrides(value *foundation.Array) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor?language=objc +type StencilOpDescriptor struct { + objc.Object +} + +func StencilOpDescriptorFrom(ptr unsafe.Pointer) StencilOpDescriptor { + return StencilOpDescriptor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (sc _StencilOpDescriptorClass) DescriptorWithOffsetsExplicitPadding(offsets *foundation.Array, explicitPadding *foundation.Array) StencilOpDescriptor { + rv := objc.Call[StencilOpDescriptor](sc, objc.Sel("descriptorWithOffsets:explicitPadding:"), offsets, explicitPadding) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787609-descriptorwithoffsets?language=objc +func StencilOpDescriptor_DescriptorWithOffsetsExplicitPadding(offsets *foundation.Array, explicitPadding *foundation.Array) StencilOpDescriptor { + return StencilOpDescriptorClass.DescriptorWithOffsetsExplicitPadding(offsets, explicitPadding) +} + +func (sc _StencilOpDescriptorClass) DescriptorWithExplicitPadding(explicitPadding *foundation.Array) StencilOpDescriptor { + rv := objc.Call[StencilOpDescriptor](sc, objc.Sel("descriptorWithExplicitPadding:"), explicitPadding) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787608-descriptorwithexplicitpadding?language=objc +func StencilOpDescriptor_DescriptorWithExplicitPadding(explicitPadding *foundation.Array) StencilOpDescriptor { + return StencilOpDescriptorClass.DescriptorWithExplicitPadding(explicitPadding) +} + +func (sc _StencilOpDescriptorClass) DescriptorWithReductionModeOffsetsStridesDilationRatesExplicitPaddingBoundaryModePaddingStylePaddingConstant(reductionMode ReductionMode, offsets *foundation.Array, strides *foundation.Array, dilationRates *foundation.Array, explicitPadding *foundation.Array, boundaryMode PaddingMode, paddingStyle PaddingStyle, paddingConstant float64) StencilOpDescriptor { + rv := objc.Call[StencilOpDescriptor](sc, objc.Sel("descriptorWithReductionMode:offsets:strides:dilationRates:explicitPadding:boundaryMode:paddingStyle:paddingConstant:"), reductionMode, offsets, strides, dilationRates, explicitPadding, boundaryMode, paddingStyle, paddingConstant) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787611-descriptorwithreductionmode?language=objc +func StencilOpDescriptor_DescriptorWithReductionModeOffsetsStridesDilationRatesExplicitPaddingBoundaryModePaddingStylePaddingConstant(reductionMode ReductionMode, offsets *foundation.Array, strides *foundation.Array, dilationRates *foundation.Array, explicitPadding *foundation.Array, boundaryMode PaddingMode, paddingStyle PaddingStyle, paddingConstant float64) StencilOpDescriptor { + return StencilOpDescriptorClass.DescriptorWithReductionModeOffsetsStridesDilationRatesExplicitPaddingBoundaryModePaddingStylePaddingConstant(reductionMode, offsets, strides, dilationRates, explicitPadding, boundaryMode, paddingStyle, paddingConstant) +} + +func (sc _StencilOpDescriptorClass) DescriptorWithPaddingStyle(paddingStyle PaddingStyle) StencilOpDescriptor { + rv := objc.Call[StencilOpDescriptor](sc, objc.Sel("descriptorWithPaddingStyle:"), paddingStyle) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787610-descriptorwithpaddingstyle?language=objc +func StencilOpDescriptor_DescriptorWithPaddingStyle(paddingStyle PaddingStyle) StencilOpDescriptor { + return StencilOpDescriptorClass.DescriptorWithPaddingStyle(paddingStyle) +} + +func (sc _StencilOpDescriptorClass) Alloc() StencilOpDescriptor { + rv := objc.Call[StencilOpDescriptor](sc, objc.Sel("alloc")) + return rv +} + +func StencilOpDescriptor_Alloc() StencilOpDescriptor { + return StencilOpDescriptorClass.Alloc() +} + +func (sc _StencilOpDescriptorClass) New() StencilOpDescriptor { + rv := objc.Call[StencilOpDescriptor](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewStencilOpDescriptor() StencilOpDescriptor { + return StencilOpDescriptorClass.New() +} + +func (s_ StencilOpDescriptor) Init() StencilOpDescriptor { + rv := objc.Call[StencilOpDescriptor](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787615-paddingconstant?language=objc +func (s_ StencilOpDescriptor) PaddingConstant() float64 { + rv := objc.Call[float64](s_, objc.Sel("paddingConstant")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787615-paddingconstant?language=objc +func (s_ StencilOpDescriptor) SetPaddingConstant(value float64) { + objc.Call[objc.Void](s_, objc.Sel("setPaddingConstant:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787614-offsets?language=objc +func (s_ StencilOpDescriptor) Offsets() *foundation.Array { + rv := objc.Call[*foundation.Array](s_, objc.Sel("offsets")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787614-offsets?language=objc +func (s_ StencilOpDescriptor) SetOffsets(value *foundation.Array) { + objc.Call[objc.Void](s_, objc.Sel("setOffsets:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787616-paddingstyle?language=objc +func (s_ StencilOpDescriptor) PaddingStyle() PaddingStyle { + rv := objc.Call[PaddingStyle](s_, objc.Sel("paddingStyle")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787616-paddingstyle?language=objc +func (s_ StencilOpDescriptor) SetPaddingStyle(value PaddingStyle) { + objc.Call[objc.Void](s_, objc.Sel("setPaddingStyle:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787612-dilationrates?language=objc +func (s_ StencilOpDescriptor) DilationRates() *foundation.Array { + rv := objc.Call[*foundation.Array](s_, objc.Sel("dilationRates")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787612-dilationrates?language=objc +func (s_ StencilOpDescriptor) SetDilationRates(value *foundation.Array) { + objc.Call[objc.Void](s_, objc.Sel("setDilationRates:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787613-explicitpadding?language=objc +func (s_ StencilOpDescriptor) ExplicitPadding() *foundation.Array { + rv := objc.Call[*foundation.Array](s_, objc.Sel("explicitPadding")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787613-explicitpadding?language=objc +func (s_ StencilOpDescriptor) SetExplicitPadding(value *foundation.Array) { + objc.Call[objc.Void](s_, objc.Sel("setExplicitPadding:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787607-boundarymode?language=objc +func (s_ StencilOpDescriptor) BoundaryMode() PaddingMode { + rv := objc.Call[PaddingMode](s_, objc.Sel("boundaryMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787607-boundarymode?language=objc +func (s_ StencilOpDescriptor) SetBoundaryMode(value PaddingMode) { + objc.Call[objc.Void](s_, objc.Sel("setBoundaryMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787617-reductionmode?language=objc +func (s_ StencilOpDescriptor) ReductionMode() ReductionMode { + rv := objc.Call[ReductionMode](s_, objc.Sel("reductionMode")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787617-reductionmode?language=objc +func (s_ StencilOpDescriptor) SetReductionMode(value ReductionMode) { + objc.Call[objc.Void](s_, objc.Sel("setReductionMode:"), value) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787618-strides?language=objc +func (s_ StencilOpDescriptor) Strides() *foundation.Array { + rv := objc.Call[*foundation.Array](s_, objc.Sel("strides")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphstencilopdescriptor/3787618-strides?language=objc +func (s_ StencilOpDescriptor) SetStrides(value *foundation.Array) { + objc.Call[objc.Void](s_, objc.Sel("setStrides:"), value) +} diff --git a/macos/mpsgraph/tensor.gen.go b/macos/mpsgraph/tensor.gen.go new file mode 100644 index 00000000..4f6db15b --- /dev/null +++ b/macos/mpsgraph/tensor.gen.go @@ -0,0 +1,87 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Tensor] class. +var TensorClass = _TensorClass{objc.GetClass("MPSGraphTensor")} + +type _TensorClass struct { + objc.Class +} + +// An interface definition for the [Tensor] class. +type ITensor interface { + objc.IObject + Shape() *foundation.Array + DataType() mps.DataType + Operation() Operation +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensor?language=objc +type Tensor struct { + objc.Object +} + +func TensorFrom(ptr unsafe.Pointer) Tensor { + return Tensor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (tc _TensorClass) Alloc() Tensor { + rv := objc.Call[Tensor](tc, objc.Sel("alloc")) + return rv +} + +func Tensor_Alloc() Tensor { + return TensorClass.Alloc() +} + +func (tc _TensorClass) New() Tensor { + rv := objc.Call[Tensor](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTensor() Tensor { + return TensorClass.New() +} + +func (t_ Tensor) Init() Tensor { + rv := objc.Call[Tensor](t_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensor/3564666-shape?language=objc +func (t_ Tensor) Shape() *foundation.Array { + rv := objc.Call[*foundation.Array](t_, objc.Sel("shape")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensor/3564663-datatype?language=objc +func (t_ Tensor) DataType() mps.DataType { + rv := objc.Call[mps.DataType](t_, objc.Sel("dataType")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensor/3564665-operation?language=objc +func (t_ Tensor) Operation() Operation { + rv := objc.Call[Operation](t_, objc.Sel("operation")) + return rv +} diff --git a/macos/mpsgraph/tensor_data.gen.go b/macos/mpsgraph/tensor_data.gen.go new file mode 100644 index 00000000..30d90e63 --- /dev/null +++ b/macos/mpsgraph/tensor_data.gen.go @@ -0,0 +1,182 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/metal" + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TensorData] class. +var TensorDataClass = _TensorDataClass{objc.GetClass("MPSGraphTensorData")} + +type _TensorDataClass struct { + objc.Class +} + +// An interface definition for the [TensorData] class. +type ITensorData interface { + objc.IObject + Mpsndarray() mps.NDArray + Shape() *foundation.Array + Device() Device + DataType() mps.DataType +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata?language=objc +type TensorData struct { + objc.Object +} + +func TensorDataFrom(ptr unsafe.Pointer) TensorData { + return TensorData{ + Object: objc.ObjectFrom(ptr), + } +} + +func (t_ TensorData) InitWithMTLBufferShapeDataType(buffer metal.PBuffer, shape *foundation.Array, dataType mps.DataType) TensorData { + po0 := objc.WrapAsProtocol("MTLBuffer", buffer) + rv := objc.Call[TensorData](t_, objc.Sel("initWithMTLBuffer:shape:dataType:"), po0, shape, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564676-initwithmtlbuffer?language=objc +func NewTensorDataWithMTLBufferShapeDataType(buffer metal.PBuffer, shape *foundation.Array, dataType mps.DataType) TensorData { + instance := TensorDataClass.Alloc().InitWithMTLBufferShapeDataType(buffer, shape, dataType) + instance.Autorelease() + return instance +} + +func (t_ TensorData) InitWithMPSImageBatch(imageBatch *foundation.Array) TensorData { + rv := objc.Call[TensorData](t_, objc.Sel("initWithMPSImageBatch:"), imageBatch) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564672-initwithmpsimagebatch?language=objc +func NewTensorDataWithMPSImageBatch(imageBatch *foundation.Array) TensorData { + instance := TensorDataClass.Alloc().InitWithMPSImageBatch(imageBatch) + instance.Autorelease() + return instance +} + +func (t_ TensorData) InitWithMPSMatrix(matrix mps.IMatrix) TensorData { + rv := objc.Call[TensorData](t_, objc.Sel("initWithMPSMatrix:"), objc.Ptr(matrix)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564673-initwithmpsmatrix?language=objc +func NewTensorDataWithMPSMatrix(matrix mps.IMatrix) TensorData { + instance := TensorDataClass.Alloc().InitWithMPSMatrix(matrix) + instance.Autorelease() + return instance +} + +func (t_ TensorData) InitWithDeviceDataShapeDataType(device IDevice, data []byte, shape *foundation.Array, dataType mps.DataType) TensorData { + rv := objc.Call[TensorData](t_, objc.Sel("initWithDevice:data:shape:dataType:"), objc.Ptr(device), data, shape, dataType) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564671-initwithdevice?language=objc +func NewTensorDataWithDeviceDataShapeDataType(device IDevice, data []byte, shape *foundation.Array, dataType mps.DataType) TensorData { + instance := TensorDataClass.Alloc().InitWithDeviceDataShapeDataType(device, data, shape, dataType) + instance.Autorelease() + return instance +} + +func (t_ TensorData) InitWithMPSNDArray(ndarray mps.INDArray) TensorData { + rv := objc.Call[TensorData](t_, objc.Sel("initWithMPSNDArray:"), objc.Ptr(ndarray)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564674-initwithmpsndarray?language=objc +func NewTensorDataWithMPSNDArray(ndarray mps.INDArray) TensorData { + instance := TensorDataClass.Alloc().InitWithMPSNDArray(ndarray) + instance.Autorelease() + return instance +} + +func (t_ TensorData) InitWithMPSVector(vector mps.IVector) TensorData { + rv := objc.Call[TensorData](t_, objc.Sel("initWithMPSVector:"), objc.Ptr(vector)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564675-initwithmpsvector?language=objc +func NewTensorDataWithMPSVector(vector mps.IVector) TensorData { + instance := TensorDataClass.Alloc().InitWithMPSVector(vector) + instance.Autorelease() + return instance +} + +func (tc _TensorDataClass) Alloc() TensorData { + rv := objc.Call[TensorData](tc, objc.Sel("alloc")) + return rv +} + +func TensorData_Alloc() TensorData { + return TensorDataClass.Alloc() +} + +func (tc _TensorDataClass) New() TensorData { + rv := objc.Call[TensorData](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTensorData() TensorData { + return TensorDataClass.New() +} + +func (t_ TensorData) Init() TensorData { + rv := objc.Call[TensorData](t_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564677-mpsndarray?language=objc +func (t_ TensorData) Mpsndarray() mps.NDArray { + rv := objc.Call[mps.NDArray](t_, objc.Sel("mpsndarray")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564678-shape?language=objc +func (t_ TensorData) Shape() *foundation.Array { + rv := objc.Call[*foundation.Array](t_, objc.Sel("shape")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564670-device?language=objc +func (t_ TensorData) Device() Device { + rv := objc.Call[Device](t_, objc.Sel("device")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensordata/3564669-datatype?language=objc +func (t_ TensorData) DataType() mps.DataType { + rv := objc.Call[mps.DataType](t_, objc.Sel("dataType")) + return rv +} diff --git a/macos/mpsgraph/type.gen.go b/macos/mpsgraph/type.gen.go new file mode 100644 index 00000000..b5379534 --- /dev/null +++ b/macos/mpsgraph/type.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Type] class. +var TypeClass = _TypeClass{objc.GetClass("MPSGraphType")} + +type _TypeClass struct { + objc.Class +} + +// An interface definition for the [Type] class. +type IType interface { + objc.IObject +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtype?language=objc +type Type struct { + objc.Object +} + +func TypeFrom(ptr unsafe.Pointer) Type { + return Type{ + Object: objc.ObjectFrom(ptr), + } +} + +func (tc _TypeClass) Alloc() Type { + rv := objc.Call[Type](tc, objc.Sel("alloc")) + return rv +} + +func Type_Alloc() Type { + return TypeClass.Alloc() +} + +func (tc _TypeClass) New() Type { + rv := objc.Call[Type](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewType() Type { + return TypeClass.New() +} + +func (t_ Type) Init() Type { + rv := objc.Call[Type](t_, objc.Sel("init")) + return rv +} diff --git a/macos/mpsgraph/variable_op.gen.go b/macos/mpsgraph/variable_op.gen.go new file mode 100644 index 00000000..49ccaaf8 --- /dev/null +++ b/macos/mpsgraph/variable_op.gen.go @@ -0,0 +1,78 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package mpsgraph + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/mps" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VariableOp] class. +var VariableOpClass = _VariableOpClass{objc.GetClass("MPSGraphVariableOp")} + +type _VariableOpClass struct { + objc.Class +} + +// An interface definition for the [VariableOp] class. +type IVariableOp interface { + IOperation + Shape() *foundation.Array + DataType() mps.DataType +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphvariableop?language=objc +type VariableOp struct { + Operation +} + +func VariableOpFrom(ptr unsafe.Pointer) VariableOp { + return VariableOp{ + Operation: OperationFrom(ptr), + } +} + +func (vc _VariableOpClass) Alloc() VariableOp { + rv := objc.Call[VariableOp](vc, objc.Sel("alloc")) + return rv +} + +func VariableOp_Alloc() VariableOp { + return VariableOpClass.Alloc() +} + +func (vc _VariableOpClass) New() VariableOp { + rv := objc.Call[VariableOp](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVariableOp() VariableOp { + return VariableOpClass.New() +} + +func (v_ VariableOp) Init() VariableOp { + rv := objc.Call[VariableOp](v_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphvariableop/3564695-shape?language=objc +func (v_ VariableOp) Shape() *foundation.Array { + rv := objc.Call[*foundation.Array](v_, objc.Sel("shape")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphvariableop/3564693-datatype?language=objc +func (v_ VariableOp) DataType() mps.DataType { + rv := objc.Call[mps.DataType](v_, objc.Sel("dataType")) + return rv +} diff --git a/macos/quartz/aliastypes.gen.go b/macos/quartz/aliastypes.gen.go new file mode 100644 index 00000000..7b2a9209 --- /dev/null +++ b/macos/quartz/aliastypes.gen.go @@ -0,0 +1,19 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcplugintexturereleasecallback?language=objc +type PlugInTextureReleaseCallback = func(cgl_ctx objc.Object, name objc.Object, context unsafe.Pointer) + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcpluginbufferreleasecallback?language=objc +type PlugInBufferReleaseCallback = func(address unsafe.Pointer, context unsafe.Pointer) diff --git a/macos/quartz/camera_device_view.gen.go b/macos/quartz/camera_device_view.gen.go new file mode 100644 index 00000000..235b07f1 --- /dev/null +++ b/macos/quartz/camera_device_view.gen.go @@ -0,0 +1,433 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CameraDeviceView] class. +var CameraDeviceViewClass = _CameraDeviceViewClass{objc.GetClass("IKCameraDeviceView")} + +type _CameraDeviceViewClass struct { + objc.Class +} + +// An interface definition for the [CameraDeviceView] class. +type ICameraDeviceView interface { + appkit.IView + SetShowStatusInfoAsWindowSubtitle(value bool) + RotateRight(sender objc.IObject) objc.Object + SelectIndexesByExtendingSelection(indexes foundation.IIndexSet, extend bool) + SetCustomModeControl(control appkit.ISegmentedControl) + DownloadAllItems(sender objc.IObject) objc.Object + SetCustomActionControl(control appkit.ISegmentedControl) + RotateLeft(sender objc.IObject) objc.Object + DeleteSelectedItems(sender objc.IObject) objc.Object + SetCustomDeleteControl(control appkit.ISegmentedControl) + SetCustomIconSizeSlider(slider appkit.ISlider) + SetCustomRotateControl(control appkit.ISegmentedControl) + SelectedIndexes() foundation.IndexSet + DownloadSelectedItems(sender objc.IObject) objc.Object + DownloadsDirectory() foundation.URL + SetDownloadsDirectory(value foundation.IURL) + DownloadSelectedControlLabel() string + SetDownloadSelectedControlLabel(value string) + DisplaysDownloadsDirectoryControl() bool + SetDisplaysDownloadsDirectoryControl(value bool) + CanDownloadSelectedItems() bool + CanRotateSelectedItemsLeft() bool + DisplaysPostProcessApplicationControl() bool + SetDisplaysPostProcessApplicationControl(value bool) + DownloadAllControlLabel() string + SetDownloadAllControlLabel(value string) + IconSize() uint + SetIconSize(value uint) + TransferMode() CameraDeviceViewTransferMode + SetTransferMode(value CameraDeviceViewTransferMode) + Delegate() CameraDeviceViewDelegateWrapper + SetDelegate(value PCameraDeviceViewDelegate) + SetDelegateObject(valueObject objc.IObject) + PostProcessApplication() foundation.URL + SetPostProcessApplication(value foundation.IURL) + HasDisplayModeIcon() bool + SetHasDisplayModeIcon(value bool) + Mode() CameraDeviceViewDisplayMode + SetMode(value CameraDeviceViewDisplayMode) + CanRotateSelectedItemsRight() bool + CanDeleteSelectedItems() bool + HasDisplayModeTable() bool + SetHasDisplayModeTable(value bool) +} + +// The IKCameraDeviceView class displays the contents of the selected camera. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview?language=objc +type CameraDeviceView struct { + appkit.View +} + +func CameraDeviceViewFrom(ptr unsafe.Pointer) CameraDeviceView { + return CameraDeviceView{ + View: appkit.ViewFrom(ptr), + } +} + +func (cc _CameraDeviceViewClass) Alloc() CameraDeviceView { + rv := objc.Call[CameraDeviceView](cc, objc.Sel("alloc")) + return rv +} + +func CameraDeviceView_Alloc() CameraDeviceView { + return CameraDeviceViewClass.Alloc() +} + +func (cc _CameraDeviceViewClass) New() CameraDeviceView { + rv := objc.Call[CameraDeviceView](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCameraDeviceView() CameraDeviceView { + return CameraDeviceViewClass.New() +} + +func (c_ CameraDeviceView) Init() CameraDeviceView { + rv := objc.Call[CameraDeviceView](c_, objc.Sel("init")) + return rv +} + +func (c_ CameraDeviceView) InitWithFrame(frameRect foundation.Rect) CameraDeviceView { + rv := objc.Call[CameraDeviceView](c_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewCameraDeviceViewWithFrame(frameRect foundation.Rect) CameraDeviceView { + instance := CameraDeviceViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/3852628-setshowstatusinfoaswindowsubtitl?language=objc +func (c_ CameraDeviceView) SetShowStatusInfoAsWindowSubtitle(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setShowStatusInfoAsWindowSubtitle:"), value) +} + +// Rotates the selected image to the right. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1505123-rotateright?language=objc +func (c_ CameraDeviceView) RotateRight(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("rotateRight:"), sender) + return rv +} + +// Invoked to select the specified files, extending the selection if specified. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503804-selectindexes?language=objc +func (c_ CameraDeviceView) SelectIndexesByExtendingSelection(indexes foundation.IIndexSet, extend bool) { + objc.Call[objc.Void](c_, objc.Sel("selectIndexes:byExtendingSelection:"), objc.Ptr(indexes), extend) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/3852626-setcustommodecontrol?language=objc +func (c_ CameraDeviceView) SetCustomModeControl(control appkit.ISegmentedControl) { + objc.Call[objc.Void](c_, objc.Sel("setCustomModeControl:"), objc.Ptr(control)) +} + +// Downloads all the items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504326-downloadallitems?language=objc +func (c_ CameraDeviceView) DownloadAllItems(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("downloadAllItems:"), sender) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/3852623-setcustomactioncontrol?language=objc +func (c_ CameraDeviceView) SetCustomActionControl(control appkit.ISegmentedControl) { + objc.Call[objc.Void](c_, objc.Sel("setCustomActionControl:"), objc.Ptr(control)) +} + +// Rotates the selected image to the left. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503662-rotateleft?language=objc +func (c_ CameraDeviceView) RotateLeft(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("rotateLeft:"), sender) + return rv +} + +// Deletes the currently selected items. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504333-deleteselecteditems?language=objc +func (c_ CameraDeviceView) DeleteSelectedItems(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("deleteSelectedItems:"), sender) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/3852624-setcustomdeletecontrol?language=objc +func (c_ CameraDeviceView) SetCustomDeleteControl(control appkit.ISegmentedControl) { + objc.Call[objc.Void](c_, objc.Sel("setCustomDeleteControl:"), objc.Ptr(control)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/3852625-setcustomiconsizeslider?language=objc +func (c_ CameraDeviceView) SetCustomIconSizeSlider(slider appkit.ISlider) { + objc.Call[objc.Void](c_, objc.Sel("setCustomIconSizeSlider:"), objc.Ptr(slider)) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/3852627-setcustomrotatecontrol?language=objc +func (c_ CameraDeviceView) SetCustomRotateControl(control appkit.ISegmentedControl) { + objc.Call[objc.Void](c_, objc.Sel("setCustomRotateControl:"), objc.Ptr(control)) +} + +// The selected indexes of the camera files. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504546-selectedindexes?language=objc +func (c_ CameraDeviceView) SelectedIndexes() foundation.IndexSet { + rv := objc.Call[foundation.IndexSet](c_, objc.Sel("selectedIndexes")) + return rv +} + +// Deletes the selected items from the camera. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504833-downloadselecteditems?language=objc +func (c_ CameraDeviceView) DownloadSelectedItems(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("downloadSelectedItems:"), sender) + return rv +} + +// Specifies the directory where files are downloaded [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503702-downloadsdirectory?language=objc +func (c_ CameraDeviceView) DownloadsDirectory() foundation.URL { + rv := objc.Call[foundation.URL](c_, objc.Sel("downloadsDirectory")) + return rv +} + +// Specifies the directory where files are downloaded [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503702-downloadsdirectory?language=objc +func (c_ CameraDeviceView) SetDownloadsDirectory(value foundation.IURL) { + objc.Call[objc.Void](c_, objc.Sel("setDownloadsDirectory:"), objc.Ptr(value)) +} + +// Allows the “Download Selected” control to be renamed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503822-downloadselectedcontrollabel?language=objc +func (c_ CameraDeviceView) DownloadSelectedControlLabel() string { + rv := objc.Call[string](c_, objc.Sel("downloadSelectedControlLabel")) + return rv +} + +// Allows the “Download Selected” control to be renamed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503822-downloadselectedcontrollabel?language=objc +func (c_ CameraDeviceView) SetDownloadSelectedControlLabel(value string) { + objc.Call[objc.Void](c_, objc.Sel("setDownloadSelectedControlLabel:"), value) +} + +// Specifies whether the downloads directory control should be displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1505006-displaysdownloadsdirectorycontro?language=objc +func (c_ CameraDeviceView) DisplaysDownloadsDirectoryControl() bool { + rv := objc.Call[bool](c_, objc.Sel("displaysDownloadsDirectoryControl")) + return rv +} + +// Specifies whether the downloads directory control should be displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1505006-displaysdownloadsdirectorycontro?language=objc +func (c_ CameraDeviceView) SetDisplaysDownloadsDirectoryControl(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setDisplaysDownloadsDirectoryControl:"), value) +} + +// Returns whether the selected items can be downloaded [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504639-candownloadselecteditems?language=objc +func (c_ CameraDeviceView) CanDownloadSelectedItems() bool { + rv := objc.Call[bool](c_, objc.Sel("canDownloadSelectedItems")) + return rv +} + +// Returns whether the selected items can be rotated left. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503947-canrotateselecteditemsleft?language=objc +func (c_ CameraDeviceView) CanRotateSelectedItemsLeft() bool { + rv := objc.Call[bool](c_, objc.Sel("canRotateSelectedItemsLeft")) + return rv +} + +// Displays whether the post process application control should be displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503644-displayspostprocessapplicationco?language=objc +func (c_ CameraDeviceView) DisplaysPostProcessApplicationControl() bool { + rv := objc.Call[bool](c_, objc.Sel("displaysPostProcessApplicationControl")) + return rv +} + +// Displays whether the post process application control should be displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503644-displayspostprocessapplicationco?language=objc +func (c_ CameraDeviceView) SetDisplaysPostProcessApplicationControl(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setDisplaysPostProcessApplicationControl:"), value) +} + +// Allows the “Download All” control to be renamed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504281-downloadallcontrollabel?language=objc +func (c_ CameraDeviceView) DownloadAllControlLabel() string { + rv := objc.Call[string](c_, objc.Sel("downloadAllControlLabel")) + return rv +} + +// Allows the “Download All” control to be renamed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504281-downloadallcontrollabel?language=objc +func (c_ CameraDeviceView) SetDownloadAllControlLabel(value string) { + objc.Call[objc.Void](c_, objc.Sel("setDownloadAllControlLabel:"), value) +} + +// Specifies the icon size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504002-iconsize?language=objc +func (c_ CameraDeviceView) IconSize() uint { + rv := objc.Call[uint](c_, objc.Sel("iconSize")) + return rv +} + +// Specifies the icon size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504002-iconsize?language=objc +func (c_ CameraDeviceView) SetIconSize(value uint) { + objc.Call[objc.Void](c_, objc.Sel("setIconSize:"), value) +} + +// Determines how the contents are saved by the delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503771-transfermode?language=objc +func (c_ CameraDeviceView) TransferMode() CameraDeviceViewTransferMode { + rv := objc.Call[CameraDeviceViewTransferMode](c_, objc.Sel("transferMode")) + return rv +} + +// Determines how the contents are saved by the delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503771-transfermode?language=objc +func (c_ CameraDeviceView) SetTransferMode(value CameraDeviceViewTransferMode) { + objc.Call[objc.Void](c_, objc.Sel("setTransferMode:"), value) +} + +// The camera device view delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504315-delegate?language=objc +func (c_ CameraDeviceView) Delegate() CameraDeviceViewDelegateWrapper { + rv := objc.Call[CameraDeviceViewDelegateWrapper](c_, objc.Sel("delegate")) + return rv +} + +// The camera device view delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504315-delegate?language=objc +func (c_ CameraDeviceView) SetDelegate(value PCameraDeviceViewDelegate) { + po0 := objc.WrapAsProtocol("IKCameraDeviceViewDelegate", value) + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), po0) +} + +// The camera device view delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504315-delegate?language=objc +func (c_ CameraDeviceView) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// The URL of the application used to post process the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504227-postprocessapplication?language=objc +func (c_ CameraDeviceView) PostProcessApplication() foundation.URL { + rv := objc.Call[foundation.URL](c_, objc.Sel("postProcessApplication")) + return rv +} + +// The URL of the application used to post process the image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504227-postprocessapplication?language=objc +func (c_ CameraDeviceView) SetPostProcessApplication(value foundation.IURL) { + objc.Call[objc.Void](c_, objc.Sel("setPostProcessApplication:"), objc.Ptr(value)) +} + +// Returns whether the device view is being displayed in icon mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504417-hasdisplaymodeicon?language=objc +func (c_ CameraDeviceView) HasDisplayModeIcon() bool { + rv := objc.Call[bool](c_, objc.Sel("hasDisplayModeIcon")) + return rv +} + +// Returns whether the device view is being displayed in icon mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504417-hasdisplaymodeicon?language=objc +func (c_ CameraDeviceView) SetHasDisplayModeIcon(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setHasDisplayModeIcon:"), value) +} + +// Specifies the display mode of the camera device view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504881-mode?language=objc +func (c_ CameraDeviceView) Mode() CameraDeviceViewDisplayMode { + rv := objc.Call[CameraDeviceViewDisplayMode](c_, objc.Sel("mode")) + return rv +} + +// Specifies the display mode of the camera device view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504881-mode?language=objc +func (c_ CameraDeviceView) SetMode(value CameraDeviceViewDisplayMode) { + objc.Call[objc.Void](c_, objc.Sel("setMode:"), value) +} + +// Returns whether the selected items can be rotated right. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503525-canrotateselecteditemsright?language=objc +func (c_ CameraDeviceView) CanRotateSelectedItemsRight() bool { + rv := objc.Call[bool](c_, objc.Sel("canRotateSelectedItemsRight")) + return rv +} + +// Returns whether the selected items can be deleted. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1504949-candeleteselecteditems?language=objc +func (c_ CameraDeviceView) CanDeleteSelectedItems() bool { + rv := objc.Call[bool](c_, objc.Sel("canDeleteSelectedItems")) + return rv +} + +// Returns whether the device view is being displayed in table mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503413-hasdisplaymodetable?language=objc +func (c_ CameraDeviceView) HasDisplayModeTable() bool { + rv := objc.Call[bool](c_, objc.Sel("hasDisplayModeTable")) + return rv +} + +// Returns whether the device view is being displayed in table mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceview/1503413-hasdisplaymodetable?language=objc +func (c_ CameraDeviceView) SetHasDisplayModeTable(value bool) { + objc.Call[objc.Void](c_, objc.Sel("setHasDisplayModeTable:"), value) +} diff --git a/macos/quartz/camera_device_view_delegate.gen.go b/macos/quartz/camera_device_view_delegate.gen.go new file mode 100644 index 00000000..106fe6ac --- /dev/null +++ b/macos/quartz/camera_device_view_delegate.gen.go @@ -0,0 +1,89 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The IKCameraDeviceViewDelegate protocol is adopted by the delegate of the IKCameraDeviceView class. It allows downloading of camera content, handling selection changes, and handling errors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdelegate?language=objc +type PCameraDeviceViewDelegate interface { + // optional + CameraDeviceViewDidEncounterError(cameraDeviceView CameraDeviceView, error foundation.Error) + HasCameraDeviceViewDidEncounterError() bool + + // optional + CameraDeviceViewSelectionDidChange(cameraDeviceView CameraDeviceView) + HasCameraDeviceViewSelectionDidChange() bool +} + +// A delegate implementation builder for the [PCameraDeviceViewDelegate] protocol. +type CameraDeviceViewDelegate struct { + _CameraDeviceViewDidEncounterError func(cameraDeviceView CameraDeviceView, error foundation.Error) + _CameraDeviceViewSelectionDidChange func(cameraDeviceView CameraDeviceView) +} + +func (di *CameraDeviceViewDelegate) HasCameraDeviceViewDidEncounterError() bool { + return di._CameraDeviceViewDidEncounterError != nil +} + +// Invoked when the camera encounters an error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdelegate/1505239-cameradeviceview?language=objc +func (di *CameraDeviceViewDelegate) SetCameraDeviceViewDidEncounterError(f func(cameraDeviceView CameraDeviceView, error foundation.Error)) { + di._CameraDeviceViewDidEncounterError = f +} + +// Invoked when the camera encounters an error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdelegate/1505239-cameradeviceview?language=objc +func (di *CameraDeviceViewDelegate) CameraDeviceViewDidEncounterError(cameraDeviceView CameraDeviceView, error foundation.Error) { + di._CameraDeviceViewDidEncounterError(cameraDeviceView, error) +} +func (di *CameraDeviceViewDelegate) HasCameraDeviceViewSelectionDidChange() bool { + return di._CameraDeviceViewSelectionDidChange != nil +} + +// Invoked when the selection changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdelegate/1505308-cameradeviceviewselectiondidchan?language=objc +func (di *CameraDeviceViewDelegate) SetCameraDeviceViewSelectionDidChange(f func(cameraDeviceView CameraDeviceView)) { + di._CameraDeviceViewSelectionDidChange = f +} + +// Invoked when the selection changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdelegate/1505308-cameradeviceviewselectiondidchan?language=objc +func (di *CameraDeviceViewDelegate) CameraDeviceViewSelectionDidChange(cameraDeviceView CameraDeviceView) { + di._CameraDeviceViewSelectionDidChange(cameraDeviceView) +} + +// A concrete type wrapper for the [PCameraDeviceViewDelegate] protocol. +type CameraDeviceViewDelegateWrapper struct { + objc.Object +} + +func (c_ CameraDeviceViewDelegateWrapper) HasCameraDeviceViewDidEncounterError() bool { + return c_.RespondsToSelector(objc.Sel("cameraDeviceView:didEncounterError:")) +} + +// Invoked when the camera encounters an error. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdelegate/1505239-cameradeviceview?language=objc +func (c_ CameraDeviceViewDelegateWrapper) CameraDeviceViewDidEncounterError(cameraDeviceView ICameraDeviceView, error foundation.IError) { + objc.Call[objc.Void](c_, objc.Sel("cameraDeviceView:didEncounterError:"), objc.Ptr(cameraDeviceView), objc.Ptr(error)) +} + +func (c_ CameraDeviceViewDelegateWrapper) HasCameraDeviceViewSelectionDidChange() bool { + return c_.RespondsToSelector(objc.Sel("cameraDeviceViewSelectionDidChange:")) +} + +// Invoked when the selection changed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdelegate/1505308-cameradeviceviewselectiondidchan?language=objc +func (c_ CameraDeviceViewDelegateWrapper) CameraDeviceViewSelectionDidChange(cameraDeviceView ICameraDeviceView) { + objc.Call[objc.Void](c_, objc.Sel("cameraDeviceViewSelectionDidChange:"), objc.Ptr(cameraDeviceView)) +} diff --git a/macos/quartz/composition.gen.go b/macos/quartz/composition.gen.go new file mode 100644 index 00000000..db5e47a1 --- /dev/null +++ b/macos/quartz/composition.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Composition] class. +var CompositionClass = _CompositionClass{objc.GetClass("QCComposition")} + +type _CompositionClass struct { + objc.Class +} + +// An interface definition for the [Composition] class. +type IComposition interface { + objc.IObject +} + +// The QCComposition class represents a Quartz Composer composition that either: [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qccomposition?language=objc +type Composition struct { + objc.Object +} + +func CompositionFrom(ptr unsafe.Pointer) Composition { + return Composition{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CompositionClass) Alloc() Composition { + rv := objc.Call[Composition](cc, objc.Sel("alloc")) + return rv +} + +func Composition_Alloc() Composition { + return CompositionClass.Alloc() +} + +func (cc _CompositionClass) New() Composition { + rv := objc.Call[Composition](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewComposition() Composition { + return CompositionClass.New() +} + +func (c_ Composition) Init() Composition { + rv := objc.Call[Composition](c_, objc.Sel("init")) + return rv +} diff --git a/macos/quartz/composition_layer.gen.go b/macos/quartz/composition_layer.gen.go new file mode 100644 index 00000000..b3aa0bae --- /dev/null +++ b/macos/quartz/composition_layer.gen.go @@ -0,0 +1,113 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionLayer] class. +var CompositionLayerClass = _CompositionLayerClass{objc.GetClass("QCCompositionLayer")} + +type _CompositionLayerClass struct { + objc.Class +} + +// An interface definition for the [CompositionLayer] class. +type ICompositionLayer interface { + quartzcore.IOpenGLLayer +} + +// A layer that loads, plays, and controls Quartz Composer compositions in a Core Animation layer hierarchy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qccompositionlayer?language=objc +type CompositionLayer struct { + quartzcore.OpenGLLayer +} + +func CompositionLayerFrom(ptr unsafe.Pointer) CompositionLayer { + return CompositionLayer{ + OpenGLLayer: quartzcore.OpenGLLayerFrom(ptr), + } +} + +func (cc _CompositionLayerClass) Alloc() CompositionLayer { + rv := objc.Call[CompositionLayer](cc, objc.Sel("alloc")) + return rv +} + +func CompositionLayer_Alloc() CompositionLayer { + return CompositionLayerClass.Alloc() +} + +func (cc _CompositionLayerClass) New() CompositionLayer { + rv := objc.Call[CompositionLayer](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionLayer() CompositionLayer { + return CompositionLayerClass.New() +} + +func (c_ CompositionLayer) Init() CompositionLayer { + rv := objc.Call[CompositionLayer](c_, objc.Sel("init")) + return rv +} + +func (cc _CompositionLayerClass) Layer() CompositionLayer { + rv := objc.Call[CompositionLayer](cc, objc.Sel("layer")) + return rv +} + +// Creates and returns an instance of the layer object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410793-layer?language=objc +func CompositionLayer_Layer() CompositionLayer { + return CompositionLayerClass.Layer() +} + +func (c_ CompositionLayer) InitWithLayer(layer objc.IObject) CompositionLayer { + rv := objc.Call[CompositionLayer](c_, objc.Sel("initWithLayer:"), layer) + return rv +} + +// Override to copy or initialize custom fields of the specified layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410842-initwithlayer?language=objc +func NewCompositionLayerWithLayer(layer objc.IObject) CompositionLayer { + instance := CompositionLayerClass.Alloc().InitWithLayer(layer) + instance.Autorelease() + return instance +} + +func (c_ CompositionLayer) ModelLayer() CompositionLayer { + rv := objc.Call[CompositionLayer](c_, objc.Sel("modelLayer")) + return rv +} + +// Returns the model layer object associated with the receiver, if any. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410853-modellayer?language=objc +func CompositionLayer_ModelLayer() CompositionLayer { + instance := CompositionLayerClass.Alloc().ModelLayer() + instance.Autorelease() + return instance +} + +func (c_ CompositionLayer) PresentationLayer() CompositionLayer { + rv := objc.Call[CompositionLayer](c_, objc.Sel("presentationLayer")) + return rv +} + +// Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartzcore/calayer/1410744-presentationlayer?language=objc +func CompositionLayer_PresentationLayer() CompositionLayer { + instance := CompositionLayerClass.Alloc().PresentationLayer() + instance.Autorelease() + return instance +} diff --git a/macos/quartz/composition_parameter_view.gen.go b/macos/quartz/composition_parameter_view.gen.go new file mode 100644 index 00000000..0fc72b54 --- /dev/null +++ b/macos/quartz/composition_parameter_view.gen.go @@ -0,0 +1,74 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionParameterView] class. +var CompositionParameterViewClass = _CompositionParameterViewClass{objc.GetClass("QCCompositionParameterView")} + +type _CompositionParameterViewClass struct { + objc.Class +} + +// An interface definition for the [CompositionParameterView] class. +type ICompositionParameterView interface { + appkit.IView +} + +// A class that allows users to edit the input parameters of a composition in real time. The composition can be rendering in any of the following objects: QCRenderer, QCView, or QCCompositionLayer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qccompositionparameterview?language=objc +type CompositionParameterView struct { + appkit.View +} + +func CompositionParameterViewFrom(ptr unsafe.Pointer) CompositionParameterView { + return CompositionParameterView{ + View: appkit.ViewFrom(ptr), + } +} + +func (cc _CompositionParameterViewClass) Alloc() CompositionParameterView { + rv := objc.Call[CompositionParameterView](cc, objc.Sel("alloc")) + return rv +} + +func CompositionParameterView_Alloc() CompositionParameterView { + return CompositionParameterViewClass.Alloc() +} + +func (cc _CompositionParameterViewClass) New() CompositionParameterView { + rv := objc.Call[CompositionParameterView](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionParameterView() CompositionParameterView { + return CompositionParameterViewClass.New() +} + +func (c_ CompositionParameterView) Init() CompositionParameterView { + rv := objc.Call[CompositionParameterView](c_, objc.Sel("init")) + return rv +} + +func (c_ CompositionParameterView) InitWithFrame(frameRect foundation.Rect) CompositionParameterView { + rv := objc.Call[CompositionParameterView](c_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewCompositionParameterViewWithFrame(frameRect foundation.Rect) CompositionParameterView { + instance := CompositionParameterViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} diff --git a/macos/quartz/composition_picker_panel.gen.go b/macos/quartz/composition_picker_panel.gen.go new file mode 100644 index 00000000..4865c8bb --- /dev/null +++ b/macos/quartz/composition_picker_panel.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionPickerPanel] class. +var CompositionPickerPanelClass = _CompositionPickerPanelClass{objc.GetClass("QCCompositionPickerPanel")} + +type _CompositionPickerPanelClass struct { + objc.Class +} + +// An interface definition for the [CompositionPickerPanel] class. +type ICompositionPickerPanel interface { + appkit.IPanel +} + +// The QCCompositionPickerPanel class represents a utility window that allows users to browse compositions that are in the Quartz Composer composition repository and, if supported, preview the composition. The QCCompositionPickerPanel class cannot be subclassed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qccompositionpickerpanel?language=objc +type CompositionPickerPanel struct { + appkit.Panel +} + +func CompositionPickerPanelFrom(ptr unsafe.Pointer) CompositionPickerPanel { + return CompositionPickerPanel{ + Panel: appkit.PanelFrom(ptr), + } +} + +func (cc _CompositionPickerPanelClass) Alloc() CompositionPickerPanel { + rv := objc.Call[CompositionPickerPanel](cc, objc.Sel("alloc")) + return rv +} + +func CompositionPickerPanel_Alloc() CompositionPickerPanel { + return CompositionPickerPanelClass.Alloc() +} + +func (cc _CompositionPickerPanelClass) New() CompositionPickerPanel { + rv := objc.Call[CompositionPickerPanel](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionPickerPanel() CompositionPickerPanel { + return CompositionPickerPanelClass.New() +} + +func (c_ CompositionPickerPanel) Init() CompositionPickerPanel { + rv := objc.Call[CompositionPickerPanel](c_, objc.Sel("init")) + return rv +} + +func (cc _CompositionPickerPanelClass) WindowWithContentViewController(contentViewController appkit.IViewController) CompositionPickerPanel { + rv := objc.Call[CompositionPickerPanel](cc, objc.Sel("windowWithContentViewController:"), objc.Ptr(contentViewController)) + return rv +} + +// Creates a titled window that contains the specified content view controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419551-windowwithcontentviewcontroller?language=objc +func CompositionPickerPanel_WindowWithContentViewController(contentViewController appkit.IViewController) CompositionPickerPanel { + return CompositionPickerPanelClass.WindowWithContentViewController(contentViewController) +} + +func (c_ CompositionPickerPanel) InitWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) CompositionPickerPanel { + rv := objc.Call[CompositionPickerPanel](c_, objc.Sel("initWithContentRect:styleMask:backing:defer:screen:"), contentRect, style, backingStoreType, flag, objc.Ptr(screen)) + return rv +} + +// Initializes an allocated window with the specified values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419755-initwithcontentrect?language=objc +func NewCompositionPickerPanelWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) CompositionPickerPanel { + instance := CompositionPickerPanelClass.Alloc().InitWithContentRectStyleMaskBackingDeferScreen(contentRect, style, backingStoreType, flag, screen) + instance.Autorelease() + return instance +} diff --git a/macos/quartz/composition_picker_view.gen.go b/macos/quartz/composition_picker_view.gen.go new file mode 100644 index 00000000..7a770101 --- /dev/null +++ b/macos/quartz/composition_picker_view.gen.go @@ -0,0 +1,74 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionPickerView] class. +var CompositionPickerViewClass = _CompositionPickerViewClass{objc.GetClass("QCCompositionPickerView")} + +type _CompositionPickerViewClass struct { + objc.Class +} + +// An interface definition for the [CompositionPickerView] class. +type ICompositionPickerView interface { + appkit.IView +} + +// The QCCompositionPickerView class allows users to browse compositions that are in the Quartz Composer composition repository, and to preview them. You can set the default input parameters for a composition preview by using the method setDefaultValue:forInputKey:. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qccompositionpickerview?language=objc +type CompositionPickerView struct { + appkit.View +} + +func CompositionPickerViewFrom(ptr unsafe.Pointer) CompositionPickerView { + return CompositionPickerView{ + View: appkit.ViewFrom(ptr), + } +} + +func (cc _CompositionPickerViewClass) Alloc() CompositionPickerView { + rv := objc.Call[CompositionPickerView](cc, objc.Sel("alloc")) + return rv +} + +func CompositionPickerView_Alloc() CompositionPickerView { + return CompositionPickerViewClass.Alloc() +} + +func (cc _CompositionPickerViewClass) New() CompositionPickerView { + rv := objc.Call[CompositionPickerView](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionPickerView() CompositionPickerView { + return CompositionPickerViewClass.New() +} + +func (c_ CompositionPickerView) Init() CompositionPickerView { + rv := objc.Call[CompositionPickerView](c_, objc.Sel("init")) + return rv +} + +func (c_ CompositionPickerView) InitWithFrame(frameRect foundation.Rect) CompositionPickerView { + rv := objc.Call[CompositionPickerView](c_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewCompositionPickerViewWithFrame(frameRect foundation.Rect) CompositionPickerView { + instance := CompositionPickerViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} diff --git a/macos/quartz/composition_renderer.gen.go b/macos/quartz/composition_renderer.gen.go new file mode 100644 index 00000000..9d56da8a --- /dev/null +++ b/macos/quartz/composition_renderer.gen.go @@ -0,0 +1,18 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/objc" +) + +// The QCRenderer protocol defines the methods used to pass data to the input ports or retrieve data from the output ports of the root patch of a Quartz Composer composition. This protocol is adopted by the QCRenderer, QCView, and QCCompositionLayer classes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qccompositionrenderer?language=objc +type PCompositionRenderer interface { +} + +// A concrete type wrapper for the [PCompositionRenderer] protocol. +type CompositionRendererWrapper struct { + objc.Object +} diff --git a/macos/quartz/composition_repository.gen.go b/macos/quartz/composition_repository.gen.go new file mode 100644 index 00000000..8c3cc364 --- /dev/null +++ b/macos/quartz/composition_repository.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CompositionRepository] class. +var CompositionRepositoryClass = _CompositionRepositoryClass{objc.GetClass("QCCompositionRepository")} + +type _CompositionRepositoryClass struct { + objc.Class +} + +// An interface definition for the [CompositionRepository] class. +type ICompositionRepository interface { + objc.IObject +} + +// The QCCompositionRepository class represents a system-wide centralized repository of built-in and installed Quartz Composer compositions (/Library/Compositions and ~/Library/Compositions). The QCCompositionRepository class cannot be subclassed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qccompositionrepository?language=objc +type CompositionRepository struct { + objc.Object +} + +func CompositionRepositoryFrom(ptr unsafe.Pointer) CompositionRepository { + return CompositionRepository{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CompositionRepositoryClass) Alloc() CompositionRepository { + rv := objc.Call[CompositionRepository](cc, objc.Sel("alloc")) + return rv +} + +func CompositionRepository_Alloc() CompositionRepository { + return CompositionRepositoryClass.Alloc() +} + +func (cc _CompositionRepositoryClass) New() CompositionRepository { + rv := objc.Call[CompositionRepository](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCompositionRepository() CompositionRepository { + return CompositionRepositoryClass.New() +} + +func (c_ CompositionRepository) Init() CompositionRepository { + rv := objc.Call[CompositionRepository](c_, objc.Sel("init")) + return rv +} diff --git a/macos/quartz/device_browser_view.gen.go b/macos/quartz/device_browser_view.gen.go new file mode 100644 index 00000000..4b567b8d --- /dev/null +++ b/macos/quartz/device_browser_view.gen.go @@ -0,0 +1,185 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DeviceBrowserView] class. +var DeviceBrowserViewClass = _DeviceBrowserViewClass{objc.GetClass("IKDeviceBrowserView")} + +type _DeviceBrowserViewClass struct { + objc.Class +} + +// An interface definition for the [DeviceBrowserView] class. +type IDeviceBrowserView interface { + appkit.IView + DisplaysNetworkCameras() bool + SetDisplaysNetworkCameras(value bool) + Delegate() DeviceBrowserViewDelegateWrapper + SetDelegate(value PDeviceBrowserViewDelegate) + SetDelegateObject(valueObject objc.IObject) + DisplaysNetworkScanners() bool + SetDisplaysNetworkScanners(value bool) + DisplaysLocalCameras() bool + SetDisplaysLocalCameras(value bool) + Mode() DeviceBrowserViewDisplayMode + SetMode(value DeviceBrowserViewDisplayMode) + DisplaysLocalScanners() bool + SetDisplaysLocalScanners(value bool) +} + +// The IKDeviceBrowserView allows you to select a camera or scanner from a list of the available devices. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview?language=objc +type DeviceBrowserView struct { + appkit.View +} + +func DeviceBrowserViewFrom(ptr unsafe.Pointer) DeviceBrowserView { + return DeviceBrowserView{ + View: appkit.ViewFrom(ptr), + } +} + +func (dc _DeviceBrowserViewClass) Alloc() DeviceBrowserView { + rv := objc.Call[DeviceBrowserView](dc, objc.Sel("alloc")) + return rv +} + +func DeviceBrowserView_Alloc() DeviceBrowserView { + return DeviceBrowserViewClass.Alloc() +} + +func (dc _DeviceBrowserViewClass) New() DeviceBrowserView { + rv := objc.Call[DeviceBrowserView](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDeviceBrowserView() DeviceBrowserView { + return DeviceBrowserViewClass.New() +} + +func (d_ DeviceBrowserView) Init() DeviceBrowserView { + rv := objc.Call[DeviceBrowserView](d_, objc.Sel("init")) + return rv +} + +func (d_ DeviceBrowserView) InitWithFrame(frameRect foundation.Rect) DeviceBrowserView { + rv := objc.Call[DeviceBrowserView](d_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewDeviceBrowserViewWithFrame(frameRect foundation.Rect) DeviceBrowserView { + instance := DeviceBrowserViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// Specifies whether network cameras are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443056-displaysnetworkcameras?language=objc +func (d_ DeviceBrowserView) DisplaysNetworkCameras() bool { + rv := objc.Call[bool](d_, objc.Sel("displaysNetworkCameras")) + return rv +} + +// Specifies whether network cameras are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443056-displaysnetworkcameras?language=objc +func (d_ DeviceBrowserView) SetDisplaysNetworkCameras(value bool) { + objc.Call[objc.Void](d_, objc.Sel("setDisplaysNetworkCameras:"), value) +} + +// Specifies the delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443054-delegate?language=objc +func (d_ DeviceBrowserView) Delegate() DeviceBrowserViewDelegateWrapper { + rv := objc.Call[DeviceBrowserViewDelegateWrapper](d_, objc.Sel("delegate")) + return rv +} + +// Specifies the delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443054-delegate?language=objc +func (d_ DeviceBrowserView) SetDelegate(value PDeviceBrowserViewDelegate) { + po0 := objc.WrapAsProtocol("IKDeviceBrowserViewDelegate", value) + objc.Call[objc.Void](d_, objc.Sel("setDelegate:"), po0) +} + +// Specifies the delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443054-delegate?language=objc +func (d_ DeviceBrowserView) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](d_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// Specifies whether network scanners are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443078-displaysnetworkscanners?language=objc +func (d_ DeviceBrowserView) DisplaysNetworkScanners() bool { + rv := objc.Call[bool](d_, objc.Sel("displaysNetworkScanners")) + return rv +} + +// Specifies whether network scanners are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443078-displaysnetworkscanners?language=objc +func (d_ DeviceBrowserView) SetDisplaysNetworkScanners(value bool) { + objc.Call[objc.Void](d_, objc.Sel("setDisplaysNetworkScanners:"), value) +} + +// Specifies whether local cameras are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443061-displayslocalcameras?language=objc +func (d_ DeviceBrowserView) DisplaysLocalCameras() bool { + rv := objc.Call[bool](d_, objc.Sel("displaysLocalCameras")) + return rv +} + +// Specifies whether local cameras are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443061-displayslocalcameras?language=objc +func (d_ DeviceBrowserView) SetDisplaysLocalCameras(value bool) { + objc.Call[objc.Void](d_, objc.Sel("setDisplaysLocalCameras:"), value) +} + +// Specifies the browser display mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443080-mode?language=objc +func (d_ DeviceBrowserView) Mode() DeviceBrowserViewDisplayMode { + rv := objc.Call[DeviceBrowserViewDisplayMode](d_, objc.Sel("mode")) + return rv +} + +// Specifies the browser display mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443080-mode?language=objc +func (d_ DeviceBrowserView) SetMode(value DeviceBrowserViewDisplayMode) { + objc.Call[objc.Void](d_, objc.Sel("setMode:"), value) +} + +// Specifies whether local scanners are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443052-displayslocalscanners?language=objc +func (d_ DeviceBrowserView) DisplaysLocalScanners() bool { + rv := objc.Call[bool](d_, objc.Sel("displaysLocalScanners")) + return rv +} + +// Specifies whether local scanners are displayed by the browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserview/1443052-displayslocalscanners?language=objc +func (d_ DeviceBrowserView) SetDisplaysLocalScanners(value bool) { + objc.Call[objc.Void](d_, objc.Sel("setDisplaysLocalScanners:"), value) +} diff --git a/macos/quartz/device_browser_view_delegate.gen.go b/macos/quartz/device_browser_view_delegate.gen.go new file mode 100644 index 00000000..ddaabe42 --- /dev/null +++ b/macos/quartz/device_browser_view_delegate.gen.go @@ -0,0 +1,22 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/objc" +) + +// The IKDeviceBrowserViewDelegate defines the methods that the delegate of the IKDeviceBrowserView class can implement. All the methods are optional. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserviewdelegate?language=objc +type PDeviceBrowserViewDelegate interface { +} + +// A delegate implementation builder for the [PDeviceBrowserViewDelegate] protocol. +type DeviceBrowserViewDelegate struct { +} + +// A concrete type wrapper for the [PDeviceBrowserViewDelegate] protocol. +type DeviceBrowserViewDelegateWrapper struct { + objc.Object +} diff --git a/macos/quartz/doc.gen.go b/macos/quartz/doc.gen.go new file mode 100644 index 00000000..b72004df --- /dev/null +++ b/macos/quartz/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Allow users to browse, edit, and save images, using slideshows and Core Image filters. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/quartz?language=objc +package quartz diff --git a/macos/quartz/enumtypes.gen.go b/macos/quartz/enumtypes.gen.go new file mode 100644 index 00000000..4ef26305 --- /dev/null +++ b/macos/quartz/enumtypes.gen.go @@ -0,0 +1,99 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +// These constants specify the display mode used by the camera view. These constants are used by mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewdisplaymode?language=objc +type CameraDeviceViewDisplayMode int + +const ( + CameraDeviceViewDisplayModeIcon CameraDeviceViewDisplayMode = 1 + CameraDeviceViewDisplayModeNone CameraDeviceViewDisplayMode = -1 + CameraDeviceViewDisplayModeTable CameraDeviceViewDisplayMode = 0 +) + +// These constants specify the transfer mode used by the camera view. These constants are used by mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikcameradeviceviewtransfermode?language=objc +type CameraDeviceViewTransferMode int + +const ( + CameraDeviceViewTransferModeFileBased CameraDeviceViewTransferMode = 0 + CameraDeviceViewTransferModeMemoryBased CameraDeviceViewTransferMode = 1 +) + +// These constants specify the display mode of the device browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikdevicebrowserviewdisplaymode?language=objc +type DeviceBrowserViewDisplayMode int + +const ( + DeviceBrowserViewDisplayModeIcon DeviceBrowserViewDisplayMode = 2 + DeviceBrowserViewDisplayModeOutline DeviceBrowserViewDisplayMode = 1 + DeviceBrowserViewDisplayModeTable DeviceBrowserViewDisplayMode = 0 +) + +// The possible states for the browser cell. These values are used by the cellState method. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercellstate?language=objc +type ImageBrowserCellState int + +const ( + ImageStateInvalid ImageBrowserCellState = 1 + ImageStateNoImage ImageBrowserCellState = 0 + ImageStateReady ImageBrowserCellState = 2 +) + +// These constants specify the locations for dropping items onto the browser view. Used by the method setDropIndex:dropOperation:. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowserdropoperation?language=objc +type ImageBrowserDropOperation int + +const ( + ImageBrowserDropBefore ImageBrowserDropOperation = 1 + ImageBrowserDropOn ImageBrowserDropOperation = 0 +) + +// These constants specify the display mode the scanner view will use. They are used by the mode property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceviewdisplaymode?language=objc +type ScannerDeviceViewDisplayMode int + +const ( + ScannerDeviceViewDisplayModeAdvanced ScannerDeviceViewDisplayMode = 1 + ScannerDeviceViewDisplayModeNone ScannerDeviceViewDisplayMode = -1 + ScannerDeviceViewDisplayModeSimple ScannerDeviceViewDisplayMode = 0 +) + +// These constants determine how the scanner data is returned to the delegate. They are used by the transferMode property. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceviewtransfermode?language=objc +type ScannerDeviceViewTransferMode int + +const ( + ScannerDeviceViewTransferModeFileBased ScannerDeviceViewTransferMode = 0 + ScannerDeviceViewTransferModeMemoryBased ScannerDeviceViewTransferMode = 1 +) + +// Execution modes for custom patches. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcpluginexecutionmode?language=objc +type PlugInExecutionMode int + +const ( + KPlugInExecutionModeConsumer PlugInExecutionMode = 3 + KPlugInExecutionModeProcessor PlugInExecutionMode = 2 + KPlugInExecutionModeProvider PlugInExecutionMode = 1 +) + +// Time modes for custom patches. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcplugintimemode?language=objc +type PlugInTimeMode int + +const ( + KPlugInTimeModeIdle PlugInTimeMode = 1 + KPlugInTimeModeNone PlugInTimeMode = 0 + KPlugInTimeModeTimeBase PlugInTimeMode = 2 +) diff --git a/macos/quartz/filter_browser_panel.gen.go b/macos/quartz/filter_browser_panel.gen.go new file mode 100644 index 00000000..ccd61d68 --- /dev/null +++ b/macos/quartz/filter_browser_panel.gen.go @@ -0,0 +1,152 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FilterBrowserPanel] class. +var FilterBrowserPanelClass = _FilterBrowserPanelClass{objc.GetClass("IKFilterBrowserPanel")} + +type _FilterBrowserPanelClass struct { + objc.Class +} + +// An interface definition for the [FilterBrowserPanel] class. +type IFilterBrowserPanel interface { + appkit.IPanel + BeginWithOptionsModelessDelegateDidEndSelectorContextInfo(inOptions foundation.Dictionary, modelessDelegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) + FilterBrowserViewWithOptions(inOptions foundation.Dictionary) FilterBrowserView + FilterName() string + BeginSheetWithOptionsModalForWindowModalDelegateDidEndSelectorContextInfo(inOptions foundation.Dictionary, docWindow appkit.IWindow, modalDelegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) + Finish(sender objc.IObject) + RunModalWithOptions(inOptions foundation.Dictionary) int +} + +// The IKFilterBrowserPanel class provides a user interface that allows users to browse Core Image filters (CIFilter), to preview a filter, and to get additional information about the filter, such as its description. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel?language=objc +type FilterBrowserPanel struct { + appkit.Panel +} + +func FilterBrowserPanelFrom(ptr unsafe.Pointer) FilterBrowserPanel { + return FilterBrowserPanel{ + Panel: appkit.PanelFrom(ptr), + } +} + +func (fc _FilterBrowserPanelClass) Alloc() FilterBrowserPanel { + rv := objc.Call[FilterBrowserPanel](fc, objc.Sel("alloc")) + return rv +} + +func FilterBrowserPanel_Alloc() FilterBrowserPanel { + return FilterBrowserPanelClass.Alloc() +} + +func (fc _FilterBrowserPanelClass) New() FilterBrowserPanel { + rv := objc.Call[FilterBrowserPanel](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFilterBrowserPanel() FilterBrowserPanel { + return FilterBrowserPanelClass.New() +} + +func (f_ FilterBrowserPanel) Init() FilterBrowserPanel { + rv := objc.Call[FilterBrowserPanel](f_, objc.Sel("init")) + return rv +} + +func (fc _FilterBrowserPanelClass) WindowWithContentViewController(contentViewController appkit.IViewController) FilterBrowserPanel { + rv := objc.Call[FilterBrowserPanel](fc, objc.Sel("windowWithContentViewController:"), objc.Ptr(contentViewController)) + return rv +} + +// Creates a titled window that contains the specified content view controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419551-windowwithcontentviewcontroller?language=objc +func FilterBrowserPanel_WindowWithContentViewController(contentViewController appkit.IViewController) FilterBrowserPanel { + return FilterBrowserPanelClass.WindowWithContentViewController(contentViewController) +} + +func (f_ FilterBrowserPanel) InitWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) FilterBrowserPanel { + rv := objc.Call[FilterBrowserPanel](f_, objc.Sel("initWithContentRect:styleMask:backing:defer:screen:"), contentRect, style, backingStoreType, flag, objc.Ptr(screen)) + return rv +} + +// Initializes an allocated window with the specified values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419755-initwithcontentrect?language=objc +func NewFilterBrowserPanelWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) FilterBrowserPanel { + instance := FilterBrowserPanelClass.Alloc().InitWithContentRectStyleMaskBackingDeferScreen(contentRect, style, backingStoreType, flag, screen) + instance.Autorelease() + return instance +} + +// Displays the filter browser in a new utility window, unless the filter browser is already open. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1504894-beginwithoptions?language=objc +func (f_ FilterBrowserPanel) BeginWithOptionsModelessDelegateDidEndSelectorContextInfo(inOptions foundation.Dictionary, modelessDelegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) { + objc.Call[objc.Void](f_, objc.Sel("beginWithOptions:modelessDelegate:didEndSelector:contextInfo:"), inOptions, modelessDelegate, didEndSelector, contextInfo) +} + +// Returns a view that contains a filter browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1503992-filterbrowserviewwithoptions?language=objc +func (f_ FilterBrowserPanel) FilterBrowserViewWithOptions(inOptions foundation.Dictionary) FilterBrowserView { + rv := objc.Call[FilterBrowserView](f_, objc.Sel("filterBrowserViewWithOptions:"), inOptions) + return rv +} + +// Creates a shared instance of the IKFilterBrowserPanel class. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1503504-filterbrowserpanelwithstylemask?language=objc +func (fc _FilterBrowserPanelClass) FilterBrowserPanelWithStyleMask(styleMask int) objc.Object { + rv := objc.Call[objc.Object](fc, objc.Sel("filterBrowserPanelWithStyleMask:"), styleMask) + return rv +} + +// Creates a shared instance of the IKFilterBrowserPanel class. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1503504-filterbrowserpanelwithstylemask?language=objc +func FilterBrowserPanel_FilterBrowserPanelWithStyleMask(styleMask int) objc.Object { + return FilterBrowserPanelClass.FilterBrowserPanelWithStyleMask(styleMask) +} + +// Returns the name of the filter that is currently selected in the filter browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1504426-filtername?language=objc +func (f_ FilterBrowserPanel) FilterName() string { + rv := objc.Call[string](f_, objc.Sel("filterName")) + return rv +} + +// Displays the filter browser in a sheet—that is, a dialog that is attached to its parent window and must be dismissed by the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1504636-beginsheetwithoptions?language=objc +func (f_ FilterBrowserPanel) BeginSheetWithOptionsModalForWindowModalDelegateDidEndSelectorContextInfo(inOptions foundation.Dictionary, docWindow appkit.IWindow, modalDelegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) { + objc.Call[objc.Void](f_, objc.Sel("beginSheetWithOptions:modalForWindow:modalDelegate:didEndSelector:contextInfo:"), inOptions, objc.Ptr(docWindow), modalDelegate, didEndSelector, contextInfo) +} + +// Closes a filter browser view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1505223-finish?language=objc +func (f_ FilterBrowserPanel) Finish(sender objc.IObject) { + objc.Call[objc.Void](f_, objc.Sel("finish:"), sender) +} + +// Displays the filter browser in a modal dialog that must be dismissed by the user but that is not attached to a window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel/1504028-runmodalwithoptions?language=objc +func (f_ FilterBrowserPanel) RunModalWithOptions(inOptions foundation.Dictionary) int { + rv := objc.Call[int](f_, objc.Sel("runModalWithOptions:"), inOptions) + return rv +} diff --git a/macos/quartz/filter_browser_view.gen.go b/macos/quartz/filter_browser_view.gen.go new file mode 100644 index 00000000..67dd29c1 --- /dev/null +++ b/macos/quartz/filter_browser_view.gen.go @@ -0,0 +1,91 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FilterBrowserView] class. +var FilterBrowserViewClass = _FilterBrowserViewClass{objc.GetClass("IKFilterBrowserView")} + +type _FilterBrowserViewClass struct { + objc.Class +} + +// An interface definition for the [FilterBrowserView] class. +type IFilterBrowserView interface { + appkit.IView + SetPreviewState(inState bool) + FilterName() string +} + +// The IKFilterBrowserView class is used as a container for the elements of an IKFilterBrowserPanel object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserview?language=objc +type FilterBrowserView struct { + appkit.View +} + +func FilterBrowserViewFrom(ptr unsafe.Pointer) FilterBrowserView { + return FilterBrowserView{ + View: appkit.ViewFrom(ptr), + } +} + +func (fc _FilterBrowserViewClass) Alloc() FilterBrowserView { + rv := objc.Call[FilterBrowserView](fc, objc.Sel("alloc")) + return rv +} + +func FilterBrowserView_Alloc() FilterBrowserView { + return FilterBrowserViewClass.Alloc() +} + +func (fc _FilterBrowserViewClass) New() FilterBrowserView { + rv := objc.Call[FilterBrowserView](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFilterBrowserView() FilterBrowserView { + return FilterBrowserViewClass.New() +} + +func (f_ FilterBrowserView) Init() FilterBrowserView { + rv := objc.Call[FilterBrowserView](f_, objc.Sel("init")) + return rv +} + +func (f_ FilterBrowserView) InitWithFrame(frameRect foundation.Rect) FilterBrowserView { + rv := objc.Call[FilterBrowserView](f_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewFilterBrowserViewWithFrame(frameRect foundation.Rect) FilterBrowserView { + instance := FilterBrowserViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// Sets the preview state. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserview/1405296-setpreviewstate?language=objc +func (f_ FilterBrowserView) SetPreviewState(inState bool) { + objc.Call[objc.Void](f_, objc.Sel("setPreviewState:"), inState) +} + +// Returns the name of the filter that is currently selected in the filter browser. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilterbrowserview/1405294-filtername?language=objc +func (f_ FilterBrowserView) FilterName() string { + rv := objc.Call[string](f_, objc.Sel("filterName")) + return rv +} diff --git a/macos/quartz/filter_custom_ui_provider.gen.go b/macos/quartz/filter_custom_ui_provider.gen.go new file mode 100644 index 00000000..9e2a8963 --- /dev/null +++ b/macos/quartz/filter_custom_ui_provider.gen.go @@ -0,0 +1,34 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The IKFilterCustomUIProvider protocol is an addition to the CIFilter class that defines a method for providing a view for a filter. This protocol is implemented by any filter that provides its own user interface. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfiltercustomuiprovider?language=objc +type PFilterCustomUIProvider interface { + // optional + ProvideViewForUIConfigurationExcludedKeys(inUIConfiguration foundation.Dictionary, inKeys []objc.Object) IFilterUIView + HasProvideViewForUIConfigurationExcludedKeys() bool +} + +// A concrete type wrapper for the [PFilterCustomUIProvider] protocol. +type FilterCustomUIProviderWrapper struct { + objc.Object +} + +func (f_ FilterCustomUIProviderWrapper) HasProvideViewForUIConfigurationExcludedKeys() bool { + return f_.RespondsToSelector(objc.Sel("provideViewForUIConfiguration:excludedKeys:")) +} + +// Provides a custom view for a filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfiltercustomuiprovider/1427525-provideviewforuiconfiguration?language=objc +func (f_ FilterCustomUIProviderWrapper) ProvideViewForUIConfigurationExcludedKeys(inUIConfiguration foundation.Dictionary, inKeys []objc.IObject) FilterUIView { + rv := objc.Call[FilterUIView](f_, objc.Sel("provideViewForUIConfiguration:excludedKeys:"), inUIConfiguration, inKeys) + return rv +} diff --git a/macos/quartz/filter_ui_view.gen.go b/macos/quartz/filter_ui_view.gen.go new file mode 100644 index 00000000..18994a2c --- /dev/null +++ b/macos/quartz/filter_ui_view.gen.go @@ -0,0 +1,117 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FilterUIView] class. +var FilterUIViewClass = _FilterUIViewClass{objc.GetClass("IKFilterUIView")} + +type _FilterUIViewClass struct { + objc.Class +} + +// An interface definition for the [FilterUIView] class. +type IFilterUIView interface { + appkit.IView + ObjectController() appkit.ObjectController + Filter() coreimage.Filter + InitWithFrameFilter(frameRect foundation.Rect, inFilter coreimage.IFilter) objc.Object +} + +// The IKFilterUIView class provides a view that contains input parameter controls for a Core Image filter (CIFilter). You need to use this class when providing a user interface for a custom filter. The class creates a view that has an object controller for the given filter. It also retains the filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilteruiview?language=objc +type FilterUIView struct { + appkit.View +} + +func FilterUIViewFrom(ptr unsafe.Pointer) FilterUIView { + return FilterUIView{ + View: appkit.ViewFrom(ptr), + } +} + +func (fc _FilterUIViewClass) Alloc() FilterUIView { + rv := objc.Call[FilterUIView](fc, objc.Sel("alloc")) + return rv +} + +func FilterUIView_Alloc() FilterUIView { + return FilterUIViewClass.Alloc() +} + +func (fc _FilterUIViewClass) New() FilterUIView { + rv := objc.Call[FilterUIView](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFilterUIView() FilterUIView { + return FilterUIViewClass.New() +} + +func (f_ FilterUIView) Init() FilterUIView { + rv := objc.Call[FilterUIView](f_, objc.Sel("init")) + return rv +} + +func (f_ FilterUIView) InitWithFrame(frameRect foundation.Rect) FilterUIView { + rv := objc.Call[FilterUIView](f_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewFilterUIViewWithFrame(frameRect foundation.Rect) FilterUIView { + instance := FilterUIViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// Returns the object controller for the bindings between the filter and its view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilteruiview/1504206-objectcontroller?language=objc +func (f_ FilterUIView) ObjectController() appkit.ObjectController { + rv := objc.Call[appkit.ObjectController](f_, objc.Sel("objectController")) + return rv +} + +// Returns the Core Image filter associated with the view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilteruiview/1504622-filter?language=objc +func (f_ FilterUIView) Filter() coreimage.Filter { + rv := objc.Call[coreimage.Filter](f_, objc.Sel("filter")) + return rv +} + +// Initializes a view that contains controls for the input parameters of a filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilteruiview/1504139-initwithframe?language=objc +func (f_ FilterUIView) InitWithFrameFilter(frameRect foundation.Rect, inFilter coreimage.IFilter) objc.Object { + rv := objc.Call[objc.Object](f_, objc.Sel("initWithFrame:filter:"), frameRect, objc.Ptr(inFilter)) + return rv +} + +// Creates a view that contains controls for the input parameters of a filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilteruiview/1504872-viewwithframe?language=objc +func (fc _FilterUIViewClass) ViewWithFrameFilter(frameRect foundation.Rect, inFilter coreimage.IFilter) objc.Object { + rv := objc.Call[objc.Object](fc, objc.Sel("viewWithFrame:filter:"), frameRect, objc.Ptr(inFilter)) + return rv +} + +// Creates a view that contains controls for the input parameters of a filter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikfilteruiview/1504872-viewwithframe?language=objc +func FilterUIView_ViewWithFrameFilter(frameRect foundation.Rect, inFilter coreimage.IFilter) objc.Object { + return FilterUIViewClass.ViewWithFrameFilter(frameRect, inFilter) +} diff --git a/macos/quartz/image_browser_cell.gen.go b/macos/quartz/image_browser_cell.gen.go new file mode 100644 index 00000000..7ffdc6d8 --- /dev/null +++ b/macos/quartz/image_browser_cell.gen.go @@ -0,0 +1,187 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageBrowserCell] class. +var ImageBrowserCellClass = _ImageBrowserCellClass{objc.GetClass("IKImageBrowserCell")} + +type _ImageBrowserCellClass struct { + objc.Class +} + +// An interface definition for the [ImageBrowserCell] class. +type IImageBrowserCell interface { + objc.IObject + ImageAlignment() appkit.ImageAlignment + Opacity() float64 + IndexOfRepresentedItem() uint + IsSelected() bool + ImageContainerFrame() foundation.Rect + CellState() ImageBrowserCellState + RepresentedItem() objc.Object + ImageFrame() foundation.Rect + TitleFrame() foundation.Rect + Frame() foundation.Rect + ImageBrowserView() ImageBrowserView + SubtitleFrame() foundation.Rect + LayerForType(type_ string) quartzcore.Layer + SelectionFrame() foundation.Rect +} + +// A class that is used to display a cell conforming to the [quartz/imagekit/ikimagebrowseritem_protocol] in an IKImageBrowserView. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell?language=objc +type ImageBrowserCell struct { + objc.Object +} + +func ImageBrowserCellFrom(ptr unsafe.Pointer) ImageBrowserCell { + return ImageBrowserCell{ + Object: objc.ObjectFrom(ptr), + } +} + +func (ic _ImageBrowserCellClass) Alloc() ImageBrowserCell { + rv := objc.Call[ImageBrowserCell](ic, objc.Sel("alloc")) + return rv +} + +func ImageBrowserCell_Alloc() ImageBrowserCell { + return ImageBrowserCellClass.Alloc() +} + +func (ic _ImageBrowserCellClass) New() ImageBrowserCell { + rv := objc.Call[ImageBrowserCell](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageBrowserCell() ImageBrowserCell { + return ImageBrowserCellClass.New() +} + +func (i_ ImageBrowserCell) Init() ImageBrowserCell { + rv := objc.Call[ImageBrowserCell](i_, objc.Sel("init")) + return rv +} + +// Returns the position of the cell’s image in the frame. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500042-imagealignment?language=objc +func (i_ ImageBrowserCell) ImageAlignment() appkit.ImageAlignment { + rv := objc.Call[appkit.ImageAlignment](i_, objc.Sel("imageAlignment")) + return rv +} + +// Returns the opacity of the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500060-opacity?language=objc +func (i_ ImageBrowserCell) Opacity() float64 { + rv := objc.Call[float64](i_, objc.Sel("opacity")) + return rv +} + +// Returns the index of the receiver’s represented object in the datasource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500047-indexofrepresenteditem?language=objc +func (i_ ImageBrowserCell) IndexOfRepresentedItem() uint { + rv := objc.Call[uint](i_, objc.Sel("indexOfRepresentedItem")) + return rv +} + +// Returns whether the cell is selected. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500051-isselected?language=objc +func (i_ ImageBrowserCell) IsSelected() bool { + rv := objc.Call[bool](i_, objc.Sel("isSelected")) + return rv +} + +// Returns the receiver’s image container frame rectangle, which defines the position of the container of the thumbnail. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500064-imagecontainerframe?language=objc +func (i_ ImageBrowserCell) ImageContainerFrame() foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("imageContainerFrame")) + return rv +} + +// Returns the current cell state of the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500062-cellstate?language=objc +func (i_ ImageBrowserCell) CellState() ImageBrowserCellState { + rv := objc.Call[ImageBrowserCellState](i_, objc.Sel("cellState")) + return rv +} + +// Returns the receiver’s represented object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500071-representeditem?language=objc +func (i_ ImageBrowserCell) RepresentedItem() objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("representedItem")) + return rv +} + +// Returns the receiver’s image frame rectangle, which defines the position of the thumbnail in its IKImageBrowserView. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500052-imageframe?language=objc +func (i_ ImageBrowserCell) ImageFrame() foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("imageFrame")) + return rv +} + +// Returns the receiver’s title frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500069-titleframe?language=objc +func (i_ ImageBrowserCell) TitleFrame() foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("titleFrame")) + return rv +} + +// Returns the receiver’s frame rectangle, which defines its position in its IKImageBrowserView. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500044-frame?language=objc +func (i_ ImageBrowserCell) Frame() foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("frame")) + return rv +} + +// Returns the view the receiver uses to display the cell. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500049-imagebrowserview?language=objc +func (i_ ImageBrowserCell) ImageBrowserView() ImageBrowserView { + rv := objc.Call[ImageBrowserView](i_, objc.Sel("imageBrowserView")) + return rv +} + +// Returns the receiver’s subtitle frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500074-subtitleframe?language=objc +func (i_ ImageBrowserCell) SubtitleFrame() foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("subtitleFrame")) + return rv +} + +// Returns a layer for the specified position. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500045-layerfortype?language=objc +func (i_ ImageBrowserCell) LayerForType(type_ string) quartzcore.Layer { + rv := objc.Call[quartzcore.Layer](i_, objc.Sel("layerForType:"), type_) + return rv +} + +// Returns the receiver’s selection frame rectangle, which defines the position of the selection rectangle in its IKImageBrowserView. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowsercell/1500070-selectionframe?language=objc +func (i_ ImageBrowserCell) SelectionFrame() foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("selectionFrame")) + return rv +} diff --git a/macos/quartz/image_browser_view.gen.go b/macos/quartz/image_browser_view.gen.go new file mode 100644 index 00000000..f6565725 --- /dev/null +++ b/macos/quartz/image_browser_view.gen.go @@ -0,0 +1,74 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageBrowserView] class. +var ImageBrowserViewClass = _ImageBrowserViewClass{objc.GetClass("IKImageBrowserView")} + +type _ImageBrowserViewClass struct { + objc.Class +} + +// An interface definition for the [ImageBrowserView] class. +type IImageBrowserView interface { + appkit.IView +} + +// The IKImageBrowserView class is a view for displaying and browsing a large amount of images and movies efficiently. This class will be deprecated in a future release. Please switch to NSCollectionView instead. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimagebrowserview?language=objc +type ImageBrowserView struct { + appkit.View +} + +func ImageBrowserViewFrom(ptr unsafe.Pointer) ImageBrowserView { + return ImageBrowserView{ + View: appkit.ViewFrom(ptr), + } +} + +func (ic _ImageBrowserViewClass) Alloc() ImageBrowserView { + rv := objc.Call[ImageBrowserView](ic, objc.Sel("alloc")) + return rv +} + +func ImageBrowserView_Alloc() ImageBrowserView { + return ImageBrowserViewClass.Alloc() +} + +func (ic _ImageBrowserViewClass) New() ImageBrowserView { + rv := objc.Call[ImageBrowserView](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageBrowserView() ImageBrowserView { + return ImageBrowserViewClass.New() +} + +func (i_ ImageBrowserView) Init() ImageBrowserView { + rv := objc.Call[ImageBrowserView](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageBrowserView) InitWithFrame(frameRect foundation.Rect) ImageBrowserView { + rv := objc.Call[ImageBrowserView](i_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewImageBrowserViewWithFrame(frameRect foundation.Rect) ImageBrowserView { + instance := ImageBrowserViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} diff --git a/macos/quartz/image_edit_panel.gen.go b/macos/quartz/image_edit_panel.gen.go new file mode 100644 index 00000000..166c3e34 --- /dev/null +++ b/macos/quartz/image_edit_panel.gen.go @@ -0,0 +1,144 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageEditPanel] class. +var ImageEditPanelClass = _ImageEditPanelClass{objc.GetClass("IKImageEditPanel")} + +type _ImageEditPanelClass struct { + objc.Class +} + +// An interface definition for the [ImageEditPanel] class. +type IImageEditPanel interface { + appkit.IPanel + ReloadData() + DataSource() ImageEditPanelDataSourceWrapper + SetDataSource(value PImageEditPanelDataSource) + SetDataSourceObject(valueObject objc.IObject) + FilterArray() []objc.Object +} + +// The IKImageEditPanel class provides a panel, that is, a utility window that floats on top of document windows, optimized for image editing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel?language=objc +type ImageEditPanel struct { + appkit.Panel +} + +func ImageEditPanelFrom(ptr unsafe.Pointer) ImageEditPanel { + return ImageEditPanel{ + Panel: appkit.PanelFrom(ptr), + } +} + +func (ic _ImageEditPanelClass) Alloc() ImageEditPanel { + rv := objc.Call[ImageEditPanel](ic, objc.Sel("alloc")) + return rv +} + +func ImageEditPanel_Alloc() ImageEditPanel { + return ImageEditPanelClass.Alloc() +} + +func (ic _ImageEditPanelClass) New() ImageEditPanel { + rv := objc.Call[ImageEditPanel](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageEditPanel() ImageEditPanel { + return ImageEditPanelClass.New() +} + +func (i_ ImageEditPanel) Init() ImageEditPanel { + rv := objc.Call[ImageEditPanel](i_, objc.Sel("init")) + return rv +} + +func (ic _ImageEditPanelClass) WindowWithContentViewController(contentViewController appkit.IViewController) ImageEditPanel { + rv := objc.Call[ImageEditPanel](ic, objc.Sel("windowWithContentViewController:"), objc.Ptr(contentViewController)) + return rv +} + +// Creates a titled window that contains the specified content view controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419551-windowwithcontentviewcontroller?language=objc +func ImageEditPanel_WindowWithContentViewController(contentViewController appkit.IViewController) ImageEditPanel { + return ImageEditPanelClass.WindowWithContentViewController(contentViewController) +} + +func (i_ ImageEditPanel) InitWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) ImageEditPanel { + rv := objc.Call[ImageEditPanel](i_, objc.Sel("initWithContentRect:styleMask:backing:defer:screen:"), contentRect, style, backingStoreType, flag, objc.Ptr(screen)) + return rv +} + +// Initializes an allocated window with the specified values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419755-initwithcontentrect?language=objc +func NewImageEditPanelWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) ImageEditPanel { + instance := ImageEditPanelClass.Alloc().InitWithContentRectStyleMaskBackingDeferScreen(contentRect, style, backingStoreType, flag, screen) + instance.Autorelease() + return instance +} + +// Creates a shared instance of an image editing panel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel/1503827-sharedimageeditpanel?language=objc +func (ic _ImageEditPanelClass) SharedImageEditPanel() ImageEditPanel { + rv := objc.Call[ImageEditPanel](ic, objc.Sel("sharedImageEditPanel")) + return rv +} + +// Creates a shared instance of an image editing panel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel/1503827-sharedimageeditpanel?language=objc +func ImageEditPanel_SharedImageEditPanel() ImageEditPanel { + return ImageEditPanelClass.SharedImageEditPanel() +} + +// Reloads the data from the data associated with an image editing panel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel/1503419-reloaddata?language=objc +func (i_ ImageEditPanel) ReloadData() { + objc.Call[objc.Void](i_, objc.Sel("reloadData")) +} + +// Specifies the edit panel’s dataSource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel/1503831-datasource?language=objc +func (i_ ImageEditPanel) DataSource() ImageEditPanelDataSourceWrapper { + rv := objc.Call[ImageEditPanelDataSourceWrapper](i_, objc.Sel("dataSource")) + return rv +} + +// Specifies the edit panel’s dataSource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel/1503831-datasource?language=objc +func (i_ ImageEditPanel) SetDataSource(value PImageEditPanelDataSource) { + po0 := objc.WrapAsProtocol("IKImageEditPanelDataSource", value) + objc.Call[objc.Void](i_, objc.Sel("setDataSource:"), po0) +} + +// Specifies the edit panel’s dataSource. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel/1503831-datasource?language=objc +func (i_ ImageEditPanel) SetDataSourceObject(valueObject objc.IObject) { + objc.Call[objc.Void](i_, objc.Sel("setDataSource:"), objc.Ptr(valueObject)) +} + +// Returns the current array of user adjustments to effects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpanel/1504436-filterarray?language=objc +func (i_ ImageEditPanel) FilterArray() []objc.Object { + rv := objc.Call[[]objc.Object](i_, objc.Sel("filterArray")) + return rv +} diff --git a/macos/quartz/image_edit_panel_data_source.gen.go b/macos/quartz/image_edit_panel_data_source.gen.go new file mode 100644 index 00000000..aa498d66 --- /dev/null +++ b/macos/quartz/image_edit_panel_data_source.gen.go @@ -0,0 +1,50 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The IKImageEditPanelDataSource protocol describes the methods that an IKImageEditPanel object uses to access the contents of its data source object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpaneldatasource?language=objc +type PImageEditPanelDataSource interface { + // optional + SetImageImageProperties(image coregraphics.ImageRef, metaData foundation.Dictionary) + HasSetImageImageProperties() bool + + // optional + ThumbnailWithMaximumSize(size foundation.Size) coregraphics.ImageRef + HasThumbnailWithMaximumSize() bool +} + +// A concrete type wrapper for the [PImageEditPanelDataSource] protocol. +type ImageEditPanelDataSourceWrapper struct { + objc.Object +} + +func (i_ ImageEditPanelDataSourceWrapper) HasSetImageImageProperties() bool { + return i_.RespondsToSelector(objc.Sel("setImage:imageProperties:")) +} + +// Sets an image with the specified properties. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpaneldatasource/1503517-setimage?language=objc +func (i_ ImageEditPanelDataSourceWrapper) SetImageImageProperties(image coregraphics.ImageRef, metaData foundation.Dictionary) { + objc.Call[objc.Void](i_, objc.Sel("setImage:imageProperties:"), image, metaData) +} + +func (i_ ImageEditPanelDataSourceWrapper) HasThumbnailWithMaximumSize() bool { + return i_.RespondsToSelector(objc.Sel("thumbnailWithMaximumSize:")) +} + +// Returns a thumbnail image whose size is no larger than the specified size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageeditpaneldatasource/1505271-thumbnailwithmaximumsize?language=objc +func (i_ ImageEditPanelDataSourceWrapper) ThumbnailWithMaximumSize(size foundation.Size) coregraphics.ImageRef { + rv := objc.Call[coregraphics.ImageRef](i_, objc.Sel("thumbnailWithMaximumSize:"), size) + return rv +} diff --git a/macos/quartz/image_view.gen.go b/macos/quartz/image_view.gen.go new file mode 100644 index 00000000..b95ca9d4 --- /dev/null +++ b/macos/quartz/image_view.gen.go @@ -0,0 +1,515 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/macos/quartzcore" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageView] class. +var ImageViewClass = _ImageViewClass{objc.GetClass("IKImageView")} + +type _ImageViewClass struct { + objc.Class +} + +// An interface definition for the [ImageView] class. +type IImageView interface { + appkit.IView + ConvertViewPointToImagePoint(viewPoint foundation.Point) foundation.Point + ZoomImageToFit(sender objc.IObject) objc.Object + RotateImageRight(sender objc.IObject) objc.Object + ZoomImageToActualSize(sender objc.IObject) objc.Object + ImageSize() foundation.Size + RotateImageLeft(sender objc.IObject) objc.Object + ConvertViewRectToImageRect(viewRect foundation.Rect) foundation.Rect + ConvertImagePointToViewPoint(imagePoint foundation.Point) foundation.Point + SetImageImageProperties(image coregraphics.ImageRef, metaData foundation.Dictionary) + ScrollToPoint(point foundation.Point) + Crop(sender objc.IObject) objc.Object + ZoomIn(sender objc.IObject) objc.Object + OverlayForType(layerType string) quartzcore.Layer + SetOverlayForType(layer quartzcore.ILayer, layerType string) + ConvertImageRectToViewRect(imageRect foundation.Rect) foundation.Rect + ImageProperties() foundation.Dictionary + ScrollToRect(rect foundation.Rect) + FlipImageVertical(sender objc.IObject) objc.Object + ZoomOut(sender objc.IObject) objc.Object + SetRotationAngleCenterPoint(rotationAngle float64, centerPoint foundation.Point) + FlipImageHorizontal(sender objc.IObject) objc.Object + SetImageZoomFactorCenterPoint(zoomFactor float64, centerPoint foundation.Point) + Image() coregraphics.ImageRef + ZoomImageToRect(rect foundation.Rect) + SetImageWithURL(url foundation.IURL) + HasVerticalScroller() bool + SetHasVerticalScroller(value bool) + Editable() bool + SetEditable(value bool) + CurrentToolMode() string + SetCurrentToolMode(value string) + Autoresizes() bool + SetAutoresizes(value bool) + Delegate() objc.Object + SetDelegate(value objc.IObject) + BackgroundColor() appkit.Color + SetBackgroundColor(value appkit.IColor) + ImageCorrection() coreimage.Filter + SetImageCorrection(value coreimage.IFilter) + AutohidesScrollers() bool + SetAutohidesScrollers(value bool) + SupportsDragAndDrop() bool + SetSupportsDragAndDrop(value bool) + RotationAngle() float64 + SetRotationAngle(value float64) + HasHorizontalScroller() bool + SetHasHorizontalScroller(value bool) + ZoomFactor() float64 + SetZoomFactor(value float64) + DoubleClickOpensImageEditPanel() bool + SetDoubleClickOpensImageEditPanel(value bool) +} + +// The IKImageView class provides an efficient way to display images in a view while at the same time supporting a number of image editing operations such as rotating, zooming, and cropping. It supports drag and drop for the NSFilenamesPboardType flavor so that the user can drag an image to the view. If possible, image rendering uses hardware acceleration to achieve optimal performance. The IKImageView class is implemented as a subclass of NSView. Similar to NSImageView, the IKImageView class is used to display a single image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview?language=objc +type ImageView struct { + appkit.View +} + +func ImageViewFrom(ptr unsafe.Pointer) ImageView { + return ImageView{ + View: appkit.ViewFrom(ptr), + } +} + +func (ic _ImageViewClass) Alloc() ImageView { + rv := objc.Call[ImageView](ic, objc.Sel("alloc")) + return rv +} + +func ImageView_Alloc() ImageView { + return ImageViewClass.Alloc() +} + +func (ic _ImageViewClass) New() ImageView { + rv := objc.Call[ImageView](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageView() ImageView { + return ImageViewClass.New() +} + +func (i_ ImageView) Init() ImageView { + rv := objc.Call[ImageView](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageView) InitWithFrame(frameRect foundation.Rect) ImageView { + rv := objc.Call[ImageView](i_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewImageViewWithFrame(frameRect foundation.Rect) ImageView { + instance := ImageViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// Converts an image view coordinate to an image coordinate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503743-convertviewpointtoimagepoint?language=objc +func (i_ ImageView) ConvertViewPointToImagePoint(viewPoint foundation.Point) foundation.Point { + rv := objc.Call[foundation.Point](i_, objc.Sel("convertViewPointToImagePoint:"), viewPoint) + return rv +} + +// Zooms the image so that it fits in the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504450-zoomimagetofit?language=objc +func (i_ ImageView) ZoomImageToFit(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("zoomImageToFit:"), sender) + return rv +} + +// Rotates the image right (clockwise). [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503427-rotateimageright?language=objc +func (i_ ImageView) RotateImageRight(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("rotateImageRight:"), sender) + return rv +} + +// Zooms the image so that it is displayed using its true size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504415-zoomimagetoactualsize?language=objc +func (i_ ImageView) ZoomImageToActualSize(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("zoomImageToActualSize:"), sender) + return rv +} + +// Returns the size of the image in the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504005-imagesize?language=objc +func (i_ ImageView) ImageSize() foundation.Size { + rv := objc.Call[foundation.Size](i_, objc.Sel("imageSize")) + return rv +} + +// Rotates the image left (counter-clockwise). [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503769-rotateimageleft?language=objc +func (i_ ImageView) RotateImageLeft(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("rotateImageLeft:"), sender) + return rv +} + +// Converts an image view rectangle to an image rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504464-convertviewrecttoimagerect?language=objc +func (i_ ImageView) ConvertViewRectToImageRect(viewRect foundation.Rect) foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("convertViewRectToImageRect:"), viewRect) + return rv +} + +// Converts an image coordinate to an image view coordinate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504633-convertimagepointtoviewpoint?language=objc +func (i_ ImageView) ConvertImagePointToViewPoint(imagePoint foundation.Point) foundation.Point { + rv := objc.Call[foundation.Point](i_, objc.Sel("convertImagePointToViewPoint:"), imagePoint) + return rv +} + +// Sets the image to display in an image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503915-setimage?language=objc +func (i_ ImageView) SetImageImageProperties(image coregraphics.ImageRef, metaData foundation.Dictionary) { + objc.Call[objc.Void](i_, objc.Sel("setImage:imageProperties:"), image, metaData) +} + +// Scrolls the view to the specified point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503677-scrolltopoint?language=objc +func (i_ ImageView) ScrollToPoint(point foundation.Point) { + objc.Call[objc.Void](i_, objc.Sel("scrollToPoint:"), point) +} + +// Crops the image using the current selection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503855-crop?language=objc +func (i_ ImageView) Crop(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("crop:"), sender) + return rv +} + +// Zooms the image in. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503800-zoomin?language=objc +func (i_ ImageView) ZoomIn(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("zoomIn:"), sender) + return rv +} + +// Returns the Core Animation layer associated with a layer type. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504236-overlayfortype?language=objc +func (i_ ImageView) OverlayForType(layerType string) quartzcore.Layer { + rv := objc.Call[quartzcore.Layer](i_, objc.Sel("overlayForType:"), layerType) + return rv +} + +// Sets an overlay type for a Core Animation layer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504283-setoverlay?language=objc +func (i_ ImageView) SetOverlayForType(layer quartzcore.ILayer, layerType string) { + objc.Call[objc.Void](i_, objc.Sel("setOverlay:forType:"), objc.Ptr(layer), layerType) +} + +// Converts an image rectangle to an image view rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504409-convertimagerecttoviewrect?language=objc +func (i_ ImageView) ConvertImageRectToViewRect(imageRect foundation.Rect) foundation.Rect { + rv := objc.Call[foundation.Rect](i_, objc.Sel("convertImageRectToViewRect:"), imageRect) + return rv +} + +// Returns the metadata for the image in the view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503845-imageproperties?language=objc +func (i_ ImageView) ImageProperties() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](i_, objc.Sel("imageProperties")) + return rv +} + +// Scrolls the view so that it includes the provided rectangular area. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504366-scrolltorect?language=objc +func (i_ ImageView) ScrollToRect(rect foundation.Rect) { + objc.Call[objc.Void](i_, objc.Sel("scrollToRect:"), rect) +} + +// Flips an image along the vertical axis. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503836-flipimagevertical?language=objc +func (i_ ImageView) FlipImageVertical(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("flipImageVertical:"), sender) + return rv +} + +// Zooms the image out. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503436-zoomout?language=objc +func (i_ ImageView) ZoomOut(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("zoomOut:"), sender) + return rv +} + +// Sets the rotation angle at the provided origin. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503535-setrotationangle?language=objc +func (i_ ImageView) SetRotationAngleCenterPoint(rotationAngle float64, centerPoint foundation.Point) { + objc.Call[objc.Void](i_, objc.Sel("setRotationAngle:centerPoint:"), rotationAngle, centerPoint) +} + +// Flips an image along the horizontal axis. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1505282-flipimagehorizontal?language=objc +func (i_ ImageView) FlipImageHorizontal(sender objc.IObject) objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("flipImageHorizontal:"), sender) + return rv +} + +// Sets the zoom factor at the provided origin. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503762-setimagezoomfactor?language=objc +func (i_ ImageView) SetImageZoomFactorCenterPoint(zoomFactor float64, centerPoint foundation.Point) { + objc.Call[objc.Void](i_, objc.Sel("setImageZoomFactor:centerPoint:"), zoomFactor, centerPoint) +} + +// Returns the image associated with the view, after any image corrections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504371-image?language=objc +func (i_ ImageView) Image() coregraphics.ImageRef { + rv := objc.Call[coregraphics.ImageRef](i_, objc.Sel("image")) + return rv +} + +// Zooms the image so that it fits in the specified rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504460-zoomimagetorect?language=objc +func (i_ ImageView) ZoomImageToRect(rect foundation.Rect) { + objc.Call[objc.Void](i_, objc.Sel("zoomImageToRect:"), rect) +} + +// Initializes an image view with the image specified by a URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1505314-setimagewithurl?language=objc +func (i_ ImageView) SetImageWithURL(url foundation.IURL) { + objc.Call[objc.Void](i_, objc.Sel("setImageWithURL:"), objc.Ptr(url)) +} + +// Specifies the vertical scroll bar state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1505256-hasverticalscroller?language=objc +func (i_ ImageView) HasVerticalScroller() bool { + rv := objc.Call[bool](i_, objc.Sel("hasVerticalScroller")) + return rv +} + +// Specifies the vertical scroll bar state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1505256-hasverticalscroller?language=objc +func (i_ ImageView) SetHasVerticalScroller(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setHasVerticalScroller:"), value) +} + +// Specifies the editable state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1505302-editable?language=objc +func (i_ ImageView) Editable() bool { + rv := objc.Call[bool](i_, objc.Sel("editable")) + return rv +} + +// Specifies the editable state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1505302-editable?language=objc +func (i_ ImageView) SetEditable(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setEditable:"), value) +} + +// Specifies the current tool mode for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503607-currenttoolmode?language=objc +func (i_ ImageView) CurrentToolMode() string { + rv := objc.Call[string](i_, objc.Sel("currentToolMode")) + return rv +} + +// Specifies the current tool mode for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503607-currenttoolmode?language=objc +func (i_ ImageView) SetCurrentToolMode(value string) { + objc.Call[objc.Void](i_, objc.Sel("setCurrentToolMode:"), value) +} + +// Specifies the automatic resizing state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503709-autoresizes?language=objc +func (i_ ImageView) Autoresizes() bool { + rv := objc.Call[bool](i_, objc.Sel("autoresizes")) + return rv +} + +// Specifies the automatic resizing state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503709-autoresizes?language=objc +func (i_ ImageView) SetAutoresizes(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setAutoresizes:"), value) +} + +// Specifies the delegate object of the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504032-delegate?language=objc +func (i_ ImageView) Delegate() objc.Object { + rv := objc.Call[objc.Object](i_, objc.Sel("delegate")) + return rv +} + +// Specifies the delegate object of the receiver. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504032-delegate?language=objc +func (i_ ImageView) SetDelegate(value objc.IObject) { + objc.Call[objc.Void](i_, objc.Sel("setDelegate:"), value) +} + +// Specifies the background color for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503567-backgroundcolor?language=objc +func (i_ ImageView) BackgroundColor() appkit.Color { + rv := objc.Call[appkit.Color](i_, objc.Sel("backgroundColor")) + return rv +} + +// Specifies the background color for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503567-backgroundcolor?language=objc +func (i_ ImageView) SetBackgroundColor(value appkit.IColor) { + objc.Call[objc.Void](i_, objc.Sel("setBackgroundColor:"), objc.Ptr(value)) +} + +// Specifies a Core Image filter for image correction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503698-imagecorrection?language=objc +func (i_ ImageView) ImageCorrection() coreimage.Filter { + rv := objc.Call[coreimage.Filter](i_, objc.Sel("imageCorrection")) + return rv +} + +// Specifies a Core Image filter for image correction. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503698-imagecorrection?language=objc +func (i_ ImageView) SetImageCorrection(value coreimage.IFilter) { + objc.Call[objc.Void](i_, objc.Sel("setImageCorrection:"), objc.Ptr(value)) +} + +// Specifies the automatic-hiding scroll bar state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503469-autohidesscrollers?language=objc +func (i_ ImageView) AutohidesScrollers() bool { + rv := objc.Call[bool](i_, objc.Sel("autohidesScrollers")) + return rv +} + +// Specifies the automatic-hiding scroll bar state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503469-autohidesscrollers?language=objc +func (i_ ImageView) SetAutohidesScrollers(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setAutohidesScrollers:"), value) +} + +// Specifies the drag-and-drop support state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504887-supportsdraganddrop?language=objc +func (i_ ImageView) SupportsDragAndDrop() bool { + rv := objc.Call[bool](i_, objc.Sel("supportsDragAndDrop")) + return rv +} + +// Specifies the drag-and-drop support state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504887-supportsdraganddrop?language=objc +func (i_ ImageView) SetSupportsDragAndDrop(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setSupportsDragAndDrop:"), value) +} + +// Specifies the rotation angle for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504691-rotationangle?language=objc +func (i_ ImageView) RotationAngle() float64 { + rv := objc.Call[float64](i_, objc.Sel("rotationAngle")) + return rv +} + +// Specifies the rotation angle for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504691-rotationangle?language=objc +func (i_ ImageView) SetRotationAngle(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setRotationAngle:"), value) +} + +// Specifies the horizontal scroll bar state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503565-hashorizontalscroller?language=objc +func (i_ ImageView) HasHorizontalScroller() bool { + rv := objc.Call[bool](i_, objc.Sel("hasHorizontalScroller")) + return rv +} + +// Specifies the horizontal scroll bar state for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1503565-hashorizontalscroller?language=objc +func (i_ ImageView) SetHasHorizontalScroller(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setHasHorizontalScroller:"), value) +} + +// Specifies the zoom factor for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504496-zoomfactor?language=objc +func (i_ ImageView) ZoomFactor() float64 { + rv := objc.Call[float64](i_, objc.Sel("zoomFactor")) + return rv +} + +// Specifies the zoom factor for the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504496-zoomfactor?language=objc +func (i_ ImageView) SetZoomFactor(value float64) { + objc.Call[objc.Void](i_, objc.Sel("setZoomFactor:"), value) +} + +// Specifies the image-opening state of the editing pane in the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504092-doubleclickopensimageeditpanel?language=objc +func (i_ ImageView) DoubleClickOpensImageEditPanel() bool { + rv := objc.Call[bool](i_, objc.Sel("doubleClickOpensImageEditPanel")) + return rv +} + +// Specifies the image-opening state of the editing pane in the image view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikimageview/1504092-doubleclickopensimageeditpanel?language=objc +func (i_ ImageView) SetDoubleClickOpensImageEditPanel(value bool) { + objc.Call[objc.Void](i_, objc.Sel("setDoubleClickOpensImageEditPanel:"), value) +} diff --git a/macos/quartz/patch_controller.gen.go b/macos/quartz/patch_controller.gen.go new file mode 100644 index 00000000..8da0f171 --- /dev/null +++ b/macos/quartz/patch_controller.gen.go @@ -0,0 +1,59 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PatchController] class. +var PatchControllerClass = _PatchControllerClass{objc.GetClass("QCPatchController")} + +type _PatchControllerClass struct { + objc.Class +} + +// An interface definition for the [PatchController] class. +type IPatchController interface { + appkit.IController +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcpatchcontroller?language=objc +type PatchController struct { + appkit.Controller +} + +func PatchControllerFrom(ptr unsafe.Pointer) PatchController { + return PatchController{ + Controller: appkit.ControllerFrom(ptr), + } +} + +func (pc _PatchControllerClass) Alloc() PatchController { + rv := objc.Call[PatchController](pc, objc.Sel("alloc")) + return rv +} + +func PatchController_Alloc() PatchController { + return PatchControllerClass.Alloc() +} + +func (pc _PatchControllerClass) New() PatchController { + rv := objc.Call[PatchController](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPatchController() PatchController { + return PatchControllerClass.New() +} + +func (p_ PatchController) Init() PatchController { + rv := objc.Call[PatchController](p_, objc.Sel("init")) + return rv +} diff --git a/macos/quartz/picture_taker.gen.go b/macos/quartz/picture_taker.gen.go new file mode 100644 index 00000000..8a07b566 --- /dev/null +++ b/macos/quartz/picture_taker.gen.go @@ -0,0 +1,177 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PictureTaker] class. +var PictureTakerClass = _PictureTakerClass{objc.GetClass("IKPictureTaker")} + +type _PictureTakerClass struct { + objc.Class +} + +// An interface definition for the [PictureTaker] class. +type IPictureTaker interface { + appkit.IPanel + PopUpRecentsMenuForViewWithDelegateDidEndSelectorContextInfo(aView appkit.IView, delegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) + InputImage() appkit.Image + Mirroring() bool + SetInputImage(image appkit.IImage) + RunModal() int + BeginPictureTakerWithDelegateDidEndSelectorContextInfo(delegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) + BeginPictureTakerSheetForWindowWithDelegateDidEndSelectorContextInfo(aWindow appkit.IWindow, delegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) + SetMirroring(b bool) + OutputImage() appkit.Image +} + +// The IKPictureTaker class represents a panel that allows users to choose images by browsing the file system. The picture taker panel provides an Open Recent menu, supports image cropping, and supports taking snapshots from an iSight or other digital camera. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker?language=objc +type PictureTaker struct { + appkit.Panel +} + +func PictureTakerFrom(ptr unsafe.Pointer) PictureTaker { + return PictureTaker{ + Panel: appkit.PanelFrom(ptr), + } +} + +func (pc _PictureTakerClass) Alloc() PictureTaker { + rv := objc.Call[PictureTaker](pc, objc.Sel("alloc")) + return rv +} + +func PictureTaker_Alloc() PictureTaker { + return PictureTakerClass.Alloc() +} + +func (pc _PictureTakerClass) New() PictureTaker { + rv := objc.Call[PictureTaker](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPictureTaker() PictureTaker { + return PictureTakerClass.New() +} + +func (p_ PictureTaker) Init() PictureTaker { + rv := objc.Call[PictureTaker](p_, objc.Sel("init")) + return rv +} + +func (pc _PictureTakerClass) WindowWithContentViewController(contentViewController appkit.IViewController) PictureTaker { + rv := objc.Call[PictureTaker](pc, objc.Sel("windowWithContentViewController:"), objc.Ptr(contentViewController)) + return rv +} + +// Creates a titled window that contains the specified content view controller. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419551-windowwithcontentviewcontroller?language=objc +func PictureTaker_WindowWithContentViewController(contentViewController appkit.IViewController) PictureTaker { + return PictureTakerClass.WindowWithContentViewController(contentViewController) +} + +func (p_ PictureTaker) InitWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) PictureTaker { + rv := objc.Call[PictureTaker](p_, objc.Sel("initWithContentRect:styleMask:backing:defer:screen:"), contentRect, style, backingStoreType, flag, objc.Ptr(screen)) + return rv +} + +// Initializes an allocated window with the specified values. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nswindow/1419755-initwithcontentrect?language=objc +func NewPictureTakerWithContentRectStyleMaskBackingDeferScreen(contentRect foundation.Rect, style appkit.WindowStyleMask, backingStoreType appkit.BackingStoreType, flag bool, screen appkit.IScreen) PictureTaker { + instance := PictureTakerClass.Alloc().InitWithContentRectStyleMaskBackingDeferScreen(contentRect, style, backingStoreType, flag, screen) + instance.Autorelease() + return instance +} + +// Displays the Open Recent popup menu associated with the picture taker. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1504753-popuprecentsmenuforview?language=objc +func (p_ PictureTaker) PopUpRecentsMenuForViewWithDelegateDidEndSelectorContextInfo(aView appkit.IView, delegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) { + objc.Call[objc.Void](p_, objc.Sel("popUpRecentsMenuForView:withDelegate:didEndSelector:contextInfo:"), objc.Ptr(aView), delegate, didEndSelector, contextInfo) +} + +// Returns the input image associated with the picture taker. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1505220-inputimage?language=objc +func (p_ PictureTaker) InputImage() appkit.Image { + rv := objc.Call[appkit.Image](p_, objc.Sel("inputImage")) + return rv +} + +// Returns whether video mirroring is enabled during snapshots. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1504121-mirroring?language=objc +func (p_ PictureTaker) Mirroring() bool { + rv := objc.Call[bool](p_, objc.Sel("mirroring")) + return rv +} + +// Set the image input for the picture taker. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1503724-setinputimage?language=objc +func (p_ PictureTaker) SetInputImage(image appkit.IImage) { + objc.Call[objc.Void](p_, objc.Sel("setInputImage:"), objc.Ptr(image)) +} + +// Opens a modal picture taker dialog. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1503911-runmodal?language=objc +func (p_ PictureTaker) RunModal() int { + rv := objc.Call[int](p_, objc.Sel("runModal")) + return rv +} + +// Opens a picture taker pane. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1503448-beginpicturetakerwithdelegate?language=objc +func (p_ PictureTaker) BeginPictureTakerWithDelegateDidEndSelectorContextInfo(delegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) { + objc.Call[objc.Void](p_, objc.Sel("beginPictureTakerWithDelegate:didEndSelector:contextInfo:"), delegate, didEndSelector, contextInfo) +} + +// Opens a picture taker as a sheet whose parent is the specified window. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1504302-beginpicturetakersheetforwindow?language=objc +func (p_ PictureTaker) BeginPictureTakerSheetForWindowWithDelegateDidEndSelectorContextInfo(aWindow appkit.IWindow, delegate objc.IObject, didEndSelector objc.Selector, contextInfo unsafe.Pointer) { + objc.Call[objc.Void](p_, objc.Sel("beginPictureTakerSheetForWindow:withDelegate:didEndSelector:contextInfo:"), objc.Ptr(aWindow), delegate, didEndSelector, contextInfo) +} + +// Controls whether the receiver enables video mirroring during snapshots. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1504915-setmirroring?language=objc +func (p_ PictureTaker) SetMirroring(b bool) { + objc.Call[objc.Void](p_, objc.Sel("setMirroring:"), b) +} + +// Returns a shared IKPictureTaker instance, creating it if necessary. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1503805-picturetaker?language=objc +func (pc _PictureTakerClass) PictureTaker() PictureTaker { + rv := objc.Call[PictureTaker](pc, objc.Sel("pictureTaker")) + return rv +} + +// Returns a shared IKPictureTaker instance, creating it if necessary. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1503805-picturetaker?language=objc +func PictureTaker_PictureTaker() PictureTaker { + return PictureTakerClass.PictureTaker() +} + +// Returns the edited image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikpicturetaker/1504563-outputimage?language=objc +func (p_ PictureTaker) OutputImage() appkit.Image { + rv := objc.Call[appkit.Image](p_, objc.Sel("outputImage")) + return rv +} diff --git a/macos/quartz/plug_in.gen.go b/macos/quartz/plug_in.gen.go new file mode 100644 index 00000000..0fa1ff90 --- /dev/null +++ b/macos/quartz/plug_in.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlugIn] class. +var PlugInClass = _PlugInClass{objc.GetClass("QCPlugIn")} + +type _PlugInClass struct { + objc.Class +} + +// An interface definition for the [PlugIn] class. +type IPlugIn interface { + objc.IObject +} + +// The QCPlugIn class provides the base class to subclass for writing custom Quartz Composer patches. You implement a custom patch by subclassing QCPlugIn, overriding the appropriate methods, packaging the code as an NSBundle object, and installing the bundle in the appropriate location. A bundle can contain more than one subclass of QCPlugIn, allowing you to provide a suite of custom patches in one bundle. [devLink-1733122] provides detailed instructions on how to create and package a custom patch. QCPlugIn Class Reference supplements the information in the programming guide. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcplugin?language=objc +type PlugIn struct { + objc.Object +} + +func PlugInFrom(ptr unsafe.Pointer) PlugIn { + return PlugIn{ + Object: objc.ObjectFrom(ptr), + } +} + +func (pc _PlugInClass) Alloc() PlugIn { + rv := objc.Call[PlugIn](pc, objc.Sel("alloc")) + return rv +} + +func PlugIn_Alloc() PlugIn { + return PlugInClass.Alloc() +} + +func (pc _PlugInClass) New() PlugIn { + rv := objc.Call[PlugIn](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlugIn() PlugIn { + return PlugInClass.New() +} + +func (p_ PlugIn) Init() PlugIn { + rv := objc.Call[PlugIn](p_, objc.Sel("init")) + return rv +} diff --git a/macos/quartz/plug_in_context.gen.go b/macos/quartz/plug_in_context.gen.go new file mode 100644 index 00000000..aef46504 --- /dev/null +++ b/macos/quartz/plug_in_context.gen.go @@ -0,0 +1,18 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/objc" +) + +// The QCPlugInContext protocol defines methods that you use only from within the execution method (execute:atTime:withArguments:) of a QCPlugIn object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcplugincontext?language=objc +type PPlugInContext interface { +} + +// A concrete type wrapper for the [PPlugInContext] protocol. +type PlugInContextWrapper struct { + objc.Object +} diff --git a/macos/quartz/plug_in_input_image_source.gen.go b/macos/quartz/plug_in_input_image_source.gen.go new file mode 100644 index 00000000..3648ef75 --- /dev/null +++ b/macos/quartz/plug_in_input_image_source.gen.go @@ -0,0 +1,18 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/objc" +) + +// The QCPlugInInputImageSource protocol eliminates the need to use explicit image types for the image input ports on your custom patch. Not only does using the protocol avoid restrictions of a specific image type, but it avoids impedance mismatches, and provides better performance by deferring pixel computation until it is needed. When you need to access the pixels in an image, you simply convert the image to a representation (texture or buffer) using one of the methods defined by the QCPlugInInputImageSource protocol. Use a texture representation when you want to use input images on the GPU. Use a buffer representation when you want to use input images on the CPU. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcplugininputimagesource?language=objc +type PPlugInInputImageSource interface { +} + +// A concrete type wrapper for the [PPlugInInputImageSource] protocol. +type PlugInInputImageSourceWrapper struct { + objc.Object +} diff --git a/macos/quartz/plug_in_output_image_provider.gen.go b/macos/quartz/plug_in_output_image_provider.gen.go new file mode 100644 index 00000000..a3338dfd --- /dev/null +++ b/macos/quartz/plug_in_output_image_provider.gen.go @@ -0,0 +1,18 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/objc" +) + +// The QCPlugInOuputImageProvider protocol eliminates the need to use explicit image types for the image output ports on a custom patch. The methods in this protocol are called by the Quartz Composer engine when the output image is needed. If your custom patch has an image output port, you need to implement the appropriate methods for rendering image data and to supply information about the rendering destination and the image bounds. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcpluginoutputimageprovider?language=objc +type PPlugInOutputImageProvider interface { +} + +// A concrete type wrapper for the [PPlugInOutputImageProvider] protocol. +type PlugInOutputImageProviderWrapper struct { + objc.Object +} diff --git a/macos/quartz/plug_in_view_controller.gen.go b/macos/quartz/plug_in_view_controller.gen.go new file mode 100644 index 00000000..13fc3325 --- /dev/null +++ b/macos/quartz/plug_in_view_controller.gen.go @@ -0,0 +1,74 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PlugInViewController] class. +var PlugInViewControllerClass = _PlugInViewControllerClass{objc.GetClass("QCPlugInViewController")} + +type _PlugInViewControllerClass struct { + objc.Class +} + +// An interface definition for the [PlugInViewController] class. +type IPlugInViewController interface { + appkit.IViewController +} + +// The QCPlugInViewController class communicates (through Cocoa bindings) between a custom patch and the view used for the internal settings of the custom patch. Only custom patches that use internal settings exposed to the user need to use the QCPlugInViewController class. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcpluginviewcontroller?language=objc +type PlugInViewController struct { + appkit.ViewController +} + +func PlugInViewControllerFrom(ptr unsafe.Pointer) PlugInViewController { + return PlugInViewController{ + ViewController: appkit.ViewControllerFrom(ptr), + } +} + +func (pc _PlugInViewControllerClass) Alloc() PlugInViewController { + rv := objc.Call[PlugInViewController](pc, objc.Sel("alloc")) + return rv +} + +func PlugInViewController_Alloc() PlugInViewController { + return PlugInViewControllerClass.Alloc() +} + +func (pc _PlugInViewControllerClass) New() PlugInViewController { + rv := objc.Call[PlugInViewController](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPlugInViewController() PlugInViewController { + return PlugInViewControllerClass.New() +} + +func (p_ PlugInViewController) Init() PlugInViewController { + rv := objc.Call[PlugInViewController](p_, objc.Sel("init")) + return rv +} + +func (p_ PlugInViewController) InitWithNibNameBundle(nibNameOrNil appkit.NibName, nibBundleOrNil foundation.IBundle) PlugInViewController { + rv := objc.Call[PlugInViewController](p_, objc.Sel("initWithNibName:bundle:"), nibNameOrNil, objc.Ptr(nibBundleOrNil)) + return rv +} + +// Returns a view controller object initialized to the nib file in the specified bundle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsviewcontroller/1434481-initwithnibname?language=objc +func NewPlugInViewControllerWithNibNameBundle(nibNameOrNil appkit.NibName, nibBundleOrNil foundation.IBundle) PlugInViewController { + instance := PlugInViewControllerClass.Alloc().InitWithNibNameBundle(nibNameOrNil, nibBundleOrNil) + instance.Autorelease() + return instance +} diff --git a/macos/quartz/protocols.gen.m b/macos/quartz/protocols.gen.m new file mode 100644 index 00000000..88e915f6 --- /dev/null +++ b/macos/quartz/protocols.gen.m @@ -0,0 +1,17 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "Quartz/Quartz.h" + +void importQuartzProtocols() { + id o; + o = @protocol(IKCameraDeviceViewDelegate); + o = @protocol(IKDeviceBrowserViewDelegate); + o = @protocol(IKFilterCustomUIProvider); + o = @protocol(IKImageEditPanelDataSource); + o = @protocol(IKScannerDeviceViewDelegate); + o = @protocol(IKSlideshowDataSource); + o = @protocol(QCCompositionRenderer); + o = @protocol(QCPlugInContext); + o = @protocol(QCPlugInInputImageSource); + o = @protocol(QCPlugInOutputImageProvider); +} diff --git a/macos/quartz/quartz_filter.gen.go b/macos/quartz/quartz_filter.gen.go new file mode 100644 index 00000000..968f3f54 --- /dev/null +++ b/macos/quartz/quartz_filter.gen.go @@ -0,0 +1,149 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [QuartzFilter] class. +var QuartzFilterClass = _QuartzFilterClass{objc.GetClass("QuartzFilter")} + +type _QuartzFilterClass struct { + objc.Class +} + +// An interface definition for the [QuartzFilter] class. +type IQuartzFilter interface { + objc.IObject + ApplyToContext(aContext coregraphics.ContextRef) bool + RemoveFromContext(aContext coregraphics.ContextRef) + LocalizedName() string + Properties() foundation.Dictionary + Url() foundation.URL +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter?language=objc +type QuartzFilter struct { + objc.Object +} + +func QuartzFilterFrom(ptr unsafe.Pointer) QuartzFilter { + return QuartzFilter{ + Object: objc.ObjectFrom(ptr), + } +} + +func (qc _QuartzFilterClass) Alloc() QuartzFilter { + rv := objc.Call[QuartzFilter](qc, objc.Sel("alloc")) + return rv +} + +func QuartzFilter_Alloc() QuartzFilter { + return QuartzFilterClass.Alloc() +} + +func (qc _QuartzFilterClass) New() QuartzFilter { + rv := objc.Call[QuartzFilter](qc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewQuartzFilter() QuartzFilter { + return QuartzFilterClass.New() +} + +func (q_ QuartzFilter) Init() QuartzFilter { + rv := objc.Call[QuartzFilter](q_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433684-applytocontext?language=objc +func (q_ QuartzFilter) ApplyToContext(aContext coregraphics.ContextRef) bool { + rv := objc.Call[bool](q_, objc.Sel("applyToContext:"), aContext) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433679-removefromcontext?language=objc +func (q_ QuartzFilter) RemoveFromContext(aContext coregraphics.ContextRef) { + objc.Call[objc.Void](q_, objc.Sel("removeFromContext:"), aContext) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433671-quartzfilterwithurl?language=objc +func (qc _QuartzFilterClass) QuartzFilterWithURL(aURL foundation.IURL) QuartzFilter { + rv := objc.Call[QuartzFilter](qc, objc.Sel("quartzFilterWithURL:"), objc.Ptr(aURL)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433671-quartzfilterwithurl?language=objc +func QuartzFilter_QuartzFilterWithURL(aURL foundation.IURL) QuartzFilter { + return QuartzFilterClass.QuartzFilterWithURL(aURL) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433675-quartzfilterwithoutputintents?language=objc +func (qc _QuartzFilterClass) QuartzFilterWithOutputIntents(outputIntents []objc.IObject) QuartzFilter { + rv := objc.Call[QuartzFilter](qc, objc.Sel("quartzFilterWithOutputIntents:"), outputIntents) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433675-quartzfilterwithoutputintents?language=objc +func QuartzFilter_QuartzFilterWithOutputIntents(outputIntents []objc.IObject) QuartzFilter { + return QuartzFilterClass.QuartzFilterWithOutputIntents(outputIntents) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433673-quartzfilterwithproperties?language=objc +func (qc _QuartzFilterClass) QuartzFilterWithProperties(properties foundation.Dictionary) QuartzFilter { + rv := objc.Call[QuartzFilter](qc, objc.Sel("quartzFilterWithProperties:"), properties) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433673-quartzfilterwithproperties?language=objc +func QuartzFilter_QuartzFilterWithProperties(properties foundation.Dictionary) QuartzFilter { + return QuartzFilterClass.QuartzFilterWithProperties(properties) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433682-localizedname?language=objc +func (q_ QuartzFilter) LocalizedName() string { + rv := objc.Call[string](q_, objc.Sel("localizedName")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433686-properties?language=objc +func (q_ QuartzFilter) Properties() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](q_, objc.Sel("properties")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilter/1433677-url?language=objc +func (q_ QuartzFilter) Url() foundation.URL { + rv := objc.Call[foundation.URL](q_, objc.Sel("url")) + return rv +} diff --git a/macos/quartz/quartz_filter_manager.gen.go b/macos/quartz/quartz_filter_manager.gen.go new file mode 100644 index 00000000..1199f071 --- /dev/null +++ b/macos/quartz/quartz_filter_manager.gen.go @@ -0,0 +1,152 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [QuartzFilterManager] class. +var QuartzFilterManagerClass = _QuartzFilterManagerClass{objc.GetClass("QuartzFilterManager")} + +type _QuartzFilterManagerClass struct { + objc.Class +} + +// An interface definition for the [QuartzFilterManager] class. +type IQuartzFilterManager interface { + objc.IObject + SetDelegate(aDelegate objc.IObject) + SelectFilter(filter IQuartzFilter) bool + FilterPanel() appkit.Panel + Delegate() objc.Object + FilterView() QuartzFilterView + SelectedFilter() QuartzFilter + ImportFilter(filterProperties foundation.Dictionary) QuartzFilter +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager?language=objc +type QuartzFilterManager struct { + objc.Object +} + +func QuartzFilterManagerFrom(ptr unsafe.Pointer) QuartzFilterManager { + return QuartzFilterManager{ + Object: objc.ObjectFrom(ptr), + } +} + +func (qc _QuartzFilterManagerClass) Alloc() QuartzFilterManager { + rv := objc.Call[QuartzFilterManager](qc, objc.Sel("alloc")) + return rv +} + +func QuartzFilterManager_Alloc() QuartzFilterManager { + return QuartzFilterManagerClass.Alloc() +} + +func (qc _QuartzFilterManagerClass) New() QuartzFilterManager { + rv := objc.Call[QuartzFilterManager](qc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewQuartzFilterManager() QuartzFilterManager { + return QuartzFilterManagerClass.New() +} + +func (q_ QuartzFilterManager) Init() QuartzFilterManager { + rv := objc.Call[QuartzFilterManager](q_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1505098-setdelegate?language=objc +func (q_ QuartzFilterManager) SetDelegate(aDelegate objc.IObject) { + objc.Call[objc.Void](q_, objc.Sel("setDelegate:"), aDelegate) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1503913-selectfilter?language=objc +func (q_ QuartzFilterManager) SelectFilter(filter IQuartzFilter) bool { + rv := objc.Call[bool](q_, objc.Sel("selectFilter:"), objc.Ptr(filter)) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1505297-filterpanel?language=objc +func (q_ QuartzFilterManager) FilterPanel() appkit.Panel { + rv := objc.Call[appkit.Panel](q_, objc.Sel("filterPanel")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1503409-delegate?language=objc +func (q_ QuartzFilterManager) Delegate() objc.Object { + rv := objc.Call[objc.Object](q_, objc.Sel("delegate")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1505290-filterview?language=objc +func (q_ QuartzFilterManager) FilterView() QuartzFilterView { + rv := objc.Call[QuartzFilterView](q_, objc.Sel("filterView")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1518336-filtermanager?language=objc +func (qc _QuartzFilterManagerClass) FilterManager() QuartzFilterManager { + rv := objc.Call[QuartzFilterManager](qc, objc.Sel("filterManager")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1518336-filtermanager?language=objc +func QuartzFilterManager_FilterManager() QuartzFilterManager { + return QuartzFilterManagerClass.FilterManager() +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1503432-filtersindomains?language=objc +func (qc _QuartzFilterManagerClass) FiltersInDomains(domains []objc.IObject) []objc.Object { + rv := objc.Call[[]objc.Object](qc, objc.Sel("filtersInDomains:"), domains) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1503432-filtersindomains?language=objc +func QuartzFilterManager_FiltersInDomains(domains []objc.IObject) []objc.Object { + return QuartzFilterManagerClass.FiltersInDomains(domains) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1504816-selectedfilter?language=objc +func (q_ QuartzFilterManager) SelectedFilter() QuartzFilter { + rv := objc.Call[QuartzFilter](q_, objc.Sel("selectedFilter")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfiltermanager/1503784-importfilter?language=objc +func (q_ QuartzFilterManager) ImportFilter(filterProperties foundation.Dictionary) QuartzFilter { + rv := objc.Call[QuartzFilter](q_, objc.Sel("importFilter:"), filterProperties) + return rv +} diff --git a/macos/quartz/quartz_filter_view.gen.go b/macos/quartz/quartz_filter_view.gen.go new file mode 100644 index 00000000..59bda326 --- /dev/null +++ b/macos/quartz/quartz_filter_view.gen.go @@ -0,0 +1,82 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [QuartzFilterView] class. +var QuartzFilterViewClass = _QuartzFilterViewClass{objc.GetClass("QuartzFilterView")} + +type _QuartzFilterViewClass struct { + objc.Class +} + +// An interface definition for the [QuartzFilterView] class. +type IQuartzFilterView interface { + appkit.IView + SizeToFit() +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilterview?language=objc +type QuartzFilterView struct { + appkit.View +} + +func QuartzFilterViewFrom(ptr unsafe.Pointer) QuartzFilterView { + return QuartzFilterView{ + View: appkit.ViewFrom(ptr), + } +} + +func (qc _QuartzFilterViewClass) Alloc() QuartzFilterView { + rv := objc.Call[QuartzFilterView](qc, objc.Sel("alloc")) + return rv +} + +func QuartzFilterView_Alloc() QuartzFilterView { + return QuartzFilterViewClass.Alloc() +} + +func (qc _QuartzFilterViewClass) New() QuartzFilterView { + rv := objc.Call[QuartzFilterView](qc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewQuartzFilterView() QuartzFilterView { + return QuartzFilterViewClass.New() +} + +func (q_ QuartzFilterView) Init() QuartzFilterView { + rv := objc.Call[QuartzFilterView](q_, objc.Sel("init")) + return rv +} + +func (q_ QuartzFilterView) InitWithFrame(frameRect foundation.Rect) QuartzFilterView { + rv := objc.Call[QuartzFilterView](q_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewQuartzFilterViewWithFrame(frameRect foundation.Rect) QuartzFilterView { + instance := QuartzFilterViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/quartzfilterview/1505010-sizetofit?language=objc +func (q_ QuartzFilterView) SizeToFit() { + objc.Call[objc.Void](q_, objc.Sel("sizeToFit")) +} diff --git a/macos/quartz/renderer.gen.go b/macos/quartz/renderer.gen.go new file mode 100644 index 00000000..4c3bad56 --- /dev/null +++ b/macos/quartz/renderer.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Renderer] class. +var RendererClass = _RendererClass{objc.GetClass("QCRenderer")} + +type _RendererClass struct { + objc.Class +} + +// An interface definition for the [Renderer] class. +type IRenderer interface { + objc.IObject +} + +// A QCRenderer class is designed for low-level rendering of Quartz Composer compositions. This is the class to use if you want to be in charge of rendering a composition to a specific OpenGL context—either using the NSOpenGLContext class or a CGLContextObj object. QCRenderer also allows you to load, play, and control a composition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcrenderer?language=objc +type Renderer struct { + objc.Object +} + +func RendererFrom(ptr unsafe.Pointer) Renderer { + return Renderer{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RendererClass) Alloc() Renderer { + rv := objc.Call[Renderer](rc, objc.Sel("alloc")) + return rv +} + +func Renderer_Alloc() Renderer { + return RendererClass.Alloc() +} + +func (rc _RendererClass) New() Renderer { + rv := objc.Call[Renderer](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRenderer() Renderer { + return RendererClass.New() +} + +func (r_ Renderer) Init() Renderer { + rv := objc.Call[Renderer](r_, objc.Sel("init")) + return rv +} diff --git a/macos/quartz/save_options.gen.go b/macos/quartz/save_options.gen.go new file mode 100644 index 00000000..2955948c --- /dev/null +++ b/macos/quartz/save_options.gen.go @@ -0,0 +1,151 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SaveOptions] class. +var SaveOptionsClass = _SaveOptionsClass{objc.GetClass("IKSaveOptions")} + +type _SaveOptionsClass struct { + objc.Class +} + +// An interface definition for the [SaveOptions] class. +type ISaveOptions interface { + objc.IObject + AddSaveOptionsToView(view appkit.IView) + AddSaveOptionsAccessoryViewToSavePanel(savePanel appkit.ISavePanel) + ImageUTType() string + Delegate() objc.Object + SetDelegate(value objc.IObject) + ImageProperties() foundation.Dictionary + UserSelection() foundation.Dictionary + RememberLastSetting() bool + SetRememberLastSetting(value bool) +} + +// The IKSaveOptions class initializes, adds, and manages user interface options for saving image data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions?language=objc +type SaveOptions struct { + objc.Object +} + +func SaveOptionsFrom(ptr unsafe.Pointer) SaveOptions { + return SaveOptions{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ SaveOptions) InitWithImagePropertiesImageUTType(imageProperties foundation.Dictionary, imageUTType string) SaveOptions { + rv := objc.Call[SaveOptions](s_, objc.Sel("initWithImageProperties:imageUTType:"), imageProperties, imageUTType) + return rv +} + +// Initializes a save options accessory pane for the provided image properties and uniform type identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1503412-initwithimageproperties?language=objc +func NewSaveOptionsWithImagePropertiesImageUTType(imageProperties foundation.Dictionary, imageUTType string) SaveOptions { + instance := SaveOptionsClass.Alloc().InitWithImagePropertiesImageUTType(imageProperties, imageUTType) + instance.Autorelease() + return instance +} + +func (sc _SaveOptionsClass) Alloc() SaveOptions { + rv := objc.Call[SaveOptions](sc, objc.Sel("alloc")) + return rv +} + +func SaveOptions_Alloc() SaveOptions { + return SaveOptionsClass.Alloc() +} + +func (sc _SaveOptionsClass) New() SaveOptions { + rv := objc.Call[SaveOptions](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSaveOptions() SaveOptions { + return SaveOptionsClass.New() +} + +func (s_ SaveOptions) Init() SaveOptions { + rv := objc.Call[SaveOptions](s_, objc.Sel("init")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1504945-addsaveoptionstoview?language=objc +func (s_ SaveOptions) AddSaveOptionsToView(view appkit.IView) { + objc.Call[objc.Void](s_, objc.Sel("addSaveOptionsToView:"), objc.Ptr(view)) +} + +// Adds IKSaveOptions accessory view to a NSSavePanel. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1503458-addsaveoptionsaccessoryviewtosav?language=objc +func (s_ SaveOptions) AddSaveOptionsAccessoryViewToSavePanel(savePanel appkit.ISavePanel) { + objc.Call[objc.Void](s_, objc.Sel("addSaveOptionsAccessoryViewToSavePanel:"), objc.Ptr(savePanel)) +} + +// Returns the uniform type identifier that reflects the user’s selection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1504388-imageuttype?language=objc +func (s_ SaveOptions) ImageUTType() string { + rv := objc.Call[string](s_, objc.Sel("imageUTType")) + return rv +} + +// Specifies the delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1503653-delegate?language=objc +func (s_ SaveOptions) Delegate() objc.Object { + rv := objc.Call[objc.Object](s_, objc.Sel("delegate")) + return rv +} + +// Specifies the delegate object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1503653-delegate?language=objc +func (s_ SaveOptions) SetDelegate(value objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("setDelegate:"), value) +} + +// Returns a dictionary of updated image properties that reflects the user’s selection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1505299-imageproperties?language=objc +func (s_ SaveOptions) ImageProperties() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](s_, objc.Sel("imageProperties")) + return rv +} + +// Returns a dictionary that contains the save options selected by the user. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/1504791-userselection?language=objc +func (s_ SaveOptions) UserSelection() foundation.Dictionary { + rv := objc.Call[foundation.Dictionary](s_, objc.Sel("userSelection")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/3738462-rememberlastsetting?language=objc +func (s_ SaveOptions) RememberLastSetting() bool { + rv := objc.Call[bool](s_, objc.Sel("rememberLastSetting")) + return rv +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/iksaveoptions/3738462-rememberlastsetting?language=objc +func (s_ SaveOptions) SetRememberLastSetting(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setRememberLastSetting:"), value) +} diff --git a/macos/quartz/scanner_device_view.gen.go b/macos/quartz/scanner_device_view.gen.go new file mode 100644 index 00000000..0e3435c1 --- /dev/null +++ b/macos/quartz/scanner_device_view.gen.go @@ -0,0 +1,287 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ScannerDeviceView] class. +var ScannerDeviceViewClass = _ScannerDeviceViewClass{objc.GetClass("IKScannerDeviceView")} + +type _ScannerDeviceViewClass struct { + objc.Class +} + +// An interface definition for the [ScannerDeviceView] class. +type IScannerDeviceView interface { + appkit.IView + DownloadsDirectory() foundation.URL + SetDownloadsDirectory(value foundation.IURL) + ScanControlLabel() string + SetScanControlLabel(value string) + HasDisplayModeSimple() bool + SetHasDisplayModeSimple(value bool) + DisplaysDownloadsDirectoryControl() bool + SetDisplaysDownloadsDirectoryControl(value bool) + DisplaysPostProcessApplicationControl() bool + SetDisplaysPostProcessApplicationControl(value bool) + TransferMode() ScannerDeviceViewTransferMode + SetTransferMode(value ScannerDeviceViewTransferMode) + Delegate() ScannerDeviceViewDelegateWrapper + SetDelegate(value PScannerDeviceViewDelegate) + SetDelegateObject(valueObject objc.IObject) + PostProcessApplication() foundation.URL + SetPostProcessApplication(value foundation.IURL) + DocumentName() string + SetDocumentName(value string) + Mode() ScannerDeviceViewDisplayMode + SetMode(value ScannerDeviceViewDisplayMode) + OverviewControlLabel() string + SetOverviewControlLabel(value string) + HasDisplayModeAdvanced() bool + SetHasDisplayModeAdvanced(value bool) +} + +// The IKScannerDeviceView class displays a view that allows scanning. It can be customized by specifying the display mode. The delegate receives the scanned data and must implement the IKScannerDeviceViewDelegate protocol. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview?language=objc +type ScannerDeviceView struct { + appkit.View +} + +func ScannerDeviceViewFrom(ptr unsafe.Pointer) ScannerDeviceView { + return ScannerDeviceView{ + View: appkit.ViewFrom(ptr), + } +} + +func (sc _ScannerDeviceViewClass) Alloc() ScannerDeviceView { + rv := objc.Call[ScannerDeviceView](sc, objc.Sel("alloc")) + return rv +} + +func ScannerDeviceView_Alloc() ScannerDeviceView { + return ScannerDeviceViewClass.Alloc() +} + +func (sc _ScannerDeviceViewClass) New() ScannerDeviceView { + rv := objc.Call[ScannerDeviceView](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewScannerDeviceView() ScannerDeviceView { + return ScannerDeviceViewClass.New() +} + +func (s_ ScannerDeviceView) Init() ScannerDeviceView { + rv := objc.Call[ScannerDeviceView](s_, objc.Sel("init")) + return rv +} + +func (s_ ScannerDeviceView) InitWithFrame(frameRect foundation.Rect) ScannerDeviceView { + rv := objc.Call[ScannerDeviceView](s_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewScannerDeviceViewWithFrame(frameRect foundation.Rect) ScannerDeviceView { + instance := ScannerDeviceViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} + +// The directory where scans are saved. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503585-downloadsdirectory?language=objc +func (s_ ScannerDeviceView) DownloadsDirectory() foundation.URL { + rv := objc.Call[foundation.URL](s_, objc.Sel("downloadsDirectory")) + return rv +} + +// The directory where scans are saved. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503585-downloadsdirectory?language=objc +func (s_ ScannerDeviceView) SetDownloadsDirectory(value foundation.IURL) { + objc.Call[objc.Void](s_, objc.Sel("setDownloadsDirectory:"), objc.Ptr(value)) +} + +// Allows customization of the “Scan” label. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504143-scancontrollabel?language=objc +func (s_ ScannerDeviceView) ScanControlLabel() string { + rv := objc.Call[string](s_, objc.Sel("scanControlLabel")) + return rv +} + +// Allows customization of the “Scan” label. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504143-scancontrollabel?language=objc +func (s_ ScannerDeviceView) SetScanControlLabel(value string) { + objc.Call[objc.Void](s_, objc.Sel("setScanControlLabel:"), value) +} + +// The property that determines whether the scanner view uses the simple display mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504506-hasdisplaymodesimple?language=objc +func (s_ ScannerDeviceView) HasDisplayModeSimple() bool { + rv := objc.Call[bool](s_, objc.Sel("hasDisplayModeSimple")) + return rv +} + +// The property that determines whether the scanner view uses the simple display mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504506-hasdisplaymodesimple?language=objc +func (s_ ScannerDeviceView) SetHasDisplayModeSimple(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setHasDisplayModeSimple:"), value) +} + +// Determines whether the downloads directory control is displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503830-displaysdownloadsdirectorycontro?language=objc +func (s_ ScannerDeviceView) DisplaysDownloadsDirectoryControl() bool { + rv := objc.Call[bool](s_, objc.Sel("displaysDownloadsDirectoryControl")) + return rv +} + +// Determines whether the downloads directory control is displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503830-displaysdownloadsdirectorycontro?language=objc +func (s_ ScannerDeviceView) SetDisplaysDownloadsDirectoryControl(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setDisplaysDownloadsDirectoryControl:"), value) +} + +// Specifies whether the post processing application control is displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1505053-displayspostprocessapplicationco?language=objc +func (s_ ScannerDeviceView) DisplaysPostProcessApplicationControl() bool { + rv := objc.Call[bool](s_, objc.Sel("displaysPostProcessApplicationControl")) + return rv +} + +// Specifies whether the post processing application control is displayed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1505053-displayspostprocessapplicationco?language=objc +func (s_ ScannerDeviceView) SetDisplaysPostProcessApplicationControl(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setDisplaysPostProcessApplicationControl:"), value) +} + +// Determines how the scanned content is provided to the delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1505017-transfermode?language=objc +func (s_ ScannerDeviceView) TransferMode() ScannerDeviceViewTransferMode { + rv := objc.Call[ScannerDeviceViewTransferMode](s_, objc.Sel("transferMode")) + return rv +} + +// Determines how the scanned content is provided to the delegate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1505017-transfermode?language=objc +func (s_ ScannerDeviceView) SetTransferMode(value ScannerDeviceViewTransferMode) { + objc.Call[objc.Void](s_, objc.Sel("setTransferMode:"), value) +} + +// The scanner device delegate [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504170-delegate?language=objc +func (s_ ScannerDeviceView) Delegate() ScannerDeviceViewDelegateWrapper { + rv := objc.Call[ScannerDeviceViewDelegateWrapper](s_, objc.Sel("delegate")) + return rv +} + +// The scanner device delegate [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504170-delegate?language=objc +func (s_ ScannerDeviceView) SetDelegate(value PScannerDeviceViewDelegate) { + po0 := objc.WrapAsProtocol("IKScannerDeviceViewDelegate", value) + objc.Call[objc.Void](s_, objc.Sel("setDelegate:"), po0) +} + +// The scanner device delegate [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504170-delegate?language=objc +func (s_ ScannerDeviceView) SetDelegateObject(valueObject objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("setDelegate:"), objc.Ptr(valueObject)) +} + +// The URL of the application to use for post processing of the scan. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1505215-postprocessapplication?language=objc +func (s_ ScannerDeviceView) PostProcessApplication() foundation.URL { + rv := objc.Call[foundation.URL](s_, objc.Sel("postProcessApplication")) + return rv +} + +// The URL of the application to use for post processing of the scan. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1505215-postprocessapplication?language=objc +func (s_ ScannerDeviceView) SetPostProcessApplication(value foundation.IURL) { + objc.Call[objc.Void](s_, objc.Sel("setPostProcessApplication:"), objc.Ptr(value)) +} + +// Returns the document name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503744-documentname?language=objc +func (s_ ScannerDeviceView) DocumentName() string { + rv := objc.Call[string](s_, objc.Sel("documentName")) + return rv +} + +// Returns the document name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503744-documentname?language=objc +func (s_ ScannerDeviceView) SetDocumentName(value string) { + objc.Call[objc.Void](s_, objc.Sel("setDocumentName:"), value) +} + +// The display mode used by the device view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504321-mode?language=objc +func (s_ ScannerDeviceView) Mode() ScannerDeviceViewDisplayMode { + rv := objc.Call[ScannerDeviceViewDisplayMode](s_, objc.Sel("mode")) + return rv +} + +// The display mode used by the device view. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504321-mode?language=objc +func (s_ ScannerDeviceView) SetMode(value ScannerDeviceViewDisplayMode) { + objc.Call[objc.Void](s_, objc.Sel("setMode:"), value) +} + +// Allows customization of the “Overview” label. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504055-overviewcontrollabel?language=objc +func (s_ ScannerDeviceView) OverviewControlLabel() string { + rv := objc.Call[string](s_, objc.Sel("overviewControlLabel")) + return rv +} + +// Allows customization of the “Overview” label. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1504055-overviewcontrollabel?language=objc +func (s_ ScannerDeviceView) SetOverviewControlLabel(value string) { + objc.Call[objc.Void](s_, objc.Sel("setOverviewControlLabel:"), value) +} + +// The property that determines whether the scanner view uses the advanced display mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503437-hasdisplaymodeadvanced?language=objc +func (s_ ScannerDeviceView) HasDisplayModeAdvanced() bool { + rv := objc.Call[bool](s_, objc.Sel("hasDisplayModeAdvanced")) + return rv +} + +// The property that determines whether the scanner view uses the advanced display mode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceview/1503437-hasdisplaymodeadvanced?language=objc +func (s_ ScannerDeviceView) SetHasDisplayModeAdvanced(value bool) { + objc.Call[objc.Void](s_, objc.Sel("setHasDisplayModeAdvanced:"), value) +} diff --git a/macos/quartz/scanner_device_view_delegate.gen.go b/macos/quartz/scanner_device_view_delegate.gen.go new file mode 100644 index 00000000..d92d54c6 --- /dev/null +++ b/macos/quartz/scanner_device_view_delegate.gen.go @@ -0,0 +1,56 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The IKScannerDeviceViewDelegate protocol defines the delegate protocol that the IKScannerDeviceView delegate must conform to. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceviewdelegate?language=objc +type PScannerDeviceViewDelegate interface { + // optional + ScannerDeviceViewDidScanToURLError(scannerDeviceView ScannerDeviceView, url foundation.URL, error foundation.Error) + HasScannerDeviceViewDidScanToURLError() bool +} + +// A delegate implementation builder for the [PScannerDeviceViewDelegate] protocol. +type ScannerDeviceViewDelegate struct { + _ScannerDeviceViewDidScanToURLError func(scannerDeviceView ScannerDeviceView, url foundation.URL, error foundation.Error) +} + +func (di *ScannerDeviceViewDelegate) HasScannerDeviceViewDidScanToURLError() bool { + return di._ScannerDeviceViewDidScanToURLError != nil +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceviewdelegate/1504768-scannerdeviceview?language=objc +func (di *ScannerDeviceViewDelegate) SetScannerDeviceViewDidScanToURLError(f func(scannerDeviceView ScannerDeviceView, url foundation.URL, error foundation.Error)) { + di._ScannerDeviceViewDidScanToURLError = f +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceviewdelegate/1504768-scannerdeviceview?language=objc +func (di *ScannerDeviceViewDelegate) ScannerDeviceViewDidScanToURLError(scannerDeviceView ScannerDeviceView, url foundation.URL, error foundation.Error) { + di._ScannerDeviceViewDidScanToURLError(scannerDeviceView, url, error) +} + +// A concrete type wrapper for the [PScannerDeviceViewDelegate] protocol. +type ScannerDeviceViewDelegateWrapper struct { + objc.Object +} + +func (s_ ScannerDeviceViewDelegateWrapper) HasScannerDeviceViewDidScanToURLError() bool { + return s_.RespondsToSelector(objc.Sel("scannerDeviceView:didScanToURL:error:")) +} + +// [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikscannerdeviceviewdelegate/1504768-scannerdeviceview?language=objc +func (s_ ScannerDeviceViewDelegateWrapper) ScannerDeviceViewDidScanToURLError(scannerDeviceView IScannerDeviceView, url foundation.IURL, error foundation.IError) { + objc.Call[objc.Void](s_, objc.Sel("scannerDeviceView:didScanToURL:error:"), objc.Ptr(scannerDeviceView), objc.Ptr(url), objc.Ptr(error)) +} diff --git a/macos/quartz/slideshow.gen.go b/macos/quartz/slideshow.gen.go new file mode 100644 index 00000000..cd42bc32 --- /dev/null +++ b/macos/quartz/slideshow.gen.go @@ -0,0 +1,170 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Slideshow] class. +var SlideshowClass = _SlideshowClass{objc.GetClass("IKSlideshow")} + +type _SlideshowClass struct { + objc.Class +} + +// An interface definition for the [Slideshow] class. +type ISlideshow interface { + objc.IObject + IndexOfCurrentSlideshowItem() uint + RunSlideshowWithDataSourceInModeOptions(dataSource PSlideshowDataSource, slideshowMode string, slideshowOptions foundation.Dictionary) + RunSlideshowWithDataSourceObjectInModeOptions(dataSourceObject objc.IObject, slideshowMode string, slideshowOptions foundation.Dictionary) + StopSlideshow(sender objc.IObject) + ReloadSlideshowItemAtIndex(index uint) + ReloadData() + AutoPlayDelay() foundation.TimeInterval + SetAutoPlayDelay(value foundation.TimeInterval) +} + +// The IKSlideshow class encapsulates a data source and options for a slideshow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow?language=objc +type Slideshow struct { + objc.Object +} + +func SlideshowFrom(ptr unsafe.Pointer) Slideshow { + return Slideshow{ + Object: objc.ObjectFrom(ptr), + } +} + +func (sc _SlideshowClass) Alloc() Slideshow { + rv := objc.Call[Slideshow](sc, objc.Sel("alloc")) + return rv +} + +func Slideshow_Alloc() Slideshow { + return SlideshowClass.Alloc() +} + +func (sc _SlideshowClass) New() Slideshow { + rv := objc.Call[Slideshow](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSlideshow() Slideshow { + return SlideshowClass.New() +} + +func (s_ Slideshow) Init() Slideshow { + rv := objc.Call[Slideshow](s_, objc.Sel("init")) + return rv +} + +// Exports a slideshow item to the application that has the provided bundle identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1503513-exportslideshowitem?language=objc +func (sc _SlideshowClass) ExportSlideshowItemToApplication(item objc.IObject, applicationBundleIdentifier string) { + objc.Call[objc.Void](sc, objc.Sel("exportSlideshowItem:toApplication:"), item, applicationBundleIdentifier) +} + +// Exports a slideshow item to the application that has the provided bundle identifier. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1503513-exportslideshowitem?language=objc +func Slideshow_ExportSlideshowItemToApplication(item objc.IObject, applicationBundleIdentifier string) { + SlideshowClass.ExportSlideshowItemToApplication(item, applicationBundleIdentifier) +} + +// Returns the index of the current slideshow item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1503700-indexofcurrentslideshowitem?language=objc +func (s_ Slideshow) IndexOfCurrentSlideshowItem() uint { + rv := objc.Call[uint](s_, objc.Sel("indexOfCurrentSlideshowItem")) + return rv +} + +// Runs a slideshow that contains the specified kind of items, provided from a data source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504036-runslideshowwithdatasource?language=objc +func (s_ Slideshow) RunSlideshowWithDataSourceInModeOptions(dataSource PSlideshowDataSource, slideshowMode string, slideshowOptions foundation.Dictionary) { + po0 := objc.WrapAsProtocol("IKSlideshowDataSource", dataSource) + objc.Call[objc.Void](s_, objc.Sel("runSlideshowWithDataSource:inMode:options:"), po0, slideshowMode, slideshowOptions) +} + +// Runs a slideshow that contains the specified kind of items, provided from a data source. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504036-runslideshowwithdatasource?language=objc +func (s_ Slideshow) RunSlideshowWithDataSourceObjectInModeOptions(dataSourceObject objc.IObject, slideshowMode string, slideshowOptions foundation.Dictionary) { + objc.Call[objc.Void](s_, objc.Sel("runSlideshowWithDataSource:inMode:options:"), objc.Ptr(dataSourceObject), slideshowMode, slideshowOptions) +} + +// Stops a slideshow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1503801-stopslideshow?language=objc +func (s_ Slideshow) StopSlideshow(sender objc.IObject) { + objc.Call[objc.Void](s_, objc.Sel("stopSlideshow:"), sender) +} + +// Finds out whether the slideshow can export its contents to an application. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504783-canexporttoapplication?language=objc +func (sc _SlideshowClass) CanExportToApplication(applicationBundleIdentifier string) bool { + rv := objc.Call[bool](sc, objc.Sel("canExportToApplication:"), applicationBundleIdentifier) + return rv +} + +// Finds out whether the slideshow can export its contents to an application. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504783-canexporttoapplication?language=objc +func Slideshow_CanExportToApplication(applicationBundleIdentifier string) bool { + return SlideshowClass.CanExportToApplication(applicationBundleIdentifier) +} + +// Reloads the data for a slideshow, starting at the specified index. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504713-reloadslideshowitematindex?language=objc +func (s_ Slideshow) ReloadSlideshowItemAtIndex(index uint) { + objc.Call[objc.Void](s_, objc.Sel("reloadSlideshowItemAtIndex:"), index) +} + +// Returns a shared instance of a slideshow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504883-sharedslideshow?language=objc +func (sc _SlideshowClass) SharedSlideshow() Slideshow { + rv := objc.Call[Slideshow](sc, objc.Sel("sharedSlideshow")) + return rv +} + +// Returns a shared instance of a slideshow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504883-sharedslideshow?language=objc +func Slideshow_SharedSlideshow() Slideshow { + return SlideshowClass.SharedSlideshow() +} + +// Reloads the data for a slideshow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504298-reloaddata?language=objc +func (s_ Slideshow) ReloadData() { + objc.Call[objc.Void](s_, objc.Sel("reloadData")) +} + +// Controls the interval of time before a slideshow starts to play automatically. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504967-autoplaydelay?language=objc +func (s_ Slideshow) AutoPlayDelay() foundation.TimeInterval { + rv := objc.Call[foundation.TimeInterval](s_, objc.Sel("autoPlayDelay")) + return rv +} + +// Controls the interval of time before a slideshow starts to play automatically. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshow/1504967-autoplaydelay?language=objc +func (s_ Slideshow) SetAutoPlayDelay(value foundation.TimeInterval) { + objc.Call[objc.Void](s_, objc.Sel("setAutoPlayDelay:"), value) +} diff --git a/macos/quartz/slideshow_data_source.gen.go b/macos/quartz/slideshow_data_source.gen.go new file mode 100644 index 00000000..ea59b811 --- /dev/null +++ b/macos/quartz/slideshow_data_source.gen.go @@ -0,0 +1,126 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "github.com/progrium/macdriver/objc" +) + +// The IKSlideshowDataSource protocol describes the methods that an IKSlideshow object uses to access the contents of its data source object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource?language=objc +type PSlideshowDataSource interface { + // optional + CanExportSlideshowItemAtIndexToApplication(index uint, applicationBundleIdentifier string) bool + HasCanExportSlideshowItemAtIndexToApplication() bool + + // optional + NameOfSlideshowItemAtIndex(index uint) string + HasNameOfSlideshowItemAtIndex() bool + + // optional + NumberOfSlideshowItems() uint + HasNumberOfSlideshowItems() bool + + // optional + SlideshowWillStart() + HasSlideshowWillStart() bool + + // optional + SlideshowDidStop() + HasSlideshowDidStop() bool + + // optional + SlideshowItemAtIndex(index uint) objc.IObject + HasSlideshowItemAtIndex() bool + + // optional + SlideshowDidChangeCurrentIndex(newIndex uint) + HasSlideshowDidChangeCurrentIndex() bool +} + +// A concrete type wrapper for the [PSlideshowDataSource] protocol. +type SlideshowDataSourceWrapper struct { + objc.Object +} + +func (s_ SlideshowDataSourceWrapper) HasCanExportSlideshowItemAtIndexToApplication() bool { + return s_.RespondsToSelector(objc.Sel("canExportSlideshowItemAtIndex:toApplication:")) +} + +// Reports whether the export button should be enabled for a slideshow item. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource/1505226-canexportslideshowitematindex?language=objc +func (s_ SlideshowDataSourceWrapper) CanExportSlideshowItemAtIndexToApplication(index uint, applicationBundleIdentifier string) bool { + rv := objc.Call[bool](s_, objc.Sel("canExportSlideshowItemAtIndex:toApplication:"), index, applicationBundleIdentifier) + return rv +} + +func (s_ SlideshowDataSourceWrapper) HasNameOfSlideshowItemAtIndex() bool { + return s_.RespondsToSelector(objc.Sel("nameOfSlideshowItemAtIndex:")) +} + +// Returns the display name for item at the specified index. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource/1503638-nameofslideshowitematindex?language=objc +func (s_ SlideshowDataSourceWrapper) NameOfSlideshowItemAtIndex(index uint) string { + rv := objc.Call[string](s_, objc.Sel("nameOfSlideshowItemAtIndex:"), index) + return rv +} + +func (s_ SlideshowDataSourceWrapper) HasNumberOfSlideshowItems() bool { + return s_.RespondsToSelector(objc.Sel("numberOfSlideshowItems")) +} + +// Returns the number of items in a slideshow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource/1503441-numberofslideshowitems?language=objc +func (s_ SlideshowDataSourceWrapper) NumberOfSlideshowItems() uint { + rv := objc.Call[uint](s_, objc.Sel("numberOfSlideshowItems")) + return rv +} + +func (s_ SlideshowDataSourceWrapper) HasSlideshowWillStart() bool { + return s_.RespondsToSelector(objc.Sel("slideshowWillStart")) +} + +// Performs custom tasks when the slideshow is about to start. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource/1504337-slideshowwillstart?language=objc +func (s_ SlideshowDataSourceWrapper) SlideshowWillStart() { + objc.Call[objc.Void](s_, objc.Sel("slideshowWillStart")) +} + +func (s_ SlideshowDataSourceWrapper) HasSlideshowDidStop() bool { + return s_.RespondsToSelector(objc.Sel("slideshowDidStop")) +} + +// Performs custom tasks when the slideshow stops. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource/1504870-slideshowdidstop?language=objc +func (s_ SlideshowDataSourceWrapper) SlideshowDidStop() { + objc.Call[objc.Void](s_, objc.Sel("slideshowDidStop")) +} + +func (s_ SlideshowDataSourceWrapper) HasSlideshowItemAtIndex() bool { + return s_.RespondsToSelector(objc.Sel("slideshowItemAtIndex:")) +} + +// Returns the item for a given index [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource/1503729-slideshowitematindex?language=objc +func (s_ SlideshowDataSourceWrapper) SlideshowItemAtIndex(index uint) objc.Object { + rv := objc.Call[objc.Object](s_, objc.Sel("slideshowItemAtIndex:"), index) + return rv +} + +func (s_ SlideshowDataSourceWrapper) HasSlideshowDidChangeCurrentIndex() bool { + return s_.RespondsToSelector(objc.Sel("slideshowDidChangeCurrentIndex:")) +} + +// Performs custom tasks when the slideshow changes to the item at the specified index. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/ikslideshowdatasource/1504272-slideshowdidchangecurrentindex?language=objc +func (s_ SlideshowDataSourceWrapper) SlideshowDidChangeCurrentIndex(newIndex uint) { + objc.Call[objc.Void](s_, objc.Sel("slideshowDidChangeCurrentIndex:"), newIndex) +} diff --git a/macos/quartz/view.gen.go b/macos/quartz/view.gen.go new file mode 100644 index 00000000..803a0730 --- /dev/null +++ b/macos/quartz/view.gen.go @@ -0,0 +1,74 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package quartz + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/appkit" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [View] class. +var ViewClass = _ViewClass{objc.GetClass("QCView")} + +type _ViewClass struct { + objc.Class +} + +// An interface definition for the [View] class. +type IView interface { + appkit.IView +} + +// The QCView class is a custom NSView class that loads, plays, and controls Quartz Composer compositions. It is an autonomous view that is driven by an internal timer running on the main thread. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/quartz/qcview?language=objc +type View struct { + appkit.View +} + +func ViewFrom(ptr unsafe.Pointer) View { + return View{ + View: appkit.ViewFrom(ptr), + } +} + +func (vc _ViewClass) Alloc() View { + rv := objc.Call[View](vc, objc.Sel("alloc")) + return rv +} + +func View_Alloc() View { + return ViewClass.Alloc() +} + +func (vc _ViewClass) New() View { + rv := objc.Call[View](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewView() View { + return ViewClass.New() +} + +func (v_ View) Init() View { + rv := objc.Call[View](v_, objc.Sel("init")) + return rv +} + +func (v_ View) InitWithFrame(frameRect foundation.Rect) View { + rv := objc.Call[View](v_, objc.Sel("initWithFrame:"), frameRect) + return rv +} + +// Initializes and returns a newly allocated NSView object with a specified frame rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/appkit/nsview/1483458-initwithframe?language=objc +func NewViewWithFrame(frameRect foundation.Rect) View { + instance := ViewClass.Alloc().InitWithFrame(frameRect) + instance.Autorelease() + return instance +} diff --git a/macos/scenekit/scenekit_custom.go b/macos/scenekit/scenekit_custom.go deleted file mode 100644 index c1bb7b4b..00000000 --- a/macos/scenekit/scenekit_custom.go +++ /dev/null @@ -1 +0,0 @@ -package scenekit diff --git a/macos/sysconfig/aliastypes.gen.go b/macos/sysconfig/aliastypes.gen.go new file mode 100644 index 00000000..3fdc16b1 --- /dev/null +++ b/macos/sysconfig/aliastypes.gen.go @@ -0,0 +1,29 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package sysconfig + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corefoundation" +) + +// Type of the callback function used when the preferences have been updated or applied. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scpreferencescallback?language=objc +type PreferencesCallBack = func(prefs PreferencesRef, notificationType PreferencesNotification, info unsafe.Pointer) + +// The type of callback function used when a status event is delivered. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scnetworkconnectioncallback?language=objc +type etworkConnectionCallBack = func(connection EtworkConnectionRef, status EtworkConnectionStatus, info unsafe.Pointer) + +// Type of callback function used when the reachability of a network address or name changes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scnetworkreachabilitycallback?language=objc +type etworkReachabilityCallBack = func(target EtworkReachabilityRef, flags EtworkReachabilityFlags, info unsafe.Pointer) + +// Callback used when notification of changes made to the dynamic store is delivered. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scdynamicstorecallback?language=objc +type DynamicStoreCallBack = func(store DynamicStoreRef, changedKeys corefoundation.ArrayRef, info unsafe.Pointer) diff --git a/macos/sysconfig/doc.gen.go b/macos/sysconfig/doc.gen.go new file mode 100644 index 00000000..5fade057 --- /dev/null +++ b/macos/sysconfig/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Allow applications to access a device’s network configuration settings. Determine the reachability of the device, such as whether Wi-Fi or cell connectivity are active. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/systemconfiguration?language=objc +package sysconfig diff --git a/macos/sysconfig/enumtypes.gen.go b/macos/sysconfig/enumtypes.gen.go new file mode 100644 index 00000000..2fb312b4 --- /dev/null +++ b/macos/sysconfig/enumtypes.gen.go @@ -0,0 +1,70 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package sysconfig + +// Flags that indicate whether the specified network node name or address is reachable, whether a connection is required, and whether some user intervention may be required when establishing a connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scnetworkconnectionflags?language=objc +type EtworkConnectionFlags uint32 + +// The PPP-specific status of the network connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scnetworkconnectionpppstatus?language=objc +type EtworkConnectionPPPStatus int32 + +const ( + KNetworkConnectionPPPAuthenticating EtworkConnectionPPPStatus = 5 + KNetworkConnectionPPPConnected EtworkConnectionPPPStatus = 8 + KNetworkConnectionPPPConnectingLink EtworkConnectionPPPStatus = 2 + KNetworkConnectionPPPDialOnTraffic EtworkConnectionPPPStatus = 3 + KNetworkConnectionPPPDisconnected EtworkConnectionPPPStatus = 0 + KNetworkConnectionPPPDisconnectingLink EtworkConnectionPPPStatus = 10 + KNetworkConnectionPPPHoldingLinkOff EtworkConnectionPPPStatus = 11 + KNetworkConnectionPPPInitializing EtworkConnectionPPPStatus = 1 + KNetworkConnectionPPPNegotiatingLink EtworkConnectionPPPStatus = 4 + KNetworkConnectionPPPNegotiatingNetwork EtworkConnectionPPPStatus = 7 + KNetworkConnectionPPPSuspended EtworkConnectionPPPStatus = 12 + KNetworkConnectionPPPTerminating EtworkConnectionPPPStatus = 9 + KNetworkConnectionPPPWaitingForCallBack EtworkConnectionPPPStatus = 6 + KNetworkConnectionPPPWaitingForRedial EtworkConnectionPPPStatus = 13 +) + +// The current status of the network connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scnetworkconnectionstatus?language=objc +type EtworkConnectionStatus int32 + +const ( + KNetworkConnectionConnected EtworkConnectionStatus = 2 + KNetworkConnectionConnecting EtworkConnectionStatus = 1 + KNetworkConnectionDisconnected EtworkConnectionStatus = 0 + KNetworkConnectionDisconnecting EtworkConnectionStatus = 3 + KNetworkConnectionInvalid EtworkConnectionStatus = -1 +) + +// Flags that indicate the reachability of a network node name or address, including whether a connection is required, and whether some user intervention might be required when establishing a connection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scnetworkreachabilityflags?language=objc +type EtworkReachabilityFlags uint32 + +const ( + KNetworkReachabilityFlagsConnectionAutomatic EtworkReachabilityFlags = 8 + KNetworkReachabilityFlagsConnectionOnDemand EtworkReachabilityFlags = 32 + KNetworkReachabilityFlagsConnectionOnTraffic EtworkReachabilityFlags = 8 + KNetworkReachabilityFlagsConnectionRequired EtworkReachabilityFlags = 4 + KNetworkReachabilityFlagsInterventionRequired EtworkReachabilityFlags = 16 + KNetworkReachabilityFlagsIsDirect EtworkReachabilityFlags = 131072 + KNetworkReachabilityFlagsIsLocalAddress EtworkReachabilityFlags = 65536 + KNetworkReachabilityFlagsReachable EtworkReachabilityFlags = 2 + KNetworkReachabilityFlagsTransientConnection EtworkReachabilityFlags = 1 +) + +// The type of notification (used with the SCPreferencesCallBack callback). [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/systemconfiguration/scpreferencesnotification?language=objc +type PreferencesNotification uint32 + +const ( + KPreferencesNotificationApply PreferencesNotification = 2 + KPreferencesNotificationCommit PreferencesNotification = 1 +) diff --git a/macos/sysconfig/protocols.gen.m b/macos/sysconfig/protocols.gen.m new file mode 100644 index 00000000..7a26ea52 --- /dev/null +++ b/macos/sysconfig/protocols.gen.m @@ -0,0 +1,7 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "SystemConfiguration/SystemConfiguration.h" + +void importSystemConfigurationProtocols() { + id o; +} diff --git a/macos/sysconfig/sysconfig.go b/macos/sysconfig/sysconfig.go new file mode 100644 index 00000000..9daf7894 --- /dev/null +++ b/macos/sysconfig/sysconfig.go @@ -0,0 +1,6 @@ +//go:generate go run ../../generate/tools/genmod.go +package sysconfig + +// #cgo CFLAGS: -x objective-c +// #cgo LDFLAGS: -framework SystemConfiguration +import "C" diff --git a/macos/sysconfig/sysconfig_custom.go b/macos/sysconfig/sysconfig_custom.go new file mode 100644 index 00000000..3688cf2b --- /dev/null +++ b/macos/sysconfig/sysconfig_custom.go @@ -0,0 +1,8 @@ +package sysconfig + +import "unsafe" + +type PreferencesRef unsafe.Pointer +type EtworkConnectionRef unsafe.Pointer +type EtworkReachabilityRef unsafe.Pointer +type DynamicStoreRef unsafe.Pointer diff --git a/macos/sysconfig/sysconfig_test.go b/macos/sysconfig/sysconfig_test.go new file mode 100644 index 00000000..32585b4c --- /dev/null +++ b/macos/sysconfig/sysconfig_test.go @@ -0,0 +1,5 @@ +package sysconfig + +import "testing" + +func TestSystemConfigurationValid(t *testing.T) {} diff --git a/macos/vision/aliastypes.gen.go b/macos/vision/aliastypes.gen.go new file mode 100644 index 00000000..75370501 --- /dev/null +++ b/macos/vision/aliastypes.gen.go @@ -0,0 +1,17 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "github.com/progrium/macdriver/macos/foundation" +) + +// A block executed at intervals during the processing of a Vision request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestprogresshandler?language=objc +type RequestProgressHandler = func(request Request, fractionCompleted float64, error foundation.Error) + +// A type alias to encapsulate the syntax for the completion handler the system calls after the request finishes processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestcompletionhandler?language=objc +type RequestCompletionHandler = func(request Request, error foundation.Error) diff --git a/macos/vision/barcode_observation.gen.go b/macos/vision/barcode_observation.gen.go new file mode 100644 index 00000000..0c0cfe07 --- /dev/null +++ b/macos/vision/barcode_observation.gen.go @@ -0,0 +1,111 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [BarcodeObservation] class. +var BarcodeObservationClass = _BarcodeObservationClass{objc.GetClass("VNBarcodeObservation")} + +type _BarcodeObservationClass struct { + objc.Class +} + +// An interface definition for the [BarcodeObservation] class. +type IBarcodeObservation interface { + IRectangleObservation + PayloadStringValue() string + BarcodeDescriptor() coreimage.BarcodeDescriptor + Symbology() BarcodeSymbology +} + +// An object that represents barcode information that an image analysis request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnbarcodeobservation?language=objc +type BarcodeObservation struct { + RectangleObservation +} + +func BarcodeObservationFrom(ptr unsafe.Pointer) BarcodeObservation { + return BarcodeObservation{ + RectangleObservation: RectangleObservationFrom(ptr), + } +} + +func (bc _BarcodeObservationClass) Alloc() BarcodeObservation { + rv := objc.Call[BarcodeObservation](bc, objc.Sel("alloc")) + return rv +} + +func BarcodeObservation_Alloc() BarcodeObservation { + return BarcodeObservationClass.Alloc() +} + +func (bc _BarcodeObservationClass) New() BarcodeObservation { + rv := objc.Call[BarcodeObservation](bc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewBarcodeObservation() BarcodeObservation { + return BarcodeObservationClass.New() +} + +func (b_ BarcodeObservation) Init() BarcodeObservation { + rv := objc.Call[BarcodeObservation](b_, objc.Sel("init")) + return rv +} + +func (bc _BarcodeObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) BarcodeObservation { + rv := objc.Call[BarcodeObservation](bc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func BarcodeObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) BarcodeObservation { + return BarcodeObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (bc _BarcodeObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) BarcodeObservation { + rv := objc.Call[BarcodeObservation](bc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func BarcodeObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) BarcodeObservation { + return BarcodeObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +// A string value that represents the barcode payload. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnbarcodeobservation/2923485-payloadstringvalue?language=objc +func (b_ BarcodeObservation) PayloadStringValue() string { + rv := objc.Call[string](b_, objc.Sel("payloadStringValue")) + return rv +} + +// An object that describes the low-level details about the barcode and its data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnbarcodeobservation/2880296-barcodedescriptor?language=objc +func (b_ BarcodeObservation) BarcodeDescriptor() coreimage.BarcodeDescriptor { + rv := objc.Call[coreimage.BarcodeDescriptor](b_, objc.Sel("barcodeDescriptor")) + return rv +} + +// The symbology of the observed barcode. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnbarcodeobservation/2869611-symbology?language=objc +func (b_ BarcodeObservation) Symbology() BarcodeSymbology { + rv := objc.Call[BarcodeSymbology](b_, objc.Sel("symbology")) + return rv +} diff --git a/macos/vision/circle.gen.go b/macos/vision/circle.gen.go new file mode 100644 index 00000000..2a7fb446 --- /dev/null +++ b/macos/vision/circle.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Circle] class. +var CircleClass = _CircleClass{objc.GetClass("VNCircle")} + +type _CircleClass struct { + objc.Class +} + +// An interface definition for the [Circle] class. +type ICircle interface { + objc.IObject + ContainsPoint(point IPoint) bool + Radius() float64 + Diameter() float64 + Center() Point +} + +// An immutable, two-dimensional circle represented by its center point and radius. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle?language=objc +type Circle struct { + objc.Object +} + +func CircleFrom(ptr unsafe.Pointer) Circle { + return Circle{ + Object: objc.ObjectFrom(ptr), + } +} + +func (c_ Circle) InitWithCenterRadius(center IPoint, radius float64) Circle { + rv := objc.Call[Circle](c_, objc.Sel("initWithCenter:radius:"), objc.Ptr(center), radius) + return rv +} + +// Creates a circle with the specified center and radius. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle/3548317-initwithcenter?language=objc +func NewCircleWithCenterRadius(center IPoint, radius float64) Circle { + instance := CircleClass.Alloc().InitWithCenterRadius(center, radius) + instance.Autorelease() + return instance +} + +func (cc _CircleClass) Alloc() Circle { + rv := objc.Call[Circle](cc, objc.Sel("alloc")) + return rv +} + +func Circle_Alloc() Circle { + return CircleClass.Alloc() +} + +func (cc _CircleClass) New() Circle { + rv := objc.Call[Circle](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCircle() Circle { + return CircleClass.New() +} + +func (c_ Circle) Init() Circle { + rv := objc.Call[Circle](c_, objc.Sel("init")) + return rv +} + +// Determines if this circle, including its boundary, contains the specified point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle/3548313-containspoint?language=objc +func (c_ Circle) ContainsPoint(point IPoint) bool { + rv := objc.Call[bool](c_, objc.Sel("containsPoint:"), objc.Ptr(point)) + return rv +} + +// The circle’s radius. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle/3548318-radius?language=objc +func (c_ Circle) Radius() float64 { + rv := objc.Call[float64](c_, objc.Sel("radius")) + return rv +} + +// The circle’s diameter. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle/3548315-diameter?language=objc +func (c_ Circle) Diameter() float64 { + rv := objc.Call[float64](c_, objc.Sel("diameter")) + return rv +} + +// A circle object centered at the origin, with a radius of zero. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle/3548319-zerocircle?language=objc +func (cc _CircleClass) ZeroCircle() Circle { + rv := objc.Call[Circle](cc, objc.Sel("zeroCircle")) + return rv +} + +// A circle object centered at the origin, with a radius of zero. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle/3548319-zerocircle?language=objc +func Circle_ZeroCircle() Circle { + return CircleClass.ZeroCircle() +} + +// The circle’s center point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncircle/3548312-center?language=objc +func (c_ Circle) Center() Point { + rv := objc.Call[Point](c_, objc.Sel("center")) + return rv +} diff --git a/macos/vision/classification_observation.gen.go b/macos/vision/classification_observation.gen.go new file mode 100644 index 00000000..9140d80f --- /dev/null +++ b/macos/vision/classification_observation.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ClassificationObservation] class. +var ClassificationObservationClass = _ClassificationObservationClass{objc.GetClass("VNClassificationObservation")} + +type _ClassificationObservationClass struct { + objc.Class +} + +// An interface definition for the [ClassificationObservation] class. +type IClassificationObservation interface { + IObservation + HasMinimumRecallForPrecision(minimumRecall float64, precision float64) bool + HasMinimumPrecisionForRecall(minimumPrecision float64, recall float64) bool + HasPrecisionRecallCurve() bool + Identifier() string +} + +// An object that represents classification information that an image analysis request produces. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnclassificationobservation?language=objc +type ClassificationObservation struct { + Observation +} + +func ClassificationObservationFrom(ptr unsafe.Pointer) ClassificationObservation { + return ClassificationObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (cc _ClassificationObservationClass) Alloc() ClassificationObservation { + rv := objc.Call[ClassificationObservation](cc, objc.Sel("alloc")) + return rv +} + +func ClassificationObservation_Alloc() ClassificationObservation { + return ClassificationObservationClass.Alloc() +} + +func (cc _ClassificationObservationClass) New() ClassificationObservation { + rv := objc.Call[ClassificationObservation](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewClassificationObservation() ClassificationObservation { + return ClassificationObservationClass.New() +} + +func (c_ ClassificationObservation) Init() ClassificationObservation { + rv := objc.Call[ClassificationObservation](c_, objc.Sel("init")) + return rv +} + +// Determines whether the observation for a specific precision has a minimum recall value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnclassificationobservation/3152625-hasminimumrecall?language=objc +func (c_ ClassificationObservation) HasMinimumRecallForPrecision(minimumRecall float64, precision float64) bool { + rv := objc.Call[bool](c_, objc.Sel("hasMinimumRecall:forPrecision:"), minimumRecall, precision) + return rv +} + +// Determines whether the observation for a specific recall has a minimum precision value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnclassificationobservation/3152624-hasminimumprecision?language=objc +func (c_ ClassificationObservation) HasMinimumPrecisionForRecall(minimumPrecision float64, recall float64) bool { + rv := objc.Call[bool](c_, objc.Sel("hasMinimumPrecision:forRecall:"), minimumPrecision, recall) + return rv +} + +// A Boolean variable indicating whether the observation contains precision and recall curves. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnclassificationobservation/3152626-hasprecisionrecallcurve?language=objc +func (c_ ClassificationObservation) HasPrecisionRecallCurve() bool { + rv := objc.Call[bool](c_, objc.Sel("hasPrecisionRecallCurve")) + return rv +} + +// Classification label identifying the type of observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnclassificationobservation/2867259-identifier?language=objc +func (c_ ClassificationObservation) Identifier() string { + rv := objc.Call[string](c_, objc.Sel("identifier")) + return rv +} diff --git a/macos/vision/classify_image_request.gen.go b/macos/vision/classify_image_request.gen.go new file mode 100644 index 00000000..e1fbdfc7 --- /dev/null +++ b/macos/vision/classify_image_request.gen.go @@ -0,0 +1,82 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ClassifyImageRequest] class. +var ClassifyImageRequestClass = _ClassifyImageRequestClass{objc.GetClass("VNClassifyImageRequest")} + +type _ClassifyImageRequestClass struct { + objc.Class +} + +// An interface definition for the [ClassifyImageRequest] class. +type IClassifyImageRequest interface { + IImageBasedRequest + SupportedIdentifiersAndReturnError(error foundation.IError) []string +} + +// A request to classify an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnclassifyimagerequest?language=objc +type ClassifyImageRequest struct { + ImageBasedRequest +} + +func ClassifyImageRequestFrom(ptr unsafe.Pointer) ClassifyImageRequest { + return ClassifyImageRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (cc _ClassifyImageRequestClass) Alloc() ClassifyImageRequest { + rv := objc.Call[ClassifyImageRequest](cc, objc.Sel("alloc")) + return rv +} + +func ClassifyImageRequest_Alloc() ClassifyImageRequest { + return ClassifyImageRequestClass.Alloc() +} + +func (cc _ClassifyImageRequestClass) New() ClassifyImageRequest { + rv := objc.Call[ClassifyImageRequest](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewClassifyImageRequest() ClassifyImageRequest { + return ClassifyImageRequestClass.New() +} + +func (c_ ClassifyImageRequest) Init() ClassifyImageRequest { + rv := objc.Call[ClassifyImageRequest](c_, objc.Sel("init")) + return rv +} + +func (c_ ClassifyImageRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) ClassifyImageRequest { + rv := objc.Call[ClassifyImageRequest](c_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewClassifyImageRequestWithCompletionHandler(completionHandler RequestCompletionHandler) ClassifyImageRequest { + instance := ClassifyImageRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// Returns the classification identifiers that the request supports in its current configuration. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnclassifyimagerequest/3750957-supportedidentifiersandreturnerr?language=objc +func (c_ ClassifyImageRequest) SupportedIdentifiersAndReturnError(error foundation.IError) []string { + rv := objc.Call[[]string](c_, objc.Sel("supportedIdentifiersAndReturnError:"), objc.Ptr(error)) + return rv +} diff --git a/macos/vision/contour.gen.go b/macos/vision/contour.gen.go new file mode 100644 index 00000000..5018a553 --- /dev/null +++ b/macos/vision/contour.gen.go @@ -0,0 +1,140 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Contour] class. +var ContourClass = _ContourClass{objc.GetClass("VNContour")} + +type _ContourClass struct { + objc.Class +} + +// An interface definition for the [Contour] class. +type IContour interface { + objc.IObject + PolygonApproximationWithEpsilonError(epsilon float64, error foundation.IError) Contour + ChildContourAtIndexError(childContourIndex uint, error foundation.IError) Contour + ChildContours() []Contour + NormalizedPoints() objc.Object + PointCount() int + NormalizedPath() unsafe.Pointer + IndexPath() foundation.IndexPath + AspectRatio() float64 + ChildContourCount() int +} + +// A class that represents a detected contour in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour?language=objc +type Contour struct { + objc.Object +} + +func ContourFrom(ptr unsafe.Pointer) Contour { + return Contour{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _ContourClass) Alloc() Contour { + rv := objc.Call[Contour](cc, objc.Sel("alloc")) + return rv +} + +func Contour_Alloc() Contour { + return ContourClass.Alloc() +} + +func (cc _ContourClass) New() Contour { + rv := objc.Call[Contour](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContour() Contour { + return ContourClass.New() +} + +func (c_ Contour) Init() Contour { + rv := objc.Call[Contour](c_, objc.Sel("init")) + return rv +} + +// Simplifies the contour to a polygon using a Ramer-Douglas-Peucker algorithm. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3618958-polygonapproximationwithepsilon?language=objc +func (c_ Contour) PolygonApproximationWithEpsilonError(epsilon float64, error foundation.IError) Contour { + rv := objc.Call[Contour](c_, objc.Sel("polygonApproximationWithEpsilon:error:"), epsilon, objc.Ptr(error)) + return rv +} + +// Retrieves the child contour object at the specified index. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3548321-childcontouratindex?language=objc +func (c_ Contour) ChildContourAtIndexError(childContourIndex uint, error foundation.IError) Contour { + rv := objc.Call[Contour](c_, objc.Sel("childContourAtIndex:error:"), childContourIndex, objc.Ptr(error)) + return rv +} + +// An array of contours that this contour encloses. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3548323-childcontours?language=objc +func (c_ Contour) ChildContours() []Contour { + rv := objc.Call[[]Contour](c_, objc.Sel("childContours")) + return rv +} + +// The contour’s array of points in normalized coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3548326-normalizedpoints?language=objc +func (c_ Contour) NormalizedPoints() objc.Object { + rv := objc.Call[objc.Object](c_, objc.Sel("normalizedPoints")) + return rv +} + +// The contour’s number of points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3548327-pointcount?language=objc +func (c_ Contour) PointCount() int { + rv := objc.Call[int](c_, objc.Sel("pointCount")) + return rv +} + +// The contour object as a path in normalized coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3548325-normalizedpath?language=objc +func (c_ Contour) NormalizedPath() unsafe.Pointer { + rv := objc.Call[unsafe.Pointer](c_, objc.Sel("normalizedPath")) + return rv +} + +// The contour object’s index path. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3548324-indexpath?language=objc +func (c_ Contour) IndexPath() foundation.IndexPath { + rv := objc.Call[foundation.IndexPath](c_, objc.Sel("indexPath")) + return rv +} + +// The aspect ratio of the contour. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3600614-aspectratio?language=objc +func (c_ Contour) AspectRatio() float64 { + rv := objc.Call[float64](c_, objc.Sel("aspectRatio")) + return rv +} + +// The total number of detected child contours. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontour/3548322-childcontourcount?language=objc +func (c_ Contour) ChildContourCount() int { + rv := objc.Call[int](c_, objc.Sel("childContourCount")) + return rv +} diff --git a/macos/vision/contours_observation.gen.go b/macos/vision/contours_observation.gen.go new file mode 100644 index 00000000..5ecdce68 --- /dev/null +++ b/macos/vision/contours_observation.gen.go @@ -0,0 +1,113 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ContoursObservation] class. +var ContoursObservationClass = _ContoursObservationClass{objc.GetClass("VNContoursObservation")} + +type _ContoursObservationClass struct { + objc.Class +} + +// An interface definition for the [ContoursObservation] class. +type IContoursObservation interface { + IObservation + ContourAtIndexError(contourIndex int, error foundation.IError) Contour + ContourAtIndexPathError(indexPath foundation.IIndexPath, error foundation.IError) Contour + ContourCount() int + TopLevelContours() []Contour + NormalizedPath() unsafe.Pointer + TopLevelContourCount() int +} + +// An object that represents the detected contours in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontoursobservation?language=objc +type ContoursObservation struct { + Observation +} + +func ContoursObservationFrom(ptr unsafe.Pointer) ContoursObservation { + return ContoursObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (cc _ContoursObservationClass) Alloc() ContoursObservation { + rv := objc.Call[ContoursObservation](cc, objc.Sel("alloc")) + return rv +} + +func ContoursObservation_Alloc() ContoursObservation { + return ContoursObservationClass.Alloc() +} + +func (cc _ContoursObservationClass) New() ContoursObservation { + rv := objc.Call[ContoursObservation](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewContoursObservation() ContoursObservation { + return ContoursObservationClass.New() +} + +func (c_ ContoursObservation) Init() ContoursObservation { + rv := objc.Call[ContoursObservation](c_, objc.Sel("init")) + return rv +} + +// Retrieves the contour object at the specified index, irrespective of hierarchy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontoursobservation/3548360-contouratindex?language=objc +func (c_ ContoursObservation) ContourAtIndexError(contourIndex int, error foundation.IError) Contour { + rv := objc.Call[Contour](c_, objc.Sel("contourAtIndex:error:"), contourIndex, objc.Ptr(error)) + return rv +} + +// Retrieves the contour object at the specified index path. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontoursobservation/3548361-contouratindexpath?language=objc +func (c_ ContoursObservation) ContourAtIndexPathError(indexPath foundation.IIndexPath, error foundation.IError) Contour { + rv := objc.Call[Contour](c_, objc.Sel("contourAtIndexPath:error:"), objc.Ptr(indexPath), objc.Ptr(error)) + return rv +} + +// The total number of detected contours. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontoursobservation/3548362-contourcount?language=objc +func (c_ ContoursObservation) ContourCount() int { + rv := objc.Call[int](c_, objc.Sel("contourCount")) + return rv +} + +// An array of contours that don’t have another contour enclosing them. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontoursobservation/3548364-toplevelcontours?language=objc +func (c_ ContoursObservation) TopLevelContours() []Contour { + rv := objc.Call[[]Contour](c_, objc.Sel("topLevelContours")) + return rv +} + +// The detected contours as a path object in normalized coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontoursobservation/3548363-normalizedpath?language=objc +func (c_ ContoursObservation) NormalizedPath() unsafe.Pointer { + rv := objc.Call[unsafe.Pointer](c_, objc.Sel("normalizedPath")) + return rv +} + +// The total number of detected top-level contours. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncontoursobservation/3675675-toplevelcontourcount?language=objc +func (c_ ContoursObservation) TopLevelContourCount() int { + rv := objc.Call[int](c_, objc.Sel("topLevelContourCount")) + return rv +} diff --git a/macos/vision/core_ml_feature_value_observation.gen.go b/macos/vision/core_ml_feature_value_observation.gen.go new file mode 100644 index 00000000..77761b53 --- /dev/null +++ b/macos/vision/core_ml_feature_value_observation.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coreml" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CoreMLFeatureValueObservation] class. +var CoreMLFeatureValueObservationClass = _CoreMLFeatureValueObservationClass{objc.GetClass("VNCoreMLFeatureValueObservation")} + +type _CoreMLFeatureValueObservationClass struct { + objc.Class +} + +// An interface definition for the [CoreMLFeatureValueObservation] class. +type ICoreMLFeatureValueObservation interface { + IObservation + FeatureName() string + FeatureValue() coreml.FeatureValue +} + +// An object that represents a collection of key-value information that a Core ML image analysis request produces. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlfeaturevalueobservation?language=objc +type CoreMLFeatureValueObservation struct { + Observation +} + +func CoreMLFeatureValueObservationFrom(ptr unsafe.Pointer) CoreMLFeatureValueObservation { + return CoreMLFeatureValueObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (cc _CoreMLFeatureValueObservationClass) Alloc() CoreMLFeatureValueObservation { + rv := objc.Call[CoreMLFeatureValueObservation](cc, objc.Sel("alloc")) + return rv +} + +func CoreMLFeatureValueObservation_Alloc() CoreMLFeatureValueObservation { + return CoreMLFeatureValueObservationClass.Alloc() +} + +func (cc _CoreMLFeatureValueObservationClass) New() CoreMLFeatureValueObservation { + rv := objc.Call[CoreMLFeatureValueObservation](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCoreMLFeatureValueObservation() CoreMLFeatureValueObservation { + return CoreMLFeatureValueObservationClass.New() +} + +func (c_ CoreMLFeatureValueObservation) Init() CoreMLFeatureValueObservation { + rv := objc.Call[CoreMLFeatureValueObservation](c_, objc.Sel("init")) + return rv +} + +// The name used in the model description of the CoreML model that produced this observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlfeaturevalueobservation/3131944-featurename?language=objc +func (c_ CoreMLFeatureValueObservation) FeatureName() string { + rv := objc.Call[string](c_, objc.Sel("featureName")) + return rv +} + +// The feature result of a VNCoreMLRequest that outputs neither a classification nor an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlfeaturevalueobservation/2890135-featurevalue?language=objc +func (c_ CoreMLFeatureValueObservation) FeatureValue() coreml.FeatureValue { + rv := objc.Call[coreml.FeatureValue](c_, objc.Sel("featureValue")) + return rv +} diff --git a/macos/vision/core_ml_model.gen.go b/macos/vision/core_ml_model.gen.go new file mode 100644 index 00000000..44547b56 --- /dev/null +++ b/macos/vision/core_ml_model.gen.go @@ -0,0 +1,115 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coreml" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CoreMLModel] class. +var CoreMLModelClass = _CoreMLModelClass{objc.GetClass("VNCoreMLModel")} + +type _CoreMLModelClass struct { + objc.Class +} + +// An interface definition for the [CoreMLModel] class. +type ICoreMLModel interface { + objc.IObject + FeatureProvider() coreml.FeatureProviderWrapper + SetFeatureProvider(value coreml.PFeatureProvider) + SetFeatureProviderObject(valueObject objc.IObject) + InputImageFeatureName() string + SetInputImageFeatureName(value string) +} + +// A container for the model to use with Vision requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlmodel?language=objc +type CoreMLModel struct { + objc.Object +} + +func CoreMLModelFrom(ptr unsafe.Pointer) CoreMLModel { + return CoreMLModel{ + Object: objc.ObjectFrom(ptr), + } +} + +func (cc _CoreMLModelClass) ModelForMLModelError(model coreml.IModel, error foundation.IError) CoreMLModel { + rv := objc.Call[CoreMLModel](cc, objc.Sel("modelForMLModel:error:"), objc.Ptr(model), objc.Ptr(error)) + return rv +} + +// Creates a model container to be used with VNCoreMLRequest. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlmodel/2890148-modelformlmodel?language=objc +func CoreMLModel_ModelForMLModelError(model coreml.IModel, error foundation.IError) CoreMLModel { + return CoreMLModelClass.ModelForMLModelError(model, error) +} + +func (cc _CoreMLModelClass) Alloc() CoreMLModel { + rv := objc.Call[CoreMLModel](cc, objc.Sel("alloc")) + return rv +} + +func CoreMLModel_Alloc() CoreMLModel { + return CoreMLModelClass.Alloc() +} + +func (cc _CoreMLModelClass) New() CoreMLModel { + rv := objc.Call[CoreMLModel](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCoreMLModel() CoreMLModel { + return CoreMLModelClass.New() +} + +func (c_ CoreMLModel) Init() CoreMLModel { + rv := objc.Call[CoreMLModel](c_, objc.Sel("init")) + return rv +} + +// An optional object to support inputs outside Vision. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlmodel/3131933-featureprovider?language=objc +func (c_ CoreMLModel) FeatureProvider() coreml.FeatureProviderWrapper { + rv := objc.Call[coreml.FeatureProviderWrapper](c_, objc.Sel("featureProvider")) + return rv +} + +// An optional object to support inputs outside Vision. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlmodel/3131933-featureprovider?language=objc +func (c_ CoreMLModel) SetFeatureProvider(value coreml.PFeatureProvider) { + po0 := objc.WrapAsProtocol("MLFeatureProvider", value) + objc.Call[objc.Void](c_, objc.Sel("setFeatureProvider:"), po0) +} + +// An optional object to support inputs outside Vision. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlmodel/3131933-featureprovider?language=objc +func (c_ CoreMLModel) SetFeatureProviderObject(valueObject objc.IObject) { + objc.Call[objc.Void](c_, objc.Sel("setFeatureProvider:"), objc.Ptr(valueObject)) +} + +// The name of the MLFeatureValue that Vision sets from the request handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlmodel/3131934-inputimagefeaturename?language=objc +func (c_ CoreMLModel) InputImageFeatureName() string { + rv := objc.Call[string](c_, objc.Sel("inputImageFeatureName")) + return rv +} + +// The name of the MLFeatureValue that Vision sets from the request handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlmodel/3131934-inputimagefeaturename?language=objc +func (c_ CoreMLModel) SetInputImageFeatureName(value string) { + objc.Call[objc.Void](c_, objc.Sel("setInputImageFeatureName:"), value) +} diff --git a/macos/vision/core_ml_request.gen.go b/macos/vision/core_ml_request.gen.go new file mode 100644 index 00000000..a4bbeb3e --- /dev/null +++ b/macos/vision/core_ml_request.gen.go @@ -0,0 +1,112 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [CoreMLRequest] class. +var CoreMLRequestClass = _CoreMLRequestClass{objc.GetClass("VNCoreMLRequest")} + +type _CoreMLRequestClass struct { + objc.Class +} + +// An interface definition for the [CoreMLRequest] class. +type ICoreMLRequest interface { + IImageBasedRequest + Model() CoreMLModel + ImageCropAndScaleOption() ImageCropAndScaleOption + SetImageCropAndScaleOption(value ImageCropAndScaleOption) +} + +// An image analysis request that uses a Core ML model to process images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlrequest?language=objc +type CoreMLRequest struct { + ImageBasedRequest +} + +func CoreMLRequestFrom(ptr unsafe.Pointer) CoreMLRequest { + return CoreMLRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (c_ CoreMLRequest) InitWithModel(model ICoreMLModel) CoreMLRequest { + rv := objc.Call[CoreMLRequest](c_, objc.Sel("initWithModel:"), objc.Ptr(model)) + return rv +} + +// Creates a model container to use with an image analysis request based on the model you provide. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlrequest/2890146-initwithmodel?language=objc +func NewCoreMLRequestWithModel(model ICoreMLModel) CoreMLRequest { + instance := CoreMLRequestClass.Alloc().InitWithModel(model) + instance.Autorelease() + return instance +} + +func (cc _CoreMLRequestClass) Alloc() CoreMLRequest { + rv := objc.Call[CoreMLRequest](cc, objc.Sel("alloc")) + return rv +} + +func CoreMLRequest_Alloc() CoreMLRequest { + return CoreMLRequestClass.Alloc() +} + +func (cc _CoreMLRequestClass) New() CoreMLRequest { + rv := objc.Call[CoreMLRequest](cc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewCoreMLRequest() CoreMLRequest { + return CoreMLRequestClass.New() +} + +func (c_ CoreMLRequest) Init() CoreMLRequest { + rv := objc.Call[CoreMLRequest](c_, objc.Sel("init")) + return rv +} + +func (c_ CoreMLRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) CoreMLRequest { + rv := objc.Call[CoreMLRequest](c_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewCoreMLRequestWithCompletionHandler(completionHandler RequestCompletionHandler) CoreMLRequest { + instance := CoreMLRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// The model to base the image analysis request on. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlrequest/2890150-model?language=objc +func (c_ CoreMLRequest) Model() CoreMLModel { + rv := objc.Call[CoreMLModel](c_, objc.Sel("model")) + return rv +} + +// An optional setting that tells the Vision algorithm how to scale an input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlrequest/2890144-imagecropandscaleoption?language=objc +func (c_ CoreMLRequest) ImageCropAndScaleOption() ImageCropAndScaleOption { + rv := objc.Call[ImageCropAndScaleOption](c_, objc.Sel("imageCropAndScaleOption")) + return rv +} + +// An optional setting that tells the Vision algorithm how to scale an input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vncoremlrequest/2890144-imagecropandscaleoption?language=objc +func (c_ CoreMLRequest) SetImageCropAndScaleOption(value ImageCropAndScaleOption) { + objc.Call[objc.Void](c_, objc.Sel("setImageCropAndScaleOption:"), value) +} diff --git a/macos/vision/detect_barcodes_request.gen.go b/macos/vision/detect_barcodes_request.gen.go new file mode 100644 index 00000000..c7b8a7cf --- /dev/null +++ b/macos/vision/detect_barcodes_request.gen.go @@ -0,0 +1,99 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectBarcodesRequest] class. +var DetectBarcodesRequestClass = _DetectBarcodesRequestClass{objc.GetClass("VNDetectBarcodesRequest")} + +type _DetectBarcodesRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectBarcodesRequest] class. +type IDetectBarcodesRequest interface { + IImageBasedRequest + SupportedSymbologiesAndReturnError(error foundation.IError) []BarcodeSymbology + Symbologies() []BarcodeSymbology + SetSymbologies(value []BarcodeSymbology) +} + +// A request that detects barcodes in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectbarcodesrequest?language=objc +type DetectBarcodesRequest struct { + ImageBasedRequest +} + +func DetectBarcodesRequestFrom(ptr unsafe.Pointer) DetectBarcodesRequest { + return DetectBarcodesRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectBarcodesRequestClass) Alloc() DetectBarcodesRequest { + rv := objc.Call[DetectBarcodesRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectBarcodesRequest_Alloc() DetectBarcodesRequest { + return DetectBarcodesRequestClass.Alloc() +} + +func (dc _DetectBarcodesRequestClass) New() DetectBarcodesRequest { + rv := objc.Call[DetectBarcodesRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectBarcodesRequest() DetectBarcodesRequest { + return DetectBarcodesRequestClass.New() +} + +func (d_ DetectBarcodesRequest) Init() DetectBarcodesRequest { + rv := objc.Call[DetectBarcodesRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectBarcodesRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectBarcodesRequest { + rv := objc.Call[DetectBarcodesRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectBarcodesRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectBarcodesRequest { + instance := DetectBarcodesRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// Returns the barcode symbologies that the request supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectbarcodesrequest/3750959-supportedsymbologiesandreturnerr?language=objc +func (d_ DetectBarcodesRequest) SupportedSymbologiesAndReturnError(error foundation.IError) []BarcodeSymbology { + rv := objc.Call[[]BarcodeSymbology](d_, objc.Sel("supportedSymbologiesAndReturnError:"), objc.Ptr(error)) + return rv +} + +// The barcode symbologies that the request detects in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectbarcodesrequest/2875397-symbologies?language=objc +func (d_ DetectBarcodesRequest) Symbologies() []BarcodeSymbology { + rv := objc.Call[[]BarcodeSymbology](d_, objc.Sel("symbologies")) + return rv +} + +// The barcode symbologies that the request detects in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectbarcodesrequest/2875397-symbologies?language=objc +func (d_ DetectBarcodesRequest) SetSymbologies(value []BarcodeSymbology) { + objc.Call[objc.Void](d_, objc.Sel("setSymbologies:"), value) +} diff --git a/macos/vision/detect_contours_request.gen.go b/macos/vision/detect_contours_request.gen.go new file mode 100644 index 00000000..a829541f --- /dev/null +++ b/macos/vision/detect_contours_request.gen.go @@ -0,0 +1,141 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectContoursRequest] class. +var DetectContoursRequestClass = _DetectContoursRequestClass{objc.GetClass("VNDetectContoursRequest")} + +type _DetectContoursRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectContoursRequest] class. +type IDetectContoursRequest interface { + IImageBasedRequest + ContrastPivot() foundation.Number + SetContrastPivot(value foundation.INumber) + DetectsDarkOnLight() bool + SetDetectsDarkOnLight(value bool) + ContrastAdjustment() float64 + SetContrastAdjustment(value float64) + MaximumImageDimension() uint + SetMaximumImageDimension(value uint) +} + +// A request that detects the contours of the edges of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest?language=objc +type DetectContoursRequest struct { + ImageBasedRequest +} + +func DetectContoursRequestFrom(ptr unsafe.Pointer) DetectContoursRequest { + return DetectContoursRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectContoursRequestClass) Alloc() DetectContoursRequest { + rv := objc.Call[DetectContoursRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectContoursRequest_Alloc() DetectContoursRequest { + return DetectContoursRequestClass.Alloc() +} + +func (dc _DetectContoursRequestClass) New() DetectContoursRequest { + rv := objc.Call[DetectContoursRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectContoursRequest() DetectContoursRequest { + return DetectContoursRequestClass.New() +} + +func (d_ DetectContoursRequest) Init() DetectContoursRequest { + rv := objc.Call[DetectContoursRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectContoursRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectContoursRequest { + rv := objc.Call[DetectContoursRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectContoursRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectContoursRequest { + instance := DetectContoursRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// The pixel value to use as a pivot for the contrast. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3750961-contrastpivot?language=objc +func (d_ DetectContoursRequest) ContrastPivot() foundation.Number { + rv := objc.Call[foundation.Number](d_, objc.Sel("contrastPivot")) + return rv +} + +// The pixel value to use as a pivot for the contrast. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3750961-contrastpivot?language=objc +func (d_ DetectContoursRequest) SetContrastPivot(value foundation.INumber) { + objc.Call[objc.Void](d_, objc.Sel("setContrastPivot:"), objc.Ptr(value)) +} + +// A Boolean value that indicates whether the request detects a dark object on a light background to aid in detection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3675596-detectsdarkonlight?language=objc +func (d_ DetectContoursRequest) DetectsDarkOnLight() bool { + rv := objc.Call[bool](d_, objc.Sel("detectsDarkOnLight")) + return rv +} + +// A Boolean value that indicates whether the request detects a dark object on a light background to aid in detection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3675596-detectsdarkonlight?language=objc +func (d_ DetectContoursRequest) SetDetectsDarkOnLight(value bool) { + objc.Call[objc.Void](d_, objc.Sel("setDetectsDarkOnLight:"), value) +} + +// The amount by which to adjust the image contrast. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3548236-contrastadjustment?language=objc +func (d_ DetectContoursRequest) ContrastAdjustment() float64 { + rv := objc.Call[float64](d_, objc.Sel("contrastAdjustment")) + return rv +} + +// The amount by which to adjust the image contrast. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3548236-contrastadjustment?language=objc +func (d_ DetectContoursRequest) SetContrastAdjustment(value float64) { + objc.Call[objc.Void](d_, objc.Sel("setContrastAdjustment:"), value) +} + +// The maximum image dimension to use for contour detection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3548238-maximumimagedimension?language=objc +func (d_ DetectContoursRequest) MaximumImageDimension() uint { + rv := objc.Call[uint](d_, objc.Sel("maximumImageDimension")) + return rv +} + +// The maximum image dimension to use for contour detection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/3548238-maximumimagedimension?language=objc +func (d_ DetectContoursRequest) SetMaximumImageDimension(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setMaximumImageDimension:"), value) +} diff --git a/macos/vision/detect_document_segmentation_request.gen.go b/macos/vision/detect_document_segmentation_request.gen.go new file mode 100644 index 00000000..1663e27a --- /dev/null +++ b/macos/vision/detect_document_segmentation_request.gen.go @@ -0,0 +1,72 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectDocumentSegmentationRequest] class. +var DetectDocumentSegmentationRequestClass = _DetectDocumentSegmentationRequestClass{objc.GetClass("VNDetectDocumentSegmentationRequest")} + +type _DetectDocumentSegmentationRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectDocumentSegmentationRequest] class. +type IDetectDocumentSegmentationRequest interface { + IImageBasedRequest +} + +// An object that detects rectangular regions that contain text in the input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectdocumentsegmentationrequest?language=objc +type DetectDocumentSegmentationRequest struct { + ImageBasedRequest +} + +func DetectDocumentSegmentationRequestFrom(ptr unsafe.Pointer) DetectDocumentSegmentationRequest { + return DetectDocumentSegmentationRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectDocumentSegmentationRequestClass) Alloc() DetectDocumentSegmentationRequest { + rv := objc.Call[DetectDocumentSegmentationRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectDocumentSegmentationRequest_Alloc() DetectDocumentSegmentationRequest { + return DetectDocumentSegmentationRequestClass.Alloc() +} + +func (dc _DetectDocumentSegmentationRequestClass) New() DetectDocumentSegmentationRequest { + rv := objc.Call[DetectDocumentSegmentationRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectDocumentSegmentationRequest() DetectDocumentSegmentationRequest { + return DetectDocumentSegmentationRequestClass.New() +} + +func (d_ DetectDocumentSegmentationRequest) Init() DetectDocumentSegmentationRequest { + rv := objc.Call[DetectDocumentSegmentationRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectDocumentSegmentationRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectDocumentSegmentationRequest { + rv := objc.Call[DetectDocumentSegmentationRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectDocumentSegmentationRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectDocumentSegmentationRequest { + instance := DetectDocumentSegmentationRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/detect_face_capture_quality_request.gen.go b/macos/vision/detect_face_capture_quality_request.gen.go new file mode 100644 index 00000000..5502631f --- /dev/null +++ b/macos/vision/detect_face_capture_quality_request.gen.go @@ -0,0 +1,72 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectFaceCaptureQualityRequest] class. +var DetectFaceCaptureQualityRequestClass = _DetectFaceCaptureQualityRequestClass{objc.GetClass("VNDetectFaceCaptureQualityRequest")} + +type _DetectFaceCaptureQualityRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectFaceCaptureQualityRequest] class. +type IDetectFaceCaptureQualityRequest interface { + IImageBasedRequest +} + +// A request that produces a floating-point number that represents the capture quality of a face in a photo. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequest?language=objc +type DetectFaceCaptureQualityRequest struct { + ImageBasedRequest +} + +func DetectFaceCaptureQualityRequestFrom(ptr unsafe.Pointer) DetectFaceCaptureQualityRequest { + return DetectFaceCaptureQualityRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectFaceCaptureQualityRequestClass) Alloc() DetectFaceCaptureQualityRequest { + rv := objc.Call[DetectFaceCaptureQualityRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectFaceCaptureQualityRequest_Alloc() DetectFaceCaptureQualityRequest { + return DetectFaceCaptureQualityRequestClass.Alloc() +} + +func (dc _DetectFaceCaptureQualityRequestClass) New() DetectFaceCaptureQualityRequest { + rv := objc.Call[DetectFaceCaptureQualityRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectFaceCaptureQualityRequest() DetectFaceCaptureQualityRequest { + return DetectFaceCaptureQualityRequestClass.New() +} + +func (d_ DetectFaceCaptureQualityRequest) Init() DetectFaceCaptureQualityRequest { + rv := objc.Call[DetectFaceCaptureQualityRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectFaceCaptureQualityRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectFaceCaptureQualityRequest { + rv := objc.Call[DetectFaceCaptureQualityRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectFaceCaptureQualityRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectFaceCaptureQualityRequest { + instance := DetectFaceCaptureQualityRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/detect_face_landmarks_request.gen.go b/macos/vision/detect_face_landmarks_request.gen.go new file mode 100644 index 00000000..91bea81f --- /dev/null +++ b/macos/vision/detect_face_landmarks_request.gen.go @@ -0,0 +1,104 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectFaceLandmarksRequest] class. +var DetectFaceLandmarksRequestClass = _DetectFaceLandmarksRequestClass{objc.GetClass("VNDetectFaceLandmarksRequest")} + +type _DetectFaceLandmarksRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectFaceLandmarksRequest] class. +type IDetectFaceLandmarksRequest interface { + IImageBasedRequest + Constellation() RequestFaceLandmarksConstellation + SetConstellation(value RequestFaceLandmarksConstellation) +} + +// An image analysis request that finds facial features like eyes and mouth in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequest?language=objc +type DetectFaceLandmarksRequest struct { + ImageBasedRequest +} + +func DetectFaceLandmarksRequestFrom(ptr unsafe.Pointer) DetectFaceLandmarksRequest { + return DetectFaceLandmarksRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectFaceLandmarksRequestClass) Alloc() DetectFaceLandmarksRequest { + rv := objc.Call[DetectFaceLandmarksRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectFaceLandmarksRequest_Alloc() DetectFaceLandmarksRequest { + return DetectFaceLandmarksRequestClass.Alloc() +} + +func (dc _DetectFaceLandmarksRequestClass) New() DetectFaceLandmarksRequest { + rv := objc.Call[DetectFaceLandmarksRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectFaceLandmarksRequest() DetectFaceLandmarksRequest { + return DetectFaceLandmarksRequestClass.New() +} + +func (d_ DetectFaceLandmarksRequest) Init() DetectFaceLandmarksRequest { + rv := objc.Call[DetectFaceLandmarksRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectFaceLandmarksRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectFaceLandmarksRequest { + rv := objc.Call[DetectFaceLandmarksRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectFaceLandmarksRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectFaceLandmarksRequest { + instance := DetectFaceLandmarksRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// Returns a Boolean value that indicates whether a revision supports a constellation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequest/3143665-revision?language=objc +func (dc _DetectFaceLandmarksRequestClass) RevisionSupportsConstellation(requestRevision uint, constellation RequestFaceLandmarksConstellation) bool { + rv := objc.Call[bool](dc, objc.Sel("revision:supportsConstellation:"), requestRevision, constellation) + return rv +} + +// Returns a Boolean value that indicates whether a revision supports a constellation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequest/3143665-revision?language=objc +func DetectFaceLandmarksRequest_RevisionSupportsConstellation(requestRevision uint, constellation RequestFaceLandmarksConstellation) bool { + return DetectFaceLandmarksRequestClass.RevisionSupportsConstellation(requestRevision, constellation) +} + +// A variable that describes how a face landmarks request orders or enumerates the resulting features. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequest/3143664-constellation?language=objc +func (d_ DetectFaceLandmarksRequest) Constellation() RequestFaceLandmarksConstellation { + rv := objc.Call[RequestFaceLandmarksConstellation](d_, objc.Sel("constellation")) + return rv +} + +// A variable that describes how a face landmarks request orders or enumerates the resulting features. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequest/3143664-constellation?language=objc +func (d_ DetectFaceLandmarksRequest) SetConstellation(value RequestFaceLandmarksConstellation) { + objc.Call[objc.Void](d_, objc.Sel("setConstellation:"), value) +} diff --git a/macos/vision/detect_face_rectangles_request.gen.go b/macos/vision/detect_face_rectangles_request.gen.go new file mode 100644 index 00000000..49cab175 --- /dev/null +++ b/macos/vision/detect_face_rectangles_request.gen.go @@ -0,0 +1,72 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectFaceRectanglesRequest] class. +var DetectFaceRectanglesRequestClass = _DetectFaceRectanglesRequestClass{objc.GetClass("VNDetectFaceRectanglesRequest")} + +type _DetectFaceRectanglesRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectFaceRectanglesRequest] class. +type IDetectFaceRectanglesRequest interface { + IImageBasedRequest +} + +// A request that finds faces within an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectfacerectanglesrequest?language=objc +type DetectFaceRectanglesRequest struct { + ImageBasedRequest +} + +func DetectFaceRectanglesRequestFrom(ptr unsafe.Pointer) DetectFaceRectanglesRequest { + return DetectFaceRectanglesRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectFaceRectanglesRequestClass) Alloc() DetectFaceRectanglesRequest { + rv := objc.Call[DetectFaceRectanglesRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectFaceRectanglesRequest_Alloc() DetectFaceRectanglesRequest { + return DetectFaceRectanglesRequestClass.Alloc() +} + +func (dc _DetectFaceRectanglesRequestClass) New() DetectFaceRectanglesRequest { + rv := objc.Call[DetectFaceRectanglesRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectFaceRectanglesRequest() DetectFaceRectanglesRequest { + return DetectFaceRectanglesRequestClass.New() +} + +func (d_ DetectFaceRectanglesRequest) Init() DetectFaceRectanglesRequest { + rv := objc.Call[DetectFaceRectanglesRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectFaceRectanglesRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectFaceRectanglesRequest { + rv := objc.Call[DetectFaceRectanglesRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectFaceRectanglesRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectFaceRectanglesRequest { + instance := DetectFaceRectanglesRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/detect_horizon_request.gen.go b/macos/vision/detect_horizon_request.gen.go new file mode 100644 index 00000000..390d5917 --- /dev/null +++ b/macos/vision/detect_horizon_request.gen.go @@ -0,0 +1,72 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectHorizonRequest] class. +var DetectHorizonRequestClass = _DetectHorizonRequestClass{objc.GetClass("VNDetectHorizonRequest")} + +type _DetectHorizonRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectHorizonRequest] class. +type IDetectHorizonRequest interface { + IImageBasedRequest +} + +// An image analysis request that determines the horizon angle in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthorizonrequest?language=objc +type DetectHorizonRequest struct { + ImageBasedRequest +} + +func DetectHorizonRequestFrom(ptr unsafe.Pointer) DetectHorizonRequest { + return DetectHorizonRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectHorizonRequestClass) Alloc() DetectHorizonRequest { + rv := objc.Call[DetectHorizonRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectHorizonRequest_Alloc() DetectHorizonRequest { + return DetectHorizonRequestClass.Alloc() +} + +func (dc _DetectHorizonRequestClass) New() DetectHorizonRequest { + rv := objc.Call[DetectHorizonRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectHorizonRequest() DetectHorizonRequest { + return DetectHorizonRequestClass.New() +} + +func (d_ DetectHorizonRequest) Init() DetectHorizonRequest { + rv := objc.Call[DetectHorizonRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectHorizonRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHorizonRequest { + rv := objc.Call[DetectHorizonRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectHorizonRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHorizonRequest { + instance := DetectHorizonRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/detect_human_body_pose_request.gen.go b/macos/vision/detect_human_body_pose_request.gen.go new file mode 100644 index 00000000..7d3979c6 --- /dev/null +++ b/macos/vision/detect_human_body_pose_request.gen.go @@ -0,0 +1,72 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectHumanBodyPoseRequest] class. +var DetectHumanBodyPoseRequestClass = _DetectHumanBodyPoseRequestClass{objc.GetClass("VNDetectHumanBodyPoseRequest")} + +type _DetectHumanBodyPoseRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectHumanBodyPoseRequest] class. +type IDetectHumanBodyPoseRequest interface { + IImageBasedRequest +} + +// A request that detects a human body pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthumanbodyposerequest?language=objc +type DetectHumanBodyPoseRequest struct { + ImageBasedRequest +} + +func DetectHumanBodyPoseRequestFrom(ptr unsafe.Pointer) DetectHumanBodyPoseRequest { + return DetectHumanBodyPoseRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectHumanBodyPoseRequestClass) Alloc() DetectHumanBodyPoseRequest { + rv := objc.Call[DetectHumanBodyPoseRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectHumanBodyPoseRequest_Alloc() DetectHumanBodyPoseRequest { + return DetectHumanBodyPoseRequestClass.Alloc() +} + +func (dc _DetectHumanBodyPoseRequestClass) New() DetectHumanBodyPoseRequest { + rv := objc.Call[DetectHumanBodyPoseRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectHumanBodyPoseRequest() DetectHumanBodyPoseRequest { + return DetectHumanBodyPoseRequestClass.New() +} + +func (d_ DetectHumanBodyPoseRequest) Init() DetectHumanBodyPoseRequest { + rv := objc.Call[DetectHumanBodyPoseRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectHumanBodyPoseRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHumanBodyPoseRequest { + rv := objc.Call[DetectHumanBodyPoseRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectHumanBodyPoseRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHumanBodyPoseRequest { + instance := DetectHumanBodyPoseRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/detect_human_hand_pose_request.gen.go b/macos/vision/detect_human_hand_pose_request.gen.go new file mode 100644 index 00000000..3ea77c52 --- /dev/null +++ b/macos/vision/detect_human_hand_pose_request.gen.go @@ -0,0 +1,89 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectHumanHandPoseRequest] class. +var DetectHumanHandPoseRequestClass = _DetectHumanHandPoseRequestClass{objc.GetClass("VNDetectHumanHandPoseRequest")} + +type _DetectHumanHandPoseRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectHumanHandPoseRequest] class. +type IDetectHumanHandPoseRequest interface { + IImageBasedRequest + MaximumHandCount() uint + SetMaximumHandCount(value uint) +} + +// A request that detects a human hand pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthumanhandposerequest?language=objc +type DetectHumanHandPoseRequest struct { + ImageBasedRequest +} + +func DetectHumanHandPoseRequestFrom(ptr unsafe.Pointer) DetectHumanHandPoseRequest { + return DetectHumanHandPoseRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectHumanHandPoseRequestClass) Alloc() DetectHumanHandPoseRequest { + rv := objc.Call[DetectHumanHandPoseRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectHumanHandPoseRequest_Alloc() DetectHumanHandPoseRequest { + return DetectHumanHandPoseRequestClass.Alloc() +} + +func (dc _DetectHumanHandPoseRequestClass) New() DetectHumanHandPoseRequest { + rv := objc.Call[DetectHumanHandPoseRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectHumanHandPoseRequest() DetectHumanHandPoseRequest { + return DetectHumanHandPoseRequestClass.New() +} + +func (d_ DetectHumanHandPoseRequest) Init() DetectHumanHandPoseRequest { + rv := objc.Call[DetectHumanHandPoseRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectHumanHandPoseRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHumanHandPoseRequest { + rv := objc.Call[DetectHumanHandPoseRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectHumanHandPoseRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHumanHandPoseRequest { + instance := DetectHumanHandPoseRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// The maximum number of hands to detect in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthumanhandposerequest/3571271-maximumhandcount?language=objc +func (d_ DetectHumanHandPoseRequest) MaximumHandCount() uint { + rv := objc.Call[uint](d_, objc.Sel("maximumHandCount")) + return rv +} + +// The maximum number of hands to detect in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthumanhandposerequest/3571271-maximumhandcount?language=objc +func (d_ DetectHumanHandPoseRequest) SetMaximumHandCount(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setMaximumHandCount:"), value) +} diff --git a/macos/vision/detect_human_rectangles_request.gen.go b/macos/vision/detect_human_rectangles_request.gen.go new file mode 100644 index 00000000..69b2c1b4 --- /dev/null +++ b/macos/vision/detect_human_rectangles_request.gen.go @@ -0,0 +1,89 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectHumanRectanglesRequest] class. +var DetectHumanRectanglesRequestClass = _DetectHumanRectanglesRequestClass{objc.GetClass("VNDetectHumanRectanglesRequest")} + +type _DetectHumanRectanglesRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectHumanRectanglesRequest] class. +type IDetectHumanRectanglesRequest interface { + IImageBasedRequest + UpperBodyOnly() bool + SetUpperBodyOnly(value bool) +} + +// A request that finds rectangular regions that contain people in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequest?language=objc +type DetectHumanRectanglesRequest struct { + ImageBasedRequest +} + +func DetectHumanRectanglesRequestFrom(ptr unsafe.Pointer) DetectHumanRectanglesRequest { + return DetectHumanRectanglesRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectHumanRectanglesRequestClass) Alloc() DetectHumanRectanglesRequest { + rv := objc.Call[DetectHumanRectanglesRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectHumanRectanglesRequest_Alloc() DetectHumanRectanglesRequest { + return DetectHumanRectanglesRequestClass.Alloc() +} + +func (dc _DetectHumanRectanglesRequestClass) New() DetectHumanRectanglesRequest { + rv := objc.Call[DetectHumanRectanglesRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectHumanRectanglesRequest() DetectHumanRectanglesRequest { + return DetectHumanRectanglesRequestClass.New() +} + +func (d_ DetectHumanRectanglesRequest) Init() DetectHumanRectanglesRequest { + rv := objc.Call[DetectHumanRectanglesRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectHumanRectanglesRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHumanRectanglesRequest { + rv := objc.Call[DetectHumanRectanglesRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectHumanRectanglesRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectHumanRectanglesRequest { + instance := DetectHumanRectanglesRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// A Boolean value that indicates whether the request requires detecting a full body or upper body only to produce a result. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequest/3750977-upperbodyonly?language=objc +func (d_ DetectHumanRectanglesRequest) UpperBodyOnly() bool { + rv := objc.Call[bool](d_, objc.Sel("upperBodyOnly")) + return rv +} + +// A Boolean value that indicates whether the request requires detecting a full body or upper body only to produce a result. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequest/3750977-upperbodyonly?language=objc +func (d_ DetectHumanRectanglesRequest) SetUpperBodyOnly(value bool) { + objc.Call[objc.Void](d_, objc.Sel("setUpperBodyOnly:"), value) +} diff --git a/macos/vision/detect_rectangles_request.gen.go b/macos/vision/detect_rectangles_request.gen.go new file mode 100644 index 00000000..df62631d --- /dev/null +++ b/macos/vision/detect_rectangles_request.gen.go @@ -0,0 +1,174 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectRectanglesRequest] class. +var DetectRectanglesRequestClass = _DetectRectanglesRequestClass{objc.GetClass("VNDetectRectanglesRequest")} + +type _DetectRectanglesRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectRectanglesRequest] class. +type IDetectRectanglesRequest interface { + IImageBasedRequest + MinimumAspectRatio() AspectRatio + SetMinimumAspectRatio(value AspectRatio) + MinimumSize() float64 + SetMinimumSize(value float64) + MinimumConfidence() Confidence + SetMinimumConfidence(value Confidence) + MaximumObservations() uint + SetMaximumObservations(value uint) + MaximumAspectRatio() AspectRatio + SetMaximumAspectRatio(value AspectRatio) + QuadratureTolerance() Degrees + SetQuadratureTolerance(value Degrees) +} + +// An image analysis request that finds projected rectangular regions in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest?language=objc +type DetectRectanglesRequest struct { + ImageBasedRequest +} + +func DetectRectanglesRequestFrom(ptr unsafe.Pointer) DetectRectanglesRequest { + return DetectRectanglesRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectRectanglesRequestClass) Alloc() DetectRectanglesRequest { + rv := objc.Call[DetectRectanglesRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectRectanglesRequest_Alloc() DetectRectanglesRequest { + return DetectRectanglesRequestClass.Alloc() +} + +func (dc _DetectRectanglesRequestClass) New() DetectRectanglesRequest { + rv := objc.Call[DetectRectanglesRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectRectanglesRequest() DetectRectanglesRequest { + return DetectRectanglesRequestClass.New() +} + +func (d_ DetectRectanglesRequest) Init() DetectRectanglesRequest { + rv := objc.Call[DetectRectanglesRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectRectanglesRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectRectanglesRequest { + rv := objc.Call[DetectRectanglesRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectRectanglesRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectRectanglesRequest { + instance := DetectRectanglesRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// A float specifying the minimum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875378-minimumaspectratio?language=objc +func (d_ DetectRectanglesRequest) MinimumAspectRatio() AspectRatio { + rv := objc.Call[AspectRatio](d_, objc.Sel("minimumAspectRatio")) + return rv +} + +// A float specifying the minimum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875378-minimumaspectratio?language=objc +func (d_ DetectRectanglesRequest) SetMinimumAspectRatio(value AspectRatio) { + objc.Call[objc.Void](d_, objc.Sel("setMinimumAspectRatio:"), value) +} + +// The minimum size of a rectangle to detect, as a proportion of the smallest dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875374-minimumsize?language=objc +func (d_ DetectRectanglesRequest) MinimumSize() float64 { + rv := objc.Call[float64](d_, objc.Sel("minimumSize")) + return rv +} + +// The minimum size of a rectangle to detect, as a proportion of the smallest dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875374-minimumsize?language=objc +func (d_ DetectRectanglesRequest) SetMinimumSize(value float64) { + objc.Call[objc.Void](d_, objc.Sel("setMinimumSize:"), value) +} + +// A value specifying the minimum acceptable confidence level. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875375-minimumconfidence?language=objc +func (d_ DetectRectanglesRequest) MinimumConfidence() Confidence { + rv := objc.Call[Confidence](d_, objc.Sel("minimumConfidence")) + return rv +} + +// A value specifying the minimum acceptable confidence level. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875375-minimumconfidence?language=objc +func (d_ DetectRectanglesRequest) SetMinimumConfidence(value Confidence) { + objc.Call[objc.Void](d_, objc.Sel("setMinimumConfidence:"), value) +} + +// An integer specifying the maximum number of rectangles Vision returns. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875373-maximumobservations?language=objc +func (d_ DetectRectanglesRequest) MaximumObservations() uint { + rv := objc.Call[uint](d_, objc.Sel("maximumObservations")) + return rv +} + +// An integer specifying the maximum number of rectangles Vision returns. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875373-maximumobservations?language=objc +func (d_ DetectRectanglesRequest) SetMaximumObservations(value uint) { + objc.Call[objc.Void](d_, objc.Sel("setMaximumObservations:"), value) +} + +// A float specifying the maximum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875376-maximumaspectratio?language=objc +func (d_ DetectRectanglesRequest) MaximumAspectRatio() AspectRatio { + rv := objc.Call[AspectRatio](d_, objc.Sel("maximumAspectRatio")) + return rv +} + +// A float specifying the maximum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875376-maximumaspectratio?language=objc +func (d_ DetectRectanglesRequest) SetMaximumAspectRatio(value AspectRatio) { + objc.Call[objc.Void](d_, objc.Sel("setMaximumAspectRatio:"), value) +} + +// A float specifying the number of degrees a rectangle corner angle can deviate from 90°. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875379-quadraturetolerance?language=objc +func (d_ DetectRectanglesRequest) QuadratureTolerance() Degrees { + rv := objc.Call[Degrees](d_, objc.Sel("quadratureTolerance")) + return rv +} + +// A float specifying the number of degrees a rectangle corner angle can deviate from 90°. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectrectanglesrequest/2875379-quadraturetolerance?language=objc +func (d_ DetectRectanglesRequest) SetQuadratureTolerance(value Degrees) { + objc.Call[objc.Void](d_, objc.Sel("setQuadratureTolerance:"), value) +} diff --git a/macos/vision/detect_text_rectangles_request.gen.go b/macos/vision/detect_text_rectangles_request.gen.go new file mode 100644 index 00000000..e84f9cbb --- /dev/null +++ b/macos/vision/detect_text_rectangles_request.gen.go @@ -0,0 +1,89 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectTextRectanglesRequest] class. +var DetectTextRectanglesRequestClass = _DetectTextRectanglesRequestClass{objc.GetClass("VNDetectTextRectanglesRequest")} + +type _DetectTextRectanglesRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectTextRectanglesRequest] class. +type IDetectTextRectanglesRequest interface { + IImageBasedRequest + ReportCharacterBoxes() bool + SetReportCharacterBoxes(value bool) +} + +// An image analysis request that finds regions of visible text in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttextrectanglesrequest?language=objc +type DetectTextRectanglesRequest struct { + ImageBasedRequest +} + +func DetectTextRectanglesRequestFrom(ptr unsafe.Pointer) DetectTextRectanglesRequest { + return DetectTextRectanglesRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (dc _DetectTextRectanglesRequestClass) Alloc() DetectTextRectanglesRequest { + rv := objc.Call[DetectTextRectanglesRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectTextRectanglesRequest_Alloc() DetectTextRectanglesRequest { + return DetectTextRectanglesRequestClass.Alloc() +} + +func (dc _DetectTextRectanglesRequestClass) New() DetectTextRectanglesRequest { + rv := objc.Call[DetectTextRectanglesRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectTextRectanglesRequest() DetectTextRectanglesRequest { + return DetectTextRectanglesRequestClass.New() +} + +func (d_ DetectTextRectanglesRequest) Init() DetectTextRectanglesRequest { + rv := objc.Call[DetectTextRectanglesRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectTextRectanglesRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectTextRectanglesRequest { + rv := objc.Call[DetectTextRectanglesRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectTextRectanglesRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectTextRectanglesRequest { + instance := DetectTextRectanglesRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// A Boolean value that indicates whether the request detects character bounding boxes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttextrectanglesrequest/2875410-reportcharacterboxes?language=objc +func (d_ DetectTextRectanglesRequest) ReportCharacterBoxes() bool { + rv := objc.Call[bool](d_, objc.Sel("reportCharacterBoxes")) + return rv +} + +// A Boolean value that indicates whether the request detects character bounding boxes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttextrectanglesrequest/2875410-reportcharacterboxes?language=objc +func (d_ DetectTextRectanglesRequest) SetReportCharacterBoxes(value bool) { + objc.Call[objc.Void](d_, objc.Sel("setReportCharacterBoxes:"), value) +} diff --git a/macos/vision/detect_trajectories_request.gen.go b/macos/vision/detect_trajectories_request.gen.go new file mode 100644 index 00000000..afd5982e --- /dev/null +++ b/macos/vision/detect_trajectories_request.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectTrajectoriesRequest] class. +var DetectTrajectoriesRequestClass = _DetectTrajectoriesRequestClass{objc.GetClass("VNDetectTrajectoriesRequest")} + +type _DetectTrajectoriesRequestClass struct { + objc.Class +} + +// An interface definition for the [DetectTrajectoriesRequest] class. +type IDetectTrajectoriesRequest interface { + IStatefulRequest + ObjectMaximumNormalizedRadius() float64 + SetObjectMaximumNormalizedRadius(value float64) + TargetFrameTime() coremedia.Time + SetTargetFrameTime(value coremedia.Time) + TrajectoryLength() int + ObjectMinimumNormalizedRadius() float64 + SetObjectMinimumNormalizedRadius(value float64) +} + +// A request that detects the trajectories of shapes moving along a parabolic path. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest?language=objc +type DetectTrajectoriesRequest struct { + StatefulRequest +} + +func DetectTrajectoriesRequestFrom(ptr unsafe.Pointer) DetectTrajectoriesRequest { + return DetectTrajectoriesRequest{ + StatefulRequest: StatefulRequestFrom(ptr), + } +} + +func (d_ DetectTrajectoriesRequest) InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler(frameAnalysisSpacing coremedia.Time, trajectoryLength int, completionHandler RequestCompletionHandler) DetectTrajectoriesRequest { + rv := objc.Call[DetectTrajectoriesRequest](d_, objc.Sel("initWithFrameAnalysisSpacing:trajectoryLength:completionHandler:"), frameAnalysisSpacing, trajectoryLength, completionHandler) + return rv +} + +// Creates a new request to detect trajectories. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3600612-initwithframeanalysisspacing?language=objc +func NewDetectTrajectoriesRequestWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler(frameAnalysisSpacing coremedia.Time, trajectoryLength int, completionHandler RequestCompletionHandler) DetectTrajectoriesRequest { + instance := DetectTrajectoriesRequestClass.Alloc().InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler(frameAnalysisSpacing, trajectoryLength, completionHandler) + instance.Autorelease() + return instance +} + +func (dc _DetectTrajectoriesRequestClass) Alloc() DetectTrajectoriesRequest { + rv := objc.Call[DetectTrajectoriesRequest](dc, objc.Sel("alloc")) + return rv +} + +func DetectTrajectoriesRequest_Alloc() DetectTrajectoriesRequest { + return DetectTrajectoriesRequestClass.Alloc() +} + +func (dc _DetectTrajectoriesRequestClass) New() DetectTrajectoriesRequest { + rv := objc.Call[DetectTrajectoriesRequest](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectTrajectoriesRequest() DetectTrajectoriesRequest { + return DetectTrajectoriesRequestClass.New() +} + +func (d_ DetectTrajectoriesRequest) Init() DetectTrajectoriesRequest { + rv := objc.Call[DetectTrajectoriesRequest](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectTrajectoriesRequest) InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing coremedia.Time, completionHandler RequestCompletionHandler) DetectTrajectoriesRequest { + rv := objc.Call[DetectTrajectoriesRequest](d_, objc.Sel("initWithFrameAnalysisSpacing:completionHandler:"), frameAnalysisSpacing, completionHandler) + return rv +} + +// Initializes a video-based request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnstatefulrequest/3564828-initwithframeanalysisspacing?language=objc +func NewDetectTrajectoriesRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing coremedia.Time, completionHandler RequestCompletionHandler) DetectTrajectoriesRequest { + instance := DetectTrajectoriesRequestClass.Alloc().InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing, completionHandler) + instance.Autorelease() + return instance +} + +func (d_ DetectTrajectoriesRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) DetectTrajectoriesRequest { + rv := objc.Call[DetectTrajectoriesRequest](d_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewDetectTrajectoriesRequestWithCompletionHandler(completionHandler RequestCompletionHandler) DetectTrajectoriesRequest { + instance := DetectTrajectoriesRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// The maximum radius of the bounding circle of the object to track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3675670-objectmaximumnormalizedradius?language=objc +func (d_ DetectTrajectoriesRequest) ObjectMaximumNormalizedRadius() float64 { + rv := objc.Call[float64](d_, objc.Sel("objectMaximumNormalizedRadius")) + return rv +} + +// The maximum radius of the bounding circle of the object to track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3675670-objectmaximumnormalizedradius?language=objc +func (d_ DetectTrajectoriesRequest) SetObjectMaximumNormalizedRadius(value float64) { + objc.Call[objc.Void](d_, objc.Sel("setObjectMaximumNormalizedRadius:"), value) +} + +// The requested target frame time for processing trajectory detection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3750981-targetframetime?language=objc +func (d_ DetectTrajectoriesRequest) TargetFrameTime() coremedia.Time { + rv := objc.Call[coremedia.Time](d_, objc.Sel("targetFrameTime")) + return rv +} + +// The requested target frame time for processing trajectory detection. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3750981-targetframetime?language=objc +func (d_ DetectTrajectoriesRequest) SetTargetFrameTime(value coremedia.Time) { + objc.Call[objc.Void](d_, objc.Sel("setTargetFrameTime:"), value) +} + +// The number of points to detect before calculating a trajectory. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3675673-trajectorylength?language=objc +func (d_ DetectTrajectoriesRequest) TrajectoryLength() int { + rv := objc.Call[int](d_, objc.Sel("trajectoryLength")) + return rv +} + +// The minimum radius of the bounding circle of the object to track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3675671-objectminimumnormalizedradius?language=objc +func (d_ DetectTrajectoriesRequest) ObjectMinimumNormalizedRadius() float64 { + rv := objc.Call[float64](d_, objc.Sel("objectMinimumNormalizedRadius")) + return rv +} + +// The minimum radius of the bounding circle of the object to track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/3675671-objectminimumnormalizedradius?language=objc +func (d_ DetectTrajectoriesRequest) SetObjectMinimumNormalizedRadius(value float64) { + objc.Call[objc.Void](d_, objc.Sel("setObjectMinimumNormalizedRadius:"), value) +} diff --git a/macos/vision/detected_object_observation.gen.go b/macos/vision/detected_object_observation.gen.go new file mode 100644 index 00000000..fa0ebca8 --- /dev/null +++ b/macos/vision/detected_object_observation.gen.go @@ -0,0 +1,101 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectedObjectObservation] class. +var DetectedObjectObservationClass = _DetectedObjectObservationClass{objc.GetClass("VNDetectedObjectObservation")} + +type _DetectedObjectObservationClass struct { + objc.Class +} + +// An interface definition for the [DetectedObjectObservation] class. +type IDetectedObjectObservation interface { + IObservation + GlobalSegmentationMask() PixelBufferObservation + BoundingBox() coregraphics.Rect +} + +// An observation that provides the position and extent of an image feature that an image analysis request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation?language=objc +type DetectedObjectObservation struct { + Observation +} + +func DetectedObjectObservationFrom(ptr unsafe.Pointer) DetectedObjectObservation { + return DetectedObjectObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (dc _DetectedObjectObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) DetectedObjectObservation { + rv := objc.Call[DetectedObjectObservation](dc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func DetectedObjectObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) DetectedObjectObservation { + return DetectedObjectObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (dc _DetectedObjectObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) DetectedObjectObservation { + rv := objc.Call[DetectedObjectObservation](dc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func DetectedObjectObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) DetectedObjectObservation { + return DetectedObjectObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +func (dc _DetectedObjectObservationClass) Alloc() DetectedObjectObservation { + rv := objc.Call[DetectedObjectObservation](dc, objc.Sel("alloc")) + return rv +} + +func DetectedObjectObservation_Alloc() DetectedObjectObservation { + return DetectedObjectObservationClass.Alloc() +} + +func (dc _DetectedObjectObservationClass) New() DetectedObjectObservation { + rv := objc.Call[DetectedObjectObservation](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectedObjectObservation() DetectedObjectObservation { + return DetectedObjectObservationClass.New() +} + +func (d_ DetectedObjectObservation) Init() DetectedObjectObservation { + rv := objc.Call[DetectedObjectObservation](d_, objc.Sel("init")) + return rv +} + +// A resulting pixel buffer from a request to generate a segmentation mask for an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/3798796-globalsegmentationmask?language=objc +func (d_ DetectedObjectObservation) GlobalSegmentationMask() PixelBufferObservation { + rv := objc.Call[PixelBufferObservation](d_, objc.Sel("globalSegmentationMask")) + return rv +} + +// The bounding box of the object that the request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2867227-boundingbox?language=objc +func (d_ DetectedObjectObservation) BoundingBox() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](d_, objc.Sel("boundingBox")) + return rv +} diff --git a/macos/vision/detected_point.gen.go b/macos/vision/detected_point.gen.go new file mode 100644 index 00000000..4394bede --- /dev/null +++ b/macos/vision/detected_point.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [DetectedPoint] class. +var DetectedPointClass = _DetectedPointClass{objc.GetClass("VNDetectedPoint")} + +type _DetectedPointClass struct { + objc.Class +} + +// An interface definition for the [DetectedPoint] class. +type IDetectedPoint interface { + IPoint + Confidence() Confidence +} + +// An object that represents a normalized point in an image, along with a confidence value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedpoint?language=objc +type DetectedPoint struct { + Point +} + +func DetectedPointFrom(ptr unsafe.Pointer) DetectedPoint { + return DetectedPoint{ + Point: PointFrom(ptr), + } +} + +func (dc _DetectedPointClass) Alloc() DetectedPoint { + rv := objc.Call[DetectedPoint](dc, objc.Sel("alloc")) + return rv +} + +func DetectedPoint_Alloc() DetectedPoint { + return DetectedPointClass.Alloc() +} + +func (dc _DetectedPointClass) New() DetectedPoint { + rv := objc.Call[DetectedPoint](dc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewDetectedPoint() DetectedPoint { + return DetectedPointClass.New() +} + +func (d_ DetectedPoint) Init() DetectedPoint { + rv := objc.Call[DetectedPoint](d_, objc.Sel("init")) + return rv +} + +func (d_ DetectedPoint) InitWithXY(x float64, y float64) DetectedPoint { + rv := objc.Call[DetectedPoint](d_, objc.Sel("initWithX:y:"), x, y) + return rv +} + +// Creates a point object with the specified coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548331-initwithx?language=objc +func NewDetectedPointWithXY(x float64, y float64) DetectedPoint { + instance := DetectedPointClass.Alloc().InitWithXY(x, y) + instance.Autorelease() + return instance +} + +func (d_ DetectedPoint) InitWithLocation(location coregraphics.Point) DetectedPoint { + rv := objc.Call[DetectedPoint](d_, objc.Sel("initWithLocation:"), location) + return rv +} + +// Creates a point object from the specified Core Graphics point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548330-initwithlocation?language=objc +func NewDetectedPointWithLocation(location coregraphics.Point) DetectedPoint { + instance := DetectedPointClass.Alloc().InitWithLocation(location) + instance.Autorelease() + return instance +} + +// A confidence score that indicates the detected point’s accuracy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedpoint/3548297-confidence?language=objc +func (d_ DetectedPoint) Confidence() Confidence { + rv := objc.Call[Confidence](d_, objc.Sel("confidence")) + return rv +} diff --git a/macos/vision/doc.gen.go b/macos/vision/doc.gen.go new file mode 100644 index 00000000..4717a4ff --- /dev/null +++ b/macos/vision/doc.gen.go @@ -0,0 +1,8 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +// Apply computer vision algorithms to perform a variety of tasks on input images and video. +// +// [Full Documentation] +// +// [Full Documentation]: https://developer.apple.com/documentation/vision?language=objc +package vision diff --git a/macos/vision/enumtypes.gen.go b/macos/vision/enumtypes.gen.go new file mode 100644 index 00000000..9b61d4f2 --- /dev/null +++ b/macos/vision/enumtypes.gen.go @@ -0,0 +1,322 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +// An animal identifier string. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnanimalidentifier?language=objc +type AnimalIdentifier string + +const ( + AnimalIdentifierCat AnimalIdentifier = "Cat" + AnimalIdentifierDog AnimalIdentifier = "Dog" +) + +// A type alias for expressing rectangle aspect ratios in Vision. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnaspectratio?language=objc +type AspectRatio float64 + +// The barcode symbologies that the framework detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnbarcodesymbology?language=objc +type BarcodeSymbology string + +const ( + BarcodeSymbologyAztec BarcodeSymbology = "VNBarcodeSymbologyAztec" + BarcodeSymbologyCodabar BarcodeSymbology = "VNBarcodeSymbologyCodabar" + BarcodeSymbologyCode128 BarcodeSymbology = "VNBarcodeSymbologyCode128" + BarcodeSymbologyCode39 BarcodeSymbology = "VNBarcodeSymbologyCode39" + BarcodeSymbologyCode39Checksum BarcodeSymbology = "VNBarcodeSymbologyCode39Checksum" + BarcodeSymbologyCode39FullASCII BarcodeSymbology = "VNBarcodeSymbologyCode39FullASCII" + BarcodeSymbologyCode39FullASCIIChecksum BarcodeSymbology = "VNBarcodeSymbologyCode39FullASCIIChecksum" + BarcodeSymbologyCode93 BarcodeSymbology = "VNBarcodeSymbologyCode93" + BarcodeSymbologyCode93i BarcodeSymbology = "VNBarcodeSymbologyCode93i" + BarcodeSymbologyDataMatrix BarcodeSymbology = "VNBarcodeSymbologyDataMatrix" + BarcodeSymbologyEAN13 BarcodeSymbology = "VNBarcodeSymbologyEAN13" + BarcodeSymbologyEAN8 BarcodeSymbology = "VNBarcodeSymbologyEAN8" + BarcodeSymbologyGS1DataBar BarcodeSymbology = "VNBarcodeSymbologyGS1DataBar" + BarcodeSymbologyGS1DataBarExpanded BarcodeSymbology = "VNBarcodeSymbologyGS1DataBarExpanded" + BarcodeSymbologyGS1DataBarLimited BarcodeSymbology = "VNBarcodeSymbologyGS1DataBarLimited" + BarcodeSymbologyI2of5 BarcodeSymbology = "VNBarcodeSymbologyI2of5" + BarcodeSymbologyI2of5Checksum BarcodeSymbology = "VNBarcodeSymbologyI2of5Checksum" + BarcodeSymbologyITF14 BarcodeSymbology = "VNBarcodeSymbologyITF14" + BarcodeSymbologyMicroPDF417 BarcodeSymbology = "VNBarcodeSymbologyMicroPDF417" + BarcodeSymbologyMicroQR BarcodeSymbology = "VNBarcodeSymbologyMicroQR" + BarcodeSymbologyPDF417 BarcodeSymbology = "VNBarcodeSymbologyPDF417" + BarcodeSymbologyQR BarcodeSymbology = "VNBarcodeSymbologyQR" + BarcodeSymbologyUPCE BarcodeSymbology = "VNBarcodeSymbologyUPCE" +) + +// Constants that the define the chirality, or handedness, of a pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnchirality?language=objc +type Chirality int + +const ( + ChiralityLeft Chirality = -1 + ChiralityRight Chirality = 1 + ChiralityUnknown Chirality = 0 +) + +// A type alias for the confidence value of an observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnconfidence?language=objc +type Confidence float64 + +// A typealias for expressing tolerance angles in Vision. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndegrees?language=objc +type Degrees float64 + +// An enumeration of the type of element in feature print data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnelementtype?language=objc +type ElementType uint + +const ( + ElementTypeDouble ElementType = 2 + ElementTypeFloat ElementType = 1 + ElementTypeUnknown ElementType = 0 +) + +// Constants that identify errors from the framework. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnerrorcode?language=objc +type ErrorCode int + +const ( + ErrorDataUnavailable ErrorCode = 17 + ErrorIOError ErrorCode = 6 + ErrorInternalError ErrorCode = 9 + ErrorInvalidArgument ErrorCode = 14 + ErrorInvalidFormat ErrorCode = 2 + ErrorInvalidImage ErrorCode = 13 + ErrorInvalidModel ErrorCode = 15 + ErrorInvalidOperation ErrorCode = 12 + ErrorInvalidOption ErrorCode = 5 + ErrorMissingOption ErrorCode = 7 + ErrorNotImplemented ErrorCode = 8 + ErrorOK ErrorCode = 0 + ErrorOperationFailed ErrorCode = 3 + ErrorOutOfBoundsError ErrorCode = 4 + ErrorOutOfMemory ErrorCode = 10 + ErrorRequestCancelled ErrorCode = 1 + ErrorTimeStampNotFound ErrorCode = 18 + ErrorUnknownError ErrorCode = 11 + ErrorUnsupportedRequest ErrorCode = 19 + ErrorUnsupportedRevision ErrorCode = 16 +) + +// The supported optical flow accuracy levels. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequestcomputationaccuracy?language=objc +type GenerateOpticalFlowRequestComputationAccuracy uint + +const ( + GenerateOpticalFlowRequestComputationAccuracyHigh GenerateOpticalFlowRequestComputationAccuracy = 2 + GenerateOpticalFlowRequestComputationAccuracyLow GenerateOpticalFlowRequestComputationAccuracy = 0 + GenerateOpticalFlowRequestComputationAccuracyMedium GenerateOpticalFlowRequestComputationAccuracy = 1 + GenerateOpticalFlowRequestComputationAccuracyVeryHigh GenerateOpticalFlowRequestComputationAccuracy = 3 +) + +// Constants that define the levels of quality for a person segmentation request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequestqualitylevel?language=objc +type GeneratePersonSegmentationRequestQualityLevel uint + +const ( + GeneratePersonSegmentationRequestQualityLevelAccurate GeneratePersonSegmentationRequestQualityLevel = 0 + GeneratePersonSegmentationRequestQualityLevelBalanced GeneratePersonSegmentationRequestQualityLevel = 1 + GeneratePersonSegmentationRequestQualityLevelFast GeneratePersonSegmentationRequestQualityLevel = 2 +) + +// The supported joint names for the body pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanbodyposeobservationjointname?language=objc +type HumanBodyPoseObservationJointName RecognizedPointKey + +const ( + HumanBodyPoseObservationJointNameLeftAnkle HumanBodyPoseObservationJointName = "left_foot_joint" + HumanBodyPoseObservationJointNameLeftEar HumanBodyPoseObservationJointName = "left_ear_joint" + HumanBodyPoseObservationJointNameLeftElbow HumanBodyPoseObservationJointName = "left_forearm_joint" + HumanBodyPoseObservationJointNameLeftEye HumanBodyPoseObservationJointName = "left_eye_joint" + HumanBodyPoseObservationJointNameLeftHip HumanBodyPoseObservationJointName = "left_upLeg_joint" + HumanBodyPoseObservationJointNameLeftKnee HumanBodyPoseObservationJointName = "left_leg_joint" + HumanBodyPoseObservationJointNameLeftShoulder HumanBodyPoseObservationJointName = "left_shoulder_1_joint" + HumanBodyPoseObservationJointNameLeftWrist HumanBodyPoseObservationJointName = "left_hand_joint" + HumanBodyPoseObservationJointNameNeck HumanBodyPoseObservationJointName = "neck_1_joint" + HumanBodyPoseObservationJointNameNose HumanBodyPoseObservationJointName = "head_joint" + HumanBodyPoseObservationJointNameRightAnkle HumanBodyPoseObservationJointName = "right_foot_joint" + HumanBodyPoseObservationJointNameRightEar HumanBodyPoseObservationJointName = "right_ear_joint" + HumanBodyPoseObservationJointNameRightElbow HumanBodyPoseObservationJointName = "right_forearm_joint" + HumanBodyPoseObservationJointNameRightEye HumanBodyPoseObservationJointName = "right_eye_joint" + HumanBodyPoseObservationJointNameRightHip HumanBodyPoseObservationJointName = "right_upLeg_joint" + HumanBodyPoseObservationJointNameRightKnee HumanBodyPoseObservationJointName = "right_leg_joint" + HumanBodyPoseObservationJointNameRightShoulder HumanBodyPoseObservationJointName = "right_shoulder_1_joint" + HumanBodyPoseObservationJointNameRightWrist HumanBodyPoseObservationJointName = "right_hand_joint" + HumanBodyPoseObservationJointNameRoot HumanBodyPoseObservationJointName = "root" +) + +// The supported joint group names for the body pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanbodyposeobservationjointsgroupname?language=objc +type HumanBodyPoseObservationJointsGroupName RecognizedPointGroupKey + +const ( + HumanBodyPoseObservationJointsGroupNameAll HumanBodyPoseObservationJointsGroupName = "VNIPOAll" + HumanBodyPoseObservationJointsGroupNameFace HumanBodyPoseObservationJointsGroupName = "VNBLKFACE" + HumanBodyPoseObservationJointsGroupNameLeftArm HumanBodyPoseObservationJointsGroupName = "VNBLKLARM" + HumanBodyPoseObservationJointsGroupNameLeftLeg HumanBodyPoseObservationJointsGroupName = "VNBLKLLEG" + HumanBodyPoseObservationJointsGroupNameRightArm HumanBodyPoseObservationJointsGroupName = "VNBLKRARM" + HumanBodyPoseObservationJointsGroupNameRightLeg HumanBodyPoseObservationJointsGroupName = "VNBLKRLEG" + HumanBodyPoseObservationJointsGroupNameTorso HumanBodyPoseObservationJointsGroupName = "VNBLKTORSO" +) + +// The supported joint names for the hand pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointname?language=objc +type HumanHandPoseObservationJointName RecognizedPointKey + +const ( + HumanHandPoseObservationJointNameIndexDIP HumanHandPoseObservationJointName = "VNHLKIDIP" + HumanHandPoseObservationJointNameIndexMCP HumanHandPoseObservationJointName = "VNHLKIMCP" + HumanHandPoseObservationJointNameIndexPIP HumanHandPoseObservationJointName = "VNHLKIPIP" + HumanHandPoseObservationJointNameIndexTip HumanHandPoseObservationJointName = "VNHLKITIP" + HumanHandPoseObservationJointNameLittleDIP HumanHandPoseObservationJointName = "VNHLKPDIP" + HumanHandPoseObservationJointNameLittleMCP HumanHandPoseObservationJointName = "VNHLKPMCP" + HumanHandPoseObservationJointNameLittlePIP HumanHandPoseObservationJointName = "VNHLKPPIP" + HumanHandPoseObservationJointNameLittleTip HumanHandPoseObservationJointName = "VNHLKPTIP" + HumanHandPoseObservationJointNameMiddleDIP HumanHandPoseObservationJointName = "VNHLKMDIP" + HumanHandPoseObservationJointNameMiddleMCP HumanHandPoseObservationJointName = "VNHLKMMCP" + HumanHandPoseObservationJointNameMiddlePIP HumanHandPoseObservationJointName = "VNHLKMPIP" + HumanHandPoseObservationJointNameMiddleTip HumanHandPoseObservationJointName = "VNHLKMTIP" + HumanHandPoseObservationJointNameRingDIP HumanHandPoseObservationJointName = "VNHLKRDIP" + HumanHandPoseObservationJointNameRingMCP HumanHandPoseObservationJointName = "VNHLKRMCP" + HumanHandPoseObservationJointNameRingPIP HumanHandPoseObservationJointName = "VNHLKRPIP" + HumanHandPoseObservationJointNameRingTip HumanHandPoseObservationJointName = "VNHLKRTIP" + HumanHandPoseObservationJointNameThumbCMC HumanHandPoseObservationJointName = "VNHLKTCMC" + HumanHandPoseObservationJointNameThumbIP HumanHandPoseObservationJointName = "VNHLKTIP" + HumanHandPoseObservationJointNameThumbMP HumanHandPoseObservationJointName = "VNHLKTMP" + HumanHandPoseObservationJointNameThumbTip HumanHandPoseObservationJointName = "VNHLKTTIP" + HumanHandPoseObservationJointNameWrist HumanHandPoseObservationJointName = "VNHLKWRI" +) + +// The supported joint group names for the hand pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupname?language=objc +type HumanHandPoseObservationJointsGroupName RecognizedPointGroupKey + +const ( + HumanHandPoseObservationJointsGroupNameAll HumanHandPoseObservationJointsGroupName = "VNIPOAll" + HumanHandPoseObservationJointsGroupNameIndexFinger HumanHandPoseObservationJointsGroupName = "VNHLRKI" + HumanHandPoseObservationJointsGroupNameLittleFinger HumanHandPoseObservationJointsGroupName = "VNHLRKP" + HumanHandPoseObservationJointsGroupNameMiddleFinger HumanHandPoseObservationJointsGroupName = "VNHLRKM" + HumanHandPoseObservationJointsGroupNameRingFinger HumanHandPoseObservationJointsGroupName = "VNHLRKR" + HumanHandPoseObservationJointsGroupNameThumb HumanHandPoseObservationJointsGroupName = "VNHLRKT" +) + +// Options that define how Vision crops and scales an input-image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagecropandscaleoption?language=objc +type ImageCropAndScaleOption uint + +const ( + ImageCropAndScaleOptionCenterCrop ImageCropAndScaleOption = 0 + ImageCropAndScaleOptionScaleFill ImageCropAndScaleOption = 2 + ImageCropAndScaleOptionScaleFit ImageCropAndScaleOption = 1 +) + +// An option key passed into VNImageRequestHandler creations or requests that take an auxiliary image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimageoption?language=objc +type ImageOption string + +const ( + ImageOptionCIContext ImageOption = "VNImageOptionCIContext" + ImageOptionCameraIntrinsics ImageOption = "VNImageOptionCameraIntrinsics" + ImageOptionProperties ImageOption = "VNImageOptionProperties" +) + +// The data type for all recognized point group keys. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointgroupkey?language=objc +type RecognizedPointGroupKey string + +const ( + BodyLandmarkRegionKeyFace RecognizedPointGroupKey = "VNBLKFACE" + BodyLandmarkRegionKeyLeftArm RecognizedPointGroupKey = "VNBLKLARM" + BodyLandmarkRegionKeyLeftLeg RecognizedPointGroupKey = "VNBLKLLEG" + BodyLandmarkRegionKeyRightArm RecognizedPointGroupKey = "VNBLKRARM" + BodyLandmarkRegionKeyRightLeg RecognizedPointGroupKey = "VNBLKRLEG" + BodyLandmarkRegionKeyTorso RecognizedPointGroupKey = "VNBLKTORSO" + RecognizedPointGroupKeyAll RecognizedPointGroupKey = "VNIPOAll" +) + +// The data type for all recognized point keys. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointkey?language=objc +type RecognizedPointKey string + +const ( + BodyLandmarkKeyLeftAnkle RecognizedPointKey = "left_foot_joint" + BodyLandmarkKeyLeftEar RecognizedPointKey = "left_ear_joint" + BodyLandmarkKeyLeftElbow RecognizedPointKey = "left_forearm_joint" + BodyLandmarkKeyLeftEye RecognizedPointKey = "left_eye_joint" + BodyLandmarkKeyLeftHip RecognizedPointKey = "left_upLeg_joint" + BodyLandmarkKeyLeftKnee RecognizedPointKey = "left_leg_joint" + BodyLandmarkKeyLeftShoulder RecognizedPointKey = "left_shoulder_1_joint" + BodyLandmarkKeyLeftWrist RecognizedPointKey = "left_hand_joint" + BodyLandmarkKeyNeck RecognizedPointKey = "neck_1_joint" + BodyLandmarkKeyNose RecognizedPointKey = "head_joint" + BodyLandmarkKeyRightAnkle RecognizedPointKey = "right_foot_joint" + BodyLandmarkKeyRightEar RecognizedPointKey = "right_ear_joint" + BodyLandmarkKeyRightElbow RecognizedPointKey = "right_forearm_joint" + BodyLandmarkKeyRightEye RecognizedPointKey = "right_eye_joint" + BodyLandmarkKeyRightHip RecognizedPointKey = "right_upLeg_joint" + BodyLandmarkKeyRightKnee RecognizedPointKey = "right_leg_joint" + BodyLandmarkKeyRightShoulder RecognizedPointKey = "right_shoulder_1_joint" + BodyLandmarkKeyRightWrist RecognizedPointKey = "right_hand_joint" + BodyLandmarkKeyRoot RecognizedPointKey = "root" +) + +// An enumeration of face landmarks in a constellation object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestfacelandmarksconstellation?language=objc +type RequestFaceLandmarksConstellation uint + +const ( + RequestFaceLandmarksConstellation65Points RequestFaceLandmarksConstellation = 1 + RequestFaceLandmarksConstellation76Points RequestFaceLandmarksConstellation = 2 + RequestFaceLandmarksConstellationNotDefined RequestFaceLandmarksConstellation = 0 +) + +// Constants that identify the performance and accuracy of the text recognition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequesttextrecognitionlevel?language=objc +type RequestTextRecognitionLevel int + +const ( + RequestTextRecognitionLevelAccurate RequestTextRecognitionLevel = 0 + RequestTextRecognitionLevelFast RequestTextRecognitionLevel = 1 +) + +// An enumeration of tracking priorities. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequesttrackinglevel?language=objc +type RequestTrackingLevel uint + +const ( + RequestTrackingLevelAccurate RequestTrackingLevel = 0 + RequestTrackingLevelFast RequestTrackingLevel = 1 +) + +// Options to pass to the video processor when adding requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessingoption?language=objc +type VideoProcessingOption string + +const ( + VideoProcessingOptionFrameCadence VideoProcessingOption = "VNVideoProcessingOptionFrameCadence" + VideoProcessingOptionTimeInterval VideoProcessingOption = "VNVideoProcessingOptionTimeInterval" +) diff --git a/macos/vision/face_landmark_region.gen.go b/macos/vision/face_landmark_region.gen.go new file mode 100644 index 00000000..58e19f6d --- /dev/null +++ b/macos/vision/face_landmark_region.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FaceLandmarkRegion] class. +var FaceLandmarkRegionClass = _FaceLandmarkRegionClass{objc.GetClass("VNFaceLandmarkRegion")} + +type _FaceLandmarkRegionClass struct { + objc.Class +} + +// An interface definition for the [FaceLandmarkRegion] class. +type IFaceLandmarkRegion interface { + objc.IObject + PointCount() uint +} + +// The abstract superclass for information about a specific face landmark. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarkregion?language=objc +type FaceLandmarkRegion struct { + objc.Object +} + +func FaceLandmarkRegionFrom(ptr unsafe.Pointer) FaceLandmarkRegion { + return FaceLandmarkRegion{ + Object: objc.ObjectFrom(ptr), + } +} + +func (fc _FaceLandmarkRegionClass) Alloc() FaceLandmarkRegion { + rv := objc.Call[FaceLandmarkRegion](fc, objc.Sel("alloc")) + return rv +} + +func FaceLandmarkRegion_Alloc() FaceLandmarkRegion { + return FaceLandmarkRegionClass.Alloc() +} + +func (fc _FaceLandmarkRegionClass) New() FaceLandmarkRegion { + rv := objc.Call[FaceLandmarkRegion](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFaceLandmarkRegion() FaceLandmarkRegion { + return FaceLandmarkRegionClass.New() +} + +func (f_ FaceLandmarkRegion) Init() FaceLandmarkRegion { + rv := objc.Call[FaceLandmarkRegion](f_, objc.Sel("init")) + return rv +} + +// The number of points in the face region. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarkregion/2909053-pointcount?language=objc +func (f_ FaceLandmarkRegion) PointCount() uint { + rv := objc.Call[uint](f_, objc.Sel("pointCount")) + return rv +} diff --git a/macos/vision/face_landmark_region2_d.gen.go b/macos/vision/face_landmark_region2_d.gen.go new file mode 100644 index 00000000..b8e037de --- /dev/null +++ b/macos/vision/face_landmark_region2_d.gen.go @@ -0,0 +1,87 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FaceLandmarkRegion2D] class. +var FaceLandmarkRegion2DClass = _FaceLandmarkRegion2DClass{objc.GetClass("VNFaceLandmarkRegion2D")} + +type _FaceLandmarkRegion2DClass struct { + objc.Class +} + +// An interface definition for the [FaceLandmarkRegion2D] class. +type IFaceLandmarkRegion2D interface { + IFaceLandmarkRegion + PointsInImageOfSize(imageSize coregraphics.Size) *coregraphics.Point + PrecisionEstimatesPerPoint() []foundation.Number + NormalizedPoints() *coregraphics.Point +} + +// 2D geometry information for a specific facial feature. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarkregion2d?language=objc +type FaceLandmarkRegion2D struct { + FaceLandmarkRegion +} + +func FaceLandmarkRegion2DFrom(ptr unsafe.Pointer) FaceLandmarkRegion2D { + return FaceLandmarkRegion2D{ + FaceLandmarkRegion: FaceLandmarkRegionFrom(ptr), + } +} + +func (fc _FaceLandmarkRegion2DClass) Alloc() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](fc, objc.Sel("alloc")) + return rv +} + +func FaceLandmarkRegion2D_Alloc() FaceLandmarkRegion2D { + return FaceLandmarkRegion2DClass.Alloc() +} + +func (fc _FaceLandmarkRegion2DClass) New() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFaceLandmarkRegion2D() FaceLandmarkRegion2D { + return FaceLandmarkRegion2DClass.New() +} + +func (f_ FaceLandmarkRegion2D) Init() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("init")) + return rv +} + +// A buffer in memory containing landmark points in the coordinate space of the specified image size. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarkregion2d/2923491-pointsinimageofsize?language=objc +func (f_ FaceLandmarkRegion2D) PointsInImageOfSize(imageSize coregraphics.Size) *coregraphics.Point { + rv := objc.Call[*coregraphics.Point](f_, objc.Sel("pointsInImageOfSize:"), imageSize) + return rv +} + +// An array of precision estimates for each landmark point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarkregion2d/3143672-precisionestimatesperpoint?language=objc +func (f_ FaceLandmarkRegion2D) PrecisionEstimatesPerPoint() []foundation.Number { + rv := objc.Call[[]foundation.Number](f_, objc.Sel("precisionEstimatesPerPoint")) + return rv +} + +// A buffer in memory containing normalized landmark points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarkregion2d/2923490-normalizedpoints?language=objc +func (f_ FaceLandmarkRegion2D) NormalizedPoints() *coregraphics.Point { + rv := objc.Call[*coregraphics.Point](f_, objc.Sel("normalizedPoints")) + return rv +} diff --git a/macos/vision/face_landmarks.gen.go b/macos/vision/face_landmarks.gen.go new file mode 100644 index 00000000..3f946dcc --- /dev/null +++ b/macos/vision/face_landmarks.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FaceLandmarks] class. +var FaceLandmarksClass = _FaceLandmarksClass{objc.GetClass("VNFaceLandmarks")} + +type _FaceLandmarksClass struct { + objc.Class +} + +// An interface definition for the [FaceLandmarks] class. +type IFaceLandmarks interface { + objc.IObject + Confidence() Confidence +} + +// The abstract superclass for containers of face landmark information. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks?language=objc +type FaceLandmarks struct { + objc.Object +} + +func FaceLandmarksFrom(ptr unsafe.Pointer) FaceLandmarks { + return FaceLandmarks{ + Object: objc.ObjectFrom(ptr), + } +} + +func (fc _FaceLandmarksClass) Alloc() FaceLandmarks { + rv := objc.Call[FaceLandmarks](fc, objc.Sel("alloc")) + return rv +} + +func FaceLandmarks_Alloc() FaceLandmarks { + return FaceLandmarksClass.Alloc() +} + +func (fc _FaceLandmarksClass) New() FaceLandmarks { + rv := objc.Call[FaceLandmarks](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFaceLandmarks() FaceLandmarks { + return FaceLandmarksClass.New() +} + +func (f_ FaceLandmarks) Init() FaceLandmarks { + rv := objc.Call[FaceLandmarks](f_, objc.Sel("init")) + return rv +} + +// A confidence estimate for the detected landmarks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks/2909054-confidence?language=objc +func (f_ FaceLandmarks) Confidence() Confidence { + rv := objc.Call[Confidence](f_, objc.Sel("confidence")) + return rv +} diff --git a/macos/vision/face_landmarks2_d.gen.go b/macos/vision/face_landmarks2_d.gen.go new file mode 100644 index 00000000..ca279a99 --- /dev/null +++ b/macos/vision/face_landmarks2_d.gen.go @@ -0,0 +1,175 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FaceLandmarks2D] class. +var FaceLandmarks2DClass = _FaceLandmarks2DClass{objc.GetClass("VNFaceLandmarks2D")} + +type _FaceLandmarks2DClass struct { + objc.Class +} + +// An interface definition for the [FaceLandmarks2D] class. +type IFaceLandmarks2D interface { + IFaceLandmarks + RightPupil() FaceLandmarkRegion2D + Nose() FaceLandmarkRegion2D + InnerLips() FaceLandmarkRegion2D + LeftPupil() FaceLandmarkRegion2D + OuterLips() FaceLandmarkRegion2D + MedianLine() FaceLandmarkRegion2D + NoseCrest() FaceLandmarkRegion2D + RightEyebrow() FaceLandmarkRegion2D + FaceContour() FaceLandmarkRegion2D + AllPoints() FaceLandmarkRegion2D + LeftEyebrow() FaceLandmarkRegion2D + LeftEye() FaceLandmarkRegion2D + RightEye() FaceLandmarkRegion2D +} + +// A collection of facial features that a request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d?language=objc +type FaceLandmarks2D struct { + FaceLandmarks +} + +func FaceLandmarks2DFrom(ptr unsafe.Pointer) FaceLandmarks2D { + return FaceLandmarks2D{ + FaceLandmarks: FaceLandmarksFrom(ptr), + } +} + +func (fc _FaceLandmarks2DClass) Alloc() FaceLandmarks2D { + rv := objc.Call[FaceLandmarks2D](fc, objc.Sel("alloc")) + return rv +} + +func FaceLandmarks2D_Alloc() FaceLandmarks2D { + return FaceLandmarks2DClass.Alloc() +} + +func (fc _FaceLandmarks2DClass) New() FaceLandmarks2D { + rv := objc.Call[FaceLandmarks2D](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFaceLandmarks2D() FaceLandmarks2D { + return FaceLandmarks2DClass.New() +} + +func (f_ FaceLandmarks2D) Init() FaceLandmarks2D { + rv := objc.Call[FaceLandmarks2D](f_, objc.Sel("init")) + return rv +} + +// The region containing the point where the right pupil is located. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879441-rightpupil?language=objc +func (f_ FaceLandmarks2D) RightPupil() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("rightPupil")) + return rv +} + +// The region containing points that outline the nose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879443-nose?language=objc +func (f_ FaceLandmarks2D) Nose() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("nose")) + return rv +} + +// The region containing points that outline the space between the lips. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879434-innerlips?language=objc +func (f_ FaceLandmarks2D) InnerLips() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("innerLips")) + return rv +} + +// The region containing the point where the left pupil is located. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879436-leftpupil?language=objc +func (f_ FaceLandmarks2D) LeftPupil() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("leftPupil")) + return rv +} + +// The region containing points that outline the outside of the lips. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879440-outerlips?language=objc +func (f_ FaceLandmarks2D) OuterLips() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("outerLips")) + return rv +} + +// The region containing points that trace a vertical line down the center of the face. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879427-medianline?language=objc +func (f_ FaceLandmarks2D) MedianLine() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("medianLine")) + return rv +} + +// The region containing points that trace the center crest of the nose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879431-nosecrest?language=objc +func (f_ FaceLandmarks2D) NoseCrest() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("noseCrest")) + return rv +} + +// The region containing points that trace the right eyebrow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879432-righteyebrow?language=objc +func (f_ FaceLandmarks2D) RightEyebrow() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("rightEyebrow")) + return rv +} + +// The region containing points that trace the face contour from the left cheek, over the chin, to the right cheek. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879437-facecontour?language=objc +func (f_ FaceLandmarks2D) FaceContour() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("faceContour")) + return rv +} + +// The region containing all face landmark points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879430-allpoints?language=objc +func (f_ FaceLandmarks2D) AllPoints() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("allPoints")) + return rv +} + +// The region containing points that trace the left eyebrow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879438-lefteyebrow?language=objc +func (f_ FaceLandmarks2D) LeftEyebrow() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("leftEyebrow")) + return rv +} + +// The region containing points that outline the left eye. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879426-lefteye?language=objc +func (f_ FaceLandmarks2D) LeftEye() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("leftEye")) + return rv +} + +// The region containing points that outline the right eye. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfacelandmarks2d/2879442-righteye?language=objc +func (f_ FaceLandmarks2D) RightEye() FaceLandmarkRegion2D { + rv := objc.Call[FaceLandmarkRegion2D](f_, objc.Sel("rightEye")) + return rv +} diff --git a/macos/vision/face_observation.gen.go b/macos/vision/face_observation.gen.go new file mode 100644 index 00000000..59df8091 --- /dev/null +++ b/macos/vision/face_observation.gen.go @@ -0,0 +1,141 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FaceObservation] class. +var FaceObservationClass = _FaceObservationClass{objc.GetClass("VNFaceObservation")} + +type _FaceObservationClass struct { + objc.Class +} + +// An interface definition for the [FaceObservation] class. +type IFaceObservation interface { + IDetectedObjectObservation + Roll() foundation.Number + Yaw() foundation.Number + FaceCaptureQuality() foundation.Number + Pitch() foundation.Number + Landmarks() FaceLandmarks2D +} + +// Face or facial-feature information that an image analysis request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservation?language=objc +type FaceObservation struct { + DetectedObjectObservation +} + +func FaceObservationFrom(ptr unsafe.Pointer) FaceObservation { + return FaceObservation{ + DetectedObjectObservation: DetectedObjectObservationFrom(ptr), + } +} + +func (fc _FaceObservationClass) FaceObservationWithRequestRevisionBoundingBoxRollYawPitch(requestRevision uint, boundingBox coregraphics.Rect, roll foundation.INumber, yaw foundation.INumber, pitch foundation.INumber) FaceObservation { + rv := objc.Call[FaceObservation](fc, objc.Sel("faceObservationWithRequestRevision:boundingBox:roll:yaw:pitch:"), requestRevision, boundingBox, objc.Ptr(roll), objc.Ptr(yaw), objc.Ptr(pitch)) + return rv +} + +// Creates an observation that contains the roll, yaw, and pitch of the face. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservation/3763078-faceobservationwithrequestrevisi?language=objc +func FaceObservation_FaceObservationWithRequestRevisionBoundingBoxRollYawPitch(requestRevision uint, boundingBox coregraphics.Rect, roll foundation.INumber, yaw foundation.INumber, pitch foundation.INumber) FaceObservation { + return FaceObservationClass.FaceObservationWithRequestRevisionBoundingBoxRollYawPitch(requestRevision, boundingBox, roll, yaw, pitch) +} + +func (fc _FaceObservationClass) Alloc() FaceObservation { + rv := objc.Call[FaceObservation](fc, objc.Sel("alloc")) + return rv +} + +func FaceObservation_Alloc() FaceObservation { + return FaceObservationClass.Alloc() +} + +func (fc _FaceObservationClass) New() FaceObservation { + rv := objc.Call[FaceObservation](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFaceObservation() FaceObservation { + return FaceObservationClass.New() +} + +func (f_ FaceObservation) Init() FaceObservation { + rv := objc.Call[FaceObservation](f_, objc.Sel("init")) + return rv +} + +func (fc _FaceObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) FaceObservation { + rv := objc.Call[FaceObservation](fc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func FaceObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) FaceObservation { + return FaceObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (fc _FaceObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) FaceObservation { + rv := objc.Call[FaceObservation](fc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func FaceObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) FaceObservation { + return FaceObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +// The roll angle of a face in radians. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservation/2980939-roll?language=objc +func (f_ FaceObservation) Roll() foundation.Number { + rv := objc.Call[foundation.Number](f_, objc.Sel("roll")) + return rv +} + +// The yaw angle of a face in radians. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservation/2980940-yaw?language=objc +func (f_ FaceObservation) Yaw() foundation.Number { + rv := objc.Call[foundation.Number](f_, objc.Sel("yaw")) + return rv +} + +// A value that indicates the quality of the face capture. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservation/3152627-facecapturequality?language=objc +func (f_ FaceObservation) FaceCaptureQuality() foundation.Number { + rv := objc.Call[foundation.Number](f_, objc.Sel("faceCaptureQuality")) + return rv +} + +// The pitch angle of a face in radians. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservation/3750998-pitch?language=objc +func (f_ FaceObservation) Pitch() foundation.Number { + rv := objc.Call[foundation.Number](f_, objc.Sel("pitch")) + return rv +} + +// The facial features of the detected face. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservation/2867250-landmarks?language=objc +func (f_ FaceObservation) Landmarks() FaceLandmarks2D { + rv := objc.Call[FaceLandmarks2D](f_, objc.Sel("landmarks")) + return rv +} diff --git a/macos/vision/face_observation_accepting.gen.go b/macos/vision/face_observation_accepting.gen.go new file mode 100644 index 00000000..59dfbb76 --- /dev/null +++ b/macos/vision/face_observation_accepting.gen.go @@ -0,0 +1,48 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "github.com/progrium/macdriver/objc" +) + +// An image analysis request that operates on face observations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservationaccepting?language=objc +type PFaceObservationAccepting interface { + // optional + SetInputFaceObservations(value []FaceObservation) + HasSetInputFaceObservations() bool + + // optional + InputFaceObservations() []IFaceObservation + HasInputFaceObservations() bool +} + +// A concrete type wrapper for the [PFaceObservationAccepting] protocol. +type FaceObservationAcceptingWrapper struct { + objc.Object +} + +func (f_ FaceObservationAcceptingWrapper) HasSetInputFaceObservations() bool { + return f_.RespondsToSelector(objc.Sel("setInputFaceObservations:")) +} + +// An array of VNFaceObservation objects to process as part of the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservationaccepting/2877424-inputfaceobservations?language=objc +func (f_ FaceObservationAcceptingWrapper) SetInputFaceObservations(value []IFaceObservation) { + objc.Call[objc.Void](f_, objc.Sel("setInputFaceObservations:"), value) +} + +func (f_ FaceObservationAcceptingWrapper) HasInputFaceObservations() bool { + return f_.RespondsToSelector(objc.Sel("inputFaceObservations")) +} + +// An array of VNFaceObservation objects to process as part of the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfaceobservationaccepting/2877424-inputfaceobservations?language=objc +func (f_ FaceObservationAcceptingWrapper) InputFaceObservations() []FaceObservation { + rv := objc.Call[[]FaceObservation](f_, objc.Sel("inputFaceObservations")) + return rv +} diff --git a/macos/vision/feature_print_observation.gen.go b/macos/vision/feature_print_observation.gen.go new file mode 100644 index 00000000..caec9ee0 --- /dev/null +++ b/macos/vision/feature_print_observation.gen.go @@ -0,0 +1,95 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [FeaturePrintObservation] class. +var FeaturePrintObservationClass = _FeaturePrintObservationClass{objc.GetClass("VNFeaturePrintObservation")} + +type _FeaturePrintObservationClass struct { + objc.Class +} + +// An interface definition for the [FeaturePrintObservation] class. +type IFeaturePrintObservation interface { + IObservation + ComputeDistanceToFeaturePrintObservationError(outDistance *float64, featurePrint IFeaturePrintObservation, error foundation.IError) bool + Data() []byte + ElementType() ElementType + ElementCount() uint +} + +// An observation that provides the recognized feature print. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfeatureprintobservation?language=objc +type FeaturePrintObservation struct { + Observation +} + +func FeaturePrintObservationFrom(ptr unsafe.Pointer) FeaturePrintObservation { + return FeaturePrintObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (fc _FeaturePrintObservationClass) Alloc() FeaturePrintObservation { + rv := objc.Call[FeaturePrintObservation](fc, objc.Sel("alloc")) + return rv +} + +func FeaturePrintObservation_Alloc() FeaturePrintObservation { + return FeaturePrintObservationClass.Alloc() +} + +func (fc _FeaturePrintObservationClass) New() FeaturePrintObservation { + rv := objc.Call[FeaturePrintObservation](fc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewFeaturePrintObservation() FeaturePrintObservation { + return FeaturePrintObservationClass.New() +} + +func (f_ FeaturePrintObservation) Init() FeaturePrintObservation { + rv := objc.Call[FeaturePrintObservation](f_, objc.Sel("init")) + return rv +} + +// Computes the distance between two feature print observations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfeatureprintobservation/3182823-computedistance?language=objc +func (f_ FeaturePrintObservation) ComputeDistanceToFeaturePrintObservationError(outDistance *float64, featurePrint IFeaturePrintObservation, error foundation.IError) bool { + rv := objc.Call[bool](f_, objc.Sel("computeDistance:toFeaturePrintObservation:error:"), outDistance, objc.Ptr(featurePrint), objc.Ptr(error)) + return rv +} + +// The feature print data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfeatureprintobservation/3152630-data?language=objc +func (f_ FeaturePrintObservation) Data() []byte { + rv := objc.Call[[]byte](f_, objc.Sel("data")) + return rv +} + +// The type of each element in the data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfeatureprintobservation/3152632-elementtype?language=objc +func (f_ FeaturePrintObservation) ElementType() ElementType { + rv := objc.Call[ElementType](f_, objc.Sel("elementType")) + return rv +} + +// The total number of elements in the data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnfeatureprintobservation/3152631-elementcount?language=objc +func (f_ FeaturePrintObservation) ElementCount() uint { + rv := objc.Call[uint](f_, objc.Sel("elementCount")) + return rv +} diff --git a/macos/vision/generate_attention_based_saliency_image_request.gen.go b/macos/vision/generate_attention_based_saliency_image_request.gen.go new file mode 100644 index 00000000..fa628af2 --- /dev/null +++ b/macos/vision/generate_attention_based_saliency_image_request.gen.go @@ -0,0 +1,72 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [GenerateAttentionBasedSaliencyImageRequest] class. +var GenerateAttentionBasedSaliencyImageRequestClass = _GenerateAttentionBasedSaliencyImageRequestClass{objc.GetClass("VNGenerateAttentionBasedSaliencyImageRequest")} + +type _GenerateAttentionBasedSaliencyImageRequestClass struct { + objc.Class +} + +// An interface definition for the [GenerateAttentionBasedSaliencyImageRequest] class. +type IGenerateAttentionBasedSaliencyImageRequest interface { + IImageBasedRequest +} + +// An object that produces a heat map that identifies the parts of an image most likely to draw attention. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateattentionbasedsaliencyimagerequest?language=objc +type GenerateAttentionBasedSaliencyImageRequest struct { + ImageBasedRequest +} + +func GenerateAttentionBasedSaliencyImageRequestFrom(ptr unsafe.Pointer) GenerateAttentionBasedSaliencyImageRequest { + return GenerateAttentionBasedSaliencyImageRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (gc _GenerateAttentionBasedSaliencyImageRequestClass) Alloc() GenerateAttentionBasedSaliencyImageRequest { + rv := objc.Call[GenerateAttentionBasedSaliencyImageRequest](gc, objc.Sel("alloc")) + return rv +} + +func GenerateAttentionBasedSaliencyImageRequest_Alloc() GenerateAttentionBasedSaliencyImageRequest { + return GenerateAttentionBasedSaliencyImageRequestClass.Alloc() +} + +func (gc _GenerateAttentionBasedSaliencyImageRequestClass) New() GenerateAttentionBasedSaliencyImageRequest { + rv := objc.Call[GenerateAttentionBasedSaliencyImageRequest](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGenerateAttentionBasedSaliencyImageRequest() GenerateAttentionBasedSaliencyImageRequest { + return GenerateAttentionBasedSaliencyImageRequestClass.New() +} + +func (g_ GenerateAttentionBasedSaliencyImageRequest) Init() GenerateAttentionBasedSaliencyImageRequest { + rv := objc.Call[GenerateAttentionBasedSaliencyImageRequest](g_, objc.Sel("init")) + return rv +} + +func (g_ GenerateAttentionBasedSaliencyImageRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateAttentionBasedSaliencyImageRequest { + rv := objc.Call[GenerateAttentionBasedSaliencyImageRequest](g_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewGenerateAttentionBasedSaliencyImageRequestWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateAttentionBasedSaliencyImageRequest { + instance := GenerateAttentionBasedSaliencyImageRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/generate_image_feature_print_request.gen.go b/macos/vision/generate_image_feature_print_request.gen.go new file mode 100644 index 00000000..63f6a07e --- /dev/null +++ b/macos/vision/generate_image_feature_print_request.gen.go @@ -0,0 +1,89 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [GenerateImageFeaturePrintRequest] class. +var GenerateImageFeaturePrintRequestClass = _GenerateImageFeaturePrintRequestClass{objc.GetClass("VNGenerateImageFeaturePrintRequest")} + +type _GenerateImageFeaturePrintRequestClass struct { + objc.Class +} + +// An interface definition for the [GenerateImageFeaturePrintRequest] class. +type IGenerateImageFeaturePrintRequest interface { + IImageBasedRequest + ImageCropAndScaleOption() ImageCropAndScaleOption + SetImageCropAndScaleOption(value ImageCropAndScaleOption) +} + +// An image-based request to generate feature prints from an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateimagefeatureprintrequest?language=objc +type GenerateImageFeaturePrintRequest struct { + ImageBasedRequest +} + +func GenerateImageFeaturePrintRequestFrom(ptr unsafe.Pointer) GenerateImageFeaturePrintRequest { + return GenerateImageFeaturePrintRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (gc _GenerateImageFeaturePrintRequestClass) Alloc() GenerateImageFeaturePrintRequest { + rv := objc.Call[GenerateImageFeaturePrintRequest](gc, objc.Sel("alloc")) + return rv +} + +func GenerateImageFeaturePrintRequest_Alloc() GenerateImageFeaturePrintRequest { + return GenerateImageFeaturePrintRequestClass.Alloc() +} + +func (gc _GenerateImageFeaturePrintRequestClass) New() GenerateImageFeaturePrintRequest { + rv := objc.Call[GenerateImageFeaturePrintRequest](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGenerateImageFeaturePrintRequest() GenerateImageFeaturePrintRequest { + return GenerateImageFeaturePrintRequestClass.New() +} + +func (g_ GenerateImageFeaturePrintRequest) Init() GenerateImageFeaturePrintRequest { + rv := objc.Call[GenerateImageFeaturePrintRequest](g_, objc.Sel("init")) + return rv +} + +func (g_ GenerateImageFeaturePrintRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateImageFeaturePrintRequest { + rv := objc.Call[GenerateImageFeaturePrintRequest](g_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewGenerateImageFeaturePrintRequestWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateImageFeaturePrintRequest { + instance := GenerateImageFeaturePrintRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// An optional setting that tells the algorithm how to scale an input image before generating the feature print. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateimagefeatureprintrequest/3152620-imagecropandscaleoption?language=objc +func (g_ GenerateImageFeaturePrintRequest) ImageCropAndScaleOption() ImageCropAndScaleOption { + rv := objc.Call[ImageCropAndScaleOption](g_, objc.Sel("imageCropAndScaleOption")) + return rv +} + +// An optional setting that tells the algorithm how to scale an input image before generating the feature print. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateimagefeatureprintrequest/3152620-imagecropandscaleoption?language=objc +func (g_ GenerateImageFeaturePrintRequest) SetImageCropAndScaleOption(value ImageCropAndScaleOption) { + objc.Call[objc.Void](g_, objc.Sel("setImageCropAndScaleOption:"), value) +} diff --git a/macos/vision/generate_objectness_based_saliency_image_request.gen.go b/macos/vision/generate_objectness_based_saliency_image_request.gen.go new file mode 100644 index 00000000..70953d01 --- /dev/null +++ b/macos/vision/generate_objectness_based_saliency_image_request.gen.go @@ -0,0 +1,72 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [GenerateObjectnessBasedSaliencyImageRequest] class. +var GenerateObjectnessBasedSaliencyImageRequestClass = _GenerateObjectnessBasedSaliencyImageRequestClass{objc.GetClass("VNGenerateObjectnessBasedSaliencyImageRequest")} + +type _GenerateObjectnessBasedSaliencyImageRequestClass struct { + objc.Class +} + +// An interface definition for the [GenerateObjectnessBasedSaliencyImageRequest] class. +type IGenerateObjectnessBasedSaliencyImageRequest interface { + IImageBasedRequest +} + +// A request that generates a heat map that identifies the parts of an image most likely to represent objects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateobjectnessbasedsaliencyimagerequest?language=objc +type GenerateObjectnessBasedSaliencyImageRequest struct { + ImageBasedRequest +} + +func GenerateObjectnessBasedSaliencyImageRequestFrom(ptr unsafe.Pointer) GenerateObjectnessBasedSaliencyImageRequest { + return GenerateObjectnessBasedSaliencyImageRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (gc _GenerateObjectnessBasedSaliencyImageRequestClass) Alloc() GenerateObjectnessBasedSaliencyImageRequest { + rv := objc.Call[GenerateObjectnessBasedSaliencyImageRequest](gc, objc.Sel("alloc")) + return rv +} + +func GenerateObjectnessBasedSaliencyImageRequest_Alloc() GenerateObjectnessBasedSaliencyImageRequest { + return GenerateObjectnessBasedSaliencyImageRequestClass.Alloc() +} + +func (gc _GenerateObjectnessBasedSaliencyImageRequestClass) New() GenerateObjectnessBasedSaliencyImageRequest { + rv := objc.Call[GenerateObjectnessBasedSaliencyImageRequest](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGenerateObjectnessBasedSaliencyImageRequest() GenerateObjectnessBasedSaliencyImageRequest { + return GenerateObjectnessBasedSaliencyImageRequestClass.New() +} + +func (g_ GenerateObjectnessBasedSaliencyImageRequest) Init() GenerateObjectnessBasedSaliencyImageRequest { + rv := objc.Call[GenerateObjectnessBasedSaliencyImageRequest](g_, objc.Sel("init")) + return rv +} + +func (g_ GenerateObjectnessBasedSaliencyImageRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateObjectnessBasedSaliencyImageRequest { + rv := objc.Call[GenerateObjectnessBasedSaliencyImageRequest](g_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewGenerateObjectnessBasedSaliencyImageRequestWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateObjectnessBasedSaliencyImageRequest { + instance := GenerateObjectnessBasedSaliencyImageRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/generate_optical_flow_request.gen.go b/macos/vision/generate_optical_flow_request.gen.go new file mode 100644 index 00000000..475cf792 --- /dev/null +++ b/macos/vision/generate_optical_flow_request.gen.go @@ -0,0 +1,195 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [GenerateOpticalFlowRequest] class. +var GenerateOpticalFlowRequestClass = _GenerateOpticalFlowRequestClass{objc.GetClass("VNGenerateOpticalFlowRequest")} + +type _GenerateOpticalFlowRequestClass struct { + objc.Class +} + +// An interface definition for the [GenerateOpticalFlowRequest] class. +type IGenerateOpticalFlowRequest interface { + ITargetedImageRequest + ComputationAccuracy() GenerateOpticalFlowRequestComputationAccuracy + SetComputationAccuracy(value GenerateOpticalFlowRequestComputationAccuracy) + OutputPixelFormat() uint + SetOutputPixelFormat(value uint) +} + +// An object that generates directional change vectors for each pixel in the targeted image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequest?language=objc +type GenerateOpticalFlowRequest struct { + TargetedImageRequest +} + +func GenerateOpticalFlowRequestFrom(ptr unsafe.Pointer) GenerateOpticalFlowRequest { + return GenerateOpticalFlowRequest{ + TargetedImageRequest: TargetedImageRequestFrom(ptr), + } +} + +func (gc _GenerateOpticalFlowRequestClass) Alloc() GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](gc, objc.Sel("alloc")) + return rv +} + +func GenerateOpticalFlowRequest_Alloc() GenerateOpticalFlowRequest { + return GenerateOpticalFlowRequestClass.Alloc() +} + +func (gc _GenerateOpticalFlowRequestClass) New() GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGenerateOpticalFlowRequest() GenerateOpticalFlowRequest { + return GenerateOpticalFlowRequestClass.New() +} + +func (g_ GenerateOpticalFlowRequest) Init() GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("init")) + return rv +} + +func (g_ GenerateOpticalFlowRequest) InitWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("initWithTargetedImageURL:options:"), objc.Ptr(imageURL), options) + return rv +} + +// Creates a new request targeting an image at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923458-initwithtargetedimageurl?language=objc +func NewGenerateOpticalFlowRequestWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + instance := GenerateOpticalFlowRequestClass.Alloc().InitWithTargetedImageURLOptions(imageURL, options) + instance.Autorelease() + return instance +} + +func (g_ GenerateOpticalFlowRequest) InitWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("initWithTargetedCMSampleBuffer:options:"), sampleBuffer, options) + return rv +} + +// Creates a new request that targets an image in a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/3571274-initwithtargetedcmsamplebuffer?language=objc +func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + instance := GenerateOpticalFlowRequestClass.Alloc().InitWithTargetedCMSampleBufferOptions(sampleBuffer, options) + instance.Autorelease() + return instance +} + +func (g_ GenerateOpticalFlowRequest) InitWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("initWithTargetedCIImage:options:"), objc.Ptr(ciImage), options) + return rv +} + +// Creates a new request targeting a CIImage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923447-initwithtargetedciimage?language=objc +func NewGenerateOpticalFlowRequestWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + instance := GenerateOpticalFlowRequestClass.Alloc().InitWithTargetedCIImageOptions(ciImage, options) + instance.Autorelease() + return instance +} + +func (g_ GenerateOpticalFlowRequest) InitWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("initWithTargetedCVPixelBuffer:options:"), pixelBuffer, options) + return rv +} + +// Creates a new request targeting an image in a CVPixelBufferRef. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923445-initwithtargetedcvpixelbuffer?language=objc +func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + instance := GenerateOpticalFlowRequestClass.Alloc().InitWithTargetedCVPixelBufferOptions(pixelBuffer, options) + instance.Autorelease() + return instance +} + +func (g_ GenerateOpticalFlowRequest) InitWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("initWithTargetedCGImage:options:"), cgImage, options) + return rv +} + +// Creates a new request targeting a Core Graphics image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923452-initwithtargetedcgimage?language=objc +func NewGenerateOpticalFlowRequestWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + instance := GenerateOpticalFlowRequestClass.Alloc().InitWithTargetedCGImageOptions(cgImage, options) + instance.Autorelease() + return instance +} + +func (g_ GenerateOpticalFlowRequest) InitWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("initWithTargetedImageData:options:"), imageData, options) + return rv +} + +// Creates a new request targeting an image as raw data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923460-initwithtargetedimagedata?language=objc +func NewGenerateOpticalFlowRequestWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) GenerateOpticalFlowRequest { + instance := GenerateOpticalFlowRequestClass.Alloc().InitWithTargetedImageDataOptions(imageData, options) + instance.Autorelease() + return instance +} + +func (g_ GenerateOpticalFlowRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateOpticalFlowRequest { + rv := objc.Call[GenerateOpticalFlowRequest](g_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewGenerateOpticalFlowRequestWithCompletionHandler(completionHandler RequestCompletionHandler) GenerateOpticalFlowRequest { + instance := GenerateOpticalFlowRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// The accuracy level for computing optical flow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequest/3672181-computationaccuracy?language=objc +func (g_ GenerateOpticalFlowRequest) ComputationAccuracy() GenerateOpticalFlowRequestComputationAccuracy { + rv := objc.Call[GenerateOpticalFlowRequestComputationAccuracy](g_, objc.Sel("computationAccuracy")) + return rv +} + +// The accuracy level for computing optical flow. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequest/3672181-computationaccuracy?language=objc +func (g_ GenerateOpticalFlowRequest) SetComputationAccuracy(value GenerateOpticalFlowRequestComputationAccuracy) { + objc.Call[objc.Void](g_, objc.Sel("setComputationAccuracy:"), value) +} + +// The output buffer’s pixel format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequest/3548304-outputpixelformat?language=objc +func (g_ GenerateOpticalFlowRequest) OutputPixelFormat() uint { + rv := objc.Call[uint](g_, objc.Sel("outputPixelFormat")) + return rv +} + +// The output buffer’s pixel format. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequest/3548304-outputpixelformat?language=objc +func (g_ GenerateOpticalFlowRequest) SetOutputPixelFormat(value uint) { + objc.Call[objc.Void](g_, objc.Sel("setOutputPixelFormat:"), value) +} diff --git a/macos/vision/generate_person_segmentation_request.gen.go b/macos/vision/generate_person_segmentation_request.gen.go new file mode 100644 index 00000000..61b27ae5 --- /dev/null +++ b/macos/vision/generate_person_segmentation_request.gen.go @@ -0,0 +1,121 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [GeneratePersonSegmentationRequest] class. +var GeneratePersonSegmentationRequestClass = _GeneratePersonSegmentationRequestClass{objc.GetClass("VNGeneratePersonSegmentationRequest")} + +type _GeneratePersonSegmentationRequestClass struct { + objc.Class +} + +// An interface definition for the [GeneratePersonSegmentationRequest] class. +type IGeneratePersonSegmentationRequest interface { + IStatefulRequest + QualityLevel() GeneratePersonSegmentationRequestQualityLevel + SetQualityLevel(value GeneratePersonSegmentationRequestQualityLevel) + OutputPixelFormat() uint + SetOutputPixelFormat(value uint) +} + +// An object that produces a matte image for a person it finds in the input image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequest?language=objc +type GeneratePersonSegmentationRequest struct { + StatefulRequest +} + +func GeneratePersonSegmentationRequestFrom(ptr unsafe.Pointer) GeneratePersonSegmentationRequest { + return GeneratePersonSegmentationRequest{ + StatefulRequest: StatefulRequestFrom(ptr), + } +} + +func (gc _GeneratePersonSegmentationRequestClass) New() GeneratePersonSegmentationRequest { + rv := objc.Call[GeneratePersonSegmentationRequest](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGeneratePersonSegmentationRequest() GeneratePersonSegmentationRequest { + return GeneratePersonSegmentationRequestClass.New() +} + +func (g_ GeneratePersonSegmentationRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) GeneratePersonSegmentationRequest { + rv := objc.Call[GeneratePersonSegmentationRequest](g_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a generate person segmentation request with a completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequest/3783572-initwithcompletionhandler?language=objc +func NewGeneratePersonSegmentationRequestWithCompletionHandler(completionHandler RequestCompletionHandler) GeneratePersonSegmentationRequest { + instance := GeneratePersonSegmentationRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +func (g_ GeneratePersonSegmentationRequest) Init() GeneratePersonSegmentationRequest { + rv := objc.Call[GeneratePersonSegmentationRequest](g_, objc.Sel("init")) + return rv +} + +func (gc _GeneratePersonSegmentationRequestClass) Alloc() GeneratePersonSegmentationRequest { + rv := objc.Call[GeneratePersonSegmentationRequest](gc, objc.Sel("alloc")) + return rv +} + +func GeneratePersonSegmentationRequest_Alloc() GeneratePersonSegmentationRequest { + return GeneratePersonSegmentationRequestClass.Alloc() +} + +func (g_ GeneratePersonSegmentationRequest) InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing coremedia.Time, completionHandler RequestCompletionHandler) GeneratePersonSegmentationRequest { + rv := objc.Call[GeneratePersonSegmentationRequest](g_, objc.Sel("initWithFrameAnalysisSpacing:completionHandler:"), frameAnalysisSpacing, completionHandler) + return rv +} + +// Initializes a video-based request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnstatefulrequest/3564828-initwithframeanalysisspacing?language=objc +func NewGeneratePersonSegmentationRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing coremedia.Time, completionHandler RequestCompletionHandler) GeneratePersonSegmentationRequest { + instance := GeneratePersonSegmentationRequestClass.Alloc().InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing, completionHandler) + instance.Autorelease() + return instance +} + +// A value that indicates how the request balances accuracy and performance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequest/3750989-qualitylevel?language=objc +func (g_ GeneratePersonSegmentationRequest) QualityLevel() GeneratePersonSegmentationRequestQualityLevel { + rv := objc.Call[GeneratePersonSegmentationRequestQualityLevel](g_, objc.Sel("qualityLevel")) + return rv +} + +// A value that indicates how the request balances accuracy and performance. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequest/3750989-qualitylevel?language=objc +func (g_ GeneratePersonSegmentationRequest) SetQualityLevel(value GeneratePersonSegmentationRequestQualityLevel) { + objc.Call[objc.Void](g_, objc.Sel("setQualityLevel:"), value) +} + +// The pixel format of the output image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequest/3750988-outputpixelformat?language=objc +func (g_ GeneratePersonSegmentationRequest) OutputPixelFormat() uint { + rv := objc.Call[uint](g_, objc.Sel("outputPixelFormat")) + return rv +} + +// The pixel format of the output image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequest/3750988-outputpixelformat?language=objc +func (g_ GeneratePersonSegmentationRequest) SetOutputPixelFormat(value uint) { + objc.Call[objc.Void](g_, objc.Sel("setOutputPixelFormat:"), value) +} diff --git a/macos/vision/geometry_utils.gen.go b/macos/vision/geometry_utils.gen.go new file mode 100644 index 00000000..cffbf098 --- /dev/null +++ b/macos/vision/geometry_utils.gen.go @@ -0,0 +1,134 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [GeometryUtils] class. +var GeometryUtilsClass = _GeometryUtilsClass{objc.GetClass("VNGeometryUtils")} + +type _GeometryUtilsClass struct { + objc.Class +} + +// An interface definition for the [GeometryUtils] class. +type IGeometryUtils interface { + objc.IObject +} + +// Utility methods to determine the geometries of various Vision types. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils?language=objc +type GeometryUtils struct { + objc.Object +} + +func GeometryUtilsFrom(ptr unsafe.Pointer) GeometryUtils { + return GeometryUtils{ + Object: objc.ObjectFrom(ptr), + } +} + +func (gc _GeometryUtilsClass) Alloc() GeometryUtils { + rv := objc.Call[GeometryUtils](gc, objc.Sel("alloc")) + return rv +} + +func GeometryUtils_Alloc() GeometryUtils { + return GeometryUtilsClass.Alloc() +} + +func (gc _GeometryUtilsClass) New() GeometryUtils { + rv := objc.Call[GeometryUtils](gc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewGeometryUtils() GeometryUtils { + return GeometryUtilsClass.New() +} + +func (g_ GeometryUtils) Init() GeometryUtils { + rv := objc.Call[GeometryUtils](g_, objc.Sel("init")) + return rv +} + +// Calculates the area for the specified contour. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548357-calculatearea?language=objc +func (gc _GeometryUtilsClass) CalculateAreaForContourOrientedAreaError(area *float64, contour IContour, orientedArea bool, error foundation.IError) bool { + rv := objc.Call[bool](gc, objc.Sel("calculateArea:forContour:orientedArea:error:"), area, objc.Ptr(contour), orientedArea, objc.Ptr(error)) + return rv +} + +// Calculates the area for the specified contour. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548357-calculatearea?language=objc +func GeometryUtils_CalculateAreaForContourOrientedAreaError(area *float64, contour IContour, orientedArea bool, error foundation.IError) bool { + return GeometryUtilsClass.CalculateAreaForContourOrientedAreaError(area, contour, orientedArea, error) +} + +// Calculates a bounding circle for the specified array of points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548355-boundingcircleforpoints?language=objc +func (gc _GeometryUtilsClass) BoundingCircleForPointsError(points []IPoint, error foundation.IError) Circle { + rv := objc.Call[Circle](gc, objc.Sel("boundingCircleForPoints:error:"), points, objc.Ptr(error)) + return rv +} + +// Calculates a bounding circle for the specified array of points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548355-boundingcircleforpoints?language=objc +func GeometryUtils_BoundingCircleForPointsError(points []IPoint, error foundation.IError) Circle { + return GeometryUtilsClass.BoundingCircleForPointsError(points, error) +} + +// Calculates a bounding circle for the specified points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548356-boundingcircleforsimdpoints?language=objc +func (gc _GeometryUtilsClass) BoundingCircleForSIMDPointsPointCountError(points objc.IObject, pointCount int, error foundation.IError) Circle { + rv := objc.Call[Circle](gc, objc.Sel("boundingCircleForSIMDPoints:pointCount:error:"), objc.Ptr(points), pointCount, objc.Ptr(error)) + return rv +} + +// Calculates a bounding circle for the specified points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548356-boundingcircleforsimdpoints?language=objc +func GeometryUtils_BoundingCircleForSIMDPointsPointCountError(points objc.IObject, pointCount int, error foundation.IError) Circle { + return GeometryUtilsClass.BoundingCircleForSIMDPointsPointCountError(points, pointCount, error) +} + +// Calculates a bounding circle for the specified contour object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548354-boundingcircleforcontour?language=objc +func (gc _GeometryUtilsClass) BoundingCircleForContourError(contour IContour, error foundation.IError) Circle { + rv := objc.Call[Circle](gc, objc.Sel("boundingCircleForContour:error:"), objc.Ptr(contour), objc.Ptr(error)) + return rv +} + +// Calculates a bounding circle for the specified contour object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548354-boundingcircleforcontour?language=objc +func GeometryUtils_BoundingCircleForContourError(contour IContour, error foundation.IError) Circle { + return GeometryUtilsClass.BoundingCircleForContourError(contour, error) +} + +// Calculates the perimeter of a closed contour. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548358-calculateperimeter?language=objc +func (gc _GeometryUtilsClass) CalculatePerimeterForContourError(perimeter *float64, contour IContour, error foundation.IError) bool { + rv := objc.Call[bool](gc, objc.Sel("calculatePerimeter:forContour:error:"), perimeter, objc.Ptr(contour), objc.Ptr(error)) + return rv +} + +// Calculates the perimeter of a closed contour. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vngeometryutils/3548358-calculateperimeter?language=objc +func GeometryUtils_CalculatePerimeterForContourError(perimeter *float64, contour IContour, error foundation.IError) bool { + return GeometryUtilsClass.CalculatePerimeterForContourError(perimeter, contour, error) +} diff --git a/macos/vision/homographic_image_registration_request.gen.go b/macos/vision/homographic_image_registration_request.gen.go new file mode 100644 index 00000000..33b11f06 --- /dev/null +++ b/macos/vision/homographic_image_registration_request.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [HomographicImageRegistrationRequest] class. +var HomographicImageRegistrationRequestClass = _HomographicImageRegistrationRequestClass{objc.GetClass("VNHomographicImageRegistrationRequest")} + +type _HomographicImageRegistrationRequestClass struct { + objc.Class +} + +// An interface definition for the [HomographicImageRegistrationRequest] class. +type IHomographicImageRegistrationRequest interface { + IImageRegistrationRequest +} + +// An image analysis request that determines the perspective warp matrix necessary to align the content of two images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhomographicimageregistrationrequest?language=objc +type HomographicImageRegistrationRequest struct { + ImageRegistrationRequest +} + +func HomographicImageRegistrationRequestFrom(ptr unsafe.Pointer) HomographicImageRegistrationRequest { + return HomographicImageRegistrationRequest{ + ImageRegistrationRequest: ImageRegistrationRequestFrom(ptr), + } +} + +func (hc _HomographicImageRegistrationRequestClass) Alloc() HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](hc, objc.Sel("alloc")) + return rv +} + +func HomographicImageRegistrationRequest_Alloc() HomographicImageRegistrationRequest { + return HomographicImageRegistrationRequestClass.Alloc() +} + +func (hc _HomographicImageRegistrationRequestClass) New() HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](hc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewHomographicImageRegistrationRequest() HomographicImageRegistrationRequest { + return HomographicImageRegistrationRequestClass.New() +} + +func (h_ HomographicImageRegistrationRequest) Init() HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("init")) + return rv +} + +func (h_ HomographicImageRegistrationRequest) InitWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("initWithTargetedImageURL:options:"), objc.Ptr(imageURL), options) + return rv +} + +// Creates a new request targeting an image at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923458-initwithtargetedimageurl?language=objc +func NewHomographicImageRegistrationRequestWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + instance := HomographicImageRegistrationRequestClass.Alloc().InitWithTargetedImageURLOptions(imageURL, options) + instance.Autorelease() + return instance +} + +func (h_ HomographicImageRegistrationRequest) InitWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("initWithTargetedCMSampleBuffer:options:"), sampleBuffer, options) + return rv +} + +// Creates a new request that targets an image in a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/3571274-initwithtargetedcmsamplebuffer?language=objc +func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + instance := HomographicImageRegistrationRequestClass.Alloc().InitWithTargetedCMSampleBufferOptions(sampleBuffer, options) + instance.Autorelease() + return instance +} + +func (h_ HomographicImageRegistrationRequest) InitWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("initWithTargetedCIImage:options:"), objc.Ptr(ciImage), options) + return rv +} + +// Creates a new request targeting a CIImage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923447-initwithtargetedciimage?language=objc +func NewHomographicImageRegistrationRequestWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + instance := HomographicImageRegistrationRequestClass.Alloc().InitWithTargetedCIImageOptions(ciImage, options) + instance.Autorelease() + return instance +} + +func (h_ HomographicImageRegistrationRequest) InitWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("initWithTargetedCVPixelBuffer:options:"), pixelBuffer, options) + return rv +} + +// Creates a new request targeting an image in a CVPixelBufferRef. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923445-initwithtargetedcvpixelbuffer?language=objc +func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + instance := HomographicImageRegistrationRequestClass.Alloc().InitWithTargetedCVPixelBufferOptions(pixelBuffer, options) + instance.Autorelease() + return instance +} + +func (h_ HomographicImageRegistrationRequest) InitWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("initWithTargetedCGImage:options:"), cgImage, options) + return rv +} + +// Creates a new request targeting a Core Graphics image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923452-initwithtargetedcgimage?language=objc +func NewHomographicImageRegistrationRequestWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + instance := HomographicImageRegistrationRequestClass.Alloc().InitWithTargetedCGImageOptions(cgImage, options) + instance.Autorelease() + return instance +} + +func (h_ HomographicImageRegistrationRequest) InitWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("initWithTargetedImageData:options:"), imageData, options) + return rv +} + +// Creates a new request targeting an image as raw data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923460-initwithtargetedimagedata?language=objc +func NewHomographicImageRegistrationRequestWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) HomographicImageRegistrationRequest { + instance := HomographicImageRegistrationRequestClass.Alloc().InitWithTargetedImageDataOptions(imageData, options) + instance.Autorelease() + return instance +} + +func (h_ HomographicImageRegistrationRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) HomographicImageRegistrationRequest { + rv := objc.Call[HomographicImageRegistrationRequest](h_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewHomographicImageRegistrationRequestWithCompletionHandler(completionHandler RequestCompletionHandler) HomographicImageRegistrationRequest { + instance := HomographicImageRegistrationRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/horizon_observation.gen.go b/macos/vision/horizon_observation.gen.go new file mode 100644 index 00000000..f6edd064 --- /dev/null +++ b/macos/vision/horizon_observation.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [HorizonObservation] class. +var HorizonObservationClass = _HorizonObservationClass{objc.GetClass("VNHorizonObservation")} + +type _HorizonObservationClass struct { + objc.Class +} + +// An interface definition for the [HorizonObservation] class. +type IHorizonObservation interface { + IObservation + Angle() float64 + Transform() coregraphics.AffineTransform +} + +// The horizon angle information that an image analysis request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhorizonobservation?language=objc +type HorizonObservation struct { + Observation +} + +func HorizonObservationFrom(ptr unsafe.Pointer) HorizonObservation { + return HorizonObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (hc _HorizonObservationClass) Alloc() HorizonObservation { + rv := objc.Call[HorizonObservation](hc, objc.Sel("alloc")) + return rv +} + +func HorizonObservation_Alloc() HorizonObservation { + return HorizonObservationClass.Alloc() +} + +func (hc _HorizonObservationClass) New() HorizonObservation { + rv := objc.Call[HorizonObservation](hc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewHorizonObservation() HorizonObservation { + return HorizonObservationClass.New() +} + +func (h_ HorizonObservation) Init() HorizonObservation { + rv := objc.Call[HorizonObservation](h_, objc.Sel("init")) + return rv +} + +// The angle of the observed horizon. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhorizonobservation/2867230-angle?language=objc +func (h_ HorizonObservation) Angle() float64 { + rv := objc.Call[float64](h_, objc.Sel("angle")) + return rv +} + +// The transform to apply to the detected horizon. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhorizonobservation/2867231-transform?language=objc +func (h_ HorizonObservation) Transform() coregraphics.AffineTransform { + rv := objc.Call[coregraphics.AffineTransform](h_, objc.Sel("transform")) + return rv +} diff --git a/macos/vision/human_body_pose_observation.gen.go b/macos/vision/human_body_pose_observation.gen.go new file mode 100644 index 00000000..9d26f816 --- /dev/null +++ b/macos/vision/human_body_pose_observation.gen.go @@ -0,0 +1,95 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [HumanBodyPoseObservation] class. +var HumanBodyPoseObservationClass = _HumanBodyPoseObservationClass{objc.GetClass("VNHumanBodyPoseObservation")} + +type _HumanBodyPoseObservationClass struct { + objc.Class +} + +// An interface definition for the [HumanBodyPoseObservation] class. +type IHumanBodyPoseObservation interface { + IRecognizedPointsObservation + RecognizedPointsForJointsGroupNameError(jointsGroupName HumanBodyPoseObservationJointsGroupName, error foundation.IError) map[HumanBodyPoseObservationJointName]RecognizedPoint + RecognizedPointForJointNameError(jointName HumanBodyPoseObservationJointName, error foundation.IError) RecognizedPoint + AvailableJointNames() []HumanBodyPoseObservationJointName + AvailableJointsGroupNames() []HumanBodyPoseObservationJointsGroupName +} + +// An observation that provides the body points the analysis recognized. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanbodyposeobservation?language=objc +type HumanBodyPoseObservation struct { + RecognizedPointsObservation +} + +func HumanBodyPoseObservationFrom(ptr unsafe.Pointer) HumanBodyPoseObservation { + return HumanBodyPoseObservation{ + RecognizedPointsObservation: RecognizedPointsObservationFrom(ptr), + } +} + +func (hc _HumanBodyPoseObservationClass) Alloc() HumanBodyPoseObservation { + rv := objc.Call[HumanBodyPoseObservation](hc, objc.Sel("alloc")) + return rv +} + +func HumanBodyPoseObservation_Alloc() HumanBodyPoseObservation { + return HumanBodyPoseObservationClass.Alloc() +} + +func (hc _HumanBodyPoseObservationClass) New() HumanBodyPoseObservation { + rv := objc.Call[HumanBodyPoseObservation](hc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewHumanBodyPoseObservation() HumanBodyPoseObservation { + return HumanBodyPoseObservationClass.New() +} + +func (h_ HumanBodyPoseObservation) Init() HumanBodyPoseObservation { + rv := objc.Call[HumanBodyPoseObservation](h_, objc.Sel("init")) + return rv +} + +// Retrieves the recognized points associated with the joint group name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanbodyposeobservation/3675604-recognizedpointsforjointsgroupna?language=objc +func (h_ HumanBodyPoseObservation) RecognizedPointsForJointsGroupNameError(jointsGroupName HumanBodyPoseObservationJointsGroupName, error foundation.IError) map[HumanBodyPoseObservationJointName]RecognizedPoint { + rv := objc.Call[map[HumanBodyPoseObservationJointName]RecognizedPoint](h_, objc.Sel("recognizedPointsForJointsGroupName:error:"), jointsGroupName, objc.Ptr(error)) + return rv +} + +// Retrieves the recognized point for a joint name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanbodyposeobservation/3675603-recognizedpointforjointname?language=objc +func (h_ HumanBodyPoseObservation) RecognizedPointForJointNameError(jointName HumanBodyPoseObservationJointName, error foundation.IError) RecognizedPoint { + rv := objc.Call[RecognizedPoint](h_, objc.Sel("recognizedPointForJointName:error:"), jointName, objc.Ptr(error)) + return rv +} + +// The names of the available joints in the observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanbodyposeobservation/3675601-availablejointnames?language=objc +func (h_ HumanBodyPoseObservation) AvailableJointNames() []HumanBodyPoseObservationJointName { + rv := objc.Call[[]HumanBodyPoseObservationJointName](h_, objc.Sel("availableJointNames")) + return rv +} + +// The available joint group names in the observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanbodyposeobservation/3675602-availablejointsgroupnames?language=objc +func (h_ HumanBodyPoseObservation) AvailableJointsGroupNames() []HumanBodyPoseObservationJointsGroupName { + rv := objc.Call[[]HumanBodyPoseObservationJointsGroupName](h_, objc.Sel("availableJointsGroupNames")) + return rv +} diff --git a/macos/vision/human_hand_pose_observation.gen.go b/macos/vision/human_hand_pose_observation.gen.go new file mode 100644 index 00000000..f05ed9a0 --- /dev/null +++ b/macos/vision/human_hand_pose_observation.gen.go @@ -0,0 +1,104 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [HumanHandPoseObservation] class. +var HumanHandPoseObservationClass = _HumanHandPoseObservationClass{objc.GetClass("VNHumanHandPoseObservation")} + +type _HumanHandPoseObservationClass struct { + objc.Class +} + +// An interface definition for the [HumanHandPoseObservation] class. +type IHumanHandPoseObservation interface { + IRecognizedPointsObservation + RecognizedPointsForJointsGroupNameError(jointsGroupName HumanHandPoseObservationJointsGroupName, error foundation.IError) map[HumanHandPoseObservationJointName]RecognizedPoint + RecognizedPointForJointNameError(jointName HumanHandPoseObservationJointName, error foundation.IError) RecognizedPoint + Chirality() Chirality + AvailableJointNames() []HumanHandPoseObservationJointName + AvailableJointsGroupNames() []HumanHandPoseObservationJointsGroupName +} + +// An observation that provides the hand points the analysis recognized. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservation?language=objc +type HumanHandPoseObservation struct { + RecognizedPointsObservation +} + +func HumanHandPoseObservationFrom(ptr unsafe.Pointer) HumanHandPoseObservation { + return HumanHandPoseObservation{ + RecognizedPointsObservation: RecognizedPointsObservationFrom(ptr), + } +} + +func (hc _HumanHandPoseObservationClass) Alloc() HumanHandPoseObservation { + rv := objc.Call[HumanHandPoseObservation](hc, objc.Sel("alloc")) + return rv +} + +func HumanHandPoseObservation_Alloc() HumanHandPoseObservation { + return HumanHandPoseObservationClass.Alloc() +} + +func (hc _HumanHandPoseObservationClass) New() HumanHandPoseObservation { + rv := objc.Call[HumanHandPoseObservation](hc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewHumanHandPoseObservation() HumanHandPoseObservation { + return HumanHandPoseObservationClass.New() +} + +func (h_ HumanHandPoseObservation) Init() HumanHandPoseObservation { + rv := objc.Call[HumanHandPoseObservation](h_, objc.Sel("init")) + return rv +} + +// Retrieves the recognized points associated with the joint group name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservation/3675640-recognizedpointsforjointsgroupna?language=objc +func (h_ HumanHandPoseObservation) RecognizedPointsForJointsGroupNameError(jointsGroupName HumanHandPoseObservationJointsGroupName, error foundation.IError) map[HumanHandPoseObservationJointName]RecognizedPoint { + rv := objc.Call[map[HumanHandPoseObservationJointName]RecognizedPoint](h_, objc.Sel("recognizedPointsForJointsGroupName:error:"), jointsGroupName, objc.Ptr(error)) + return rv +} + +// Retrieves the recognized point for a joint name. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservation/3675639-recognizedpointforjointname?language=objc +func (h_ HumanHandPoseObservation) RecognizedPointForJointNameError(jointName HumanHandPoseObservationJointName, error foundation.IError) RecognizedPoint { + rv := objc.Call[RecognizedPoint](h_, objc.Sel("recognizedPointForJointName:error:"), jointName, objc.Ptr(error)) + return rv +} + +// The chirality, or handedness, of a pose. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservation/3750971-chirality?language=objc +func (h_ HumanHandPoseObservation) Chirality() Chirality { + rv := objc.Call[Chirality](h_, objc.Sel("chirality")) + return rv +} + +// The names of the available joints in the observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservation/3675637-availablejointnames?language=objc +func (h_ HumanHandPoseObservation) AvailableJointNames() []HumanHandPoseObservationJointName { + rv := objc.Call[[]HumanHandPoseObservationJointName](h_, objc.Sel("availableJointNames")) + return rv +} + +// The joint group names available in the observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanhandposeobservation/3675638-availablejointsgroupnames?language=objc +func (h_ HumanHandPoseObservation) AvailableJointsGroupNames() []HumanHandPoseObservationJointsGroupName { + rv := objc.Call[[]HumanHandPoseObservationJointsGroupName](h_, objc.Sel("availableJointsGroupNames")) + return rv +} diff --git a/macos/vision/human_observation.gen.go b/macos/vision/human_observation.gen.go new file mode 100644 index 00000000..0f897ba2 --- /dev/null +++ b/macos/vision/human_observation.gen.go @@ -0,0 +1,92 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [HumanObservation] class. +var HumanObservationClass = _HumanObservationClass{objc.GetClass("VNHumanObservation")} + +type _HumanObservationClass struct { + objc.Class +} + +// An interface definition for the [HumanObservation] class. +type IHumanObservation interface { + IDetectedObjectObservation + UpperBodyOnly() bool +} + +// An object that represents a person that the request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanobservation?language=objc +type HumanObservation struct { + DetectedObjectObservation +} + +func HumanObservationFrom(ptr unsafe.Pointer) HumanObservation { + return HumanObservation{ + DetectedObjectObservation: DetectedObjectObservationFrom(ptr), + } +} + +func (hc _HumanObservationClass) Alloc() HumanObservation { + rv := objc.Call[HumanObservation](hc, objc.Sel("alloc")) + return rv +} + +func HumanObservation_Alloc() HumanObservation { + return HumanObservationClass.Alloc() +} + +func (hc _HumanObservationClass) New() HumanObservation { + rv := objc.Call[HumanObservation](hc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewHumanObservation() HumanObservation { + return HumanObservationClass.New() +} + +func (h_ HumanObservation) Init() HumanObservation { + rv := objc.Call[HumanObservation](h_, objc.Sel("init")) + return rv +} + +func (hc _HumanObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) HumanObservation { + rv := objc.Call[HumanObservation](hc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func HumanObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) HumanObservation { + return HumanObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (hc _HumanObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) HumanObservation { + rv := objc.Call[HumanObservation](hc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func HumanObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) HumanObservation { + return HumanObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +// A Boolean value that indicates whether the observation represents an upper-body or full-body rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnhumanobservation/3751000-upperbodyonly?language=objc +func (h_ HumanObservation) UpperBodyOnly() bool { + rv := objc.Call[bool](h_, objc.Sel("upperBodyOnly")) + return rv +} diff --git a/macos/vision/image_alignment_observation.gen.go b/macos/vision/image_alignment_observation.gen.go new file mode 100644 index 00000000..7ba1f0b8 --- /dev/null +++ b/macos/vision/image_alignment_observation.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageAlignmentObservation] class. +var ImageAlignmentObservationClass = _ImageAlignmentObservationClass{objc.GetClass("VNImageAlignmentObservation")} + +type _ImageAlignmentObservationClass struct { + objc.Class +} + +// An interface definition for the [ImageAlignmentObservation] class. +type IImageAlignmentObservation interface { + IObservation +} + +// The abstract superclass for image analysis results that describe the relative alignment of two images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagealignmentobservation?language=objc +type ImageAlignmentObservation struct { + Observation +} + +func ImageAlignmentObservationFrom(ptr unsafe.Pointer) ImageAlignmentObservation { + return ImageAlignmentObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (ic _ImageAlignmentObservationClass) Alloc() ImageAlignmentObservation { + rv := objc.Call[ImageAlignmentObservation](ic, objc.Sel("alloc")) + return rv +} + +func ImageAlignmentObservation_Alloc() ImageAlignmentObservation { + return ImageAlignmentObservationClass.Alloc() +} + +func (ic _ImageAlignmentObservationClass) New() ImageAlignmentObservation { + rv := objc.Call[ImageAlignmentObservation](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageAlignmentObservation() ImageAlignmentObservation { + return ImageAlignmentObservationClass.New() +} + +func (i_ ImageAlignmentObservation) Init() ImageAlignmentObservation { + rv := objc.Call[ImageAlignmentObservation](i_, objc.Sel("init")) + return rv +} diff --git a/macos/vision/image_based_request.gen.go b/macos/vision/image_based_request.gen.go new file mode 100644 index 00000000..a9ad6655 --- /dev/null +++ b/macos/vision/image_based_request.gen.go @@ -0,0 +1,90 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageBasedRequest] class. +var ImageBasedRequestClass = _ImageBasedRequestClass{objc.GetClass("VNImageBasedRequest")} + +type _ImageBasedRequestClass struct { + objc.Class +} + +// An interface definition for the [ImageBasedRequest] class. +type IImageBasedRequest interface { + IRequest + RegionOfInterest() coregraphics.Rect + SetRegionOfInterest(value coregraphics.Rect) +} + +// The abstract superclass for image analysis requests that focus on a specific part of an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagebasedrequest?language=objc +type ImageBasedRequest struct { + Request +} + +func ImageBasedRequestFrom(ptr unsafe.Pointer) ImageBasedRequest { + return ImageBasedRequest{ + Request: RequestFrom(ptr), + } +} + +func (ic _ImageBasedRequestClass) Alloc() ImageBasedRequest { + rv := objc.Call[ImageBasedRequest](ic, objc.Sel("alloc")) + return rv +} + +func ImageBasedRequest_Alloc() ImageBasedRequest { + return ImageBasedRequestClass.Alloc() +} + +func (ic _ImageBasedRequestClass) New() ImageBasedRequest { + rv := objc.Call[ImageBasedRequest](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageBasedRequest() ImageBasedRequest { + return ImageBasedRequestClass.New() +} + +func (i_ ImageBasedRequest) Init() ImageBasedRequest { + rv := objc.Call[ImageBasedRequest](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageBasedRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) ImageBasedRequest { + rv := objc.Call[ImageBasedRequest](i_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewImageBasedRequestWithCompletionHandler(completionHandler RequestCompletionHandler) ImageBasedRequest { + instance := ImageBasedRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// The region of the image in which Vision will perform the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagebasedrequest/2877482-regionofinterest?language=objc +func (i_ ImageBasedRequest) RegionOfInterest() coregraphics.Rect { + rv := objc.Call[coregraphics.Rect](i_, objc.Sel("regionOfInterest")) + return rv +} + +// The region of the image in which Vision will perform the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagebasedrequest/2877482-regionofinterest?language=objc +func (i_ ImageBasedRequest) SetRegionOfInterest(value coregraphics.Rect) { + objc.Call[objc.Void](i_, objc.Sel("setRegionOfInterest:"), value) +} diff --git a/macos/vision/image_homographic_alignment_observation.gen.go b/macos/vision/image_homographic_alignment_observation.gen.go new file mode 100644 index 00000000..a3561e2e --- /dev/null +++ b/macos/vision/image_homographic_alignment_observation.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/kernel" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageHomographicAlignmentObservation] class. +var ImageHomographicAlignmentObservationClass = _ImageHomographicAlignmentObservationClass{objc.GetClass("VNImageHomographicAlignmentObservation")} + +type _ImageHomographicAlignmentObservationClass struct { + objc.Class +} + +// An interface definition for the [ImageHomographicAlignmentObservation] class. +type IImageHomographicAlignmentObservation interface { + IImageAlignmentObservation + WarpTransform() kernel.Matrix_float3x3 +} + +// An object that represents a perspective warp transformation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagehomographicalignmentobservation?language=objc +type ImageHomographicAlignmentObservation struct { + ImageAlignmentObservation +} + +func ImageHomographicAlignmentObservationFrom(ptr unsafe.Pointer) ImageHomographicAlignmentObservation { + return ImageHomographicAlignmentObservation{ + ImageAlignmentObservation: ImageAlignmentObservationFrom(ptr), + } +} + +func (ic _ImageHomographicAlignmentObservationClass) Alloc() ImageHomographicAlignmentObservation { + rv := objc.Call[ImageHomographicAlignmentObservation](ic, objc.Sel("alloc")) + return rv +} + +func ImageHomographicAlignmentObservation_Alloc() ImageHomographicAlignmentObservation { + return ImageHomographicAlignmentObservationClass.Alloc() +} + +func (ic _ImageHomographicAlignmentObservationClass) New() ImageHomographicAlignmentObservation { + rv := objc.Call[ImageHomographicAlignmentObservation](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageHomographicAlignmentObservation() ImageHomographicAlignmentObservation { + return ImageHomographicAlignmentObservationClass.New() +} + +func (i_ ImageHomographicAlignmentObservation) Init() ImageHomographicAlignmentObservation { + rv := objc.Call[ImageHomographicAlignmentObservation](i_, objc.Sel("init")) + return rv +} + +// The warp transform matrix to morph the floating image into the reference image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagehomographicalignmentobservation/2887129-warptransform?language=objc +func (i_ ImageHomographicAlignmentObservation) WarpTransform() kernel.Matrix_float3x3 { + rv := objc.Call[kernel.Matrix_float3x3](i_, objc.Sel("warpTransform")) + return rv +} diff --git a/macos/vision/image_registration_request.gen.go b/macos/vision/image_registration_request.gen.go new file mode 100644 index 00000000..b365149e --- /dev/null +++ b/macos/vision/image_registration_request.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageRegistrationRequest] class. +var ImageRegistrationRequestClass = _ImageRegistrationRequestClass{objc.GetClass("VNImageRegistrationRequest")} + +type _ImageRegistrationRequestClass struct { + objc.Class +} + +// An interface definition for the [ImageRegistrationRequest] class. +type IImageRegistrationRequest interface { + ITargetedImageRequest +} + +// The abstract superclass for image analysis requests that align images according to their content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimageregistrationrequest?language=objc +type ImageRegistrationRequest struct { + TargetedImageRequest +} + +func ImageRegistrationRequestFrom(ptr unsafe.Pointer) ImageRegistrationRequest { + return ImageRegistrationRequest{ + TargetedImageRequest: TargetedImageRequestFrom(ptr), + } +} + +func (ic _ImageRegistrationRequestClass) Alloc() ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](ic, objc.Sel("alloc")) + return rv +} + +func ImageRegistrationRequest_Alloc() ImageRegistrationRequest { + return ImageRegistrationRequestClass.Alloc() +} + +func (ic _ImageRegistrationRequestClass) New() ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageRegistrationRequest() ImageRegistrationRequest { + return ImageRegistrationRequestClass.New() +} + +func (i_ ImageRegistrationRequest) Init() ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("init")) + return rv +} + +func (i_ ImageRegistrationRequest) InitWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("initWithTargetedImageURL:options:"), objc.Ptr(imageURL), options) + return rv +} + +// Creates a new request targeting an image at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923458-initwithtargetedimageurl?language=objc +func NewImageRegistrationRequestWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + instance := ImageRegistrationRequestClass.Alloc().InitWithTargetedImageURLOptions(imageURL, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRegistrationRequest) InitWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("initWithTargetedCMSampleBuffer:options:"), sampleBuffer, options) + return rv +} + +// Creates a new request that targets an image in a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/3571274-initwithtargetedcmsamplebuffer?language=objc +func NewImageRegistrationRequestWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + instance := ImageRegistrationRequestClass.Alloc().InitWithTargetedCMSampleBufferOptions(sampleBuffer, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRegistrationRequest) InitWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("initWithTargetedCIImage:options:"), objc.Ptr(ciImage), options) + return rv +} + +// Creates a new request targeting a CIImage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923447-initwithtargetedciimage?language=objc +func NewImageRegistrationRequestWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + instance := ImageRegistrationRequestClass.Alloc().InitWithTargetedCIImageOptions(ciImage, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRegistrationRequest) InitWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("initWithTargetedCVPixelBuffer:options:"), pixelBuffer, options) + return rv +} + +// Creates a new request targeting an image in a CVPixelBufferRef. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923445-initwithtargetedcvpixelbuffer?language=objc +func NewImageRegistrationRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + instance := ImageRegistrationRequestClass.Alloc().InitWithTargetedCVPixelBufferOptions(pixelBuffer, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRegistrationRequest) InitWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("initWithTargetedCGImage:options:"), cgImage, options) + return rv +} + +// Creates a new request targeting a Core Graphics image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923452-initwithtargetedcgimage?language=objc +func NewImageRegistrationRequestWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + instance := ImageRegistrationRequestClass.Alloc().InitWithTargetedCGImageOptions(cgImage, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRegistrationRequest) InitWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("initWithTargetedImageData:options:"), imageData, options) + return rv +} + +// Creates a new request targeting an image as raw data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923460-initwithtargetedimagedata?language=objc +func NewImageRegistrationRequestWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) ImageRegistrationRequest { + instance := ImageRegistrationRequestClass.Alloc().InitWithTargetedImageDataOptions(imageData, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRegistrationRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) ImageRegistrationRequest { + rv := objc.Call[ImageRegistrationRequest](i_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewImageRegistrationRequestWithCompletionHandler(completionHandler RequestCompletionHandler) ImageRegistrationRequest { + instance := ImageRegistrationRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/image_request_handler.gen.go b/macos/vision/image_request_handler.gen.go new file mode 100644 index 00000000..20127367 --- /dev/null +++ b/macos/vision/image_request_handler.gen.go @@ -0,0 +1,156 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageRequestHandler] class. +var ImageRequestHandlerClass = _ImageRequestHandlerClass{objc.GetClass("VNImageRequestHandler")} + +type _ImageRequestHandlerClass struct { + objc.Class +} + +// An interface definition for the [ImageRequestHandler] class. +type IImageRequestHandler interface { + objc.IObject + PerformRequestsError(requests []IRequest, error foundation.IError) bool +} + +// An object that processes one or more image analysis requests pertaining to a single image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler?language=objc +type ImageRequestHandler struct { + objc.Object +} + +func ImageRequestHandlerFrom(ptr unsafe.Pointer) ImageRequestHandler { + return ImageRequestHandler{ + Object: objc.ObjectFrom(ptr), + } +} + +func (i_ ImageRequestHandler) InitWithCIImageOptions(image coreimage.IImage, options map[ImageOption]objc.IObject) ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](i_, objc.Sel("initWithCIImage:options:"), objc.Ptr(image), options) + return rv +} + +// Creates a handler to be used for performing requests on CIImage data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler/2866549-initwithciimage?language=objc +func NewImageRequestHandlerWithCIImageOptions(image coreimage.IImage, options map[ImageOption]objc.IObject) ImageRequestHandler { + instance := ImageRequestHandlerClass.Alloc().InitWithCIImageOptions(image, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRequestHandler) InitWithDataOptions(imageData []byte, options map[ImageOption]objc.IObject) ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](i_, objc.Sel("initWithData:options:"), imageData, options) + return rv +} + +// Creates a handler to be used for performing requests on an image contained in an NSData object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler/2866551-initwithdata?language=objc +func NewImageRequestHandlerWithDataOptions(imageData []byte, options map[ImageOption]objc.IObject) ImageRequestHandler { + instance := ImageRequestHandlerClass.Alloc().InitWithDataOptions(imageData, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRequestHandler) InitWithURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](i_, objc.Sel("initWithURL:options:"), objc.Ptr(imageURL), options) + return rv +} + +// Creates a handler to be used for performing requests on an image at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler/2866553-initwithurl?language=objc +func NewImageRequestHandlerWithURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) ImageRequestHandler { + instance := ImageRequestHandlerClass.Alloc().InitWithURLOptions(imageURL, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRequestHandler) InitWithCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](i_, objc.Sel("initWithCMSampleBuffer:options:"), sampleBuffer, options) + return rv +} + +// Creates a request handler that performs requests on an image contained within a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler/3548373-initwithcmsamplebuffer?language=objc +func NewImageRequestHandlerWithCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) ImageRequestHandler { + instance := ImageRequestHandlerClass.Alloc().InitWithCMSampleBufferOptions(sampleBuffer, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRequestHandler) InitWithCGImageOptions(image coregraphics.ImageRef, options map[ImageOption]objc.IObject) ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](i_, objc.Sel("initWithCGImage:options:"), image, options) + return rv +} + +// Creates a handler to be used for performing requests on Core Graphics images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler/2866541-initwithcgimage?language=objc +func NewImageRequestHandlerWithCGImageOptions(image coregraphics.ImageRef, options map[ImageOption]objc.IObject) ImageRequestHandler { + instance := ImageRequestHandlerClass.Alloc().InitWithCGImageOptions(image, options) + instance.Autorelease() + return instance +} + +func (i_ ImageRequestHandler) InitWithCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](i_, objc.Sel("initWithCVPixelBuffer:options:"), pixelBuffer, options) + return rv +} + +// Creates a handler for performing requests on a Core Video pixel buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler/2880309-initwithcvpixelbuffer?language=objc +func NewImageRequestHandlerWithCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) ImageRequestHandler { + instance := ImageRequestHandlerClass.Alloc().InitWithCVPixelBufferOptions(pixelBuffer, options) + instance.Autorelease() + return instance +} + +func (ic _ImageRequestHandlerClass) Alloc() ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](ic, objc.Sel("alloc")) + return rv +} + +func ImageRequestHandler_Alloc() ImageRequestHandler { + return ImageRequestHandlerClass.Alloc() +} + +func (ic _ImageRequestHandlerClass) New() ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageRequestHandler() ImageRequestHandler { + return ImageRequestHandlerClass.New() +} + +func (i_ ImageRequestHandler) Init() ImageRequestHandler { + rv := objc.Call[ImageRequestHandler](i_, objc.Sel("init")) + return rv +} + +// Schedules Vision requests to perform. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagerequesthandler/2880297-performrequests?language=objc +func (i_ ImageRequestHandler) PerformRequestsError(requests []IRequest, error foundation.IError) bool { + rv := objc.Call[bool](i_, objc.Sel("performRequests:error:"), requests, objc.Ptr(error)) + return rv +} diff --git a/macos/vision/image_translation_alignment_observation.gen.go b/macos/vision/image_translation_alignment_observation.gen.go new file mode 100644 index 00000000..ca5249f1 --- /dev/null +++ b/macos/vision/image_translation_alignment_observation.gen.go @@ -0,0 +1,68 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [ImageTranslationAlignmentObservation] class. +var ImageTranslationAlignmentObservationClass = _ImageTranslationAlignmentObservationClass{objc.GetClass("VNImageTranslationAlignmentObservation")} + +type _ImageTranslationAlignmentObservationClass struct { + objc.Class +} + +// An interface definition for the [ImageTranslationAlignmentObservation] class. +type IImageTranslationAlignmentObservation interface { + IImageAlignmentObservation + AlignmentTransform() coregraphics.AffineTransform +} + +// Affine transform information that an image alignment request produces. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagetranslationalignmentobservation?language=objc +type ImageTranslationAlignmentObservation struct { + ImageAlignmentObservation +} + +func ImageTranslationAlignmentObservationFrom(ptr unsafe.Pointer) ImageTranslationAlignmentObservation { + return ImageTranslationAlignmentObservation{ + ImageAlignmentObservation: ImageAlignmentObservationFrom(ptr), + } +} + +func (ic _ImageTranslationAlignmentObservationClass) Alloc() ImageTranslationAlignmentObservation { + rv := objc.Call[ImageTranslationAlignmentObservation](ic, objc.Sel("alloc")) + return rv +} + +func ImageTranslationAlignmentObservation_Alloc() ImageTranslationAlignmentObservation { + return ImageTranslationAlignmentObservationClass.Alloc() +} + +func (ic _ImageTranslationAlignmentObservationClass) New() ImageTranslationAlignmentObservation { + rv := objc.Call[ImageTranslationAlignmentObservation](ic, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewImageTranslationAlignmentObservation() ImageTranslationAlignmentObservation { + return ImageTranslationAlignmentObservationClass.New() +} + +func (i_ ImageTranslationAlignmentObservation) Init() ImageTranslationAlignmentObservation { + rv := objc.Call[ImageTranslationAlignmentObservation](i_, objc.Sel("init")) + return rv +} + +// The alignment transform to align the floating image with the reference image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnimagetranslationalignmentobservation/2887130-alignmenttransform?language=objc +func (i_ ImageTranslationAlignmentObservation) AlignmentTransform() coregraphics.AffineTransform { + rv := objc.Call[coregraphics.AffineTransform](i_, objc.Sel("alignmentTransform")) + return rv +} diff --git a/macos/vision/observation.gen.go b/macos/vision/observation.gen.go new file mode 100644 index 00000000..1abefddf --- /dev/null +++ b/macos/vision/observation.gen.go @@ -0,0 +1,87 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Observation] class. +var ObservationClass = _ObservationClass{objc.GetClass("VNObservation")} + +type _ObservationClass struct { + objc.Class +} + +// An interface definition for the [Observation] class. +type IObservation interface { + objc.IObject + TimeRange() coremedia.TimeRange + Uuid() foundation.UUID + Confidence() Confidence +} + +// The abstract superclass for analysis results. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnobservation?language=objc +type Observation struct { + objc.Object +} + +func ObservationFrom(ptr unsafe.Pointer) Observation { + return Observation{ + Object: objc.ObjectFrom(ptr), + } +} + +func (oc _ObservationClass) Alloc() Observation { + rv := objc.Call[Observation](oc, objc.Sel("alloc")) + return rv +} + +func Observation_Alloc() Observation { + return ObservationClass.Alloc() +} + +func (oc _ObservationClass) New() Observation { + rv := objc.Call[Observation](oc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewObservation() Observation { + return ObservationClass.New() +} + +func (o_ Observation) Init() Observation { + rv := objc.Call[Observation](o_, objc.Sel("init")) + return rv +} + +// The time range of the reported observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnobservation/3548370-timerange?language=objc +func (o_ Observation) TimeRange() coremedia.TimeRange { + rv := objc.Call[coremedia.TimeRange](o_, objc.Sel("timeRange")) + return rv +} + +// A unique identifier assigned to the Vision observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnobservation/2879296-uuid?language=objc +func (o_ Observation) Uuid() foundation.UUID { + rv := objc.Call[foundation.UUID](o_, objc.Sel("uuid")) + return rv +} + +// The level of confidence in the observation’s accuracy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnobservation/2867220-confidence?language=objc +func (o_ Observation) Confidence() Confidence { + rv := objc.Call[Confidence](o_, objc.Sel("confidence")) + return rv +} diff --git a/macos/vision/pixel_buffer_observation.gen.go b/macos/vision/pixel_buffer_observation.gen.go new file mode 100644 index 00000000..26e896f2 --- /dev/null +++ b/macos/vision/pixel_buffer_observation.gen.go @@ -0,0 +1,77 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [PixelBufferObservation] class. +var PixelBufferObservationClass = _PixelBufferObservationClass{objc.GetClass("VNPixelBufferObservation")} + +type _PixelBufferObservationClass struct { + objc.Class +} + +// An interface definition for the [PixelBufferObservation] class. +type IPixelBufferObservation interface { + IObservation + FeatureName() string + PixelBuffer() corevideo.PixelBufferRef +} + +// An object that represents an image that an image analysis request produces. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpixelbufferobservation?language=objc +type PixelBufferObservation struct { + Observation +} + +func PixelBufferObservationFrom(ptr unsafe.Pointer) PixelBufferObservation { + return PixelBufferObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (pc _PixelBufferObservationClass) Alloc() PixelBufferObservation { + rv := objc.Call[PixelBufferObservation](pc, objc.Sel("alloc")) + return rv +} + +func PixelBufferObservation_Alloc() PixelBufferObservation { + return PixelBufferObservationClass.Alloc() +} + +func (pc _PixelBufferObservationClass) New() PixelBufferObservation { + rv := objc.Call[PixelBufferObservation](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPixelBufferObservation() PixelBufferObservation { + return PixelBufferObservationClass.New() +} + +func (p_ PixelBufferObservation) Init() PixelBufferObservation { + rv := objc.Call[PixelBufferObservation](p_, objc.Sel("init")) + return rv +} + +// A feature name that the CoreML model defines. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpixelbufferobservation/3131945-featurename?language=objc +func (p_ PixelBufferObservation) FeatureName() string { + rv := objc.Call[string](p_, objc.Sel("featureName")) + return rv +} + +// The image that results from a request with image output. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpixelbufferobservation/2890132-pixelbuffer?language=objc +func (p_ PixelBufferObservation) PixelBuffer() corevideo.PixelBufferRef { + rv := objc.Call[corevideo.PixelBufferRef](p_, objc.Sel("pixelBuffer")) + return rv +} diff --git a/macos/vision/point.gen.go b/macos/vision/point.gen.go new file mode 100644 index 00000000..1b77de86 --- /dev/null +++ b/macos/vision/point.gen.go @@ -0,0 +1,153 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Point] class. +var PointClass = _PointClass{objc.GetClass("VNPoint")} + +type _PointClass struct { + objc.Class +} + +// An interface definition for the [Point] class. +type IPoint interface { + objc.IObject + DistanceToPoint(point IPoint) float64 + X() float64 + Y() float64 + Location() coregraphics.Point +} + +// An immutable object that represents a single, two-dimensional point in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint?language=objc +type Point struct { + objc.Object +} + +func PointFrom(ptr unsafe.Pointer) Point { + return Point{ + Object: objc.ObjectFrom(ptr), + } +} + +func (p_ Point) InitWithXY(x float64, y float64) Point { + rv := objc.Call[Point](p_, objc.Sel("initWithX:y:"), x, y) + return rv +} + +// Creates a point object with the specified coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548331-initwithx?language=objc +func NewPointWithXY(x float64, y float64) Point { + instance := PointClass.Alloc().InitWithXY(x, y) + instance.Autorelease() + return instance +} + +func (p_ Point) InitWithLocation(location coregraphics.Point) Point { + rv := objc.Call[Point](p_, objc.Sel("initWithLocation:"), location) + return rv +} + +// Creates a point object from the specified Core Graphics point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548330-initwithlocation?language=objc +func NewPointWithLocation(location coregraphics.Point) Point { + instance := PointClass.Alloc().InitWithLocation(location) + instance.Autorelease() + return instance +} + +func (pc _PointClass) Alloc() Point { + rv := objc.Call[Point](pc, objc.Sel("alloc")) + return rv +} + +func Point_Alloc() Point { + return PointClass.Alloc() +} + +func (pc _PointClass) New() Point { + rv := objc.Call[Point](pc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewPoint() Point { + return PointClass.New() +} + +func (p_ Point) Init() Point { + rv := objc.Call[Point](p_, objc.Sel("init")) + return rv +} + +// Creates a point object that’s shifted by the X and Y offsets of the specified vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548333-pointbyapplyingvector?language=objc +func (pc _PointClass) PointByApplyingVectorToPoint(vector IVector, point IPoint) Point { + rv := objc.Call[Point](pc, objc.Sel("pointByApplyingVector:toPoint:"), objc.Ptr(vector), objc.Ptr(point)) + return rv +} + +// Creates a point object that’s shifted by the X and Y offsets of the specified vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548333-pointbyapplyingvector?language=objc +func Point_PointByApplyingVectorToPoint(vector IVector, point IPoint) Point { + return PointClass.PointByApplyingVectorToPoint(vector, point) +} + +// Returns the distance to another point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3675674-distancetopoint?language=objc +func (p_ Point) DistanceToPoint(point IPoint) float64 { + rv := objc.Call[float64](p_, objc.Sel("distanceToPoint:"), objc.Ptr(point)) + return rv +} + +// A point object that represents the origin. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548336-zeropoint?language=objc +func (pc _PointClass) ZeroPoint() Point { + rv := objc.Call[Point](pc, objc.Sel("zeroPoint")) + return rv +} + +// A point object that represents the origin. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548336-zeropoint?language=objc +func Point_ZeroPoint() Point { + return PointClass.ZeroPoint() +} + +// The x-coordinate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548334-x?language=objc +func (p_ Point) X() float64 { + rv := objc.Call[float64](p_, objc.Sel("x")) + return rv +} + +// The y-coordinate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548335-y?language=objc +func (p_ Point) Y() float64 { + rv := objc.Call[float64](p_, objc.Sel("y")) + return rv +} + +// The Core Graphics point for this point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548332-location?language=objc +func (p_ Point) Location() coregraphics.Point { + rv := objc.Call[coregraphics.Point](p_, objc.Sel("location")) + return rv +} diff --git a/macos/vision/protocols.gen.m b/macos/vision/protocols.gen.m new file mode 100644 index 00000000..ec60c8c4 --- /dev/null +++ b/macos/vision/protocols.gen.m @@ -0,0 +1,10 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +#import "Vision/Vision.h" + +void importVisionProtocols() { + id o; + o = @protocol(VNFaceObservationAccepting); + o = @protocol(VNRequestProgressProviding); + o = @protocol(VNRequestRevisionProviding); +} diff --git a/macos/vision/recognize_animals_request.gen.go b/macos/vision/recognize_animals_request.gen.go new file mode 100644 index 00000000..6a416076 --- /dev/null +++ b/macos/vision/recognize_animals_request.gen.go @@ -0,0 +1,82 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RecognizeAnimalsRequest] class. +var RecognizeAnimalsRequestClass = _RecognizeAnimalsRequestClass{objc.GetClass("VNRecognizeAnimalsRequest")} + +type _RecognizeAnimalsRequestClass struct { + objc.Class +} + +// An interface definition for the [RecognizeAnimalsRequest] class. +type IRecognizeAnimalsRequest interface { + IImageBasedRequest + SupportedIdentifiersAndReturnError(error foundation.IError) []AnimalIdentifier +} + +// A request that recognizes animals in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizeanimalsrequest?language=objc +type RecognizeAnimalsRequest struct { + ImageBasedRequest +} + +func RecognizeAnimalsRequestFrom(ptr unsafe.Pointer) RecognizeAnimalsRequest { + return RecognizeAnimalsRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (rc _RecognizeAnimalsRequestClass) Alloc() RecognizeAnimalsRequest { + rv := objc.Call[RecognizeAnimalsRequest](rc, objc.Sel("alloc")) + return rv +} + +func RecognizeAnimalsRequest_Alloc() RecognizeAnimalsRequest { + return RecognizeAnimalsRequestClass.Alloc() +} + +func (rc _RecognizeAnimalsRequestClass) New() RecognizeAnimalsRequest { + rv := objc.Call[RecognizeAnimalsRequest](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRecognizeAnimalsRequest() RecognizeAnimalsRequest { + return RecognizeAnimalsRequestClass.New() +} + +func (r_ RecognizeAnimalsRequest) Init() RecognizeAnimalsRequest { + rv := objc.Call[RecognizeAnimalsRequest](r_, objc.Sel("init")) + return rv +} + +func (r_ RecognizeAnimalsRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) RecognizeAnimalsRequest { + rv := objc.Call[RecognizeAnimalsRequest](r_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewRecognizeAnimalsRequestWithCompletionHandler(completionHandler RequestCompletionHandler) RecognizeAnimalsRequest { + instance := RecognizeAnimalsRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// Returns the identifiers of the animals that the request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizeanimalsrequest/3751003-supportedidentifiersandreturnerr?language=objc +func (r_ RecognizeAnimalsRequest) SupportedIdentifiersAndReturnError(error foundation.IError) []AnimalIdentifier { + rv := objc.Call[[]AnimalIdentifier](r_, objc.Sel("supportedIdentifiersAndReturnError:"), objc.Ptr(error)) + return rv +} diff --git a/macos/vision/recognize_text_request.gen.go b/macos/vision/recognize_text_request.gen.go new file mode 100644 index 00000000..9a1657ce --- /dev/null +++ b/macos/vision/recognize_text_request.gen.go @@ -0,0 +1,167 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RecognizeTextRequest] class. +var RecognizeTextRequestClass = _RecognizeTextRequestClass{objc.GetClass("VNRecognizeTextRequest")} + +type _RecognizeTextRequestClass struct { + objc.Class +} + +// An interface definition for the [RecognizeTextRequest] class. +type IRecognizeTextRequest interface { + IImageBasedRequest + SupportedRecognitionLanguagesAndReturnError(error foundation.IError) []string + RecognitionLevel() RequestTextRecognitionLevel + SetRecognitionLevel(value RequestTextRecognitionLevel) + UsesLanguageCorrection() bool + SetUsesLanguageCorrection(value bool) + MinimumTextHeight() float64 + SetMinimumTextHeight(value float64) + RecognitionLanguages() []string + SetRecognitionLanguages(value []string) + CustomWords() []string + SetCustomWords(value []string) +} + +// An image analysis request that finds and recognizes text in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest?language=objc +type RecognizeTextRequest struct { + ImageBasedRequest +} + +func RecognizeTextRequestFrom(ptr unsafe.Pointer) RecognizeTextRequest { + return RecognizeTextRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (rc _RecognizeTextRequestClass) Alloc() RecognizeTextRequest { + rv := objc.Call[RecognizeTextRequest](rc, objc.Sel("alloc")) + return rv +} + +func RecognizeTextRequest_Alloc() RecognizeTextRequest { + return RecognizeTextRequestClass.Alloc() +} + +func (rc _RecognizeTextRequestClass) New() RecognizeTextRequest { + rv := objc.Call[RecognizeTextRequest](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRecognizeTextRequest() RecognizeTextRequest { + return RecognizeTextRequestClass.New() +} + +func (r_ RecognizeTextRequest) Init() RecognizeTextRequest { + rv := objc.Call[RecognizeTextRequest](r_, objc.Sel("init")) + return rv +} + +func (r_ RecognizeTextRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) RecognizeTextRequest { + rv := objc.Call[RecognizeTextRequest](r_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewRecognizeTextRequestWithCompletionHandler(completionHandler RequestCompletionHandler) RecognizeTextRequest { + instance := RecognizeTextRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// Returns the identifiers of the languages that the request supports. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3751006-supportedrecognitionlanguagesand?language=objc +func (r_ RecognizeTextRequest) SupportedRecognitionLanguagesAndReturnError(error foundation.IError) []string { + rv := objc.Call[[]string](r_, objc.Sel("supportedRecognitionLanguagesAndReturnError:"), objc.Ptr(error)) + return rv +} + +// A value that determines whether the request prioritizes accuracy or speed in text recognition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152643-recognitionlevel?language=objc +func (r_ RecognizeTextRequest) RecognitionLevel() RequestTextRecognitionLevel { + rv := objc.Call[RequestTextRecognitionLevel](r_, objc.Sel("recognitionLevel")) + return rv +} + +// A value that determines whether the request prioritizes accuracy or speed in text recognition. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152643-recognitionlevel?language=objc +func (r_ RecognizeTextRequest) SetRecognitionLevel(value RequestTextRecognitionLevel) { + objc.Call[objc.Void](r_, objc.Sel("setRecognitionLevel:"), value) +} + +// A Boolean value that indicates whether the request applies language correction during the recognition process. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3166773-useslanguagecorrection?language=objc +func (r_ RecognizeTextRequest) UsesLanguageCorrection() bool { + rv := objc.Call[bool](r_, objc.Sel("usesLanguageCorrection")) + return rv +} + +// A Boolean value that indicates whether the request applies language correction during the recognition process. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3166773-useslanguagecorrection?language=objc +func (r_ RecognizeTextRequest) SetUsesLanguageCorrection(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setUsesLanguageCorrection:"), value) +} + +// The minimum height, relative to the image height, of the text to recognize. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152641-minimumtextheight?language=objc +func (r_ RecognizeTextRequest) MinimumTextHeight() float64 { + rv := objc.Call[float64](r_, objc.Sel("minimumTextHeight")) + return rv +} + +// The minimum height, relative to the image height, of the text to recognize. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152641-minimumtextheight?language=objc +func (r_ RecognizeTextRequest) SetMinimumTextHeight(value float64) { + objc.Call[objc.Void](r_, objc.Sel("setMinimumTextHeight:"), value) +} + +// An array of languages to detect, in priority order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152642-recognitionlanguages?language=objc +func (r_ RecognizeTextRequest) RecognitionLanguages() []string { + rv := objc.Call[[]string](r_, objc.Sel("recognitionLanguages")) + return rv +} + +// An array of languages to detect, in priority order. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152642-recognitionlanguages?language=objc +func (r_ RecognizeTextRequest) SetRecognitionLanguages(value []string) { + objc.Call[objc.Void](r_, objc.Sel("setRecognitionLanguages:"), value) +} + +// An array of strings to supplement the recognized languages at the word-recognition stage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152640-customwords?language=objc +func (r_ RecognizeTextRequest) CustomWords() []string { + rv := objc.Call[[]string](r_, objc.Sel("customWords")) + return rv +} + +// An array of strings to supplement the recognized languages at the word-recognition stage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizetextrequest/3152640-customwords?language=objc +func (r_ RecognizeTextRequest) SetCustomWords(value []string) { + objc.Call[objc.Void](r_, objc.Sel("setCustomWords:"), value) +} diff --git a/macos/vision/recognized_object_observation.gen.go b/macos/vision/recognized_object_observation.gen.go new file mode 100644 index 00000000..190b60b3 --- /dev/null +++ b/macos/vision/recognized_object_observation.gen.go @@ -0,0 +1,92 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RecognizedObjectObservation] class. +var RecognizedObjectObservationClass = _RecognizedObjectObservationClass{objc.GetClass("VNRecognizedObjectObservation")} + +type _RecognizedObjectObservationClass struct { + objc.Class +} + +// An interface definition for the [RecognizedObjectObservation] class. +type IRecognizedObjectObservation interface { + IDetectedObjectObservation + Labels() []ClassificationObservation +} + +// A detected object observation with an array of classification labels that classify the recognized object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedobjectobservation?language=objc +type RecognizedObjectObservation struct { + DetectedObjectObservation +} + +func RecognizedObjectObservationFrom(ptr unsafe.Pointer) RecognizedObjectObservation { + return RecognizedObjectObservation{ + DetectedObjectObservation: DetectedObjectObservationFrom(ptr), + } +} + +func (rc _RecognizedObjectObservationClass) Alloc() RecognizedObjectObservation { + rv := objc.Call[RecognizedObjectObservation](rc, objc.Sel("alloc")) + return rv +} + +func RecognizedObjectObservation_Alloc() RecognizedObjectObservation { + return RecognizedObjectObservationClass.Alloc() +} + +func (rc _RecognizedObjectObservationClass) New() RecognizedObjectObservation { + rv := objc.Call[RecognizedObjectObservation](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRecognizedObjectObservation() RecognizedObjectObservation { + return RecognizedObjectObservationClass.New() +} + +func (r_ RecognizedObjectObservation) Init() RecognizedObjectObservation { + rv := objc.Call[RecognizedObjectObservation](r_, objc.Sel("init")) + return rv +} + +func (rc _RecognizedObjectObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) RecognizedObjectObservation { + rv := objc.Call[RecognizedObjectObservation](rc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func RecognizedObjectObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) RecognizedObjectObservation { + return RecognizedObjectObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (rc _RecognizedObjectObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) RecognizedObjectObservation { + rv := objc.Call[RecognizedObjectObservation](rc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func RecognizedObjectObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) RecognizedObjectObservation { + return RecognizedObjectObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +// An array of observations that classify the recognized object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedobjectobservation/2980942-labels?language=objc +func (r_ RecognizedObjectObservation) Labels() []ClassificationObservation { + rv := objc.Call[[]ClassificationObservation](r_, objc.Sel("labels")) + return rv +} diff --git a/macos/vision/recognized_point.gen.go b/macos/vision/recognized_point.gen.go new file mode 100644 index 00000000..e5deed3c --- /dev/null +++ b/macos/vision/recognized_point.gen.go @@ -0,0 +1,96 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RecognizedPoint] class. +var RecognizedPointClass = _RecognizedPointClass{objc.GetClass("VNRecognizedPoint")} + +type _RecognizedPointClass struct { + objc.Class +} + +// An interface definition for the [RecognizedPoint] class. +type IRecognizedPoint interface { + IDetectedPoint + Identifier() RecognizedPointKey +} + +// An object that represents a normalized point in an image, along with an identifier label and a confidence value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpoint?language=objc +type RecognizedPoint struct { + DetectedPoint +} + +func RecognizedPointFrom(ptr unsafe.Pointer) RecognizedPoint { + return RecognizedPoint{ + DetectedPoint: DetectedPointFrom(ptr), + } +} + +func (rc _RecognizedPointClass) Alloc() RecognizedPoint { + rv := objc.Call[RecognizedPoint](rc, objc.Sel("alloc")) + return rv +} + +func RecognizedPoint_Alloc() RecognizedPoint { + return RecognizedPointClass.Alloc() +} + +func (rc _RecognizedPointClass) New() RecognizedPoint { + rv := objc.Call[RecognizedPoint](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRecognizedPoint() RecognizedPoint { + return RecognizedPointClass.New() +} + +func (r_ RecognizedPoint) Init() RecognizedPoint { + rv := objc.Call[RecognizedPoint](r_, objc.Sel("init")) + return rv +} + +func (r_ RecognizedPoint) InitWithXY(x float64, y float64) RecognizedPoint { + rv := objc.Call[RecognizedPoint](r_, objc.Sel("initWithX:y:"), x, y) + return rv +} + +// Creates a point object with the specified coordinates. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548331-initwithx?language=objc +func NewRecognizedPointWithXY(x float64, y float64) RecognizedPoint { + instance := RecognizedPointClass.Alloc().InitWithXY(x, y) + instance.Autorelease() + return instance +} + +func (r_ RecognizedPoint) InitWithLocation(location coregraphics.Point) RecognizedPoint { + rv := objc.Call[RecognizedPoint](r_, objc.Sel("initWithLocation:"), location) + return rv +} + +// Creates a point object from the specified Core Graphics point. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnpoint/3548330-initwithlocation?language=objc +func NewRecognizedPointWithLocation(location coregraphics.Point) RecognizedPoint { + instance := RecognizedPointClass.Alloc().InitWithLocation(location) + instance.Autorelease() + return instance +} + +// The point’s identifier label. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpoint/3548299-identifier?language=objc +func (r_ RecognizedPoint) Identifier() RecognizedPointKey { + rv := objc.Call[RecognizedPointKey](r_, objc.Sel("identifier")) + return rv +} diff --git a/macos/vision/recognized_points_observation.gen.go b/macos/vision/recognized_points_observation.gen.go new file mode 100644 index 00000000..bc2cf6ec --- /dev/null +++ b/macos/vision/recognized_points_observation.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coreml" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RecognizedPointsObservation] class. +var RecognizedPointsObservationClass = _RecognizedPointsObservationClass{objc.GetClass("VNRecognizedPointsObservation")} + +type _RecognizedPointsObservationClass struct { + objc.Class +} + +// An interface definition for the [RecognizedPointsObservation] class. +type IRecognizedPointsObservation interface { + IObservation + RecognizedPointsForGroupKeyError(groupKey RecognizedPointGroupKey, error foundation.IError) map[RecognizedPointKey]RecognizedPoint + RecognizedPointForKeyError(pointKey RecognizedPointKey, error foundation.IError) RecognizedPoint + KeypointsMultiArrayAndReturnError(error foundation.IError) coreml.MultiArray + AvailableKeys() []RecognizedPointKey + AvailableGroupKeys() []RecognizedPointGroupKey +} + +// An observation that provides the points the analysis recognized. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointsobservation?language=objc +type RecognizedPointsObservation struct { + Observation +} + +func RecognizedPointsObservationFrom(ptr unsafe.Pointer) RecognizedPointsObservation { + return RecognizedPointsObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (rc _RecognizedPointsObservationClass) Alloc() RecognizedPointsObservation { + rv := objc.Call[RecognizedPointsObservation](rc, objc.Sel("alloc")) + return rv +} + +func RecognizedPointsObservation_Alloc() RecognizedPointsObservation { + return RecognizedPointsObservationClass.Alloc() +} + +func (rc _RecognizedPointsObservationClass) New() RecognizedPointsObservation { + rv := objc.Call[RecognizedPointsObservation](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRecognizedPointsObservation() RecognizedPointsObservation { + return RecognizedPointsObservationClass.New() +} + +func (r_ RecognizedPointsObservation) Init() RecognizedPointsObservation { + rv := objc.Call[RecognizedPointsObservation](r_, objc.Sel("init")) + return rv +} + +// Retrieves the recognized points for a key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointsobservation/3618962-recognizedpointsforgroupkey?language=objc +func (r_ RecognizedPointsObservation) RecognizedPointsForGroupKeyError(groupKey RecognizedPointGroupKey, error foundation.IError) map[RecognizedPointKey]RecognizedPoint { + rv := objc.Call[map[RecognizedPointKey]RecognizedPoint](r_, objc.Sel("recognizedPointsForGroupKey:error:"), groupKey, objc.Ptr(error)) + return rv +} + +// Retrieves a recognized point for a key. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointsobservation/3656175-recognizedpointforkey?language=objc +func (r_ RecognizedPointsObservation) RecognizedPointForKeyError(pointKey RecognizedPointKey, error foundation.IError) RecognizedPoint { + rv := objc.Call[RecognizedPoint](r_, objc.Sel("recognizedPointForKey:error:"), pointKey, objc.Ptr(error)) + return rv +} + +// Retrieves the grouping of normalized point coordinates and confidence scores in a format compatible with Core ML. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointsobservation/3618961-keypointsmultiarrayandreturnerro?language=objc +func (r_ RecognizedPointsObservation) KeypointsMultiArrayAndReturnError(error foundation.IError) coreml.MultiArray { + rv := objc.Call[coreml.MultiArray](r_, objc.Sel("keypointsMultiArrayAndReturnError:"), objc.Ptr(error)) + return rv +} + +// The available point keys in the observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointsobservation/3656174-availablekeys?language=objc +func (r_ RecognizedPointsObservation) AvailableKeys() []RecognizedPointKey { + rv := objc.Call[[]RecognizedPointKey](r_, objc.Sel("availableKeys")) + return rv +} + +// The available point group keys in the observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedpointsobservation/3618960-availablegroupkeys?language=objc +func (r_ RecognizedPointsObservation) AvailableGroupKeys() []RecognizedPointGroupKey { + rv := objc.Call[[]RecognizedPointGroupKey](r_, objc.Sel("availableGroupKeys")) + return rv +} diff --git a/macos/vision/recognized_text.gen.go b/macos/vision/recognized_text.gen.go new file mode 100644 index 00000000..5c06499f --- /dev/null +++ b/macos/vision/recognized_text.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RecognizedText] class. +var RecognizedTextClass = _RecognizedTextClass{objc.GetClass("VNRecognizedText")} + +type _RecognizedTextClass struct { + objc.Class +} + +// An interface definition for the [RecognizedText] class. +type IRecognizedText interface { + objc.IObject + BoundingBoxForRangeError(range_ foundation.Range, error foundation.IError) RectangleObservation + String() string + Confidence() Confidence +} + +// Text recognized in an image through a text recognition request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedtext?language=objc +type RecognizedText struct { + objc.Object +} + +func RecognizedTextFrom(ptr unsafe.Pointer) RecognizedText { + return RecognizedText{ + Object: objc.ObjectFrom(ptr), + } +} + +func (rc _RecognizedTextClass) Alloc() RecognizedText { + rv := objc.Call[RecognizedText](rc, objc.Sel("alloc")) + return rv +} + +func RecognizedText_Alloc() RecognizedText { + return RecognizedTextClass.Alloc() +} + +func (rc _RecognizedTextClass) New() RecognizedText { + rv := objc.Call[RecognizedText](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRecognizedText() RecognizedText { + return RecognizedTextClass.New() +} + +func (r_ RecognizedText) Init() RecognizedText { + rv := objc.Call[RecognizedText](r_, objc.Sel("init")) + return rv +} + +// Calculates the bounding box around the characters in the range of a string. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedtext/3152634-boundingboxforrange?language=objc +func (r_ RecognizedText) BoundingBoxForRangeError(range_ foundation.Range, error foundation.IError) RectangleObservation { + rv := objc.Call[RectangleObservation](r_, objc.Sel("boundingBoxForRange:error:"), range_, objc.Ptr(error)) + return rv +} + +// The top candidate for recognized text. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedtext/3152636-string?language=objc +func (r_ RecognizedText) String() string { + rv := objc.Call[string](r_, objc.Sel("string")) + return rv +} + +// A normalized confidence score for the text recognition result. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedtext/3152635-confidence?language=objc +func (r_ RecognizedText) Confidence() Confidence { + rv := objc.Call[Confidence](r_, objc.Sel("confidence")) + return rv +} diff --git a/macos/vision/recognized_text_observation.gen.go b/macos/vision/recognized_text_observation.gen.go new file mode 100644 index 00000000..e8463ea7 --- /dev/null +++ b/macos/vision/recognized_text_observation.gen.go @@ -0,0 +1,92 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RecognizedTextObservation] class. +var RecognizedTextObservationClass = _RecognizedTextObservationClass{objc.GetClass("VNRecognizedTextObservation")} + +type _RecognizedTextObservationClass struct { + objc.Class +} + +// An interface definition for the [RecognizedTextObservation] class. +type IRecognizedTextObservation interface { + IRectangleObservation + TopCandidates(maxCandidateCount uint) []RecognizedText +} + +// A request that detects and recognizes regions of text in an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedtextobservation?language=objc +type RecognizedTextObservation struct { + RectangleObservation +} + +func RecognizedTextObservationFrom(ptr unsafe.Pointer) RecognizedTextObservation { + return RecognizedTextObservation{ + RectangleObservation: RectangleObservationFrom(ptr), + } +} + +func (rc _RecognizedTextObservationClass) Alloc() RecognizedTextObservation { + rv := objc.Call[RecognizedTextObservation](rc, objc.Sel("alloc")) + return rv +} + +func RecognizedTextObservation_Alloc() RecognizedTextObservation { + return RecognizedTextObservationClass.Alloc() +} + +func (rc _RecognizedTextObservationClass) New() RecognizedTextObservation { + rv := objc.Call[RecognizedTextObservation](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRecognizedTextObservation() RecognizedTextObservation { + return RecognizedTextObservationClass.New() +} + +func (r_ RecognizedTextObservation) Init() RecognizedTextObservation { + rv := objc.Call[RecognizedTextObservation](r_, objc.Sel("init")) + return rv +} + +func (rc _RecognizedTextObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) RecognizedTextObservation { + rv := objc.Call[RecognizedTextObservation](rc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func RecognizedTextObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) RecognizedTextObservation { + return RecognizedTextObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (rc _RecognizedTextObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) RecognizedTextObservation { + rv := objc.Call[RecognizedTextObservation](rc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func RecognizedTextObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) RecognizedTextObservation { + return RecognizedTextObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +// Requests the n top candidates for a recognized text string. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrecognizedtextobservation/3152637-topcandidates?language=objc +func (r_ RecognizedTextObservation) TopCandidates(maxCandidateCount uint) []RecognizedText { + rv := objc.Call[[]RecognizedText](r_, objc.Sel("topCandidates:"), maxCandidateCount) + return rv +} diff --git a/macos/vision/rectangle_observation.gen.go b/macos/vision/rectangle_observation.gen.go new file mode 100644 index 00000000..4a97c1b7 --- /dev/null +++ b/macos/vision/rectangle_observation.gen.go @@ -0,0 +1,119 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [RectangleObservation] class. +var RectangleObservationClass = _RectangleObservationClass{objc.GetClass("VNRectangleObservation")} + +type _RectangleObservationClass struct { + objc.Class +} + +// An interface definition for the [RectangleObservation] class. +type IRectangleObservation interface { + IDetectedObjectObservation + BottomRight() coregraphics.Point + BottomLeft() coregraphics.Point + TopRight() coregraphics.Point + TopLeft() coregraphics.Point +} + +// An object that represents the four vertices of a detected rectangle. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrectangleobservation?language=objc +type RectangleObservation struct { + DetectedObjectObservation +} + +func RectangleObservationFrom(ptr unsafe.Pointer) RectangleObservation { + return RectangleObservation{ + DetectedObjectObservation: DetectedObjectObservationFrom(ptr), + } +} + +func (rc _RectangleObservationClass) Alloc() RectangleObservation { + rv := objc.Call[RectangleObservation](rc, objc.Sel("alloc")) + return rv +} + +func RectangleObservation_Alloc() RectangleObservation { + return RectangleObservationClass.Alloc() +} + +func (rc _RectangleObservationClass) New() RectangleObservation { + rv := objc.Call[RectangleObservation](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRectangleObservation() RectangleObservation { + return RectangleObservationClass.New() +} + +func (r_ RectangleObservation) Init() RectangleObservation { + rv := objc.Call[RectangleObservation](r_, objc.Sel("init")) + return rv +} + +func (rc _RectangleObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) RectangleObservation { + rv := objc.Call[RectangleObservation](rc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func RectangleObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) RectangleObservation { + return RectangleObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (rc _RectangleObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) RectangleObservation { + rv := objc.Call[RectangleObservation](rc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func RectangleObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) RectangleObservation { + return RectangleObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +// The coordinates of the lower-right corner of the observation bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrectangleobservation/2867226-bottomright?language=objc +func (r_ RectangleObservation) BottomRight() coregraphics.Point { + rv := objc.Call[coregraphics.Point](r_, objc.Sel("bottomRight")) + return rv +} + +// The coordinates of the lower-left corner of the observation bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrectangleobservation/2867201-bottomleft?language=objc +func (r_ RectangleObservation) BottomLeft() coregraphics.Point { + rv := objc.Call[coregraphics.Point](r_, objc.Sel("bottomLeft")) + return rv +} + +// The coordinates of the upper-right corner of the observation bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrectangleobservation/2867233-topright?language=objc +func (r_ RectangleObservation) TopRight() coregraphics.Point { + rv := objc.Call[coregraphics.Point](r_, objc.Sel("topRight")) + return rv +} + +// The coordinates of the upper-left corner of the observation bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrectangleobservation/2867210-topleft?language=objc +func (r_ RectangleObservation) TopLeft() coregraphics.Point { + rv := objc.Call[coregraphics.Point](r_, objc.Sel("topLeft")) + return rv +} diff --git a/macos/vision/request.gen.go b/macos/vision/request.gen.go new file mode 100644 index 00000000..4995d393 --- /dev/null +++ b/macos/vision/request.gen.go @@ -0,0 +1,178 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Request] class. +var RequestClass = _RequestClass{objc.GetClass("VNRequest")} + +type _RequestClass struct { + objc.Class +} + +// An interface definition for the [Request] class. +type IRequest interface { + objc.IObject + Cancel() + Results() []Observation + PreferBackgroundProcessing() bool + SetPreferBackgroundProcessing(value bool) + CompletionHandler() RequestCompletionHandler + Revision() uint + SetRevision(value uint) +} + +// The abstract superclass for analysis requests. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest?language=objc +type Request struct { + objc.Object +} + +func RequestFrom(ptr unsafe.Pointer) Request { + return Request{ + Object: objc.ObjectFrom(ptr), + } +} + +func (r_ Request) InitWithCompletionHandler(completionHandler RequestCompletionHandler) Request { + rv := objc.Call[Request](r_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewRequestWithCompletionHandler(completionHandler RequestCompletionHandler) Request { + instance := RequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +func (r_ Request) Init() Request { + rv := objc.Call[Request](r_, objc.Sel("init")) + return rv +} + +func (rc _RequestClass) Alloc() Request { + rv := objc.Call[Request](rc, objc.Sel("alloc")) + return rv +} + +func Request_Alloc() Request { + return RequestClass.Alloc() +} + +func (rc _RequestClass) New() Request { + rv := objc.Call[Request](rc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewRequest() Request { + return RequestClass.New() +} + +// Cancels the request before it can finish executing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2867234-cancel?language=objc +func (r_ Request) Cancel() { + objc.Call[objc.Void](r_, objc.Sel("cancel")) +} + +// The current revison supported by the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967108-currentrevision?language=objc +func (rc _RequestClass) CurrentRevision() uint { + rv := objc.Call[uint](rc, objc.Sel("currentRevision")) + return rv +} + +// The current revison supported by the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967108-currentrevision?language=objc +func Request_CurrentRevision() uint { + return RequestClass.CurrentRevision() +} + +// The collection of currently-supported algorithm versions for the class of request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967111-supportedrevisions?language=objc +func (rc _RequestClass) SupportedRevisions() foundation.IndexSet { + rv := objc.Call[foundation.IndexSet](rc, objc.Sel("supportedRevisions")) + return rv +} + +// The collection of currently-supported algorithm versions for the class of request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967111-supportedrevisions?language=objc +func Request_SupportedRevisions() foundation.IndexSet { + return RequestClass.SupportedRevisions() +} + +// The revision of the latest request for the particular SDK linked with the client application. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967109-defaultrevision?language=objc +func (rc _RequestClass) DefaultRevision() uint { + rv := objc.Call[uint](rc, objc.Sel("defaultRevision")) + return rv +} + +// The revision of the latest request for the particular SDK linked with the client application. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967109-defaultrevision?language=objc +func Request_DefaultRevision() uint { + return RequestClass.DefaultRevision() +} + +// The collection of VNObservation results generated by request processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2867238-results?language=objc +func (r_ Request) Results() []Observation { + rv := objc.Call[[]Observation](r_, objc.Sel("results")) + return rv +} + +// A hint to minimize the resource burden of the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875404-preferbackgroundprocessing?language=objc +func (r_ Request) PreferBackgroundProcessing() bool { + rv := objc.Call[bool](r_, objc.Sel("preferBackgroundProcessing")) + return rv +} + +// A hint to minimize the resource burden of the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875404-preferbackgroundprocessing?language=objc +func (r_ Request) SetPreferBackgroundProcessing(value bool) { + objc.Call[objc.Void](r_, objc.Sel("setPreferBackgroundProcessing:"), value) +} + +// The completion handler the system invokes after the request finishes processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2867266-completionhandler?language=objc +func (r_ Request) CompletionHandler() RequestCompletionHandler { + rv := objc.Call[RequestCompletionHandler](r_, objc.Sel("completionHandler")) + return rv +} + +// The specific algorithm or implementation revision that’s used to perform the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967110-revision?language=objc +func (r_ Request) Revision() uint { + rv := objc.Call[uint](r_, objc.Sel("revision")) + return rv +} + +// The specific algorithm or implementation revision that’s used to perform the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2967110-revision?language=objc +func (r_ Request) SetRevision(value uint) { + objc.Call[objc.Void](r_, objc.Sel("setRevision:"), value) +} diff --git a/macos/vision/request_progress_providing.gen.go b/macos/vision/request_progress_providing.gen.go new file mode 100644 index 00000000..7b9c1e27 --- /dev/null +++ b/macos/vision/request_progress_providing.gen.go @@ -0,0 +1,64 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol for providing progress information on long-running tasks in Vision. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestprogressproviding?language=objc +type PRequestProgressProviding interface { + // optional + SetProgressHandler(value RequestProgressHandler) + HasSetProgressHandler() bool + + // optional + ProgressHandler() RequestProgressHandler + HasProgressHandler() bool + + // optional + Indeterminate() bool + HasIndeterminate() bool +} + +// A concrete type wrapper for the [PRequestProgressProviding] protocol. +type RequestProgressProvidingWrapper struct { + objc.Object +} + +func (r_ RequestProgressProvidingWrapper) HasSetProgressHandler() bool { + return r_.RespondsToSelector(objc.Sel("setProgressHandler:")) +} + +// A block of code executed periodically during a Vision request to report progress on long-running tasks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestprogressproviding/3152652-progresshandler?language=objc +func (r_ RequestProgressProvidingWrapper) SetProgressHandler(value RequestProgressHandler) { + objc.Call[objc.Void](r_, objc.Sel("setProgressHandler:"), value) +} + +func (r_ RequestProgressProvidingWrapper) HasProgressHandler() bool { + return r_.RespondsToSelector(objc.Sel("progressHandler")) +} + +// A block of code executed periodically during a Vision request to report progress on long-running tasks. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestprogressproviding/3152652-progresshandler?language=objc +func (r_ RequestProgressProvidingWrapper) ProgressHandler() RequestProgressHandler { + rv := objc.Call[RequestProgressHandler](r_, objc.Sel("progressHandler")) + return rv +} + +func (r_ RequestProgressProvidingWrapper) HasIndeterminate() bool { + return r_.RespondsToSelector(objc.Sel("indeterminate")) +} + +// A Boolean set to true when a request can't determine its progress in fractions completed. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestprogressproviding/3152651-indeterminate?language=objc +func (r_ RequestProgressProvidingWrapper) Indeterminate() bool { + rv := objc.Call[bool](r_, objc.Sel("indeterminate")) + return rv +} diff --git a/macos/vision/request_revision_providing.gen.go b/macos/vision/request_revision_providing.gen.go new file mode 100644 index 00000000..30b01e7b --- /dev/null +++ b/macos/vision/request_revision_providing.gen.go @@ -0,0 +1,33 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "github.com/progrium/macdriver/objc" +) + +// A protocol for specifying the revision number of Vision algorithms. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestrevisionproviding?language=objc +type PRequestRevisionProviding interface { + // optional + RequestRevision() uint + HasRequestRevision() bool +} + +// A concrete type wrapper for the [PRequestRevisionProviding] protocol. +type RequestRevisionProvidingWrapper struct { + objc.Object +} + +func (r_ RequestRevisionProvidingWrapper) HasRequestRevision() bool { + return r_.RespondsToSelector(objc.Sel("requestRevision")) +} + +// The revision of the VNRequest subclass used to generate the implementing object. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequestrevisionproviding/2967114-requestrevision?language=objc +func (r_ RequestRevisionProvidingWrapper) RequestRevision() uint { + rv := objc.Call[uint](r_, objc.Sel("requestRevision")) + return rv +} diff --git a/macos/vision/saliency_image_observation.gen.go b/macos/vision/saliency_image_observation.gen.go new file mode 100644 index 00000000..8ac3bf6f --- /dev/null +++ b/macos/vision/saliency_image_observation.gen.go @@ -0,0 +1,67 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SaliencyImageObservation] class. +var SaliencyImageObservationClass = _SaliencyImageObservationClass{objc.GetClass("VNSaliencyImageObservation")} + +type _SaliencyImageObservationClass struct { + objc.Class +} + +// An interface definition for the [SaliencyImageObservation] class. +type ISaliencyImageObservation interface { + IPixelBufferObservation + SalientObjects() []RectangleObservation +} + +// An observation that contains a grayscale heat map of important areas across an image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnsaliencyimageobservation?language=objc +type SaliencyImageObservation struct { + PixelBufferObservation +} + +func SaliencyImageObservationFrom(ptr unsafe.Pointer) SaliencyImageObservation { + return SaliencyImageObservation{ + PixelBufferObservation: PixelBufferObservationFrom(ptr), + } +} + +func (sc _SaliencyImageObservationClass) Alloc() SaliencyImageObservation { + rv := objc.Call[SaliencyImageObservation](sc, objc.Sel("alloc")) + return rv +} + +func SaliencyImageObservation_Alloc() SaliencyImageObservation { + return SaliencyImageObservationClass.Alloc() +} + +func (sc _SaliencyImageObservationClass) New() SaliencyImageObservation { + rv := objc.Call[SaliencyImageObservation](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSaliencyImageObservation() SaliencyImageObservation { + return SaliencyImageObservationClass.New() +} + +func (s_ SaliencyImageObservation) Init() SaliencyImageObservation { + rv := objc.Call[SaliencyImageObservation](s_, objc.Sel("init")) + return rv +} + +// A collection of objects describing the distinct areas of the saliency heat map. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnsaliencyimageobservation/3114160-salientobjects?language=objc +func (s_ SaliencyImageObservation) SalientObjects() []RectangleObservation { + rv := objc.Call[[]RectangleObservation](s_, objc.Sel("salientObjects")) + return rv +} diff --git a/macos/vision/sequence_request_handler.gen.go b/macos/vision/sequence_request_handler.gen.go new file mode 100644 index 00000000..5d7aec1a --- /dev/null +++ b/macos/vision/sequence_request_handler.gen.go @@ -0,0 +1,69 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [SequenceRequestHandler] class. +var SequenceRequestHandlerClass = _SequenceRequestHandlerClass{objc.GetClass("VNSequenceRequestHandler")} + +type _SequenceRequestHandlerClass struct { + objc.Class +} + +// An interface definition for the [SequenceRequestHandler] class. +type ISequenceRequestHandler interface { + objc.IObject + PerformRequestsOnCMSampleBufferError(requests []IRequest, sampleBuffer coremedia.SampleBufferRef, error foundation.IError) bool +} + +// An object that processes image analysis requests for each frame in a sequence. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnsequencerequesthandler?language=objc +type SequenceRequestHandler struct { + objc.Object +} + +func SequenceRequestHandlerFrom(ptr unsafe.Pointer) SequenceRequestHandler { + return SequenceRequestHandler{ + Object: objc.ObjectFrom(ptr), + } +} + +func (s_ SequenceRequestHandler) Init() SequenceRequestHandler { + rv := objc.Call[SequenceRequestHandler](s_, objc.Sel("init")) + return rv +} + +func (sc _SequenceRequestHandlerClass) Alloc() SequenceRequestHandler { + rv := objc.Call[SequenceRequestHandler](sc, objc.Sel("alloc")) + return rv +} + +func SequenceRequestHandler_Alloc() SequenceRequestHandler { + return SequenceRequestHandlerClass.Alloc() +} + +func (sc _SequenceRequestHandlerClass) New() SequenceRequestHandler { + rv := objc.Call[SequenceRequestHandler](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewSequenceRequestHandler() SequenceRequestHandler { + return SequenceRequestHandlerClass.New() +} + +// Performs one or more requests on an image contained within a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnsequencerequesthandler/3571272-performrequests?language=objc +func (s_ SequenceRequestHandler) PerformRequestsOnCMSampleBufferError(requests []IRequest, sampleBuffer coremedia.SampleBufferRef, error foundation.IError) bool { + rv := objc.Call[bool](s_, objc.Sel("performRequests:onCMSampleBuffer:error:"), requests, sampleBuffer, objc.Ptr(error)) + return rv +} diff --git a/macos/vision/stateful_request.gen.go b/macos/vision/stateful_request.gen.go new file mode 100644 index 00000000..d9746076 --- /dev/null +++ b/macos/vision/stateful_request.gen.go @@ -0,0 +1,105 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [StatefulRequest] class. +var StatefulRequestClass = _StatefulRequestClass{objc.GetClass("VNStatefulRequest")} + +type _StatefulRequestClass struct { + objc.Class +} + +// An interface definition for the [StatefulRequest] class. +type IStatefulRequest interface { + IImageBasedRequest + MinimumLatencyFrameCount() int + FrameAnalysisSpacing() coremedia.Time +} + +// An abstract request type that builds evidence of a condition over time. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnstatefulrequest?language=objc +type StatefulRequest struct { + ImageBasedRequest +} + +func StatefulRequestFrom(ptr unsafe.Pointer) StatefulRequest { + return StatefulRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (s_ StatefulRequest) InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing coremedia.Time, completionHandler RequestCompletionHandler) StatefulRequest { + rv := objc.Call[StatefulRequest](s_, objc.Sel("initWithFrameAnalysisSpacing:completionHandler:"), frameAnalysisSpacing, completionHandler) + return rv +} + +// Initializes a video-based request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnstatefulrequest/3564828-initwithframeanalysisspacing?language=objc +func NewStatefulRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing coremedia.Time, completionHandler RequestCompletionHandler) StatefulRequest { + instance := StatefulRequestClass.Alloc().InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing, completionHandler) + instance.Autorelease() + return instance +} + +func (sc _StatefulRequestClass) Alloc() StatefulRequest { + rv := objc.Call[StatefulRequest](sc, objc.Sel("alloc")) + return rv +} + +func StatefulRequest_Alloc() StatefulRequest { + return StatefulRequestClass.Alloc() +} + +func (sc _StatefulRequestClass) New() StatefulRequest { + rv := objc.Call[StatefulRequest](sc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewStatefulRequest() StatefulRequest { + return StatefulRequestClass.New() +} + +func (s_ StatefulRequest) Init() StatefulRequest { + rv := objc.Call[StatefulRequest](s_, objc.Sel("init")) + return rv +} + +func (s_ StatefulRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) StatefulRequest { + rv := objc.Call[StatefulRequest](s_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewStatefulRequestWithCompletionHandler(completionHandler RequestCompletionHandler) StatefulRequest { + instance := StatefulRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// The minimum number of frames a request processes before reporting an observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnstatefulrequest/3564829-minimumlatencyframecount?language=objc +func (s_ StatefulRequest) MinimumLatencyFrameCount() int { + rv := objc.Call[int](s_, objc.Sel("minimumLatencyFrameCount")) + return rv +} + +// A time value that indicates the interval between analysis operations. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnstatefulrequest/3675676-frameanalysisspacing?language=objc +func (s_ StatefulRequest) FrameAnalysisSpacing() coremedia.Time { + rv := objc.Call[coremedia.Time](s_, objc.Sel("frameAnalysisSpacing")) + return rv +} diff --git a/macos/vision/targeted_image_request.gen.go b/macos/vision/targeted_image_request.gen.go new file mode 100644 index 00000000..b2bed667 --- /dev/null +++ b/macos/vision/targeted_image_request.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TargetedImageRequest] class. +var TargetedImageRequestClass = _TargetedImageRequestClass{objc.GetClass("VNTargetedImageRequest")} + +type _TargetedImageRequestClass struct { + objc.Class +} + +// An interface definition for the [TargetedImageRequest] class. +type ITargetedImageRequest interface { + IImageBasedRequest +} + +// The abstract superclass for image analysis requests that operate on both the processed image and a secondary image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest?language=objc +type TargetedImageRequest struct { + ImageBasedRequest +} + +func TargetedImageRequestFrom(ptr unsafe.Pointer) TargetedImageRequest { + return TargetedImageRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (t_ TargetedImageRequest) InitWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("initWithTargetedImageURL:options:"), objc.Ptr(imageURL), options) + return rv +} + +// Creates a new request targeting an image at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923458-initwithtargetedimageurl?language=objc +func NewTargetedImageRequestWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) TargetedImageRequest { + instance := TargetedImageRequestClass.Alloc().InitWithTargetedImageURLOptions(imageURL, options) + instance.Autorelease() + return instance +} + +func (t_ TargetedImageRequest) InitWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("initWithTargetedCMSampleBuffer:options:"), sampleBuffer, options) + return rv +} + +// Creates a new request that targets an image in a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/3571274-initwithtargetedcmsamplebuffer?language=objc +func NewTargetedImageRequestWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) TargetedImageRequest { + instance := TargetedImageRequestClass.Alloc().InitWithTargetedCMSampleBufferOptions(sampleBuffer, options) + instance.Autorelease() + return instance +} + +func (t_ TargetedImageRequest) InitWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("initWithTargetedCIImage:options:"), objc.Ptr(ciImage), options) + return rv +} + +// Creates a new request targeting a CIImage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923447-initwithtargetedciimage?language=objc +func NewTargetedImageRequestWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) TargetedImageRequest { + instance := TargetedImageRequestClass.Alloc().InitWithTargetedCIImageOptions(ciImage, options) + instance.Autorelease() + return instance +} + +func (t_ TargetedImageRequest) InitWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("initWithTargetedCVPixelBuffer:options:"), pixelBuffer, options) + return rv +} + +// Creates a new request targeting an image in a CVPixelBufferRef. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923445-initwithtargetedcvpixelbuffer?language=objc +func NewTargetedImageRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) TargetedImageRequest { + instance := TargetedImageRequestClass.Alloc().InitWithTargetedCVPixelBufferOptions(pixelBuffer, options) + instance.Autorelease() + return instance +} + +func (t_ TargetedImageRequest) InitWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("initWithTargetedCGImage:options:"), cgImage, options) + return rv +} + +// Creates a new request targeting a Core Graphics image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923452-initwithtargetedcgimage?language=objc +func NewTargetedImageRequestWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) TargetedImageRequest { + instance := TargetedImageRequestClass.Alloc().InitWithTargetedCGImageOptions(cgImage, options) + instance.Autorelease() + return instance +} + +func (t_ TargetedImageRequest) InitWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("initWithTargetedImageData:options:"), imageData, options) + return rv +} + +// Creates a new request targeting an image as raw data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923460-initwithtargetedimagedata?language=objc +func NewTargetedImageRequestWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) TargetedImageRequest { + instance := TargetedImageRequestClass.Alloc().InitWithTargetedImageDataOptions(imageData, options) + instance.Autorelease() + return instance +} + +func (tc _TargetedImageRequestClass) Alloc() TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](tc, objc.Sel("alloc")) + return rv +} + +func TargetedImageRequest_Alloc() TargetedImageRequest { + return TargetedImageRequestClass.Alloc() +} + +func (tc _TargetedImageRequestClass) New() TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTargetedImageRequest() TargetedImageRequest { + return TargetedImageRequestClass.New() +} + +func (t_ TargetedImageRequest) Init() TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("init")) + return rv +} + +func (t_ TargetedImageRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) TargetedImageRequest { + rv := objc.Call[TargetedImageRequest](t_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewTargetedImageRequestWithCompletionHandler(completionHandler RequestCompletionHandler) TargetedImageRequest { + instance := TargetedImageRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/text_observation.gen.go b/macos/vision/text_observation.gen.go new file mode 100644 index 00000000..3652c7ed --- /dev/null +++ b/macos/vision/text_observation.gen.go @@ -0,0 +1,92 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TextObservation] class. +var TextObservationClass = _TextObservationClass{objc.GetClass("VNTextObservation")} + +type _TextObservationClass struct { + objc.Class +} + +// An interface definition for the [TextObservation] class. +type ITextObservation interface { + IRectangleObservation + CharacterBoxes() []RectangleObservation +} + +// Information about regions of text that an image analysis request detects. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntextobservation?language=objc +type TextObservation struct { + RectangleObservation +} + +func TextObservationFrom(ptr unsafe.Pointer) TextObservation { + return TextObservation{ + RectangleObservation: RectangleObservationFrom(ptr), + } +} + +func (tc _TextObservationClass) Alloc() TextObservation { + rv := objc.Call[TextObservation](tc, objc.Sel("alloc")) + return rv +} + +func TextObservation_Alloc() TextObservation { + return TextObservationClass.Alloc() +} + +func (tc _TextObservationClass) New() TextObservation { + rv := objc.Call[TextObservation](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTextObservation() TextObservation { + return TextObservationClass.New() +} + +func (t_ TextObservation) Init() TextObservation { + rv := objc.Call[TextObservation](t_, objc.Sel("init")) + return rv +} + +func (tc _TextObservationClass) ObservationWithBoundingBox(boundingBox coregraphics.Rect) TextObservation { + rv := objc.Call[TextObservation](tc, objc.Sel("observationWithBoundingBox:"), boundingBox) + return rv +} + +// Creates an observation with a bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2879297-observationwithboundingbox?language=objc +func TextObservation_ObservationWithBoundingBox(boundingBox coregraphics.Rect) TextObservation { + return TextObservationClass.ObservationWithBoundingBox(boundingBox) +} + +func (tc _TextObservationClass) ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) TextObservation { + rv := objc.Call[TextObservation](tc, objc.Sel("observationWithRequestRevision:boundingBox:"), requestRevision, boundingBox) + return rv +} + +// Creates an observation with a revision number and bounding box. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/2967105-observationwithrequestrevision?language=objc +func TextObservation_ObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox coregraphics.Rect) TextObservation { + return TextObservationClass.ObservationWithRequestRevisionBoundingBox(requestRevision, boundingBox) +} + +// An array of detected individual character bounding boxes. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntextobservation/2867213-characterboxes?language=objc +func (t_ TextObservation) CharacterBoxes() []RectangleObservation { + rv := objc.Call[[]RectangleObservation](t_, objc.Sel("characterBoxes")) + return rv +} diff --git a/macos/vision/track_object_request.gen.go b/macos/vision/track_object_request.gen.go new file mode 100644 index 00000000..49f8a29f --- /dev/null +++ b/macos/vision/track_object_request.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TrackObjectRequest] class. +var TrackObjectRequestClass = _TrackObjectRequestClass{objc.GetClass("VNTrackObjectRequest")} + +type _TrackObjectRequestClass struct { + objc.Class +} + +// An interface definition for the [TrackObjectRequest] class. +type ITrackObjectRequest interface { + ITrackingRequest +} + +// An image analysis request that tracks the movement of a previously identified object across multiple images or video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackobjectrequest?language=objc +type TrackObjectRequest struct { + TrackingRequest +} + +func TrackObjectRequestFrom(ptr unsafe.Pointer) TrackObjectRequest { + return TrackObjectRequest{ + TrackingRequest: TrackingRequestFrom(ptr), + } +} + +func (t_ TrackObjectRequest) InitWithDetectedObjectObservation(observation IDetectedObjectObservation) TrackObjectRequest { + rv := objc.Call[TrackObjectRequest](t_, objc.Sel("initWithDetectedObjectObservation:"), objc.Ptr(observation)) + return rv +} + +// Creates a new object tracking request with a detected object observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackobjectrequest/2887297-initwithdetectedobjectobservatio?language=objc +func NewTrackObjectRequestWithDetectedObjectObservation(observation IDetectedObjectObservation) TrackObjectRequest { + instance := TrackObjectRequestClass.Alloc().InitWithDetectedObjectObservation(observation) + instance.Autorelease() + return instance +} + +func (tc _TrackObjectRequestClass) Alloc() TrackObjectRequest { + rv := objc.Call[TrackObjectRequest](tc, objc.Sel("alloc")) + return rv +} + +func TrackObjectRequest_Alloc() TrackObjectRequest { + return TrackObjectRequestClass.Alloc() +} + +func (tc _TrackObjectRequestClass) New() TrackObjectRequest { + rv := objc.Call[TrackObjectRequest](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTrackObjectRequest() TrackObjectRequest { + return TrackObjectRequestClass.New() +} + +func (t_ TrackObjectRequest) Init() TrackObjectRequest { + rv := objc.Call[TrackObjectRequest](t_, objc.Sel("init")) + return rv +} + +func (t_ TrackObjectRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) TrackObjectRequest { + rv := objc.Call[TrackObjectRequest](t_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewTrackObjectRequestWithCompletionHandler(completionHandler RequestCompletionHandler) TrackObjectRequest { + instance := TrackObjectRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/track_rectangle_request.gen.go b/macos/vision/track_rectangle_request.gen.go new file mode 100644 index 00000000..5ba1302a --- /dev/null +++ b/macos/vision/track_rectangle_request.gen.go @@ -0,0 +1,86 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TrackRectangleRequest] class. +var TrackRectangleRequestClass = _TrackRectangleRequestClass{objc.GetClass("VNTrackRectangleRequest")} + +type _TrackRectangleRequestClass struct { + objc.Class +} + +// An interface definition for the [TrackRectangleRequest] class. +type ITrackRectangleRequest interface { + ITrackingRequest +} + +// An image analysis request that tracks movement of a previously identified rectangular object across multiple images or video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackrectanglerequest?language=objc +type TrackRectangleRequest struct { + TrackingRequest +} + +func TrackRectangleRequestFrom(ptr unsafe.Pointer) TrackRectangleRequest { + return TrackRectangleRequest{ + TrackingRequest: TrackingRequestFrom(ptr), + } +} + +func (t_ TrackRectangleRequest) InitWithRectangleObservation(observation IRectangleObservation) TrackRectangleRequest { + rv := objc.Call[TrackRectangleRequest](t_, objc.Sel("initWithRectangleObservation:"), objc.Ptr(observation)) + return rv +} + +// Creates a new rectangle tracking request with a rectangle observation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackrectanglerequest/2887361-initwithrectangleobservation?language=objc +func NewTrackRectangleRequestWithRectangleObservation(observation IRectangleObservation) TrackRectangleRequest { + instance := TrackRectangleRequestClass.Alloc().InitWithRectangleObservation(observation) + instance.Autorelease() + return instance +} + +func (tc _TrackRectangleRequestClass) Alloc() TrackRectangleRequest { + rv := objc.Call[TrackRectangleRequest](tc, objc.Sel("alloc")) + return rv +} + +func TrackRectangleRequest_Alloc() TrackRectangleRequest { + return TrackRectangleRequestClass.Alloc() +} + +func (tc _TrackRectangleRequestClass) New() TrackRectangleRequest { + rv := objc.Call[TrackRectangleRequest](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTrackRectangleRequest() TrackRectangleRequest { + return TrackRectangleRequestClass.New() +} + +func (t_ TrackRectangleRequest) Init() TrackRectangleRequest { + rv := objc.Call[TrackRectangleRequest](t_, objc.Sel("init")) + return rv +} + +func (t_ TrackRectangleRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) TrackRectangleRequest { + rv := objc.Call[TrackRectangleRequest](t_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewTrackRectangleRequestWithCompletionHandler(completionHandler RequestCompletionHandler) TrackRectangleRequest { + instance := TrackRectangleRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/tracking_request.gen.go b/macos/vision/tracking_request.gen.go new file mode 100644 index 00000000..c15be233 --- /dev/null +++ b/macos/vision/tracking_request.gen.go @@ -0,0 +1,123 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TrackingRequest] class. +var TrackingRequestClass = _TrackingRequestClass{objc.GetClass("VNTrackingRequest")} + +type _TrackingRequestClass struct { + objc.Class +} + +// An interface definition for the [TrackingRequest] class. +type ITrackingRequest interface { + IImageBasedRequest + IsLastFrame() bool + SetLastFrame(value bool) + InputObservation() DetectedObjectObservation + SetInputObservation(value IDetectedObjectObservation) + TrackingLevel() RequestTrackingLevel + SetTrackingLevel(value RequestTrackingLevel) +} + +// The abstract superclass for image analysis requests that track unique features across multiple images or video frames. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackingrequest?language=objc +type TrackingRequest struct { + ImageBasedRequest +} + +func TrackingRequestFrom(ptr unsafe.Pointer) TrackingRequest { + return TrackingRequest{ + ImageBasedRequest: ImageBasedRequestFrom(ptr), + } +} + +func (tc _TrackingRequestClass) Alloc() TrackingRequest { + rv := objc.Call[TrackingRequest](tc, objc.Sel("alloc")) + return rv +} + +func TrackingRequest_Alloc() TrackingRequest { + return TrackingRequestClass.Alloc() +} + +func (tc _TrackingRequestClass) New() TrackingRequest { + rv := objc.Call[TrackingRequest](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTrackingRequest() TrackingRequest { + return TrackingRequestClass.New() +} + +func (t_ TrackingRequest) Init() TrackingRequest { + rv := objc.Call[TrackingRequest](t_, objc.Sel("init")) + return rv +} + +func (t_ TrackingRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) TrackingRequest { + rv := objc.Call[TrackingRequest](t_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewTrackingRequestWithCompletionHandler(completionHandler RequestCompletionHandler) TrackingRequest { + instance := TrackingRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} + +// A Boolean that indicates the last frame in a tracking sequence. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackingrequest/2887356-lastframe?language=objc +func (t_ TrackingRequest) IsLastFrame() bool { + rv := objc.Call[bool](t_, objc.Sel("isLastFrame")) + return rv +} + +// A Boolean that indicates the last frame in a tracking sequence. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackingrequest/2887356-lastframe?language=objc +func (t_ TrackingRequest) SetLastFrame(value bool) { + objc.Call[objc.Void](t_, objc.Sel("setLastFrame:"), value) +} + +// The observation object defining a region to track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackingrequest/2887350-inputobservation?language=objc +func (t_ TrackingRequest) InputObservation() DetectedObjectObservation { + rv := objc.Call[DetectedObjectObservation](t_, objc.Sel("inputObservation")) + return rv +} + +// The observation object defining a region to track. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackingrequest/2887350-inputobservation?language=objc +func (t_ TrackingRequest) SetInputObservation(value IDetectedObjectObservation) { + objc.Call[objc.Void](t_, objc.Sel("setInputObservation:"), objc.Ptr(value)) +} + +// A value for specifying whether to prioritize speed or location accuracy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackingrequest/2887353-trackinglevel?language=objc +func (t_ TrackingRequest) TrackingLevel() RequestTrackingLevel { + rv := objc.Call[RequestTrackingLevel](t_, objc.Sel("trackingLevel")) + return rv +} + +// A value for specifying whether to prioritize speed or location accuracy. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrackingrequest/2887353-trackinglevel?language=objc +func (t_ TrackingRequest) SetTrackingLevel(value RequestTrackingLevel) { + objc.Call[objc.Void](t_, objc.Sel("setTrackingLevel:"), value) +} diff --git a/macos/vision/trajectory_observation.gen.go b/macos/vision/trajectory_observation.gen.go new file mode 100644 index 00000000..8eadab72 --- /dev/null +++ b/macos/vision/trajectory_observation.gen.go @@ -0,0 +1,94 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TrajectoryObservation] class. +var TrajectoryObservationClass = _TrajectoryObservationClass{objc.GetClass("VNTrajectoryObservation")} + +type _TrajectoryObservationClass struct { + objc.Class +} + +// An interface definition for the [TrajectoryObservation] class. +type ITrajectoryObservation interface { + IObservation + MovingAverageRadius() float64 + DetectedPoints() []Point + ProjectedPoints() []Point + EquationCoefficients() objc.Object +} + +// An observation that describes a detected trajectory. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrajectoryobservation?language=objc +type TrajectoryObservation struct { + Observation +} + +func TrajectoryObservationFrom(ptr unsafe.Pointer) TrajectoryObservation { + return TrajectoryObservation{ + Observation: ObservationFrom(ptr), + } +} + +func (tc _TrajectoryObservationClass) Alloc() TrajectoryObservation { + rv := objc.Call[TrajectoryObservation](tc, objc.Sel("alloc")) + return rv +} + +func TrajectoryObservation_Alloc() TrajectoryObservation { + return TrajectoryObservationClass.Alloc() +} + +func (tc _TrajectoryObservationClass) New() TrajectoryObservation { + rv := objc.Call[TrajectoryObservation](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTrajectoryObservation() TrajectoryObservation { + return TrajectoryObservationClass.New() +} + +func (t_ TrajectoryObservation) Init() TrajectoryObservation { + rv := objc.Call[TrajectoryObservation](t_, objc.Sel("init")) + return rv +} + +// The moving average radius of the object the request is tracking. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrajectoryobservation/3751001-movingaverageradius?language=objc +func (t_ TrajectoryObservation) MovingAverageRadius() float64 { + rv := objc.Call[float64](t_, objc.Sel("movingAverageRadius")) + return rv +} + +// The centroid points of the detected contour along the trajectory. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrajectoryobservation/3564824-detectedpoints?language=objc +func (t_ TrajectoryObservation) DetectedPoints() []Point { + rv := objc.Call[[]Point](t_, objc.Sel("detectedPoints")) + return rv +} + +// The centroids of the calculated trajectory from the detected points. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrajectoryobservation/3564826-projectedpoints?language=objc +func (t_ TrajectoryObservation) ProjectedPoints() []Point { + rv := objc.Call[[]Point](t_, objc.Sel("projectedPoints")) + return rv +} + +// The coefficients of the parabolic equation. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntrajectoryobservation/3564825-equationcoefficients?language=objc +func (t_ TrajectoryObservation) EquationCoefficients() objc.Object { + rv := objc.Call[objc.Object](t_, objc.Sel("equationCoefficients")) + return rv +} diff --git a/macos/vision/translational_image_registration_request.gen.go b/macos/vision/translational_image_registration_request.gen.go new file mode 100644 index 00000000..7629d55c --- /dev/null +++ b/macos/vision/translational_image_registration_request.gen.go @@ -0,0 +1,161 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coregraphics" + "github.com/progrium/macdriver/macos/coreimage" + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/corevideo" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [TranslationalImageRegistrationRequest] class. +var TranslationalImageRegistrationRequestClass = _TranslationalImageRegistrationRequestClass{objc.GetClass("VNTranslationalImageRegistrationRequest")} + +type _TranslationalImageRegistrationRequestClass struct { + objc.Class +} + +// An interface definition for the [TranslationalImageRegistrationRequest] class. +type ITranslationalImageRegistrationRequest interface { + IImageRegistrationRequest +} + +// An image analysis request that determines the affine transform necessary to align the content of two images. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntranslationalimageregistrationrequest?language=objc +type TranslationalImageRegistrationRequest struct { + ImageRegistrationRequest +} + +func TranslationalImageRegistrationRequestFrom(ptr unsafe.Pointer) TranslationalImageRegistrationRequest { + return TranslationalImageRegistrationRequest{ + ImageRegistrationRequest: ImageRegistrationRequestFrom(ptr), + } +} + +func (tc _TranslationalImageRegistrationRequestClass) Alloc() TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](tc, objc.Sel("alloc")) + return rv +} + +func TranslationalImageRegistrationRequest_Alloc() TranslationalImageRegistrationRequest { + return TranslationalImageRegistrationRequestClass.Alloc() +} + +func (tc _TranslationalImageRegistrationRequestClass) New() TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](tc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewTranslationalImageRegistrationRequest() TranslationalImageRegistrationRequest { + return TranslationalImageRegistrationRequestClass.New() +} + +func (t_ TranslationalImageRegistrationRequest) Init() TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("init")) + return rv +} + +func (t_ TranslationalImageRegistrationRequest) InitWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("initWithTargetedImageURL:options:"), objc.Ptr(imageURL), options) + return rv +} + +// Creates a new request targeting an image at the specified URL. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923458-initwithtargetedimageurl?language=objc +func NewTranslationalImageRegistrationRequestWithTargetedImageURLOptions(imageURL foundation.IURL, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + instance := TranslationalImageRegistrationRequestClass.Alloc().InitWithTargetedImageURLOptions(imageURL, options) + instance.Autorelease() + return instance +} + +func (t_ TranslationalImageRegistrationRequest) InitWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("initWithTargetedCMSampleBuffer:options:"), sampleBuffer, options) + return rv +} + +// Creates a new request that targets an image in a sample buffer. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/3571274-initwithtargetedcmsamplebuffer?language=objc +func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOptions(sampleBuffer coremedia.SampleBufferRef, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + instance := TranslationalImageRegistrationRequestClass.Alloc().InitWithTargetedCMSampleBufferOptions(sampleBuffer, options) + instance.Autorelease() + return instance +} + +func (t_ TranslationalImageRegistrationRequest) InitWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("initWithTargetedCIImage:options:"), objc.Ptr(ciImage), options) + return rv +} + +// Creates a new request targeting a CIImage. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923447-initwithtargetedciimage?language=objc +func NewTranslationalImageRegistrationRequestWithTargetedCIImageOptions(ciImage coreimage.IImage, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + instance := TranslationalImageRegistrationRequestClass.Alloc().InitWithTargetedCIImageOptions(ciImage, options) + instance.Autorelease() + return instance +} + +func (t_ TranslationalImageRegistrationRequest) InitWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("initWithTargetedCVPixelBuffer:options:"), pixelBuffer, options) + return rv +} + +// Creates a new request targeting an image in a CVPixelBufferRef. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923445-initwithtargetedcvpixelbuffer?language=objc +func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.PixelBufferRef, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + instance := TranslationalImageRegistrationRequestClass.Alloc().InitWithTargetedCVPixelBufferOptions(pixelBuffer, options) + instance.Autorelease() + return instance +} + +func (t_ TranslationalImageRegistrationRequest) InitWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("initWithTargetedCGImage:options:"), cgImage, options) + return rv +} + +// Creates a new request targeting a Core Graphics image. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923452-initwithtargetedcgimage?language=objc +func NewTranslationalImageRegistrationRequestWithTargetedCGImageOptions(cgImage coregraphics.ImageRef, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + instance := TranslationalImageRegistrationRequestClass.Alloc().InitWithTargetedCGImageOptions(cgImage, options) + instance.Autorelease() + return instance +} + +func (t_ TranslationalImageRegistrationRequest) InitWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("initWithTargetedImageData:options:"), imageData, options) + return rv +} + +// Creates a new request targeting an image as raw data. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vntargetedimagerequest/2923460-initwithtargetedimagedata?language=objc +func NewTranslationalImageRegistrationRequestWithTargetedImageDataOptions(imageData []byte, options map[ImageOption]objc.IObject) TranslationalImageRegistrationRequest { + instance := TranslationalImageRegistrationRequestClass.Alloc().InitWithTargetedImageDataOptions(imageData, options) + instance.Autorelease() + return instance +} + +func (t_ TranslationalImageRegistrationRequest) InitWithCompletionHandler(completionHandler RequestCompletionHandler) TranslationalImageRegistrationRequest { + rv := objc.Call[TranslationalImageRegistrationRequest](t_, objc.Sel("initWithCompletionHandler:"), completionHandler) + return rv +} + +// Creates a new Vision request with an optional completion handler. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnrequest/2875416-initwithcompletionhandler?language=objc +func NewTranslationalImageRegistrationRequestWithCompletionHandler(completionHandler RequestCompletionHandler) TranslationalImageRegistrationRequest { + instance := TranslationalImageRegistrationRequestClass.Alloc().InitWithCompletionHandler(completionHandler) + instance.Autorelease() + return instance +} diff --git a/macos/vision/vector.gen.go b/macos/vision/vector.gen.go new file mode 100644 index 00000000..03024c40 --- /dev/null +++ b/macos/vision/vector.gen.go @@ -0,0 +1,244 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [Vector] class. +var VectorClass = _VectorClass{objc.GetClass("VNVector")} + +type _VectorClass struct { + objc.Class +} + +// An interface definition for the [Vector] class. +type IVector interface { + objc.IObject + X() float64 + Y() float64 + R() float64 + Length() float64 + Theta() float64 + SquaredLength() float64 +} + +// An immutable, two-dimensional vector represented by its x-axis and y-axis projections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector?language=objc +type Vector struct { + objc.Object +} + +func VectorFrom(ptr unsafe.Pointer) Vector { + return Vector{ + Object: objc.ObjectFrom(ptr), + } +} + +func (v_ Vector) InitWithRTheta(r float64, theta float64) Vector { + rv := objc.Call[Vector](v_, objc.Sel("initWithR:theta:"), r, theta) + return rv +} + +// Creates a new vector in polar coordinate space. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548339-initwithr?language=objc +func NewVectorWithRTheta(r float64, theta float64) Vector { + instance := VectorClass.Alloc().InitWithRTheta(r, theta) + instance.Autorelease() + return instance +} + +func (v_ Vector) InitWithXComponentYComponent(x float64, y float64) Vector { + rv := objc.Call[Vector](v_, objc.Sel("initWithXComponent:yComponent:"), x, y) + return rv +} + +// Creates a new vector in Cartesian coordinate space, based on its x-axis and y-axis projections. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548341-initwithxcomponent?language=objc +func NewVectorWithXComponentYComponent(x float64, y float64) Vector { + instance := VectorClass.Alloc().InitWithXComponentYComponent(x, y) + instance.Autorelease() + return instance +} + +func (v_ Vector) InitWithVectorHeadTail(head IPoint, tail IPoint) Vector { + rv := objc.Call[Vector](v_, objc.Sel("initWithVectorHead:tail:"), objc.Ptr(head), objc.Ptr(tail)) + return rv +} + +// Creates a new vector in Cartesian coordinate space. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548340-initwithvectorhead?language=objc +func NewVectorWithVectorHeadTail(head IPoint, tail IPoint) Vector { + instance := VectorClass.Alloc().InitWithVectorHeadTail(head, tail) + instance.Autorelease() + return instance +} + +func (vc _VectorClass) Alloc() Vector { + rv := objc.Call[Vector](vc, objc.Sel("alloc")) + return rv +} + +func Vector_Alloc() Vector { + return VectorClass.Alloc() +} + +func (vc _VectorClass) New() Vector { + rv := objc.Call[Vector](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVector() Vector { + return VectorClass.New() +} + +func (v_ Vector) Init() Vector { + rv := objc.Call[Vector](v_, objc.Sel("init")) + return rv +} + +// Creates a new vector by subtracting the first vector from the second vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548349-vectorbysubtractingvector?language=objc +func (vc _VectorClass) VectorBySubtractingVectorFromVector(v1 IVector, v2 IVector) Vector { + rv := objc.Call[Vector](vc, objc.Sel("vectorBySubtractingVector:fromVector:"), objc.Ptr(v1), objc.Ptr(v2)) + return rv +} + +// Creates a new vector by subtracting the first vector from the second vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548349-vectorbysubtractingvector?language=objc +func Vector_VectorBySubtractingVectorFromVector(v1 IVector, v2 IVector) Vector { + return VectorClass.VectorBySubtractingVectorFromVector(v1, v2) +} + +// Caclulates the dot product of two vectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548338-dotproductofvector?language=objc +func (vc _VectorClass) DotProductOfVectorVector(v1 IVector, v2 IVector) float64 { + rv := objc.Call[float64](vc, objc.Sel("dotProductOfVector:vector:"), objc.Ptr(v1), objc.Ptr(v2)) + return rv +} + +// Caclulates the dot product of two vectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548338-dotproductofvector?language=objc +func Vector_DotProductOfVectorVector(v1 IVector, v2 IVector) float64 { + return VectorClass.DotProductOfVectorVector(v1, v2) +} + +// Calculates a vector that’s normalized by preserving its direction, so that the vector length equals 1.0. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548346-unitvectorforvector?language=objc +func (vc _VectorClass) UnitVectorForVector(vector IVector) Vector { + rv := objc.Call[Vector](vc, objc.Sel("unitVectorForVector:"), objc.Ptr(vector)) + return rv +} + +// Calculates a vector that’s normalized by preserving its direction, so that the vector length equals 1.0. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548346-unitvectorforvector?language=objc +func Vector_UnitVectorForVector(vector IVector) Vector { + return VectorClass.UnitVectorForVector(vector) +} + +// Creates a new vector by adding the specified vectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548347-vectorbyaddingvector?language=objc +func (vc _VectorClass) VectorByAddingVectorToVector(v1 IVector, v2 IVector) Vector { + rv := objc.Call[Vector](vc, objc.Sel("vectorByAddingVector:toVector:"), objc.Ptr(v1), objc.Ptr(v2)) + return rv +} + +// Creates a new vector by adding the specified vectors. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548347-vectorbyaddingvector?language=objc +func Vector_VectorByAddingVectorToVector(v1 IVector, v2 IVector) Vector { + return VectorClass.VectorByAddingVectorToVector(v1, v2) +} + +// Creates a new vector by multiplying the specified vector’s x-axis and y-axis projections by the scalar value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548348-vectorbymultiplyingvector?language=objc +func (vc _VectorClass) VectorByMultiplyingVectorByScalar(vector IVector, scalar float64) Vector { + rv := objc.Call[Vector](vc, objc.Sel("vectorByMultiplyingVector:byScalar:"), objc.Ptr(vector), scalar) + return rv +} + +// Creates a new vector by multiplying the specified vector’s x-axis and y-axis projections by the scalar value. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548348-vectorbymultiplyingvector?language=objc +func Vector_VectorByMultiplyingVectorByScalar(vector IVector, scalar float64) Vector { + return VectorClass.VectorByMultiplyingVectorByScalar(vector, scalar) +} + +// A signed projection that indicates the vector’s direction on the x-axis. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548350-x?language=objc +func (v_ Vector) X() float64 { + rv := objc.Call[float64](v_, objc.Sel("x")) + return rv +} + +// A signed projection that indicates the vector’s direction on the y-axis. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548351-y?language=objc +func (v_ Vector) Y() float64 { + rv := objc.Call[float64](v_, objc.Sel("y")) + return rv +} + +// A vector object with zero length. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548352-zerovector?language=objc +func (vc _VectorClass) ZeroVector() Vector { + rv := objc.Call[Vector](vc, objc.Sel("zeroVector")) + return rv +} + +// A vector object with zero length. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548352-zerovector?language=objc +func Vector_ZeroVector() Vector { + return VectorClass.ZeroVector() +} + +// The radius, absolute value, or length of the vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548343-r?language=objc +func (v_ Vector) R() float64 { + rv := objc.Call[float64](v_, objc.Sel("r")) + return rv +} + +// The length, or absolute value, of the vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548342-length?language=objc +func (v_ Vector) Length() float64 { + rv := objc.Call[float64](v_, objc.Sel("length")) + return rv +} + +// The angle between the vector direction and the positive direction of the x-axis. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548345-theta?language=objc +func (v_ Vector) Theta() float64 { + rv := objc.Call[float64](v_, objc.Sel("theta")) + return rv +} + +// The squared length of the vector. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvector/3548344-squaredlength?language=objc +func (v_ Vector) SquaredLength() float64 { + rv := objc.Call[float64](v_, objc.Sel("squaredLength")) + return rv +} diff --git a/macos/vision/video_processor.gen.go b/macos/vision/video_processor.gen.go new file mode 100644 index 00000000..4cd841e6 --- /dev/null +++ b/macos/vision/video_processor.gen.go @@ -0,0 +1,109 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/coremedia" + "github.com/progrium/macdriver/macos/foundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoProcessor] class. +var VideoProcessorClass = _VideoProcessorClass{objc.GetClass("VNVideoProcessor")} + +type _VideoProcessorClass struct { + objc.Class +} + +// An interface definition for the [VideoProcessor] class. +type IVideoProcessor interface { + objc.IObject + AddRequestProcessingOptionsError(request IRequest, processingOptions IVideoProcessorRequestProcessingOptions, error foundation.IError) bool + AnalyzeTimeRangeError(timeRange coremedia.TimeRange, error foundation.IError) bool + RemoveRequestError(request IRequest, error foundation.IError) bool + Cancel() +} + +// An object that performs offline analysis of video content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessor?language=objc +type VideoProcessor struct { + objc.Object +} + +func VideoProcessorFrom(ptr unsafe.Pointer) VideoProcessor { + return VideoProcessor{ + Object: objc.ObjectFrom(ptr), + } +} + +func (v_ VideoProcessor) InitWithURL(videoURL foundation.IURL) VideoProcessor { + rv := objc.Call[VideoProcessor](v_, objc.Sel("initWithURL:"), objc.Ptr(videoURL)) + return rv +} + +// Creates a video processor to perform Vision requests against the specified video asset. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessor/3548386-initwithurl?language=objc +func NewVideoProcessorWithURL(videoURL foundation.IURL) VideoProcessor { + instance := VideoProcessorClass.Alloc().InitWithURL(videoURL) + instance.Autorelease() + return instance +} + +func (vc _VideoProcessorClass) Alloc() VideoProcessor { + rv := objc.Call[VideoProcessor](vc, objc.Sel("alloc")) + return rv +} + +func VideoProcessor_Alloc() VideoProcessor { + return VideoProcessorClass.Alloc() +} + +func (vc _VideoProcessorClass) New() VideoProcessor { + rv := objc.Call[VideoProcessor](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoProcessor() VideoProcessor { + return VideoProcessorClass.New() +} + +func (v_ VideoProcessor) Init() VideoProcessor { + rv := objc.Call[VideoProcessor](v_, objc.Sel("init")) + return rv +} + +// Adds a request with processing options to the video processor. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessor/3675677-addrequest?language=objc +func (v_ VideoProcessor) AddRequestProcessingOptionsError(request IRequest, processingOptions IVideoProcessorRequestProcessingOptions, error foundation.IError) bool { + rv := objc.Call[bool](v_, objc.Sel("addRequest:processingOptions:error:"), objc.Ptr(request), objc.Ptr(processingOptions), objc.Ptr(error)) + return rv +} + +// Analyzes a time range of video content. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessor/3675678-analyzetimerange?language=objc +func (v_ VideoProcessor) AnalyzeTimeRangeError(timeRange coremedia.TimeRange, error foundation.IError) bool { + rv := objc.Call[bool](v_, objc.Sel("analyzeTimeRange:error:"), timeRange, objc.Ptr(error)) + return rv +} + +// Removes a Vision request from the video processor’s request queue. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessor/3548387-removerequest?language=objc +func (v_ VideoProcessor) RemoveRequestError(request IRequest, error foundation.IError) bool { + rv := objc.Call[bool](v_, objc.Sel("removeRequest:error:"), objc.Ptr(request), objc.Ptr(error)) + return rv +} + +// Cancels the video processing. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessor/3548385-cancel?language=objc +func (v_ VideoProcessor) Cancel() { + objc.Call[objc.Void](v_, objc.Sel("cancel")) +} diff --git a/macos/vision/video_processor_cadence.gen.go b/macos/vision/video_processor_cadence.gen.go new file mode 100644 index 00000000..eec7d5b4 --- /dev/null +++ b/macos/vision/video_processor_cadence.gen.go @@ -0,0 +1,58 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoProcessorCadence] class. +var VideoProcessorCadenceClass = _VideoProcessorCadenceClass{objc.GetClass("VNVideoProcessorCadence")} + +type _VideoProcessorCadenceClass struct { + objc.Class +} + +// An interface definition for the [VideoProcessorCadence] class. +type IVideoProcessorCadence interface { + objc.IObject +} + +// An object that defines the cadence at which to process video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessorcadence?language=objc +type VideoProcessorCadence struct { + objc.Object +} + +func VideoProcessorCadenceFrom(ptr unsafe.Pointer) VideoProcessorCadence { + return VideoProcessorCadence{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoProcessorCadenceClass) Alloc() VideoProcessorCadence { + rv := objc.Call[VideoProcessorCadence](vc, objc.Sel("alloc")) + return rv +} + +func VideoProcessorCadence_Alloc() VideoProcessorCadence { + return VideoProcessorCadenceClass.Alloc() +} + +func (vc _VideoProcessorCadenceClass) New() VideoProcessorCadence { + rv := objc.Call[VideoProcessorCadence](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoProcessorCadence() VideoProcessorCadence { + return VideoProcessorCadenceClass.New() +} + +func (v_ VideoProcessorCadence) Init() VideoProcessorCadence { + rv := objc.Call[VideoProcessorCadence](v_, objc.Sel("init")) + return rv +} diff --git a/macos/vision/video_processor_frame_rate_cadence.gen.go b/macos/vision/video_processor_frame_rate_cadence.gen.go new file mode 100644 index 00000000..9659382b --- /dev/null +++ b/macos/vision/video_processor_frame_rate_cadence.gen.go @@ -0,0 +1,81 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoProcessorFrameRateCadence] class. +var VideoProcessorFrameRateCadenceClass = _VideoProcessorFrameRateCadenceClass{objc.GetClass("VNVideoProcessorFrameRateCadence")} + +type _VideoProcessorFrameRateCadenceClass struct { + objc.Class +} + +// An interface definition for the [VideoProcessorFrameRateCadence] class. +type IVideoProcessorFrameRateCadence interface { + IVideoProcessorCadence + FrameRate() int +} + +// An object that defines a frame-based cadence for processing a video stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessorframeratecadence?language=objc +type VideoProcessorFrameRateCadence struct { + VideoProcessorCadence +} + +func VideoProcessorFrameRateCadenceFrom(ptr unsafe.Pointer) VideoProcessorFrameRateCadence { + return VideoProcessorFrameRateCadence{ + VideoProcessorCadence: VideoProcessorCadenceFrom(ptr), + } +} + +func (v_ VideoProcessorFrameRateCadence) InitWithFrameRate(frameRate int) VideoProcessorFrameRateCadence { + rv := objc.Call[VideoProcessorFrameRateCadence](v_, objc.Sel("initWithFrameRate:"), frameRate) + return rv +} + +// Creates a new frame-based cadence with a frame rate. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessorframeratecadence/3675682-initwithframerate?language=objc +func NewVideoProcessorFrameRateCadenceWithFrameRate(frameRate int) VideoProcessorFrameRateCadence { + instance := VideoProcessorFrameRateCadenceClass.Alloc().InitWithFrameRate(frameRate) + instance.Autorelease() + return instance +} + +func (vc _VideoProcessorFrameRateCadenceClass) Alloc() VideoProcessorFrameRateCadence { + rv := objc.Call[VideoProcessorFrameRateCadence](vc, objc.Sel("alloc")) + return rv +} + +func VideoProcessorFrameRateCadence_Alloc() VideoProcessorFrameRateCadence { + return VideoProcessorFrameRateCadenceClass.Alloc() +} + +func (vc _VideoProcessorFrameRateCadenceClass) New() VideoProcessorFrameRateCadence { + rv := objc.Call[VideoProcessorFrameRateCadence](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoProcessorFrameRateCadence() VideoProcessorFrameRateCadence { + return VideoProcessorFrameRateCadenceClass.New() +} + +func (v_ VideoProcessorFrameRateCadence) Init() VideoProcessorFrameRateCadence { + rv := objc.Call[VideoProcessorFrameRateCadence](v_, objc.Sel("init")) + return rv +} + +// The frame rate at which to process video. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessorframeratecadence/3675681-framerate?language=objc +func (v_ VideoProcessorFrameRateCadence) FrameRate() int { + rv := objc.Call[int](v_, objc.Sel("frameRate")) + return rv +} diff --git a/macos/vision/video_processor_request_processing_options.gen.go b/macos/vision/video_processor_request_processing_options.gen.go new file mode 100644 index 00000000..ed254f14 --- /dev/null +++ b/macos/vision/video_processor_request_processing_options.gen.go @@ -0,0 +1,75 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoProcessorRequestProcessingOptions] class. +var VideoProcessorRequestProcessingOptionsClass = _VideoProcessorRequestProcessingOptionsClass{objc.GetClass("VNVideoProcessorRequestProcessingOptions")} + +type _VideoProcessorRequestProcessingOptionsClass struct { + objc.Class +} + +// An interface definition for the [VideoProcessorRequestProcessingOptions] class. +type IVideoProcessorRequestProcessingOptions interface { + objc.IObject + Cadence() VideoProcessorCadence + SetCadence(value IVideoProcessorCadence) +} + +// An object that defines a video processor’s configuration options. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessorrequestprocessingoptions?language=objc +type VideoProcessorRequestProcessingOptions struct { + objc.Object +} + +func VideoProcessorRequestProcessingOptionsFrom(ptr unsafe.Pointer) VideoProcessorRequestProcessingOptions { + return VideoProcessorRequestProcessingOptions{ + Object: objc.ObjectFrom(ptr), + } +} + +func (vc _VideoProcessorRequestProcessingOptionsClass) Alloc() VideoProcessorRequestProcessingOptions { + rv := objc.Call[VideoProcessorRequestProcessingOptions](vc, objc.Sel("alloc")) + return rv +} + +func VideoProcessorRequestProcessingOptions_Alloc() VideoProcessorRequestProcessingOptions { + return VideoProcessorRequestProcessingOptionsClass.Alloc() +} + +func (vc _VideoProcessorRequestProcessingOptionsClass) New() VideoProcessorRequestProcessingOptions { + rv := objc.Call[VideoProcessorRequestProcessingOptions](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoProcessorRequestProcessingOptions() VideoProcessorRequestProcessingOptions { + return VideoProcessorRequestProcessingOptionsClass.New() +} + +func (v_ VideoProcessorRequestProcessingOptions) Init() VideoProcessorRequestProcessingOptions { + rv := objc.Call[VideoProcessorRequestProcessingOptions](v_, objc.Sel("init")) + return rv +} + +// The cadence the video processor maintains to process the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessorrequestprocessingoptions/3675684-cadence?language=objc +func (v_ VideoProcessorRequestProcessingOptions) Cadence() VideoProcessorCadence { + rv := objc.Call[VideoProcessorCadence](v_, objc.Sel("cadence")) + return rv +} + +// The cadence the video processor maintains to process the request. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessorrequestprocessingoptions/3675684-cadence?language=objc +func (v_ VideoProcessorRequestProcessingOptions) SetCadence(value IVideoProcessorCadence) { + objc.Call[objc.Void](v_, objc.Sel("setCadence:"), objc.Ptr(value)) +} diff --git a/macos/vision/video_processor_time_interval_cadence.gen.go b/macos/vision/video_processor_time_interval_cadence.gen.go new file mode 100644 index 00000000..96c66fc5 --- /dev/null +++ b/macos/vision/video_processor_time_interval_cadence.gen.go @@ -0,0 +1,82 @@ +// AUTO-GENERATED CODE, DO NOT MODIFY + +package vision + +import ( + "unsafe" + + "github.com/progrium/macdriver/macos/corefoundation" + "github.com/progrium/macdriver/objc" +) + +// The class instance for the [VideoProcessorTimeIntervalCadence] class. +var VideoProcessorTimeIntervalCadenceClass = _VideoProcessorTimeIntervalCadenceClass{objc.GetClass("VNVideoProcessorTimeIntervalCadence")} + +type _VideoProcessorTimeIntervalCadenceClass struct { + objc.Class +} + +// An interface definition for the [VideoProcessorTimeIntervalCadence] class. +type IVideoProcessorTimeIntervalCadence interface { + IVideoProcessorCadence + TimeInterval() corefoundation.TimeInterval +} + +// An object that defines a time-based cadence for processing a video stream. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessortimeintervalcadence?language=objc +type VideoProcessorTimeIntervalCadence struct { + VideoProcessorCadence +} + +func VideoProcessorTimeIntervalCadenceFrom(ptr unsafe.Pointer) VideoProcessorTimeIntervalCadence { + return VideoProcessorTimeIntervalCadence{ + VideoProcessorCadence: VideoProcessorCadenceFrom(ptr), + } +} + +func (v_ VideoProcessorTimeIntervalCadence) InitWithTimeInterval(timeInterval corefoundation.TimeInterval) VideoProcessorTimeIntervalCadence { + rv := objc.Call[VideoProcessorTimeIntervalCadence](v_, objc.Sel("initWithTimeInterval:"), timeInterval) + return rv +} + +// Creates a new time-based cadence with a time interval. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessortimeintervalcadence/3675686-initwithtimeinterval?language=objc +func NewVideoProcessorTimeIntervalCadenceWithTimeInterval(timeInterval corefoundation.TimeInterval) VideoProcessorTimeIntervalCadence { + instance := VideoProcessorTimeIntervalCadenceClass.Alloc().InitWithTimeInterval(timeInterval) + instance.Autorelease() + return instance +} + +func (vc _VideoProcessorTimeIntervalCadenceClass) Alloc() VideoProcessorTimeIntervalCadence { + rv := objc.Call[VideoProcessorTimeIntervalCadence](vc, objc.Sel("alloc")) + return rv +} + +func VideoProcessorTimeIntervalCadence_Alloc() VideoProcessorTimeIntervalCadence { + return VideoProcessorTimeIntervalCadenceClass.Alloc() +} + +func (vc _VideoProcessorTimeIntervalCadenceClass) New() VideoProcessorTimeIntervalCadence { + rv := objc.Call[VideoProcessorTimeIntervalCadence](vc, objc.Sel("new")) + rv.Autorelease() + return rv +} + +func NewVideoProcessorTimeIntervalCadence() VideoProcessorTimeIntervalCadence { + return VideoProcessorTimeIntervalCadenceClass.New() +} + +func (v_ VideoProcessorTimeIntervalCadence) Init() VideoProcessorTimeIntervalCadence { + rv := objc.Call[VideoProcessorTimeIntervalCadence](v_, objc.Sel("init")) + return rv +} + +// The time interval of the cadence. [Full Topic] +// +// [Full Topic]: https://developer.apple.com/documentation/vision/vnvideoprocessortimeintervalcadence/3675687-timeinterval?language=objc +func (v_ VideoProcessorTimeIntervalCadence) TimeInterval() corefoundation.TimeInterval { + rv := objc.Call[corefoundation.TimeInterval](v_, objc.Sel("timeInterval")) + return rv +}