alphatau 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/ext/alphatau/native/alphatau_native.cpp +141 -0
- data/ext/alphatau/native/extconf.rb +18 -0
- data/ext/alphatau/native/sdl/Android.mk +110 -0
- data/ext/alphatau/native/sdl/BUGS.txt +16 -0
- data/ext/alphatau/native/sdl/CMakeLists.txt +1877 -0
- data/ext/alphatau/native/sdl/COPYING.txt +20 -0
- data/ext/alphatau/native/sdl/CREDITS.txt +53 -0
- data/ext/alphatau/native/sdl/INSTALL.txt +40 -0
- data/ext/alphatau/native/sdl/Makefile.in +240 -0
- data/ext/alphatau/native/sdl/Makefile.minimal +44 -0
- data/ext/alphatau/native/sdl/Makefile.pandora +60 -0
- data/ext/alphatau/native/sdl/Makefile.psp +95 -0
- data/ext/alphatau/native/sdl/Makefile.wiz +80 -0
- data/ext/alphatau/native/sdl/README-SDL.txt +13 -0
- data/ext/alphatau/native/sdl/README.txt +21 -0
- data/ext/alphatau/native/sdl/SDL2.spec.in +118 -0
- data/ext/alphatau/native/sdl/SDL2Config.cmake +1 -0
- data/ext/alphatau/native/sdl/TODO.txt +10 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.nuspec +23 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.targets +38 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec +22 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets +10 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln +34 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj +575 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters +774 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln +28 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj +466 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters +735 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln +34 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj +571 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters +771 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/Logo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Package.appxmanifest +42 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj +170 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/Logo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Package.appxmanifest +42 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj +160 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx +0 -0
- data/ext/alphatau/native/sdl/VisualC.html +146 -0
- data/ext/alphatau/native/sdl/VisualC/SDL.sln +291 -0
- data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj +559 -0
- data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj.filters +479 -0
- data/ext/alphatau/native/sdl/VisualC/SDLmain/SDLmain.vcxproj +162 -0
- data/ext/alphatau/native/sdl/VisualC/SDLtest/SDLtest.vcxproj +177 -0
- data/ext/alphatau/native/sdl/VisualC/clean.sh +4 -0
- data/ext/alphatau/native/sdl/VisualC/tests/checkkeys/checkkeys.vcxproj +218 -0
- data/ext/alphatau/native/sdl/VisualC/tests/controllermap/controllermap.vcxproj +259 -0
- data/ext/alphatau/native/sdl/VisualC/tests/loopwave/loopwave.vcxproj +229 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testatomic/testatomic.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testautomation/testautomation.vcxproj +230 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testdraw2/testdraw2.vcxproj +209 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testfile/testfile.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj +259 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgesture/testgesture.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgl2/testgl2.vcxproj +213 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgles2/testgles2.vcxproj +209 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testjoystick/testjoystick.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testoverlay2/testoverlay2.vcxproj +224 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testplatform/testplatform.vcxproj +231 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testpower/testpower.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testrendertarget/testrendertarget.vcxproj +247 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testrumble/testrumble.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testscale/testscale.vcxproj +247 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testshape/testshape.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testsprite2/testsprite2.vcxproj +229 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testvulkan/testvulkan.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testyuv/testyuv.vcxproj +233 -0
- data/ext/alphatau/native/sdl/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj +216 -0
- data/ext/alphatau/native/sdl/VisualC/visualtest/visualtest_VS2012.vcxproj +304 -0
- data/ext/alphatau/native/sdl/WhatsNew.txt +401 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Default.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +1299 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Icon.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Info.plist +32 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/README +43 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/license.txt +258 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_china.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/icon.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/ship.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/space.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/stroke.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/iOS Launch Screen.storyboard +40 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/accelerometer.c +226 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.c +56 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.h +10 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/fireworks.c +474 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/happy.c +180 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/keyboard.c +301 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/mixer.c +344 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/rectangles.c +92 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/touch.c +129 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +2047 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj +422 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Info.plist +28 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +10 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj +308 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/main.c +100 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Test/Info.plist +26 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Test/README +11 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +3095 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/Info-Framework.plist +28 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj +3384 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/SDL.info +15 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/License.txt +19 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt +32 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/SDL_DS_Store +0 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/sdl_logo.pdf +0 -0
- data/ext/alphatau/native/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +4995 -0
- data/ext/alphatau/native/sdl/Xcode/SDLTest/TestDropFile-Info.plist +35 -0
- data/ext/alphatau/native/sdl/Xcode/XcodeDocSet/Doxyfile +1558 -0
- data/ext/alphatau/native/sdl/acinclude/ac_check_define.m4 +14 -0
- data/ext/alphatau/native/sdl/acinclude/alsa.m4 +145 -0
- data/ext/alphatau/native/sdl/acinclude/ax_check_compiler_flags.m4 +76 -0
- data/ext/alphatau/native/sdl/acinclude/ax_gcc_archflag.m4 +215 -0
- data/ext/alphatau/native/sdl/acinclude/ax_gcc_x86_cpuid.m4.htm +79 -0
- data/ext/alphatau/native/sdl/acinclude/esd.m4 +168 -0
- data/ext/alphatau/native/sdl/acinclude/libtool.m4 +7998 -0
- data/ext/alphatau/native/sdl/acinclude/ltoptions.m4 +384 -0
- data/ext/alphatau/native/sdl/acinclude/ltsugar.m4 +123 -0
- data/ext/alphatau/native/sdl/acinclude/ltversion.m4 +23 -0
- data/ext/alphatau/native/sdl/acinclude/lt~obsolete.m4 +98 -0
- data/ext/alphatau/native/sdl/android-project-ant/AndroidManifest.xml +1 -0
- data/ext/alphatau/native/sdl/android-project-ant/ant.properties +17 -0
- data/ext/alphatau/native/sdl/android-project-ant/build.properties +17 -0
- data/ext/alphatau/native/sdl/android-project-ant/build.xml +93 -0
- data/ext/alphatau/native/sdl/android-project-ant/default.properties +11 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/Android.mk +1 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/Application.mk +10 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android.mk +18 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android_static.mk +12 -0
- data/ext/alphatau/native/sdl/android-project-ant/proguard-project.txt +20 -0
- data/ext/alphatau/native/sdl/android-project-ant/project.properties +14 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-hdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-mdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xxhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/layout/main.xml +13 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/values/strings.xml +4 -0
- data/ext/alphatau/native/sdl/android-project-ant/src +1 -0
- data/ext/alphatau/native/sdl/android-project/app/build.gradle +69 -0
- data/ext/alphatau/native/sdl/android-project/app/jni/Android.mk +1 -0
- data/ext/alphatau/native/sdl/android-project/app/jni/Application.mk +9 -0
- data/ext/alphatau/native/sdl/android-project/app/jni/src/Android.mk +18 -0
- data/ext/alphatau/native/sdl/android-project/app/proguard-rules.pro +17 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/AndroidManifest.xml +77 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDevice.java +19 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java +640 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +624 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java +298 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDL.java +37 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +2103 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java +178 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java +812 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/colors.xml +6 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/strings.xml +3 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/styles.xml +8 -0
- data/ext/alphatau/native/sdl/android-project/build.gradle +23 -0
- data/ext/alphatau/native/sdl/android-project/gradle.properties +17 -0
- data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/ext/alphatau/native/sdl/android-project/gradlew +160 -0
- data/ext/alphatau/native/sdl/android-project/gradlew.bat +90 -0
- data/ext/alphatau/native/sdl/android-project/settings.gradle +1 -0
- data/ext/alphatau/native/sdl/autogen.sh +23 -0
- data/ext/alphatau/native/sdl/build-scripts/androidbuild.sh +100 -0
- data/ext/alphatau/native/sdl/build-scripts/androidbuildlibs.sh +74 -0
- data/ext/alphatau/native/sdl/build-scripts/checker-buildbot.sh +103 -0
- data/ext/alphatau/native/sdl/build-scripts/config.guess +1476 -0
- data/ext/alphatau/native/sdl/build-scripts/config.sub +1868 -0
- data/ext/alphatau/native/sdl/build-scripts/config.sub.patch +72 -0
- data/ext/alphatau/native/sdl/build-scripts/emscripten-buildbot.sh +77 -0
- data/ext/alphatau/native/sdl/build-scripts/g++-fat.sh +101 -0
- data/ext/alphatau/native/sdl/build-scripts/gcc-fat.sh +102 -0
- data/ext/alphatau/native/sdl/build-scripts/install-sh +323 -0
- data/ext/alphatau/native/sdl/build-scripts/iosbuild.sh +188 -0
- data/ext/alphatau/native/sdl/build-scripts/ltmain.sh +9658 -0
- data/ext/alphatau/native/sdl/build-scripts/mkinstalldirs +99 -0
- data/ext/alphatau/native/sdl/build-scripts/nacl-buildbot.sh +61 -0
- data/ext/alphatau/native/sdl/build-scripts/naclbuild.sh +105 -0
- data/ext/alphatau/native/sdl/build-scripts/raspberrypi-buildbot.sh +60 -0
- data/ext/alphatau/native/sdl/build-scripts/showrev.sh +5 -0
- data/ext/alphatau/native/sdl/build-scripts/strip_fPIC.sh +21 -0
- data/ext/alphatau/native/sdl/build-scripts/update-copyright.sh +8 -0
- data/ext/alphatau/native/sdl/build-scripts/updaterev.sh +20 -0
- data/ext/alphatau/native/sdl/build-scripts/windows-buildbot-zipper.bat +40 -0
- data/ext/alphatau/native/sdl/build-scripts/winrtbuild.bat +8 -0
- data/ext/alphatau/native/sdl/build-scripts/winrtbuild.ps1 +302 -0
- data/ext/alphatau/native/sdl/cmake/macros.cmake +73 -0
- data/ext/alphatau/native/sdl/cmake/sdlchecks.cmake +1184 -0
- data/ext/alphatau/native/sdl/cmake_uninstall.cmake.in +18 -0
- data/ext/alphatau/native/sdl/configure +27540 -0
- data/ext/alphatau/native/sdl/configure.in +4236 -0
- data/ext/alphatau/native/sdl/debian/changelog +114 -0
- data/ext/alphatau/native/sdl/debian/compat +1 -0
- data/ext/alphatau/native/sdl/debian/control +76 -0
- data/ext/alphatau/native/sdl/debian/copyright +351 -0
- data/ext/alphatau/native/sdl/debian/docs +4 -0
- data/ext/alphatau/native/sdl/debian/libsdl2-dev.install +8 -0
- data/ext/alphatau/native/sdl/debian/libsdl2-dev.manpages +1 -0
- data/ext/alphatau/native/sdl/debian/libsdl2.install +1 -0
- data/ext/alphatau/native/sdl/debian/rules +41 -0
- data/ext/alphatau/native/sdl/debian/sdl2-config.1 +86 -0
- data/ext/alphatau/native/sdl/debian/source/format +1 -0
- data/ext/alphatau/native/sdl/debian/watch +2 -0
- data/ext/alphatau/native/sdl/docs/README-android.md +432 -0
- data/ext/alphatau/native/sdl/docs/README-cmake.md +32 -0
- data/ext/alphatau/native/sdl/docs/README-directfb.md +107 -0
- data/ext/alphatau/native/sdl/docs/README-dynapi.md +130 -0
- data/ext/alphatau/native/sdl/docs/README-emscripten.md +35 -0
- data/ext/alphatau/native/sdl/docs/README-gesture.md +71 -0
- data/ext/alphatau/native/sdl/docs/README-hg.md +22 -0
- data/ext/alphatau/native/sdl/docs/README-ios.md +284 -0
- data/ext/alphatau/native/sdl/docs/README-linux.md +90 -0
- data/ext/alphatau/native/sdl/docs/README-macosx.md +240 -0
- data/ext/alphatau/native/sdl/docs/README-nacl.md +103 -0
- data/ext/alphatau/native/sdl/docs/README-pandora.md +17 -0
- data/ext/alphatau/native/sdl/docs/README-platforms.md +8 -0
- data/ext/alphatau/native/sdl/docs/README-porting.md +68 -0
- data/ext/alphatau/native/sdl/docs/README-psp.md +19 -0
- data/ext/alphatau/native/sdl/docs/README-raspberrypi.md +188 -0
- data/ext/alphatau/native/sdl/docs/README-touch.md +86 -0
- data/ext/alphatau/native/sdl/docs/README-wince.md +10 -0
- data/ext/alphatau/native/sdl/docs/README-windows.md +45 -0
- data/ext/alphatau/native/sdl/docs/README-winrt.md +544 -0
- data/ext/alphatau/native/sdl/docs/README.md +63 -0
- data/ext/alphatau/native/sdl/docs/doxyfile +1560 -0
- data/ext/alphatau/native/sdl/include/SDL.h +135 -0
- data/ext/alphatau/native/sdl/include/SDL_assert.h +291 -0
- data/ext/alphatau/native/sdl/include/SDL_atomic.h +277 -0
- data/ext/alphatau/native/sdl/include/SDL_audio.h +825 -0
- data/ext/alphatau/native/sdl/include/SDL_bits.h +112 -0
- data/ext/alphatau/native/sdl/include/SDL_blendmode.h +120 -0
- data/ext/alphatau/native/sdl/include/SDL_clipboard.h +71 -0
- data/ext/alphatau/native/sdl/include/SDL_config.h +53 -0
- data/ext/alphatau/native/sdl/include/SDL_config.h.cmake +471 -0
- data/ext/alphatau/native/sdl/include/SDL_config.h.in +417 -0
- data/ext/alphatau/native/sdl/include/SDL_config_android.h +177 -0
- data/ext/alphatau/native/sdl/include/SDL_config_iphoneos.h +201 -0
- data/ext/alphatau/native/sdl/include/SDL_config_macosx.h +240 -0
- data/ext/alphatau/native/sdl/include/SDL_config_minimal.h +85 -0
- data/ext/alphatau/native/sdl/include/SDL_config_pandora.h +133 -0
- data/ext/alphatau/native/sdl/include/SDL_config_psp.h +164 -0
- data/ext/alphatau/native/sdl/include/SDL_config_windows.h +254 -0
- data/ext/alphatau/native/sdl/include/SDL_config_winrt.h +235 -0
- data/ext/alphatau/native/sdl/include/SDL_config_wiz.h +146 -0
- data/ext/alphatau/native/sdl/include/SDL_copying.h +20 -0
- data/ext/alphatau/native/sdl/include/SDL_cpuinfo.h +188 -0
- data/ext/alphatau/native/sdl/include/SDL_egl.h +1673 -0
- data/ext/alphatau/native/sdl/include/SDL_endian.h +260 -0
- data/ext/alphatau/native/sdl/include/SDL_error.h +76 -0
- data/ext/alphatau/native/sdl/include/SDL_events.h +788 -0
- data/ext/alphatau/native/sdl/include/SDL_filesystem.h +136 -0
- data/ext/alphatau/native/sdl/include/SDL_gamecontroller.h +383 -0
- data/ext/alphatau/native/sdl/include/SDL_gesture.h +87 -0
- data/ext/alphatau/native/sdl/include/SDL_haptic.h +1227 -0
- data/ext/alphatau/native/sdl/include/SDL_hints.h +1106 -0
- data/ext/alphatau/native/sdl/include/SDL_joystick.h +395 -0
- data/ext/alphatau/native/sdl/include/SDL_keyboard.h +217 -0
- data/ext/alphatau/native/sdl/include/SDL_keycode.h +349 -0
- data/ext/alphatau/native/sdl/include/SDL_loadso.h +81 -0
- data/ext/alphatau/native/sdl/include/SDL_log.h +211 -0
- data/ext/alphatau/native/sdl/include/SDL_main.h +168 -0
- data/ext/alphatau/native/sdl/include/SDL_messagebox.h +144 -0
- data/ext/alphatau/native/sdl/include/SDL_mouse.h +302 -0
- data/ext/alphatau/native/sdl/include/SDL_mutex.h +251 -0
- data/ext/alphatau/native/sdl/include/SDL_name.h +33 -0
- data/ext/alphatau/native/sdl/include/SDL_opengl.h +2183 -0
- data/ext/alphatau/native/sdl/include/SDL_opengl_glext.h +11177 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles.h +39 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2.h +52 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2.h +621 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2ext.h +2050 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2platform.h +30 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_khrplatform.h +282 -0
- data/ext/alphatau/native/sdl/include/SDL_pixels.h +470 -0
- data/ext/alphatau/native/sdl/include/SDL_platform.h +198 -0
- data/ext/alphatau/native/sdl/include/SDL_power.h +75 -0
- data/ext/alphatau/native/sdl/include/SDL_quit.h +58 -0
- data/ext/alphatau/native/sdl/include/SDL_rect.h +148 -0
- data/ext/alphatau/native/sdl/include/SDL_render.h +931 -0
- data/ext/alphatau/native/sdl/include/SDL_revision.h +2 -0
- data/ext/alphatau/native/sdl/include/SDL_rwops.h +254 -0
- data/ext/alphatau/native/sdl/include/SDL_scancode.h +413 -0
- data/ext/alphatau/native/sdl/include/SDL_sensor.h +251 -0
- data/ext/alphatau/native/sdl/include/SDL_shape.h +144 -0
- data/ext/alphatau/native/sdl/include/SDL_stdinc.h +607 -0
- data/ext/alphatau/native/sdl/include/SDL_surface.h +546 -0
- data/ext/alphatau/native/sdl/include/SDL_system.h +279 -0
- data/ext/alphatau/native/sdl/include/SDL_syswm.h +324 -0
- data/ext/alphatau/native/sdl/include/SDL_test.h +69 -0
- data/ext/alphatau/native/sdl/include/SDL_test_assert.h +105 -0
- data/ext/alphatau/native/sdl/include/SDL_test_common.h +188 -0
- data/ext/alphatau/native/sdl/include/SDL_test_compare.h +69 -0
- data/ext/alphatau/native/sdl/include/SDL_test_crc32.h +124 -0
- data/ext/alphatau/native/sdl/include/SDL_test_font.h +81 -0
- data/ext/alphatau/native/sdl/include/SDL_test_fuzzer.h +384 -0
- data/ext/alphatau/native/sdl/include/SDL_test_harness.h +134 -0
- data/ext/alphatau/native/sdl/include/SDL_test_images.h +78 -0
- data/ext/alphatau/native/sdl/include/SDL_test_log.h +67 -0
- data/ext/alphatau/native/sdl/include/SDL_test_md5.h +129 -0
- data/ext/alphatau/native/sdl/include/SDL_test_memory.h +63 -0
- data/ext/alphatau/native/sdl/include/SDL_test_random.h +115 -0
- data/ext/alphatau/native/sdl/include/SDL_thread.h +309 -0
- data/ext/alphatau/native/sdl/include/SDL_timer.h +115 -0
- data/ext/alphatau/native/sdl/include/SDL_touch.h +86 -0
- data/ext/alphatau/native/sdl/include/SDL_types.h +29 -0
- data/ext/alphatau/native/sdl/include/SDL_version.h +162 -0
- data/ext/alphatau/native/sdl/include/SDL_video.h +1276 -0
- data/ext/alphatau/native/sdl/include/SDL_vulkan.h +278 -0
- data/ext/alphatau/native/sdl/include/begin_code.h +167 -0
- data/ext/alphatau/native/sdl/include/close_code.h +37 -0
- data/ext/alphatau/native/sdl/sdl2-config.cmake.in +11 -0
- data/ext/alphatau/native/sdl/sdl2-config.in +60 -0
- data/ext/alphatau/native/sdl/sdl2.m4 +234 -0
- data/ext/alphatau/native/sdl/sdl2.pc.in +15 -0
- data/ext/alphatau/native/sdl/src/SDL.c +514 -0
- data/ext/alphatau/native/sdl/src/SDL_assert.c +451 -0
- data/ext/alphatau/native/sdl/src/SDL_assert_c.h +24 -0
- data/ext/alphatau/native/sdl/src/SDL_dataqueue.c +339 -0
- data/ext/alphatau/native/sdl/src/SDL_dataqueue.h +55 -0
- data/ext/alphatau/native/sdl/src/SDL_error.c +319 -0
- data/ext/alphatau/native/sdl/src/SDL_error_c.h +65 -0
- data/ext/alphatau/native/sdl/src/SDL_hints.c +236 -0
- data/ext/alphatau/native/sdl/src/SDL_internal.h +52 -0
- data/ext/alphatau/native/sdl/src/SDL_log.c +450 -0
- data/ext/alphatau/native/sdl/src/atomic/SDL_atomic.c +303 -0
- data/ext/alphatau/native/sdl/src/atomic/SDL_spinlock.c +176 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audio.c +1647 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audio_c.h +79 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiocvt.c +1673 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiodev.c +124 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiodev_c.h +38 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiotypecvt.c +1430 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_mixer.c +369 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_sysaudio.h +211 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_wave.c +694 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_wave.h +77 -0
- data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.c +990 -0
- data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.h +48 -0
- data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.c +226 -0
- data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.h +42 -0
- data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.c +365 -0
- data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.h +53 -0
- data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.h +66 -0
- data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.m +861 -0
- data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.c +604 -0
- data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.h +47 -0
- data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.c +207 -0
- data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.h +41 -0
- data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.c +320 -0
- data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.h +43 -0
- data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.c +65 -0
- data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.h +41 -0
- data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.c +379 -0
- data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.h +38 -0
- data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.c +335 -0
- data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.h +51 -0
- data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.c +328 -0
- data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.h +50 -0
- data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.cc +248 -0
- data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.h +38 -0
- data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.c +446 -0
- data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.h +41 -0
- data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.c +165 -0
- data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.h +43 -0
- data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.c +463 -0
- data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.h +56 -0
- data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.c +412 -0
- data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.h +48 -0
- data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.c +516 -0
- data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.h +48 -0
- data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.c +181 -0
- data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.h +45 -0
- data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.c +782 -0
- data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.h +52 -0
- data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.c +666 -0
- data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.h +57 -0
- data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.c +382 -0
- data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.h +49 -0
- data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.c +419 -0
- data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.h +47 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.c +779 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.h +85 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_win32.c +417 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_winrt.cpp +276 -0
- data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.c +457 -0
- data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.h +45 -0
- data/ext/alphatau/native/sdl/src/core/android/SDL_android.c +2285 -0
- data/ext/alphatau/native/sdl/src/core/android/SDL_android.h +122 -0
- data/ext/alphatau/native/sdl/src/core/android/keyinfotable.h +175 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.c +347 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.h +97 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.c +698 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.h +39 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.c +840 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.h +29 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_accents.h +284 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_keymap.h +4763 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.c +373 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.h +40 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.c +584 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.h +58 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.c +152 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.h +40 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.c +553 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.h +121 -0
- data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.c +87 -0
- data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.h +34 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_directx.h +111 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.c +233 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.h +75 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.c +139 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.h +177 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.cpp +66 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.h +31 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.cpp +855 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.h +92 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.cpp +160 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.h +33 -0
- data/ext/alphatau/native/sdl/src/cpuinfo/SDL_cpuinfo.c +855 -0
- data/ext/alphatau/native/sdl/src/cpuinfo/SDL_simd.h +88 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.c +331 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.h +67 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_overrides.h +698 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_procs.h +740 -0
- data/ext/alphatau/native/sdl/src/dynapi/gendynapi.pl +141 -0
- data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents.c +46 -0
- data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents_c.h +30 -0
- data/ext/alphatau/native/sdl/src/events/SDL_displayevents.c +60 -0
- data/ext/alphatau/native/sdl/src/events/SDL_displayevents_c.h +30 -0
- data/ext/alphatau/native/sdl/src/events/SDL_dropevents.c +98 -0
- data/ext/alphatau/native/sdl/src/events/SDL_dropevents_c.h +32 -0
- data/ext/alphatau/native/sdl/src/events/SDL_events.c +976 -0
- data/ext/alphatau/native/sdl/src/events/SDL_events_c.h +52 -0
- data/ext/alphatau/native/sdl/src/events/SDL_gesture.c +700 -0
- data/ext/alphatau/native/sdl/src/events/SDL_gesture_c.h +35 -0
- data/ext/alphatau/native/sdl/src/events/SDL_keyboard.c +1033 -0
- data/ext/alphatau/native/sdl/src/events/SDL_keyboard_c.h +70 -0
- data/ext/alphatau/native/sdl/src/events/SDL_mouse.c +1031 -0
- data/ext/alphatau/native/sdl/src/events/SDL_mouse_c.h +141 -0
- data/ext/alphatau/native/sdl/src/events/SDL_quit.c +152 -0
- data/ext/alphatau/native/sdl/src/events/SDL_sysevents.h +36 -0
- data/ext/alphatau/native/sdl/src/events/SDL_touch.c +375 -0
- data/ext/alphatau/native/sdl/src/events/SDL_touch_c.h +61 -0
- data/ext/alphatau/native/sdl/src/events/SDL_windowevents.c +227 -0
- data/ext/alphatau/native/sdl/src/events/SDL_windowevents_c.h +31 -0
- data/ext/alphatau/native/sdl/src/events/blank_cursor.h +33 -0
- data/ext/alphatau/native/sdl/src/events/default_cursor.h +114 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_darwin.h +159 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_linux.h +263 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_windows.h +55 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_xfree86.h +506 -0
- data/ext/alphatau/native/sdl/src/file/SDL_rwops.c +867 -0
- data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.h +30 -0
- data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m +62 -0
- data/ext/alphatau/native/sdl/src/filesystem/android/SDL_sysfilesystem.c +62 -0
- data/ext/alphatau/native/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m +117 -0
- data/ext/alphatau/native/sdl/src/filesystem/dummy/SDL_sysfilesystem.c +47 -0
- data/ext/alphatau/native/sdl/src/filesystem/emscripten/SDL_sysfilesystem.c +81 -0
- data/ext/alphatau/native/sdl/src/filesystem/haiku/SDL_sysfilesystem.cc +110 -0
- data/ext/alphatau/native/sdl/src/filesystem/nacl/SDL_sysfilesystem.c +43 -0
- data/ext/alphatau/native/sdl/src/filesystem/unix/SDL_sysfilesystem.c +250 -0
- data/ext/alphatau/native/sdl/src/filesystem/windows/SDL_sysfilesystem.c +192 -0
- data/ext/alphatau/native/sdl/src/filesystem/winrt/SDL_sysfilesystem.cpp +233 -0
- data/ext/alphatau/native/sdl/src/haptic/SDL_haptic.c +850 -0
- data/ext/alphatau/native/sdl/src/haptic/SDL_haptic_c.h +25 -0
- data/ext/alphatau/native/sdl/src/haptic/SDL_syshaptic.h +208 -0
- data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic.c +358 -0
- data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic_c.h +12 -0
- data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic.c +1417 -0
- data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic_c.h +26 -0
- data/ext/alphatau/native/sdl/src/haptic/dummy/SDL_syshaptic.c +186 -0
- data/ext/alphatau/native/sdl/src/haptic/linux/SDL_syshaptic.c +1165 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic.c +1305 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic_c.h +47 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic.c +456 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic_c.h +88 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic.c +487 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic_c.h +47 -0
- data/ext/alphatau/native/sdl/src/hidapi/AUTHORS.txt +16 -0
- data/ext/alphatau/native/sdl/src/hidapi/HACKING.txt +15 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE-bsd.txt +26 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE-gpl3.txt +674 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE-orig.txt +9 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE.txt +13 -0
- data/ext/alphatau/native/sdl/src/hidapi/Makefile.am +85 -0
- data/ext/alphatau/native/sdl/src/hidapi/README.txt +339 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/hid.cpp +1079 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/jni/Android.mk +16 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/jni/Application.mk +2 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/project.properties +14 -0
- data/ext/alphatau/native/sdl/src/hidapi/bootstrap +2 -0
- data/ext/alphatau/native/sdl/src/hidapi/configure.ac +236 -0
- data/ext/alphatau/native/sdl/src/hidapi/doxygen/Doxyfile +1630 -0
- data/ext/alphatau/native/sdl/src/hidapi/hidapi/hidapi.h +398 -0
- data/ext/alphatau/native/sdl/src/hidapi/hidtest/Makefile.am +20 -0
- data/ext/alphatau/native/sdl/src/hidapi/hidtest/hidtest.cpp +194 -0
- data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile-manual +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile.am +9 -0
- data/ext/alphatau/native/sdl/src/hidapi/ios/hid.m +909 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile-manual +18 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.am +27 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.freebsd +46 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.linux +49 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/hid.c +1615 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/hidusb.cpp +3 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile-manual +49 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile.am +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/README.txt +59 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/hid.c +893 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/hid.cpp +333 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/hidraw.cpp +3 -0
- data/ext/alphatau/native/sdl/src/hidapi/m4/ax_pthread.m4 +309 -0
- data/ext/alphatau/native/sdl/src/hidapi/m4/pkg.m4 +157 -0
- data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile-manual +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile.am +9 -0
- data/ext/alphatau/native/sdl/src/hidapi/mac/hid.c +1186 -0
- data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-hidraw.pc.in +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-libusb.pc.in +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi.pc.in +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile-manual +26 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.am +43 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.freebsd +33 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.linux +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mac +46 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mingw +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Info.plist +28 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/PkgInfo +1 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/English.lproj/InfoPlist.strings +0 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/Signal11.icns +0 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/copy_to_bundle.sh +97 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.cpp +134 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.h +17 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support_cocoa.m +94 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/start.sh +2 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/test.cpp +532 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.sln +20 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.vcproj +217 -0
- data/ext/alphatau/native/sdl/src/hidapi/udev/99-hid.rules +33 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile-manual +14 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.am +16 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.mingw +35 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/hidapi.def +17 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/makefile +49 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/sources +23 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hid.c +983 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.sln +29 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.vcproj +201 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hidtest.vcproj +196 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontroller.c +2066 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontrollerdb.h +583 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_joystick.c +1547 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_joystick_c.h +94 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_sysjoystick.h +153 -0
- data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick.c +703 -0
- data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick_c.h +59 -0
- data/ext/alphatau/native/sdl/src/joystick/bsd/SDL_sysjoystick.c +701 -0
- data/ext/alphatau/native/sdl/src/joystick/controller_type.h +457 -0
- data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick.c +1012 -0
- data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick_c.h +79 -0
- data/ext/alphatau/native/sdl/src/joystick/dummy/SDL_sysjoystick.c +113 -0
- data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick.c +406 -0
- data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick_c.h +52 -0
- data/ext/alphatau/native/sdl/src/joystick/haiku/SDL_haikujoystick.cc +272 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_ps4.c +545 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_switch.c +905 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xbox360.c +461 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xboxone.c +318 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick.c +1021 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick_c.h +72 -0
- data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick.m +727 -0
- data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick_c.h +57 -0
- data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick.c +1116 -0
- data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick_c.h +64 -0
- data/ext/alphatau/native/sdl/src/joystick/psp/SDL_sysjoystick.c +264 -0
- data/ext/alphatau/native/sdl/src/joystick/sort_controllers.py +78 -0
- data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.c +52 -0
- data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.h +33 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick.c +1155 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick_c.h +31 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_mmjoystick.c +452 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick.c +558 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick_c.h +95 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick.c +558 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick_c.h +34 -0
- data/ext/alphatau/native/sdl/src/libm/e_atan2.c +134 -0
- data/ext/alphatau/native/sdl/src/libm/e_exp.c +187 -0
- data/ext/alphatau/native/sdl/src/libm/e_fmod.c +144 -0
- data/ext/alphatau/native/sdl/src/libm/e_log.c +152 -0
- data/ext/alphatau/native/sdl/src/libm/e_log10.c +106 -0
- data/ext/alphatau/native/sdl/src/libm/e_pow.c +343 -0
- data/ext/alphatau/native/sdl/src/libm/e_rem_pio2.c +161 -0
- data/ext/alphatau/native/sdl/src/libm/e_sqrt.c +457 -0
- data/ext/alphatau/native/sdl/src/libm/k_cos.c +82 -0
- data/ext/alphatau/native/sdl/src/libm/k_rem_pio2.c +317 -0
- data/ext/alphatau/native/sdl/src/libm/k_sin.c +65 -0
- data/ext/alphatau/native/sdl/src/libm/k_tan.c +118 -0
- data/ext/alphatau/native/sdl/src/libm/math_libm.h +41 -0
- data/ext/alphatau/native/sdl/src/libm/math_private.h +227 -0
- data/ext/alphatau/native/sdl/src/libm/s_atan.c +114 -0
- data/ext/alphatau/native/sdl/src/libm/s_copysign.c +29 -0
- data/ext/alphatau/native/sdl/src/libm/s_cos.c +73 -0
- data/ext/alphatau/native/sdl/src/libm/s_fabs.c +29 -0
- data/ext/alphatau/native/sdl/src/libm/s_floor.c +71 -0
- data/ext/alphatau/native/sdl/src/libm/s_scalbn.c +69 -0
- data/ext/alphatau/native/sdl/src/libm/s_sin.c +73 -0
- data/ext/alphatau/native/sdl/src/libm/s_tan.c +67 -0
- data/ext/alphatau/native/sdl/src/loadso/dlopen/SDL_sysloadso.c +88 -0
- data/ext/alphatau/native/sdl/src/loadso/dummy/SDL_sysloadso.c +54 -0
- data/ext/alphatau/native/sdl/src/loadso/windows/SDL_sysloadso.c +80 -0
- data/ext/alphatau/native/sdl/src/main/android/SDL_android_main.c +7 -0
- data/ext/alphatau/native/sdl/src/main/dummy/SDL_dummy_main.c +28 -0
- data/ext/alphatau/native/sdl/src/main/haiku/SDL_BApp.h +399 -0
- data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.cc +157 -0
- data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.h +38 -0
- data/ext/alphatau/native/sdl/src/main/nacl/SDL_nacl_main.c +93 -0
- data/ext/alphatau/native/sdl/src/main/psp/SDL_psp_main.c +70 -0
- data/ext/alphatau/native/sdl/src/main/windows/SDL_windows_main.c +207 -0
- data/ext/alphatau/native/sdl/src/main/windows/version.rc +38 -0
- data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResource_BlankCursor.cur +0 -0
- data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResources.rc +3 -0
- data/ext/alphatau/native/sdl/src/main/winrt/SDL_winrt_main_NonXAML.cpp +54 -0
- data/ext/alphatau/native/sdl/src/power/SDL_power.c +116 -0
- data/ext/alphatau/native/sdl/src/power/SDL_syspower.h +47 -0
- data/ext/alphatau/native/sdl/src/power/android/SDL_syspower.c +64 -0
- data/ext/alphatau/native/sdl/src/power/emscripten/SDL_syspower.c +62 -0
- data/ext/alphatau/native/sdl/src/power/haiku/SDL_syspower.c +128 -0
- data/ext/alphatau/native/sdl/src/power/linux/SDL_syspower.c +642 -0
- data/ext/alphatau/native/sdl/src/power/macosx/SDL_syspower.c +192 -0
- data/ext/alphatau/native/sdl/src/power/psp/SDL_syspower.c +68 -0
- data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.h +32 -0
- data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.m +113 -0
- data/ext/alphatau/native/sdl/src/power/windows/SDL_syspower.c +76 -0
- data/ext/alphatau/native/sdl/src/power/winrt/SDL_syspower.cpp +44 -0
- data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.c +136 -0
- data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.h +72 -0
- data/ext/alphatau/native/sdl/src/render/SDL_render.c +2292 -0
- data/ext/alphatau/native/sdl/src/render/SDL_sysrender.h +214 -0
- data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw.c +414 -0
- data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw_c.h +67 -0
- data/ext/alphatau/native/sdl/src/render/direct3d/SDL_render_d3d.c +1813 -0
- data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.c +274 -0
- data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.h +34 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_d3d11.c +2559 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.cpp +116 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.h +40 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.c +1957 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.h +43 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_render_metal.m +1428 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal.metal +109 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_ios.h +1899 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_osx.h +1903 -0
- data/ext/alphatau/native/sdl/src/render/metal/build-metal-shaders.sh +18 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_glfuncs.h +478 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_render_gl.c +1678 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.c +524 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.h +47 -0
- data/ext/alphatau/native/sdl/src/render/opengles/SDL_glesfuncs.h +65 -0
- data/ext/alphatau/native/sdl/src/render/opengles/SDL_render_gles.c +1278 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_gles2funcs.h +80 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_render_gles2.c +2256 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.c +569 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.h +70 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/Makefile +41 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_c.sno +181 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_h.sno +116 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2funcs_h.sno +82 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gles2funcs_into_gles2_define_overs_h.sno +42 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/gl2.h +686 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/readme.txt +70 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/testgles2.c +725 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/triangle.c +147 -0
- data/ext/alphatau/native/sdl/src/render/psp/SDL_render_psp.c +1016 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.c +336 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.c +777 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.c +341 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_draw.h +576 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.c +209 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.c +114 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw.c +882 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw_c.h +24 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.c +530 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.h +28 -0
- data/ext/alphatau/native/sdl/src/sensor/SDL_sensor.c +546 -0
- data/ext/alphatau/native/sdl/src/sensor/SDL_sensor_c.h +38 -0
- data/ext/alphatau/native/sdl/src/sensor/SDL_syssensor.h +99 -0
- data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.c +211 -0
- data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.h +31 -0
- data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.h +30 -0
- data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.m +234 -0
- data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.c +110 -0
- data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.h +23 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_getenv.c +315 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_iconv.c +934 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_malloc.c +5376 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_qsort.c +534 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_stdlib.c +1155 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_string.c +1737 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_assert.c +152 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_common.c +1826 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_compare.c +117 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_crc32.c +166 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_font.c +3250 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_fuzzer.c +534 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_harness.c +683 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlit.c +1559 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlitBlend.c +2845 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imageFace.c +247 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitives.c +514 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitivesBlend.c +696 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_log.c +118 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_md5.c +338 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_memory.c +274 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_random.c +96 -0
- data/ext/alphatau/native/sdl/src/thread/SDL_systhread.h +70 -0
- data/ext/alphatau/native/sdl/src/thread/SDL_thread.c +503 -0
- data/ext/alphatau/native/sdl/src/thread/SDL_thread_c.h +95 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_syscond.c +220 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex.c +165 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex_c.h +22 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_syssem.c +217 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread.c +71 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread_c.h +26 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_systls.c +38 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_syscond.c +224 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex.c +136 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex_c.h +22 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_syssem.c +161 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread.c +114 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread_c.h +24 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syscond.c +158 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex.c +195 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex_c.h +32 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syssem.c +209 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread.c +324 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread_c.h +27 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systls.c +70 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_syscond.cpp +164 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex.cpp +111 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex_c.h +30 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread.cpp +168 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread_c.h +26 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_sysmutex.c +110 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_syssem.c +152 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread.c +260 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread_c.h +32 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_systls.c +72 -0
- data/ext/alphatau/native/sdl/src/timer/SDL_timer.c +373 -0
- data/ext/alphatau/native/sdl/src/timer/SDL_timer_c.h +34 -0
- data/ext/alphatau/native/sdl/src/timer/dummy/SDL_systimer.c +75 -0
- data/ext/alphatau/native/sdl/src/timer/haiku/SDL_systimer.c +80 -0
- data/ext/alphatau/native/sdl/src/timer/psp/SDL_systimer.c +91 -0
- data/ext/alphatau/native/sdl/src/timer/unix/SDL_systimer.c +232 -0
- data/ext/alphatau/native/sdl/src/timer/windows/SDL_systimer.c +200 -0
- data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel.c +1581 -0
- data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel_c.h +31 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit.c +296 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit.h +553 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_0.c +483 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_1.c +552 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_A.c +1388 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_N.c +2647 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.c +7419 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.h +30 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.c +162 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.h +24 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.c +164 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.h +25 -0
- data/ext/alphatau/native/sdl/src/video/SDL_bmp.c +702 -0
- data/ext/alphatau/native/sdl/src/video/SDL_clipboard.c +90 -0
- data/ext/alphatau/native/sdl/src/video/SDL_egl.c +899 -0
- data/ext/alphatau/native/sdl/src/video/SDL_egl_c.h +149 -0
- data/ext/alphatau/native/sdl/src/video/SDL_fillrect.c +343 -0
- data/ext/alphatau/native/sdl/src/video/SDL_pixels.c +1125 -0
- data/ext/alphatau/native/sdl/src/video/SDL_pixels_c.h +40 -0
- data/ext/alphatau/native/sdl/src/video/SDL_rect.c +531 -0
- data/ext/alphatau/native/sdl/src/video/SDL_rect_c.h +25 -0
- data/ext/alphatau/native/sdl/src/video/SDL_shape.c +309 -0
- data/ext/alphatau/native/sdl/src/video/SDL_shape_internals.h +69 -0
- data/ext/alphatau/native/sdl/src/video/SDL_stretch.c +353 -0
- data/ext/alphatau/native/sdl/src/video/SDL_surface.c +1232 -0
- data/ext/alphatau/native/sdl/src/video/SDL_sysvideo.h +467 -0
- data/ext/alphatau/native/sdl/src/video/SDL_video.c +4160 -0
- data/ext/alphatau/native/sdl/src/video/SDL_vulkan_internal.h +91 -0
- data/ext/alphatau/native/sdl/src/video/SDL_vulkan_utils.c +172 -0
- data/ext/alphatau/native/sdl/src/video/SDL_yuv.c +1834 -0
- data/ext/alphatau/native/sdl/src/video/SDL_yuv_c.h +30 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.c +48 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.h +32 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.c +123 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.h +27 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.c +62 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.h +34 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.c +391 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.c +37 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.c +266 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.h +33 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.c +151 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.h +29 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.c +259 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.h +51 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.c +175 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.c +175 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.h +45 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.m +103 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.h +32 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.m +483 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.m +720 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.m +145 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.h +63 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.m +134 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.h +46 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.m +490 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.h +52 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.m +477 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.h +34 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.m +279 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.h +68 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.m +428 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.m +132 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.h +45 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.m +113 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.h +118 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.m +254 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.h +55 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.m +231 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.h +155 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.m +1885 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.c +413 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.h +56 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.c +117 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.h +41 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.c +748 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.h +34 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.c +414 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.h +59 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.c +389 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.h +44 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.c +332 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.h +64 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.c +1335 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.h +25 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.c +131 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.h +38 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.c +418 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.h +170 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.c +565 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.h +82 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents.c +41 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents_c.h +27 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer.c +89 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer_c.h +27 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.c +144 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.h +30 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.c +716 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.h +40 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.c +178 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.h +32 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.c +275 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.h +42 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.c +119 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.c +354 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.h +58 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_BWin.h +679 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.cc +95 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.h +33 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.cc +41 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.h +39 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.cc +259 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.h +47 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.cc +190 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.h +44 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.cc +333 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.h +48 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.cc +176 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.h +55 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.cc +178 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.h +44 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.cc +233 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.h +55 -0
- data/ext/alphatau/native/sdl/src/video/khronos/EGL/egl.h +303 -0
- data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglext.h +1241 -0
- data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglplatform.h +132 -0
- data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2.h +675 -0
- data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2ext.h +3505 -0
- data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2platform.h +38 -0
- data/ext/alphatau/native/sdl/src/video/khronos/KHR/khrplatform.h +284 -0
- data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vk_platform.h +120 -0
- data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vulkan.h +6458 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.c +171 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.h +53 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.c +42 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.h +31 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.c +501 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.h +45 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.c +189 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.h +48 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmsym.h +99 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.c +664 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.h +124 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.c +170 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.h +53 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.c +321 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.h +37 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.c +134 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.h +47 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.c +292 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.h +37 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.c +78 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.h +53 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirsym.h +143 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.c +423 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.h +49 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.c +176 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.c +374 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.h +93 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents.c +438 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents_c.h +30 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclglue.c +24 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.c +174 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.h +38 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.c +183 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.h +67 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.c +79 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.h +32 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.c +838 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.h +101 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.c +38 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.h +25 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents.c +290 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents_c.h +31 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl.c +210 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl_c.h +54 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse.c +41 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse_c.h +24 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.c +333 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.h +102 -0
- data/ext/alphatau/native/sdl/src/video/qnx/gl.c +285 -0
- data/ext/alphatau/native/sdl/src/video/qnx/keyboard.c +133 -0
- data/ext/alphatau/native/sdl/src/video/qnx/sdl_qnx.h +48 -0
- data/ext/alphatau/native/sdl/src/video/qnx/video.c +364 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents.c +45 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents_c.h +31 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.c +386 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.h +43 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.c +71 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.c +442 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.h +104 -0
- data/ext/alphatau/native/sdl/src/video/sdlgenblit.pl +535 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.h +47 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.m +516 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.h +35 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.m +111 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.h +30 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.m +73 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.h +31 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.m +208 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.h +58 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.m +131 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.h +54 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.m +378 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.h +40 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.m +250 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.h +60 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.m +384 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.h +46 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.m +249 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.h +41 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.m +328 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.h +91 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.m +532 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.h +54 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.m +222 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.h +56 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.m +465 -0
- data/ext/alphatau/native/sdl/src/video/uikit/keyinfotable.h +174 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.c +47 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.h +48 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.c +54 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.h +47 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.c +409 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.h +91 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.c +123 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.h +32 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.c +468 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.h +103 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.c +178 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.h +107 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents.c +1134 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents_c.h +51 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.c +396 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.h +31 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.c +93 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandsym.h +127 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.c +265 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.h +352 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.c +517 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.h +85 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.c +176 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.c +684 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.h +88 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_msctf.h +242 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_vkeys.h +76 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.c +160 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.c +1229 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.h +36 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.c +127 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.h +27 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.c +1579 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.h +40 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.c +905 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.c +407 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.h +47 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.c +322 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.h +33 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.c +895 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.h +142 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.c +131 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.c +110 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.h +40 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowstaskdialog.h +156 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.c +442 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.h +199 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.c +176 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.c +992 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.h +86 -0
- data/ext/alphatau/native/sdl/src/video/windows/wmmsg.h +1052 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents.cpp +154 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents_c.h +82 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar.cpp +196 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar_cpp.h +35 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtkeyboard.cpp +430 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.cpp +112 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse.cpp +224 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse_c.h +40 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.cpp +203 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.h +70 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtpointerinput.cpp +415 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo.cpp +842 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo_cpp.h +106 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.c +199 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.h +33 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.c +212 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.h +111 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.c +1500 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.h +31 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.c +257 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.h +31 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.c +543 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.c +853 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.h +28 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.c +1112 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.h +85 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.c +448 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.h +31 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.c +946 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.h +84 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.c +109 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.h +56 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.c +115 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.h +39 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11sym.h +337 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.c +54 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.h +32 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.c +497 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.h +156 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.c +243 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.h +48 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.c +1619 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.h +111 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.c +313 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.h +42 -0
- data/ext/alphatau/native/sdl/src/video/x11/edid-parse.c +754 -0
- data/ext/alphatau/native/sdl/src/video/x11/edid.h +167 -0
- data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.c +350 -0
- data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.h +32 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/LICENSE +27 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/README.md +63 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.c +687 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.h +381 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_sse_func.h +498 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_std_func.h +228 -0
- data/ext/alphatau/native/sdl/test/CMakeLists.txt +122 -0
- data/ext/alphatau/native/sdl/test/COPYING +8 -0
- data/ext/alphatau/native/sdl/test/Makefile.in +328 -0
- data/ext/alphatau/native/sdl/test/README +47 -0
- data/ext/alphatau/native/sdl/test/acinclude.m4 +359 -0
- data/ext/alphatau/native/sdl/test/aclocal.m4 +359 -0
- data/ext/alphatau/native/sdl/test/autogen.sh +12 -0
- data/ext/alphatau/native/sdl/test/axis.bmp +0 -0
- data/ext/alphatau/native/sdl/test/button.bmp +0 -0
- data/ext/alphatau/native/sdl/test/checkkeys.c +248 -0
- data/ext/alphatau/native/sdl/test/configure +5124 -0
- data/ext/alphatau/native/sdl/test/configure.in +191 -0
- data/ext/alphatau/native/sdl/test/controllermap.bmp +0 -0
- data/ext/alphatau/native/sdl/test/controllermap.c +781 -0
- data/ext/alphatau/native/sdl/test/emscripten/joystick-pre.js +25 -0
- data/ext/alphatau/native/sdl/test/gcc-fat.sh +110 -0
- data/ext/alphatau/native/sdl/test/icon.bmp +0 -0
- data/ext/alphatau/native/sdl/test/loopwave.c +179 -0
- data/ext/alphatau/native/sdl/test/loopwavequeue.c +149 -0
- data/ext/alphatau/native/sdl/test/moose.dat +0 -0
- data/ext/alphatau/native/sdl/test/nacl/Makefile +63 -0
- data/ext/alphatau/native/sdl/test/nacl/background.js +40 -0
- data/ext/alphatau/native/sdl/test/nacl/common.js +474 -0
- data/ext/alphatau/native/sdl/test/nacl/index.html +21 -0
- data/ext/alphatau/native/sdl/test/nacl/manifest.json +22 -0
- data/ext/alphatau/native/sdl/test/picture.xbm +14 -0
- data/ext/alphatau/native/sdl/test/relative_mode.markdown +58 -0
- data/ext/alphatau/native/sdl/test/sample.bmp +0 -0
- data/ext/alphatau/native/sdl/test/sample.wav +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p01_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p01_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p01_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p02_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p02_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p02_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p03_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p03_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape1.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p05_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape1alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p07_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p07_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p07_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p08_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p08_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p08_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p09_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p09_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p09_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape1.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p11_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p11_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p11_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p12_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p12_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p13_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p13_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p13_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p14_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p14_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p15_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p15_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p15_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p16_shape1.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p16_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p16_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/trollface_24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/trollface_32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/testatomic.c +727 -0
- data/ext/alphatau/native/sdl/test/testaudiocapture.c +165 -0
- data/ext/alphatau/native/sdl/test/testaudiohotplug.c +203 -0
- data/ext/alphatau/native/sdl/test/testaudioinfo.c +74 -0
- data/ext/alphatau/native/sdl/test/testautomation.c +124 -0
- data/ext/alphatau/native/sdl/test/testautomation_audio.c +1038 -0
- data/ext/alphatau/native/sdl/test/testautomation_clipboard.c +184 -0
- data/ext/alphatau/native/sdl/test/testautomation_events.c +201 -0
- data/ext/alphatau/native/sdl/test/testautomation_hints.c +168 -0
- data/ext/alphatau/native/sdl/test/testautomation_keyboard.c +713 -0
- data/ext/alphatau/native/sdl/test/testautomation_main.c +157 -0
- data/ext/alphatau/native/sdl/test/testautomation_mouse.c +606 -0
- data/ext/alphatau/native/sdl/test/testautomation_pixels.c +529 -0
- data/ext/alphatau/native/sdl/test/testautomation_platform.c +584 -0
- data/ext/alphatau/native/sdl/test/testautomation_rect.c +1696 -0
- data/ext/alphatau/native/sdl/test/testautomation_render.c +1099 -0
- data/ext/alphatau/native/sdl/test/testautomation_rwops.c +748 -0
- data/ext/alphatau/native/sdl/test/testautomation_sdltest.c +1319 -0
- data/ext/alphatau/native/sdl/test/testautomation_stdlib.c +319 -0
- data/ext/alphatau/native/sdl/test/testautomation_suites.h +54 -0
- data/ext/alphatau/native/sdl/test/testautomation_surface.c +647 -0
- data/ext/alphatau/native/sdl/test/testautomation_syswm.c +61 -0
- data/ext/alphatau/native/sdl/test/testautomation_timer.c +201 -0
- data/ext/alphatau/native/sdl/test/testautomation_video.c +1811 -0
- data/ext/alphatau/native/sdl/test/testbounds.c +40 -0
- data/ext/alphatau/native/sdl/test/testcustomcursor.c +259 -0
- data/ext/alphatau/native/sdl/test/testdisplayinfo.c +96 -0
- data/ext/alphatau/native/sdl/test/testdraw2.c +305 -0
- data/ext/alphatau/native/sdl/test/testdrawchessboard.c +147 -0
- data/ext/alphatau/native/sdl/test/testdropfile.c +98 -0
- data/ext/alphatau/native/sdl/test/testerror.c +76 -0
- data/ext/alphatau/native/sdl/test/testfile.c +283 -0
- data/ext/alphatau/native/sdl/test/testfilesystem.c +60 -0
- data/ext/alphatau/native/sdl/test/testgamecontroller.c +375 -0
- data/ext/alphatau/native/sdl/test/testgesture.c +309 -0
- data/ext/alphatau/native/sdl/test/testgl2.c +416 -0
- data/ext/alphatau/native/sdl/test/testgles.c +355 -0
- data/ext/alphatau/native/sdl/test/testgles2.c +732 -0
- data/ext/alphatau/native/sdl/test/testhaptic.c +369 -0
- data/ext/alphatau/native/sdl/test/testhittesting.c +134 -0
- data/ext/alphatau/native/sdl/test/testhotplug.c +162 -0
- data/ext/alphatau/native/sdl/test/testiconv.c +88 -0
- data/ext/alphatau/native/sdl/test/testime.c +801 -0
- data/ext/alphatau/native/sdl/test/testintersections.c +363 -0
- data/ext/alphatau/native/sdl/test/testjoystick.c +387 -0
- data/ext/alphatau/native/sdl/test/testkeys.c +40 -0
- data/ext/alphatau/native/sdl/test/testloadso.c +82 -0
- data/ext/alphatau/native/sdl/test/testlock.c +128 -0
- data/ext/alphatau/native/sdl/test/testmessage.c +193 -0
- data/ext/alphatau/native/sdl/test/testmultiaudio.c +199 -0
- data/ext/alphatau/native/sdl/test/testnative.c +237 -0
- data/ext/alphatau/native/sdl/test/testnative.h +46 -0
- data/ext/alphatau/native/sdl/test/testnativecocoa.m +51 -0
- data/ext/alphatau/native/sdl/test/testnativew32.c +86 -0
- data/ext/alphatau/native/sdl/test/testnativex11.c +53 -0
- data/ext/alphatau/native/sdl/test/testoverlay2.c +408 -0
- data/ext/alphatau/native/sdl/test/testplatform.c +442 -0
- data/ext/alphatau/native/sdl/test/testpower.c +80 -0
- data/ext/alphatau/native/sdl/test/testqsort.c +108 -0
- data/ext/alphatau/native/sdl/test/testrelative.c +126 -0
- data/ext/alphatau/native/sdl/test/testrendercopyex.c +233 -0
- data/ext/alphatau/native/sdl/test/testrendertarget.c +335 -0
- data/ext/alphatau/native/sdl/test/testresample.c +120 -0
- data/ext/alphatau/native/sdl/test/testrumble.c +153 -0
- data/ext/alphatau/native/sdl/test/testscale.c +224 -0
- data/ext/alphatau/native/sdl/test/testsem.c +130 -0
- data/ext/alphatau/native/sdl/test/testsensor.c +117 -0
- data/ext/alphatau/native/sdl/test/testshader.c +500 -0
- data/ext/alphatau/native/sdl/test/testshape.c +200 -0
- data/ext/alphatau/native/sdl/test/testsprite2.c +409 -0
- data/ext/alphatau/native/sdl/test/testspriteminimal.c +194 -0
- data/ext/alphatau/native/sdl/test/teststreaming.c +190 -0
- data/ext/alphatau/native/sdl/test/testthread.c +130 -0
- data/ext/alphatau/native/sdl/test/testtimer.c +122 -0
- data/ext/alphatau/native/sdl/test/testver.c +47 -0
- data/ext/alphatau/native/sdl/test/testviewport.c +217 -0
- data/ext/alphatau/native/sdl/test/testvulkan.c +1201 -0
- data/ext/alphatau/native/sdl/test/testwm2.c +174 -0
- data/ext/alphatau/native/sdl/test/testyuv.bmp +0 -0
- data/ext/alphatau/native/sdl/test/testyuv.c +455 -0
- data/ext/alphatau/native/sdl/test/testyuv_cvt.c +300 -0
- data/ext/alphatau/native/sdl/test/testyuv_cvt.h +16 -0
- data/ext/alphatau/native/sdl/test/torturethread.c +113 -0
- data/ext/alphatau/native/sdl/test/utf8.txt +287 -0
- data/ext/alphatau/native/sdl/visualtest/COPYING.txt +18 -0
- data/ext/alphatau/native/sdl/visualtest/Makefile.in +37 -0
- data/ext/alphatau/native/sdl/visualtest/README.txt +214 -0
- data/ext/alphatau/native/sdl/visualtest/acinclude.m4 +359 -0
- data/ext/alphatau/native/sdl/visualtest/autogen.sh +12 -0
- data/ext/alphatau/native/sdl/visualtest/compile +1 -0
- data/ext/alphatau/native/sdl/visualtest/config.h +23 -0
- data/ext/alphatau/native/sdl/visualtest/config.h.in +22 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions +1 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters +24 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters +5 -0
- data/ext/alphatau/native/sdl/visualtest/configure +5203 -0
- data/ext/alphatau/native/sdl/visualtest/configure.in +166 -0
- data/ext/alphatau/native/sdl/visualtest/depcomp +1 -0
- data/ext/alphatau/native/sdl/visualtest/docs/Doxyfile +1936 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_action_configparser.h +149 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_exhaustive_variator.h +64 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_harness_argparser.h +75 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_mischelper.h +28 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_parsehelper.h +46 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_process.h +112 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_random_variator.h +61 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_rwhelper.h +87 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_screenshot.h +52 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_sut_configparser.h +105 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variator_common.h +122 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variators.h +66 -0
- data/ext/alphatau/native/sdl/visualtest/install-sh +1 -0
- data/ext/alphatau/native/sdl/visualtest/launch_harness.cmd +2 -0
- data/ext/alphatau/native/sdl/visualtest/launch_harness.sh +6 -0
- data/ext/alphatau/native/sdl/visualtest/missing +1 -0
- data/ext/alphatau/native/sdl/visualtest/src/action_configparser.c +396 -0
- data/ext/alphatau/native/sdl/visualtest/src/harness_argparser.c +358 -0
- data/ext/alphatau/native/sdl/visualtest/src/linux/linux_process.c +199 -0
- data/ext/alphatau/native/sdl/visualtest/src/mischelper.c +28 -0
- data/ext/alphatau/native/sdl/visualtest/src/parsehelper.c +231 -0
- data/ext/alphatau/native/sdl/visualtest/src/rwhelper.c +131 -0
- data/ext/alphatau/native/sdl/visualtest/src/screenshot.c +136 -0
- data/ext/alphatau/native/sdl/visualtest/src/sut_configparser.c +232 -0
- data/ext/alphatau/native/sdl/visualtest/src/testharness.c +533 -0
- data/ext/alphatau/native/sdl/visualtest/src/variator_common.c +225 -0
- data/ext/alphatau/native/sdl/visualtest/src/variator_exhaustive.c +132 -0
- data/ext/alphatau/native/sdl/visualtest/src/variator_random.c +111 -0
- data/ext/alphatau/native/sdl/visualtest/src/variators.c +93 -0
- data/ext/alphatau/native/sdl/visualtest/src/windows/windows_process.c +284 -0
- data/ext/alphatau/native/sdl/visualtest/src/windows/windows_screenshot.c +349 -0
- data/ext/alphatau/native/sdl/visualtest/stamp-h1 +1 -0
- data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.config +6 -0
- data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.parameters +29 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.actions +1 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.c +101 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.parameters +3 -0
- data/ext/alphatau/native/sdl/wayland-protocols/pointer-constraints-unstable-v1.xml +339 -0
- data/ext/alphatau/native/sdl/wayland-protocols/relative-pointer-unstable-v1.xml +136 -0
- data/ext/alphatau/native/sdl/wayland-protocols/wayland.xml +2746 -0
- data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell-unstable-v6.xml +1044 -0
- data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell.xml +1120 -0
- data/lib/alphatau.rb +12 -0
- data/lib/alphatau/version.rb +3 -0
- metadata +1465 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
/*
|
2
|
+
Simple DirectMedia Layer
|
3
|
+
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
4
|
+
|
5
|
+
This software is provided 'as-is', without any express or implied
|
6
|
+
warranty. In no event will the authors be held liable for any damages
|
7
|
+
arising from the use of this software.
|
8
|
+
|
9
|
+
Permission is granted to anyone to use this software for any purpose,
|
10
|
+
including commercial applications, and to alter it and redistribute it
|
11
|
+
freely, subject to the following restrictions:
|
12
|
+
|
13
|
+
1. The origin of this software must not be misrepresented; you must not
|
14
|
+
claim that you wrote the original software. If you use this software
|
15
|
+
in a product, an acknowledgment in the product documentation would be
|
16
|
+
appreciated but is not required.
|
17
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
18
|
+
misrepresented as being the original software.
|
19
|
+
3. This notice may not be removed or altered from any source distribution.
|
20
|
+
*/
|
21
|
+
#ifndef SDL_vulkan_internal_h_
|
22
|
+
#define SDL_vulkan_internal_h_
|
23
|
+
|
24
|
+
#include "../SDL_internal.h"
|
25
|
+
|
26
|
+
#include "SDL_stdinc.h"
|
27
|
+
|
28
|
+
#if defined(SDL_LOADSO_DISABLED)
|
29
|
+
#undef SDL_VIDEO_VULKAN
|
30
|
+
#define SDL_VIDEO_VULKAN 0
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#if SDL_VIDEO_VULKAN
|
34
|
+
|
35
|
+
#if SDL_VIDEO_DRIVER_ANDROID
|
36
|
+
#define VK_USE_PLATFORM_ANDROID_KHR
|
37
|
+
#endif
|
38
|
+
#if SDL_VIDEO_DRIVER_COCOA
|
39
|
+
#define VK_USE_PLATFORM_MACOS_MVK
|
40
|
+
#endif
|
41
|
+
#if SDL_VIDEO_DRIVER_MIR
|
42
|
+
#define VK_USE_PLATFORM_MIR_KHR
|
43
|
+
#endif
|
44
|
+
#if SDL_VIDEO_DRIVER_UIKIT
|
45
|
+
#define VK_USE_PLATFORM_IOS_MVK
|
46
|
+
#endif
|
47
|
+
#if SDL_VIDEO_DRIVER_WAYLAND
|
48
|
+
#define VK_USE_PLATFORM_WAYLAND_KHR
|
49
|
+
#include "wayland/SDL_waylanddyn.h"
|
50
|
+
#endif
|
51
|
+
#if SDL_VIDEO_DRIVER_WINDOWS
|
52
|
+
#define VK_USE_PLATFORM_WIN32_KHR
|
53
|
+
#include "../core/windows/SDL_windows.h"
|
54
|
+
#endif
|
55
|
+
#if SDL_VIDEO_DRIVER_X11
|
56
|
+
#define VK_USE_PLATFORM_XLIB_KHR
|
57
|
+
#define VK_USE_PLATFORM_XCB_KHR
|
58
|
+
#endif
|
59
|
+
|
60
|
+
#define VK_NO_PROTOTYPES
|
61
|
+
#include "./khronos/vulkan/vulkan.h"
|
62
|
+
|
63
|
+
#include "SDL_vulkan.h"
|
64
|
+
|
65
|
+
|
66
|
+
extern const char *SDL_Vulkan_GetResultString(VkResult result);
|
67
|
+
|
68
|
+
extern VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
|
69
|
+
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties,
|
70
|
+
Uint32 *extensionCount); /* free returned list with SDL_free */
|
71
|
+
|
72
|
+
/* Implements functionality of SDL_Vulkan_GetInstanceExtensions for a list of
|
73
|
+
* names passed in nameCount and names. */
|
74
|
+
extern SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
|
75
|
+
const char **userNames,
|
76
|
+
unsigned nameCount,
|
77
|
+
const char *const *names);
|
78
|
+
|
79
|
+
#else
|
80
|
+
|
81
|
+
/* No SDL Vulkan support, just include the header for typedefs */
|
82
|
+
#include "SDL_vulkan.h"
|
83
|
+
|
84
|
+
typedef void (*PFN_vkGetInstanceProcAddr) (void);
|
85
|
+
typedef int (*PFN_vkEnumerateInstanceExtensionProperties) (void);
|
86
|
+
|
87
|
+
#endif /* SDL_VIDEO_VULKAN */
|
88
|
+
|
89
|
+
#endif /* SDL_vulkan_internal_h_ */
|
90
|
+
|
91
|
+
/* vi: set ts=4 sw=4 expandtab: */
|
@@ -0,0 +1,172 @@
|
|
1
|
+
/*
|
2
|
+
Simple DirectMedia Layer
|
3
|
+
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
4
|
+
|
5
|
+
This software is provided 'as-is', without any express or implied
|
6
|
+
warranty. In no event will the authors be held liable for any damages
|
7
|
+
arising from the use of this software.
|
8
|
+
|
9
|
+
Permission is granted to anyone to use this software for any purpose,
|
10
|
+
including commercial applications, and to alter it and redistribute it
|
11
|
+
freely, subject to the following restrictions:
|
12
|
+
|
13
|
+
1. The origin of this software must not be misrepresented; you must not
|
14
|
+
claim that you wrote the original software. If you use this software
|
15
|
+
in a product, an acknowledgment in the product documentation would be
|
16
|
+
appreciated but is not required.
|
17
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
18
|
+
misrepresented as being the original software.
|
19
|
+
3. This notice may not be removed or altered from any source distribution.
|
20
|
+
*/
|
21
|
+
#include "../SDL_internal.h"
|
22
|
+
|
23
|
+
#include "SDL_vulkan_internal.h"
|
24
|
+
#include "SDL_error.h"
|
25
|
+
|
26
|
+
#if SDL_VIDEO_VULKAN
|
27
|
+
|
28
|
+
const char *SDL_Vulkan_GetResultString(VkResult result)
|
29
|
+
{
|
30
|
+
switch((int)result)
|
31
|
+
{
|
32
|
+
case VK_SUCCESS:
|
33
|
+
return "VK_SUCCESS";
|
34
|
+
case VK_NOT_READY:
|
35
|
+
return "VK_NOT_READY";
|
36
|
+
case VK_TIMEOUT:
|
37
|
+
return "VK_TIMEOUT";
|
38
|
+
case VK_EVENT_SET:
|
39
|
+
return "VK_EVENT_SET";
|
40
|
+
case VK_EVENT_RESET:
|
41
|
+
return "VK_EVENT_RESET";
|
42
|
+
case VK_INCOMPLETE:
|
43
|
+
return "VK_INCOMPLETE";
|
44
|
+
case VK_ERROR_OUT_OF_HOST_MEMORY:
|
45
|
+
return "VK_ERROR_OUT_OF_HOST_MEMORY";
|
46
|
+
case VK_ERROR_OUT_OF_DEVICE_MEMORY:
|
47
|
+
return "VK_ERROR_OUT_OF_DEVICE_MEMORY";
|
48
|
+
case VK_ERROR_INITIALIZATION_FAILED:
|
49
|
+
return "VK_ERROR_INITIALIZATION_FAILED";
|
50
|
+
case VK_ERROR_DEVICE_LOST:
|
51
|
+
return "VK_ERROR_DEVICE_LOST";
|
52
|
+
case VK_ERROR_MEMORY_MAP_FAILED:
|
53
|
+
return "VK_ERROR_MEMORY_MAP_FAILED";
|
54
|
+
case VK_ERROR_LAYER_NOT_PRESENT:
|
55
|
+
return "VK_ERROR_LAYER_NOT_PRESENT";
|
56
|
+
case VK_ERROR_EXTENSION_NOT_PRESENT:
|
57
|
+
return "VK_ERROR_EXTENSION_NOT_PRESENT";
|
58
|
+
case VK_ERROR_FEATURE_NOT_PRESENT:
|
59
|
+
return "VK_ERROR_FEATURE_NOT_PRESENT";
|
60
|
+
case VK_ERROR_INCOMPATIBLE_DRIVER:
|
61
|
+
return "VK_ERROR_INCOMPATIBLE_DRIVER";
|
62
|
+
case VK_ERROR_TOO_MANY_OBJECTS:
|
63
|
+
return "VK_ERROR_TOO_MANY_OBJECTS";
|
64
|
+
case VK_ERROR_FORMAT_NOT_SUPPORTED:
|
65
|
+
return "VK_ERROR_FORMAT_NOT_SUPPORTED";
|
66
|
+
case VK_ERROR_FRAGMENTED_POOL:
|
67
|
+
return "VK_ERROR_FRAGMENTED_POOL";
|
68
|
+
case VK_ERROR_SURFACE_LOST_KHR:
|
69
|
+
return "VK_ERROR_SURFACE_LOST_KHR";
|
70
|
+
case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR:
|
71
|
+
return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR";
|
72
|
+
case VK_SUBOPTIMAL_KHR:
|
73
|
+
return "VK_SUBOPTIMAL_KHR";
|
74
|
+
case VK_ERROR_OUT_OF_DATE_KHR:
|
75
|
+
return "VK_ERROR_OUT_OF_DATE_KHR";
|
76
|
+
case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR:
|
77
|
+
return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR";
|
78
|
+
case VK_ERROR_VALIDATION_FAILED_EXT:
|
79
|
+
return "VK_ERROR_VALIDATION_FAILED_EXT";
|
80
|
+
case VK_ERROR_OUT_OF_POOL_MEMORY_KHR:
|
81
|
+
return "VK_ERROR_OUT_OF_POOL_MEMORY_KHR";
|
82
|
+
case VK_ERROR_INVALID_SHADER_NV:
|
83
|
+
return "VK_ERROR_INVALID_SHADER_NV";
|
84
|
+
case VK_RESULT_MAX_ENUM:
|
85
|
+
case VK_RESULT_RANGE_SIZE:
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
if(result < 0)
|
89
|
+
return "VK_ERROR_<Unknown>";
|
90
|
+
return "VK_<Unknown>";
|
91
|
+
}
|
92
|
+
|
93
|
+
VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
|
94
|
+
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties,
|
95
|
+
Uint32 *extensionCount)
|
96
|
+
{
|
97
|
+
Uint32 count = 0;
|
98
|
+
VkResult result = vkEnumerateInstanceExtensionProperties(NULL, &count, NULL);
|
99
|
+
VkExtensionProperties *retval;
|
100
|
+
if(result == VK_ERROR_INCOMPATIBLE_DRIVER)
|
101
|
+
{
|
102
|
+
/* Avoid the ERR_MAX_STRLEN limit by passing part of the message
|
103
|
+
* as a string argument.
|
104
|
+
*/
|
105
|
+
SDL_SetError(
|
106
|
+
"You probably don't have a working Vulkan driver installed. %s %s %s(%d)",
|
107
|
+
"Getting Vulkan extensions failed:",
|
108
|
+
"vkEnumerateInstanceExtensionProperties returned",
|
109
|
+
SDL_Vulkan_GetResultString(result),
|
110
|
+
(int)result);
|
111
|
+
return NULL;
|
112
|
+
}
|
113
|
+
else if(result != VK_SUCCESS)
|
114
|
+
{
|
115
|
+
SDL_SetError(
|
116
|
+
"Getting Vulkan extensions failed: vkEnumerateInstanceExtensionProperties returned "
|
117
|
+
"%s(%d)",
|
118
|
+
SDL_Vulkan_GetResultString(result),
|
119
|
+
(int)result);
|
120
|
+
return NULL;
|
121
|
+
}
|
122
|
+
if(count == 0)
|
123
|
+
{
|
124
|
+
retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null
|
125
|
+
}
|
126
|
+
else
|
127
|
+
{
|
128
|
+
retval = SDL_calloc(count, sizeof(VkExtensionProperties));
|
129
|
+
}
|
130
|
+
if(!retval)
|
131
|
+
{
|
132
|
+
SDL_OutOfMemory();
|
133
|
+
return NULL;
|
134
|
+
}
|
135
|
+
result = vkEnumerateInstanceExtensionProperties(NULL, &count, retval);
|
136
|
+
if(result != VK_SUCCESS)
|
137
|
+
{
|
138
|
+
SDL_SetError(
|
139
|
+
"Getting Vulkan extensions failed: vkEnumerateInstanceExtensionProperties returned "
|
140
|
+
"%s(%d)",
|
141
|
+
SDL_Vulkan_GetResultString(result),
|
142
|
+
(int)result);
|
143
|
+
SDL_free(retval);
|
144
|
+
return NULL;
|
145
|
+
}
|
146
|
+
*extensionCount = count;
|
147
|
+
return retval;
|
148
|
+
}
|
149
|
+
|
150
|
+
SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
|
151
|
+
const char **userNames,
|
152
|
+
unsigned nameCount,
|
153
|
+
const char *const *names)
|
154
|
+
{
|
155
|
+
if (userNames) {
|
156
|
+
unsigned i;
|
157
|
+
|
158
|
+
if (*userCount < nameCount) {
|
159
|
+
SDL_SetError("Output array for SDL_Vulkan_GetInstanceExtensions needs to be at least %d big", nameCount);
|
160
|
+
return SDL_FALSE;
|
161
|
+
}
|
162
|
+
for (i = 0; i < nameCount; i++) {
|
163
|
+
userNames[i] = names[i];
|
164
|
+
}
|
165
|
+
}
|
166
|
+
*userCount = nameCount;
|
167
|
+
return SDL_TRUE;
|
168
|
+
}
|
169
|
+
|
170
|
+
#endif
|
171
|
+
|
172
|
+
/* vi: set ts=4 sw=4 expandtab: */
|
@@ -0,0 +1,1834 @@
|
|
1
|
+
/*
|
2
|
+
Simple DirectMedia Layer
|
3
|
+
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
4
|
+
|
5
|
+
This software is provided 'as-is', without any express or implied
|
6
|
+
warranty. In no event will the authors be held liable for any damages
|
7
|
+
arising from the use of this software.
|
8
|
+
|
9
|
+
Permission is granted to anyone to use this software for any purpose,
|
10
|
+
including commercial applications, and to alter it and redistribute it
|
11
|
+
freely, subject to the following restrictions:
|
12
|
+
|
13
|
+
1. The origin of this software must not be misrepresented; you must not
|
14
|
+
claim that you wrote the original software. If you use this software
|
15
|
+
in a product, an acknowledgment in the product documentation would be
|
16
|
+
appreciated but is not required.
|
17
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
18
|
+
misrepresented as being the original software.
|
19
|
+
3. This notice may not be removed or altered from any source distribution.
|
20
|
+
*/
|
21
|
+
#include "../SDL_internal.h"
|
22
|
+
|
23
|
+
#include "SDL_endian.h"
|
24
|
+
#include "SDL_video.h"
|
25
|
+
#include "SDL_pixels_c.h"
|
26
|
+
|
27
|
+
#include "yuv2rgb/yuv_rgb.h"
|
28
|
+
|
29
|
+
#define SDL_YUV_SD_THRESHOLD 576
|
30
|
+
|
31
|
+
|
32
|
+
static SDL_YUV_CONVERSION_MODE SDL_YUV_ConversionMode = SDL_YUV_CONVERSION_BT601;
|
33
|
+
|
34
|
+
|
35
|
+
void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode)
|
36
|
+
{
|
37
|
+
SDL_YUV_ConversionMode = mode;
|
38
|
+
}
|
39
|
+
|
40
|
+
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode()
|
41
|
+
{
|
42
|
+
return SDL_YUV_ConversionMode;
|
43
|
+
}
|
44
|
+
|
45
|
+
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int height)
|
46
|
+
{
|
47
|
+
SDL_YUV_CONVERSION_MODE mode = SDL_GetYUVConversionMode();
|
48
|
+
if (mode == SDL_YUV_CONVERSION_AUTOMATIC) {
|
49
|
+
if (height <= SDL_YUV_SD_THRESHOLD) {
|
50
|
+
mode = SDL_YUV_CONVERSION_BT601;
|
51
|
+
} else {
|
52
|
+
mode = SDL_YUV_CONVERSION_BT709;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
return mode;
|
56
|
+
}
|
57
|
+
|
58
|
+
static int GetYUVConversionType(int width, int height, YCbCrType *yuv_type)
|
59
|
+
{
|
60
|
+
switch (SDL_GetYUVConversionModeForResolution(width, height)) {
|
61
|
+
case SDL_YUV_CONVERSION_JPEG:
|
62
|
+
*yuv_type = YCBCR_JPEG;
|
63
|
+
break;
|
64
|
+
case SDL_YUV_CONVERSION_BT601:
|
65
|
+
*yuv_type = YCBCR_601;
|
66
|
+
break;
|
67
|
+
case SDL_YUV_CONVERSION_BT709:
|
68
|
+
*yuv_type = YCBCR_709;
|
69
|
+
break;
|
70
|
+
default:
|
71
|
+
return SDL_SetError("Unexpected YUV conversion mode");
|
72
|
+
}
|
73
|
+
return 0;
|
74
|
+
}
|
75
|
+
|
76
|
+
static SDL_bool IsPlanar2x2Format(Uint32 format)
|
77
|
+
{
|
78
|
+
return (format == SDL_PIXELFORMAT_YV12 ||
|
79
|
+
format == SDL_PIXELFORMAT_IYUV ||
|
80
|
+
format == SDL_PIXELFORMAT_NV12 ||
|
81
|
+
format == SDL_PIXELFORMAT_NV21);
|
82
|
+
}
|
83
|
+
|
84
|
+
static SDL_bool IsPacked4Format(Uint32 format)
|
85
|
+
{
|
86
|
+
return (format == SDL_PIXELFORMAT_YUY2 ||
|
87
|
+
format == SDL_PIXELFORMAT_UYVY ||
|
88
|
+
format == SDL_PIXELFORMAT_YVYU);
|
89
|
+
}
|
90
|
+
|
91
|
+
static int GetYUVPlanes(int width, int height, Uint32 format, const void *yuv, int yuv_pitch,
|
92
|
+
const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride)
|
93
|
+
{
|
94
|
+
const Uint8 *planes[3] = { NULL, NULL, NULL };
|
95
|
+
int pitches[3] = { 0, 0, 0 };
|
96
|
+
|
97
|
+
switch (format) {
|
98
|
+
case SDL_PIXELFORMAT_YV12:
|
99
|
+
case SDL_PIXELFORMAT_IYUV:
|
100
|
+
pitches[0] = yuv_pitch;
|
101
|
+
pitches[1] = (pitches[0] + 1) / 2;
|
102
|
+
pitches[2] = (pitches[0] + 1) / 2;
|
103
|
+
planes[0] = (const Uint8 *)yuv;
|
104
|
+
planes[1] = planes[0] + pitches[0] * height;
|
105
|
+
planes[2] = planes[1] + pitches[1] * ((height + 1) / 2);
|
106
|
+
break;
|
107
|
+
case SDL_PIXELFORMAT_YUY2:
|
108
|
+
case SDL_PIXELFORMAT_UYVY:
|
109
|
+
case SDL_PIXELFORMAT_YVYU:
|
110
|
+
pitches[0] = yuv_pitch;
|
111
|
+
planes[0] = (const Uint8 *)yuv;
|
112
|
+
break;
|
113
|
+
case SDL_PIXELFORMAT_NV12:
|
114
|
+
case SDL_PIXELFORMAT_NV21:
|
115
|
+
pitches[0] = yuv_pitch;
|
116
|
+
pitches[1] = 2 * ((pitches[0] + 1) / 2);
|
117
|
+
planes[0] = (const Uint8 *)yuv;
|
118
|
+
planes[1] = planes[0] + pitches[0] * height;
|
119
|
+
break;
|
120
|
+
default:
|
121
|
+
return SDL_SetError("GetYUVPlanes(): Unsupported YUV format: %s", SDL_GetPixelFormatName(format));
|
122
|
+
}
|
123
|
+
|
124
|
+
switch (format) {
|
125
|
+
case SDL_PIXELFORMAT_YV12:
|
126
|
+
*y = planes[0];
|
127
|
+
*y_stride = pitches[0];
|
128
|
+
*v = planes[1];
|
129
|
+
*u = planes[2];
|
130
|
+
*uv_stride = pitches[1];
|
131
|
+
break;
|
132
|
+
case SDL_PIXELFORMAT_IYUV:
|
133
|
+
*y = planes[0];
|
134
|
+
*y_stride = pitches[0];
|
135
|
+
*v = planes[2];
|
136
|
+
*u = planes[1];
|
137
|
+
*uv_stride = pitches[1];
|
138
|
+
break;
|
139
|
+
case SDL_PIXELFORMAT_YUY2:
|
140
|
+
*y = planes[0];
|
141
|
+
*y_stride = pitches[0];
|
142
|
+
*v = *y + 3;
|
143
|
+
*u = *y + 1;
|
144
|
+
*uv_stride = pitches[0];
|
145
|
+
break;
|
146
|
+
case SDL_PIXELFORMAT_UYVY:
|
147
|
+
*y = planes[0] + 1;
|
148
|
+
*y_stride = pitches[0];
|
149
|
+
*v = *y + 1;
|
150
|
+
*u = *y - 1;
|
151
|
+
*uv_stride = pitches[0];
|
152
|
+
break;
|
153
|
+
case SDL_PIXELFORMAT_YVYU:
|
154
|
+
*y = planes[0];
|
155
|
+
*y_stride = pitches[0];
|
156
|
+
*v = *y + 1;
|
157
|
+
*u = *y + 3;
|
158
|
+
*uv_stride = pitches[0];
|
159
|
+
break;
|
160
|
+
case SDL_PIXELFORMAT_NV12:
|
161
|
+
*y = planes[0];
|
162
|
+
*y_stride = pitches[0];
|
163
|
+
*u = planes[1];
|
164
|
+
*v = *u + 1;
|
165
|
+
*uv_stride = pitches[1];
|
166
|
+
break;
|
167
|
+
case SDL_PIXELFORMAT_NV21:
|
168
|
+
*y = planes[0];
|
169
|
+
*y_stride = pitches[0];
|
170
|
+
*v = planes[1];
|
171
|
+
*u = *v + 1;
|
172
|
+
*uv_stride = pitches[1];
|
173
|
+
break;
|
174
|
+
default:
|
175
|
+
/* Should have caught this above */
|
176
|
+
return SDL_SetError("GetYUVPlanes[2]: Unsupported YUV format: %s", SDL_GetPixelFormatName(format));
|
177
|
+
}
|
178
|
+
return 0;
|
179
|
+
}
|
180
|
+
|
181
|
+
static SDL_bool yuv_rgb_sse(
|
182
|
+
Uint32 src_format, Uint32 dst_format,
|
183
|
+
Uint32 width, Uint32 height,
|
184
|
+
const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride,
|
185
|
+
Uint8 *rgb, Uint32 rgb_stride,
|
186
|
+
YCbCrType yuv_type)
|
187
|
+
{
|
188
|
+
#ifdef __SSE2__
|
189
|
+
if (!SDL_HasSSE2()) {
|
190
|
+
return SDL_FALSE;
|
191
|
+
}
|
192
|
+
|
193
|
+
if (src_format == SDL_PIXELFORMAT_YV12 ||
|
194
|
+
src_format == SDL_PIXELFORMAT_IYUV) {
|
195
|
+
|
196
|
+
switch (dst_format) {
|
197
|
+
case SDL_PIXELFORMAT_RGB565:
|
198
|
+
yuv420_rgb565_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
199
|
+
return SDL_TRUE;
|
200
|
+
case SDL_PIXELFORMAT_RGB24:
|
201
|
+
yuv420_rgb24_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
202
|
+
return SDL_TRUE;
|
203
|
+
case SDL_PIXELFORMAT_RGBX8888:
|
204
|
+
case SDL_PIXELFORMAT_RGBA8888:
|
205
|
+
yuv420_rgba_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
206
|
+
return SDL_TRUE;
|
207
|
+
case SDL_PIXELFORMAT_BGRX8888:
|
208
|
+
case SDL_PIXELFORMAT_BGRA8888:
|
209
|
+
yuv420_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
210
|
+
return SDL_TRUE;
|
211
|
+
case SDL_PIXELFORMAT_RGB888:
|
212
|
+
case SDL_PIXELFORMAT_ARGB8888:
|
213
|
+
yuv420_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
214
|
+
return SDL_TRUE;
|
215
|
+
case SDL_PIXELFORMAT_BGR888:
|
216
|
+
case SDL_PIXELFORMAT_ABGR8888:
|
217
|
+
yuv420_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
218
|
+
return SDL_TRUE;
|
219
|
+
default:
|
220
|
+
break;
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
if (src_format == SDL_PIXELFORMAT_YUY2 ||
|
225
|
+
src_format == SDL_PIXELFORMAT_UYVY ||
|
226
|
+
src_format == SDL_PIXELFORMAT_YVYU) {
|
227
|
+
|
228
|
+
switch (dst_format) {
|
229
|
+
case SDL_PIXELFORMAT_RGB565:
|
230
|
+
yuv422_rgb565_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
231
|
+
return SDL_TRUE;
|
232
|
+
case SDL_PIXELFORMAT_RGB24:
|
233
|
+
yuv422_rgb24_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
234
|
+
return SDL_TRUE;
|
235
|
+
case SDL_PIXELFORMAT_RGBX8888:
|
236
|
+
case SDL_PIXELFORMAT_RGBA8888:
|
237
|
+
yuv422_rgba_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
238
|
+
return SDL_TRUE;
|
239
|
+
case SDL_PIXELFORMAT_BGRX8888:
|
240
|
+
case SDL_PIXELFORMAT_BGRA8888:
|
241
|
+
yuv422_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
242
|
+
return SDL_TRUE;
|
243
|
+
case SDL_PIXELFORMAT_RGB888:
|
244
|
+
case SDL_PIXELFORMAT_ARGB8888:
|
245
|
+
yuv422_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
246
|
+
return SDL_TRUE;
|
247
|
+
case SDL_PIXELFORMAT_BGR888:
|
248
|
+
case SDL_PIXELFORMAT_ABGR8888:
|
249
|
+
yuv422_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
250
|
+
return SDL_TRUE;
|
251
|
+
default:
|
252
|
+
break;
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
if (src_format == SDL_PIXELFORMAT_NV12 ||
|
257
|
+
src_format == SDL_PIXELFORMAT_NV21) {
|
258
|
+
|
259
|
+
switch (dst_format) {
|
260
|
+
case SDL_PIXELFORMAT_RGB565:
|
261
|
+
yuvnv12_rgb565_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
262
|
+
return SDL_TRUE;
|
263
|
+
case SDL_PIXELFORMAT_RGB24:
|
264
|
+
yuvnv12_rgb24_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
265
|
+
return SDL_TRUE;
|
266
|
+
case SDL_PIXELFORMAT_RGBX8888:
|
267
|
+
case SDL_PIXELFORMAT_RGBA8888:
|
268
|
+
yuvnv12_rgba_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
269
|
+
return SDL_TRUE;
|
270
|
+
case SDL_PIXELFORMAT_BGRX8888:
|
271
|
+
case SDL_PIXELFORMAT_BGRA8888:
|
272
|
+
yuvnv12_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
273
|
+
return SDL_TRUE;
|
274
|
+
case SDL_PIXELFORMAT_RGB888:
|
275
|
+
case SDL_PIXELFORMAT_ARGB8888:
|
276
|
+
yuvnv12_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
277
|
+
return SDL_TRUE;
|
278
|
+
case SDL_PIXELFORMAT_BGR888:
|
279
|
+
case SDL_PIXELFORMAT_ABGR8888:
|
280
|
+
yuvnv12_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
281
|
+
return SDL_TRUE;
|
282
|
+
default:
|
283
|
+
break;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
#endif
|
287
|
+
return SDL_FALSE;
|
288
|
+
}
|
289
|
+
|
290
|
+
static SDL_bool yuv_rgb_std(
|
291
|
+
Uint32 src_format, Uint32 dst_format,
|
292
|
+
Uint32 width, Uint32 height,
|
293
|
+
const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride,
|
294
|
+
Uint8 *rgb, Uint32 rgb_stride,
|
295
|
+
YCbCrType yuv_type)
|
296
|
+
{
|
297
|
+
if (src_format == SDL_PIXELFORMAT_YV12 ||
|
298
|
+
src_format == SDL_PIXELFORMAT_IYUV) {
|
299
|
+
|
300
|
+
switch (dst_format) {
|
301
|
+
case SDL_PIXELFORMAT_RGB565:
|
302
|
+
yuv420_rgb565_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
303
|
+
return SDL_TRUE;
|
304
|
+
case SDL_PIXELFORMAT_RGB24:
|
305
|
+
yuv420_rgb24_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
306
|
+
return SDL_TRUE;
|
307
|
+
case SDL_PIXELFORMAT_RGBX8888:
|
308
|
+
case SDL_PIXELFORMAT_RGBA8888:
|
309
|
+
yuv420_rgba_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
310
|
+
return SDL_TRUE;
|
311
|
+
case SDL_PIXELFORMAT_BGRX8888:
|
312
|
+
case SDL_PIXELFORMAT_BGRA8888:
|
313
|
+
yuv420_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
314
|
+
return SDL_TRUE;
|
315
|
+
case SDL_PIXELFORMAT_RGB888:
|
316
|
+
case SDL_PIXELFORMAT_ARGB8888:
|
317
|
+
yuv420_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
318
|
+
return SDL_TRUE;
|
319
|
+
case SDL_PIXELFORMAT_BGR888:
|
320
|
+
case SDL_PIXELFORMAT_ABGR8888:
|
321
|
+
yuv420_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
322
|
+
return SDL_TRUE;
|
323
|
+
default:
|
324
|
+
break;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
if (src_format == SDL_PIXELFORMAT_YUY2 ||
|
329
|
+
src_format == SDL_PIXELFORMAT_UYVY ||
|
330
|
+
src_format == SDL_PIXELFORMAT_YVYU) {
|
331
|
+
|
332
|
+
switch (dst_format) {
|
333
|
+
case SDL_PIXELFORMAT_RGB565:
|
334
|
+
yuv422_rgb565_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
335
|
+
return SDL_TRUE;
|
336
|
+
case SDL_PIXELFORMAT_RGB24:
|
337
|
+
yuv422_rgb24_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
338
|
+
return SDL_TRUE;
|
339
|
+
case SDL_PIXELFORMAT_RGBX8888:
|
340
|
+
case SDL_PIXELFORMAT_RGBA8888:
|
341
|
+
yuv422_rgba_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
342
|
+
return SDL_TRUE;
|
343
|
+
case SDL_PIXELFORMAT_BGRX8888:
|
344
|
+
case SDL_PIXELFORMAT_BGRA8888:
|
345
|
+
yuv422_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
346
|
+
return SDL_TRUE;
|
347
|
+
case SDL_PIXELFORMAT_RGB888:
|
348
|
+
case SDL_PIXELFORMAT_ARGB8888:
|
349
|
+
yuv422_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
350
|
+
return SDL_TRUE;
|
351
|
+
case SDL_PIXELFORMAT_BGR888:
|
352
|
+
case SDL_PIXELFORMAT_ABGR8888:
|
353
|
+
yuv422_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
354
|
+
return SDL_TRUE;
|
355
|
+
default:
|
356
|
+
break;
|
357
|
+
}
|
358
|
+
}
|
359
|
+
|
360
|
+
if (src_format == SDL_PIXELFORMAT_NV12 ||
|
361
|
+
src_format == SDL_PIXELFORMAT_NV21) {
|
362
|
+
|
363
|
+
switch (dst_format) {
|
364
|
+
case SDL_PIXELFORMAT_RGB565:
|
365
|
+
yuvnv12_rgb565_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
366
|
+
return SDL_TRUE;
|
367
|
+
case SDL_PIXELFORMAT_RGB24:
|
368
|
+
yuvnv12_rgb24_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
369
|
+
return SDL_TRUE;
|
370
|
+
case SDL_PIXELFORMAT_RGBX8888:
|
371
|
+
case SDL_PIXELFORMAT_RGBA8888:
|
372
|
+
yuvnv12_rgba_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
373
|
+
return SDL_TRUE;
|
374
|
+
case SDL_PIXELFORMAT_BGRX8888:
|
375
|
+
case SDL_PIXELFORMAT_BGRA8888:
|
376
|
+
yuvnv12_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
377
|
+
return SDL_TRUE;
|
378
|
+
case SDL_PIXELFORMAT_RGB888:
|
379
|
+
case SDL_PIXELFORMAT_ARGB8888:
|
380
|
+
yuvnv12_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
381
|
+
return SDL_TRUE;
|
382
|
+
case SDL_PIXELFORMAT_BGR888:
|
383
|
+
case SDL_PIXELFORMAT_ABGR8888:
|
384
|
+
yuvnv12_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
|
385
|
+
return SDL_TRUE;
|
386
|
+
default:
|
387
|
+
break;
|
388
|
+
}
|
389
|
+
}
|
390
|
+
return SDL_FALSE;
|
391
|
+
}
|
392
|
+
|
393
|
+
int
|
394
|
+
SDL_ConvertPixels_YUV_to_RGB(int width, int height,
|
395
|
+
Uint32 src_format, const void *src, int src_pitch,
|
396
|
+
Uint32 dst_format, void *dst, int dst_pitch)
|
397
|
+
{
|
398
|
+
const Uint8 *y = NULL;
|
399
|
+
const Uint8 *u = NULL;
|
400
|
+
const Uint8 *v = NULL;
|
401
|
+
Uint32 y_stride = 0;
|
402
|
+
Uint32 uv_stride = 0;
|
403
|
+
YCbCrType yuv_type = YCBCR_601;
|
404
|
+
|
405
|
+
if (GetYUVPlanes(width, height, src_format, src, src_pitch, &y, &u, &v, &y_stride, &uv_stride) < 0) {
|
406
|
+
return -1;
|
407
|
+
}
|
408
|
+
|
409
|
+
if (GetYUVConversionType(width, height, &yuv_type) < 0) {
|
410
|
+
return -1;
|
411
|
+
}
|
412
|
+
|
413
|
+
if (yuv_rgb_sse(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8*)dst, dst_pitch, yuv_type)) {
|
414
|
+
return 0;
|
415
|
+
}
|
416
|
+
|
417
|
+
if (yuv_rgb_std(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8*)dst, dst_pitch, yuv_type)) {
|
418
|
+
return 0;
|
419
|
+
}
|
420
|
+
|
421
|
+
/* No fast path for the RGB format, instead convert using an intermediate buffer */
|
422
|
+
if (dst_format != SDL_PIXELFORMAT_ARGB8888) {
|
423
|
+
int ret;
|
424
|
+
void *tmp;
|
425
|
+
int tmp_pitch = (width * sizeof(Uint32));
|
426
|
+
|
427
|
+
tmp = SDL_malloc(tmp_pitch * height);
|
428
|
+
if (tmp == NULL) {
|
429
|
+
return SDL_OutOfMemory();
|
430
|
+
}
|
431
|
+
|
432
|
+
/* convert src/src_format to tmp/ARGB8888 */
|
433
|
+
ret = SDL_ConvertPixels_YUV_to_RGB(width, height, src_format, src, src_pitch, SDL_PIXELFORMAT_ARGB8888, tmp, tmp_pitch);
|
434
|
+
if (ret < 0) {
|
435
|
+
SDL_free(tmp);
|
436
|
+
return ret;
|
437
|
+
}
|
438
|
+
|
439
|
+
/* convert tmp/ARGB8888 to dst/RGB */
|
440
|
+
ret = SDL_ConvertPixels(width, height, SDL_PIXELFORMAT_ARGB8888, tmp, tmp_pitch, dst_format, dst, dst_pitch);
|
441
|
+
SDL_free(tmp);
|
442
|
+
return ret;
|
443
|
+
}
|
444
|
+
|
445
|
+
return SDL_SetError("Unsupported YUV conversion");
|
446
|
+
}
|
447
|
+
|
448
|
+
struct RGB2YUVFactors
|
449
|
+
{
|
450
|
+
int y_offset;
|
451
|
+
float y[3]; /* Rfactor, Gfactor, Bfactor */
|
452
|
+
float u[3]; /* Rfactor, Gfactor, Bfactor */
|
453
|
+
float v[3]; /* Rfactor, Gfactor, Bfactor */
|
454
|
+
};
|
455
|
+
|
456
|
+
static int
|
457
|
+
SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
|
458
|
+
{
|
459
|
+
const int src_pitch_x_2 = src_pitch * 2;
|
460
|
+
const int height_half = height / 2;
|
461
|
+
const int height_remainder = (height & 0x1);
|
462
|
+
const int width_half = width / 2;
|
463
|
+
const int width_remainder = (width & 0x1);
|
464
|
+
int i, j;
|
465
|
+
|
466
|
+
static struct RGB2YUVFactors RGB2YUVFactorTables[SDL_YUV_CONVERSION_BT709 + 1] =
|
467
|
+
{
|
468
|
+
/* ITU-T T.871 (JPEG) */
|
469
|
+
{
|
470
|
+
0,
|
471
|
+
{ 0.2990f, 0.5870f, 0.1140f },
|
472
|
+
{ -0.1687f, -0.3313f, 0.5000f },
|
473
|
+
{ 0.5000f, -0.4187f, -0.0813f },
|
474
|
+
},
|
475
|
+
/* ITU-R BT.601-7 */
|
476
|
+
{
|
477
|
+
16,
|
478
|
+
{ 0.2568f, 0.5041f, 0.0979f },
|
479
|
+
{ -0.1482f, -0.2910f, 0.4392f },
|
480
|
+
{ 0.4392f, -0.3678f, -0.0714f },
|
481
|
+
},
|
482
|
+
/* ITU-R BT.709-6 */
|
483
|
+
{
|
484
|
+
16,
|
485
|
+
{ 0.1826f, 0.6142f, 0.0620f },
|
486
|
+
{-0.1006f, -0.3386f, 0.4392f },
|
487
|
+
{ 0.4392f, -0.3989f, -0.0403f },
|
488
|
+
},
|
489
|
+
};
|
490
|
+
const struct RGB2YUVFactors *cvt = &RGB2YUVFactorTables[SDL_GetYUVConversionModeForResolution(width, height)];
|
491
|
+
|
492
|
+
#define MAKE_Y(r, g, b) (Uint8)((int)(cvt->y[0] * (r) + cvt->y[1] * (g) + cvt->y[2] * (b) + 0.5f) + cvt->y_offset)
|
493
|
+
#define MAKE_U(r, g, b) (Uint8)((int)(cvt->u[0] * (r) + cvt->u[1] * (g) + cvt->u[2] * (b) + 0.5f) + 128)
|
494
|
+
#define MAKE_V(r, g, b) (Uint8)((int)(cvt->v[0] * (r) + cvt->v[1] * (g) + cvt->v[2] * (b) + 0.5f) + 128)
|
495
|
+
|
496
|
+
#define READ_2x2_PIXELS \
|
497
|
+
const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \
|
498
|
+
const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \
|
499
|
+
const Uint32 p3 = ((const Uint32 *)next_row)[2 * i]; \
|
500
|
+
const Uint32 p4 = ((const Uint32 *)next_row)[2 * i + 1]; \
|
501
|
+
const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000) + (p3 & 0x00ff0000) + (p4 & 0x00ff0000)) >> 18; \
|
502
|
+
const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00) + (p3 & 0x0000ff00) + (p4 & 0x0000ff00)) >> 10; \
|
503
|
+
const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff) + (p3 & 0x000000ff) + (p4 & 0x000000ff)) >> 2; \
|
504
|
+
|
505
|
+
#define READ_2x1_PIXELS \
|
506
|
+
const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \
|
507
|
+
const Uint32 p2 = ((const Uint32 *)next_row)[2 * i]; \
|
508
|
+
const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \
|
509
|
+
const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \
|
510
|
+
const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; \
|
511
|
+
|
512
|
+
#define READ_1x2_PIXELS \
|
513
|
+
const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \
|
514
|
+
const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \
|
515
|
+
const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \
|
516
|
+
const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \
|
517
|
+
const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; \
|
518
|
+
|
519
|
+
#define READ_1x1_PIXEL \
|
520
|
+
const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \
|
521
|
+
const Uint32 r = (p & 0x00ff0000) >> 16; \
|
522
|
+
const Uint32 g = (p & 0x0000ff00) >> 8; \
|
523
|
+
const Uint32 b = (p & 0x000000ff); \
|
524
|
+
|
525
|
+
#define READ_TWO_RGB_PIXELS \
|
526
|
+
const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \
|
527
|
+
const Uint32 r = (p & 0x00ff0000) >> 16; \
|
528
|
+
const Uint32 g = (p & 0x0000ff00) >> 8; \
|
529
|
+
const Uint32 b = (p & 0x000000ff); \
|
530
|
+
const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i + 1]; \
|
531
|
+
const Uint32 r1 = (p1 & 0x00ff0000) >> 16; \
|
532
|
+
const Uint32 g1 = (p1 & 0x0000ff00) >> 8; \
|
533
|
+
const Uint32 b1 = (p1 & 0x000000ff); \
|
534
|
+
const Uint32 R = (r + r1)/2; \
|
535
|
+
const Uint32 G = (g + g1)/2; \
|
536
|
+
const Uint32 B = (b + b1)/2; \
|
537
|
+
|
538
|
+
#define READ_ONE_RGB_PIXEL READ_1x1_PIXEL
|
539
|
+
|
540
|
+
switch (dst_format)
|
541
|
+
{
|
542
|
+
case SDL_PIXELFORMAT_YV12:
|
543
|
+
case SDL_PIXELFORMAT_IYUV:
|
544
|
+
case SDL_PIXELFORMAT_NV12:
|
545
|
+
case SDL_PIXELFORMAT_NV21:
|
546
|
+
{
|
547
|
+
const Uint8 *curr_row, *next_row;
|
548
|
+
|
549
|
+
Uint8 *plane_y;
|
550
|
+
Uint8 *plane_u;
|
551
|
+
Uint8 *plane_v;
|
552
|
+
Uint8 *plane_interleaved_uv;
|
553
|
+
Uint32 y_stride, uv_stride, y_skip, uv_skip;
|
554
|
+
|
555
|
+
GetYUVPlanes(width, height, dst_format, dst, dst_pitch,
|
556
|
+
(const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v,
|
557
|
+
&y_stride, &uv_stride);
|
558
|
+
plane_interleaved_uv = (plane_y + height * y_stride);
|
559
|
+
y_skip = (y_stride - width);
|
560
|
+
|
561
|
+
curr_row = (const Uint8*)src;
|
562
|
+
|
563
|
+
/* Write Y plane */
|
564
|
+
for (j = 0; j < height; j++) {
|
565
|
+
for (i = 0; i < width; i++) {
|
566
|
+
const Uint32 p1 = ((const Uint32 *)curr_row)[i];
|
567
|
+
const Uint32 r = (p1 & 0x00ff0000) >> 16;
|
568
|
+
const Uint32 g = (p1 & 0x0000ff00) >> 8;
|
569
|
+
const Uint32 b = (p1 & 0x000000ff);
|
570
|
+
*plane_y++ = MAKE_Y(r, g, b);
|
571
|
+
}
|
572
|
+
plane_y += y_skip;
|
573
|
+
curr_row += src_pitch;
|
574
|
+
}
|
575
|
+
|
576
|
+
curr_row = (const Uint8*)src;
|
577
|
+
next_row = (const Uint8*)src;
|
578
|
+
next_row += src_pitch;
|
579
|
+
|
580
|
+
if (dst_format == SDL_PIXELFORMAT_YV12 || dst_format == SDL_PIXELFORMAT_IYUV)
|
581
|
+
{
|
582
|
+
/* Write UV planes, not interleaved */
|
583
|
+
uv_skip = (uv_stride - (width + 1)/2);
|
584
|
+
for (j = 0; j < height_half; j++) {
|
585
|
+
for (i = 0; i < width_half; i++) {
|
586
|
+
READ_2x2_PIXELS;
|
587
|
+
*plane_u++ = MAKE_U(r, g, b);
|
588
|
+
*plane_v++ = MAKE_V(r, g, b);
|
589
|
+
}
|
590
|
+
if (width_remainder) {
|
591
|
+
READ_2x1_PIXELS;
|
592
|
+
*plane_u++ = MAKE_U(r, g, b);
|
593
|
+
*plane_v++ = MAKE_V(r, g, b);
|
594
|
+
}
|
595
|
+
plane_u += uv_skip;
|
596
|
+
plane_v += uv_skip;
|
597
|
+
curr_row += src_pitch_x_2;
|
598
|
+
next_row += src_pitch_x_2;
|
599
|
+
}
|
600
|
+
if (height_remainder) {
|
601
|
+
for (i = 0; i < width_half; i++) {
|
602
|
+
READ_1x2_PIXELS;
|
603
|
+
*plane_u++ = MAKE_U(r, g, b);
|
604
|
+
*plane_v++ = MAKE_V(r, g, b);
|
605
|
+
}
|
606
|
+
if (width_remainder) {
|
607
|
+
READ_1x1_PIXEL;
|
608
|
+
*plane_u++ = MAKE_U(r, g, b);
|
609
|
+
*plane_v++ = MAKE_V(r, g, b);
|
610
|
+
}
|
611
|
+
plane_u += uv_skip;
|
612
|
+
plane_v += uv_skip;
|
613
|
+
}
|
614
|
+
}
|
615
|
+
else if (dst_format == SDL_PIXELFORMAT_NV12)
|
616
|
+
{
|
617
|
+
uv_skip = (uv_stride - ((width + 1)/2)*2);
|
618
|
+
for (j = 0; j < height_half; j++) {
|
619
|
+
for (i = 0; i < width_half; i++) {
|
620
|
+
READ_2x2_PIXELS;
|
621
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
622
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
623
|
+
}
|
624
|
+
if (width_remainder) {
|
625
|
+
READ_2x1_PIXELS;
|
626
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
627
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
628
|
+
}
|
629
|
+
plane_interleaved_uv += uv_skip;
|
630
|
+
curr_row += src_pitch_x_2;
|
631
|
+
next_row += src_pitch_x_2;
|
632
|
+
}
|
633
|
+
if (height_remainder) {
|
634
|
+
for (i = 0; i < width_half; i++) {
|
635
|
+
READ_1x2_PIXELS;
|
636
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
637
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
638
|
+
}
|
639
|
+
if (width_remainder) {
|
640
|
+
READ_1x1_PIXEL;
|
641
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
642
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
643
|
+
}
|
644
|
+
}
|
645
|
+
}
|
646
|
+
else /* dst_format == SDL_PIXELFORMAT_NV21 */
|
647
|
+
{
|
648
|
+
uv_skip = (uv_stride - ((width + 1)/2)*2);
|
649
|
+
for (j = 0; j < height_half; j++) {
|
650
|
+
for (i = 0; i < width_half; i++) {
|
651
|
+
READ_2x2_PIXELS;
|
652
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
653
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
654
|
+
}
|
655
|
+
if (width_remainder) {
|
656
|
+
READ_2x1_PIXELS;
|
657
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
658
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
659
|
+
}
|
660
|
+
plane_interleaved_uv += uv_skip;
|
661
|
+
curr_row += src_pitch_x_2;
|
662
|
+
next_row += src_pitch_x_2;
|
663
|
+
}
|
664
|
+
if (height_remainder) {
|
665
|
+
for (i = 0; i < width_half; i++) {
|
666
|
+
READ_1x2_PIXELS;
|
667
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
668
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
669
|
+
}
|
670
|
+
if (width_remainder) {
|
671
|
+
READ_1x1_PIXEL;
|
672
|
+
*plane_interleaved_uv++ = MAKE_V(r, g, b);
|
673
|
+
*plane_interleaved_uv++ = MAKE_U(r, g, b);
|
674
|
+
}
|
675
|
+
}
|
676
|
+
}
|
677
|
+
}
|
678
|
+
break;
|
679
|
+
|
680
|
+
case SDL_PIXELFORMAT_YUY2:
|
681
|
+
case SDL_PIXELFORMAT_UYVY:
|
682
|
+
case SDL_PIXELFORMAT_YVYU:
|
683
|
+
{
|
684
|
+
const Uint8 *curr_row = (const Uint8*) src;
|
685
|
+
Uint8 *plane = (Uint8*) dst;
|
686
|
+
const int row_size = (4 * ((width + 1) / 2));
|
687
|
+
int plane_skip;
|
688
|
+
|
689
|
+
if (dst_pitch < row_size) {
|
690
|
+
return SDL_SetError("Destination pitch is too small, expected at least %d\n", row_size);
|
691
|
+
}
|
692
|
+
plane_skip = (dst_pitch - row_size);
|
693
|
+
|
694
|
+
/* Write YUV plane, packed */
|
695
|
+
if (dst_format == SDL_PIXELFORMAT_YUY2)
|
696
|
+
{
|
697
|
+
for (j = 0; j < height; j++) {
|
698
|
+
for (i = 0; i < width_half; i++) {
|
699
|
+
READ_TWO_RGB_PIXELS;
|
700
|
+
/* Y U Y1 V */
|
701
|
+
*plane++ = MAKE_Y(r, g, b);
|
702
|
+
*plane++ = MAKE_U(R, G, B);
|
703
|
+
*plane++ = MAKE_Y(r1, g1, b1);
|
704
|
+
*plane++ = MAKE_V(R, G, B);
|
705
|
+
}
|
706
|
+
if (width_remainder) {
|
707
|
+
READ_ONE_RGB_PIXEL;
|
708
|
+
/* Y U Y V */
|
709
|
+
*plane++ = MAKE_Y(r, g, b);
|
710
|
+
*plane++ = MAKE_U(r, g, b);
|
711
|
+
*plane++ = MAKE_Y(r, g, b);
|
712
|
+
*plane++ = MAKE_V(r, g, b);
|
713
|
+
}
|
714
|
+
plane += plane_skip;
|
715
|
+
curr_row += src_pitch;
|
716
|
+
}
|
717
|
+
}
|
718
|
+
else if (dst_format == SDL_PIXELFORMAT_UYVY)
|
719
|
+
{
|
720
|
+
for (j = 0; j < height; j++) {
|
721
|
+
for (i = 0; i < width_half; i++) {
|
722
|
+
READ_TWO_RGB_PIXELS;
|
723
|
+
/* U Y V Y1 */
|
724
|
+
*plane++ = MAKE_U(R, G, B);
|
725
|
+
*plane++ = MAKE_Y(r, g, b);
|
726
|
+
*plane++ = MAKE_V(R, G, B);
|
727
|
+
*plane++ = MAKE_Y(r1, g1, b1);
|
728
|
+
}
|
729
|
+
if (width_remainder) {
|
730
|
+
READ_ONE_RGB_PIXEL;
|
731
|
+
/* U Y V Y */
|
732
|
+
*plane++ = MAKE_U(r, g, b);
|
733
|
+
*plane++ = MAKE_Y(r, g, b);
|
734
|
+
*plane++ = MAKE_V(r, g, b);
|
735
|
+
*plane++ = MAKE_Y(r, g, b);
|
736
|
+
}
|
737
|
+
plane += plane_skip;
|
738
|
+
curr_row += src_pitch;
|
739
|
+
}
|
740
|
+
}
|
741
|
+
else if (dst_format == SDL_PIXELFORMAT_YVYU)
|
742
|
+
{
|
743
|
+
for (j = 0; j < height; j++) {
|
744
|
+
for (i = 0; i < width_half; i++) {
|
745
|
+
READ_TWO_RGB_PIXELS;
|
746
|
+
/* Y V Y1 U */
|
747
|
+
*plane++ = MAKE_Y(r, g, b);
|
748
|
+
*plane++ = MAKE_V(R, G, B);
|
749
|
+
*plane++ = MAKE_Y(r1, g1, b1);
|
750
|
+
*plane++ = MAKE_U(R, G, B);
|
751
|
+
}
|
752
|
+
if (width_remainder) {
|
753
|
+
READ_ONE_RGB_PIXEL;
|
754
|
+
/* Y V Y U */
|
755
|
+
*plane++ = MAKE_Y(r, g, b);
|
756
|
+
*plane++ = MAKE_V(r, g, b);
|
757
|
+
*plane++ = MAKE_Y(r, g, b);
|
758
|
+
*plane++ = MAKE_U(r, g, b);
|
759
|
+
}
|
760
|
+
plane += plane_skip;
|
761
|
+
curr_row += src_pitch;
|
762
|
+
}
|
763
|
+
}
|
764
|
+
}
|
765
|
+
break;
|
766
|
+
|
767
|
+
default:
|
768
|
+
return SDL_SetError("Unsupported YUV destination format: %s", SDL_GetPixelFormatName(dst_format));
|
769
|
+
}
|
770
|
+
#undef MAKE_Y
|
771
|
+
#undef MAKE_U
|
772
|
+
#undef MAKE_V
|
773
|
+
#undef READ_2x2_PIXELS
|
774
|
+
#undef READ_2x1_PIXELS
|
775
|
+
#undef READ_1x2_PIXELS
|
776
|
+
#undef READ_1x1_PIXEL
|
777
|
+
#undef READ_TWO_RGB_PIXELS
|
778
|
+
#undef READ_ONE_RGB_PIXEL
|
779
|
+
return 0;
|
780
|
+
}
|
781
|
+
|
782
|
+
int
|
783
|
+
SDL_ConvertPixels_RGB_to_YUV(int width, int height,
|
784
|
+
Uint32 src_format, const void *src, int src_pitch,
|
785
|
+
Uint32 dst_format, void *dst, int dst_pitch)
|
786
|
+
{
|
787
|
+
#if 0 /* Doesn't handle odd widths */
|
788
|
+
/* RGB24 to FOURCC */
|
789
|
+
if (src_format == SDL_PIXELFORMAT_RGB24) {
|
790
|
+
Uint8 *y;
|
791
|
+
Uint8 *u;
|
792
|
+
Uint8 *v;
|
793
|
+
Uint32 y_stride;
|
794
|
+
Uint32 uv_stride;
|
795
|
+
YCbCrType yuv_type;
|
796
|
+
|
797
|
+
if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch, (const Uint8 **)&y, (const Uint8 **)&u, (const Uint8 **)&v, &y_stride, &uv_stride) < 0) {
|
798
|
+
return -1;
|
799
|
+
}
|
800
|
+
|
801
|
+
if (GetYUVConversionType(width, height, &yuv_type) < 0) {
|
802
|
+
return -1;
|
803
|
+
}
|
804
|
+
|
805
|
+
rgb24_yuv420_std(width, height, src, src_pitch, y, u, v, y_stride, uv_stride, yuv_type);
|
806
|
+
return 0;
|
807
|
+
}
|
808
|
+
#endif
|
809
|
+
|
810
|
+
/* ARGB8888 to FOURCC */
|
811
|
+
if (src_format == SDL_PIXELFORMAT_ARGB8888) {
|
812
|
+
return SDL_ConvertPixels_ARGB8888_to_YUV(width, height, src, src_pitch, dst_format, dst, dst_pitch);
|
813
|
+
}
|
814
|
+
|
815
|
+
/* not ARGB8888 to FOURCC : need an intermediate conversion */
|
816
|
+
{
|
817
|
+
int ret;
|
818
|
+
void *tmp;
|
819
|
+
int tmp_pitch = (width * sizeof(Uint32));
|
820
|
+
|
821
|
+
tmp = SDL_malloc(tmp_pitch * height);
|
822
|
+
if (tmp == NULL) {
|
823
|
+
return SDL_OutOfMemory();
|
824
|
+
}
|
825
|
+
|
826
|
+
/* convert src/src_format to tmp/ARGB8888 */
|
827
|
+
ret = SDL_ConvertPixels(width, height, src_format, src, src_pitch, SDL_PIXELFORMAT_ARGB8888, tmp, tmp_pitch);
|
828
|
+
if (ret == -1) {
|
829
|
+
SDL_free(tmp);
|
830
|
+
return ret;
|
831
|
+
}
|
832
|
+
|
833
|
+
/* convert tmp/ARGB8888 to dst/FOURCC */
|
834
|
+
ret = SDL_ConvertPixels_ARGB8888_to_YUV(width, height, tmp, tmp_pitch, dst_format, dst, dst_pitch);
|
835
|
+
SDL_free(tmp);
|
836
|
+
return ret;
|
837
|
+
}
|
838
|
+
}
|
839
|
+
|
840
|
+
static int
|
841
|
+
SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format,
|
842
|
+
const void *src, int src_pitch, void *dst, int dst_pitch)
|
843
|
+
{
|
844
|
+
int i;
|
845
|
+
|
846
|
+
if (IsPlanar2x2Format(format)) {
|
847
|
+
/* Y plane */
|
848
|
+
for (i = height; i--;) {
|
849
|
+
SDL_memcpy(dst, src, width);
|
850
|
+
src = (const Uint8*)src + src_pitch;
|
851
|
+
dst = (Uint8*)dst + dst_pitch;
|
852
|
+
}
|
853
|
+
|
854
|
+
if (format == SDL_PIXELFORMAT_YV12 || format == SDL_PIXELFORMAT_IYUV) {
|
855
|
+
/* U and V planes are a quarter the size of the Y plane, rounded up */
|
856
|
+
width = (width + 1) / 2;
|
857
|
+
height = (height + 1) / 2;
|
858
|
+
src_pitch = (src_pitch + 1) / 2;
|
859
|
+
dst_pitch = (dst_pitch + 1) / 2;
|
860
|
+
for (i = height * 2; i--;) {
|
861
|
+
SDL_memcpy(dst, src, width);
|
862
|
+
src = (const Uint8*)src + src_pitch;
|
863
|
+
dst = (Uint8*)dst + dst_pitch;
|
864
|
+
}
|
865
|
+
} else if (format == SDL_PIXELFORMAT_NV12 || format == SDL_PIXELFORMAT_NV21) {
|
866
|
+
/* U/V plane is half the height of the Y plane, rounded up */
|
867
|
+
height = (height + 1) / 2;
|
868
|
+
width = ((width + 1) / 2)*2;
|
869
|
+
src_pitch = ((src_pitch + 1) / 2)*2;
|
870
|
+
dst_pitch = ((dst_pitch + 1) / 2)*2;
|
871
|
+
for (i = height; i--;) {
|
872
|
+
SDL_memcpy(dst, src, width);
|
873
|
+
src = (const Uint8*)src + src_pitch;
|
874
|
+
dst = (Uint8*)dst + dst_pitch;
|
875
|
+
}
|
876
|
+
}
|
877
|
+
return 0;
|
878
|
+
}
|
879
|
+
|
880
|
+
if (IsPacked4Format(format)) {
|
881
|
+
/* Packed planes */
|
882
|
+
width = 4 * ((width + 1) / 2);
|
883
|
+
for (i = height; i--;) {
|
884
|
+
SDL_memcpy(dst, src, width);
|
885
|
+
src = (const Uint8*)src + src_pitch;
|
886
|
+
dst = (Uint8*)dst + dst_pitch;
|
887
|
+
}
|
888
|
+
return 0;
|
889
|
+
}
|
890
|
+
|
891
|
+
return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV_Copy: Unsupported YUV format: %s", SDL_GetPixelFormatName(format));
|
892
|
+
}
|
893
|
+
|
894
|
+
static int
|
895
|
+
SDL_ConvertPixels_SwapUVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
896
|
+
{
|
897
|
+
int y;
|
898
|
+
const int UVwidth = (width + 1)/2;
|
899
|
+
const int UVheight = (height + 1)/2;
|
900
|
+
|
901
|
+
/* Skip the Y plane */
|
902
|
+
src = (const Uint8 *)src + height * src_pitch;
|
903
|
+
dst = (Uint8 *)dst + height * dst_pitch;
|
904
|
+
|
905
|
+
if (src == dst) {
|
906
|
+
int UVpitch = (dst_pitch + 1)/2;
|
907
|
+
Uint8 *tmp;
|
908
|
+
Uint8 *row1 = dst;
|
909
|
+
Uint8 *row2 = (Uint8 *)dst + UVheight * UVpitch;
|
910
|
+
|
911
|
+
/* Allocate a temporary row for the swap */
|
912
|
+
tmp = (Uint8 *)SDL_malloc(UVwidth);
|
913
|
+
if (!tmp) {
|
914
|
+
return SDL_OutOfMemory();
|
915
|
+
}
|
916
|
+
for (y = 0; y < UVheight; ++y) {
|
917
|
+
SDL_memcpy(tmp, row1, UVwidth);
|
918
|
+
SDL_memcpy(row1, row2, UVwidth);
|
919
|
+
SDL_memcpy(row2, tmp, UVwidth);
|
920
|
+
row1 += UVpitch;
|
921
|
+
row2 += UVpitch;
|
922
|
+
}
|
923
|
+
SDL_free(tmp);
|
924
|
+
} else {
|
925
|
+
const Uint8 *srcUV;
|
926
|
+
Uint8 *dstUV;
|
927
|
+
int srcUVPitch = ((src_pitch + 1)/2);
|
928
|
+
int dstUVPitch = ((dst_pitch + 1)/2);
|
929
|
+
|
930
|
+
/* Copy the first plane */
|
931
|
+
srcUV = (const Uint8 *)src;
|
932
|
+
dstUV = (Uint8 *)dst + UVheight * dstUVPitch;
|
933
|
+
for (y = 0; y < UVheight; ++y) {
|
934
|
+
SDL_memcpy(dstUV, srcUV, UVwidth);
|
935
|
+
srcUV += srcUVPitch;
|
936
|
+
dstUV += dstUVPitch;
|
937
|
+
}
|
938
|
+
|
939
|
+
/* Copy the second plane */
|
940
|
+
dstUV = (Uint8 *)dst;
|
941
|
+
for (y = 0; y < UVheight; ++y) {
|
942
|
+
SDL_memcpy(dstUV, srcUV, UVwidth);
|
943
|
+
srcUV += srcUVPitch;
|
944
|
+
dstUV += dstUVPitch;
|
945
|
+
}
|
946
|
+
}
|
947
|
+
return 0;
|
948
|
+
}
|
949
|
+
|
950
|
+
static int
|
951
|
+
SDL_ConvertPixels_PackUVPlanes_to_NV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV)
|
952
|
+
{
|
953
|
+
int x, y;
|
954
|
+
const int UVwidth = (width + 1)/2;
|
955
|
+
const int UVheight = (height + 1)/2;
|
956
|
+
const int srcUVPitch = ((src_pitch + 1)/2);
|
957
|
+
const int srcUVPitchLeft = srcUVPitch - UVwidth;
|
958
|
+
const int dstUVPitch = ((dst_pitch + 1)/2)*2;
|
959
|
+
const int dstUVPitchLeft = dstUVPitch - UVwidth*2;
|
960
|
+
const Uint8 *src1, *src2;
|
961
|
+
Uint8 *dstUV;
|
962
|
+
Uint8 *tmp = NULL;
|
963
|
+
#ifdef __SSE2__
|
964
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
965
|
+
#endif
|
966
|
+
|
967
|
+
/* Skip the Y plane */
|
968
|
+
src = (const Uint8 *)src + height * src_pitch;
|
969
|
+
dst = (Uint8 *)dst + height * dst_pitch;
|
970
|
+
|
971
|
+
if (src == dst) {
|
972
|
+
/* Need to make a copy of the buffer so we don't clobber it while converting */
|
973
|
+
tmp = (Uint8 *)SDL_malloc(2*UVheight*srcUVPitch);
|
974
|
+
if (!tmp) {
|
975
|
+
return SDL_OutOfMemory();
|
976
|
+
}
|
977
|
+
SDL_memcpy(tmp, src, 2*UVheight*srcUVPitch);
|
978
|
+
src = tmp;
|
979
|
+
}
|
980
|
+
|
981
|
+
if (reverseUV) {
|
982
|
+
src2 = (const Uint8 *)src;
|
983
|
+
src1 = src2 + UVheight * srcUVPitch;
|
984
|
+
} else {
|
985
|
+
src1 = (const Uint8 *)src;
|
986
|
+
src2 = src1 + UVheight * srcUVPitch;
|
987
|
+
}
|
988
|
+
dstUV = (Uint8 *)dst;
|
989
|
+
|
990
|
+
y = UVheight;
|
991
|
+
while (y--) {
|
992
|
+
x = UVwidth;
|
993
|
+
#ifdef __SSE2__
|
994
|
+
if (use_SSE2) {
|
995
|
+
while (x >= 16) {
|
996
|
+
__m128i u = _mm_loadu_si128((__m128i *)src1);
|
997
|
+
__m128i v = _mm_loadu_si128((__m128i *)src2);
|
998
|
+
__m128i uv1 = _mm_unpacklo_epi8(u, v);
|
999
|
+
__m128i uv2 = _mm_unpackhi_epi8(u, v);
|
1000
|
+
_mm_storeu_si128((__m128i*)dstUV, uv1);
|
1001
|
+
_mm_storeu_si128((__m128i*)(dstUV + 16), uv2);
|
1002
|
+
src1 += 16;
|
1003
|
+
src2 += 16;
|
1004
|
+
dstUV += 32;
|
1005
|
+
x -= 16;
|
1006
|
+
}
|
1007
|
+
}
|
1008
|
+
#endif
|
1009
|
+
while (x--) {
|
1010
|
+
*dstUV++ = *src1++;
|
1011
|
+
*dstUV++ = *src2++;
|
1012
|
+
}
|
1013
|
+
src1 += srcUVPitchLeft;
|
1014
|
+
src2 += srcUVPitchLeft;
|
1015
|
+
dstUV += dstUVPitchLeft;
|
1016
|
+
}
|
1017
|
+
|
1018
|
+
if (tmp) {
|
1019
|
+
SDL_free(tmp);
|
1020
|
+
}
|
1021
|
+
return 0;
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
static int
|
1025
|
+
SDL_ConvertPixels_SplitNV_to_UVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV)
|
1026
|
+
{
|
1027
|
+
int x, y;
|
1028
|
+
const int UVwidth = (width + 1)/2;
|
1029
|
+
const int UVheight = (height + 1)/2;
|
1030
|
+
const int srcUVPitch = ((src_pitch + 1)/2)*2;
|
1031
|
+
const int srcUVPitchLeft = srcUVPitch - UVwidth*2;
|
1032
|
+
const int dstUVPitch = ((dst_pitch + 1)/2);
|
1033
|
+
const int dstUVPitchLeft = dstUVPitch - UVwidth;
|
1034
|
+
const Uint8 *srcUV;
|
1035
|
+
Uint8 *dst1, *dst2;
|
1036
|
+
Uint8 *tmp = NULL;
|
1037
|
+
#ifdef __SSE2__
|
1038
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1039
|
+
#endif
|
1040
|
+
|
1041
|
+
/* Skip the Y plane */
|
1042
|
+
src = (const Uint8 *)src + height * src_pitch;
|
1043
|
+
dst = (Uint8 *)dst + height * dst_pitch;
|
1044
|
+
|
1045
|
+
if (src == dst) {
|
1046
|
+
/* Need to make a copy of the buffer so we don't clobber it while converting */
|
1047
|
+
tmp = (Uint8 *)SDL_malloc(UVheight*srcUVPitch);
|
1048
|
+
if (!tmp) {
|
1049
|
+
return SDL_OutOfMemory();
|
1050
|
+
}
|
1051
|
+
SDL_memcpy(tmp, src, UVheight*srcUVPitch);
|
1052
|
+
src = tmp;
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
if (reverseUV) {
|
1056
|
+
dst2 = (Uint8 *)dst;
|
1057
|
+
dst1 = dst2 + UVheight * dstUVPitch;
|
1058
|
+
} else {
|
1059
|
+
dst1 = (Uint8 *)dst;
|
1060
|
+
dst2 = dst1 + UVheight * dstUVPitch;
|
1061
|
+
}
|
1062
|
+
srcUV = (const Uint8 *)src;
|
1063
|
+
|
1064
|
+
y = UVheight;
|
1065
|
+
while (y--) {
|
1066
|
+
x = UVwidth;
|
1067
|
+
#ifdef __SSE2__
|
1068
|
+
if (use_SSE2) {
|
1069
|
+
__m128i mask = _mm_set1_epi16(0x00FF);
|
1070
|
+
while (x >= 16) {
|
1071
|
+
__m128i uv1 = _mm_loadu_si128((__m128i*)srcUV);
|
1072
|
+
__m128i uv2 = _mm_loadu_si128((__m128i*)(srcUV+16));
|
1073
|
+
__m128i u1 = _mm_and_si128(uv1, mask);
|
1074
|
+
__m128i u2 = _mm_and_si128(uv2, mask);
|
1075
|
+
__m128i u = _mm_packus_epi16(u1, u2);
|
1076
|
+
__m128i v1 = _mm_srli_epi16(uv1, 8);
|
1077
|
+
__m128i v2 = _mm_srli_epi16(uv2, 8);
|
1078
|
+
__m128i v = _mm_packus_epi16(v1, v2);
|
1079
|
+
_mm_storeu_si128((__m128i*)dst1, u);
|
1080
|
+
_mm_storeu_si128((__m128i*)dst2, v);
|
1081
|
+
srcUV += 32;
|
1082
|
+
dst1 += 16;
|
1083
|
+
dst2 += 16;
|
1084
|
+
x -= 16;
|
1085
|
+
}
|
1086
|
+
}
|
1087
|
+
#endif
|
1088
|
+
while (x--) {
|
1089
|
+
*dst1++ = *srcUV++;
|
1090
|
+
*dst2++ = *srcUV++;
|
1091
|
+
}
|
1092
|
+
srcUV += srcUVPitchLeft;
|
1093
|
+
dst1 += dstUVPitchLeft;
|
1094
|
+
dst2 += dstUVPitchLeft;
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
if (tmp) {
|
1098
|
+
SDL_free(tmp);
|
1099
|
+
}
|
1100
|
+
return 0;
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
static int
|
1104
|
+
SDL_ConvertPixels_SwapNV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
1105
|
+
{
|
1106
|
+
int x, y;
|
1107
|
+
const int UVwidth = (width + 1)/2;
|
1108
|
+
const int UVheight = (height + 1)/2;
|
1109
|
+
const int srcUVPitch = ((src_pitch + 1)/2)*2;
|
1110
|
+
const int srcUVPitchLeft = (srcUVPitch - UVwidth*2)/sizeof(Uint16);
|
1111
|
+
const int dstUVPitch = ((dst_pitch + 1)/2)*2;
|
1112
|
+
const int dstUVPitchLeft = (dstUVPitch - UVwidth*2)/sizeof(Uint16);
|
1113
|
+
const Uint16 *srcUV;
|
1114
|
+
Uint16 *dstUV;
|
1115
|
+
#ifdef __SSE2__
|
1116
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1117
|
+
#endif
|
1118
|
+
|
1119
|
+
/* Skip the Y plane */
|
1120
|
+
src = (const Uint8 *)src + height * src_pitch;
|
1121
|
+
dst = (Uint8 *)dst + height * dst_pitch;
|
1122
|
+
|
1123
|
+
srcUV = (const Uint16 *)src;
|
1124
|
+
dstUV = (Uint16 *)dst;
|
1125
|
+
y = UVheight;
|
1126
|
+
while (y--) {
|
1127
|
+
x = UVwidth;
|
1128
|
+
#ifdef __SSE2__
|
1129
|
+
if (use_SSE2) {
|
1130
|
+
while (x >= 8) {
|
1131
|
+
__m128i uv = _mm_loadu_si128((__m128i*)srcUV);
|
1132
|
+
__m128i v = _mm_slli_epi16(uv, 8);
|
1133
|
+
__m128i u = _mm_srli_epi16(uv, 8);
|
1134
|
+
__m128i vu = _mm_or_si128(v, u);
|
1135
|
+
_mm_storeu_si128((__m128i*)dstUV, vu);
|
1136
|
+
srcUV += 8;
|
1137
|
+
dstUV += 8;
|
1138
|
+
x -= 8;
|
1139
|
+
}
|
1140
|
+
}
|
1141
|
+
#endif
|
1142
|
+
while (x--) {
|
1143
|
+
*dstUV++ = SDL_Swap16(*srcUV++);
|
1144
|
+
}
|
1145
|
+
srcUV += srcUVPitchLeft;
|
1146
|
+
dstUV += dstUVPitchLeft;
|
1147
|
+
}
|
1148
|
+
return 0;
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
static int
|
1152
|
+
SDL_ConvertPixels_Planar2x2_to_Planar2x2(int width, int height,
|
1153
|
+
Uint32 src_format, const void *src, int src_pitch,
|
1154
|
+
Uint32 dst_format, void *dst, int dst_pitch)
|
1155
|
+
{
|
1156
|
+
if (src != dst) {
|
1157
|
+
/* Copy Y plane */
|
1158
|
+
int i;
|
1159
|
+
const Uint8 *srcY = (const Uint8 *)src;
|
1160
|
+
Uint8 *dstY = (Uint8 *)dst;
|
1161
|
+
for (i = height; i--; ) {
|
1162
|
+
SDL_memcpy(dstY, srcY, width);
|
1163
|
+
srcY += src_pitch;
|
1164
|
+
dstY += dst_pitch;
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
|
1168
|
+
switch (src_format) {
|
1169
|
+
case SDL_PIXELFORMAT_YV12:
|
1170
|
+
switch (dst_format) {
|
1171
|
+
case SDL_PIXELFORMAT_IYUV:
|
1172
|
+
return SDL_ConvertPixels_SwapUVPlanes(width, height, src, src_pitch, dst, dst_pitch);
|
1173
|
+
case SDL_PIXELFORMAT_NV12:
|
1174
|
+
return SDL_ConvertPixels_PackUVPlanes_to_NV(width, height, src, src_pitch, dst, dst_pitch, SDL_TRUE);
|
1175
|
+
case SDL_PIXELFORMAT_NV21:
|
1176
|
+
return SDL_ConvertPixels_PackUVPlanes_to_NV(width, height, src, src_pitch, dst, dst_pitch, SDL_FALSE);
|
1177
|
+
default:
|
1178
|
+
break;
|
1179
|
+
}
|
1180
|
+
break;
|
1181
|
+
case SDL_PIXELFORMAT_IYUV:
|
1182
|
+
switch (dst_format) {
|
1183
|
+
case SDL_PIXELFORMAT_YV12:
|
1184
|
+
return SDL_ConvertPixels_SwapUVPlanes(width, height, src, src_pitch, dst, dst_pitch);
|
1185
|
+
case SDL_PIXELFORMAT_NV12:
|
1186
|
+
return SDL_ConvertPixels_PackUVPlanes_to_NV(width, height, src, src_pitch, dst, dst_pitch, SDL_FALSE);
|
1187
|
+
case SDL_PIXELFORMAT_NV21:
|
1188
|
+
return SDL_ConvertPixels_PackUVPlanes_to_NV(width, height, src, src_pitch, dst, dst_pitch, SDL_TRUE);
|
1189
|
+
default:
|
1190
|
+
break;
|
1191
|
+
}
|
1192
|
+
break;
|
1193
|
+
case SDL_PIXELFORMAT_NV12:
|
1194
|
+
switch (dst_format) {
|
1195
|
+
case SDL_PIXELFORMAT_YV12:
|
1196
|
+
return SDL_ConvertPixels_SplitNV_to_UVPlanes(width, height, src, src_pitch, dst, dst_pitch, SDL_TRUE);
|
1197
|
+
case SDL_PIXELFORMAT_IYUV:
|
1198
|
+
return SDL_ConvertPixels_SplitNV_to_UVPlanes(width, height, src, src_pitch, dst, dst_pitch, SDL_FALSE);
|
1199
|
+
case SDL_PIXELFORMAT_NV21:
|
1200
|
+
return SDL_ConvertPixels_SwapNV(width, height, src, src_pitch, dst, dst_pitch);
|
1201
|
+
default:
|
1202
|
+
break;
|
1203
|
+
}
|
1204
|
+
break;
|
1205
|
+
case SDL_PIXELFORMAT_NV21:
|
1206
|
+
switch (dst_format) {
|
1207
|
+
case SDL_PIXELFORMAT_YV12:
|
1208
|
+
return SDL_ConvertPixels_SplitNV_to_UVPlanes(width, height, src, src_pitch, dst, dst_pitch, SDL_FALSE);
|
1209
|
+
case SDL_PIXELFORMAT_IYUV:
|
1210
|
+
return SDL_ConvertPixels_SplitNV_to_UVPlanes(width, height, src, src_pitch, dst, dst_pitch, SDL_TRUE);
|
1211
|
+
case SDL_PIXELFORMAT_NV12:
|
1212
|
+
return SDL_ConvertPixels_SwapNV(width, height, src, src_pitch, dst, dst_pitch);
|
1213
|
+
default:
|
1214
|
+
break;
|
1215
|
+
}
|
1216
|
+
break;
|
1217
|
+
default:
|
1218
|
+
break;
|
1219
|
+
}
|
1220
|
+
return SDL_SetError("SDL_ConvertPixels_Planar2x2_to_Planar2x2: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format));
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
#define PACKED4_TO_PACKED4_ROW_SSE2(shuffle) \
|
1224
|
+
while (x >= 4) { \
|
1225
|
+
__m128i yuv = _mm_loadu_si128((__m128i*)srcYUV); \
|
1226
|
+
__m128i lo = _mm_unpacklo_epi8(yuv, _mm_setzero_si128()); \
|
1227
|
+
__m128i hi = _mm_unpackhi_epi8(yuv, _mm_setzero_si128()); \
|
1228
|
+
lo = _mm_shufflelo_epi16(lo, shuffle); \
|
1229
|
+
lo = _mm_shufflehi_epi16(lo, shuffle); \
|
1230
|
+
hi = _mm_shufflelo_epi16(hi, shuffle); \
|
1231
|
+
hi = _mm_shufflehi_epi16(hi, shuffle); \
|
1232
|
+
yuv = _mm_packus_epi16(lo, hi); \
|
1233
|
+
_mm_storeu_si128((__m128i*)dstYUV, yuv); \
|
1234
|
+
srcYUV += 16; \
|
1235
|
+
dstYUV += 16; \
|
1236
|
+
x -= 4; \
|
1237
|
+
} \
|
1238
|
+
|
1239
|
+
static int
|
1240
|
+
SDL_ConvertPixels_YUY2_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
1241
|
+
{
|
1242
|
+
int x, y;
|
1243
|
+
const int YUVwidth = (width + 1)/2;
|
1244
|
+
const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
|
1245
|
+
const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
|
1246
|
+
const Uint8 *srcYUV = (const Uint8 *)src;
|
1247
|
+
Uint8 *dstYUV = (Uint8 *)dst;
|
1248
|
+
#ifdef __SSE2__
|
1249
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1250
|
+
#endif
|
1251
|
+
|
1252
|
+
y = height;
|
1253
|
+
while (y--) {
|
1254
|
+
x = YUVwidth;
|
1255
|
+
#ifdef __SSE2__
|
1256
|
+
if (use_SSE2) {
|
1257
|
+
PACKED4_TO_PACKED4_ROW_SSE2(_MM_SHUFFLE(2, 3, 0, 1));
|
1258
|
+
}
|
1259
|
+
#endif
|
1260
|
+
while (x--) {
|
1261
|
+
Uint8 Y1, U, Y2, V;
|
1262
|
+
|
1263
|
+
Y1 = srcYUV[0];
|
1264
|
+
U = srcYUV[1];
|
1265
|
+
Y2 = srcYUV[2];
|
1266
|
+
V = srcYUV[3];
|
1267
|
+
srcYUV += 4;
|
1268
|
+
|
1269
|
+
dstYUV[0] = U;
|
1270
|
+
dstYUV[1] = Y1;
|
1271
|
+
dstYUV[2] = V;
|
1272
|
+
dstYUV[3] = Y2;
|
1273
|
+
dstYUV += 4;
|
1274
|
+
}
|
1275
|
+
srcYUV += srcYUVPitchLeft;
|
1276
|
+
dstYUV += dstYUVPitchLeft;
|
1277
|
+
}
|
1278
|
+
return 0;
|
1279
|
+
}
|
1280
|
+
|
1281
|
+
static int
|
1282
|
+
SDL_ConvertPixels_YUY2_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
1283
|
+
{
|
1284
|
+
int x, y;
|
1285
|
+
const int YUVwidth = (width + 1)/2;
|
1286
|
+
const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
|
1287
|
+
const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
|
1288
|
+
const Uint8 *srcYUV = (const Uint8 *)src;
|
1289
|
+
Uint8 *dstYUV = (Uint8 *)dst;
|
1290
|
+
#ifdef __SSE2__
|
1291
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1292
|
+
#endif
|
1293
|
+
|
1294
|
+
y = height;
|
1295
|
+
while (y--) {
|
1296
|
+
x = YUVwidth;
|
1297
|
+
#ifdef __SSE2__
|
1298
|
+
if (use_SSE2) {
|
1299
|
+
PACKED4_TO_PACKED4_ROW_SSE2(_MM_SHUFFLE(1, 2, 3, 0));
|
1300
|
+
}
|
1301
|
+
#endif
|
1302
|
+
while (x--) {
|
1303
|
+
Uint8 Y1, U, Y2, V;
|
1304
|
+
|
1305
|
+
Y1 = srcYUV[0];
|
1306
|
+
U = srcYUV[1];
|
1307
|
+
Y2 = srcYUV[2];
|
1308
|
+
V = srcYUV[3];
|
1309
|
+
srcYUV += 4;
|
1310
|
+
|
1311
|
+
dstYUV[0] = Y1;
|
1312
|
+
dstYUV[1] = V;
|
1313
|
+
dstYUV[2] = Y2;
|
1314
|
+
dstYUV[3] = U;
|
1315
|
+
dstYUV += 4;
|
1316
|
+
}
|
1317
|
+
srcYUV += srcYUVPitchLeft;
|
1318
|
+
dstYUV += dstYUVPitchLeft;
|
1319
|
+
}
|
1320
|
+
return 0;
|
1321
|
+
}
|
1322
|
+
|
1323
|
+
static int
|
1324
|
+
SDL_ConvertPixels_UYVY_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
1325
|
+
{
|
1326
|
+
int x, y;
|
1327
|
+
const int YUVwidth = (width + 1)/2;
|
1328
|
+
const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
|
1329
|
+
const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
|
1330
|
+
const Uint8 *srcYUV = (const Uint8 *)src;
|
1331
|
+
Uint8 *dstYUV = (Uint8 *)dst;
|
1332
|
+
#ifdef __SSE2__
|
1333
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1334
|
+
#endif
|
1335
|
+
|
1336
|
+
y = height;
|
1337
|
+
while (y--) {
|
1338
|
+
x = YUVwidth;
|
1339
|
+
#ifdef __SSE2__
|
1340
|
+
if (use_SSE2) {
|
1341
|
+
PACKED4_TO_PACKED4_ROW_SSE2(_MM_SHUFFLE(2, 3, 0, 1));
|
1342
|
+
}
|
1343
|
+
#endif
|
1344
|
+
while (x--) {
|
1345
|
+
Uint8 Y1, U, Y2, V;
|
1346
|
+
|
1347
|
+
U = srcYUV[0];
|
1348
|
+
Y1 = srcYUV[1];
|
1349
|
+
V = srcYUV[2];
|
1350
|
+
Y2 = srcYUV[3];
|
1351
|
+
srcYUV += 4;
|
1352
|
+
|
1353
|
+
dstYUV[0] = Y1;
|
1354
|
+
dstYUV[1] = U;
|
1355
|
+
dstYUV[2] = Y2;
|
1356
|
+
dstYUV[3] = V;
|
1357
|
+
dstYUV += 4;
|
1358
|
+
}
|
1359
|
+
srcYUV += srcYUVPitchLeft;
|
1360
|
+
dstYUV += dstYUVPitchLeft;
|
1361
|
+
}
|
1362
|
+
return 0;
|
1363
|
+
}
|
1364
|
+
|
1365
|
+
static int
|
1366
|
+
SDL_ConvertPixels_UYVY_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
1367
|
+
{
|
1368
|
+
int x, y;
|
1369
|
+
const int YUVwidth = (width + 1)/2;
|
1370
|
+
const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
|
1371
|
+
const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
|
1372
|
+
const Uint8 *srcYUV = (const Uint8 *)src;
|
1373
|
+
Uint8 *dstYUV = (Uint8 *)dst;
|
1374
|
+
#ifdef __SSE2__
|
1375
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1376
|
+
#endif
|
1377
|
+
|
1378
|
+
y = height;
|
1379
|
+
while (y--) {
|
1380
|
+
x = YUVwidth;
|
1381
|
+
#ifdef __SSE2__
|
1382
|
+
if (use_SSE2) {
|
1383
|
+
PACKED4_TO_PACKED4_ROW_SSE2(_MM_SHUFFLE(0, 3, 2, 1));
|
1384
|
+
}
|
1385
|
+
#endif
|
1386
|
+
while (x--) {
|
1387
|
+
Uint8 Y1, U, Y2, V;
|
1388
|
+
|
1389
|
+
U = srcYUV[0];
|
1390
|
+
Y1 = srcYUV[1];
|
1391
|
+
V = srcYUV[2];
|
1392
|
+
Y2 = srcYUV[3];
|
1393
|
+
srcYUV += 4;
|
1394
|
+
|
1395
|
+
dstYUV[0] = Y1;
|
1396
|
+
dstYUV[1] = V;
|
1397
|
+
dstYUV[2] = Y2;
|
1398
|
+
dstYUV[3] = U;
|
1399
|
+
dstYUV += 4;
|
1400
|
+
}
|
1401
|
+
srcYUV += srcYUVPitchLeft;
|
1402
|
+
dstYUV += dstYUVPitchLeft;
|
1403
|
+
}
|
1404
|
+
return 0;
|
1405
|
+
}
|
1406
|
+
|
1407
|
+
static int
|
1408
|
+
SDL_ConvertPixels_YVYU_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
1409
|
+
{
|
1410
|
+
int x, y;
|
1411
|
+
const int YUVwidth = (width + 1)/2;
|
1412
|
+
const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
|
1413
|
+
const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
|
1414
|
+
const Uint8 *srcYUV = (const Uint8 *)src;
|
1415
|
+
Uint8 *dstYUV = (Uint8 *)dst;
|
1416
|
+
#ifdef __SSE2__
|
1417
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1418
|
+
#endif
|
1419
|
+
|
1420
|
+
y = height;
|
1421
|
+
while (y--) {
|
1422
|
+
x = YUVwidth;
|
1423
|
+
#ifdef __SSE2__
|
1424
|
+
if (use_SSE2) {
|
1425
|
+
PACKED4_TO_PACKED4_ROW_SSE2(_MM_SHUFFLE(1, 2, 3, 0));
|
1426
|
+
}
|
1427
|
+
#endif
|
1428
|
+
while (x--) {
|
1429
|
+
Uint8 Y1, U, Y2, V;
|
1430
|
+
|
1431
|
+
Y1 = srcYUV[0];
|
1432
|
+
V = srcYUV[1];
|
1433
|
+
Y2 = srcYUV[2];
|
1434
|
+
U = srcYUV[3];
|
1435
|
+
srcYUV += 4;
|
1436
|
+
|
1437
|
+
dstYUV[0] = Y1;
|
1438
|
+
dstYUV[1] = U;
|
1439
|
+
dstYUV[2] = Y2;
|
1440
|
+
dstYUV[3] = V;
|
1441
|
+
dstYUV += 4;
|
1442
|
+
}
|
1443
|
+
srcYUV += srcYUVPitchLeft;
|
1444
|
+
dstYUV += dstYUVPitchLeft;
|
1445
|
+
}
|
1446
|
+
return 0;
|
1447
|
+
}
|
1448
|
+
|
1449
|
+
static int
|
1450
|
+
SDL_ConvertPixels_YVYU_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
|
1451
|
+
{
|
1452
|
+
int x, y;
|
1453
|
+
const int YUVwidth = (width + 1)/2;
|
1454
|
+
const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
|
1455
|
+
const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
|
1456
|
+
const Uint8 *srcYUV = (const Uint8 *)src;
|
1457
|
+
Uint8 *dstYUV = (Uint8 *)dst;
|
1458
|
+
#ifdef __SSE2__
|
1459
|
+
const SDL_bool use_SSE2 = SDL_HasSSE2();
|
1460
|
+
#endif
|
1461
|
+
|
1462
|
+
y = height;
|
1463
|
+
while (y--) {
|
1464
|
+
x = YUVwidth;
|
1465
|
+
#ifdef __SSE2__
|
1466
|
+
if (use_SSE2) {
|
1467
|
+
PACKED4_TO_PACKED4_ROW_SSE2(_MM_SHUFFLE(2, 1, 0, 3));
|
1468
|
+
}
|
1469
|
+
#endif
|
1470
|
+
while (x--) {
|
1471
|
+
Uint8 Y1, U, Y2, V;
|
1472
|
+
|
1473
|
+
Y1 = srcYUV[0];
|
1474
|
+
V = srcYUV[1];
|
1475
|
+
Y2 = srcYUV[2];
|
1476
|
+
U = srcYUV[3];
|
1477
|
+
srcYUV += 4;
|
1478
|
+
|
1479
|
+
dstYUV[0] = U;
|
1480
|
+
dstYUV[1] = Y1;
|
1481
|
+
dstYUV[2] = V;
|
1482
|
+
dstYUV[3] = Y2;
|
1483
|
+
dstYUV += 4;
|
1484
|
+
}
|
1485
|
+
srcYUV += srcYUVPitchLeft;
|
1486
|
+
dstYUV += dstYUVPitchLeft;
|
1487
|
+
}
|
1488
|
+
return 0;
|
1489
|
+
}
|
1490
|
+
|
1491
|
+
static int
|
1492
|
+
SDL_ConvertPixels_Packed4_to_Packed4(int width, int height,
|
1493
|
+
Uint32 src_format, const void *src, int src_pitch,
|
1494
|
+
Uint32 dst_format, void *dst, int dst_pitch)
|
1495
|
+
{
|
1496
|
+
switch (src_format) {
|
1497
|
+
case SDL_PIXELFORMAT_YUY2:
|
1498
|
+
switch (dst_format) {
|
1499
|
+
case SDL_PIXELFORMAT_UYVY:
|
1500
|
+
return SDL_ConvertPixels_YUY2_to_UYVY(width, height, src, src_pitch, dst, dst_pitch);
|
1501
|
+
case SDL_PIXELFORMAT_YVYU:
|
1502
|
+
return SDL_ConvertPixels_YUY2_to_YVYU(width, height, src, src_pitch, dst, dst_pitch);
|
1503
|
+
default:
|
1504
|
+
break;
|
1505
|
+
}
|
1506
|
+
break;
|
1507
|
+
case SDL_PIXELFORMAT_UYVY:
|
1508
|
+
switch (dst_format) {
|
1509
|
+
case SDL_PIXELFORMAT_YUY2:
|
1510
|
+
return SDL_ConvertPixels_UYVY_to_YUY2(width, height, src, src_pitch, dst, dst_pitch);
|
1511
|
+
case SDL_PIXELFORMAT_YVYU:
|
1512
|
+
return SDL_ConvertPixels_UYVY_to_YVYU(width, height, src, src_pitch, dst, dst_pitch);
|
1513
|
+
default:
|
1514
|
+
break;
|
1515
|
+
}
|
1516
|
+
break;
|
1517
|
+
case SDL_PIXELFORMAT_YVYU:
|
1518
|
+
switch (dst_format) {
|
1519
|
+
case SDL_PIXELFORMAT_YUY2:
|
1520
|
+
return SDL_ConvertPixels_YVYU_to_YUY2(width, height, src, src_pitch, dst, dst_pitch);
|
1521
|
+
case SDL_PIXELFORMAT_UYVY:
|
1522
|
+
return SDL_ConvertPixels_YVYU_to_UYVY(width, height, src, src_pitch, dst, dst_pitch);
|
1523
|
+
default:
|
1524
|
+
break;
|
1525
|
+
}
|
1526
|
+
break;
|
1527
|
+
default:
|
1528
|
+
break;
|
1529
|
+
}
|
1530
|
+
return SDL_SetError("SDL_ConvertPixels_Packed4_to_Packed4: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format));
|
1531
|
+
}
|
1532
|
+
|
1533
|
+
static int
|
1534
|
+
SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height,
|
1535
|
+
Uint32 src_format, const void *src, int src_pitch,
|
1536
|
+
Uint32 dst_format, void *dst, int dst_pitch)
|
1537
|
+
{
|
1538
|
+
int x, y;
|
1539
|
+
const Uint8 *srcY1, *srcY2, *srcU, *srcV;
|
1540
|
+
Uint32 srcY_pitch, srcUV_pitch;
|
1541
|
+
Uint32 srcY_pitch_left, srcUV_pitch_left, srcUV_pixel_stride;
|
1542
|
+
Uint8 *dstY1, *dstY2, *dstU1, *dstU2, *dstV1, *dstV2;
|
1543
|
+
Uint32 dstY_pitch, dstUV_pitch;
|
1544
|
+
Uint32 dst_pitch_left;
|
1545
|
+
|
1546
|
+
if (src == dst) {
|
1547
|
+
return SDL_SetError("Can't change YUV plane types in-place");
|
1548
|
+
}
|
1549
|
+
|
1550
|
+
if (GetYUVPlanes(width, height, src_format, src, src_pitch,
|
1551
|
+
&srcY1, &srcU, &srcV, &srcY_pitch, &srcUV_pitch) < 0) {
|
1552
|
+
return -1;
|
1553
|
+
}
|
1554
|
+
srcY2 = srcY1 + srcY_pitch;
|
1555
|
+
srcY_pitch_left = (srcY_pitch - width);
|
1556
|
+
|
1557
|
+
if (src_format == SDL_PIXELFORMAT_NV12 || src_format == SDL_PIXELFORMAT_NV21) {
|
1558
|
+
srcUV_pixel_stride = 2;
|
1559
|
+
srcUV_pitch_left = (srcUV_pitch - 2*((width + 1)/2));
|
1560
|
+
} else {
|
1561
|
+
srcUV_pixel_stride = 1;
|
1562
|
+
srcUV_pitch_left = (srcUV_pitch - ((width + 1)/2));
|
1563
|
+
}
|
1564
|
+
|
1565
|
+
if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch,
|
1566
|
+
(const Uint8 **)&dstY1, (const Uint8 **)&dstU1, (const Uint8 **)&dstV1,
|
1567
|
+
&dstY_pitch, &dstUV_pitch) < 0) {
|
1568
|
+
return -1;
|
1569
|
+
}
|
1570
|
+
dstY2 = dstY1 + dstY_pitch;
|
1571
|
+
dstU2 = dstU1 + dstUV_pitch;
|
1572
|
+
dstV2 = dstV1 + dstUV_pitch;
|
1573
|
+
dst_pitch_left = (dstY_pitch - 4*((width + 1)/2));
|
1574
|
+
|
1575
|
+
/* Copy 2x2 blocks of pixels at a time */
|
1576
|
+
for (y = 0; y < (height - 1); y += 2) {
|
1577
|
+
for (x = 0; x < (width - 1); x += 2) {
|
1578
|
+
/* Row 1 */
|
1579
|
+
*dstY1 = *srcY1++;
|
1580
|
+
dstY1 += 2;
|
1581
|
+
*dstY1 = *srcY1++;
|
1582
|
+
dstY1 += 2;
|
1583
|
+
*dstU1 = *srcU;
|
1584
|
+
*dstV1 = *srcV;
|
1585
|
+
|
1586
|
+
/* Row 2 */
|
1587
|
+
*dstY2 = *srcY2++;
|
1588
|
+
dstY2 += 2;
|
1589
|
+
*dstY2 = *srcY2++;
|
1590
|
+
dstY2 += 2;
|
1591
|
+
*dstU2 = *srcU;
|
1592
|
+
*dstV2 = *srcV;
|
1593
|
+
|
1594
|
+
srcU += srcUV_pixel_stride;
|
1595
|
+
srcV += srcUV_pixel_stride;
|
1596
|
+
dstU1 += 4;
|
1597
|
+
dstU2 += 4;
|
1598
|
+
dstV1 += 4;
|
1599
|
+
dstV2 += 4;
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
/* Last column */
|
1603
|
+
if (x == (width - 1)) {
|
1604
|
+
/* Row 1 */
|
1605
|
+
*dstY1 = *srcY1;
|
1606
|
+
dstY1 += 2;
|
1607
|
+
*dstY1 = *srcY1++;
|
1608
|
+
dstY1 += 2;
|
1609
|
+
*dstU1 = *srcU;
|
1610
|
+
*dstV1 = *srcV;
|
1611
|
+
|
1612
|
+
/* Row 2 */
|
1613
|
+
*dstY2 = *srcY2;
|
1614
|
+
dstY2 += 2;
|
1615
|
+
*dstY2 = *srcY2++;
|
1616
|
+
dstY2 += 2;
|
1617
|
+
*dstU2 = *srcU;
|
1618
|
+
*dstV2 = *srcV;
|
1619
|
+
|
1620
|
+
srcU += srcUV_pixel_stride;
|
1621
|
+
srcV += srcUV_pixel_stride;
|
1622
|
+
dstU1 += 4;
|
1623
|
+
dstU2 += 4;
|
1624
|
+
dstV1 += 4;
|
1625
|
+
dstV2 += 4;
|
1626
|
+
}
|
1627
|
+
|
1628
|
+
srcY1 += srcY_pitch_left + srcY_pitch;
|
1629
|
+
srcY2 += srcY_pitch_left + srcY_pitch;
|
1630
|
+
srcU += srcUV_pitch_left;
|
1631
|
+
srcV += srcUV_pitch_left;
|
1632
|
+
dstY1 += dst_pitch_left + dstY_pitch;
|
1633
|
+
dstY2 += dst_pitch_left + dstY_pitch;
|
1634
|
+
dstU1 += dst_pitch_left + dstUV_pitch;
|
1635
|
+
dstU2 += dst_pitch_left + dstUV_pitch;
|
1636
|
+
dstV1 += dst_pitch_left + dstUV_pitch;
|
1637
|
+
dstV2 += dst_pitch_left + dstUV_pitch;
|
1638
|
+
}
|
1639
|
+
|
1640
|
+
/* Last row */
|
1641
|
+
if (y == (height - 1)) {
|
1642
|
+
for (x = 0; x < (width - 1); x += 2) {
|
1643
|
+
/* Row 1 */
|
1644
|
+
*dstY1 = *srcY1++;
|
1645
|
+
dstY1 += 2;
|
1646
|
+
*dstY1 = *srcY1++;
|
1647
|
+
dstY1 += 2;
|
1648
|
+
*dstU1 = *srcU;
|
1649
|
+
*dstV1 = *srcV;
|
1650
|
+
|
1651
|
+
srcU += srcUV_pixel_stride;
|
1652
|
+
srcV += srcUV_pixel_stride;
|
1653
|
+
dstU1 += 4;
|
1654
|
+
dstV1 += 4;
|
1655
|
+
}
|
1656
|
+
|
1657
|
+
/* Last column */
|
1658
|
+
if (x == (width - 1)) {
|
1659
|
+
/* Row 1 */
|
1660
|
+
*dstY1 = *srcY1;
|
1661
|
+
dstY1 += 2;
|
1662
|
+
*dstY1 = *srcY1++;
|
1663
|
+
dstY1 += 2;
|
1664
|
+
*dstU1 = *srcU;
|
1665
|
+
*dstV1 = *srcV;
|
1666
|
+
|
1667
|
+
srcU += srcUV_pixel_stride;
|
1668
|
+
srcV += srcUV_pixel_stride;
|
1669
|
+
dstU1 += 4;
|
1670
|
+
dstV1 += 4;
|
1671
|
+
}
|
1672
|
+
}
|
1673
|
+
return 0;
|
1674
|
+
}
|
1675
|
+
|
1676
|
+
static int
|
1677
|
+
SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height,
|
1678
|
+
Uint32 src_format, const void *src, int src_pitch,
|
1679
|
+
Uint32 dst_format, void *dst, int dst_pitch)
|
1680
|
+
{
|
1681
|
+
int x, y;
|
1682
|
+
const Uint8 *srcY1, *srcY2, *srcU1, *srcU2, *srcV1, *srcV2;
|
1683
|
+
Uint32 srcY_pitch, srcUV_pitch;
|
1684
|
+
Uint32 src_pitch_left;
|
1685
|
+
Uint8 *dstY1, *dstY2, *dstU, *dstV;
|
1686
|
+
Uint32 dstY_pitch, dstUV_pitch;
|
1687
|
+
Uint32 dstY_pitch_left, dstUV_pitch_left, dstUV_pixel_stride;
|
1688
|
+
|
1689
|
+
if (src == dst) {
|
1690
|
+
return SDL_SetError("Can't change YUV plane types in-place");
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
if (GetYUVPlanes(width, height, src_format, src, src_pitch,
|
1694
|
+
&srcY1, &srcU1, &srcV1, &srcY_pitch, &srcUV_pitch) < 0) {
|
1695
|
+
return -1;
|
1696
|
+
}
|
1697
|
+
srcY2 = srcY1 + srcY_pitch;
|
1698
|
+
srcU2 = srcU1 + srcUV_pitch;
|
1699
|
+
srcV2 = srcV1 + srcUV_pitch;
|
1700
|
+
src_pitch_left = (srcY_pitch - 4*((width + 1)/2));
|
1701
|
+
|
1702
|
+
if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch,
|
1703
|
+
(const Uint8 **)&dstY1, (const Uint8 **)&dstU, (const Uint8 **)&dstV,
|
1704
|
+
&dstY_pitch, &dstUV_pitch) < 0) {
|
1705
|
+
return -1;
|
1706
|
+
}
|
1707
|
+
dstY2 = dstY1 + dstY_pitch;
|
1708
|
+
dstY_pitch_left = (dstY_pitch - width);
|
1709
|
+
|
1710
|
+
if (dst_format == SDL_PIXELFORMAT_NV12 || dst_format == SDL_PIXELFORMAT_NV21) {
|
1711
|
+
dstUV_pixel_stride = 2;
|
1712
|
+
dstUV_pitch_left = (dstUV_pitch - 2*((width + 1)/2));
|
1713
|
+
} else {
|
1714
|
+
dstUV_pixel_stride = 1;
|
1715
|
+
dstUV_pitch_left = (dstUV_pitch - ((width + 1)/2));
|
1716
|
+
}
|
1717
|
+
|
1718
|
+
/* Copy 2x2 blocks of pixels at a time */
|
1719
|
+
for (y = 0; y < (height - 1); y += 2) {
|
1720
|
+
for (x = 0; x < (width - 1); x += 2) {
|
1721
|
+
/* Row 1 */
|
1722
|
+
*dstY1++ = *srcY1;
|
1723
|
+
srcY1 += 2;
|
1724
|
+
*dstY1++ = *srcY1;
|
1725
|
+
srcY1 += 2;
|
1726
|
+
|
1727
|
+
/* Row 2 */
|
1728
|
+
*dstY2++ = *srcY2;
|
1729
|
+
srcY2 += 2;
|
1730
|
+
*dstY2++ = *srcY2;
|
1731
|
+
srcY2 += 2;
|
1732
|
+
|
1733
|
+
*dstU = (Uint8)(((Uint32)*srcU1 + *srcU2)/2);
|
1734
|
+
*dstV = (Uint8)(((Uint32)*srcV1 + *srcV2)/2);
|
1735
|
+
|
1736
|
+
srcU1 += 4;
|
1737
|
+
srcU2 += 4;
|
1738
|
+
srcV1 += 4;
|
1739
|
+
srcV2 += 4;
|
1740
|
+
dstU += dstUV_pixel_stride;
|
1741
|
+
dstV += dstUV_pixel_stride;
|
1742
|
+
}
|
1743
|
+
|
1744
|
+
/* Last column */
|
1745
|
+
if (x == (width - 1)) {
|
1746
|
+
/* Row 1 */
|
1747
|
+
*dstY1 = *srcY1;
|
1748
|
+
srcY1 += 2;
|
1749
|
+
*dstY1++ = *srcY1;
|
1750
|
+
srcY1 += 2;
|
1751
|
+
|
1752
|
+
/* Row 2 */
|
1753
|
+
*dstY2 = *srcY2;
|
1754
|
+
srcY2 += 2;
|
1755
|
+
*dstY2++ = *srcY2;
|
1756
|
+
srcY2 += 2;
|
1757
|
+
|
1758
|
+
*dstU = (Uint8)(((Uint32)*srcU1 + *srcU2)/2);
|
1759
|
+
*dstV = (Uint8)(((Uint32)*srcV1 + *srcV2)/2);
|
1760
|
+
|
1761
|
+
srcU1 += 4;
|
1762
|
+
srcU2 += 4;
|
1763
|
+
srcV1 += 4;
|
1764
|
+
srcV2 += 4;
|
1765
|
+
dstU += dstUV_pixel_stride;
|
1766
|
+
dstV += dstUV_pixel_stride;
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
srcY1 += src_pitch_left + srcY_pitch;
|
1770
|
+
srcY2 += src_pitch_left + srcY_pitch;
|
1771
|
+
srcU1 += src_pitch_left + srcUV_pitch;
|
1772
|
+
srcU2 += src_pitch_left + srcUV_pitch;
|
1773
|
+
srcV1 += src_pitch_left + srcUV_pitch;
|
1774
|
+
srcV2 += src_pitch_left + srcUV_pitch;
|
1775
|
+
dstY1 += dstY_pitch_left + dstY_pitch;
|
1776
|
+
dstY2 += dstY_pitch_left + dstY_pitch;
|
1777
|
+
dstU += dstUV_pitch_left;
|
1778
|
+
dstV += dstUV_pitch_left;
|
1779
|
+
}
|
1780
|
+
|
1781
|
+
/* Last row */
|
1782
|
+
if (y == (height - 1)) {
|
1783
|
+
for (x = 0; x < (width - 1); x += 2) {
|
1784
|
+
*dstY1++ = *srcY1;
|
1785
|
+
srcY1 += 2;
|
1786
|
+
*dstY1++ = *srcY1;
|
1787
|
+
srcY1 += 2;
|
1788
|
+
|
1789
|
+
*dstU = *srcU1;
|
1790
|
+
*dstV = *srcV1;
|
1791
|
+
|
1792
|
+
srcU1 += 4;
|
1793
|
+
srcV1 += 4;
|
1794
|
+
dstU += dstUV_pixel_stride;
|
1795
|
+
dstV += dstUV_pixel_stride;
|
1796
|
+
}
|
1797
|
+
|
1798
|
+
/* Last column */
|
1799
|
+
if (x == (width - 1)) {
|
1800
|
+
*dstY1 = *srcY1;
|
1801
|
+
*dstU = *srcU1;
|
1802
|
+
*dstV = *srcV1;
|
1803
|
+
}
|
1804
|
+
}
|
1805
|
+
return 0;
|
1806
|
+
}
|
1807
|
+
|
1808
|
+
int
|
1809
|
+
SDL_ConvertPixels_YUV_to_YUV(int width, int height,
|
1810
|
+
Uint32 src_format, const void *src, int src_pitch,
|
1811
|
+
Uint32 dst_format, void *dst, int dst_pitch)
|
1812
|
+
{
|
1813
|
+
if (src_format == dst_format) {
|
1814
|
+
if (src == dst) {
|
1815
|
+
/* Nothing to do */
|
1816
|
+
return 0;
|
1817
|
+
}
|
1818
|
+
return SDL_ConvertPixels_YUV_to_YUV_Copy(width, height, src_format, src, src_pitch, dst, dst_pitch);
|
1819
|
+
}
|
1820
|
+
|
1821
|
+
if (IsPlanar2x2Format(src_format) && IsPlanar2x2Format(dst_format)) {
|
1822
|
+
return SDL_ConvertPixels_Planar2x2_to_Planar2x2(width, height, src_format, src, src_pitch, dst_format, dst, dst_pitch);
|
1823
|
+
} else if (IsPacked4Format(src_format) && IsPacked4Format(dst_format)) {
|
1824
|
+
return SDL_ConvertPixels_Packed4_to_Packed4(width, height, src_format, src, src_pitch, dst_format, dst, dst_pitch);
|
1825
|
+
} else if (IsPlanar2x2Format(src_format) && IsPacked4Format(dst_format)) {
|
1826
|
+
return SDL_ConvertPixels_Planar2x2_to_Packed4(width, height, src_format, src, src_pitch, dst_format, dst, dst_pitch);
|
1827
|
+
} else if (IsPacked4Format(src_format) && IsPlanar2x2Format(dst_format)) {
|
1828
|
+
return SDL_ConvertPixels_Packed4_to_Planar2x2(width, height, src_format, src, src_pitch, dst_format, dst, dst_pitch);
|
1829
|
+
} else {
|
1830
|
+
return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format));
|
1831
|
+
}
|
1832
|
+
}
|
1833
|
+
|
1834
|
+
/* vi: set ts=4 sw=4 expandtab: */
|