Re: GTKD Cairo get pixel color

2016-01-06 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 6 January 2016 at 01:41:03 UTC, Basile B. wrote: Until a certain "time" my answers were useful. But I recognize that after this "time" I've managed to turn the topic into something totally delirious because, to be honest I was completly sratched by alcohool. I'm sorry but life is

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 23:36:16 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2016 at 23:26:12 UTC, Basile B. wrote: access to pix is easy... This is the learn forum. Maybe one should be able to figure it out without asking, but there is nothing wrong with asking in depth on t

Re: GTKD Cairo get pixel color

2016-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 23:26:12 UTC, Basile B. wrote: access to pix is easy... This is the learn forum. Maybe one should be able to figure it out without asking, but there is nothing wrong with asking in depth on this forum. The threshold for asking should be low in here. At worst, no

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 22:40:22 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 22:08:52 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2016 at 22:02:47 UTC, Basile B. wrote: du bist normal oder idiot ? https://youtu.be/7kjTXMecCrM Ding dong! https://en.wikipedia.org/wiki

Re: GTKD Cairo get pixel color

2016-01-05 Thread TheDGuy via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 22:02:33 UTC, Mike Wey wrote: On 01/04/2016 11:08 PM, TheDGuy wrote: On Monday, 4 January 2016 at 21:42:16 UTC, Mike Wey wrote: [...] 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

Re: GTKD Cairo get pixel color

2016-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
Sorry about being off-topic, let's get back on topic: https://youtu.be/MPwLKIXYEPE?t=1m20s

Re: GTKD Cairo get pixel color

2016-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 22:40:22 UTC, Basile B. wrote: https://en.wikipedia.org/wiki/Turing_Award Si tu crois que tu es un génie, il y a de forte chance que tu sois un gros bouffon. Jeg hadde faktisk 2001 vinnerne av Turing prisen som forelesere på universitetet og Kristen Nygaard var

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 22:08:52 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2016 at 22:02:47 UTC, Basile B. wrote: du bist normal oder idiot ? https://youtu.be/7kjTXMecCrM Ding dong! https://en.wikipedia.org/wiki/Turing_Award Si tu crois que tu es un génie, il y a de forte

Re: GTKD Cairo get pixel color

2016-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 22:02:47 UTC, Basile B. wrote: du bist normal oder idiot ? https://youtu.be/7kjTXMecCrM Ding dong!

Re: GTKD Cairo get pixel color

2016-01-05 Thread Mike Wey via Digitalmars-d-learn
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

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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

Re: GTKD Cairo get pixel color

2016-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 21:01:55 UTC, Basile B. wrote: Awww... I'm so sorry. https://youtu.be/uyMUck2RRjw

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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.you

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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. ^^

Re: GTKD Cairo get pixel color

2016-01-05 Thread TheDGuy via Digitalmars-d-learn
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 "MemorySt

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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.

Re: GTKD Cairo get pixel color

2016-01-05 Thread TheDGuy via Digitalmars-d-learn
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

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
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

Re: GTKD Cairo get pixel color

2016-01-05 Thread TheDGuy via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 16:16:39 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 15:04:57 UTC, TheDGuy wrote: But i get "only one index allowed to index char". So it looks like there is no 2D array but just a char. If i try like this: The data is just a contiguous memory area. You h

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 15:04:57 UTC, TheDGuy wrote: But i get "only one index allowed to index char". So it looks like there is no 2D array but just a char. If i try like this: The data is just a contiguous memory area. You have to implement your own opIndexAssign()/opIndex() to write/

Re: GTKD Cairo get pixel color

2016-01-05 Thread TheDGuy via Digitalmars-d-learn
On Monday, 4 January 2016 at 23:47:05 UTC, Basile B. wrote: On Friday, 1 January 2016 at 22:00:04 UTC, TheDGuy wrote: On Friday, 1 January 2016 at 19:32:40 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheD

Re: GTKD Cairo get pixel color

2016-01-04 Thread Basile B. via Digitalmars-d-learn
On Friday, 1 January 2016 at 22:00:04 UTC, TheDGuy wrote: On Friday, 1 January 2016 at 19:32:40 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color

Re: GTKD Cairo get pixel color

2016-01-04 Thread TheDGuy via Digitalmars-d-learn
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 option

Re: GTKD Cairo get pixel color

2016-01-04 Thread Mike Wey via Digitalmars-d-learn
On 01/04/2016 09:13 PM, TheDGuy wrote: On Monday, 4 January 2016 at 19:27:48 UTC, Mike Wey wrote: I think you are looking for something like this. Context.getTarget will get you the surface the Context is drawing to, this most likely isn't a ImageSurface. So you will need to create an pixbuf fr

Re: GTKD Cairo get pixel color

2016-01-04 Thread TheDGuy via Digitalmars-d-learn
On Monday, 4 January 2016 at 19:27:48 UTC, Mike Wey wrote: I think you are looking for something like this. Context.getTarget will get you the surface the Context is drawing to, this most likely isn't a ImageSurface. So you will need to create an pixbuf from the returned surface, with the Pixb

Re: GTKD Cairo get pixel color

2016-01-04 Thread Mike Wey via Digitalmars-d-learn
I think you are looking for something like this. Context.getTarget will get you the surface the Context is drawing to, this most likely isn't a ImageSurface. So you will need to create an pixbuf from the returned surface, with the Pixbuf you can then get the raw pixel data using getPixelsWithLe

Re: GTKD Cairo get pixel color

2016-01-02 Thread TheDGuy via Digitalmars-d-learn
``` import cairo.ImageSurface; ImageSurface.createForData(c,cairo.FORMAT_ARGB32,256,256,256*4); ``` You need to import the ImageSurface module, and the createForData function is in the ImageSurface class which is in the cairo.ImageSurface module. Thanks, that was the problem! Now i can read

Re: GTKD Cairo get pixel color

2016-01-02 Thread Mike Wey via Digitalmars-d-learn
On 01/02/2016 12:32 AM, TheDGuy wrote: On Friday, 1 January 2016 at 22:00:04 UTC, TheDGuy wrote: On Friday, 1 January 2016 at 19:32:40 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello,

Re: GTKD Cairo get pixel color

2016-01-01 Thread TheDGuy via Digitalmars-d-learn
On Friday, 1 January 2016 at 22:00:04 UTC, TheDGuy wrote: On Friday, 1 January 2016 at 19:32:40 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color

Re: GTKD Cairo get pixel color

2016-01-01 Thread TheDGuy via Digitalmars-d-learn
On Friday, 1 January 2016 at 19:32:40 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? r

Re: GTKD Cairo get pixel color

2016-01-01 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? render to a png back buffer. see cairo_image_surface_create_f

Re: GTKD Cairo get pixel color

2016-01-01 Thread TheDGuy via Digitalmars-d-learn
On Friday, 1 January 2016 at 15:22:18 UTC, Mike Wey wrote: On 01/01/2016 01:37 PM, TheDGuy wrote: [...] you would either cr.getTarget(); or cairo.ImageSurface.ImageSurface.create. I'm not sure how those would get you access to the pixel data. Okay, thanks for your answer. So which functi

Re: GTKD Cairo get pixel color

2016-01-01 Thread Mike Wey via Digitalmars-d-learn
On 01/01/2016 01:37 PM, TheDGuy wrote: On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? render to a png back bu

Re: GTKD Cairo get pixel color

2016-01-01 Thread TheDGuy via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? render to a png back buffer. see cairo_image_surface_create_f

Re: GTKD Cairo get pixel color

2015-12-30 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? render to a png back buffer. see cairo_image_surface_create_for_data then you'll be able to access the data and, at the same t

GTKD Cairo get pixel color

2015-12-30 Thread TheDGuy via Digitalmars-d-learn
Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context?