Reading raw image files in c#

时光毁灭记忆、已成空白 提交于 2019-12-01 19:32:59

If you don't have a codec installed, then you'll have to read the raw image data and convert it to a bitmap or other format that you can read. In order to do that, you need a copy of the format specification so that you can write code that reads the binary data.

I strongly recommend getting a codec, or finding code that somebody has written that already handles the conversion. But if you really want to try your hand at writing image format conversion code, your first order of business is to get the format specification.

A quick Google search on [CR2 image format] reveals this Canon CR2 Specification. Truthfully, I don't know how accurate that is, but it looks reasonable. A little time with a search engine will probably reveal similar documents for the other formats.

Be forewarned: writing these conversions can be a very difficult task. Again, I recommend that you find some existing code that you can leverage.

If you insist on not installing a codec, then your best bet might be these:

http://www.cybercom.net/~dcoffin/dcraw/
- written in C, supports most cameras

http://sourceforge.net/projects/dcrawnet/
- apparently a (partial?) port of DCRAW to C#, but project does not seem to be active

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!