在 iPhone 上使用 X 射线或热效应

发布于 2024-11-19 23:18:39 字数 542 浏览 0 评论 0原文

我该如何改变相机效果,就像 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仙女山的月亮 2024-11-26 23:18:39

您已经看到“反转”这个词,并且只是假设它可以实现您想要的功能。事实并非如此,抱歉:(

您所应用的用于影响相机布局的变换,与显示的实际颜色无关。您将相机预览颠倒过来(并且可能将其放在某个地方)据

我所知,没有 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文