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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,50b378dbbc6317de X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!o8g2000yqo.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: A generic image decoder - specification design Date: Sun, 2 May 2010 08:09:35 -0700 (PDT) Organization: http://groups.google.com Message-ID: <90a9fdb6-7a1c-44a5-a6ce-1288de7561c5@o8g2000yqo.googlegroups.com> References: <0fe40ae3-7582-424c-9b72-9d6d0cb351e2@y36g2000yqm.googlegroups.com> <6d7d1892-e8a1-444d-8ff2-3ee12e281f42@l32g2000yqm.googlegroups.com> <8f304$4bdd43b6$541ed605$26008@cache6.tilbu1.nb.home.nl> NNTP-Posting-Host: 85.1.159.115 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1272812976 22926 127.0.0.1 (2 May 2010 15:09:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 2 May 2010 15:09:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o8g2000yqo.googlegroups.com; posting-host=85.1.159.115; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.9) Gecko/20100317 SeaMonkey/2.0.4,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11290 Date: 2010-05-02T08:09:35-07:00 List-Id: On May 2, 11:19=A0am, Andre wrote: > The first question which comes up in mind is: where do you want to use > it for? > Is it an initial step for your Ada based browser? Many things, from image manipulation without display, loading of textures for GL (there it would replace the "input" part of the GL.IO provided with GLOBE_3D), display into a rectangle of a GUI system and an in-memory cache (good guess: for a browser :-) ),... > The 2nd question is more basic, are you write the load image functions > in Ada or use bindings to existing libraries (like the JPEG one)? The whole would be in Ada. The code already exists for GIF, BMP, TGA, in different places. The decompression for PNG can be taken from UnZip.Decompress. JPEG is a bit trickier. There are "Pascal" sources that could be used, perhaps. > Basically all pixel based images are a block of memory. The one which > are 8 bit based use normally a Palette (like GIF and 8-bit BMP). The > full color versions (JPEG, 24-bit BMP) use 3 or 4 byte per pixel (4th > one is in general the alpha channel) in a memory map. So that can easily > be modeled. > If it is for a browser, you can forget about the 1-, 2- and 4-bit images. > > So how will be your real image data be modeled? > Do you plan to just use a 24-bit with alpha channel format and convert > lower grade images (like GIF) into this format? > Or do you want to represent the different image types also in you data > model? The color model is 24-bit. Palettes will be decoded. The transparent pixels in GIF will have alpha=3DOpacity_range'First and the others will have Opacity_range'Last. All the rest (basically, the choice of the memory model, and what to do with transparency) is left to the user. For instance GL.IO will keep its model: a data buffer, which is sent to GL via Insert_into_GL. But decoded pixels might be even directly sent to a "screen" or a GUI object if it makes sense (e.g when decoding an interlaced PNG to a visible image on a Web page), without any Ada storage of the image. > just some feedback, > Andr=E9 Thanks for it! Gautier