From: b Date: Sun, 19 Jan 2014 17:20:06 +0000 (+0000) Subject: Everything is ready (again) X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=1e6cab53da54347d358a946b414d248c398eb4d1;p=ott%2Fenhance Everything is ready (again) git-svn-id: svn://botcastle1b/npb@26 0d794883-4e4e-4f65-aa7a-0e7f5947bab5 --- diff --git a/403 b/403 index 1f19398..5a5a1bb 100755 Binary files a/403 and b/403 differ diff --git a/403.cpp b/403.cpp index a08e577..3e0bf86 100644 --- a/403.cpp +++ b/403.cpp @@ -1,5 +1,5 @@ - // //It's NewpixbOTTification Time! - // // Take a picture and add a newpixbot to it! + // //It's 403fication Time! + // // Take a picture and add a Megan to it! // // // // Requires Dev Image Library, // // //on Pentium III libdevil must be @@ -9,14 +9,21 @@ #define INPIX_MUSTARD 1 #define OUTPIX_MUSTARD 2 -#define NPBPIX_MUSTARD 3 +#define MEGPIX_MUSTARD 3 #define ARGUMENT_MUSTARD 4 #define SEAISH_MUSTARD 5 #define ANIMATED_MUSTARD 6 #define FAIL 900 #define OK 0 -#define NPBPIX0 "npb0.png" +#define MEGPIX "403.png" +#define XM 553 +#define XA 262 +#define XB 226 +#define YM 395 +#define YA 131 + +/*#define NPBPIX0 "npb0.png" #define X0 411 #define X01 21 #define X02 96 @@ -36,24 +43,22 @@ #define X2 411 #define X21 213 #define Y2 404 -#define Y21 234 +#define Y21 234*/ #include #include #include void mustard(int mustard); -void loadnpb(const char *path); -void npbottify0(const char *path); -void npbottify1(const char *path); -void npbottify2(const char *path); +void loadmeg(const char *path); +void m403(const char *path); int main (int argc, const char *argv[]); -ILuint inPix, outPix, npbPix; +ILuint inPix, outPix, megPix; ILboolean q=true; ILboolean inH=false; ILboolean outH=false; -ILboolean npbH=false; +ILboolean megH=false; ILuint inX, inY, outX, outY; ILubyte *newdata; @@ -70,7 +75,7 @@ int main (int argc, const char *argv[]) ilInit(); if(!ilEnable(IL_ORIGIN_SET))mustard(FAIL); if(!ilEnable(IL_FILE_OVERWRITE))mustard(FAIL); - ilClearColour(255,255,0,0); + ilClearColour(255,255,255,255); ilGenImages(1, &inPix); inH=true; ilBindImage(inPix); @@ -83,136 +88,108 @@ int main (int argc, const char *argv[]) if(ilGetInteger(IL_NUM_IMAGES)>1) mustard(ANIMATED_MUSTARD); - if(inX<=X02&&inY<=Y02) - npbottify0(argv[2]); - else if(inX<=X12&&inY<=Y12) - npbottify1(argv[2]); - else - npbottify2(argv[2]); + m403(argv[2]); //ok mustard(0); } -void loadnpb(const char *path) +void loadmeg(const char *path) { - ilGenImages(1, &npbPix); - npbH=true; - ilBindImage(npbPix); - if(!ilLoadImage(path))mustard(NPBPIX_MUSTARD); - if(!ilConvertImage(IL_RGBA,IL_UNSIGNED_BYTE))mustard(NPBPIX_MUSTARD); + ilGenImages(1, &megPix); + megH=true; + ilBindImage(megPix); + if(!ilLoadImage(path))mustard(MEGPIX_MUSTARD); + if(!ilConvertImage(IL_RGBA,IL_UNSIGNED_BYTE))mustard(MEGPIX_MUSTARD); } -void npbottify0(const char *path) +void m403(const char *path) { - //newdata= new ILubyte[X0*Y0*4]; + unsigned long i,j; + outX=(inX+XB+6>XM)?(inX+XB+6):XM; + outY=(inY+YA+6>YM)?(inY+YA+6):YM; ilGenImages(1, &outPix); outH=true; - loadnpb(NPBPIX0); + loadmeg(MEGPIX); + newdata=ilGetData(); ilBindImage(outPix); - if(!ilCopyImage(npbPix))mustard(FAIL); - //if(!ilTexImage(X0,Y0,1,4,IL_RGBA,IL_UNSIGNED_BYTE,NULL))mustard(OUTPIX_MUSTARD); - //if(!ilConvertImage(IL_RGBA,IL_UNSIGNED_BYTE))mustard(OUTPIX_MUSTARD); + if(!ilTexImage(outX,outY,1,4,IL_RGBA,IL_UNSIGNED_BYTE,NULL))mustard(OUTPIX_MUSTARD); + if(!ilClearImage())mustard(FAIL); + + ilSetPixels(0,0/**/,0,XM,YM,1,IL_RGBA,IL_UNSIGNED_BYTE,newdata); + if(!ilOverlayImage(inPix,((inX/2=X01+(X02-inX)/2)&& - (i< X01+(X02-inX)/2+inX)&& - (j>=Y01+(Y02-inY)/2)&& - (j< Y01+(Y02-inY)/2+inY)) - { - newdata[4*(i+X0*j)+0]=0xFF; - newdata[4*(i+X0*j)+1]=0xFF; - newdata[4*(i+X0*j)+2]=0xFF; - newdata[4*(i+X0*j)+3]=0xFF; - } - else if((i>=X01)&&(i=Y01)&&(j=X11+(X12-inX)/2)&& - (i< X11+(X12-inX)/2+inX)&& - (j>=Y11+(Y12-inY)/2)&& - (j< Y11+(Y12-inY)/2+inY)) - { - newdata[4*(i+X1*j)+0]=0xFF; - newdata[4*(i+X1*j)+1]=0xFF; - newdata[4*(i+X1*j)+2]=0xFF; - newdata[4*(i+X1*j)+3]=0xFF; - } - else if((i>=X11)&&(i=Y11)&&(jX2)?(X21+inX+2):X2; - outY=(Y21+inY+2>Y2)?(Y21+inY+2):Y2; - ilGenImages(1, &outPix); - outH=true; - loadnpb(NPBPIX2); - newdata=ilGetData(); - ilBindImage(outPix); - if(!ilTexImage(outX,outY,1,4,IL_RGBA,IL_UNSIGNED_BYTE,NULL))mustard(OUTPIX_MUSTARD); - if(!ilClearImage())mustard(FAIL); - ilSetPixels(outX-X2,0,0,X2,Y2,1,IL_RGBA,IL_UNSIGNED_BYTE,newdata); - newdata=ilGetData(); + + for(i=outX-X21-inX-2;i