rorodriguez116 / camera-swiftui Goto Github PK
View Code? Open in Web Editor NEWA lightweight camera library for quick integration with SwiftUI - iOS/iPadOS only
A lightweight camera library for quick integration with SwiftUI - iOS/iPadOS only
Privacy Updates for AppStore submission
Developers are responsible for all code included in their apps. At WWDC23, Apple introduced new privacy manifests and signatures for commonly used third-party SDKs and announced that developers will need to declare approved reasons for using a set of APIs in their app’s privacy manifest.
The library doesn't provide Privacy Manifest file
The library should provide Privacy Manifest if it collects information or access "Required Reasons API"
CameraPreview.swift: The circle that appears when you tap to focus does not appear at the location of the tap. Instead it appears slightly off center due to the origin of the circle being at the top left corner. Proposed solution is to just offset the circle in x and y by its radius. Should just modify the focusView's CGRect to this:
let focusCircleDiam: CGFloat = 50
let shiftedLayerPoint = CGPoint(
x: layerPoint.x - (focusCircleDiam / 2),
y: layerPoint.y - (focusCircleDiam / 2))
self.focusView.layer.frame = CGRect(origin: shiftedLayerPoint, size: CGSize(width: focusCircleDiam, height: focusCircleDiam))
Even if you rotate the device orientation, the preview screen will be fixed in portrait orientation. Even if you take a picture, the result is the same problem. Is there any way to solve it?
How is it possible to shoot photo in landscape format?
Hello, I tried to modify the capturePhoto()
function to allow depth data delivery but in the photo callback, the depth data is still nil.
I tried to modify the configuration code to use either LiDAR or TrueDepth like this sample project (https://developer.apple.com/documentation/avfoundation/additional_data_capture/capturing_depth_using_the_lidar_camera) but I received no depth nor calibration either. I'm wondering if you have suggestion on how to get depth/camera calibration when a photo is taken as well. Thank you
public func capturePhoto() {
/*
Retrieve the video preview layer's video orientation on the main queue before
entering the session queue. This to ensures that UI elements are accessed on
the main thread and session configuration is done on the session queue.
*/
if self.setupResult != .configurationFailed {
let videoPreviewLayerOrientation: AVCaptureVideoOrientation = .portrait
self.isCameraButtonDisabled = true
sessionQueue.async {
if let photoOutputConnection = self.photoOutput.connection(with: .video) {
photoOutputConnection.videoOrientation = videoPreviewLayerOrientation
}
var photoSettings = AVCapturePhotoSettings()
photoSettings.isDepthDataDeliveryEnabled = true
When following this guide to recreate a Snapchat-like navigation for my app, I stumbled upon "Couldn't add video device input to the session." when using the following code:
TabView(){ CameraPreview(session: model.session) .onAppear { model.configure() } .tabViewStyle(PageTabViewStyle())
Is there any way to fill the whole screen?
Great package! - I discovered a bug. When I move to a new view using NavigationLink
and then use the back
navigationBarButton to return to the camera view - it is no longer possible to take an image; and Couldn't add video device input to the session.
is printed in the console.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.