在 iPhone 上使用 X 射线或热效应
我该如何改变相机效果,就像 Mac 或 iPad 上的 Photo Booth 从 X 射线效果变为热效果一样?我到处找遍了,根本找不到任何东西。我想使用 X 射线或热效应。
这就是我一直在尝试的,但我不知道我在做什么。
UIImagePickerController *Camera_Picker = [[UIImagePickerController alloc] init];
Camera_Picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:Camera_Picker animated:YES];
Camera_Picker.cameraViewTransform = CGAffineTransformInvert(CGAffineTransformMake(1, 1, 1, 1, 1, 1));
我已经更改了数字,但没有任何效果,只是使屏幕变白。当你在 Photoshop 中反转某些东西时,它会呈现出热感外观,这就是我的思考过程。
How would I go about changing camera effects in the same way that Photo Booth on the Mac or iPad changes from x-ray to thermal effect? I have searched all over and can't find anything at all. I would like to use the x-ray or thermal effect.
This is what I have been trying but I have no idea what I'm doing.
UIImagePickerController *Camera_Picker = [[UIImagePickerController alloc] init];
Camera_Picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:Camera_Picker animated:YES];
Camera_Picker.cameraViewTransform = CGAffineTransformInvert(CGAffineTransformMake(1, 1, 1, 1, 1, 1));
I have been change around the numbers but nothing works right it just turns the screen white. When you invert something in Photoshop it gives it a thermal look, that is my thought process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已经看到“反转”这个词,并且只是假设它可以实现您想要的功能。事实并非如此,抱歉:(
您所应用的用于影响相机布局的变换,与显示的实际颜色无关。您将相机预览颠倒过来(并且可能将其放在某个地方)据
我所知,没有 sdk 选项可以执行您想要执行的操作 - 您必须读取相机的每一帧并自行转换,这是相机选择器的功能。班级不会让你 您需要查看 AVFoundation 类来执行此操作
- 它们有点复杂。 /Reference/AVFoundationFramework/_index.html" rel="nofollow noreferrer">是来自苹果的参考文档 和 这个堆栈溢出问题可能也很有用!
You've seen the word 'Invert' and just assumed that it does what you want. It doesn't, sorry :(
The transform that you're applying to to affect the layout of the camera, it's nothing to do with the actual colours displayed. You're turning the camera preview upside down (and probably putting it somewhere off screen, hence the white display).
There's no sdk option to do what you're trying to do as far as I know - you will have to read in each frame of the camera and convert it yourself. This is something that the camera picker class won't let you do.
You'll need to look at the AVFoundation classes to do this - they're a bit more complicated. A starting point is the reference docs from apple and this stack overflow question is probably useful as well!