/* Copyright (c) 2005-2007 Joseph Gleason Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Current versions of this and other code can be downloaded at: http://gleason.cc/ */ package cc.glsn.v15; import java.awt.Color; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.math.BigInteger; import java.util.TreeMap; import javax.imageio.ImageIO; public class EqArt { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { new EqArt(args); } public EqArt(String[] Args) throws IOException { int Width=new Integer(Args[0]).intValue(); int Height=new Integer(Args[1]).intValue(); Values=new TreeMap(); BufferedImage BI=new BufferedImage(Width,Height,BufferedImage.TYPE_INT_RGB); for(int i=0; i Values; private Color mcCannRSAXOR(int i, int j) { int temp=Math.abs(i+j) ^ Math.abs(i-j); BigInteger I=new BigInteger(new Long(temp).toString()); I=I.pow(7); BigInteger Val=I.mod(new BigInteger("257")); int val=Val.intValue(); if (val==256) val=0; if (!Values.containsKey(val)) { Values.put(val,0); } Values.put(val,Values.get(val)+1); Color c=new Color(val,val,val); return c; } /** * Discovered from an obvious mis-implemtnation of McCann's RSA XOR */ private Color fadedChecker(int i, int j) { i+=5000; //Added an offset to avoid the i=j reflection line int temp=Math.abs(i+j) ^ Math.abs(i-j); int black=(temp^7) % 256; //System.out.println(black); Color c=new Color(black,black,black); return c; } }