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,ASCII Received: by 10.224.181.75 with SMTP id bx11mr6236171qab.7.1346447579442; Fri, 31 Aug 2012 14:12:59 -0700 (PDT) Received: by 10.52.38.99 with SMTP id f3mr1749184vdk.5.1346447579408; Fri, 31 Aug 2012 14:12:59 -0700 (PDT) Path: da15ni7637554qab.0!nntp.google.com!b19no129641qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 31 Aug 2012 14:12:59 -0700 (PDT) In-Reply-To: <50406532$0$10734$5b6aafb4@news.zen.co.uk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=62.202.72.93; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 62.202.72.93 References: <7bd3df18-178b-4735-ac43-c6bb6df9e999@googlegroups.com> <50406532$0$10734$5b6aafb4@news.zen.co.uk> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <61c38064-4eef-425d-8936-c68f68ca6dbd@googlegroups.com> Subject: Re: Question: re Image Files. From: gautier_niouzes@hotmail.com Injection-Date: Fri, 31 Aug 2012 21:12:59 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-08-31T14:12:59-07:00 List-Id: Le vendredi 31 ao=FBt 2012 09:18:11 UTC+2, Mark Murray a =E9crit=A0: > Yes, but you have to handle each individual image format (GIF, JPEG, > BMP etc) 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/=20 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_Pixel ( 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 showing progess)= , then instanciate a procedure: procedure Load_image is new GID.Load_image_contents( Primary_color_range,=20 Set_X_Y, Put_Pixel,=20 Feedback,=20 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 is trying to do steganography. The simplest way it to take test\mini.adb and customize it for that purpose= . Have fun! _________________________=20 Gautier's Ada programming=20 http://freecode.com/users/gdemont