-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imageformats : PBM and XPM #9
Comments
I've just had a look at XPM and PBM formats, I wouldn't mind PBM and family, but XPM not really. |
PBM it's very trivial to implement. I wrote a PBM reader on C++ some time ago to generate a bitmap font from it. |
Yeah, that's what I thought as well. |
XPM have different versions . The original version , really need a more complex parsing. It was design to be used with a #include "image.xpm" from C. XPM2 not have these C stuff . If you check XPM2, It's similar to PBM :
XPM3 isn't hard to parse, as the only C stuff is at the begin/end of the file :
If you remove the opening/end, is a list of strings and uses // & /* */ as comments. |
I'm happy with XPM2 just not the others. At the current time, I won't be implementing another file format any where close to PNG's complexity, ones enough for now. I'll see what I can do in the next few hours about PBM support. |
I've started on the XPM work - trying to mirror the PNG interface as much as possible. Plan is to start with XPM2 and then do a version of XPM1/3 that doesn't use the full C lexer if I can pull it off. |
Don't worry too much about what I have with PNG. Get something working e.g. using GC and all. |
OK that's encouraging - I've been trying to make sense of the allocator work and interfaces, it's a lot to take in! |
Lets just say my first go of png reader/writer was quite a bit different. |
Making good progress. Initially I'll have a "D-ized" XPM1 and XPM3 that basically take raw D strings to make it easy for people to embed the XPM in their D code. Reading external .xpm with the valid C syntax will be a little more work but will definitely not require a full C lexer. I think the format is used rarely, and not really intended for high-performance image manipulation, so a lot of optimization is probably unnecessary. One question for you rikkimax: is there an image or bitmap class you'd prefer me to use for the export/internal representation? I poked around the repository source and had a hard time finding something with an obvious API that I should use. |
They are provided by std.experimental.graphic.image.storage. Hard code it for now to be e.g. horizontal. I have a solution for that in PNG that'll work fine here as well. |
Haver you planed to support PBM and XPM formats ? They are very trivial, and are very useful for embed small image resources on code.
The text was updated successfully, but these errors were encountered: