00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "filters.h"
00016 #include "graphic.h"
00017 #include "goom_tools.h"
00018 #include <stdlib.h>
00019 #include <math.h>
00020 #include <stdio.h>
00021 #include <inttypes.h>
00022
00023 #ifdef MMX
00024 #define USE_ASM
00025 #endif
00026 #ifdef POWERPC
00027 #define USE_ASM
00028 #endif
00029
00030 #define EFFECT_DISTORS 4
00031 #define EFFECT_DISTORS_SL 2
00032
00033 extern volatile guint32 resolx;
00034 extern volatile guint32 c_resoly;
00035
00036 void c_zoom (unsigned int *expix1, unsigned int *expix2, unsigned int prevX, unsigned int prevY, signed int *brutS, signed int *brutD);
00037
00038 #ifdef MMX
00039
00040 void zoom_filter_xmmx (int prevX, int prevY, unsigned int *expix1, unsigned int *expix2, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]);
00041 int zoom_filter_xmmx_supported ();
00042 void zoom_filter_mmx (int prevX, int prevY, unsigned int *expix1, unsigned int *expix2, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]);
00043 int zoom_filter_mmx_supported ();
00044
00045 static int zf_use_xmmx = 0;
00046 static int zf_use_mmx = 0;
00047
00048 static void select_zoom_filter () {
00049 static int firsttime = 1;
00050 if (firsttime){
00051 if (zoom_filter_xmmx_supported()) {
00052 zf_use_xmmx = 1;
00053 printf ("Extended MMX detected. Using the fastest method !\n");
00054 }
00055 else if (zoom_filter_mmx_supported()) {
00056 zf_use_mmx = 1;
00057 printf ("MMX detected. Using fast method !\n");
00058 }
00059 else {
00060 printf ("Too bad ! No MMX detected.\n");
00061 }
00062 firsttime = 0;
00063 }
00064 }
00065
00066 #else
00067
00068 static void select_zoom_filter () {
00069 static int firsttime = 1;
00070 if (firsttime) {
00071 printf ("No MMX support compiled in\n");
00072 firsttime = 0;
00073 }
00074 }
00075
00076 #endif
00077
00078
00079 guint32 mmx_zoom_size;
00080
00081 #ifdef USE_ASM
00082
00083 #ifdef POWERPC
00084 #include "altivec.h"
00085 extern unsigned int useAltivec;
00086 extern const void ppc_zoom (unsigned int *frompixmap, unsigned int *topixmap, unsigned int sizex, unsigned int sizey, unsigned int *brutS, unsigned int *brutD, unsigned int buffratio, int precalCoef[16][16]);
00087
00088 #endif
00089
00090 #endif
00091
00092
00093 unsigned int *coeffs = 0, *freecoeffs = 0;
00094
00095 signed int *brutS = 0, *freebrutS = 0;
00096 signed int *brutD = 0, *freebrutD = 0;
00097 signed int *brutT = 0, *freebrutT = 0;
00098
00099
00100 guint32 *expix1 = 0;
00101 guint32 *expix2 = 0;
00102
00103
00104 guint32 zoom_width;
00105
00106 unsigned int prevX = 0, prevY = 0;
00107
00108 static int sintable[0x10000];
00109 static int vitesse = 127;
00110 static char theMode = AMULETTE_MODE;
00111 static int waveEffect = 0;
00112 static int hypercosEffect = 0;
00113 static int vPlaneEffect = 0;
00114 static int hPlaneEffect = 0;
00115 static char noisify = 2;
00116 static int middleX, middleY;
00117
00118
00119
00121
00122 int buffratio = 0;
00123
00124 #define BUFFPOINTNB 16
00125 #define BUFFPOINTMASK 0xffff
00126 #define BUFFINCR 0xff
00127
00128 #define sqrtperte 16
00129
00130 #define PERTEMASK 0xf
00131
00132 #define PERTEDEC 4
00133
00134 static int *firedec = 0;
00135
00136
00137
00138 #define ShiftRight(_x,_s) (((_x)<0) ? -(-(_x)>>(_s)) : ((_x)>>(_s)))
00139
00141 int precalCoef[16][16];
00142
00143
00144 void generatePrecalCoef (void);
00145 void calculatePXandPY (int x, int y, int *px, int *py);
00146 void setPixelRGB (Uint * buffer, Uint x, Uint y, Color c);
00147 void setPixelRGB_ (Uint * buffer, Uint x, Color c);
00148 inline void getPixelRGB (Uint * buffer, Uint x, Uint y, Color * c);
00149 void getPixelRGB_ (Uint * buffer, Uint x, Color * c);
00150
00151 void
00152 generatePrecalCoef ()
00153 {
00154 static int firstime = 1;
00155
00156 if (firstime) {
00157 int coefh, coefv;
00158
00159 firstime = 0;
00160
00161 for (coefh = 0; coefh < 16; coefh++) {
00162
00163 for (coefv = 0; coefv < 16; coefv++) {
00164 int i;
00165 int diffcoeffh;
00166 int diffcoeffv;
00167
00168 diffcoeffh = sqrtperte - coefh;
00169 diffcoeffv = sqrtperte - coefv;
00170
00171
00172
00173 if (!(coefh || coefv))
00174 i = 255;
00175 else {
00176 int i1, i2, i3, i4;
00177
00178 i1 = diffcoeffh * diffcoeffv;
00179 i2 = coefh * diffcoeffv;
00180 i3 = diffcoeffh * coefv;
00181 i4 = coefh * coefv;
00182 if (i1)
00183 i1--;
00184 if (i2)
00185 i2--;
00186 if (i3)
00187 i3--;
00188 if (i4)
00189 i4--;
00190
00191 i = (i1) | (i2 << 8) | (i3 << 16) | (i4 << 24);
00192 }
00193 precalCoef[coefh][coefv] = i;
00194 }
00195 }
00196 }
00197 }
00198
00199
00200
00201
00202
00203
00204 void
00205 calculatePXandPY (int x, int y, int *px, int *py)
00206 {
00207 if (theMode == WATER_MODE) {
00208 static int wave = 0;
00209 static int wavesp = 0;
00210 int yy;
00211
00212 yy = y + RAND () % 4 - RAND () % 4 + wave / 10;
00213 if (yy < 0)
00214 yy = 0;
00215 if (yy >= (int)c_resoly)
00216 yy = c_resoly - 1;
00217
00218 *px = (x << 4) + firedec[yy] + (wave / 10);
00219 *py = (y << 4) + 132 - ((vitesse < 131) ? vitesse : 130);
00220
00221 wavesp += RAND () % 3 - RAND () % 3;
00222 if (wave < -10)
00223 wavesp += 2;
00224 if (wave > 10)
00225 wavesp -= 2;
00226 wave += (wavesp / 10) + RAND () % 3 - RAND () % 3;
00227 if (wavesp > 100)
00228 wavesp = (wavesp * 9) / 10;
00229 }
00230 else {
00231 int dist = 0, vx9, vy9;
00232 int vx, vy;
00233 int ppx, ppy;
00234 int fvitesse = vitesse << 4;
00235
00236 if (noisify) {
00237 x += RAND () % noisify - RAND () % noisify;
00238 y += RAND () % noisify - RAND () % noisify;
00239 }
00240 vx = (x - middleX) << 9;
00241 vy = (y - middleY) << 9;
00242
00243 if (hPlaneEffect)
00244 vx += hPlaneEffect * (y - middleY);
00245
00246
00247 if (vPlaneEffect)
00248 vy += vPlaneEffect * (x - middleX);
00249
00250
00251 if (waveEffect) {
00252 fvitesse *=
00253 1024 +
00254 ShiftRight (sintable
00255 [(unsigned short) (dist * 0xffff + EFFECT_DISTORS)], 6);
00256 fvitesse /= 1024;
00257 }
00258
00259 if (hypercosEffect) {
00260 vx += ShiftRight (sintable[(-vy + dist) & 0xffff], 1);
00261 vy += ShiftRight (sintable[(vx + dist) & 0xffff], 1);
00262 }
00263
00264 vx9 = ShiftRight (vx, 9);
00265 vy9 = ShiftRight (vy, 9);
00266 dist = vx9 * vx9 + vy9 * vy9;
00267
00268 switch (theMode) {
00269 case WAVE_MODE:
00270 fvitesse *=
00271 1024 +
00272 ShiftRight (sintable
00273 [(unsigned short) (dist * 0xffff * EFFECT_DISTORS)], 6);
00274 fvitesse>>=10;
00275 break;
00276 case CRYSTAL_BALL_MODE:
00277 fvitesse += (dist >> (10-EFFECT_DISTORS_SL));
00278 break;
00279 case AMULETTE_MODE:
00280 fvitesse -= (dist >> (4 - EFFECT_DISTORS_SL));
00281 break;
00282 case SCRUNCH_MODE:
00283 fvitesse -= (dist >> (10 - EFFECT_DISTORS_SL));
00284 break;
00285 case HYPERCOS1_MODE:
00286 vx = vx + ShiftRight (sintable[(-vy + dist) & 0xffff], 1);
00287 vy = vy + ShiftRight (sintable[(vx + dist) & 0xffff], 1);
00288 break;
00289 case HYPERCOS2_MODE:
00290 vx =
00291 vx + ShiftRight (sintable[(-ShiftRight (vy, 1) + dist) & 0xffff], 0);
00292 vy =
00293 vy + ShiftRight (sintable[(ShiftRight (vx, 1) + dist) & 0xffff], 0);
00294 fvitesse = 128 << 4;
00295 break;
00296 case YONLY_MODE:
00297 fvitesse *= 1024 + ShiftRight (sintable[vy & 0xffff], 6);
00298 fvitesse >>= 10;
00299 break;
00300 case SPEEDWAY_MODE:
00301 fvitesse -= (ShiftRight(vy,10-EFFECT_DISTORS_SL));
00302 break;
00303 }
00304
00305 if (fvitesse < -3024)
00306 fvitesse = -3024;
00307
00308 if (vx < 0)
00309 ppx = -(-(vx * fvitesse) >> 16);
00310
00311
00312 else
00313 ppx = ((vx * fvitesse) >> 16);
00314
00315 if (vy < 0)
00316 ppy = -(-(vy * fvitesse) >> 16);
00317 else
00318 ppy = ((vy * fvitesse) >> 16);
00319
00320 *px = (middleX << 4) + ppx;
00321 *py = (middleY << 4) + ppy;
00322 }
00323 }
00324
00325
00326
00327 void
00328 setPixelRGB (Uint * buffer, Uint x, Uint y, Color c)
00329 {
00330
00331 #ifdef _DEBUG_PIXEL
00332 if (x + y * resolx >= resolx * resoly) {
00333 fprintf (stderr, "setPixel ERROR : hors du tableau... %i, %i\n", x, y);
00334
00335 }
00336 #endif
00337
00338 buffer[y * resolx + x] =
00339 (c.b << (BLEU * 8)) | (c.v << (VERT * 8)) | (c.r << (ROUGE * 8));
00340 }
00341
00342
00343 void
00344 setPixelRGB_ (Uint * buffer, Uint x, Color c)
00345 {
00346 #ifdef _DEBUG
00347 if (x >= resolx * c_resoly) {
00348 printf ("setPixel ERROR : hors du tableau... %i\n", x);
00349
00350 }
00351 #endif
00352
00353 buffer[x] = (c.r << (ROUGE * 8)) | (c.v << (VERT * 8)) | c.b << (BLEU * 8);
00354 }
00355
00356
00357
00358 inline void
00359 getPixelRGB (Uint * buffer, Uint x, Uint y, Color * c)
00360 {
00361
00362 unsigned int i;
00363
00364 #ifdef _DEBUG
00365 if (x + y * resolx >= resolx * c_resoly) {
00366 printf ("getPixel ERROR : hors du tableau... %i, %i\n", x, y);
00367
00368 }
00369 #endif
00370
00371
00372 i = *(buffer + (x + y * resolx));
00373 c->b = (i >> (BLEU * 8)) & 0xff;
00374 c->v = (i >> (VERT * 8)) & 0xff;
00375 c->r = (i >> (ROUGE * 8)) & 0xff;
00376 }
00377
00378
00379 void
00380 getPixelRGB_ (Uint * buffer, Uint x, Color * c)
00381 {
00382 register unsigned char *tmp8;
00383
00384 #ifdef _DEBUG
00385 if (x >= resolx * c_resoly) {
00386 printf ("getPixel ERROR : hors du tableau... %i\n", x);
00387
00388 }
00389 #endif
00390
00391 #ifdef __BIG_ENDIAN__
00392 c->b = *(unsigned char *) (tmp8 = (unsigned char *) (buffer + x));
00393 c->r = *(unsigned char *) (++tmp8);
00394 c->v = *(unsigned char *) (++tmp8);
00395 c->b = *(unsigned char *) (++tmp8);
00396
00397 #else
00398
00399 c->b = *(unsigned char *) (tmp8 = (unsigned char *) (buffer + x));
00400 c->v = *(unsigned char *) (++tmp8);
00401 c->r = *(unsigned char *) (++tmp8);
00402
00403 #endif
00404 }
00405
00406
00407 void c_zoom (unsigned int *expix1, unsigned int *expix2, unsigned int prevX, unsigned int prevY, signed int *brutS, signed int *brutD)
00408 {
00409 int myPos, myPos2;
00410 Color couleur;
00411
00412
00413 unsigned int ax = (prevX - 1) << PERTEDEC, ay = (prevY - 1) << PERTEDEC;
00414
00415 int bufsize = prevX * prevY * 2;
00416 int bufwidth = prevX;
00417
00418 expix1[0]=expix1[prevX-1]=expix1[prevX*prevY-1]=expix1[prevX*prevY-prevX]=0;
00419
00420 for (myPos = 0; myPos < bufsize; myPos += 2) {
00421 Color col1, col2, col3, col4;
00422 int c1, c2, c3, c4, px, py;
00423 int pos;
00424 int coeffs;
00425
00426 int brutSmypos = brutS[myPos];
00427
00428 myPos2 = myPos + 1;
00429
00430 px = brutSmypos + (((brutD[myPos] - brutSmypos) * buffratio) >> BUFFPOINTNB);
00431 brutSmypos = brutS[myPos2];
00432 py = brutSmypos + (((brutD[myPos2] - brutSmypos) * buffratio) >> BUFFPOINTNB);
00433
00434 if (px < 0)
00435 px = 0;
00436 if (py < 0)
00437 py = 0;
00438
00439 pos = ((px >> PERTEDEC) + prevX * (py >> PERTEDEC));
00440
00441 coeffs = precalCoef[px & PERTEMASK][py & PERTEMASK];
00442
00443 if ((py >= (int)ay) || (px >= (int)ax)) {
00444 pos = coeffs = 0;
00445 }
00446
00447 getPixelRGB_ (expix1, pos, &col1);
00448 getPixelRGB_ (expix1, pos + 1, &col2);
00449 getPixelRGB_ (expix1, pos + bufwidth, &col3);
00450 getPixelRGB_ (expix1, pos + bufwidth + 1, &col4);
00451
00452 c1 = coeffs;
00453 c2 = (c1 & 0x0000ff00) >> 8;
00454 c3 = (c1 & 0x00ff0000) >> 16;
00455 c4 = (c1 & 0xff000000) >> 24;
00456 c1 = c1 & 0xff;
00457
00458 couleur.r = col1.r * c1 + col2.r * c2 + col3.r * c3 + col4.r * c4;
00459 if (couleur.r > 5)
00460 couleur.r -= 5;
00461 couleur.r >>= 8;
00462
00463 couleur.v = col1.v * c1 + col2.v * c2 + col3.v * c3 + col4.v * c4;
00464 if (couleur.v > 5)
00465 couleur.v -= 5;
00466 couleur.v >>= 8;
00467
00468 couleur.b = col1.b * c1 + col2.b * c2 + col3.b * c3 + col4.b * c4;
00469 if (couleur.b > 5)
00470 couleur.b -= 5;
00471 couleur.b >>= 8;
00472
00473 setPixelRGB_ (expix2, myPos >> 1, couleur);
00474 }
00475 }
00476
00477 #ifdef USE_ASM
00478 void setAsmUse (int useIt);
00479 int getAsmUse (void);
00480
00481 static int use_asm = 1;
00482 void
00483 setAsmUse (int useIt)
00484 {
00485 use_asm = useIt;
00486 }
00487
00488 int
00489 getAsmUse ()
00490 {
00491 return use_asm;
00492 }
00493 #endif
00494
00495
00496 void
00497 zoomFilterFastRGB (Uint * pix1, Uint * pix2, ZoomFilterData * zf, Uint resx, Uint resy, int switchIncr, float switchMult)
00498 {
00499 register Uint x, y;
00500
00501 static char reverse = 0;
00502 static unsigned char pertedec = 8;
00503 static char firstTime = 1;
00504
00505 #define INTERLACE_INCR 16
00506 #define INTERLACE_ADD 9
00507 #define INTERLACE_AND 0xf
00508 static int interlace_start = -2;
00509
00510 expix1 = pix1;
00511 expix2 = pix2;
00512
00514 if ((prevX != resx) || (prevY != resy)) {
00515 prevX = resx;
00516 prevY = resy;
00517
00518 if (brutS)
00519 free (freebrutS);
00520 brutS = 0;
00521 if (brutD)
00522 free (freebrutD);
00523 brutD = 0;
00524 if (brutT)
00525 free (freebrutT);
00526 brutT = 0;
00527
00528 middleX = resx / 2;
00529 middleY = resy - 1;
00530 firstTime = 1;
00531 if (firedec)
00532 free (firedec);
00533 firedec = 0;
00534 }
00535
00536 if (interlace_start != -2)
00537 zf = NULL;
00538
00540 if (zf) {
00541 reverse = zf->reverse;
00542 vitesse = zf->vitesse;
00543 if (reverse)
00544 vitesse = 256 - vitesse;
00545 pertedec = zf->pertedec;
00546 middleX = zf->middleX;
00547 middleY = zf->middleY;
00548 theMode = zf->mode;
00549 hPlaneEffect = zf->hPlaneEffect;
00550 vPlaneEffect = zf->vPlaneEffect;
00551 waveEffect = zf->waveEffect;
00552 hypercosEffect = zf->hypercosEffect;
00553 noisify = zf->noisify;
00554 }
00555
00556
00557 (void)pertedec;
00558
00560 if (firstTime || zf) {
00561
00562
00563 if (firstTime) {
00564 unsigned short us;
00565 int yofs;
00566
00567 firstTime = 0;
00568 generatePrecalCoef ();
00569 select_zoom_filter ();
00570
00571 freebrutS = (signed int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int));
00572 brutS = (signed int *) ((1 + ((uintptr_t) (freebrutS)) / 128) * 128);
00573
00574 freebrutD = (signed int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int));
00575 brutD = (signed int *) ((1 + ((uintptr_t) (freebrutD)) / 128) * 128);
00576
00577 freebrutT = (signed int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int));
00578 brutT = (signed int *) ((1 + ((uintptr_t) (freebrutT)) / 128) * 128);
00579
00581 {
00582 int yperte = 0;
00583
00584 for (y = 0, yofs = 0; y < resy; y++, yofs += resx) {
00585 int xofs = yofs << 1;
00586 int xperte = 0;
00587
00588 for (x = 0; x < resx; x++) {
00589 brutS[xofs++] = xperte;
00590 brutS[xofs++] = yperte;
00591 xperte += sqrtperte;
00592 }
00593 yperte += sqrtperte;
00594 }
00595 buffratio = 0;
00596 }
00597
00598 for (us = 0; us < 0xffff; us++) {
00599 sintable[us] = (int) (1024 * sin ((double) us * 360 / (sizeof (sintable) / sizeof (sintable[0]) - 1) * 3.141592 / 180) + .5);
00600 }
00601
00602 {
00603 int loopv;
00604 firedec = (int *) malloc (prevY * sizeof (int));
00605
00606 for (loopv = prevY; loopv != 0;) {
00607 static int decc = 0;
00608 static int spdc = 0;
00609 static int accel = 0;
00610
00611 loopv--;
00612 firedec[loopv] = decc;
00613 decc += spdc / 10;
00614 spdc += RAND () % 3 - RAND () % 3;
00615
00616 if (decc > 4)
00617 spdc -= 1;
00618 if (decc < -4)
00619 spdc += 1;
00620
00621 if (spdc > 30)
00622 spdc = spdc - RAND () % 3 + accel / 10;
00623 if (spdc < -30)
00624 spdc = spdc + RAND () % 3 + accel / 10;
00625
00626 if (decc > 8 && spdc > 1)
00627 spdc -= RAND () % 3 - 2;
00628
00629 if (decc < -8 && spdc < -1)
00630 spdc += RAND () % 3 + 2;
00631
00632 if (decc > 8 || decc < -8)
00633 decc = decc * 8 / 9;
00634
00635 accel += RAND () % 2 - RAND () % 2;
00636 if (accel > 20)
00637 accel -= 2;
00638 if (accel < -20)
00639 accel += 2;
00640 }
00641 }
00642 }
00643
00644 interlace_start = 0;
00645 }
00646
00647 if (interlace_start==-1) {
00648
00649
00650
00651 y = prevX * prevY * 2;
00652 for (x = 0; x < y; x += 2) {
00653 int brutSmypos = brutS[x];
00654 int x2 = x + 1;
00655
00656 brutS[x] =
00657 brutSmypos + (((brutD[x] - brutSmypos) * buffratio) >> BUFFPOINTNB);
00658 brutSmypos = brutS[x2];
00659 brutS[x2] =
00660 brutSmypos +
00661 (((brutD[x2] - brutSmypos) * buffratio) >> BUFFPOINTNB);
00662 }
00663 buffratio = 0;
00664 }
00665
00666 if (interlace_start==-1) {
00667 signed int * tmp;
00668 tmp = brutD;
00669 brutD=brutT;
00670 brutT=tmp;
00671 tmp = freebrutD;
00672 freebrutD=freebrutT;
00673 freebrutT=tmp;
00674 interlace_start = -2;
00675 }
00676
00677 if (interlace_start>=0) {
00678 int maxEnd = (interlace_start+INTERLACE_INCR);
00679
00680 for (y = (Uint)interlace_start; (y < (Uint)prevY) && (y < (Uint)maxEnd); y++) {
00681 Uint premul_y_prevX = y * prevX * 2;
00682 for (x = 0; x < prevX; x++) {
00683 int px, py;
00684
00685 calculatePXandPY (x, y, &px, &py);
00686
00687 brutT[premul_y_prevX] = px;
00688 brutT[premul_y_prevX + 1] = py;
00689 premul_y_prevX += 2;
00690 }
00691 }
00692 interlace_start += INTERLACE_INCR;
00693 if (y >= prevY-1) interlace_start = -1;
00694 }
00695
00696 if (switchIncr != 0) {
00697 buffratio += switchIncr;
00698 if (buffratio > BUFFPOINTMASK)
00699 buffratio = BUFFPOINTMASK;
00700 }
00701
00702 if (switchMult != 1.0f) {
00703 buffratio =
00704 (int) ((float) BUFFPOINTMASK * (1.0f - switchMult) +
00705 (float) buffratio * switchMult);
00706 }
00707
00708 zoom_width = prevX;
00709 mmx_zoom_size = prevX * prevY;
00710
00711 #ifdef USE_ASM
00712 #ifdef MMX
00713 if (zf_use_xmmx)
00714 zoom_filter_xmmx (prevX, prevY,expix1, expix2,
00715 brutS, brutD, buffratio, precalCoef);
00716 else if (zf_use_mmx)
00717 zoom_filter_mmx (prevX, prevY,expix1, expix2,
00718 brutS, brutD, buffratio, precalCoef);
00719 else c_zoom (expix1, expix2, prevX, prevY, brutS, brutD);
00720 #endif
00721
00722 #ifdef POWERPC
00723 ppc_zoom (expix1, expix2, prevX, prevY, brutS, brutD, buffratio,precalCoef);
00724 #endif
00725 #else
00726 c_zoom (expix1, expix2, prevX, prevY, brutS, brutD);
00727 #endif
00728 }
00729
00730 void
00731 pointFilter (Uint * pix1, Color c, float t1, float t2, float t3, float t4, Uint cycle)
00732 {
00733 Uint x = (Uint) ((int) (resolx/2) + (int) (t1 * cos ((float) cycle / t3)));
00734 Uint y = (Uint) ((int) (c_resoly/2) + (int) (t2 * sin ((float) cycle / t4)));
00735
00736 if ((x > 1) && (y > 1) && (x < resolx - 2) && (y < c_resoly - 2)) {
00737 setPixelRGB (pix1, x + 1, y, c);
00738 setPixelRGB (pix1, x, y + 1, c);
00739 setPixelRGB (pix1, x + 1, y + 1, WHITE);
00740 setPixelRGB (pix1, x + 2, y + 1, c);
00741 setPixelRGB (pix1, x + 1, y + 2, c);
00742 }
00743 }