logo

Creating a C++ class for images with data abstraction, information hiding, modularity, and fail-safe programming

   

Added on  2019-09-22

2 Pages819 Words278 Views
Classes and object-oriented programmingIf I changed the image data structure used in ImageLib.h and ImageLib.lib, all of the code that uses these files would need to be changed. Your goal for this program is to create a C++ class for images that hides the details of the image data structure. If the data structure is changed, only the details of your image classshould need to be changed (and not the interface), so that other code that uses the image class can be usedunchanged. This will also upgrade images to first-class objects with a constructor, destructor, operator=, etc. Make sure that you use the concepts of data abstraction, information hiding, modularity, and fail-safe programming whenever possible.Assignment You are to create a new class representing images. Remember that your project should be created as an “Empty project,” so that you don’t get precompiled header code among other things. In order to create this class you should continue to use the files for working with images from the previous programming assignment:http://courses.washington.edu/css501/cfolson/program1/ImageLib.hhttp://courses.washington.edu/css501/cfolson/program1/ImageLib.libhttp://courses.washington.edu/css501/cfolson/program1/ImageLib.pdbIf you want a new test image, you can use this one:http://courses.washington.edu/css501/cfolson/program2/test.gifThe assignment has two parts. First, you will play the role of class designer and create a new class for images. Second, you will play the role of developer using the class library. For the second part, you shoulduse your class, but not make any assumptions about the implementation of the class (and don’t write new member operations to solve that part).Your image class should include (at least) the following capabilities:Constructor using a filename (read from a file)Constructor using just the number of rows and columns (create a blank, black image)Copy constructor, destructor, operator= (these are very important!)

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Homework 7. Create example and explain the purpose of.
|4
|836
|483

Designing and Implementing Algorithms for Media Management and Mutable String ADT
|4
|1019
|453

Engr 103. SFSU. Fall 2016. A. Tabrizi. School of Engine
|1
|258
|937

Computer Programming Lab - Structures and Classes
|10
|541
|208

Testing Plan for CTAStations Application
|6
|842
|99

CSC 212. Programming. 200 points. Project 2. Develop a
|7
|314
|84