Re: Best way to display images with GTKD

2017-10-01 Thread Mike Wey via Digitalmars-d-learn
On 01-10-17 01:56, Psychological Cleanup wrote: I have to display images with a few controls: alpha channel, rotation, scaling, cropping. Generally it should be png but I want to be able to handle many images. The images will be memory based(I'll load the file in to memory then) and will be

Re: AliasSeq of T.tupleof for class and all base classes

2017-10-01 Thread bitwise via Digitalmars-d-learn
On Saturday, 30 September 2017 at 12:42:17 UTC, Steven Schveighoffer wrote: [...] https://issues.dlang.org/show_bug.cgi?id=17870

Re: how to use unknown size of array at compile time for further processing

2017-10-01 Thread thorstein via Digitalmars-d-learn
Replace arrayT ~= rowT; with arrayT ~= rowT.dup; Also, you may want to look into ndslice package [1]. [1] https://github.com/libmir/mir-algorithm Best regards, Ilya Yaroshenko Works! Thanks Ilya. I'll take a look on the difference. Also soon will get bit familiar with the mir-algorithm...

Re: how to use unknown size of array at compile time for further processing

2017-10-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 1 October 2017 at 14:23:54 UTC, thorstein wrote: [...] Sorry, I'm still really confused with the results from my function: [...] Replace arrayT ~= rowT; with arrayT ~= rowT.dup; Also, you may want to look into ndslice package [1]. [1] https://github.com/libmir/mir-algorith

Re: how to use unknown size of array at compile time for further processing

2017-10-01 Thread thorstein via Digitalmars-d-learn
Guyes, I obviously made a mistake. Forget my post! Sorry, I'm still really confused with the results from my function: double[][] transp(double[][] array) { double[][] arrayT; double[] rowT; // initialize rowT foreach(i; 0..array.length) { rowT ~= 0; } foreach(col;

Re: how to use unknown size of array at compile time for further processing

2017-10-01 Thread thorstein via Digitalmars-d-learn
On Sunday, 1 October 2017 at 13:53:57 UTC, thorstein wrote: Why is that Thanks! Guyes, I obviously made a mistake. Forget my post!

Re: how to use unknown size of array at compile time for further processing

2017-10-01 Thread thorstein via Digitalmars-d-learn
They are not alternatives. They are the only way of doing things. Yes, sounds logic - static arrays require a size before compilation. However, I tried another variation with a totally unexpected result: double[][] transp3(double[][] array) { double[][] arrayT; double[] rowT; //

Re: how to use unknown size of array at compile time for further processing

2017-10-01 Thread user456 via Digitalmars-d-learn
On Sunday, 1 October 2017 at 10:07:40 UTC, thorstein wrote: Hi, assumed, I need the size of a dynamic array for further processing, which is unknown at compile time. Below are my example, which doesn't work and two alternatives. [...] They are not alternatives. They are the only way of

how to use unknown size of array at compile time for further processing

2017-10-01 Thread thorstein via Digitalmars-d-learn
Hi, assumed, I need the size of a dynamic array for further processing, which is unknown at compile time. Below are my example, which doesn't work and two alternatives. Alternative1: may create large rowT-arrays depending on original array size. Alternative2: overrides rowT after exiting the

Re: @property with 2 arguments

2017-10-01 Thread Tony via Digitalmars-d-learn
On Sunday, 1 October 2017 at 07:11:14 UTC, bitwise wrote: On Sunday, 1 October 2017 at 05:57:53 UTC, Tony wrote: "@property functions can only have zero, one or two parameters" I am looking for an example of an @property function defined with two parameters and the syntax for how it is

Re: @property with 2 arguments

2017-10-01 Thread Tony via Digitalmars-d-learn
On Sunday, 1 October 2017 at 06:34:56 UTC, Jonathan M Davis wrote: On Sunday, October 01, 2017 05:57:53 Tony via Digitalmars-d-learn wrote: "@property functions can only have zero, one or two parameters" I am looking for an example of an @property function defined with two parameters and the

Re: [Template] Mixins and foreach

2017-10-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, October 01, 2017 06:32:53 Nicholas Wilson via Digitalmars-d-learn wrote: > On Sunday, 1 October 2017 at 06:27:21 UTC, Nicholas Wilson wrote: > > And am getting > > util.d(72,12): Error: template instance helper!(foo) cannot use > > local 'foo' as parameter to non-global template > >

Re: mtaching types with static if

2017-10-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 1 October 2017 at 07:21:57 UTC, ag0aep6g wrote: else static if (is(typeof(Fields[0]) : ArrayAccesssor!(ptr,len), alias ptr, alias len)) Ah, so close. Thanks!

Re: mtaching types with static if

2017-10-01 Thread ag0aep6g via Digitalmars-d-learn
On 10/01/2017 09:03 AM, Nicholas Wilson wrote: struct ArrayAccesssor(alias ptr, alias len) {} char * p; size_t len; ArrayAccesssor!(p,len) aa; template helper(Fields...) {     static if (Fields.length == 0)     enum helper = "";     else static if (is(typeof(Fields[0]) :

Re: @property with 2 arguments

2017-10-01 Thread bitwise via Digitalmars-d-learn
On Sunday, 1 October 2017 at 05:57:53 UTC, Tony wrote: "@property functions can only have zero, one or two parameters" I am looking for an example of an @property function defined with two parameters and the syntax for how it is accessed without (). And also this, which probably shouldn't

mtaching types with static if

2017-10-01 Thread Nicholas Wilson via Digitalmars-d-learn
struct ArrayAccesssor(alias ptr, alias len) {} char * p; size_t len; ArrayAccesssor!(p,len) aa; template helper(Fields...) { static if (Fields.length == 0) enum helper = ""; else static if (is(typeof(Fields[0]) : ArrayAccesssor!(ptr,len),ptr, len)) //13 {

Re: [Template] Mixins and foreach

2017-10-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 1 October 2017 at 06:27:21 UTC, Nicholas Wilson wrote: And am getting util.d(72,12): Error: template instance helper!(foo) cannot use local 'foo' as parameter to non-global template helper(Fields...) Fixed by making helper a global template. Thanks Jonathan!

Re: @property with 2 arguments

2017-10-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, October 01, 2017 05:57:53 Tony via Digitalmars-d-learn wrote: > "@property functions can only have zero, one or two parameters" > > I am looking for an example of an @property function defined with > two parameters and the syntax for how it is accessed without (). If it has two

Re: [Template] Mixins and foreach

2017-10-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 1 October 2017 at 04:44:16 UTC, Jonathan M Davis wrote: I don't see any reason why the compiler would be complaining about 'this' being required. Neither do I. I would think that that would imply that the compiler thinks that you're accessing the member rather than introspecting

@property with 2 arguments

2017-10-01 Thread Tony via Digitalmars-d-learn
"@property functions can only have zero, one or two parameters" I am looking for an example of an @property function defined with two parameters and the syntax for how it is accessed without ().