6
Copyright (C) 2004 Marc Singer
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License as
10
published by the Free Software Foundation; either version 2 of the
11
License, or (at your option) any later version.
13
This program is distributed in the hope that it will be useful, but
14
WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29
#include <linux/types.h>
30
#include <linux/ctype.h>
36
void dumpw (const char* rgb, int cb, unsigned long index, int width)
40
if ( (width == 2 && ((unsigned long) rgb & 1))
41
|| (width == 4 && ((unsigned long) rgb & 3))) {
42
printf ("%s: unable to display unaligned data\n", __FUNCTION__);
47
printf ("%08lx: ", index);
48
for (i = 0; i < 16; ++i) {
53
printf ("%02x ", rgb[i]);
56
printf ("%04x ", *((u16*)&rgb[i]));
60
printf ("%08x ", *((u32*)&rgb[i]));
70
for (i = 0; i < 16; ++i) {
73
putchar ( (i < cb) ? (isprint (rgb[i]) ? rgb[i] : '.') : ' ');