Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program Help. 16.12 Homework 8a: Grayscale Image Class There are three major features that are essential to object oriented programming (paraphrased from pcmag.com) 1.

C++ program Help.

image text in transcribedimage text in transcribedimage text in transcribed

16.12 Homework 8a: Grayscale Image Class There are three major features that are essential to object oriented programming (paraphrased from pcmag.com) 1. 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. 2. Inheritance- the ability to create hierarchies of classes, such that child classes inherit functionality from parent classes. .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) 1. 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. 2. Inheritance- the ability to create hierarchies of classes, such that child classes inherit functionality from parent classes. .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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions