multiplicative scaling代做、C/C++程序语言代写
and multiplicative scaling. By updating the individual pixel values in the image’s matrix, you can manipulate the
image in various ways to achieve the desired result. We will provide you with the starting code and required files
for the project.
Environment Setup
Code link:
1. Set up visual studio code for C/C++: Visual Studio Code C/C++ setup.
2. Download the code and set up your environment.
3. Rename the file FIRSTNAME LASTNAME NETID with your first name, last name, and NETID.
4. Test by running make. To learn more about make, read this Makefile tutorial.
Part I (35 points)
Create a templated class named Vector that serves as a fundamental component for implementing matrices in the
image-processing library (from Project 1) that performs matrix operations on images. The Vector class should be
capable of storing a collection of homogeneous data of any data type. Implement the class using either an array or
a linked list, based on your preference. The class should provide the following functionalities:
1. int getsize(): A member function that returns the size of the vector, i.e., the number of elements it
contains.
2. Copy constructor: A constructor that creates a new vector as a copy of an existing one.
3. Assignment operator (operator=): An operator that allows the assignment of one vector to another.
4. Destructor: A destructor that cleans up any resources the vector uses.
5. Input and output stream operators (operator>> and operator<<): Operators that allow reading from and
writing to input and output streams, respectively.
6. Arithmetic operators (operator+, operator-, and operator*): Operators that allow addition, subtraction, and multiplication of vectors.
7. Subscript operator (operator[]): An operator that provides access to individual elements of the vector
based on their index.
8. Additionally, implement any member functions as virtual if you believe they should be overrideable in derived classes. This class will later be used to create the Matrix class, which will be an essential part of the
image-processing library.
9. Constructors also need to be defined for the Vector object to be usable.
2
Part II (35 points)
Create a new class named Matrix that represents a matrix of elements of type uint8 t. The Matrix class should
utilize the Vector class through composition to implement the matrix structure, where each row or column of
the matrix is represented as an instance of the Vector class. The class should provide implementations for the
following operators and member functions:
1. Copy constructor
2. Assignment operator (operator=)
3. Destructor
4. Input and output stream operators (operator>> and operator<<)
5. Arithmetic operators (operator+, operator-, and operator*)
6. Subscript operator (operator[])
Additionally, implement the following new member functions in the Matrix class:
1. int getrows(): A member function that returns the number of rows in the matrix.
2. int getcols(): A member function that returns the number of columns in the matrix.
The Matrix class will serve as an essential component in the image-processing library (from Project 1) that performs matrix operations on images. The composition of Vector instances allows the Matrix class to leverage the
functionalities of the Vector class while maintaining the semantic distinction between vectors and matrices.
Part III (30 points)
Create a new Image class that inherits from the Matrix class and implements all the functions described in Project
1. The Image class should have the following properties:
• filePath: The file path for the image.
• numChannels: The number of color channels (e.g., 3 for RGB images).
• width: The width of the image in pixels.
• height: The height of the image in pixels.
The Image class should be capable of performing the following operations on images:
1. Scaling an image
2. Adding two images
3. Subtracting two images
4. Multiplying two images
The operations for scaling, adding, subtracting, and multiplying images should be implemented as overloaded
operators (+, -, and *).
3
Part IV (30 points) EXTRA CREDIT
• Add a function called transpose() to the Matrix class. This function should generate the transpose of
the original matrix, such that each element in the transposed matrix MT is given by the formula MT
i j = Mji,
where Mji is the element in the j-th row and i-th column of the original matrix M. The resulting matrix MT
should have dimensions that are the transpose of the original matrix’s dimensions, i.e., if the original matrix
M has dimensions m ⇥ n, the transposed matrix MT should have dimensions n ⇥ m.
• Additionally, create a function called resize() in the Image class that uses the stb image resize library
to resize an image and populates the Image object accordingly. The resize() function should take the
original image of dimensions m ⇥ n (height m and width n) and produce a resized image of dimensions p ⇥ q
(new height p and new width q), where p and q are the target dimensions for resizing. Use the functions
provided by the stb image resize library to perform the resizing operation, preserving the aspect ratio
and visual content of the image while adjusting its size. The resized image should be stored in the Image
object.
You may want to write a main.cpp file that tests the Image class with real images, executing all the operations
implemented in the previous parts of this project.
Submission
Please zip your code and submit it via Canvas. You must include the file with your name and NETID (as specified
in Section and your modified headers.
An illustration of the file structure is shown below:
The file organizational structure for this project is as follows:
• FIRSTNAME LASTNAME NETID
• Makefile
• src
– Image.cpp
4
– Image.h
– Matrix.cpp
– Matrix.h
– Vector.h
– main.cpp
• stb image
– stb image.h
– stb image resize.h
– stb image write.h
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
- 全球营销星际商务奇谭:Line群发云控工具是科技魔法的催化剂,引领我进入业务的星际时代
- XC4020XL-1HT176C: Powering Next-Generation Digital Systems with Versatile FPGA Technology | ChipsX
- Telegram快速群发方案,电报采集群发一体机/TG拉群秘籍
- Instagram群发筛选软件,Ins群发注册工具,助你轻松推广!
- 群发新时代 WhatsApp拉群工具由专业人士带您突破风控限制 事半功倍
- 北京爱尔英智眼科医院张丽提醒:得了麦粒肿不用怕,用对方法能缓解
- ws/WhatsApp营销软件,ws协议号群发工具/ws拉群工具/ws劫持号
- 引领商业潮流的秘密武器WhatsApp工具带你走在时代前沿
- 轻松蜕变 他使用WhatsApp拉群营销工具 品牌形象在国际市场上树立了崭新的标杆
- TG全面群发营销平台,电报精准群发软件,Telegram自动化营销工具
- 全新网络通信标识推广方案,Line协议号注册器助您一站式解决!
- 做对的事情和把事情做对,哪个更重要?
- 俞敏洪又找到一位“头部主播”
- 数字之光 WhatsApp拉群工具 助你的销售成绩如日中天
- 聚焦全国一体化算力体系构建,忆联以强大存力“引擎”释放算力潜能
- 谷器数据参加瑶海区三大行动推进大会,荣膺表彰并代表发言
- WhatsApp拉群营销工具 让你在国际市场中轻松解锁新商机 成就国际营销巨头
- ins协议私信新玩法!Instagram引流新方式,Ins一键消息发送助你轻松推广!
- 皓丽酒店智显屏全新上市!引领智慧酒店新形态
- 石阡生态农业平台:绿色生态,共享健康新生活
- Instagram群发软件 - ins自动登录/ig采集指定地区/ins群发助手/引粉狂潮
- 代写small-cap bio stocks程序
- 数据艺术家TG-WS-LINE云控/自动注册机/筛料拉活人:zalo代筛料子专业服务为您呈现一手数据之美
- 易文赛携手冠军家庭:储存围产期干细胞,守护健康未来之路
- Ins/Instagram自动创新营销软件,ins一键解锁引流新方法!
- Ins打粉营销软件,Instagram群发工具,助你成就营销传奇!
- tg群发营销软件,tg拉群私信群发,海外获客爆粉就用天宇爆粉神器
- 数环通入选中国信通院《高质量数字化转型技术方案集(2023)》,积极推动企业数字化转型
- CIT 594代做、代写Python设计编程
- Ins群发工具,Instagram引流助手,共同助力你实现营销梦想!
推荐
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技