Re: Working on a library: request for code review

2014-06-21 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 20 June 2014 at 11:15:20 UTC, Mike wrote: Do you think it's ready for a v0.1 release? It be willing to add it to dub if it passes general D coding stardards. Sure, go for it :). Dub package versioning should be done using SemVer so there are some restrictions on how to number a

Re: Working on a library: request for code review

2014-06-20 Thread Mike via Digitalmars-d-learn
Do you think it's ready for a v0.1 release? It be willing to add it to dub if it passes general D coding stardards. Once again, thanks for feedback and vast improvements of the code. Best, Mike

Re: Working on a library: request for code review

2014-06-19 Thread via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 14:05:12 UTC, Rene Zwanenburg wrote: On Tuesday, 17 June 2014 at 13:07:33 UTC, Marc Schütz wrote: On Monday, 16 June 2014 at 23:04:33 UTC, Rene Zwanenburg wrote: This one depends on taste, but these helpers can be eliminated by changing the Header definition a

Re: Working on a library: request for code review

2014-06-19 Thread Rene Zwanenburg via Digitalmars-d-learn
On Thursday, 19 June 2014 at 12:06:58 UTC, Marc Schütz wrote: On Wednesday, 18 June 2014 at 14:05:12 UTC, Rene Zwanenburg wrote: On Tuesday, 17 June 2014 at 13:07:33 UTC, Marc Schütz wrote: On Monday, 16 June 2014 at 23:04:33 UTC, Rene Zwanenburg wrote: This one depends on taste, but these

Re: Working on a library: request for code review

2014-06-19 Thread Mike via Digitalmars-d-learn
Once again thanks for the feedback. The RLE rewrite using std is impressive! I will use it today or tomorrow, great stuff.

Re: Working on a library: request for code review

2014-06-18 Thread via Digitalmars-d-learn
On Tuesday, 17 June 2014 at 18:35:34 UTC, Mike wrote: Thanks, will work on fixes tonight. The current method will not detect an error when the image type is not mapped but a color map is present. At least I assume that is not a valid TGA file? A non-mapped image may contain a color map ;-0

Re: Working on a library: request for code review

2014-06-18 Thread Rene Zwanenburg via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 13:42:32 UTC, Rene Zwanenburg wrote: On Wednesday, 18 June 2014 at 09:41:01 UTC, Marc Schütz wrote: On Tuesday, 17 June 2014 at 18:35:34 UTC, Mike wrote: Thanks, will work on fixes tonight. The current method will not detect an error when the image type is not

Re: Working on a library: request for code review

2014-06-18 Thread Rene Zwanenburg via Digitalmars-d-learn
On Monday, 16 June 2014 at 23:04:33 UTC, Rene Zwanenburg wrote: The writeCompressed function can probably be simplified using std.algorithm but it's not straightforward. I'll need to ponder it for a while. Here's a version using std.algorithm and std.range. I think it's easier to understand

Re: Working on a library: request for code review

2014-06-17 Thread via Digitalmars-d-learn
On Monday, 16 June 2014 at 23:04:33 UTC, Rene Zwanenburg wrote: This one depends on taste, but these helpers can be eliminated by changing the Header definition a little. It's the same union / anonymous struct trick from the previous post, only this time with bitfields:

Re: Working on a library: request for code review

2014-06-17 Thread Mike via Digitalmars-d-learn
Thanks, will work on fixes tonight. The current method will not detect an error when the image type is not mapped but a color map is present. At least I assume that is not a valid TGA file? A non-mapped image may contain a color map ;-0 it's simply discarded. As per your ideas return

Re: Working on a library: request for code review

2014-06-16 Thread Mike via Digitalmars-d-learn
I have refactored the code as recommended. I have also modified the not-yet-reviewed writers part to take advantage of the same approach (preallocated static-sized buffer) rather than allocate slices in loops. Hoping to hear something from you guys! Best, Mike

Re: Working on a library: request for code review

2014-06-16 Thread Rene Zwanenburg via Digitalmars-d-learn
On Monday, 16 June 2014 at 19:42:14 UTC, Mike wrote: I have refactored the code as recommended. I have also modified the not-yet-reviewed writers part to take advantage of the same approach (preallocated static-sized buffer) rather than allocate slices in loops. Hoping to hear something

Re: Working on a library: request for code review

2014-06-16 Thread Rene Zwanenburg via Digitalmars-d-learn
On Monday, 16 June 2014 at 19:42:14 UTC, Mike wrote: I have refactored the code as recommended. I have also modified the not-yet-reviewed writers part to take advantage of the same approach (preallocated static-sized buffer) rather than allocate slices in loops. Hoping to hear something

Re: Working on a library: request for code review

2014-06-15 Thread Mike via Digitalmars-d-learn
On Friday, 13 June 2014 at 21:09:23 UTC, Mike Wey wrote: On 06/12/2014 09:30 PM, Rene Zwanenburg wrote: I remember a function which does something like only only + canFind on one go. It would look something like header.colorMapDepth.among(16, 32); but I can't find it right now.. Maybe it was

Re: Working on a library: request for code review

2014-06-13 Thread Mike via Digitalmars-d-learn
On Thursday, 12 June 2014 at 19:30:06 UTC, Rene Zwanenburg wrote: I need to go. Please don't mind any typo's and untested code ;). Didn't take a look at writers yet, readers and util need some more scrutiny, but the main theme is: eliminate unnecessary temporary GC allocations. Thank you for

Re: Working on a library: request for code review

2014-06-13 Thread Mike Wey via Digitalmars-d-learn
On 06/12/2014 09:30 PM, Rene Zwanenburg wrote: I remember a function which does something like only only + canFind on one go. It would look something like header.colorMapDepth.among(16, 32); but I can't find it right now.. Maybe it was only proposed but never added.

Re: Working on a library: request for code review

2014-06-12 Thread Mike via Digitalmars-d-learn
On Thursday, 12 June 2014 at 00:20:28 UTC, cal wrote: Might it be worth stitching things together into a proper image processing package? Well I started working on TGA because I was disappointed that no image abstraction is present in Phobos. Go has some imaging APIs and I think D would

Re: Working on a library: request for code review

2014-06-12 Thread Rene Zwanenburg via Digitalmars-d-learn
On Thursday, 12 June 2014 at 15:46:12 UTC, Mike wrote: On Thursday, 12 June 2014 at 00:20:28 UTC, cal wrote: Might it be worth stitching things together into a proper image processing package? Well I started working on TGA because I was disappointed that no image abstraction is present in

Re: Working on a library: request for code review

2014-06-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/06/2014 20:09, Rene Zwanenburg a écrit : On Thursday, 12 June 2014 at 15:46:12 UTC, Mike wrote: On Thursday, 12 June 2014 at 00:20:28 UTC, cal wrote: Might it be worth stitching things together into a proper image processing package? Well I started working on TGA because I was

Re: Working on a library: request for code review

2014-06-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/06/2014 20:35, Xavier Bigand a écrit : Le 12/06/2014 20:09, Rene Zwanenburg a écrit : On Thursday, 12 June 2014 at 15:46:12 UTC, Mike wrote: On Thursday, 12 June 2014 at 00:20:28 UTC, cal wrote: Might it be worth stitching things together into a proper image processing package? Well I

Re: Working on a library: request for code review

2014-06-12 Thread Mike via Digitalmars-d-learn
I can shed some light on my, beginners, point of view and the rationale behind this tiny library. I want to create a bar/matrix-code generator (QR, DataMatrix etc.). I really like graphics-related subjects and I thought this would be a good start in D. Coming from Java island and having

Re: Working on a library: request for code review

2014-06-12 Thread Rene Zwanenburg via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 18:29:27 UTC, Mike wrote: Here's the link to the repo: http://bit.ly/1mIuGhv I usually don't trust shortened URL's. Can you please post full URL's when not constrained by a character limit? Any feedback would be great! First of all, I like your coding style.

Working on a library: request for code review

2014-06-11 Thread Mike via Digitalmars-d-learn
Hello. I am new to D and I must admit I really like the language. In my opinion it takes the best from C++ and, say, Python and combines it really elegantly. Great work! I am currently working on my first library in D - related to TARGA image format. Here's the link to the repo:

Re: Working on a library: request for code review

2014-06-11 Thread cal via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 18:29:27 UTC, Mike wrote: Hello. Here's the link to the repo: http://bit.ly/1mIuGhv Hi, sorry didn't read through your code yet, but while ago I wrote some encoders/decoders for jpeg and png (https://github.com/callumenator/imaged, haven't compiled it in a