From: b Date: Sat, 28 Dec 2013 20:14:44 +0000 (+0000) Subject: The world's smallest NewpixbOTTification X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=4656739d28eb6db73dc1f45af3381c07f084f078;p=ott%2Fenhance The world's smallest NewpixbOTTification git-svn-id: svn://botcastle1b/npb@9 0d794883-4e4e-4f65-aa7a-0e7f5947bab5 --- diff --git a/npb b/npb index c72f199..1d5b27e 100755 Binary files a/npb and b/npb differ diff --git a/npb.cpp b/npb.cpp index 3cd9d19..d9a7769 100644 --- a/npb.cpp +++ b/npb.cpp @@ -1,6 +1,6 @@ // // It's NewpixbOTTification Time! // // Take a picture and add a newpixbot to it! - // // Requires Dev Image Library + // // Requires Dev Image Library, on Pentium III libdevil must be recompiled with --disable-ssl2 --disable-ssl3 // // // // ~~bicyclesonthemoon @@ -35,6 +35,7 @@ ILboolean inH=false; ILboolean outH=false; ILboolean npbH=false; ILuint inX, inY; +ILubyte *newdata; int main (int argc, const char *argv[]) { @@ -49,7 +50,7 @@ int main (int argc, const char *argv[]) ilInit(); if(!ilEnable(IL_ORIGIN_SET))mustard(FAIL); if(!ilEnable(IL_FILE_OVERWRITE))mustard(FAIL); - ilClearColour(0,200,0,0); + ilClearColour(0,0,0,0); ilGenImages(1, &inPix); inH=true; ilBindImage(inPix); @@ -80,14 +81,51 @@ void loadnpb(const char *path) void npbottify0(const char *path) { + //newdata= new ILubyte[X0*Y0*4]; ilGenImages(1, &outPix); outH=true; - ilBindImage(outPix); - if(!ilTexImage(X0,Y0,1,4,IL_RGBA,IL_UNSIGNED_BYTE,NULL))mustard(OUTPIX_MUSTARD); - //ilBindImage(outPix); - //if(!ilClearImage())mustard(FAIL); loadnpb(NPBPIX0); 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); + newdata=ilGetData(); + for(unsigned long i=0;i=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