January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to TheDGuy | On Tuesday, 5 January 2016 at 17:16:10 UTC, TheDGuy wrote:
> On Tuesday, 5 January 2016 at 16:43:00 UTC, Basile B. wrote:
>> On Tuesday, 5 January 2016 at 16:25:01 UTC, TheDGuy wrote:
>>> But how do i know which line or column my pixel is in?
>> - study D operator overloading, I've given you the solution.
>>
>>> And what is 't' in 'opIndexAssign'?
>> - t is what you want to assign. It can be an uint or maybe a float[4]. Look at my bitmap class.
>
> Okay, but what is this?
>
> "import iz.memory, iz.streams, iz.properties;"
>
> I dont' understand what "MemoryStream" is?
MemoryStream is a managed pointer with methods to read and write at a particlular postion. In the Bitmap class I often refer to .memory which is just the managed pointer.
- iz.properties is used to anotate what has to be serialiazed or not and it's pointless here (@Set @Get).
- iz.memory is just imported because I use (construct!T) instead of "new" to allocate a class instance.
But these are implementation details. Just try to imagine that you manage the bitmap data yourself with realloc/free...
|
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Tuesday, 5 January 2016 at 17:34:06 UTC, Basile B. wrote:
> On Tuesday, 5 January 2016 at 17:16:10 UTC, TheDGuy wrote:
>> On Tuesday, 5 January 2016 at 16:43:00 UTC, Basile B. wrote:
>>> [...]
>>
>> Okay, but what is this?
>>
>> "import iz.memory, iz.streams, iz.properties;"
>>
>> I dont' understand what "MemoryStream" is?
>
> MemoryStream is a managed pointer with methods to read and write at a particlular postion. In the Bitmap class I often refer to .memory which is just the managed pointer.
>
> - iz.properties is used to anotate what has to be serialiazed or not and it's pointless here (@Set @Get).
> - iz.memory is just imported because I use (construct!T) instead of "new" to allocate a class instance.
>
> But these are implementation details. Just try to imagine that you manage the bitmap data yourself with realloc/free...
No offense, but why is the same thing done in 3 lines in C++ but needs 200 lines in D?
|
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to TheDGuy | On Tuesday, 5 January 2016 at 17:37:04 UTC, TheDGuy wrote:
> On Tuesday, 5 January 2016 at 17:34:06 UTC, Basile B. wrote:
>> On Tuesday, 5 January 2016 at 17:16:10 UTC, TheDGuy wrote:
>>> On Tuesday, 5 January 2016 at 16:43:00 UTC, Basile B. wrote:
>>>> [...]
>>>
>>> Okay, but what is this?
>>>
>>> "import iz.memory, iz.streams, iz.properties;"
>>>
>>> I dont' understand what "MemoryStream" is?
>>
>> MemoryStream is a managed pointer with methods to read and write at a particlular postion. In the Bitmap class I often refer to .memory which is just the managed pointer.
>>
>> - iz.properties is used to anotate what has to be serialiazed or not and it's pointless here (@Set @Get).
>> - iz.memory is just imported because I use (construct!T) instead of "new" to allocate a class instance.
>>
>> But these are implementation details. Just try to imagine that you manage the bitmap data yourself with realloc/free...
>
> No offense, but why is the same thing done in 3 lines in C++ but needs 200 lines in D?
IDK, except D I only speek/talk Object Pascal (FPC/Delphi).
|
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote:
> IDK, except D I only speek/talk Object Pascal (FPC/Delphi).
"I didn't know, apart D, I only speak/talk Object Pascal (FPC/Delphi)."
Was what I meant. ^^
|
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Tuesday, 5 January 2016 at 18:19:08 UTC, Basile B. wrote: > On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote: >> IDK, except D I only speek/talk Object Pascal (FPC/Delphi). > > "I didn't know, apart D, I only speak/talk Object Pascal (FPC/Delphi)." > Was what I meant. ^^ https://www.youtube.com/watch?v=Mlpl-RzsCck |
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Tuesday, 5 January 2016 at 19:13:35 UTC, Basile B. wrote: > On Tuesday, 5 January 2016 at 18:19:08 UTC, Basile B. wrote: >> On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote: >>> IDK, except D I only speek/talk Object Pascal (FPC/Delphi). >> >> "I didn't know, apart D, I only speak/talk Object Pascal (FPC/Delphi)." >> Was what I meant. ^^ > > https://www.youtube.com/watch?v=Mlpl-RzsCck https://www.youtube.com/watch?v=ZKMc_NgzFxE .-. .-. | | | | | | | | | | | | _| |_ _| |_ | | | |-. | |_| |-. /| ` | / )| |_|_| | | | | |-' `-^-' | | | || | \ / \ ' / | | | | | | | | |
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Tuesday, 5 January 2016 at 19:47:02 UTC, Basile B. wrote:
> On Tuesday, 5 January 2016 at 19:13:35 UTC, Basile B. wrote:
>> On Tuesday, 5 January 2016 at 18:19:08 UTC, Basile B. wrote:
>>> On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote:
>>>> IDK, except D I only speek/talk Object Pascal (FPC/Delphi).
>>>
>>> "I didn't know, apart D, I only speak/talk Object Pascal (FPC/Delphi)."
>>> Was what I meant. ^^
>>
>> https://www.youtube.com/watch?v=Mlpl-RzsCck
>
> https://www.youtube.com/watch?v=ZKMc_NgzFxE
>
> .-. .-.
> | | | |
> | | | |
> | | | |
> _| |_ _| |_
> | | | |-. | |_| |-.
> /| ` | / )| |_|_|
> | | | | |-' `-^-'
> | | | || |
> \ / \ ' /
> | | | |
> | | | |
Awww... I'm so sorry.
It was the wedding of Michel...Basically I wanted to ruin the wedding of another person...but I don't know you...wrong ruining.
|
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Tuesday, 5 January 2016 at 21:01:55 UTC, Basile B. wrote: > Awww... I'm so sorry. https://youtu.be/uyMUck2RRjw |
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to TheDGuy | On 01/04/2016 11:08 PM, TheDGuy wrote: > On Monday, 4 January 2016 at 21:42:16 UTC, Mike Wey wrote: >> On 01/04/2016 09:13 PM, TheDGuy wrote: >>> [...] >> >> I don't have any issues with either getPixelsWithLength and savev. >> for the savev call there is an missing \ just before test.jpg, but >> that might be a copy and paste error? >> >> For the options that are available for savev the documentation of >> GDK-PixBuff lists the few available options. >> https://developer.gnome.org/gdk-pixbuf/unstable/gdk-pixbuf-File-saving.html#gdk-pixbuf-save >> >> >> Although i'm on Linux so that might make an difference. > > Ups, that was my fault, sry :( > > But how do i get now the color for each pixel out of the ubyte[]? It looks like the array has the R, G and B values like this: [R, G, B, R, G, B, R, G, B, R, G, B, .......] for every pixel from left to right top to bottom, So data[0] gives you the Red value for the pixel at 0,0. data[1] the Blue value and data[2] the green value. data[3] would then be Red for pixel 1,0. -- Mike Wey |
January 05, 2016 Re: GTKD Cairo get pixel color | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Tuesday, 5 January 2016 at 21:24:51 UTC, Ola Fosheim Grøstad wrote: > On Tuesday, 5 January 2016 at 21:01:55 UTC, Basile B. wrote: >> Awww... I'm so sorry. > > https://youtu.be/uyMUck2RRjw du bist normal oder idiot ? https://www.youtube.com/watch?v=nGLwBCMSXys |
Copyright © 1999-2021 by the D Language Foundation