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!z17g2000vbd.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: A generic image decoder - specification design Date: Mon, 24 May 2010 14:42:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3464dace-e037-480d-9540-3e1fc1b00116@z17g2000vbd.googlegroups.com> References: <0fe40ae3-7582-424c-9b72-9d6d0cb351e2@y36g2000yqm.googlegroups.com> <2010052421513016807-sjs@essexacuk> NNTP-Posting-Host: 85.1.50.30 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1274737336 1631 127.0.0.1 (24 May 2010 21:42:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 24 May 2010 21:42:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z17g2000vbd.googlegroups.com; posting-host=85.1.50.30; 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:11938 Date: 2010-05-24T14:42:16-07:00 List-Id: Thanks for the feedback. The project is really restricted to decoding images of the broadest spectrum of formats and do whatever the user wants to do with the pixels: store into a buffer (and process, save, or save that buffer), or display them directly in a GUI object, or whatever else... The current state so far is: * BMP is done, except RLE compression and some unusual bit depths * GIF is complete (including animated pictures) * PNG is covering all but transparent formats; there is a nasty glitch with the decompression, so it works on some pictures and on some, not... up to now I was able to have a common source for all formats; sure, I should have a closer look to PNG_IO... * TGA is on a good way to be complete You can have a look via a svn checkout: svn co https://gen-img-dec.svn.sf.net/svnroot/gen-img-dec gid and with gnatmake -P gid.gpr It builds ./test/to_bmp on your platform. Note: there is a "Fast" mode in the gid.gpr project file! Gautier On May 24, 10:51=A0pm, Stephen Sangwine wrote: > Interesting idea. What you are proposing looks to me like a sort > of binding to various image libraries, in that you provide basic > image reading/writing to a variety of formats. Of course, you > can't handle all the special features of each image format, but > for an application that just needs to read or write the pixels > and a few other basics like palettes, alpha etc, the approach > would be useful. I can speak from experience of developing PNG_IO > to say that handling any non-trivial format is not a small task. > BMP is pretty easy - TIFF is probably the hardest to handle. In > both PNG and TIFF the pixel data is stored in disparate pieces > within the file - not as a single block of pixel data. In the > case of PNG the compression runs across these blocks, not within > each block. What this means is that code for handling the pixel > data can't easily be common to different types of image file. > > You have available an Ada package for PNG already in PNG_IO. > I've thought about GIF as a student project now that the > compression is no longer subject to patent protection, but no > work has been done on it yet. > > Steve Sangwine