diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/Makefile linux-2.4.18-pre9-logo/scripts/tologo/Makefile --- linux-2.4.18-pre9/scripts/tologo/Makefile Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/Makefile Fri Feb 8 17:11:20 2002 @@ -0,0 +1,30 @@ +# tologo +# +# converts a pnm graphics file to a linux_logo.h header +# +# By David Odin, using code from the Gimp + +ifeq ($(HOSTCC),) +HOSTCC=gcc +HOSTCFLAGS=-Wall -O2 +endif + +all: tologo + +tologo: pnm.o main.o convert.o write_logo.o + $(HOSTCC) $(HOSTCFLAGS) pnm.o main.o convert.o write_logo.o -o tologo -g + +pnm.o: pnm.c pnm.h tologo.h + $(HOSTCC) $(HOSTCFLAGS) -c pnm.c -o pnm.o -g -Wall -O2 + +main.o: main.c tologo.h pnm.h convert.h write_logo.h + $(HOSTCC) $(HOSTCFLAGS) -c main.c -o main.o -g -Wall -O2 + +convert.o: convert.c convert.h tologo.h + $(HOSTCC) $(HOSTCFLAGS) -c convert.c -o convert.o -g -Wall -O2 + +write_logo.o: write_logo.c write_logo.h tologo.h + $(HOSTCC) $(HOSTCFLAGS) -c write_logo.c -o write_logo.o -g -Wall -O2 + +clean: + @rm -f *.o tologo diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/convert.c linux-2.4.18-pre9-logo/scripts/tologo/convert.c --- linux-2.4.18-pre9/scripts/tologo/convert.c Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/convert.c Fri Feb 8 17:11:20 2002 @@ -0,0 +1,1279 @@ +/* convert.c + * Copyright (C) 2002 DindinX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * NB: This file was originally part of the gimp. It has been adapted for + * tologo. So it is also copyrighted by the Gimp's authors + */ + +#include +#include + +#include "fsdither.h" +#include "tologo.h" + +#define PRECISION_R 6 +#define PRECISION_G 6 +#define PRECISION_B 6 + +#define HIST_R_ELEMS (1<histogram); + + /* To begin, assume that there are fewer colours in + * the image than the user actually asked for. In that + * case, we don't need to quantize or colour-dither. + */ + needs_quantize = 0 /*FALSE*/; + num_found_cols = 0; + + generate_histogram_rgb(quantobj->histogram, Logo, num_cols); + (*quantobj->first_pass) (quantobj); + + /* Initialise data which must persist across indexed layer iterations */ + if (quantobj->second_pass_init) + (*quantobj->second_pass_init) (quantobj); + + (*quantobj->second_pass) (quantobj, Logo); + /* colourmap stuff */ + if (Logo->Cmap_red) + free(Logo->Cmap_red); + if (Logo->Cmap_green) + free(Logo->Cmap_green); + if (Logo->Cmap_blue) + free(Logo->Cmap_blue); + Logo->Cmap_red = malloc(256); + Logo->Cmap_green = malloc(256); + Logo->Cmap_blue = malloc(256); + for (i = 0; i < quantobj->actual_number_of_colors; i++) { + Logo->Cmap_red[i] = quantobj->cmap[i].red; + Logo->Cmap_green[i] = quantobj->cmap[i].green; + Logo->Cmap_blue[i] = quantobj->cmap[i].blue; + } + Logo->NbCols = quantobj->actual_number_of_colors; + + /* Delete the quantizer object, if there is one */ + if (quantobj) + quantobj->delete_func(quantobj); +} + +/* + * Indexed color conversion machinery + */ + +static void +zero_histogram_rgb(Histogram histogram) +{ + int r, g, b; + + for (r = 0; r < HIST_R_ELEMS; r++) + for (g = 0; g < HIST_G_ELEMS; g++) + for (b = 0; b < HIST_B_ELEMS; b++) + histogram[r * MR + g * MG + b] = 0; +} + +static void +generate_histogram_rgb(Histogram histogram, LogoStruct * Logo, int col_limit) +{ + unsigned char *data; + int size; + ColorFreq *colfreq; + int nfc_iter; + + data = Logo->rgb_data; + size = Logo->width * Logo->height; + + if (needs_quantize) { + while (size--) { + colfreq = &histogram[(data[0] >> R_SHIFT) * MR + + (data[1] >> G_SHIFT) * MG + + (data[2] >> B_SHIFT)]; + (*colfreq)++; + data += 3; + } + } else { + while (size--) { + colfreq = &histogram[(data[0] >> R_SHIFT) * MR + + (data[1] >> G_SHIFT) * MG + + (data[2] >> B_SHIFT)]; + (*colfreq)++; + if (!needs_quantize) { + for (nfc_iter = 0; + nfc_iter < num_found_cols; nfc_iter++) { + if ((data[0] == found_cols[nfc_iter][0]) + && (data[1] == + found_cols[nfc_iter][1]) + && (data[2] == + found_cols[nfc_iter][2])) + goto already_found; + } + /* Colour was not in the table of + * existing colours + */ + num_found_cols++; + if (num_found_cols > col_limit) { + /* There are more colours in the image + * than were allowed. We switch to plain + * histogram calculation with a view to + * quantizing at a later stage. + */ + needs_quantize = 1; + goto already_found; + } else { + /* Remember the new colour we just found. + */ + found_cols[num_found_cols - 1][0] = + data[0]; + found_cols[num_found_cols - 1][1] = + data[1]; + found_cols[num_found_cols - 1][2] = + data[2]; + } + } + already_found: + data += 3; + } + } +} + +static boxptr +find_split_candidate(boxptr boxlist, int numboxes) +{ + boxptr boxp; + int i; + unsigned long long int maxc = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->volume > 0) { + if (boxp->gerror * G_SCALE > maxc) { + which = boxp; + maxc = boxp->gerror * G_SCALE; + } + if (boxp->rerror * R_SCALE > maxc) { + which = boxp; + maxc = boxp->rerror * R_SCALE; + } + if (boxp->berror * B_SCALE > maxc) { + which = boxp; + maxc = boxp->berror * B_SCALE; + } + } + } + return which; +} + +static void +update_box_rgb(Histogram histogram, boxptr boxp) +/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ +/* and recompute its volume, population and error */ +{ + ColorFreq *histp; + int R, G, B; + int Rmin, Rmax, Gmin, Gmax, Bmin, Bmax; + int dist0, dist1, dist2; + long ccount; + unsigned long long int tempRerror; + unsigned long long int tempGerror; + unsigned long long int tempBerror; + QuantizeObj dummyqo; + box dummybox; + + Rmin = boxp->Rmin; + Rmax = boxp->Rmax; + Gmin = boxp->Gmin; + Gmax = boxp->Gmax; + Bmin = boxp->Bmin; + Bmax = boxp->Bmax; + + if (Rmax > Rmin) + for (R = Rmin; R <= Rmax; R++) + for (G = Gmin; G <= Gmax; G++) { + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++) + if (*histp++ != 0) { + boxp->Rmin = Rmin = R; + goto have_Rmin; + } + } + have_Rmin: + if (Rmax > Rmin) + for (R = Rmax; R >= Rmin; R--) + for (G = Gmin; G <= Gmax; G++) { + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++) + if (*histp++ != 0) { + boxp->Rmax = Rmax = R; + goto have_Rmax; + } + } + have_Rmax: + if (Gmax > Gmin) + for (G = Gmin; G <= Gmax; G++) + for (R = Rmin; R <= Rmax; R++) { + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++) + if (*histp++ != 0) { + boxp->Gmin = Gmin = G; + goto have_Gmin; + } + } + have_Gmin: + if (Gmax > Gmin) + for (G = Gmax; G >= Gmin; G--) + for (R = Rmin; R <= Rmax; R++) { + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++) + if (*histp++ != 0) { + boxp->Gmax = Gmax = G; + goto have_Gmax; + } + } + have_Gmax: + if (Bmax > Bmin) + for (B = Bmin; B <= Bmax; B++) + for (R = Rmin; R <= Rmax; R++) { + histp = histogram + R * MR + Gmin * MG + B; + for (G = Gmin; G <= Gmax; G++, histp += MG) + if (*histp != 0) { + boxp->Bmin = Bmin = B; + goto have_Bmin; + } + } + have_Bmin: + if (Bmax > Bmin) + for (B = Bmax; B >= Bmin; B--) + for (R = Rmin; R <= Rmax; R++) { + histp = histogram + R * MR + Gmin * MG + B; + for (G = Gmin; G <= Gmax; G++, histp += MG) + if (*histp != 0) { + boxp->Bmax = Bmax = B; + goto have_Bmax; + } + } + have_Bmax: + + /* Update box volume. + * We use 2-norm rather than real volume here; this biases the method + * against making long narrow boxes, and it has the side benefit that + * a box is splittable iff norm > 0. + * Since the differences are expressed in histogram-cell units, + * we have to shift back to JSAMPLE units to get consistent distances; + * after which, we scale according to the selected distance scale factors. + */ + dist0 = ((+Rmax - Rmin) << R_SHIFT) * R_SCALE; + dist1 = ((+Gmax - Gmin) << G_SHIFT) * G_SCALE; + dist2 = ((+Bmax - Bmin) << B_SHIFT) * B_SCALE; + boxp->volume = dist0 * dist0 + dist1 * dist1 + dist2 * dist2; + + compute_color_rgb(&dummyqo, histogram, boxp, 0); + + /* Now scan remaining volume of box and compute population */ + ccount = 0; + boxp->error = 0; + boxp->rerror = 0; + boxp->gerror = 0; + boxp->berror = 0; + for (R = Rmin; R <= Rmax; R++) + for (G = Gmin; G <= Gmax; G++) { + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++, histp++) + if (*histp != 0) { + int ge, be, re; + + dummybox.Rmin = dummybox.Rmax = R; + dummybox.Gmin = dummybox.Gmax = G; + dummybox.Bmin = dummybox.Bmax = B; + compute_color_rgb(&dummyqo, histogram, + &dummybox, 1); + + re = dummyqo.cmap[0].red - + dummyqo.cmap[1].red; + ge = dummyqo.cmap[0].green - + dummyqo.cmap[1].green; + be = dummyqo.cmap[0].blue - + dummyqo.cmap[1].blue; + + boxp->rerror += (*histp) * re * re; + boxp->gerror += (*histp) * ge * ge; + boxp->berror += (*histp) * be * be; + + boxp->error += (*histp) * + (re * re * R_SCALE + + ge * ge * G_SCALE + + be * be * B_SCALE); + ccount += *histp; + } + } + + /* Scan again, taking note of halfway error point for red axis */ + tempRerror = 0; + boxp->Rhalferror = Rmin; + for (R = Rmin; R < Rmax; R++) { + dummybox.Rmin = dummybox.Rmax = R; + for (G = Gmin; G <= Gmax; G++) { + dummybox.Gmin = dummybox.Gmax = G; + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++, histp++) + if (*histp != 0) { + int re; + dummybox.Bmin = dummybox.Bmax = B; + compute_color_rgb(&dummyqo, histogram, + &dummybox, 1); + + re = dummyqo.cmap[0].red - + dummyqo.cmap[1].red; + + tempRerror += (*histp) * re * re; + + if (tempRerror * 2 > boxp->rerror) + goto green_axisscan; + else + boxp->Rhalferror = R; + } + } + } + green_axisscan: + /* Scan again, taking note of halfway error point for green axis */ + tempGerror = 0; + boxp->Ghalferror = Gmin; + for (G = Gmin; G < Gmax; G++) { + dummybox.Gmin = dummybox.Gmax = G; + for (R = Rmin; R <= Rmax; R++) { + dummybox.Rmin = dummybox.Rmax = R; + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++, histp++) + if (*histp != 0) { + int ge; + dummybox.Bmin = dummybox.Bmax = B; + compute_color_rgb(&dummyqo, histogram, + &dummybox, 1); + + ge = dummyqo.cmap[0].green - + dummyqo.cmap[1].green; + + tempGerror += (*histp) * ge * ge; + + if (tempGerror * 2 > boxp->gerror) + goto blue_axisscan; + else + boxp->Ghalferror = G; + } + } + } + blue_axisscan: + /* Scan again, taking note of halfway error point for blue axis */ + tempBerror = 0; + boxp->Bhalferror = Bmin; + for (B = Bmin; B < Bmax; B++) { + dummybox.Bmin = dummybox.Bmax = B; + for (R = Rmin; R <= Rmax; R++) { + dummybox.Rmin = dummybox.Rmax = R; + for (G = Gmin; G <= Gmax; G++) { + histp = histogram + R * MR + G * MG + B; + if (*histp != 0) { + int be; + dummybox.Gmin = dummybox.Gmax = G; + compute_color_rgb(&dummyqo, histogram, + &dummybox, 1); + + be = dummyqo.cmap[0].blue - + dummyqo.cmap[1].blue; + + tempBerror += (*histp) * be * be; + + if (tempBerror * 2 > boxp->berror) + goto finished_axesscan; + else + boxp->Bhalferror = B; + } + } + } + } + finished_axesscan: + + boxp->colorcount = ccount; +} + +static int +median_cut_rgb(Histogram histogram, + boxptr boxlist, int numboxes, int desired_colors) +/* Repeatedly select and split the largest box until we have enough boxes */ +{ + int n, lb; + unsigned long long int R, G, B, cmax; + boxptr b1, b2; + + while (numboxes < desired_colors) { + b1 = find_split_candidate(boxlist, numboxes); + + if (b1 == NULL) /* no splittable boxes left! */ + break; + b2 = boxlist + numboxes; /* where new box will go */ + /* Copy the color bounds to the new box. */ + b2->Rmax = b1->Rmax; + b2->Gmax = b1->Gmax; + b2->Bmax = b1->Bmax; + b2->Rmin = b1->Rmin; + b2->Gmin = b1->Gmin; + b2->Bmin = b1->Bmin; + /* Choose which axis to split the box on. + * See notes in update_box about scaling distances. + */ + R = R_SCALE * b1->rerror; + G = G_SCALE * b1->gerror; + B = B_SCALE * b1->berror; + /* We want to break any ties in favor of green, then red, blue last. + */ + cmax = G; + n = 1; + if (R > cmax) { + cmax = R; + n = 0; + } + if (B > cmax) { + n = 2; + } + + /* Choose split point along selected axis, and update box bounds. + * Note that lb value is max for lower box, so must be < old max. + */ + switch (n) { + case 0: + lb = b1->Rhalferror; /* *0 + (b1->Rmax + b1->Rmin) / 2; */ + b1->Rmax = lb; + b2->Rmin = lb + 1; + break; + case 1: + lb = b1->Ghalferror; /* *0 + (b1->Gmax + b1->Gmin) / 2; */ + b1->Gmax = lb; + b2->Gmin = lb + 1; + break; + case 2: + lb = b1->Bhalferror; /* *0 + (b1->Bmax + b1->Bmin) / 2; */ + b1->Bmax = lb; + b2->Bmin = lb + 1; + break; + } + /* Update stats for boxes */ + update_box_rgb(histogram, b1); + update_box_rgb(histogram, b2); + numboxes++; + } + return numboxes; +} + +static void +compute_color_rgb(QuantizeObj * quantobj, + Histogram histogram, boxptr boxp, int icolor) +/* Compute representative color for a box, put it in colormap[icolor] */ +{ + /* Current algorithm: mean weighted by pixels (not colors) */ + /* Note it is important to get the rounding correct! */ + ColorFreq *histp; + int R, G, B; + int Rmin, Rmax; + int Gmin, Gmax; + int Bmin, Bmax; + long count; + long total = 0; + long Rtotal = 0; + long Gtotal = 0; + long Btotal = 0; + + Rmin = boxp->Rmin; + Rmax = boxp->Rmax; + Gmin = boxp->Gmin; + Gmax = boxp->Gmax; + Bmin = boxp->Bmin; + Bmax = boxp->Bmax; + + for (R = Rmin; R <= Rmax; R++) + for (G = Gmin; G <= Gmax; G++) { + histp = histogram + R * MR + G * MG + Bmin; + for (B = Bmin; B <= Bmax; B++) { + if ((count = *histp++) != 0) { + total += count; + Rtotal += + ((R << R_SHIFT) + + ((1 << R_SHIFT) >> 1)) * count; + Gtotal += + ((G << G_SHIFT) + + ((1 << G_SHIFT) >> 1)) * count; + Btotal += + ((B << B_SHIFT) + + ((1 << B_SHIFT) >> 1)) * count; + } + } + } + if (total != 0) { + quantobj->cmap[icolor].red = (Rtotal + (total >> 1)) / total; + quantobj->cmap[icolor].green = (Gtotal + (total >> 1)) / total; + quantobj->cmap[icolor].blue = (Btotal + (total >> 1)) / total; + } else { /* The only situation where total==0 is if the image was null or + * all-transparent. In that case we just put a dummy value in + * the colourmap. + */ + quantobj->cmap[icolor].red = + quantobj->cmap[icolor].green = + quantobj->cmap[icolor].blue = 0; + } +} + +static void +select_colors_rgb(QuantizeObj * quantobj, Histogram histogram) +/* Master routine for color selection */ +{ + boxptr boxlist; + int numboxes; + int desired = quantobj->desired_number_of_colors; + int i; + + /* Allocate workspace for box list */ + boxlist = (boxptr) malloc(desired * sizeof (box)); + + /* Initialize one box containing whole space */ + numboxes = 1; + boxlist[0].Rmin = 0; + boxlist[0].Rmax = (1 << PRECISION_R) - 1; + boxlist[0].Gmin = 0; + boxlist[0].Gmax = (1 << PRECISION_G) - 1; + boxlist[0].Bmin = 0; + boxlist[0].Bmax = (1 << PRECISION_B) - 1; + /* Shrink it to actually-used volume and set its statistics */ + update_box_rgb(histogram, boxlist); + /* Perform median-cut to produce final box list */ + numboxes = median_cut_rgb(histogram, boxlist, numboxes, desired); + + quantobj->actual_number_of_colors = numboxes; + /* Compute the representative color for each box, fill colormap */ + for (i = 0; i < numboxes; i++) + compute_color_rgb(quantobj, histogram, boxlist + i, i); +} + +/* + * These routines are concerned with the time-critical task of mapping input + * colors to the nearest color in the selected colormap. + * + * We re-use the histogram space as an "inverse color map", essentially a + * cache for the results of nearest-color searches. All colors within a + * histogram cell will be mapped to the same colormap entry, namely the one + * closest to the cell's center. This may not be quite the closest entry to + * the actual input color, but it's almost as good. A zero in the cache + * indicates we haven't found the nearest color for that cell yet; the array + * is cleared to zeroes before starting the mapping pass. When we find the + * nearest color for a cell, its colormap index plus one is recorded in the + * cache for future use. The pass2 scanning routines call fill_inverse_cmap + * when they need to use an unfilled entry in the cache. + * + * Our method of efficiently finding nearest colors is based on the "locally + * sorted search" idea described by Heckbert and on the incremental distance + * calculation described by Spencer W. Thomas in chapter III.1 of Graphics + * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that + * the distances from a given colormap entry to each cell of the histogram can + * be computed quickly using an incremental method: the differences between + * distances to adjacent cells themselves differ by a constant. This allows a + * fairly fast implementation of the "brute force" approach of computing the + * distance from every colormap entry to every histogram cell. Unfortunately, + * it needs a work array to hold the best-distance-so-far for each histogram + * cell (because the inner loop has to be over cells, not colormap entries). + * The work array elements have to be ints, so the work array would need + * 256Kb at our recommended precision. This is not feasible in DOS machines. + * + * To get around these problems, we apply Thomas' method to compute the + * nearest colors for only the cells within a small subbox of the histogram. + * The work array need be only as big as the subbox, so the memory usage + * problem is solved. Furthermore, we need not fill subboxes that are never + * referenced in pass2; many images use only part of the color gamut, so a + * fair amount of work is saved. An additional advantage of this + * approach is that we can apply Heckbert's locality criterion to quickly + * eliminate colormap entries that are far away from the subbox; typically + * three-fourths of the colormap entries are rejected by Heckbert's criterion, + * and we need not compute their distances to individual cells in the subbox. + * The speed of this approach is heavily influenced by the subbox size: too + * small means too much overhead, too big loses because Heckbert's criterion + * can't eliminate as many colormap entries. Empirically the best subbox + * size seems to be about 1/512th of the histogram (1/8th in each direction). + * + * Thomas' article also describes a refined method which is asymptotically + * faster than the brute-force method, but it is also far more complex and + * cannot efficiently be applied to small subboxes. It is therefore not + * useful for programs intended to be portable to DOS machines. On machines + * with plenty of memory, filling the whole histogram in one shot with Thomas' + * refined method might be faster than the present code --- but then again, + * it might not be any faster, and it's certainly more complicated. + */ + +/* log2(histogram cells in update box) for each axis; this can be adjusted */ +#define BOX_R_LOG (PRECISION_R-3) +#define BOX_G_LOG (PRECISION_G-3) +#define BOX_B_LOG (PRECISION_B-3) + +#define BOX_R_ELEMS (1<actual_number_of_colors; + int maxR, maxG, maxB; + int centerR, centerG, centerB; + int i, x, ncolors; + int minmaxdist, min_dist, max_dist, tdist; + int mindist[256]; /* min distance to colormap entry i */ + + /* Compute true coordinates of update box's upper corner and center. + * Actually we compute the coordinates of the center of the upper-corner + * histogram cell, which are the upper bounds of the volume we care about. + * Note that since ">>" rounds down, the "center" values may be closer to + * min than to max; hence comparisons to them must be "<=", not "<". + */ + maxR = minR + ((1 << BOX_R_SHIFT) - (1 << R_SHIFT)); + centerR = (minR + maxR) >> 1; + maxG = minG + ((1 << BOX_G_SHIFT) - (1 << G_SHIFT)); + centerG = (minG + maxG) >> 1; + maxB = minB + ((1 << BOX_B_SHIFT) - (1 << B_SHIFT)); + centerB = (minB + maxB) >> 1; + + /* For each color in colormap, find: + * 1. its minimum squared-distance to any point in the update box + * (zero if color is within update box); + * 2. its maximum squared-distance to any point in the update box. + * Both of these can be found by considering only the corners of the box. + * We save the minimum distance for each color in mindist[]; + * only the smallest maximum distance is of interest. + */ + minmaxdist = 0x7FFFFFFFL; + + for (i = 0; i < numcolors; i++) { + /* We compute the squared-R-distance term, then add in the other two. */ + x = quantobj->cmap[i].red; + if (x < minR) { + tdist = (x - minR) * R_SCALE; + min_dist = tdist * tdist; + tdist = (x - maxR) * R_SCALE; + max_dist = tdist * tdist; + } else if (x > maxR) { + tdist = (x - maxR) * R_SCALE; + min_dist = tdist * tdist; + tdist = (x - minR) * R_SCALE; + max_dist = tdist * tdist; + } else { + /* within cell range so no contribution to min_dist */ + min_dist = 0; + if (x <= centerR) { + tdist = (x - maxR) * R_SCALE; + max_dist = tdist * tdist; + } else { + tdist = (x - minR) * R_SCALE; + max_dist = tdist * tdist; + } + } + + x = quantobj->cmap[i].green; + if (x < minG) { + tdist = (x - minG) * G_SCALE; + min_dist += tdist * tdist; + tdist = (x - maxG) * G_SCALE; + max_dist += tdist * tdist; + } else if (x > maxG) { + tdist = (x - maxG) * G_SCALE; + min_dist += tdist * tdist; + tdist = (x - minG) * G_SCALE; + max_dist += tdist * tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerG) { + tdist = (x - maxG) * G_SCALE; + max_dist += tdist * tdist; + } else { + tdist = (x - minG) * G_SCALE; + max_dist += tdist * tdist; + } + } + + x = quantobj->cmap[i].blue; + if (x < minB) { + tdist = (x - minB) * B_SCALE; + min_dist += tdist * tdist; + tdist = (x - maxB) * B_SCALE; + max_dist += tdist * tdist; + } else if (x > maxB) { + tdist = (x - maxB) * B_SCALE; + min_dist += tdist * tdist; + tdist = (x - minB) * B_SCALE; + max_dist += tdist * tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerB) { + tdist = (x - maxB) * B_SCALE; + max_dist += tdist * tdist; + } else { + tdist = (x - minB) * B_SCALE; + max_dist += tdist * tdist; + } + } + + mindist[i] = min_dist; /* save away the results */ + if (max_dist < minmaxdist) + minmaxdist = max_dist; + } + + /* Now we know that no cell in the update box is more than minmaxdist + * away from some colormap entry. Therefore, only colors that are + * within minmaxdist of some part of the box need be considered. + */ + ncolors = 0; + for (i = 0; i < numcolors; i++) { + if (mindist[i] <= minmaxdist) + colorlist[ncolors++] = i; + } + return ncolors; +} + +static void +find_best_colors(QuantizeObj * quantobj, + int minR, + int minG, + int minB, int numcolors, int colorlist[], int bestcolor[]) +/* Find the closest colormap entry for each cell in the update box, + * given the list of candidate colors prepared by find_nearby_colors. + * Return the indexes of the closest entries in the bestcolor[] array. + * This routine uses Thomas' incremental distance calculation method to + * find the distance from a colormap entry to successive cells in the box. + */ +{ + int iR, iG, iB; + int i, icolor; + int *bptr; /* pointer into bestdist[] array */ + int *cptr; /* pointer into bestcolor[] array */ + int dist0, dist1; /* initial distance values */ + int dist2; /* current distance in inner loop */ + int xx0, xx1; /* distance increments */ + int xx2; + int inR, inG, inB; /* initial values for increments */ + + /* This array holds the distance to the nearest-so-far color for each cell */ + int bestdist[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS]; + + /* Initialize best-distance for each cell of the update box */ + bptr = bestdist; + for (i = BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS - 1; i >= 0; i--) + *bptr++ = 0x7FFFFFFFL; + + /* For each color selected by find_nearby_colors, + * compute its distance to the center of each cell in the box. + * If that's less than best-so-far, update best distance and color number. + */ + + /* Nominal steps between cell centers ("x" in Thomas article) */ +#define STEP_R ((1 << R_SHIFT) * R_SCALE) +#define STEP_G ((1 << G_SHIFT) * G_SCALE) +#define STEP_B ((1 << B_SHIFT) * B_SCALE) + + for (i = 0; i < numcolors; i++) { + icolor = colorlist[i]; + /* Compute (square of) distance from minR/G/B to this color */ + inR = (minR - quantobj->cmap[icolor].red) * R_SCALE; + dist0 = inR * inR; + inG = (minG - quantobj->cmap[icolor].green) * G_SCALE; + dist0 += inG * inG; + inB = (minB - quantobj->cmap[icolor].blue) * B_SCALE; + dist0 += inB * inB; + /* Form the initial difference increments */ + inR = inR * (2 * STEP_R) + STEP_R * STEP_R; + inG = inG * (2 * STEP_G) + STEP_G * STEP_G; + inB = inB * (2 * STEP_B) + STEP_B * STEP_B; + /* Now loop over all cells in box, updating distance per Thomas method */ + bptr = bestdist; + cptr = bestcolor; + xx0 = inR; + for (iR = BOX_R_ELEMS - 1; iR >= 0; iR--) { + dist1 = dist0; + xx1 = inG; + for (iG = BOX_G_ELEMS - 1; iG >= 0; iG--) { + dist2 = dist1; + xx2 = inB; + for (iB = BOX_B_ELEMS - 1; iB >= 0; iB--) { + if (dist2 < *bptr) { + *bptr = dist2; + *cptr = icolor; + } + dist2 += xx2; + xx2 += 2 * STEP_B * STEP_B; + bptr++; + cptr++; + } + dist1 += xx1; + xx1 += 2 * STEP_G * STEP_G; + } + dist0 += xx0; + xx0 += 2 * STEP_R * STEP_R; + } + } +} + +static void +fill_inverse_cmap_rgb(QuantizeObj * quantobj, + Histogram histogram, int R, int G, int B) +/* Fill the inverse-colormap entries in the update box that contains */ +/* histogram cell R/G/B. (Only that one cell MUST be filled, but */ +/* we can fill as many others as we wish.) */ +{ + int minR, minG, minB; /* lower left corner of update box */ + int iR, iG, iB; + int *cptr; /* pointer into bestcolor[] array */ + ColorFreq *cachep; /* pointer into main cache array */ + /* This array lists the candidate colormap indexes. */ + int colorlist[256]; + int numcolors; /* number of candidate colors */ + /* This array holds the actually closest colormap index for each cell. */ + int bestcolor[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS]; + + /* Convert cell coordinates to update box id */ + R >>= BOX_R_LOG; + G >>= BOX_G_LOG; + B >>= BOX_B_LOG; + + /* Compute true coordinates of update box's origin corner. + * Actually we compute the coordinates of the center of the corner + * histogram cell, which are the lower bounds of the volume we care about. + */ + minR = (R << BOX_R_SHIFT) + ((1 << R_SHIFT) >> 1); + minG = (G << BOX_G_SHIFT) + ((1 << G_SHIFT) >> 1); + minB = (B << BOX_B_SHIFT) + ((1 << B_SHIFT) >> 1); + + /* Determine which colormap entries are close enough to be candidates + * for the nearest entry to some cell in the update box. + */ + numcolors = find_nearby_colors(quantobj, minR, minG, minB, colorlist); + + /* Determine the actually nearest colors. */ + find_best_colors(quantobj, minR, minG, minB, numcolors, colorlist, + bestcolor); + + /* Save the best color numbers (plus 1) in the main cache array */ + R <<= BOX_R_LOG; /* convert id back to base cell indexes */ + G <<= BOX_G_LOG; + B <<= BOX_B_LOG; + cptr = bestcolor; + for (iR = 0; iR < BOX_R_ELEMS; iR++) { + for (iG = 0; iG < BOX_G_ELEMS; iG++) { + cachep = &histogram[(R + iR) * MR + (G + iG) * MG + B]; + for (iB = 0; iB < BOX_B_ELEMS; iB++) { + *cachep++ = (*cptr++) + 1; + } + } + } +} + +/* This is pass 1 */ +static void +median_cut_pass1_rgb(QuantizeObj * quantobj) +{ + select_colors_rgb(quantobj, quantobj->histogram); +} + +/* + * Initialize the error-limiting transfer function (lookup table). + * The raw F-S error computation can potentially compute error values of up to + * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be + * much less, otherwise obviously wrong pixels will be created. (Typical + * effects include weird fringes at color-area boundaries, isolated bright + * pixels in a dark area, etc.) The standard advice for avoiding this problem + * is to ensure that the "corners" of the color cube are allocated as output + * colors; then repeated errors in the same direction cannot cause cascading + * error buildup. However, that only prevents the error from getting + * completely out of hand; Aaron Giles reports that error limiting improves + * the results even with corner colors allocated. + * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty + * well, but the smoother transfer function used below is even better. Thanks + * to Aaron Giles for this idea. + */ + +static int * +init_error_limit(void) +/* Allocate and fill in the error_limiter table */ +{ + int *table; + int in; + const int STEPSIZE = 190; + + table = malloc(sizeof (int) * (255 * 2 + 1)); + table += 255; /* so we can index -255 ... +255 */ + + /* Coarse function, much bleeding. */ + for (in = 0; in < STEPSIZE; in++) { + table[in] = in; + table[-in] = -in; + } + for (; in <= 255; in++) { + table[in] = STEPSIZE; + table[-in] = -STEPSIZE; + } + return (table); +} + +/* + * Map some rows of pixels to the output colormapped representation. + * Perform floyd-steinberg dithering. + */ + +static void +median_cut_pass2_rgb_init(QuantizeObj * quantobj) +{ + zero_histogram_rgb(quantobj->histogram); + + /* Mark all indices as currently unused */ + memset(quantobj->index_used_count, 0, 256 * sizeof (unsigned long)); +} + +static void +median_cut_pass2_fs_dither_rgb(QuantizeObj * quantobj, LogoStruct * Logo) +{ + Histogram histogram = quantobj->histogram; + ColorFreq *cachep; + Color *color; + int *error_limiter; + const short *fs_err1, *fs_err2; + const short *fs_err3, *fs_err4; + const short *range_limiter; + int src_bytes, dest_bytes; + unsigned char *src, *dest; + unsigned char *src_buf, *dest_buf; + int *red_n_row, *red_p_row; + int *grn_n_row, *grn_p_row; + int *blu_n_row, *blu_p_row; + int *rnr, *rpr; + int *gnr, *gpr; + int *bnr, *bpr; + int *tmp; + int r, g, b; + int re, ge, be; + int row, col; + int index; + int step_dest, step_src; + int odd_row; + int width, height; + unsigned long *index_used_count = quantobj->index_used_count; + + src_bytes = 3; + dest_bytes = 1; + width = Logo->width; + height = Logo->height; + + error_limiter = init_error_limit(); + range_limiter = range_array + 256; + + src_buf = malloc(width * src_bytes); + dest_buf = malloc(width * dest_bytes); + red_n_row = malloc(sizeof (int) * (width + 2)); + red_p_row = malloc(sizeof (int) * (width + 2)); + grn_n_row = malloc(sizeof (int) * (width + 2)); + grn_p_row = malloc(sizeof (int) * (width + 2)); + blu_n_row = malloc(sizeof (int) * (width + 2)); + blu_p_row = malloc(sizeof (int) * (width + 2)); + + memset(red_p_row, 0, (width + 2) * sizeof (int)); + memset(grn_p_row, 0, (width + 2) * sizeof (int)); + memset(blu_p_row, 0, (width + 2) * sizeof (int)); + + fs_err1 = floyd_steinberg_error1 + 511; + fs_err2 = floyd_steinberg_error2 + 511; + fs_err3 = floyd_steinberg_error3 + 511; + fs_err4 = floyd_steinberg_error4 + 511; + + odd_row = 0; + + for (row = 0; row < height; row++) { + memcpy(src_buf, Logo->rgb_data + row * width * src_bytes, + width * src_bytes); + + src = src_buf; + dest = dest_buf; + + rnr = red_n_row; + gnr = grn_n_row; + bnr = blu_n_row; + rpr = red_p_row + 1; + gpr = grn_p_row + 1; + bpr = blu_p_row + 1; + if (odd_row) { + step_dest = -dest_bytes; + step_src = -src_bytes; + src += (width * src_bytes) - src_bytes; + dest += (width * dest_bytes) - dest_bytes; + rnr += width + 1; + gnr += width + 1; + bnr += width + 1; + rpr += width; + gpr += width; + bpr += width; + *(rnr - 1) = *(gnr - 1) = *(bnr - 1) = 0; + } else { + step_dest = dest_bytes; + step_src = src_bytes; + *(rnr + 1) = *(gnr + 1) = *(bnr + 1) = 0; + } + *rnr = *gnr = *bnr = 0; + for (col = 0; col < width; col++) { + r = range_limiter[src[0] + error_limiter[*rpr]]; + g = range_limiter[src[1] + error_limiter[*gpr]]; + b = range_limiter[src[2] + error_limiter[*bpr]]; + re = r >> R_SHIFT; + ge = g >> G_SHIFT; + be = b >> B_SHIFT; + cachep = &histogram[re * MR + ge * MG + be]; + /* If we have not seen this color before, find nearest + colormap entry and update the cache */ + if (*cachep == 0) + fill_inverse_cmap_rgb(quantobj, histogram, re, + ge, be); + index = *cachep - 1; + index_used_count[index]++; + dest[0] = index; + color = &quantobj->cmap[index]; + re = r - color->red; + ge = g - color->green; + be = b - color->blue; + if (odd_row) { + *(--rpr) += fs_err1[re]; + *(--gpr) += fs_err1[ge]; + *(--bpr) += fs_err1[be]; + *rnr-- += fs_err2[re]; + *gnr-- += fs_err2[ge]; + *bnr-- += fs_err2[be]; + *rnr += fs_err3[re]; + *gnr += fs_err3[ge]; + *bnr += fs_err3[be]; + *(rnr - 1) = fs_err4[re]; + *(gnr - 1) = fs_err4[ge]; + *(bnr - 1) = fs_err4[be]; + } else { + *(++rpr) += fs_err1[re]; + *(++gpr) += fs_err1[ge]; + *(++bpr) += fs_err1[be]; + *rnr++ += fs_err2[re]; + *gnr++ += fs_err2[ge]; + *bnr++ += fs_err2[be]; + *rnr += fs_err3[re]; + *gnr += fs_err3[ge]; + *bnr += fs_err3[be]; + *(rnr + 1) = fs_err4[re]; + *(gnr + 1) = fs_err4[ge]; + *(bnr + 1) = fs_err4[be]; + } + dest += step_dest; + src += step_src; + } + tmp = red_n_row; + red_n_row = red_p_row; + red_p_row = tmp; + tmp = grn_n_row; + grn_n_row = grn_p_row; + grn_p_row = tmp; + tmp = blu_n_row; + blu_n_row = blu_p_row; + blu_p_row = tmp; + odd_row = !odd_row; + memcpy(Logo->image + row * width * dest_bytes, dest_buf, + width * dest_bytes); + } + free(error_limiter - 255); + free(red_n_row); + free(red_p_row); + free(grn_n_row); + free(grn_p_row); + free(blu_n_row); + free(blu_p_row); + free(src_buf); + free(dest_buf); +} + +static void +delete_median_cut(QuantizeObj * quantobj) +{ + free(quantobj->histogram); + free(quantobj); +} + +/**************************************************************/ + +static QuantizeObj * +initialize_median_cut(int num_colors) +{ + QuantizeObj *quantobj; + + /* Initialize the data structures */ + quantobj = malloc(sizeof (QuantizeObj)); + + quantobj->histogram = malloc(sizeof (ColorFreq) * + HIST_R_ELEMS * + HIST_G_ELEMS * HIST_B_ELEMS); + + quantobj->desired_number_of_colors = num_colors; + quantobj->first_pass = median_cut_pass1_rgb; + quantobj->second_pass_init = median_cut_pass2_rgb_init; + quantobj->second_pass = median_cut_pass2_fs_dither_rgb; + quantobj->delete_func = delete_median_cut; + + return quantobj; +} diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/convert.h linux-2.4.18-pre9-logo/scripts/tologo/convert.h --- linux-2.4.18-pre9/scripts/tologo/convert.h Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/convert.h Fri Feb 8 17:11:20 2002 @@ -0,0 +1,19 @@ +/* convert.h + * Copyright (C) 2002 DindinX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +void ConvertLogo(LogoStruct * Logo, unsigned int num_cols); diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/fsdither.h linux-2.4.18-pre9-logo/scripts/tologo/fsdither.h --- linux-2.4.18-pre9/scripts/tologo/fsdither.h Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/fsdither.h Fri Feb 8 17:11:20 2002 @@ -0,0 +1,562 @@ +/* + * tologo + * Copyright (C) 2002 DindinX + * + * The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +#ifndef __FSDITHER_H__ +#define __FSDITHER_H__ + +/* The following 5 arrays are used in performing floyd-steinberg + * error diffusion dithering. The range array allows the quick + * bounds checking of pixel values. The 4 error arrays contain + * the error computations for the east, south-east, south and + * south-west pixels surrounding the current pixel respectively. + */ + +const short range_array[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, +}; + +const short floyd_steinberg_error1[] = { + -223, -223, -222, -222, -221, -221, -220, -220, -220, -219, + -219, -218, -218, -217, -217, -217, -216, -216, -215, -215, + -214, -214, -213, -213, -213, -212, -212, -211, -211, -210, + -210, -210, -209, -209, -208, -208, -207, -207, -206, -206, + -206, -205, -205, -204, -204, -203, -203, -203, -202, -202, + -201, -201, -200, -200, -199, -199, -199, -198, -198, -197, + -197, -196, -196, -196, -195, -195, -194, -194, -193, -193, + -192, -192, -192, -191, -191, -190, -190, -189, -189, -189, + -188, -188, -187, -187, -186, -186, -185, -185, -185, -184, + -184, -183, -183, -182, -182, -182, -181, -181, -180, -180, + -179, -179, -178, -178, -178, -177, -177, -176, -176, -175, + -175, -175, -174, -174, -173, -173, -172, -172, -171, -171, + -171, -170, -170, -169, -169, -168, -168, -168, -167, -167, + -166, -166, -165, -165, -164, -164, -164, -163, -163, -162, + -162, -161, -161, -161, -160, -160, -159, -159, -158, -158, + -157, -157, -157, -156, -156, -155, -155, -154, -154, -154, + -153, -153, -152, -152, -151, -151, -150, -150, -150, -149, + -149, -148, -148, -147, -147, -147, -146, -146, -145, -145, + -144, -144, -143, -143, -143, -142, -142, -141, -141, -140, + -140, -140, -139, -139, -138, -138, -137, -137, -136, -136, + -136, -135, -135, -134, -134, -133, -133, -133, -132, -132, + -131, -131, -130, -130, -129, -129, -129, -128, -128, -127, + -127, -126, -126, -126, -125, -125, -124, -124, -123, -123, + -122, -122, -122, -121, -121, -120, -120, -119, -119, -119, + -118, -118, -117, -117, -116, -116, -115, -115, -115, -114, + -114, -113, -113, -112, -112, -112, -111, -111, -110, -110, + -109, -109, -108, -108, -108, -107, -107, -106, -106, -105, + -105, -105, -104, -104, -103, -103, -102, -102, -101, -101, + -101, -100, -100, -99, -99, -98, -98, -98, -97, -97, + -96, -96, -95, -95, -94, -94, -94, -93, -93, -92, + -92, -91, -91, -91, -90, -90, -89, -89, -88, -88, + -87, -87, -87, -86, -86, -85, -85, -84, -84, -84, + -83, -83, -82, -82, -81, -81, -80, -80, -80, -79, + -79, -78, -78, -77, -77, -77, -76, -76, -75, -75, + -74, -74, -73, -73, -73, -72, -72, -71, -71, -70, + -70, -70, -69, -69, -68, -68, -67, -67, -66, -66, + -66, -65, -65, -64, -64, -63, -63, -63, -62, -62, + -61, -61, -60, -60, -59, -59, -59, -58, -58, -57, + -57, -56, -56, -56, -55, -55, -54, -54, -53, -53, + -52, -52, -52, -51, -51, -50, -50, -49, -49, -49, + -48, -48, -47, -47, -46, -46, -45, -45, -45, -44, + -44, -43, -43, -42, -42, -42, -41, -41, -40, -40, + -39, -39, -38, -38, -38, -37, -37, -36, -36, -35, + -35, -35, -34, -34, -33, -33, -32, -32, -31, -31, + -31, -30, -30, -29, -29, -28, -28, -28, -27, -27, + -26, -26, -25, -25, -24, -24, -24, -23, -23, -22, + -22, -21, -21, -21, -20, -20, -19, -19, -18, -18, + -17, -17, -17, -16, -16, -15, -15, -14, -14, -14, + -13, -13, -12, -12, -11, -11, -10, -10, -10, -9, + -9, -8, -8, -7, -7, -7, -6, -6, -5, -5, + -4, -4, -3, -3, -3, -2, -2, -1, -1, 0, + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, + 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, + 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, + 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, + 17, 17, 17, 18, 18, 19, 19, 20, 20, 21, + 21, 21, 22, 22, 23, 23, 24, 24, 24, 25, + 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, + 30, 30, 31, 31, 31, 32, 32, 33, 33, 34, + 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, + 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, + 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, + 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, + 52, 52, 52, 53, 53, 54, 54, 55, 55, 56, + 56, 56, 57, 57, 58, 58, 59, 59, 59, 60, + 60, 61, 61, 62, 62, 63, 63, 63, 64, 64, + 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, + 69, 70, 70, 70, 71, 71, 72, 72, 73, 73, + 73, 74, 74, 75, 75, 76, 76, 77, 77, 77, + 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, + 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, + 87, 87, 87, 88, 88, 89, 89, 90, 90, 91, + 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, + 95, 96, 96, 97, 97, 98, 98, 98, 99, 99, + 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, + 104, 105, 105, 105, 106, 106, 107, 107, 108, 108, + 108, 109, 109, 110, 110, 111, 111, 112, 112, 112, + 113, 113, 114, 114, 115, 115, 115, 116, 116, 117, + 117, 118, 118, 119, 119, 119, 120, 120, 121, 121, + 122, 122, 122, 123, 123, 124, 124, 125, 125, 126, + 126, 126, 127, 127, 128, 128, 129, 129, 129, 130, + 130, 131, 131, 132, 132, 133, 133, 133, 134, 134, + 135, 135, 136, 136, 136, 137, 137, 138, 138, 139, + 139, 140, 140, 140, 141, 141, 142, 142, 143, 143, + 143, 144, 144, 145, 145, 146, 146, 147, 147, 147, + 148, 148, 149, 149, 150, 150, 150, 151, 151, 152, + 152, 153, 153, 154, 154, 154, 155, 155, 156, 156, + 157, 157, 157, 158, 158, 159, 159, 160, 160, 161, + 161, 161, 162, 162, 163, 163, 164, 164, 164, 165, + 165, 166, 166, 167, 167, 168, 168, 168, 169, 169, + 170, 170, 171, 171, 171, 172, 172, 173, 173, 174, + 174, 175, 175, 175, 176, 176, 177, 177, 178, 178, + 178, 179, 179, 180, 180, 181, 181, 182, 182, 182, + 183, 183, 184, 184, 185, 185, 185, 186, 186, 187, + 187, 188, 188, 189, 189, 189, 190, 190, 191, 191, + 192, 192, 192, 193, 193, 194, 194, 195, 195, 196, + 196, 196, 197, 197, 198, 198, 199, 199, 199, 200, + 200, 201, 201, 202, 202, 203, 203, 203, 204, 204, + 205, 205, 206, 206, 206, 207, 207, 208, 208, 209, + 209, 210, 210, 210, 211, 211, 212, 212, 213, 213, + 213, 214, 214, 215, 215, 216, 216, 217, 217, 217, + 218, 218, 219, 219, 220, 220, 220, 221, 221, 222, + 222, 223, 223, 224, 224, +}; + +const short floyd_steinberg_error2[] = { + -95, -95, -95, -95, -95, -94, -94, -94, -94, -94, + -93, -93, -93, -93, -93, -93, -92, -92, -92, -92, + -92, -91, -91, -91, -91, -91, -90, -90, -90, -90, + -90, -90, -89, -89, -89, -89, -89, -88, -88, -88, + -88, -88, -87, -87, -87, -87, -87, -87, -86, -86, + -86, -86, -86, -85, -85, -85, -85, -85, -84, -84, + -84, -84, -84, -84, -83, -83, -83, -83, -83, -82, + -82, -82, -82, -82, -81, -81, -81, -81, -81, -81, + -80, -80, -80, -80, -80, -79, -79, -79, -79, -79, + -78, -78, -78, -78, -78, -78, -77, -77, -77, -77, + -77, -76, -76, -76, -76, -76, -75, -75, -75, -75, + -75, -75, -74, -74, -74, -74, -74, -73, -73, -73, + -73, -73, -72, -72, -72, -72, -72, -72, -71, -71, + -71, -71, -71, -70, -70, -70, -70, -70, -69, -69, + -69, -69, -69, -69, -68, -68, -68, -68, -68, -67, + -67, -67, -67, -67, -66, -66, -66, -66, -66, -66, + -65, -65, -65, -65, -65, -64, -64, -64, -64, -64, + -63, -63, -63, -63, -63, -63, -62, -62, -62, -62, + -62, -61, -61, -61, -61, -61, -60, -60, -60, -60, + -60, -60, -59, -59, -59, -59, -59, -58, -58, -58, + -58, -58, -57, -57, -57, -57, -57, -57, -56, -56, + -56, -56, -56, -55, -55, -55, -55, -55, -54, -54, + -54, -54, -54, -54, -53, -53, -53, -53, -53, -52, + -52, -52, -52, -52, -51, -51, -51, -51, -51, -51, + -50, -50, -50, -50, -50, -49, -49, -49, -49, -49, + -48, -48, -48, -48, -48, -48, -47, -47, -47, -47, + -47, -46, -46, -46, -46, -46, -45, -45, -45, -45, + -45, -45, -44, -44, -44, -44, -44, -43, -43, -43, + -43, -43, -42, -42, -42, -42, -42, -42, -41, -41, + -41, -41, -41, -40, -40, -40, -40, -40, -39, -39, + -39, -39, -39, -39, -38, -38, -38, -38, -38, -37, + -37, -37, -37, -37, -36, -36, -36, -36, -36, -36, + -35, -35, -35, -35, -35, -34, -34, -34, -34, -34, + -33, -33, -33, -33, -33, -33, -32, -32, -32, -32, + -32, -31, -31, -31, -31, -31, -30, -30, -30, -30, + -30, -30, -29, -29, -29, -29, -29, -28, -28, -28, + -28, -28, -27, -27, -27, -27, -27, -27, -26, -26, + -26, -26, -26, -25, -25, -25, -25, -25, -24, -24, + -24, -24, -24, -24, -23, -23, -23, -23, -23, -22, + -22, -22, -22, -22, -21, -21, -21, -21, -21, -21, + -20, -20, -20, -20, -20, -19, -19, -19, -19, -19, + -18, -18, -18, -18, -18, -18, -17, -17, -17, -17, + -17, -16, -16, -16, -16, -16, -15, -15, -15, -15, + -15, -15, -14, -14, -14, -14, -14, -13, -13, -13, + -13, -13, -12, -12, -12, -12, -12, -12, -11, -11, + -11, -11, -11, -10, -10, -10, -10, -10, -9, -9, + -9, -9, -9, -9, -8, -8, -8, -8, -8, -7, + -7, -7, -7, -7, -6, -6, -6, -6, -6, -6, + -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, + -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, + -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, + 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, + 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, + 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, + 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, + 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, + 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, + 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, + 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, + 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, + 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, + 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, + 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, + 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, + 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, + 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, + 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, + 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, + 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, + 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, + 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, + 44, 45, 45, 45, 45, 45, 45, 46, 46, 46, + 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, + 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, + 50, 50, 50, 51, 51, 51, 51, 51, 51, 52, + 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, + 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, + 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, + 57, 58, 58, 58, 58, 58, 59, 59, 59, 59, + 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, + 61, 61, 62, 62, 62, 62, 62, 63, 63, 63, + 63, 63, 63, 64, 64, 64, 64, 64, 65, 65, + 65, 65, 65, 66, 66, 66, 66, 66, 66, 67, + 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, + 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, + 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, + 72, 73, 73, 73, 73, 73, 74, 74, 74, 74, + 74, 75, 75, 75, 75, 75, 75, 76, 76, 76, + 76, 76, 77, 77, 77, 77, 77, 78, 78, 78, + 78, 78, 78, 79, 79, 79, 79, 79, 80, 80, + 80, 80, 80, 81, 81, 81, 81, 81, 81, 82, + 82, 82, 82, 82, 83, 83, 83, 83, 83, 84, + 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, + 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, + 87, 88, 88, 88, 88, 88, 89, 89, 89, 89, + 89, 90, 90, 90, 90, 90, 90, 91, 91, 91, + 91, 91, 92, 92, 92, 92, 92, 93, 93, 93, + 93, 93, 93, 94, 94, 94, 94, 94, 95, 95, + 95, 95, 95, 96, 96, +}; + +const short floyd_steinberg_error3[] = { + -159, -159, -159, -158, -158, -158, -157, -157, -157, -156, + -156, -156, -155, -155, -155, -155, -154, -154, -154, -153, + -153, -153, -152, -152, -152, -151, -151, -151, -150, -150, + -150, -150, -149, -149, -149, -148, -148, -148, -147, -147, + -147, -146, -146, -146, -145, -145, -145, -145, -144, -144, + -144, -143, -143, -143, -142, -142, -142, -141, -141, -141, + -140, -140, -140, -140, -139, -139, -139, -138, -138, -138, + -137, -137, -137, -136, -136, -136, -135, -135, -135, -135, + -134, -134, -134, -133, -133, -133, -132, -132, -132, -131, + -131, -131, -130, -130, -130, -130, -129, -129, -129, -128, + -128, -128, -127, -127, -127, -126, -126, -126, -125, -125, + -125, -125, -124, -124, -124, -123, -123, -123, -122, -122, + -122, -121, -121, -121, -120, -120, -120, -120, -119, -119, + -119, -118, -118, -118, -117, -117, -117, -116, -116, -116, + -115, -115, -115, -115, -114, -114, -114, -113, -113, -113, + -112, -112, -112, -111, -111, -111, -110, -110, -110, -110, + -109, -109, -109, -108, -108, -108, -107, -107, -107, -106, + -106, -106, -105, -105, -105, -105, -104, -104, -104, -103, + -103, -103, -102, -102, -102, -101, -101, -101, -100, -100, + -100, -100, -99, -99, -99, -98, -98, -98, -97, -97, + -97, -96, -96, -96, -95, -95, -95, -95, -94, -94, + -94, -93, -93, -93, -92, -92, -92, -91, -91, -91, + -90, -90, -90, -90, -89, -89, -89, -88, -88, -88, + -87, -87, -87, -86, -86, -86, -85, -85, -85, -85, + -84, -84, -84, -83, -83, -83, -82, -82, -82, -81, + -81, -81, -80, -80, -80, -80, -79, -79, -79, -78, + -78, -78, -77, -77, -77, -76, -76, -76, -75, -75, + -75, -75, -74, -74, -74, -73, -73, -73, -72, -72, + -72, -71, -71, -71, -70, -70, -70, -70, -69, -69, + -69, -68, -68, -68, -67, -67, -67, -66, -66, -66, + -65, -65, -65, -65, -64, -64, -64, -63, -63, -63, + -62, -62, -62, -61, -61, -61, -60, -60, -60, -60, + -59, -59, -59, -58, -58, -58, -57, -57, -57, -56, + -56, -56, -55, -55, -55, -55, -54, -54, -54, -53, + -53, -53, -52, -52, -52, -51, -51, -51, -50, -50, + -50, -50, -49, -49, -49, -48, -48, -48, -47, -47, + -47, -46, -46, -46, -45, -45, -45, -45, -44, -44, + -44, -43, -43, -43, -42, -42, -42, -41, -41, -41, + -40, -40, -40, -40, -39, -39, -39, -38, -38, -38, + -37, -37, -37, -36, -36, -36, -35, -35, -35, -35, + -34, -34, -34, -33, -33, -33, -32, -32, -32, -31, + -31, -31, -30, -30, -30, -30, -29, -29, -29, -28, + -28, -28, -27, -27, -27, -26, -26, -26, -25, -25, + -25, -25, -24, -24, -24, -23, -23, -23, -22, -22, + -22, -21, -21, -21, -20, -20, -20, -20, -19, -19, + -19, -18, -18, -18, -17, -17, -17, -16, -16, -16, + -15, -15, -15, -15, -14, -14, -14, -13, -13, -13, + -12, -12, -12, -11, -11, -11, -10, -10, -10, -10, + -9, -9, -9, -8, -8, -8, -7, -7, -7, -6, + -6, -6, -5, -5, -5, -5, -4, -4, -4, -3, + -3, -3, -2, -2, -2, -1, -1, -1, 0, 0, + 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, + 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, + 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, + 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, + 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, + 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, + 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, + 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, + 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, + 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, + 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, + 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, + 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, + 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, + 43, 43, 44, 44, 44, 45, 45, 45, 45, 46, + 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, + 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, + 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, + 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, + 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, + 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, + 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, + 68, 68, 69, 69, 69, 70, 70, 70, 70, 71, + 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, + 74, 75, 75, 75, 75, 76, 76, 76, 77, 77, + 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, + 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, + 84, 84, 84, 85, 85, 85, 85, 86, 86, 86, + 87, 87, 87, 88, 88, 88, 89, 89, 89, 90, + 90, 90, 90, 91, 91, 91, 92, 92, 92, 93, + 93, 93, 94, 94, 94, 95, 95, 95, 95, 96, + 96, 96, 97, 97, 97, 98, 98, 98, 99, 99, + 99, 100, 100, 100, 100, 101, 101, 101, 102, 102, + 102, 103, 103, 103, 104, 104, 104, 105, 105, 105, + 105, 106, 106, 106, 107, 107, 107, 108, 108, 108, + 109, 109, 109, 110, 110, 110, 110, 111, 111, 111, + 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, + 115, 115, 115, 116, 116, 116, 117, 117, 117, 118, + 118, 118, 119, 119, 119, 120, 120, 120, 120, 121, + 121, 121, 122, 122, 122, 123, 123, 123, 124, 124, + 124, 125, 125, 125, 125, 126, 126, 126, 127, 127, + 127, 128, 128, 128, 129, 129, 129, 130, 130, 130, + 130, 131, 131, 131, 132, 132, 132, 133, 133, 133, + 134, 134, 134, 135, 135, 135, 135, 136, 136, 136, + 137, 137, 137, 138, 138, 138, 139, 139, 139, 140, + 140, 140, 140, 141, 141, 141, 142, 142, 142, 143, + 143, 143, 144, 144, 144, 145, 145, 145, 145, 146, + 146, 146, 147, 147, 147, 148, 148, 148, 149, 149, + 149, 150, 150, 150, 150, 151, 151, 151, 152, 152, + 152, 153, 153, 153, 154, 154, 154, 155, 155, 155, + 155, 156, 156, 156, 157, 157, 157, 158, 158, 158, + 159, 159, 159, 160, 160, +}; + +const short floyd_steinberg_error4[] = { + -34, -33, -33, -33, -33, -33, -34, -33, -32, -33, + -33, -33, -33, -33, -32, -31, -33, -32, -32, -32, + -32, -32, -33, -32, -31, -32, -32, -32, -32, -32, + -31, -30, -32, -31, -31, -31, -31, -31, -32, -31, + -30, -31, -31, -31, -31, -31, -30, -29, -31, -30, + -30, -30, -30, -30, -31, -30, -29, -30, -30, -30, + -30, -30, -29, -28, -30, -29, -29, -29, -29, -29, + -30, -29, -28, -29, -29, -29, -29, -29, -28, -27, + -29, -28, -28, -28, -28, -28, -29, -28, -27, -28, + -28, -28, -28, -28, -27, -26, -28, -27, -27, -27, + -27, -27, -28, -27, -26, -27, -27, -27, -27, -27, + -26, -25, -27, -26, -26, -26, -26, -26, -27, -26, + -25, -26, -26, -26, -26, -26, -25, -24, -26, -25, + -25, -25, -25, -25, -26, -25, -24, -25, -25, -25, + -25, -25, -24, -23, -25, -24, -24, -24, -24, -24, + -25, -24, -23, -24, -24, -24, -24, -24, -23, -22, + -24, -23, -23, -23, -23, -23, -24, -23, -22, -23, + -23, -23, -23, -23, -22, -21, -23, -22, -22, -22, + -22, -22, -23, -22, -21, -22, -22, -22, -22, -22, + -21, -20, -22, -21, -21, -21, -21, -21, -22, -21, + -20, -21, -21, -21, -21, -21, -20, -19, -21, -20, + -20, -20, -20, -20, -21, -20, -19, -20, -20, -20, + -20, -20, -19, -18, -20, -19, -19, -19, -19, -19, + -20, -19, -18, -19, -19, -19, -19, -19, -18, -17, + -19, -18, -18, -18, -18, -18, -19, -18, -17, -18, + -18, -18, -18, -18, -17, -16, -18, -17, -17, -17, + -17, -17, -18, -17, -16, -17, -17, -17, -17, -17, + -16, -15, -17, -16, -16, -16, -16, -16, -17, -16, + -15, -16, -16, -16, -16, -16, -15, -14, -16, -15, + -15, -15, -15, -15, -16, -15, -14, -15, -15, -15, + -15, -15, -14, -13, -15, -14, -14, -14, -14, -14, + -15, -14, -13, -14, -14, -14, -14, -14, -13, -12, + -14, -13, -13, -13, -13, -13, -14, -13, -12, -13, + -13, -13, -13, -13, -12, -11, -13, -12, -12, -12, + -12, -12, -13, -12, -11, -12, -12, -12, -12, -12, + -11, -10, -12, -11, -11, -11, -11, -11, -12, -11, + -10, -11, -11, -11, -11, -11, -10, -9, -11, -10, + -10, -10, -10, -10, -11, -10, -9, -10, -10, -10, + -10, -10, -9, -8, -10, -9, -9, -9, -9, -9, + -10, -9, -8, -9, -9, -9, -9, -9, -8, -7, + -9, -8, -8, -8, -8, -8, -9, -8, -7, -8, + -8, -8, -8, -8, -7, -6, -8, -7, -7, -7, + -7, -7, -8, -7, -6, -7, -7, -7, -7, -7, + -6, -5, -7, -6, -6, -6, -6, -6, -7, -6, + -5, -6, -6, -6, -6, -6, -5, -4, -6, -5, + -5, -5, -5, -5, -6, -5, -4, -5, -5, -5, + -5, -5, -4, -3, -5, -4, -4, -4, -4, -4, + -5, -4, -3, -4, -4, -4, -4, -4, -3, -2, + -4, -3, -3, -3, -3, -3, -4, -3, -2, -3, + -3, -3, -3, -3, -2, -1, -3, -2, -2, -2, + -2, -2, -3, -2, -1, -2, -2, -2, -2, -2, + -1, 0, 1, 2, 2, 2, 2, 2, 1, 2, + 3, 2, 2, 2, 2, 2, 3, 1, 2, 3, + 3, 3, 3, 3, 2, 3, 4, 3, 3, 3, + 3, 3, 4, 2, 3, 4, 4, 4, 4, 4, + 3, 4, 5, 4, 4, 4, 4, 4, 5, 3, + 4, 5, 5, 5, 5, 5, 4, 5, 6, 5, + 5, 5, 5, 5, 6, 4, 5, 6, 6, 6, + 6, 6, 5, 6, 7, 6, 6, 6, 6, 6, + 7, 5, 6, 7, 7, 7, 7, 7, 6, 7, + 8, 7, 7, 7, 7, 7, 8, 6, 7, 8, + 8, 8, 8, 8, 7, 8, 9, 8, 8, 8, + 8, 8, 9, 7, 8, 9, 9, 9, 9, 9, + 8, 9, 10, 9, 9, 9, 9, 9, 10, 8, + 9, 10, 10, 10, 10, 10, 9, 10, 11, 10, + 10, 10, 10, 10, 11, 9, 10, 11, 11, 11, + 11, 11, 10, 11, 12, 11, 11, 11, 11, 11, + 12, 10, 11, 12, 12, 12, 12, 12, 11, 12, + 13, 12, 12, 12, 12, 12, 13, 11, 12, 13, + 13, 13, 13, 13, 12, 13, 14, 13, 13, 13, + 13, 13, 14, 12, 13, 14, 14, 14, 14, 14, + 13, 14, 15, 14, 14, 14, 14, 14, 15, 13, + 14, 15, 15, 15, 15, 15, 14, 15, 16, 15, + 15, 15, 15, 15, 16, 14, 15, 16, 16, 16, + 16, 16, 15, 16, 17, 16, 16, 16, 16, 16, + 17, 15, 16, 17, 17, 17, 17, 17, 16, 17, + 18, 17, 17, 17, 17, 17, 18, 16, 17, 18, + 18, 18, 18, 18, 17, 18, 19, 18, 18, 18, + 18, 18, 19, 17, 18, 19, 19, 19, 19, 19, + 18, 19, 20, 19, 19, 19, 19, 19, 20, 18, + 19, 20, 20, 20, 20, 20, 19, 20, 21, 20, + 20, 20, 20, 20, 21, 19, 20, 21, 21, 21, + 21, 21, 20, 21, 22, 21, 21, 21, 21, 21, + 22, 20, 21, 22, 22, 22, 22, 22, 21, 22, + 23, 22, 22, 22, 22, 22, 23, 21, 22, 23, + 23, 23, 23, 23, 22, 23, 24, 23, 23, 23, + 23, 23, 24, 22, 23, 24, 24, 24, 24, 24, + 23, 24, 25, 24, 24, 24, 24, 24, 25, 23, + 24, 25, 25, 25, 25, 25, 24, 25, 26, 25, + 25, 25, 25, 25, 26, 24, 25, 26, 26, 26, + 26, 26, 25, 26, 27, 26, 26, 26, 26, 26, + 27, 25, 26, 27, 27, 27, 27, 27, 26, 27, + 28, 27, 27, 27, 27, 27, 28, 26, 27, 28, + 28, 28, 28, 28, 27, 28, 29, 28, 28, 28, + 28, 28, 29, 27, 28, 29, 29, 29, 29, 29, + 28, 29, 30, 29, 29, 29, 29, 29, 30, 28, + 29, 30, 30, 30, 30, 30, 29, 30, 31, 30, + 30, 30, 30, 30, 31, 29, 30, 31, 31, 31, + 31, 31, 30, 31, 32, 31, 31, 31, 31, 31, + 32, 30, 31, 32, 32, 32, 32, 32, 31, 32, + 33, 32, 32, 32, 32, 32, 33, 31, 32, 33, + 33, 33, 33, 33, 32, 33, 34, 33, 33, 33, + 33, 33, 34, 32, 33, +}; + +#endif /* __FSDITHER_H__ */ diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/main.c linux-2.4.18-pre9-logo/scripts/tologo/main.c --- linux-2.4.18-pre9/scripts/tologo/main.c Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/main.c Fri Feb 8 17:11:20 2002 @@ -0,0 +1,99 @@ +/* main.c + * Copyright (C) 2002 DindinX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#include +#include +#include + +#include "tologo.h" +#include "pnm.h" +#include "convert.h" +#include "write_logo.h" + +void +version(void) +{ + printf("tologo version 1.0.1 \n"); +} + +void +usage(void) +{ + printf("tologo \n"); + printf(" A command line utility to create linux_logo.h files.\n\n"); + printf(" It does color space reduction and dithering as required.\n"); + printf("Usage: \n"); + printf(" tologo [--version] [--help] logo_filename.ppm header_filename.h \n\n"); + printf(" \"logo_filename.ppm\" is the pathname of the input graphics file.\n"); + printf(" The input file must be in the ppm format.\n"); + printf(" See \"man 5 ppm\" for information on ppm.\n"); + printf(" The Gimp and other programs can save as ppm.\n"); + printf(" If saving from the Gimp, use the \"Raw\" option for ppm.\n\n"); + printf(" \"header_filename.h\" is the pathname of the output header file.\n"); + printf(" Any existing file at that location will be overwritten.\n\n"); + printf("Options: \n"); + printf(" --version show version and exit.\n"); + printf(" --help display this help and exit.\n\n"); + printf("Copyright: \n"); + printf(" tologo is copyright David Odin, and others.\n"); + printf(" It is released under the GPL.\n\n"); + exit(0); +} + +int +main(int argc, char *argv[]) +{ + int i; + char *in_file = NULL; + char *out_file = NULL; + LogoStruct *logo; + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "--version")) { + version(); + exit(0); + } else if (!strcmp(argv[i], "--help")) { + usage(); + } else { + if (!in_file) { + in_file = argv[i]; + } else if (!out_file) { + out_file = argv[i]; + } else + usage(); + } + } + + if (!out_file) + usage(); + + printf("converting %s -> %s\n", in_file, out_file); + + logo = load_image(in_file); + if (logo) { + ConvertLogo(logo, 224); + write_logo(logo, out_file); + } else + { + printf("loading %s failed.\n", in_file); + exit(-1); + } + + return 0; +} diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/pnm.c linux-2.4.18-pre9-logo/scripts/tologo/pnm.c --- linux-2.4.18-pre9/scripts/tologo/pnm.c Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/pnm.c Fri Feb 8 17:11:20 2002 @@ -0,0 +1,450 @@ +/* + * tologo + * Copyright (C) 2002 DindinX + * + * Most of this code is taken from the GIMP. + * The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * PNM reading and writing code Copyright (C) 1996 Erik Nygren + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * The pnm reading and writing code was written from scratch by Erik Nygren + * (nygren@mit.edu) based on the specifications in the man pages and + * does not contain any code from the netpbm or pbmplus distributions. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "tologo.h" + +typedef struct _PNMScanner { + int fd; /* The file descriptor of the file being read */ + char cur; /* The current character in the input stream */ + int eof; /* Have we reached end of file? */ + char *inbuf; /* Input buffer - initially 0 */ + int inbufsize; /* Size of input buffer */ + int inbufvalidsize; /* Size of input buffer with valid data */ + int inbufpos; /* Position in input buffer */ +} PNMScanner; + +typedef struct _PNMInfo { + int xres, yres; /* The size of the image */ + int maxval; /* For ascii image files, the max value + * which we need to normalize to */ + int np; /* Number of image planes (0 for pbm) */ + int asciibody; /* 1 if ascii body, 0 if raw body */ + jmp_buf jmpbuf; /* Where to jump to on an error loading */ + /* Routine to use to load the pnm body */ + void (*loader) (PNMScanner *, struct _PNMInfo *, LogoStruct *); +} PNMInfo; + +#define BUFLEN 512 /* The input buffer size for data returned + * from the scanner. Note that lines + * aren't allowed to be over 256 characters + * by the spec anyways so this shouldn't + * be an issue. */ + +static void pnm_load_ascii(PNMScanner * scan, + PNMInfo * info, LogoStruct * pixel_rgn); +static void pnm_load_raw(PNMScanner * scan, + PNMInfo * info, LogoStruct * pixel_rgn); +static void pnm_load_rawpbm(PNMScanner * scan, + PNMInfo * info, LogoStruct * pixel_rgn); + +static void pnmscanner_destroy(PNMScanner * s); +static void pnmscanner_createbuffer(PNMScanner * s, int bufsize); +static void pnmscanner_getchar(PNMScanner * s); +static void pnmscanner_eatwhitespace(PNMScanner * s); +static void pnmscanner_gettoken(PNMScanner * s, char *buf, int bufsize); +static void pnmscanner_getsmalltoken(PNMScanner * s, char *buf); + +static PNMScanner *pnmscanner_create(int fd); + +#define pnmscanner_eof(s) ((s)->eof) +#define pnmscanner_fd(s) ((s)->fd) + +/* Checks for a fatal error */ +#define CHECK_FOR_ERROR(predicate, jmpbuf, errmsg) \ + if ((predicate)) \ + { fprintf(stderr, (errmsg)); longjmp((jmpbuf),1); } + +static struct struct_pnm_types { + char name; + int np; + int asciibody; + int maxval; + void (*loader) (PNMScanner *, struct _PNMInfo *, + LogoStruct * pixel_rgn); +} pnm_types[] = { + { + '1', 0, 1, 1, pnm_load_ascii}, /* ASCII PBM */ + { + '2', 1, 1, 255, pnm_load_ascii}, /* ASCII PGM */ + { + '3', 3, 1, 255, pnm_load_ascii}, /* ASCII PPM */ + { + '4', 0, 0, 1, pnm_load_rawpbm}, /* RAW PBM */ + { + '5', 1, 0, 255, pnm_load_raw}, /* RAW PGM */ + { + '6', 3, 0, 255, pnm_load_raw}, /* RAW PPM */ + { + 0, 0, 0, 0, NULL} +}; + +LogoStruct * +load_image(char *filename) +{ + LogoStruct *pixel_rgn = NULL; + int fd; /* File descriptor */ + char buf[BUFLEN]; /* buffer for random things like scanning */ + PNMInfo *pnminfo; + PNMScanner *volatile scan; + int ctr; + + printf("Loading %s:\n", filename); + + /* open the file */ + fd = open(filename, O_RDONLY); + + if (fd == -1) { + fprintf(stderr, "PNM: Can't open file %s.", filename); + return NULL; + } + + /* allocate the necessary structures */ + pnminfo = malloc(sizeof (PNMInfo)); + + pixel_rgn = malloc(sizeof (LogoStruct)); + scan = NULL; + /* set error handling */ + if (setjmp(pnminfo->jmpbuf)) { + /* If we get here, we had a problem reading the file */ + if (scan) + pnmscanner_destroy(scan); + close(fd); + free(pnminfo); + if (pixel_rgn) + free(pixel_rgn); + return NULL; + } + + if (!(scan = pnmscanner_create(fd))) + longjmp(pnminfo->jmpbuf, 1); + + /* Get magic number */ + pnmscanner_gettoken(scan, buf, BUFLEN); + CHECK_FOR_ERROR(pnmscanner_eof(scan), pnminfo->jmpbuf, + "PNM: Premature end of file."); + CHECK_FOR_ERROR((buf[0] != 'P' || buf[2]), pnminfo->jmpbuf, + "PNM: Invalid file."); + + printf("magic number gotten: P%c\n", buf[1]); + /* Look up magic number to see what type of PNM this is */ + for (ctr = 0; pnm_types[ctr].name; ctr++) + if (buf[1] == pnm_types[ctr].name) { + pnminfo->np = pnm_types[ctr].np; + pnminfo->asciibody = pnm_types[ctr].asciibody; + pnminfo->maxval = pnm_types[ctr].maxval; + pnminfo->loader = pnm_types[ctr].loader; + } + if (!pnminfo->loader) { + fprintf(stderr, "PNM: File not in a supported format."); + longjmp(pnminfo->jmpbuf, 1); + } + + pnmscanner_gettoken(scan, buf, BUFLEN); + CHECK_FOR_ERROR(pnmscanner_eof(scan), pnminfo->jmpbuf, + "PNM: Premature end of file."); + pnminfo->xres = isdigit(*buf) ? atoi(buf) : 0; + CHECK_FOR_ERROR(pnminfo->xres <= 0, pnminfo->jmpbuf, + "PNM: Invalid X resolution."); + + pnmscanner_gettoken(scan, buf, BUFLEN); + CHECK_FOR_ERROR(pnmscanner_eof(scan), pnminfo->jmpbuf, + "PNM: Premature end of file."); + pnminfo->yres = isdigit(*buf) ? atoi(buf) : 0; + CHECK_FOR_ERROR(pnminfo->yres <= 0, pnminfo->jmpbuf, + "PNM: Invalid Y resolution."); + + printf("res: (%d, %d)\n", pnminfo->xres, pnminfo->yres); + pixel_rgn->width = pnminfo->xres; + pixel_rgn->height = pnminfo->yres; + pixel_rgn->rgb_data = malloc(3 * pixel_rgn->width * pixel_rgn->height); + pixel_rgn->image = malloc(pixel_rgn->width * pixel_rgn->height); + memset(pixel_rgn->rgb_data, 0, + 3 * pixel_rgn->width * pixel_rgn->height); + if (pnminfo->np != 0) { /* pbm's don't have a maxval field */ + pnmscanner_gettoken(scan, buf, BUFLEN); + CHECK_FOR_ERROR(pnmscanner_eof(scan), pnminfo->jmpbuf, + "PNM: Premature end of file."); + + pnminfo->maxval = isdigit(*buf) ? atoi(buf) : 0; + CHECK_FOR_ERROR(((pnminfo->maxval <= 0) + || (pnminfo->maxval > 255 + && !pnminfo->asciibody)), pnminfo->jmpbuf, + "PNM: Invalid maximum value."); + } + + pnminfo->loader(scan, pnminfo, pixel_rgn); + + /* Destroy the scanner */ + pnmscanner_destroy(scan); + + /* free the structures */ + free(pnminfo); + + /* close the file */ + close(fd); + + return pixel_rgn; +} + +static void +pnm_load_ascii(PNMScanner * scan, PNMInfo * info, LogoStruct * pixel_rgn) +{ + unsigned char *d; + int x, y, b; + int np; + char buf[BUFLEN]; + + np = (info->np) ? (info->np) : 1; + + /* Buffer reads to increase performance */ + pnmscanner_createbuffer(scan, 4096); + + for (y = 0; y < info->yres; y++) { + d = pixel_rgn->rgb_data + 3 * y * pixel_rgn->width; + + for (x = 0; x < info->xres; x++) { + for (b = 0; b < np; b++) { + /* Truncated files will just have all 0's at the end of the images */ + CHECK_FOR_ERROR(pnmscanner_eof(scan), + info->jmpbuf, + "PNM: Premature end of file."); + if (info->np) + pnmscanner_gettoken(scan, buf, BUFLEN); + else + pnmscanner_getsmalltoken(scan, buf); + switch (info->maxval) { + case 255: + d[b] = isdigit(*buf) ? atoi(buf) : 0; + break; + case 1: + d[b] = (*buf == '0') ? 0xff : 0x00; + break; + default: + d[b] = (unsigned char) + (255.0 * (((double) (isdigit(*buf) ? atoi(buf) : 0)) + / (double) (info-> maxval))); + } + } + d += np; + } + } +} + +static void +pnm_load_raw(PNMScanner * scan, PNMInfo * info, LogoStruct * pixel_rgn) +{ + unsigned char *d; + int x, y; + int fd; + + printf("loading raw pnm (maxval=%d)\n", info->maxval); + fd = pnmscanner_fd(scan); + + for (y = 0; y < info->yres; y++) { + d = pixel_rgn->rgb_data + 3 * y * pixel_rgn->width; + + CHECK_FOR_ERROR((info->xres * info->np + != read(fd, d, info->xres * info->np)), + info->jmpbuf, "PNM: Premature end of file."); + + if (info->maxval != 255) { /* Normalize if needed */ + for (x = 0; x < info->xres * info->np; x++) + d[x] = + (unsigned char) (255.0 * (double) (d[x]) / + (double) (info->maxval)); + } + } +} + +static void +pnm_load_rawpbm(PNMScanner * scan, PNMInfo * info, LogoStruct * pixel_rgn) +{ + unsigned char *buf; + unsigned char curbyte; + unsigned char *d; + int x, y; + int fd; + int rowlen, bufpos; + + fd = pnmscanner_fd(scan); + rowlen = info->xres / 8; + if (info->xres % 8) + rowlen++; + buf = malloc(sizeof (unsigned char) * rowlen); + + for (y = 0; y < info->yres; y++) { + d = pixel_rgn->rgb_data + 3 * y * pixel_rgn->width; + + CHECK_FOR_ERROR((rowlen != read(fd, buf, rowlen)), + info->jmpbuf, "PNM: Error reading file."); + bufpos = 0; + curbyte = buf[0]; + + for (x = 0; x < info->xres; x++) { + if ((x % 8) == 0) + curbyte = buf[bufpos++]; + d[3 * x] = (curbyte & 0x80) ? 0x00 : 0xff; + d[3 * x + 1] = d[3 * x]; + d[3 * x + 2] = d[3 * x]; + curbyte <<= 1; + } + } + free(buf); +} + +/**************** FILE SCANNER UTILITIES **************/ + +/* pnmscanner_create --- + * Creates a new scanner based on a file descriptor. The + * look ahead buffer is one character initially. + */ +static PNMScanner * +pnmscanner_create(int fd) +{ + PNMScanner *s; + + s = malloc(sizeof (PNMScanner)); + s->fd = fd; + s->inbuf = 0; + s->eof = !read(s->fd, &(s->cur), 1); + return (s); +} + +/* pnmscanner_destroy --- + * Destroys a scanner and its resources. Doesn't close the fd. + */ +static void +pnmscanner_destroy(PNMScanner * s) +{ + if (s->inbuf) + free(s->inbuf); + free(s); +} + +/* pnmscanner_createbuffer --- + * Creates a buffer so we can do buffered reads. + */ +static void +pnmscanner_createbuffer(PNMScanner * s, int bufsize) +{ + s->inbuf = malloc(sizeof (char) * bufsize); + s->inbufsize = bufsize; + s->inbufpos = 0; + s->inbufvalidsize = read(s->fd, s->inbuf, bufsize); +} + +/* pnmscanner_gettoken --- + * Gets the next token, eating any leading whitespace. + */ +static void +pnmscanner_gettoken(PNMScanner * s, char *buf, int bufsize) +{ + int ctr = 0; + + pnmscanner_eatwhitespace(s); + while (!(s->eof) && !isspace(s->cur) && (s->cur != '#') + && (ctr < bufsize)) { + buf[ctr++] = s->cur; + pnmscanner_getchar(s); + } + buf[ctr] = '\0'; +} + +/* pnmscanner_getsmalltoken --- + * Gets the next char, eating any leading whitespace. + */ +static void +pnmscanner_getsmalltoken(PNMScanner * s, char *buf) +{ + pnmscanner_eatwhitespace(s); + if (!(s->eof) && !isspace(s->cur) && (s->cur != '#')) { + *buf = s->cur; + pnmscanner_getchar(s); + } +} + +/* pnmscanner_getchar --- + * Reads a character from the input stream + */ +static void +pnmscanner_getchar(PNMScanner * s) +{ + if (s->inbuf) { + s->cur = s->inbuf[s->inbufpos++]; + if (s->inbufpos >= s->inbufvalidsize) { + if (s->inbufsize > s->inbufvalidsize) + s->eof = 1; + else + s->inbufvalidsize = + read(s->fd, s->inbuf, s->inbufsize); + s->inbufpos = 0; + } + } else + s->eof = !read(s->fd, &(s->cur), 1); +} + +/* pnmscanner_eatwhitespace --- + * Eats up whitespace from the input and returns when done or eof. + * Also deals with comments. + */ +static void +pnmscanner_eatwhitespace(PNMScanner * s) +{ + int state = 0; + + while (!(s->eof) && (state != -1)) { + switch (state) { + case 0: /* in whitespace */ + if (s->cur == '#') { + state = 1; /* goto comment */ + pnmscanner_getchar(s); + } else if (!isspace(s->cur)) + state = -1; + else + pnmscanner_getchar(s); + break; + + case 1: /* in comment */ + if (s->cur == '\n') + state = 0; /* goto whitespace */ + pnmscanner_getchar(s); + break; + } + } +} diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/pnm.h linux-2.4.18-pre9-logo/scripts/tologo/pnm.h --- linux-2.4.18-pre9/scripts/tologo/pnm.h Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/pnm.h Fri Feb 8 17:11:20 2002 @@ -0,0 +1,20 @@ +/* pnm.h + * Copyright (C) 2002 DindinX + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +LogoStruct *load_image(char *filename); diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/tologo.h linux-2.4.18-pre9-logo/scripts/tologo/tologo.h --- linux-2.4.18-pre9/scripts/tologo/tologo.h Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/tologo.h Fri Feb 8 17:11:20 2002 @@ -0,0 +1,29 @@ +/* tologo.h + * Copyright (C) 2002 DindinX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +typedef struct LogoStruct +{ + unsigned char *image; + unsigned char *Cmap_red; + unsigned char *Cmap_green; + unsigned char *Cmap_blue; + unsigned char *rgb_data; + unsigned int width, height; + unsigned int NbCols; +} LogoStruct; + diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/write_logo.c linux-2.4.18-pre9-logo/scripts/tologo/write_logo.c --- linux-2.4.18-pre9/scripts/tologo/write_logo.c Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/write_logo.c Fri Feb 8 17:11:20 2002 @@ -0,0 +1,613 @@ +/* write_logo.c + * Copyright (C) 2002 DindinX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include + +#include "tologo.h" +#include "write_logo.h" + +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) + +void +write_logo(LogoStruct * logo, char *out_file) +{ + FILE *file; + int i, j; + + file = fopen(out_file, "w"); + if (file) { + fprintf(file, "/*\n" + " * include/linux/linux_logo.h: This is a linux logo\n" + " * to be displayed on boot.\n" + " *\n" + " * This file has been generated. Do not edit.\n" + " */\n" + "\n" + "#ifndef __HAVE_ARCH_LINUX_LOGO\n" + "#define LINUX_LOGO_COLORS %d\n" + "#endif\n" + "\n" + "#ifdef INCLUDE_LINUX_LOGO_DATA\n" + "\n" + "#ifndef __HAVE_ARCH_LINUX_LOGO\n" + "\n" + "#define LOGO_W (%d)\n" + "#define LOGO_H (%d)\n" + "\n" + "unsigned char linux_logo_red[] __initdata = {\n", + logo->NbCols, logo->width, logo->height); + for (i = 0; i < 256; i += 8) { + fprintf(file, " "); + for (j = 0; j < 8; j++) { + fprintf(file, " 0x%02x", logo->Cmap_red[i + j]); + if (i + j != 255) + fprintf(file, ","); + } + fprintf(file, "\n"); + } + fprintf(file, + "};\n\nunsigned char linux_logo_green[] __initdata = {\n"); + for (i = 0; i < 256; i += 8) { + fprintf(file, " "); + for (j = 0; j < 8; j++) { + fprintf(file, " 0x%02x", + logo->Cmap_green[i + j]); + if (i + j != 255) + fprintf(file, ","); + } + fprintf(file, "\n"); + } + fprintf(file, + "};\n\nunsigned char linux_logo_blue[] __initdata = {\n"); + for (i = 0; i < 256; i += 8) { + fprintf(file, " "); + for (j = 0; j < 8; j++) { + fprintf(file, " 0x%02x", + logo->Cmap_blue[i + j]); + if (i + j != 255) + fprintf(file, ","); + } + fprintf(file, "\n"); + } + fprintf(file, + "};\n\nunsigned char linux_logo[] __initdata = {\n"); + for (i = 0; i < logo->width * logo->height; i += 8) { + fprintf(file, " "); + for (j = 0; j < MIN(8, logo->width * logo->height - i); + j++) { + fprintf(file, " 0x%02x", + 32 + logo->image[i + j]); + if (i + j != logo->width * logo->height - 1) + fprintf(file, ","); + } + fprintf(file, "\n"); + } + fprintf(file, "};\n\n" + "#endif /* !__HAVE_ARCH_LINUX_LOGO */\n" + "\n" + "#ifndef __HAVE_ARCH_LINUX_LOGOBW\n" + "\n" + "unsigned char linux_logo_bw[] __initdata = {\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xbf, 0xfc, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfd, 0xff, 0xf3, 0xdf, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfd, 0xff, 0xf7, 0xef, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x9f, 0x87, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x0f, 0x03, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x67, 0x33, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xe7, 0x79, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xf7, 0x79, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xff, 0xf9, 0xf7, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x60, 0x3b, 0xf7, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x89, 0x07, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x00, 0x03, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x00, 0x0d, 0xfb, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x80, 0x33, 0xfd, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xc0, 0xc3, 0xfd, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0xff, 0x0d, 0xdd, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xfb, 0x40, 0x31, 0xee, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf7, 0x20, 0xc1, 0xee, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf7, 0x1f, 0x00, 0xff, 0x7f, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xef, 0x00, 0x00, 0x7f, 0xbf, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x7f, 0xbf, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xde, 0x00, 0x00, 0x7f, 0xdf, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x3f, 0xef, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0x7c, 0x00, 0x00, 0x3f, 0xf7, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0x7c, 0x00, 0x00, 0x1f, 0xf7, 0xff, 0xff,\n" + " 0xff, 0xff, 0xfe, 0xff, 0x1c, 0x07, 0xdf, 0xfb, 0xff, 0xff,\n" + " 0xff, 0xff, 0xfd, 0xfc, 0x08, 0x0f, 0xef, 0xfd, 0xff, 0xff,\n" + " 0xff, 0xff, 0xfd, 0xf8, 0x00, 0x01, 0xef, 0xfd, 0xff, 0xff,\n" + " 0xff, 0xff, 0xfb, 0xf0, 0x00, 0x00, 0x7f, 0xfe, 0xff, 0xff,\n" + " 0xff, 0xff, 0xfb, 0xe0, 0x00, 0x00, 0x1f, 0xfe, 0xff, 0xff,\n" + " 0xff, 0xff, 0xf7, 0xe0, 0x00, 0x00, 0x07, 0xbf, 0x7f, 0xff,\n" + " 0xff, 0xff, 0xf7, 0xc0, 0x00, 0x00, 0x03, 0xbf, 0x7f, 0xff,\n" + " 0xff, 0xff, 0xef, 0xc0, 0x00, 0x00, 0x03, 0xdf, 0xbf, 0xff,\n" + " 0xff, 0xff, 0xef, 0x80, 0x00, 0x00, 0x03, 0xdf, 0xbf, 0xff,\n" + " 0xff, 0xff, 0xdf, 0x80, 0x00, 0x00, 0x03, 0xdf, 0xbf, 0xff,\n" + " 0xff, 0xff, 0xdf, 0x80, 0x00, 0x00, 0x01, 0xef, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xdf, 0x80, 0x00, 0x00, 0x01, 0xef, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xbf, 0x00, 0x20, 0x00, 0x01, 0xef, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xbf, 0x00, 0x20, 0x00, 0x01, 0xef, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xbf, 0x00, 0x20, 0x00, 0x01, 0xef, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xbf, 0x00, 0x20, 0x00, 0x01, 0xef, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xbf, 0x00, 0x20, 0x00, 0x03, 0x03, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xbf, 0x00, 0x20, 0x00, 0x02, 0xfd, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xa3, 0x80, 0x00, 0x00, 0x1f, 0xff, 0xdf, 0xff,\n" + " 0xff, 0xff, 0xc1, 0xc0, 0x00, 0x00, 0x11, 0xff, 0x3f, 0xff,\n" + " 0xff, 0xff, 0x80, 0xe0, 0x00, 0x00, 0x21, 0xfe, 0x3f, 0xff,\n" + " 0xff, 0xff, 0x00, 0x70, 0x00, 0x00, 0x21, 0xfc, 0x3f, 0xff,\n" + " 0xff, 0xfe, 0x00, 0x3c, 0x00, 0x00, 0x20, 0xf8, 0x3f, 0xff,\n" + " 0xff, 0xf0, 0x00, 0x3e, 0x00, 0x00, 0x20, 0x00, 0x3f, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x1f, 0x00, 0x00, 0x20, 0x00, 0x3f, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x1f, 0x80, 0x00, 0x20, 0x00, 0x1f, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x0f, 0x80, 0x00, 0x20, 0x00, 0x07, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x07, 0x80, 0x00, 0x20, 0x00, 0x03, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x07, 0x80, 0x00, 0x60, 0x00, 0x01, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x02, 0x00, 0x00, 0xe0, 0x00, 0x01, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x01, 0x00, 0x01, 0xe0, 0x00, 0x01, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x00, 0x03, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x00, 0x80, 0x3f, 0xe0, 0x00, 0x0f, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x00, 0x7f, 0xff, 0xc0, 0x00, 0x1f, 0xff,\n" + " 0xff, 0xc0, 0x00, 0x00, 0x7f, 0xff, 0xc0, 0x00, 0x7f, 0xff,\n" + " 0xff, 0xe0, 0x00, 0x00, 0x7f, 0xff, 0xc0, 0x00, 0xff, 0xff,\n" + " 0xff, 0xfc, 0x00, 0x00, 0x7f, 0xff, 0xc0, 0x03, 0xff, 0xff,\n" + " 0xff, 0xff, 0xc0, 0x00, 0x70, 0x00, 0xc0, 0x07, 0xff, 0xff,\n" + " 0xff, 0xff, 0xfc, 0x00, 0x8f, 0xff, 0x20, 0x0f, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + "};\n" + "\n" + "#endif /* !__HAVE_ARCH_LINUX_LOGOBW */\n" + "\n" + "#ifndef __HAVE_ARCH_LINUX_LOGO16\n" + "\n" + "unsigned char linux_logo16[] __initdata = {\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x88, 0x80, 0x00, 0x00, 0x08, 0x88, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,\n" + " 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x80,\n" + " 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x08, 0x70, 0x00, 0x00, 0x00, 0x77, 0x70, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x87, 0x77, 0x00, 0x00, 0x07, 0xff, 0xf7, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,\n" + " 0x77, 0xff, 0x00, 0x00, 0x7f, 0x77, 0xf7, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,\n" + " 0x70, 0x0f, 0x80, 0x00, 0xf7, 0x08, 0x7f, 0x70,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,\n" + " 0x80, 0x07, 0x80, 0x00, 0xf8, 0x00, 0x8f, 0x70,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,\n" + " 0x70, 0x07, 0x88, 0x88, 0xf8, 0x00, 0x8f, 0x70,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0xf0, 0x06, 0xe6, 0xe6, 0xe6, 0x00, 0x8f, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x77, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x77, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x06, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0x00,\n" + " 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x60,\n" + " 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0x60,\n" + " 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x66, 0x66, 0x80,\n" + " 0x08, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80,\n" + " 0x86, 0xe6, 0xe6, 0xe6, 0x66, 0x66, 0x66, 0x80,\n" + " 0x08, 0x78, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80,\n" + " 0x86, 0x66, 0x66, 0x66, 0x66, 0x66, 0x77, 0x70,\n" + " 0x00, 0x77, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x87, 0x66, 0x66, 0x66, 0x66, 0x77, 0x77, 0x78,\n" + " 0x00, 0x88, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x87, 0x76, 0x66, 0x66, 0x77, 0x77, 0xff, 0xf7,\n" + " 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08,\n" + " 0xff, 0x77, 0x77, 0x77, 0x77, 0xff, 0xff, 0xff,\n" + " 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,\n" + " 0xff, 0x77, 0x77, 0x77, 0x7f, 0xff, 0xff, 0xff,\n" + " 0x70, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x8f,\n" + " 0xff, 0xf7, 0x77, 0x77, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf0, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08, 0x7f,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf7, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x87, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x77,\n" + " 0xff, 0xf7, 0x77, 0xff, 0xff, 0xff, 0x77, 0x77,\n" + " 0x77, 0x78, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x77, 0x7f,\n" + " 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x77,\n" + " 0x77, 0x78, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x7f, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf7, 0x77, 0x00, 0x08, 0x80, 0x00, 0x00, 0x80,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x80, 0x80, 0x08, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x77, 0x80, 0x00, 0x08, 0x00, 0x00, 0x08,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x08, 0x00, 0x80, 0x07, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0x78, 0x00, 0x08, 0x80, 0x00, 0x08,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x08, 0x08, 0x00, 0x8f, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xf7, 0x08, 0x80, 0x80, 0x00, 0x08,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x08, 0x08, 0x08, 0x7f, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xf7, 0x08, 0x80, 0x80, 0x00, 0x00,\n" + " 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x80, 0x08, 0x07, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0x80, 0x00, 0x08, 0x00, 0x00,\n" + " 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x80, 0x80, 0x0f, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0x70, 0x00, 0x08, 0x00, 0x00,\n" + " 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x08, 0x00, 0x80, 0x8f, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0x70, 0x00, 0x08, 0x00, 0x00,\n" + " 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x08, 0x08, 0x00, 0x7f, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0x70, 0x00, 0x08, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x80, 0x08, 0x00, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf0, 0x00, 0x08, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x08, 0x00, 0x08, 0x00, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf0, 0x00, 0x08, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x08, 0x00, 0x08, 0x08, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf0, 0x00, 0x08, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x08, 0x00, 0x08, 0x08, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf0, 0x00, 0x08, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x88, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf0, 0x00, 0x08, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x08, 0x00, 0x00, 0x08, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf0, 0x88, 0x88, 0x80, 0x00,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x08, 0x06, 0xe6, 0x00, 0x8f, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x08, 0x80,\n" + " 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x6e, 0x6e, 0x60, 0x08, 0xff, 0xff, 0xff,\n" + " 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xff, 0xe6, 0xe0, 0x00, 0x00, 0x00, 0x88,\n" + " 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x06, 0xe6, 0xe6, 0xe6, 0x00, 0x8f, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xfe, 0x6e, 0x60, 0x00, 0x00, 0x00, 0x00,\n" + " 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x60, 0x08, 0xff, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xf6, 0xe6, 0xe0, 0x00, 0x00, 0x00, 0x06,\n" + " 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe0, 0x00, 0x8f, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0xfe, 0x6e, 0x60, 0x00, 0x00, 0x00, 0x0e,\n" + " 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x00, 0x08, 0xff,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xff, 0x76, 0xe6, 0xe6, 0x00, 0x00, 0x00, 0xe6,\n" + " 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe0, 0x00, 0x8f,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf7, 0x7e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x60, 0x00, 0x08,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf7, 0x76, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0x00, 0x00,\n" + " 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf7, 0x7e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x60, 0x00,\n" + " 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf7, 0x76, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe0, 0x00,\n" + " 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0xf7, 0x8e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x88,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n" + " 0x78, 0x86, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xef,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7,\n" + " 0x80, 0x06, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e,\n" + " 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78,\n" + " 0x00, 0x06, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe0, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x80,\n" + " 0x00, 0x06, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x0e, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x66,\n" + " 0x67, 0xff, 0xff, 0xff, 0xff, 0x78, 0x80, 0x00,\n" + " 0x00, 0x86, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x06, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x86, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e,\n" + " 0x66, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x0e, 0x6e, 0x6e, 0x6e,\n" + " 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x66,\n" + " 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x86, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xe6, 0xe6,\n" + " 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,\n" + " 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x86, 0x6e, 0x6e, 0x6e, 0x6e, 0x66, 0x66,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66,\n" + " 0x66, 0x66, 0x6e, 0x6e, 0x6e, 0x6e, 0x6e, 0x66,\n" + " 0x60, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x80,\n" + " 0x00, 0x06, 0x66, 0xe6, 0xe6, 0xe6, 0x66, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x66, 0x66, 0x66, 0x66, 0xe6, 0xe6, 0x66,\n" + " 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,\n" + " 0x88, 0x86, 0x66, 0x6e, 0x6e, 0x66, 0x60, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x06, 0x66, 0x66, 0x66, 0x66,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x06, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x06, 0x66, 0x66, 0x60,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x66, 0x66, 0x66, 0x60, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n" + "};\n" + "\n" + "#endif /* !__HAVE_ARCH_LINUX_LOGO16 */\n" + "\n" + "#else /* !INCLUDE_LINUX_LOGO_DATA */\n" + "\n" + "/* prototypes only */\n" + "extern unsigned char linux_logo_red[];\n" + "extern unsigned char linux_logo_green[];\n" + "extern unsigned char linux_logo_blue[];\n" + "extern unsigned char linux_logo[];\n" + "extern unsigned char linux_logo_bw[];\n" + "extern unsigned char linux_logo16[];\n" + "\n" "#endif /* !INCLUDE_LINUX_LOGO_DATA */\n"); + fclose(file); + } else { + printf("cannot open %s for writing.\n", out_file); + exit(-1); + } +} diff -urN -X dontdiff linux-2.4.18-pre9/scripts/tologo/write_logo.h linux-2.4.18-pre9-logo/scripts/tologo/write_logo.h --- linux-2.4.18-pre9/scripts/tologo/write_logo.h Wed Dec 31 16:00:00 1969 +++ linux-2.4.18-pre9-logo/scripts/tologo/write_logo.h Fri Feb 8 17:11:20 2002 @@ -0,0 +1,19 @@ +/* write_logo.h + * Copyright (C) 2002 DindinX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +void write_logo(LogoStruct * logo, char *out_file);