From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,96b1bf0c24ced968 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Received: by 10.224.182.74 with SMTP id cb10mr7038605qab.0.1346482705524; Fri, 31 Aug 2012 23:58:25 -0700 (PDT) Received: by 10.52.75.36 with SMTP id z4mr1784308vdv.14.1346482705502; Fri, 31 Aug 2012 23:58:25 -0700 (PDT) Path: da15ni7637554qab.0!nntp.google.com!b19no208159qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 31 Aug 2012 23:58:25 -0700 (PDT) In-Reply-To: <61c38064-4eef-425d-8936-c68f68ca6dbd@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.149.3.155; posting-account=pmkN8QoAAAAtIhXRUfydb0SCISnwaeyg NNTP-Posting-Host: 109.149.3.155 References: <7bd3df18-178b-4735-ac43-c6bb6df9e999@googlegroups.com> <50406532$0$10734$5b6aafb4@news.zen.co.uk> <61c38064-4eef-425d-8936-c68f68ca6dbd@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Question: re Image Files. From: Austin Obyrne Injection-Date: Sat, 01 Sep 2012 06:58:25 +0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Date: 2012-08-31T23:58:25-07:00 List-Id: On Friday, August 31, 2012 10:12:59 PM UTC+1, (unknown) wrote: > Le vendredi 31 ao=FBt 2012 09:18:11 UTC+2, Mark Murray a =E9crit=A0: > Ye= s, but you have to handle each individual image format (GIF, JPEG, > BMP et= c) separately. This is a LOT of work to write a general program. Sure. The = good news is that it is already done :-) Download or check-out GID: http://= gen-img-dec.sf.net/ Then all the work is to define a container, say a flat = byte buffer or a two-dimensional array, then define 2 procedures, e.g. here= for a flat buffer: procedure Set_X_Y (x, y: Natural) is begin idx:=3D 3 * = (x + image_width * (image_height - 1 - y)); end Set_X_Y; -- procedure Put_P= ixel ( red, green, blue : Primary_color_range; alpha : Primary_color_range = ) is begin buffer(idx..idx+2):=3D (red, green, blue); idx:=3D idx + 3; end = Put_Pixel; plus a feedback procedure that can be null (just there for showi= ng progess), then instanciate a procedure: procedure Load_image is new GID.= Load_image_contents( Primary_color_range, Set_X_Y, Put_Pixel, Feedback, GID= .fast ); An that's it! PNG, BMP, GIF, JPEG, TGA are auto-detected. You don'= t need to tell GID under what format the image is encoded. I guess Austin i= s trying to do steganography. The simplest way it to take test\mini.adb and= customize it for that purpose. Have fun! _________________________ Gautier= 's Ada programming http://freecode.com/users/gdemont Many thanks for your coding of the =93Generic Image Decoder =93 for my bene= fit. - that was really appreciated - Austin