You can now pull pixel data, manipulate and then push back. It need to make
the data transfer more efficient but fully working now (see
test/canvas_test.adb - does a grayscale conversion on a 100x100 patch):

Gnoga.Gui.Element.Canvas.Context_2D

   procedure Data (Image_Data : in out Image_Data_Type;
                   Value      : in     Gnoga.Types.Pixel_Data_Type);
   function Data (Image_Data : Image_Data_Type)
                  return Gnoga.Types.Pixel_Data_Type;

Note that I have made a change in Gnoga.Types to the RGBA_Type :

   type Color_Type is range 0 .. 255;

   type RGBA_Type is
      record
         Red   : Color_Type := 0;
         Green : Color_Type := 0;
         Blue  : Color_Type := 0;
         Alpha : Alpha_Type := 1.0;
      end record;

   type Pixel_Type is
      record
         Red   : Color_Type := 0;
         Green : Color_Type := 0;
         Blue  : Color_Type := 0;
         Alpha : Color_Type := 0;
      end record;

   type Pixel_Data_Type is
     array (Positive range <>, Positive range <>) of Pixel_Type;
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to