Giter Club home page Giter Club logo

year-11-cs-unit-9-2d-arrays-lab-image-manipulation's Introduction

Year-11-CS-Unit-8-2D-Arrays-Lab-Image-Manipulation

This lab includes two packages within the src folder: code and image. If you open the code package, you will see a single class called ImageManipulation. This is the only class that you will be writing code in. If you open the image package, you will see four classes within it: APImage, ImageFileFilter, ImagePanel, and Pixel. The only two classes that you will directly use within your program are APImage and Pixel. The APImage class represents an image as a two-dimensional grid of Pixel objects. You will use the constructors and methods in the APImage class and Pixel class in order to complete this lab. The methods for the APImage and Pixel class are listed below.

APImage class

APImage CONSTRUCTORS WHAT IT DOES
APImage() Creates an image from a file dialog selection, or creates a blank, 200 by 200, black image if the user cancels the dialog.
APImage (String filename) Creates an image from the given file; throws an exception if the file does not exist or the file is not in JPEG format.
APImage (int width, int height) Creates a blank image of the given width and height, with a color of black.
APImage METHODS WHAT IT DOES
int getWidth() Returns the images width in pixels
int getHeight() Returns the images height in pixels
Pixel getPixel(int x, int y) Returns the pixel at the given position, where x is the column and y is the row
void setPixel(int x, int y, Pixel p) Resets the pixel at the given position, where x is the column and y is the row
void draw() Makes the image’s window visible and draws the image in it
APImage clone() Returns a new instance of APImage that is a copy of this image
String toString() Returns the string representation of the image containing the information (filename, width, and height)

Pixel class

Pixel CONSTRUCTOR WHAT IT DOES
Pixel(int red, int green, int blue) Creates a pixel with the given RGB values
Pixel METHOD WHAT IT DOES
int getRed() Returns the pixel’s red value
int getGreen() Returns the pixel’s green value
int getBlue() Returns the pixel’s blue value
void setRed(int red) Resets the pixel’s red value to red
void setGreen(int green) Resets the pixel’s green value to green
void setBlue(int blue) Resets the pixel’s blue value to blue
Pixel clone() Returns a copy of this pixel
String toString() Returns the string representation of the pixel (red, green, and blue values)

There are six challenges in this lab (challenge 0, challenge 1, challenge 2, challenge 3, challenge 4, and challenge 5). To complete this lab, you will need to complete challenges 0, 1, 2, and 3. Challenges 4 and 5 are optional and you should only attempt them if you are, like, really confident and are really feeling yourself #slay. Each challenge involves manipulating an image. The image that you will be manipulating is located in your project and is called cyberpunk2077.jpg.

Below are examples of what your output should look like after calling each method.

Challenge 0:

Screen Shot 2023-03-07 at 3 58 18 PM

Challenge 1:

Screen Shot 2023-03-07 at 3 48 09 PM

Challenge 2:

Screen Shot 2023-03-07 at 3 50 15 PM

Challenge 3 (threshold 20):

Screen Shot 2023-03-07 at 3 49 41 PM

Challenge 4:

Screen Shot 2023-03-07 at 4 14 01 PM

Challenge 5:

Screen Shot 2023-03-07 at 3 48 36 PM

As always, good luck, have fun! =)

year-11-cs-unit-9-2d-arrays-lab-image-manipulation's People

Contributors

techarenz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.