Results 107 issues of Hui

## CGContext 和 CGContextRef `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraiphcs/CGContext.h`中定义了CGContextRef ```h typedef struct CF_BRIDGED_TYPE(id) CGContext *CGContextRef; ``` 搞明白这句用了我2个小时,真心不容易。 ### 复习struct和typedef - typedef: `typedef unsigned long ulong;`, 这个不解释了 - typedef pointer: `typedef int *intPointer`, 即intPointer是int的address reference...

favor

## 单位体系 - **国际单位制**: SI Unit (来自法语Système international d'unités, 国际单位制), 又称公制或米制。源于法国大革命,1960年正式公布。SI已受大部分国家所采纳,但在英语国家中,SI并没有收到全面使用。它的基础是米-千克-秒制(KMS) - **英美单位制**: Imperial Unit (英制单位) 和 U.S. Customary Units (美制单位,或称美国惯用单位),它的基础是英寸-磅-秒 - 1 feet (ft 英尺) = 12 inch (in...

favor

[学习 MacOS App Part 1-6](https://github.com/nonocast/me/issues?q=is%3Aissue+is%3Aopen+学习MacOS+App+) ## 前导 - 从obs来看,如果是跨平台则应该考虑Qt和C/C++,native部分辅以objc - 但如果只需要考虑macOS和iOS体系,应该考虑SwiftUI/Swift, native部分通过obj/c实现 - linux的服务端程序应该考虑nodejs/javascript和C++两个体系,在需要的情况下混合nodejs和C++ > 对于有C/C++背景的程序员,Objective-C(简称ObjC)是可以速成的,因为说到底,ObjC只是在传统的C语言上加上一层面向对象的语义。ObjC是C语言的超集,一个C语言程序就是一个ObjC程序。 ## ObjC hello.m ```objc #import int main(int argc, char *argv[]) { NSLog(@"hello world"); }...

app.swift ```swift import SwiftUI if let nsImage = NSImage(byReferencingFile: "/Users/nonocast/Pictures/Samples/dance.jpg"), nsImage.isValid { print(nsImage) } ``` 输出 ```sh ``` 关于NSImage和NSBItmapImageRep的关系见这篇文章: [Working with Images - Cocoa in a Nutshell [Book]](https://www.oreilly.com/library/view/cocoa-in-a/0596004621/ch04s07.html) > The...

[MacOS Virtual Camera Compatibility Guide](https://obsproject.com/wiki/MacOS-Virtual-Camera-Compatibility-Guide) 由于MacOS提升了安全要求,需要对引用的obs-virtual-camera要有一致签名,这也是为什么同样的设备上钉钉,GPUImage3的能用,然而Zoom, Skype,包括自己编译的程序不能用,在加载的时候会runtime error。 ```sh 2022-05-05 06:27:20.970114+0800 CameraApp[9687:16921160] HALC_ShellObject::GetPropertyData: call to the proxy failed, Error: 2003332927 (who?) 2022-05-05 06:27:20.970145+0800 CameraApp[9687:16921160] HALPlugIn::ObjectGetPropertyData: got an error from the...

## Overview - CMSampleBufferRef (Core Media) - CVPixelBufferRef (Core Video) - CIImage (Core Image) - CGImage (Core Graphics) - UIImage/NSImage (Cocoa) - Image (SwiftUI) ## Framework ![164c9eaaa7e92689~tplv-t2oaga2asx-zoom-in-crop-mark-1304-0-0-0 image](https://user-images.githubusercontent.com/1457904/166632585-8e1e5565-dbfb-4787-bbd6-00417cc63387.png) 来源: [iOS图形处理概论:OpenGL...

文档形式不限于文字,包括视频,所以大概有几个方面: - [Apple Developer Documentation](https://developer.apple.com) - Apple Developer App - Xcode Documentation (Xcode Help) - Courses Site ([raywenderlich.com](https://designcode.io), [Design+Code](https://designcode.io)) - Github - Youtube/Bilibili - Stackoverflow - Google - Book ##...

## AVCaptureSession 架构 图一: 图二: ![b9c65b62-3728-43f1-8d25-08fd42bc6bb7](https://user-images.githubusercontent.com/1457904/166438605-20247db4-0cf7-46f4-a2eb-e11b00c9e028.png) 图三: ![1877765-4cbf9ba736afdb69](https://user-images.githubusercontent.com/1457904/166455703-0ade26cc-81a1-4f74-8548-9cab26b3b09e.png) 说明: - 多个App可以同时打开一个摄像头 - 一个程序中可以同时建立对一个摄像头的多个session - 一个session支持多组connection, 比如同时支持photoOutput, dataOutput ## 参考文档 - [关于AVFoundation - AVFoundation 编程指南](https://linsyorozuya.gitbook.io/avfoundation-programming-guide/) - [Setting Up a Capture Session...

要在SwiftUI中显示 [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview) 或是 [AVCaptureVideoPreviewLayer](https://developer.apple.com/documentation/avfoundation/avcapturevideopreviewlayer) 就需要借助NSViewRepresentable。 ## 起步 假设Content.swift ```swift import SwiftUI struct ContentView: View { var body: some View { PreviewView() } } struct ContentView_Previews: PreviewProvider { static var previews:...

[ObservableObject | Apple Developer Documentation](https://developer.apple.com/documentation/combine/observableobject) main.swift ```swift import SwiftUI class Contact: ObservableObject { @Published var name: String @Published var age: Int init(name: String, age: Int) { self.name = name self.age...