想要加载图像、处理它并将其保存回文件中?
我正在使用其混合应用程序在 webos 中创建一个照片编辑器应用程序。我是 c++ 新手。
我不想使用 C++ 在屏幕上显示图像,因为在前端我使用 javascript 作为 ui。因为 javascript UI 比 PDK 更好...但在后端我必须使用 c++ 来处理它并且将图像保存到文件中。我无法使用 javascript 保存它,因为 webOS 不支持 canvas.toDataURL() 方法。
因此,我必须从本地目录中的相对路径中选择一个图像文件,获取其 rgb 值,处理 rgb 值,然后将图像保存回目录。保存为新的并替换以前的。
好的,现在我需要你们开发人员的帮助。另外,如果使用 SDL 库这一切都是可能的?另外,我还可以在 c+|+ 中裁剪图像以及给定要裁剪的所有边缘的 x,y 坐标吗?
I am creating a photo editor app in webos using its hybrid app. I am new to c++.
I don't want to display image on the screen using C++, because on the front end I am using javascript as ui.because javascript UI is better thn PDK... But on the backend I have to use c++ just to process it and save image to the file. I can't save it using javascript because webOS doesn't have support for canvas.toDataURL() method.
So I have to pick an image file from a relative path in the local directory, get its rgb values, process on the rgb values and then saving image back to the directory. Saving as new and replacing the previous.
Ok, now I want assistance from u developers. Also if this is all possibe using the SDL library ?? Also can I crop image in c+|+ as well given x,y coordinates of all of its edges to be cropped from?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太了解 SDL 库(我想它可以加载和保存图像),但是要加载和保存图像,您可以使用 OpenIL/DevIL 库,它非常简单并且支持多种格式。您还可以看一下 OpenCV,但这对于您的目的来说可能有点繁重。对于第二个问题,加载图像后您可以对其进行任何操作,只需对其进行编程即可。有了合适的库和程序员,C++ 几乎可以做所有事情。对这个愚蠢的句子感到抱歉,但是您问是否可以在 C++ 中做到这一点,答案几乎总是“是”。
I don't know the SDL library well (I suppose it can load and save images) but for loading and saving images you can use the OpenIL/DevIL library, it is quite simple and supports many formats. You could also take a look at OpenCV, but that could be a bit heavy-weight for your purpose. To your second question, You can do everything with the image when it's loaded, just program it. With the right libraries and programmer, C++ can do nearly everything. Sorry for this stupid sentence, but you asked if you can do that in C++ and the answer is nearly always Yes.