]> bicyclesonthemoon.info Git - ott/enhance/commitdiff
Everything is ready (again)
authorb <b@0d794883-4e4e-4f65-aa7a-0e7f5947bab5>
Sun, 19 Jan 2014 17:20:06 +0000 (17:20 +0000)
committerb <b@0d794883-4e4e-4f65-aa7a-0e7f5947bab5>
Sun, 19 Jan 2014 17:20:06 +0000 (17:20 +0000)
git-svn-id: svn://botcastle1b/npb@26 0d794883-4e4e-4f65-aa7a-0e7f5947bab5

403
403.cpp
npb
npbd

diff --git a/403 b/403
index 1f193989bf2e457ab3bd4ba5760ea6bfa981c59e..5a5a1bb1a5911ce5a50cba74cb8de15fb281d8a9 100755 (executable)
Binary files a/403 and b/403 differ
diff --git a/403.cpp b/403.cpp
index a08e577b7ec69a5ef1e1ee96ee12551da4bd9df7..3e0bf8632278744bed5cb8a662ca8c90553a28d1 100644 (file)
--- 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
 #define X2  411
 #define X21 213
 #define Y2  404
-#define Y21 234
+#define Y21 234*/
 
 #include <stdlib.h>
 #include <stdio.h>
 #include <IL/il.h>
 
 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<XA-XB)?(XA-inX/2):XB),outY-YA-inY,0))mustard(FAIL);
+       
        newdata=ilGetData();
-       for(unsigned long i=0;i<X0;++i)
+       
+       for(i=0;i<outX;++i)
        {
-               for(unsigned long j=0;j<Y0;++j)
-               {
-                       if((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<X01+X02)&&
-                               (j>=Y01)&&(j<Y01+Y02))
-                       {
-                               newdata[4*(i+X0*j)+0]=0xFF;//looks better white
-                               newdata[4*(i+X0*j)+1]=0xFF;
-                               newdata[4*(i+X0*j)+2]=0xFF;
-                               newdata[4*(i+X0*j)+3]=0xFF;
-                       }
-                       else
-                       {
-                               //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]=0x00;
-                       }
-               }
-       }
-       //if(!ilSetData(newdata))mustard(OUTPIX_MUSTARD);
+               newdata[4*(i              )  ]=0x00;
+               newdata[4*(i              )+1]=0x00;
+               newdata[4*(i              )+2]=0x00;
+               newdata[4*(i              )+3]=0xFF;
+               
+               newdata[4*(i+outX         )  ]=0x00;
+               newdata[4*(i+outX         )+1]=0x00;
+               newdata[4*(i+outX         )+2]=0x00;
+               newdata[4*(i+outX         )+3]=0xFF;
        
-       //printf("%d\n",iCurImage);
-       if(!ilOverlayImage(inPix,X01+(X02-inX)/2,Y0-inY-(Y01+(Y02-inY)/2),0))mustard(FAIL);
-       if(!ilOverlayImage(npbPix,0,0,0))mustard(FAIL);
-       if(!ilSave(IL_PNG,path))mustard(OUTPIX_MUSTARD);
-}
-
-void npbottify1(const char *path)
-{
-       //newdata= new ILubyte[X0*Y0*4];
-       ilGenImages(1, &outPix);
-       outH=true;
-       loadnpb(NPBPIX1);
-       ilBindImage(outPix);
-       if(!ilCopyImage(npbPix))mustard(FAIL);
-       //if(!ilTexImage(X1,Y1,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<X1;++i)
+               newdata[4*(i+outX*(outY-1))  ]=0x00;
+               newdata[4*(i+outX*(outY-1))+1]=0x00;
+               newdata[4*(i+outX*(outY-1))+2]=0x00;
+               newdata[4*(i+outX*(outY-1))+3]=0xFF;
+               
+               newdata[4*(i+outX*(outY-2))  ]=0x00;
+               newdata[4*(i+outX*(outY-2))+1]=0x00;
+               newdata[4*(i+outX*(outY-2))+2]=0x00;
+               newdata[4*(i+outX*(outY-2))+3]=0xFF;
+       }
+               
+       for(j=2;j<outY-2;++j)
        {
-               for(unsigned long j=0;j<Y1;++j)
-               {
-                       if((i>=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<X11+X12)&&
-                               (j>=Y11)&&(j<Y11+Y12))
-                       {
-                               newdata[4*(i+X1*j)+0]=0x00;
-                               newdata[4*(i+X1*j)+1]=0x00;
-                               newdata[4*(i+X1*j)+2]=0x00;
-                               newdata[4*(i+X1*j)+3]=0xFF;
-                       }
-                       else
-                       {
-                               //
-                       }
-               }
+               newdata[4*(       outX*j)  ]=0x00;
+               newdata[4*(       outX*j)+1]=0x00;
+               newdata[4*(       outX*j)+2]=0x00;
+               newdata[4*(       outX*j)+3]=0xFF;
+               
+               newdata[4*(     1+outX*j)  ]=0x00;
+               newdata[4*(     1+outX*j)+1]=0x00;
+               newdata[4*(     1+outX*j)+2]=0x00;
+               newdata[4*(     1+outX*j)+3]=0xFF;
+               
+               newdata[4*(outX-1+outX*j)  ]=0x00;
+               newdata[4*(outX-1+outX*j)+1]=0x00;
+               newdata[4*(outX-1+outX*j)+2]=0x00;
+               newdata[4*(outX-1+outX*j)+3]=0xFF;
+               
+               
        }
-       //if(!ilSetData(newdata))mustard(OUTPIX_MUSTARD);
        
-       //printf("%d\n",iCurImage);
-       if(!ilOverlayImage(inPix,X11+(X12-inX)/2,Y1-inY-(Y11+(Y12-inY)/2),0))mustard(FAIL);
-       //(!ilOverlayImage(npbPix,0,0,0))mustard(FAIL);
+       newdata[4*(outX-1+outX*(outY-1))  ]=0xB6;
+       newdata[4*(outX-1+outX*(outY-1))+1]=0xB6;
+       newdata[4*(outX-1+outX*(outY-1))+2]=0xB6;
+       newdata[4*(outX-1+outX*(outY-1))+3]=0xFF;
+       
+       newdata[4*(       outX*(outY-1))  ]=0xB6;
+       newdata[4*(       outX*(outY-1))+1]=0xB6;
+       newdata[4*(       outX*(outY-1))+2]=0xB6;
+       newdata[4*(       outX*(outY-1))+3]=0xFF;
+       
+       newdata[4*(outX-1              )  ]=0xB6;
+       newdata[4*(outX-1              )+1]=0xB6;
+       newdata[4*(outX-1              )+2]=0xB6;
+       newdata[4*(outX-1              )+3]=0xFF;
+       
+       newdata[                         0]=0xB6;
+       newdata[                         1]=0xB6;
+       newdata[                         2]=0xB6;
+       newdata[                         3]=0xFF;
+       
        if(!ilSave(IL_PNG,path))mustard(OUTPIX_MUSTARD);
 }
 
-void npbottify2(const char *path)
+/*void npbottify2(const char *path)
 {
-       unsigned long i,j;
-       outX=(X21+inX+2>X2)?(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<outX-X21+2;++i)
        {
                //printf("i=%lu\n",i);
@@ -239,7 +216,9 @@ void npbottify2(const char *path)
                }
        }
        
-       if(!ilOverlayImage(inPix,outX-X21-inX,outY-Y21-inY,0))mustard(FAIL);
+       
+       //
+       
        
        i=outX-X21-inX-2;
        j=Y21-2;
@@ -285,25 +264,25 @@ void npbottify2(const char *path)
        newdata[4*(i+outX*j)+2]=0x00;
        newdata[4*(i+outX*j)+3]=0xFF;
        
-       if(!ilSave(IL_PNG,path))mustard(OUTPIX_MUSTARD);
+       
 
        
-}
+}*/
 
 void mustard(int mustard)
 {
        switch(mustard)
        {
        case 0:
-               if(q) printf("NewpixbOTTified!\n");break;
+               if(q) printf("403fied!\n");break;
        case ARGUMENT_MUSTARD:
                if(q) printf("npb inPix outPix [q]\n");break;
        case INPIX_MUSTARD:
                if(q) printf("inPIX mustard.\n");break;
        case OUTPIX_MUSTARD:
                if(q) printf("outPIX mustard.\n");break;
-       case NPBPIX_MUSTARD:
-               if(q) printf("npbPIX mustard.\n");break;
+       case MEGPIX_MUSTARD:
+               if(q) printf("megPIX mustard.\n");break;
        case SEAISH_MUSTARD:
                if(q) printf("Seaishness is mustard.\n");break;
        case ANIMATED_MUSTARD:
@@ -318,8 +297,8 @@ void mustard(int mustard)
                ilDeleteImages(1, &outPix);
                //delete[] newdata;
        }
-       if(npbH)
-               ilDeleteImages(1, &npbPix);
+       if(megH)
+               ilDeleteImages(1, &megPix);
        exit(mustard);
 }
        
diff --git a/npb b/npb
index f39f1b12192061571535fe2eca6675036e90e46a..1915a0f2c698294036f48bd39c000cd72d6a193c 100755 (executable)
Binary files a/npb and b/npb differ
diff --git a/npbd b/npbd
index edc3fa290c8a44a5a803d19465455bbbd984623a..7d3edec7aad615c59de63fd25e70fc816c6a606b 100755 (executable)
Binary files a/npbd and b/npbd differ