SPB Git

spb/forge Public MIT

Forge — LLM training from scratch in pure C++20 + Metal on Apple Silicon.

C++ 61.2% C 23% Python 7.6% TeX 7.2% CMake 1.1%
49.6 KB · 995 lines cpp
Raw Blame History
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------2//3// MetalFX/MTLFXTemporalScaler.hpp4//5// Copyright 2020-2025 Apple Inc.6//7// Licensed under the Apache License, Version 2.0 (the "License");8// you may not use this file except in compliance with the License.9// You may obtain a copy of the License at10//11//     http://www.apache.org/licenses/LICENSE-2.012//13// Unless required by applicable law or agreed to in writing, software14// distributed under the License is distributed on an "AS IS" BASIS,15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.16// See the License for the specific language governing permissions and17// limitations under the License.18//19//-------------------------------------------------------------------------------------------------------------------------------------------------------------2021#pragma once2223//-------------------------------------------------------------------------------------------------------------------------------------------------------------2425#include "MTLFXDefines.hpp"26#include "MTLFXPrivate.hpp"2728#include "../Metal/Metal.hpp"2930//-------------------------------------------------------------------------------------------------------------------------------------------------------------3132namespace MTL4FX33{34    class TemporalScaler;35}3637namespace MTLFX38{39    class TemporalScalerDescriptor : public NS::Copying< TemporalScalerDescriptor >40    {41    public:42        static class TemporalScalerDescriptor*      alloc();43        class TemporalScalerDescriptor*             init();4445        MTL::PixelFormat                            colorTextureFormat() const;46        void                                        setColorTextureFormat( MTL::PixelFormat format );4748        MTL::PixelFormat                            depthTextureFormat() const;49        void                                        setDepthTextureFormat( MTL::PixelFormat format );5051        MTL::PixelFormat                            motionTextureFormat() const;52        void                                        setMotionTextureFormat( MTL::PixelFormat format );5354        MTL::PixelFormat                            outputTextureFormat() const;55        void                                        setOutputTextureFormat( MTL::PixelFormat format );5657        NS::UInteger                                inputWidth() const;58        void                                        setInputWidth( NS::UInteger width );5960        NS::UInteger                                inputHeight() const;61        void                                        setInputHeight( NS::UInteger height );6263        NS::UInteger                                outputWidth() const;64        void                                        setOutputWidth( NS::UInteger width );6566        NS::UInteger                                outputHeight() const;67        void                                        setOutputHeight( NS::UInteger height );6869        bool                                        isAutoExposureEnabled() const;70        void                                        setAutoExposureEnabled( bool enabled );7172        bool                                        isInputContentPropertiesEnabled() const;73        void                                        setInputContentPropertiesEnabled( bool enabled );7475        bool                                        requiresSynchronousInitialization() const;76        void                                        setRequiresSynchronousInitialization(bool requiresSynchronousInitialization);7778        bool                                        isReactiveMaskTextureEnabled() const;79        void                                        setReactiveMaskTextureEnabled( bool enabled );8081        MTL::PixelFormat                            reactiveMaskTextureFormat() const;82        void                                        setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat );8384        float                                       inputContentMinScale() const;85        void                                        setInputContentMinScale( float scale );8687        float                                       inputContentMaxScale() const;88        void                                        setInputContentMaxScale( float scale );8990        bool                                        isOutputResolutionMotionVectorsEnabled() const;91        void                                        setOutputResolutionMotionVectorsEnabled( bool enabled );9293        class TemporalScaler*                       newTemporalScaler( const MTL::Device* pDevice ) const;94        MTL4FX::TemporalScaler*                     newTemporalScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler) const;9596        static float                                supportedInputContentMinScale( const MTL::Device* pDevice );97        static float                                supportedInputContentMaxScale( const MTL::Device* pDevice );9899        static bool                                 supportsDevice( const MTL::Device* pDevice );100        static bool                                 supportsMetal4FX( const MTL::Device* pDevice );101    };102103    class FrameInterpolatableScaler : public NS::Copying< FrameInterpolatableScaler >104    {105	};106107    class TemporalScalerBase : public NS::Referencing< TemporalScaler, FrameInterpolatableScaler >108    {109    public:110        MTL::TextureUsage                           colorTextureUsage() const;111        MTL::TextureUsage                           depthTextureUsage() const;112        MTL::TextureUsage                           motionTextureUsage() const;113        MTL::TextureUsage                           outputTextureUsage() const;114115        NS::UInteger                                inputContentWidth() const;116        void                                        setInputContentWidth( NS::UInteger width );117118        NS::UInteger                                inputContentHeight() const;119        void                                        setInputContentHeight( NS::UInteger height );120121        MTL::Texture*                               colorTexture() const;122        void                                        setColorTexture( MTL::Texture* pTexture );123124        MTL::Texture*                               depthTexture() const;125        void                                        setDepthTexture( MTL::Texture* pTexture );126127        MTL::Texture*                               motionTexture() const;128        void                                        setMotionTexture( MTL::Texture* pTexture );129130        MTL::Texture*                               outputTexture() const;131        void                                        setOutputTexture( MTL::Texture* pTexture );132133        MTL::Texture*                               exposureTexture() const;134        void                                        setExposureTexture( MTL::Texture* pTexture );135136        float                                       preExposure() const;137        void                                        setPreExposure( float preExposure );138        139        float                                       jitterOffsetX() const;140        void                                        setJitterOffsetX( float offset );141142        float                                       jitterOffsetY() const;143        void                                        setJitterOffsetY( float offset );144145        float                                       motionVectorScaleX() const;146        void                                        setMotionVectorScaleX( float scale );147148        float                                       motionVectorScaleY() const;149        void                                        setMotionVectorScaleY( float scale );150151        MTL::Texture*                               reactiveMaskTexture() const;152        void                                        setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture );153154        MTL::TextureUsage                           reactiveMaskTextureUsage() const;155156        [[deprecated("please use reactiveMaskTextureUsage")]]157        MTL::TextureUsage                           reactiveTextureUsage() const;158159        bool                                        reset() const;160        void                                        setReset( bool reset );161162        bool                                        isDepthReversed() const;163        void                                        setDepthReversed( bool depthReversed );164165        MTL::PixelFormat                            colorTextureFormat() const;166        MTL::PixelFormat                            depthTextureFormat() const;167        MTL::PixelFormat                            motionTextureFormat() const;168        MTL::PixelFormat                            outputTextureFormat() const;169        NS::UInteger                                inputWidth() const;170        NS::UInteger                                inputHeight() const;171        NS::UInteger                                outputWidth() const;172        NS::UInteger                                outputHeight() const;173        float                                       inputContentMinScale() const;174        float                                       inputContentMaxScale() const;175176        NS::UInteger                                colorContentOffsetX() const;177        void                                        setColorContentOffsetX( NS::UInteger offset );178        NS::UInteger                                colorContentOffsetY() const;179        void                                        setColorContentOffsetY( NS::UInteger offset );180181        NS::UInteger                                depthContentOffsetX() const;182        void                                        setDepthContentOffsetX( NS::UInteger offset );183        NS::UInteger                                depthContentOffsetY() const;184        void                                        setDepthContentOffsetY( NS::UInteger offset );185186        NS::UInteger                                motionContentOffsetX() const;187        void                                        setMotionContentOffsetX( NS::UInteger offset );188        NS::UInteger                                motionContentOffsetY() const;189        void                                        setMotionContentOffsetY( NS::UInteger offset );190191        NS::UInteger                                reactiveMaskContentOffsetX() const;192        void                                        setReactiveMaskContentOffsetX( NS::UInteger offset );193        NS::UInteger                                reactiveMaskContentOffsetY() const;194        void                                        setReactiveMaskContentOffsetY( NS::UInteger offset );195196        NS::UInteger                                outputOffsetX() const;197        void                                        setOutputOffsetX( NS::UInteger offset );198        NS::UInteger                                outputOffsetY() const;199        void                                        setOutputOffsetY( NS::UInteger offset );200201        MTL::Fence*                                 fence() const;202        void                                        setFence( MTL::Fence* pFence );203    };204205    class TemporalScaler : public NS::Referencing< TemporalScaler, TemporalScalerBase >206    {207    public:208        void                                        encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer );209    };210}211212//-------------------------------------------------------------------------------------------------------------------------------------------------------------213214_MTLFX_INLINE MTLFX::TemporalScalerDescriptor* MTLFX::TemporalScalerDescriptor::alloc()215{216    return NS::Object::alloc< TemporalScalerDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ) );217}218219//-------------------------------------------------------------------------------------------------------------------------------------------------------------220221_MTLFX_INLINE MTLFX::TemporalScalerDescriptor* MTLFX::TemporalScalerDescriptor::init()222{223    return NS::Object::init< TemporalScalerDescriptor >();224}225226//-------------------------------------------------------------------------------------------------------------------------------------------------------------227228_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::colorTextureFormat() const229{230    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) );231}232233//-------------------------------------------------------------------------------------------------------------------------------------------------------------234235_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setColorTextureFormat( MTL::PixelFormat format )236{237    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), format );238}239240//-------------------------------------------------------------------------------------------------------------------------------------------------------------241242_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::depthTextureFormat() const243{244    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) );245}246247//-------------------------------------------------------------------------------------------------------------------------------------------------------------248249_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setDepthTextureFormat( MTL::PixelFormat format )250{251    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), format );252}253254//-------------------------------------------------------------------------------------------------------------------------------------------------------------255256_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::motionTextureFormat() const257{258    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) );259}260261//-------------------------------------------------------------------------------------------------------------------------------------------------------------262263_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setMotionTextureFormat( MTL::PixelFormat format )264{265    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), format );266}267268//-------------------------------------------------------------------------------------------------------------------------------------------------------------269270_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::outputTextureFormat() const271{272    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) );273}274275//-------------------------------------------------------------------------------------------------------------------------------------------------------------276277_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputTextureFormat( MTL::PixelFormat format )278{279    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), format );280}281282//-------------------------------------------------------------------------------------------------------------------------------------------------------------283284_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::inputWidth() const285{286    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) );287}288289//-------------------------------------------------------------------------------------------------------------------------------------------------------------290291_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputWidth( NS::UInteger width )292{293    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), width );294}295296//-------------------------------------------------------------------------------------------------------------------------------------------------------------297298_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::inputHeight() const299{300    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) );301}302303//-------------------------------------------------------------------------------------------------------------------------------------------------------------304305_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputHeight( NS::UInteger height )306{307    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), height );308}309310//-------------------------------------------------------------------------------------------------------------------------------------------------------------311312_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::outputWidth() const313{314    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) );315}316317//-------------------------------------------------------------------------------------------------------------------------------------------------------------318319_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputWidth( NS::UInteger width )320{321    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), width );322}323324//-------------------------------------------------------------------------------------------------------------------------------------------------------------325326_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::outputHeight() const327{328    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) );329}330331//-------------------------------------------------------------------------------------------------------------------------------------------------------------332333_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputHeight( NS::UInteger height )334{335    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), height );336}337338//-------------------------------------------------------------------------------------------------------------------------------------------------------------339340_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isAutoExposureEnabled() const341{342    return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isAutoExposureEnabled ) );343}344345//-------------------------------------------------------------------------------------------------------------------------------------------------------------346347_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setAutoExposureEnabled( bool enabled )348{349    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAutoExposureEnabled_ ), enabled );350}351352//-------------------------------------------------------------------------------------------------------------------------------------------------------------353354_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isInputContentPropertiesEnabled() const355{356    return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isInputContentPropertiesEnabled ) );357}358359//-------------------------------------------------------------------------------------------------------------------------------------------------------------360361_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentPropertiesEnabled( bool enabled )362{363    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentPropertiesEnabled_ ), enabled );364}365366367//-------------------------------------------------------------------------------------------------------------------------------------------------------------368369_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::requiresSynchronousInitialization() const370{371    return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( requiresSynchronousInitialization ) );372}373374//-------------------------------------------------------------------------------------------------------------------------------------------------------------375376_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setRequiresSynchronousInitialization(bool requiresSynchronousInitialization)377{378    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRequiresSynchronousInitialization_ ), requiresSynchronousInitialization );379}380381//-------------------------------------------------------------------------------------------------------------------------------------------------------------382383_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isReactiveMaskTextureEnabled() const384{385    return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isReactiveMaskTextureEnabled ) );386}387388//-------------------------------------------------------------------------------------------------------------------------------------------------------------389390_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setReactiveMaskTextureEnabled( bool enabled )391{392    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureEnabled_ ), enabled );393}394395//-------------------------------------------------------------------------------------------------------------------------------------------------------------396397_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::reactiveMaskTextureFormat() const398{399    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureFormat ) );400}401402//-------------------------------------------------------------------------------------------------------------------------------------------------------------403404_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat )405{406    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureFormat_ ), pixelFormat );407}408409//-------------------------------------------------------------------------------------------------------------------------------------------------------------410411_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::inputContentMinScale() const412{413    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) );414}415416//-------------------------------------------------------------------------------------------------------------------------------------------------------------417418_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentMinScale( float scale )419{420    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMinScale_ ), scale );421}422423//-------------------------------------------------------------------------------------------------------------------------------------------------------------424425_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::inputContentMaxScale() const426{427    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) );428}429430//-------------------------------------------------------------------------------------------------------------------------------------------------------------431432_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentMaxScale( float scale )433{434    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMaxScale_ ), scale );435}436437//-------------------------------------------------------------------------------------------------------------------------------------------------------------438439_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isOutputResolutionMotionVectorsEnabled() const440{441    return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isOutputResolutionMotionVectorsEnabled ) );442}443444//-------------------------------------------------------------------------------------------------------------------------------------------------------------445446_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputResolutionMotionVectorsEnabled( bool enabled )447{448    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputResolutionMotionVectorsEnabled_ ), enabled );449}450451//-------------------------------------------------------------------------------------------------------------------------------------------------------------452453_MTLFX_INLINE MTLFX::TemporalScaler* MTLFX::TemporalScalerDescriptor::newTemporalScaler( const MTL::Device* pDevice ) const454{455    return Object::sendMessage< TemporalScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalScalerWithDevice_ ), pDevice );456}457458//-------------------------------------------------------------------------------------------------------------------------------------------------------------459460_MTLFX_INLINE MTL4FX::TemporalScaler* MTLFX::TemporalScalerDescriptor::newTemporalScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler ) const461{462    return Object::sendMessage< MTL4FX::TemporalScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalScalerWithDevice_compiler_ ), pDevice, pCompiler );463}464465//-------------------------------------------------------------------------------------------------------------------------------------------------------------466467_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::supportedInputContentMinScale( const MTL::Device* pDevice )468{469    float scale = 1.0f;470471    if ( nullptr != methodSignatureForSelector( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ) ) )472    {473        scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ), pDevice );474    }475476    return scale;477}478479//-------------------------------------------------------------------------------------------------------------------------------------------------------------480481_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::supportedInputContentMaxScale( const MTL::Device* pDevice )482{483    float scale = 1.0f;484485    if ( nullptr != methodSignatureForSelector( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ) ) )486    {487        scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ), pDevice );488    }489    else if ( supportsDevice( pDevice ) )490    {491        scale = 2.0f;492    }493494    return scale;495}496497//-------------------------------------------------------------------------------------------------------------------------------------------------------------498499_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::supportsDevice( const MTL::Device* pDevice )500{501    return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsDevice_ ), pDevice );502}503504//-------------------------------------------------------------------------------------------------------------------------------------------------------------505506_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::supportsMetal4FX( const MTL::Device* pDevice )507{508    return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), pDevice );509}510511//-------------------------------------------------------------------------------------------------------------------------------------------------------------512513_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::colorTextureUsage() const514{515    return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) );516}517518//-------------------------------------------------------------------------------------------------------------------------------------------------------------519520_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::depthTextureUsage() const521{522    return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) );523}524525//-------------------------------------------------------------------------------------------------------------------------------------------------------------526527_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::motionTextureUsage() const528{529    return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) );530}531532//-------------------------------------------------------------------------------------------------------------------------------------------------------------533534_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::outputTextureUsage() const535{536    return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) );537}538539//-------------------------------------------------------------------------------------------------------------------------------------------------------------540541_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputContentWidth() const542{543    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentWidth ) );544}545546//-------------------------------------------------------------------------------------------------------------------------------------------------------------547548_MTLFX_INLINE void MTLFX::TemporalScalerBase::setInputContentWidth( NS::UInteger width )549{550    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentWidth_ ), width );551}552553//-------------------------------------------------------------------------------------------------------------------------------------------------------------554555_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputContentHeight() const556{557    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentHeight ) );558}559560//-------------------------------------------------------------------------------------------------------------------------------------------------------------561562_MTLFX_INLINE void MTLFX::TemporalScalerBase::setInputContentHeight( NS::UInteger height )563{564    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentHeight_ ), height );565}566567//-------------------------------------------------------------------------------------------------------------------------------------------------------------568569_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::colorTexture() const570{571    return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) );572}573574//-------------------------------------------------------------------------------------------------------------------------------------------------------------575576_MTLFX_INLINE void MTLFX::TemporalScalerBase::setColorTexture( MTL::Texture* pTexture )577{578    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), pTexture );579}580581//-------------------------------------------------------------------------------------------------------------------------------------------------------------582583_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::depthTexture() const584{585    return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) );586}587588//-------------------------------------------------------------------------------------------------------------------------------------------------------------589590_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthTexture( MTL::Texture* pTexture )591{592    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), pTexture );593}594595//-------------------------------------------------------------------------------------------------------------------------------------------------------------596597_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::motionTexture() const598{599    return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) );600}601602//-------------------------------------------------------------------------------------------------------------------------------------------------------------603604_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionTexture( MTL::Texture* pTexture )605{606    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), pTexture );607}608609//-------------------------------------------------------------------------------------------------------------------------------------------------------------610611_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::outputTexture() const612{613    return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) );614}615616//-------------------------------------------------------------------------------------------------------------------------------------------------------------617618_MTLFX_INLINE void MTLFX::TemporalScalerBase::setOutputTexture( MTL::Texture* pTexture )619{620    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), pTexture );621}622623//-------------------------------------------------------------------------------------------------------------------------------------------------------------624625_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::exposureTexture() const626{627    return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( exposureTexture ) );628}629630//-------------------------------------------------------------------------------------------------------------------------------------------------------------631632_MTLFX_INLINE void MTLFX::TemporalScalerBase::setExposureTexture( MTL::Texture* pTexture )633{634    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setExposureTexture_ ), pTexture );635}636637//-------------------------------------------------------------------------------------------------------------------------------------------------------------638639_MTLFX_INLINE float MTLFX::TemporalScalerBase::preExposure() const640{641    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( preExposure ) );642}643644//-------------------------------------------------------------------------------------------------------------------------------------------------------------645646_MTLFX_INLINE void MTLFX::TemporalScalerBase::setPreExposure( float preExposure )647{648    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPreExposure_ ), preExposure );649}650651//-------------------------------------------------------------------------------------------------------------------------------------------------------------652653_MTLFX_INLINE float MTLFX::TemporalScalerBase::jitterOffsetX() const654{655    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) );656}657658//-------------------------------------------------------------------------------------------------------------------------------------------------------------659660_MTLFX_INLINE void MTLFX::TemporalScalerBase::setJitterOffsetX( float offset )661{662    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), offset );663}664665//-------------------------------------------------------------------------------------------------------------------------------------------------------------666667_MTLFX_INLINE float MTLFX::TemporalScalerBase::jitterOffsetY() const668{669    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) );670}671672//-------------------------------------------------------------------------------------------------------------------------------------------------------------673674_MTLFX_INLINE void MTLFX::TemporalScalerBase::setJitterOffsetY( float offset )675{676    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), offset );677}678679//-------------------------------------------------------------------------------------------------------------------------------------------------------------680681_MTLFX_INLINE float MTLFX::TemporalScalerBase::motionVectorScaleX() const682{683    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) );684}685686//-------------------------------------------------------------------------------------------------------------------------------------------------------------687688_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionVectorScaleX( float scale )689{690    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), scale );691}692693//-------------------------------------------------------------------------------------------------------------------------------------------------------------694695_MTLFX_INLINE float MTLFX::TemporalScalerBase::motionVectorScaleY() const696{697    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) );698}699700//-------------------------------------------------------------------------------------------------------------------------------------------------------------701702_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionVectorScaleY( float scale )703{704    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), scale );705}706707//-------------------------------------------------------------------------------------------------------------------------------------------------------------708709_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::reactiveMaskTexture() const710{711    return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTexture ) );712}713714//-------------------------------------------------------------------------------------------------------------------------------------------------------------715716_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture )717{718    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTexture_ ), reactiveMaskTexture );719}720721//-------------------------------------------------------------------------------------------------------------------------------------------------------------722723_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::reactiveMaskTextureUsage() const724{725    return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureUsage ) );726}727728//-------------------------------------------------------------------------------------------------------------------------------------------------------------729730_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::reactiveTextureUsage() const731{732    return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( reactiveTextureUsage ) );733}734735//-------------------------------------------------------------------------------------------------------------------------------------------------------------736737_MTLFX_INLINE bool MTLFX::TemporalScalerBase::reset() const738{739    return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( reset ) );740}741742//-------------------------------------------------------------------------------------------------------------------------------------------------------------743744_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReset( bool reset )745{746    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReset_ ), reset );747}748749//-------------------------------------------------------------------------------------------------------------------------------------------------------------750751_MTLFX_INLINE bool MTLFX::TemporalScalerBase::isDepthReversed() const752{753    return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) );754}755756//-------------------------------------------------------------------------------------------------------------------------------------------------------------757758_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthReversed( bool depthReversed )759{760    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed );761}762763//-------------------------------------------------------------------------------------------------------------------------------------------------------------764765_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::colorTextureFormat() const766{767    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) );768}769770//-------------------------------------------------------------------------------------------------------------------------------------------------------------771772_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::depthTextureFormat() const773{774    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) );775}776777//-------------------------------------------------------------------------------------------------------------------------------------------------------------778779_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::motionTextureFormat() const780{781    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) );782}783784//-------------------------------------------------------------------------------------------------------------------------------------------------------------785786_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::outputTextureFormat() const787{788    return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) );789}790791//-------------------------------------------------------------------------------------------------------------------------------------------------------------792793_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputWidth() const794{795    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) );796}797798//-------------------------------------------------------------------------------------------------------------------------------------------------------------799800_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputHeight() const801{802    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) );803}804805//-------------------------------------------------------------------------------------------------------------------------------------------------------------806807_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputWidth() const808{809    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) );810}811812//-------------------------------------------------------------------------------------------------------------------------------------------------------------813814_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputHeight() const815{816    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) );817}818819//-------------------------------------------------------------------------------------------------------------------------------------------------------------820821_MTLFX_INLINE float MTLFX::TemporalScalerBase::inputContentMinScale() const822{823    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) );824}825826//-------------------------------------------------------------------------------------------------------------------------------------------------------------827828_MTLFX_INLINE float MTLFX::TemporalScalerBase::inputContentMaxScale() const829{830    return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) );831}832833//-------------------------------------------------------------------------------------------------------------------------------------------------------------834835_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::colorContentOffsetX() const836{837    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( colorContentOffsetX ) );838}839840//-------------------------------------------------------------------------------------------------------------------------------------------------------------841842_MTLFX_INLINE void MTLFX::TemporalScalerBase::setColorContentOffsetX( NS::UInteger offset )843{844    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorContentOffsetX_ ), offset );845}846847//-------------------------------------------------------------------------------------------------------------------------------------------------------------848849_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::colorContentOffsetY() const850{851    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( colorContentOffsetY ) );852}853854//-------------------------------------------------------------------------------------------------------------------------------------------------------------855856_MTLFX_INLINE void MTLFX::TemporalScalerBase::setColorContentOffsetY( NS::UInteger offset )857{858    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorContentOffsetY_ ), offset );859}860861//-------------------------------------------------------------------------------------------------------------------------------------------------------------862863_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::depthContentOffsetX() const864{865    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( depthContentOffsetX ) );866}867868//-------------------------------------------------------------------------------------------------------------------------------------------------------------869870_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthContentOffsetX( NS::UInteger offset )871{872    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthContentOffsetX_ ), offset );873}874875//-------------------------------------------------------------------------------------------------------------------------------------------------------------876877_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::depthContentOffsetY() const878{879    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( depthContentOffsetY ) );880}881882//-------------------------------------------------------------------------------------------------------------------------------------------------------------883884_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthContentOffsetY( NS::UInteger offset )885{886    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthContentOffsetY_ ), offset );887}888889//-------------------------------------------------------------------------------------------------------------------------------------------------------------890891_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::motionContentOffsetX() const892{893    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( motionContentOffsetX ) );894}895896//-------------------------------------------------------------------------------------------------------------------------------------------------------------897898_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionContentOffsetX( NS::UInteger offset )899{900    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionContentOffsetX_ ), offset );901}902903//-------------------------------------------------------------------------------------------------------------------------------------------------------------904905_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::motionContentOffsetY() const906{907    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( motionContentOffsetY ) );908}909910//-------------------------------------------------------------------------------------------------------------------------------------------------------------911912_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionContentOffsetY( NS::UInteger offset )913{914    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionContentOffsetY_ ), offset );915}916917//-------------------------------------------------------------------------------------------------------------------------------------------------------------918919_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::reactiveMaskContentOffsetX() const920{921    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( reactiveMaskContentOffsetX ) );922}923924//-------------------------------------------------------------------------------------------------------------------------------------------------------------925926_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReactiveMaskContentOffsetX( NS::UInteger offset )927{928    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskContentOffsetX_ ), offset );929}930931//-------------------------------------------------------------------------------------------------------------------------------------------------------------932933_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::reactiveMaskContentOffsetY() const934{935    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( reactiveMaskContentOffsetY ) );936}937938//-------------------------------------------------------------------------------------------------------------------------------------------------------------939940_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReactiveMaskContentOffsetY( NS::UInteger offset )941{942    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskContentOffsetY_ ), offset );943}944945//-------------------------------------------------------------------------------------------------------------------------------------------------------------946947_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputOffsetX() const948{949    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputOffsetX ) );950}951952//-------------------------------------------------------------------------------------------------------------------------------------------------------------953954_MTLFX_INLINE void MTLFX::TemporalScalerBase::setOutputOffsetX( NS::UInteger offset )955{956    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputOffsetX_ ), offset );957}958959//-------------------------------------------------------------------------------------------------------------------------------------------------------------960961_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputOffsetY() const962{963    return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputOffsetY ) );964}965966//-------------------------------------------------------------------------------------------------------------------------------------------------------------967968_MTLFX_INLINE void MTLFX::TemporalScalerBase::setOutputOffsetY( NS::UInteger offset )969{970    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputOffsetY_ ), offset );971}972973//-------------------------------------------------------------------------------------------------------------------------------------------------------------974975_MTLFX_INLINE MTL::Fence* MTLFX::TemporalScalerBase::fence() const976{977    return Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) );978}979980//-------------------------------------------------------------------------------------------------------------------------------------------------------------981982_MTLFX_INLINE void MTLFX::TemporalScalerBase::setFence( MTL::Fence* pFence )983{984    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), pFence );985}986987//-------------------------------------------------------------------------------------------------------------------------------------------------------------988989_MTLFX_INLINE void MTLFX::TemporalScaler::encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer )990{991    Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer );992}993994//-------------------------------------------------------------------------------------------------------------------------------------------------------------995