Question: Please Help! 16.12 Homework 8a: Grayscale Image Class There are three major features that are essential to object oriented programming (paraphrased from pcmag.com): Encapsulation -the
Please Help!


16.12 Homework 8a: Grayscale Image Class There are three major features that are essential to object oriented programming (paraphrased from pcmag.com): Encapsulation -the ability to modularize code into self-contained units that bind data and operations together. In most object oriented languages, this is achieved by defining classes. 1. 2. Inheritance-the ability to create hierarchies of classes, such that child classes inherit functionality from parent classes. 3. Polymorphism-the ability of a programming language to define a single interface (set of properties and callable functions) for a group of different types that can be used interchangeably at runtime. In this assignment, you will write a set of classes to perform image processing operations on grayscale images that uses the three principles described above. There are two problems in this assignment. Problem 8a Grayscale Image Class In this problem, you will write a Grayscale image class, similar to the color image you wrote earlier and use it to create a program that copies an image. Write a grayscale image class. In your image class, store doubles instead of ints for the pixels. Provide a way to access and set individual image pixels. Provide mutator methods to resize the image, and clear it to a particular value (set all pixels to that value). Write a function called multiplyAdd (or something similar), which will multiply all the pixels by a value, and add another value to them. For example, adding 255, and multiplying by -1 will produce a negative of the original image. 16.12 Homework 8a: Grayscale Image Class There are three major features that are essential to object oriented programming (paraphrased from pcmag.com): Encapsulation -the ability to modularize code into self-contained units that bind data and operations together. In most object oriented languages, this is achieved by defining classes. 1. 2. Inheritance-the ability to create hierarchies of classes, such that child classes inherit functionality from parent classes. 3. Polymorphism-the ability of a programming language to define a single interface (set of properties and callable functions) for a group of different types that can be used interchangeably at runtime. In this assignment, you will write a set of classes to perform image processing operations on grayscale images that uses the three principles described above. There are two problems in this assignment. Problem 8a Grayscale Image Class In this problem, you will write a Grayscale image class, similar to the color image you wrote earlier and use it to create a program that copies an image. Write a grayscale image class. In your image class, store doubles instead of ints for the pixels. Provide a way to access and set individual image pixels. Provide mutator methods to resize the image, and clear it to a particular value (set all pixels to that value). Write a function called multiplyAdd (or something similar), which will multiply all the pixels by a value, and add another value to them. For example, adding 255, and multiplying by -1 will produce a negative of the original image
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
