JPG and PNG decoder

2012-06-16 Thread cal
e routines, and have not tested the JPEG decoder extensively, so there are bound to be bugs and there is plenty room for improvement. - The example shows stream usage, and uses Adam Ruppe's simpledisplay to make a little viewer, that can flick through all images in a directory. Cheers, cal

Re: JPG and PNG decoder

2012-06-17 Thread cal
l give a simple encoder a go if you think you could use it. Cheers, cal

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 th

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 write

Re: JPG and PNG decoder

2012-06-17 Thread cal
plate for this, can I add you to the author list? Also, if preferred, I can keep the master branch as a single merged module, just let me know. Cheers, cal

Re: JPG and PNG decoder

2012-06-21 Thread cal
On Thursday, 21 June 2012 at 17:58:47 UTC, Stewart Gordon wrote: On 18/06/2012 00:49, cal wrote: ubyte[] data = some data; Image img = new Img!(Px.R8G8B8)(width, height, data); Image? Img? img.write("mypng.png"); Image is the interface, Img the templated class that does all

Re: NaNs Just Don't Get No Respect

2012-08-20 Thread cal
On Monday, 20 August 2012 at 19:28:33 UTC, Peter Alexander wrote: On Sunday, 19 August 2012 at 22:22:28 UTC, Walter Bright wrote: > I find it more likely that the NaN will go unnoticed and > cause rare bugs. NaNs in your output are pretty obvious. For example, if your accounting program prints

Re: NaNs Just Don't Get No Respect

2012-08-21 Thread cal
On Tuesday, 21 August 2012 at 08:15:10 UTC, Don Clugston wrote: No, it's the other way around. The IEEE 754 standard defines min(x, NaN) == min(NaN, x) == x. According to the C standard, fmin() should be returning 10, as well. There is a bug in fmin(). However min() and max() are extremely un

Re: gl3n - OpenGL Maths for D

2012-08-31 Thread cal
On Friday, 31 August 2012 at 16:54:49 UTC, David wrote: Anything you miss? Matrix constructor for building projection matrices (I have a bit of code for doing this from near/far + FOV if you want it, but there are plenty examples on google). I've also found it useful to be able to set a giv

Re: early alpha of D REPL

2014-02-11 Thread cal
On Tuesday, 11 February 2014 at 11:33:53 UTC, thedeemon wrote: Have you seen Dabble? https://github.com/callumenator/dabble Just found out its author added Linux support. I was able to build an x86 version but it didn't work properly in a 64 bit system: it assumes dmd makes x86 binaries by

Re: early alpha of D REPL

2014-02-12 Thread cal
On Wednesday, 12 February 2014 at 18:08:11 UTC, Martin Nowak wrote: For example it should be possible to call a function or inherit from a class that were defined earlier. Dabble allows both of these things, if I understand your comment correctly.

Re: early alpha of D REPL

2014-02-14 Thread cal
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote: Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") =>