From owner-freebsd-hackers Sun Jan 11 18:28:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id SAA08876 for hackers-outgoing; Sun, 11 Jan 1998 18:28:17 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id SAA08830 for ; Sun, 11 Jan 1998 18:28:03 -0800 (PST) (envelope-from dag-erli@ifi.uio.no) Received: from hrotti.ifi.uio.no (2602@hrotti.ifi.uio.no [129.240.64.15]) by ifi.uio.no (8.8.8/8.8.7/ifi0.2) with ESMTP id DAA17624; Mon, 12 Jan 1998 03:27:36 +0100 (MET) Received: (from dag-erli@localhost) by hrotti.ifi.uio.no ; Mon, 12 Jan 1998 03:27:35 +0100 (MET) To: Mike Smith Cc: Kazutaka YOKOTA , hackers@FreeBSD.ORG Subject: Re: Splash screen (splashkit) for 3.0 systems... References: <199801071119.VAA00238@word.smith.net.au> Organization: Gutteklubben Terrasse X-url: http://www.ifi.uio.no/~dag-erli/ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit From: dag-erli@ifi.uio.no (Dag-Erling Coidan Smørgrav) Date: 12 Jan 1998 03:27:35 +0100 In-Reply-To: Mike Smith's message of "Wed, 07 Jan 1998 21:49:28 +1030" Message-ID: Lines: 42 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk Mike Smith writes: > > > - A better image format. The DIB (.BMP) format is relatively easy to > > > work with, but a 320x200x8 image runs the best part of 64k, which is > > > slow to load from floppy and wastes valuable core. > > How about GIF? > Sure. Do you have a compact decoder? I'm more than aware of the > various formats around; as I said the *only* reason I used DIB was that > parsing it is so simple that even the Windows weenies can do it. As a compromise, how about PCX version 5? You can write a PCX decoder in ten lines of C, and although it does not compress nearly as well as GIF, it is quite acceptable for 320x200x256. It also has the advantage of not being burdened with a patent. /* * Written off the top of my head - and untested :) * * src is a pointer to the PCX encoded image, dst is a pointer to some buffer * large enough to accomodate the decompressed image (e.g. video RAM) * * Note that it will not stop before decoding 64000 pixels, and assumes the * encoded image is "sane" */ void pcx_decode(unsigned char *src, unsigned char *dest) { int pixels = 0, count; for (pixels = 0; pixels < 64000; src++) if ((src & 0xC0) == 0xC0) for (count = *(src++) & 0x3F; count; count--, dst++) *dst = *src; else *(dst++) = *src; } Of course, you still need to read the header and the palette, but that's "easy as a piece of pie" ;) (remember to shift each byte in the palette two bits to the right) -- * Finrod (INTJ) * Unix weenie * dag-erli@ifi.uio.no * cellular +47-92835919 * RFC1123: "Be liberal in what you accept, and conservative in what you send" # unzip ; strip ; touch ; finger ; mount ; fsck ; more ; yes ; umount ; sleep