GTKD Cairo get pixel color

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 5 09:34:06 PST 2016


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...


More information about the Digitalmars-d-learn mailing list