/** Test Main. It will explore Splatoon! */ public static void main(String args[]) { // Picture pix = new Picture("snowman.jpg"); Picture pix = new Picture("splatoon.jpg"); Picture smallPic = pix.scale(.5, .48); smallPic.explore(); smallPic.write("smallSplatoon.jpg"); }
/** Method to test the collage method */ public static void testCollage() { Picture canvas = new Picture(850, 1300); // Picture beach = new Picture("beach.jpg"); // beach.sepia(); // beach.explore(); canvas.createCollage(); canvas.explore(); canvas.write("rarePepes.jpg"); }
/** * Method displayMatch that take a search image a template image and a point where the template * matches the search image and writes and displays the search image with a box drawn the size of * the template image at the point given. * * @param: search: The search image of type Picture * @param: template: The template image of type Picture * @param: minMatch: The point where the template appears in the search image, of type Point. */ public static void displayMatch(Picture search, Picture template, Point minMatch) { Turtle turtle = new Turtle((int) minMatch.getX(), (int) minMatch.getY(), search); turtle.setPenWidth(3); turtle.turnRight(); turtle.forward(template.getWidth()); turtle.turnRight(); turtle.forward(template.getHeight()); turtle.turnRight(); turtle.forward(template.getWidth()); turtle.turnRight(); turtle.forward(template.getHeight()); turtle.turnRight(); search.show(); search.write("Waldoboxed.png"); }
/** * Method to add a picture to the frame sequence * * @param picture the picture to add */ public void addFrame(Picture picture) { // add this picture to the list pictureList.add(picture); // write out this frame picture.write(directory + baseName + numberFormat.format(frameNumber) + ".jpg"); // if this sequence is being shown update the frame if (shown) { if (pictureFrame != null) pictureFrame.setPicture(picture); else pictureFrame = new PictureFrame(picture); } // increment the frame number frameNumber++; }
/** Test Main. It will explore the beach */ public static void main(String args[]) { Picture pix = new Picture("connor.jpg"); Picture smallP = pix.scale(0.1, 0.1); smallP.write("smallPictures.jpg"); pix.explore(); }