From 53b73dec4d6e71899d183335509591b7c89a419b Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Thu, 14 Jun 2012 18:34:23 -0400 Subject: pushing the fly-tools into this repository --- fly-tools/misc/makeimage.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 fly-tools/misc/makeimage.cpp (limited to 'fly-tools/misc/makeimage.cpp') diff --git a/fly-tools/misc/makeimage.cpp b/fly-tools/misc/makeimage.cpp new file mode 100644 index 0000000..06e2897 --- /dev/null +++ b/fly-tools/misc/makeimage.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +using namespace std; +using namespace Magick; + +int main(int argc,char **argv) + +{ + // Construct the image object. Seperating image construction from the + // the read operation ensures that a failure to read the image file + // doesn't render the image object useless. + + Image* img; + char buffer[100]; + sprintf(buffer,"%ix%i",7,7); + + // residual image is initialized with black representing not visited. + //residual = new Image(buffer, "black"); + + img = new Image(buffer, "white"); + + for (int j=0; j<=3;j++) { + for (int i=0; i<=3-j; i++) { + img->pixelColor(i,j, "black"); + img->pixelColor(6-i,j, "black"); + } + } + + int k; + for (int j=4; j<=6;j++) { + for (int i=0; i<=j-3; i++) { + img->pixelColor(i,j, "black"); + img->pixelColor(6-i,j, "black"); + } + } + + + //img->pixelColor(0,3, "red"); + + + string namei = "7x7.png"; + img->write(namei.c_str()); + + delete img; + + return 0; + +} + -- cgit v1.2.3