Re: JPG and PNG decoder

2012-06-17 Thread Philippe Sigaud
On 6/16/2012 12:10 PM, cal wrote: I've been working on decoders for simple (baseline) JPEG and PNG's, mostly for my own amusement, and they seem to work ok now, so if anyone has need of some simple D modules to load these formats you can grab them here:

Re: JPG and PNG decoder

2012-06-17 Thread cal
On Sunday, 17 June 2012 at 07:07:35 UTC, Philippe Sigaud wrote: Still, I'm interested in writing a JPEG/PNG to disk from a ubyte[3][][], or whatever. Do you mean that you want to encode a ubyte array to disk as JPEG/PNG? Encoding a JPEG would be a bit of work I think, the format's kind of a

Re: D syntax checker for Vim's plugin Syntastic

2012-06-17 Thread Alfredo Di Napoli
Just an update: my pull request has been merged and now my D syntax checker is officially present in the main syntastic repo: https://github.com/scrooloose/syntastic Enjoy! Alfredo

Re: JPG and PNG decoder

2012-06-17 Thread Chris NS
I second the request for a PNG encoder. You just saved me a lot of trouble, as I was about to implement my own PNG loader... and now I don't have to. ^_^ I'll glance over your code in full sometime and see if I notice any readily apparent improvements.

Re: JPG and PNG decoder

2012-06-17 Thread bearophile
cal: I've been working on decoders for simple (baseline) JPEG and PNG's, mostly for my own amusement, and they seem to work ok now, so if anyone has need of some simple D modules to load these formats you can grab them here: https://github.com/callumenator/imaged Suggestions on the code: -

Re: JPG and PNG decoder

2012-06-17 Thread Philippe Sigaud
On Sun, Jun 17, 2012 at 9:55 AM, cal callumena...@gmail.com wrote: On Sunday, 17 June 2012 at 07:07:35 UTC, Philippe Sigaud wrote: Still, I'm interested in writing a JPEG/PNG to disk from a ubyte[3][][], or whatever. Do you mean that you want to encode a ubyte array to disk as JPEG/PNG?

Re: JPG and PNG decoder

2012-06-17 Thread David
Am 16.06.2012 21:10, schrieb cal: I've been working on decoders for simple (baseline) JPEG and PNG's, mostly for my own amusement, and they seem to work ok now, so if anyone has need of some simple D modules to load these formats you can grab them here: https://github.com/callumenator/imaged

Re: D syntax checker for Vim's plugin Syntastic

2012-06-17 Thread bioinfornatics
Le dimanche 17 juin 2012 à 12:43 +0200, Alfredo Di Napoli a écrit : Just an update: my pull request has been merged and now my D syntax checker is officially present in the main syntastic repo: https://github.com/scrooloose/syntastic Enjoy! Alfredo does it works now with ldc2 and gdc

Re: JPG and PNG decoder

2012-06-17 Thread Stewart Gordon
On 17/06/2012 08:55, cal wrote: snip If you don't care too much about compression level, you simply zlib compress the data, write it out by image row/scanline, include appropriate header and chunk info, and you're done. snip Not quite. You need to encode it by scanline, add the filter byte

Re: JPG and PNG decoder

2012-06-17 Thread Philippe Sigaud
On Sun, Jun 17, 2012 at 3:25 PM, Stewart Gordon smjg_1...@yahoo.com wrote: FWIW a while ago I wrote a simple experimental program that generates an image and encodes it as a PNG.  And I've just tweaked it and updated it to D2 (attached).  It supports only truecolour with 8 bits per sample, but

Re: JPG and PNG decoder

2012-06-17 Thread Adam D. Ruppe
I have a simple png writer too if that's of use to you https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff image.d and png.d. Somewhat suboptimal to use, since I ported some of my old C code almost directly to it, and it still works like C.

Re: dpj for Windows

2012-06-17 Thread Robik
On Saturday, 16 June 2012 at 19:36:50 UTC, dnewbie wrote: On Tuesday, 22 May 2012 at 07:28:04 UTC, Ary Manzana wrote: On 5/22/12 8:55 AM, dnewbie wrote: On Monday, 21 May 2012 at 12:08:33 UTC, Ary Manzana wrote: On 5/20/12 10:37 PM, dnewbie wrote: It started as a D project, then I've moved

Re: D syntax checker for Vim's plugin Syntastic

2012-06-17 Thread bioinfornatics
Le dimanche 17 juin 2012 à 16:09 +0200, Alfredo Di Napoli a écrit : On Sunday, 17 June 2012 at 12:42:57 UTC, bioinfornatics wrote: Le dimanche 17 juin 2012 à 12:43 +0200, Alfredo Di Napoli a écrit : Just an update: my pull request has been merged and now my D syntax checker is

Re: JPG and PNG decoder

2012-06-17 Thread cal
On Sunday, 17 June 2012 at 12:15:36 UTC, bearophile wrote: Suggestions on the code: - Try to use final switches. - switch cases don't need (), so instead of case(foo): write case foo: - Try to add const/immutable/pure/nothrow where possible. Bye, bearophile Problem with final switches in

Re: JPG and PNG decoder

2012-06-17 Thread cal
On Sunday, 17 June 2012 at 12:35:41 UTC, David wrote: Cool so I don't need to use my stb_image binding ( https://bitbucket.org/dav1d/gl-utils/src/0b97f77c14d7/stb_image ) anylonger! I used stb_image with C++ opengl projects, and it was great. stb_truetype is another gem, I would love to

Re: JPG and PNG decoder

2012-06-17 Thread Stewart Gordon
On 17/06/2012 14:38, Philippe Sigaud wrote: On Sun, Jun 17, 2012 at 3:25 PM, Stewart Gordon smjg_1...@yahoo.com wrote: FWIW a while ago I wrote a simple experimental program that generates an image and encodes it as a PNG. And I've just tweaked it and updated it to D2 (attached). It supports

Re: JPG and PNG decoder

2012-06-17 Thread cal
On Sunday, 17 June 2012 at 23:17:54 UTC, Stewart Gordon wrote: You two should fuse it into one module, to give us loading/writing. That would be quite cool. I don't know how much of the code will need rewriting in order to support interlacing or all PNG colour types/depths. But I also

Re: JPG and PNG decoder

2012-06-17 Thread Chris NS
On Sunday, 17 June 2012 at 20:10:28 UTC, cal wrote: though I have worlds of trouble with const-ness, I will endeavour to add those guarantees :) What I usually do, unless it's just an obvious case, is write code without concern for const-ness, then write a thorough test and step through one