Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Apr 29, 2020. It is now read-only.
/iCimulatorPublic archive

Simulate camera functions on iOS Simulator with images, videos, or your MacBook Camera.

License

NotificationsYou must be signed in to change notification settings

YuigaWada/iCimulator

Repository files navigation

LicenseSwift VersionCocoaPods CompatibleCarthage compatible


iOS Camera Simulator 📷

iCimulator allows us to use camera functions on iOS Simulator!

2019-Oct-23:A new mode 'Mac Camera Mode' is added!

→Clickhere for details!


Support forAVFoundation &UIImagePickerController !

Installation 🎈

CocoaPods

You can useCocoaPods to installiCimulator by adding it to yourPodfile:

pod'iCimulator'

Carthage

Create aCartfile that lists the framework and runcarthage update. Follow theinstructions to add$(SRCROOT)/Carthage/Build/iOS/iCimulator.framework to an iOS project.

github "YuigaWada/iCimulator"

Manually

  1. Download and dropiCimulator in your project.
  2. Congratulations!



Usage🍏 - Image or Video -

Just 5 steps!

  1. Prepare your mock data. (image/video)
  2. InstalliCimulator.
  3. CopyiCimulator.swift andiCimulator.plist to your project.
  4. Set upiCimulator.plist , which is described what kind of mock data is used.
  5. LinkiCimulator.swift andiCimulator.plist to your project.

You can copyiCimulator.swift andiCimulator.plist fromtemplate folder.






**This 5-Steps MUST BE DONE on all projects which use camera functions.**



iCimulator.plist

KeyValueNotes
TypeImageYou can set an image as a mock
VideoYou can set a video as a mock
Mac-CameraClickhere for details!
Argument...Write here path of your mock data



iCimulator.swift

////   ** iCimulator.swift **//// MIT License//// Copyright (c) 2019 YuigaWada//// Permission is hereby granted, free of charge, to any person obtaining a copy// of this software and associated documentation files (the "Software"), to deal// in the Software without restriction, including without limitation the rights// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell// copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions://// The above copyright notice and this permission notice shall be included in all// copies or substantial portions of the Software.//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE// SOFTWARE.//#if targetEnvironment(simulator)import iCimulator    //AVFoundationpublictypealiasAVCaptureDevice=FakeCaptureDevicepublictypealiasAVCaptureSession=FakeCaptureSessionpublictypealiasAVCaptureVideoPreviewLayer=FakePreviewLayerpublictypealiasAVCapturePhotoOutput=FakeCapturePhotoOutputpublictypealiasAVCapturePhotoCaptureDelegate=FakeCapturePhotoCaptureDelegatepublictypealiasAVCapturePhoto=FakeCapturePhotopublictypealiasAVCaptureDeviceInput=FakeCaptureDeviceInputpublictypealiasAVCaptureMovieFileOutput=FakeCaptureMovieFileOutputpublictypealiasAVCaptureFileOutput=FakeCaptureFileOutputpublictypealiasAVCaptureFileOutputRecordingDelegate=FakeCaptureFileOutputRecordingDelegatepublictypealiasAVCaptureConnection=FakeCaptureConnectionpublictypealiasAVCapturePhotoSettings=FakeCapturePhotoSettingspublictypealiasAVCaptureResolvedPhotoSettings=FakeCaptureResolvedPhotoSettings    //For supporting iOS 10.publictypealiasAVCaptureStillImageOutput=FakeCaptureStillImageOutputpublictypealiasCMSampleBuffer=FakeCMSampleBuffer    //UIImagePickerControllerpublictypealiasUIImagePickerController=FakeImagePickerControllerpublictypealiasUIImagePickerControllerDelegate=FakeImagePickerControllerDelegate#endif



Usage🍎 - Mac Camera -

You can use your macbook camera to simulate camera functions!!

First, you need to launch a camera-server on your MacBook.

Openstreaming_server and launchstreaming_server/server.py!


After checking youriCimulator.plist, you can see that your MacBook Camera is displayed on iOS Simulator 😊

Dependencies

  • Python 3.7.3
  • Numpy
  • opencv-python
  • Pillow
  • Pandas

Options

You can use these options in usingstreaming_server/server.py.

___________________________________________________________________________██╗ ██████╗██╗███╗   ███╗██╗   ██╗██╗      █████╗ ████████╗ ██████╗ ██████╗██║██╔════╝██║████╗ ████║██║   ██║██║     ██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗██║██║     ██║██╔████╔██║██║   ██║██║     ███████║   ██║   ██║   ██║██████╔╝██║██║     ██║██║╚██╔╝██║██║   ██║██║     ██╔══██║   ██║   ██║   ██║██╔══██╗██║╚██████╗██║██║ ╚═╝ ██║╚██████╔╝███████╗██║  ██║   ██║   ╚██████╔╝██║  ██║╚═╝ ╚═════╝╚═╝╚═╝     ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═╝   ╚═╝    ╚═════╝ ╚═╝  ╚═╝                                                            by Yuiga Wada.___________________________________________________________________________-v / -verbose / --verbose : turn on Verbose Mode.-h / -help / --help : show help.-c / -camera / --camera : enable you to show the captured frame on another window.



Demo





Todo📒

  • typealias対象のClass →互いに可換化
  • Carthageの準備
  • CocoaPodsの準備
  • 日本語版READMEの作成

Contribute

We would love you for the contribution toiCimulator, check theLICENSE file for more info.

Others

Yuiga Wada -WebSiteTwitter -@YuigaWada

Distributed under the MIT license. SeeLICENSE for more information.

https://github.com/YuigaWada/iCimulator

About

Simulate camera functions on iOS Simulator with images, videos, or your MacBook Camera.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp