国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫COP3502、Python程序設計代做
代寫COP3502、Python程序設計代做

時間:2024-10-23  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



 
P2: RLE with Images Python 
 
Overview 
 
In this project students will develop routines to encode and decode data for images using run-length encoding 
(RLE). Students will implement encoding and decoding of raw data, conversion between data and strings, and 
display of information by creating procedures that can be called from within their programs and externally. This 
project will give students practice with loops, strings, Python lists, methods, and type-casting. 
 
Run-Length Encoding 
 
RLE is a form of lossless compression used in many industry applications, including imaging. It is intended to 
take advantage of datasets where elements (such as bytes or characters) are repeated several times in a row in 
certain types of data (such as pixel art in games). Black pixels often appear in long “runs” in some animation 
frames; instead of representing each black pixel individually, the color is recorded once, following by the number 
of instances. 
 
For example, consider the first row of pixels from the pixel image of a gator 
(shown in Figure 1). The color black is “0”, and green is “2”: 
 
Flat (unencoded) data: 0 0 2 2 2 0 0 0 0 0 0 2 2 0_ 
 
Run-length encoded data: 2 0 3 2 6 0 2 2 1 0_. 
Figure 1 – Gator Pixel Image 
 
The encoding for the entire image in RLE (in hexadecimal) – width, height, and pixels - is: 
 
 
1E|**0**602220121F10721AF21092301210**60**308250 
 
\W/ \H/ \------------------------------------------PIXELS-----------------------------------------------/ 
 
Image Formatting 
 
The images are stored in uncompressed / unencoded format natively. In addition, there are a few other rules to 
make the project more tractable: 
 
 1. Images are stored as a list of numbers, with the first two numbers holding image width and height. 
 
 2. Pixels will be represented by a number between 0 and 15 (representing 16 unique colors). 
3. No run may be longer than 15 pixels; if any pixel runs longer, it should be broken into a new run. 
 
For example, the chubby smiley image (Figure 2) would contain the data shown in Figure 3. 
 
Figure 2 Figure 3 – Data for “Chubby Smiley” 
 
NOTE: Students do not need to work with the image file format itself – they only need to work with lists and 
encode or decode them. Information about image formatting is to provide context. Requirements 
 
Student programs must present a menu when run in standalone mode and must also implement several methods, 
defined below, during this assignment. 
 
Standalone Mode (Menu) 
 
When run as the program driver via the main() method, the program should: 
 
1) Display welcome message 
 
 2) Display color test (ConsoleGfx.test_rainbow) 
3) Display the menu 
4) Prompt for input 
 
Note: for colors to properly display, it is highly recommended that student 
install the “CS1” theme on the project page. 
 
 
There are five ways to load data into the program that should be provided and four ways the program must be 
able to display data to the user. 
 
Loading a File 
 
Accepts a filename from the user and invokes ConsoleGfx.load_file(filename): 
 
Select a Menu Option: 1 
 
Enter name of file to load: testfiles/uga.gfx 
 
Loading the Test Image 
 
Loads ConsoleGfx.test_image: 
Select a Menu Option: 2_ 
Test image data loaded._ 
 
Reading RLE String 
Reads RLE data from the user in hexadecimal notation with delimiters (smiley example): 
 
Select a Menu Option: 3 
 
Enter an RLE string to be decoded: 28:10:6B:10:10B:10:2B:10:12B:10:2B:10:5B:20:11B:10:6B:10 
 
Reading RLE Hex String 
Reads RLE data from the user in hexadecimal notation without delimiters (smiley example): 
 
Select a Menu Option: 4 
 
Enter the hex string holding RLE data: 28106B10AB102B10CB102B105B20BB106B10 
 
Reading Flat Data Hex String 
Reads raw (flat) data from the user in hexadecimal notation (smiley example): 
 
Select a Menu Option: 5 
 
Enter the hex string holding flat data: 
 
880bbbbbb0bbbbbbbbbb0bb0bbbbbbbbbbbb0bb0bbbbb00bbbbbbbbbbb0bbbbbb0 
 
Displaying the Image 
 
Displays the current image by invoking the ConsoleGfx.display_image(image_data) method. 
 
Displaying the RLE String 
 
Converts the current data into a human-readable RLE representation (with delimiters): 
 
Select a Menu Option: 7 RLE representation: 28:10:6b:10:10b:10:2b:10:12b:10:2b:10:5b:20:11b:10:6b:10 
 
Note that each entry is 2-3 characters; the length is always in decimal, and the value in 
hexadecimal! Displaying the RLE Hex Data 
 
Converts the current data into RLE hexadecimal representation (without delimiters): 
 
Select a Menu Option: 8 
 
RLE hex values: 28106b10ab102b10cb102b105b20bb106b10 
 
Displaying the Flat Hex Data 
Displays the current raw (flat) data in hexadecimal representation (without delimiters): 
 
Select a Menu Option: 9 
 
Flat hex values: 880bbbbbb0bbbbbbbbbb0bb0bbbbbbbbbbbb0bb0bbbbb00bbbbbbbbbbb0bbbbbb0 
 
Class Methods 
 
Student classes are required to provide all of the following methods with defined behaviors. We recommend 
completing them in the following order: 
 
1. to_hex_string(data) 
Translates data (RLE or raw) a hexadecimal string (without delimiters). This method can also aid debugging. 
 
Ex: to_hex_string([3, 15, 6, 4]) yields string "3f64". 
 
2. count_runs(flat_data) 
Returns number of runs of data in an image data set; double this result for length of encoded (RLE) list. 
 
Ex: count_runs([15, 15, 15, 4, 4, 4, 4, 4, 4]) yields integer 2. 
 
3. encode_rle(flat_data) 
Returns encoding (in RLE) of the raw data passed in; used to generate RLE representation of a data. 
 
Ex: encode_rle([15, 15, 15, 4, 4, 4, 4, 4, 4]) yields list [3, 15, 6, 4]. 
 
4. get_decoded_length(rle_data) 
Returns decompressed size RLE data; used to generate flat data from RLE encoding. (Counterpart to #2) 
 
Ex: get_decoded_length([3, 15, 6, 4]) yields integer 9. 
 
5. decode_rle(rle_data) 
Returns the decoded data set from RLE encoded data. This decompresses RLE data for use. (Inverse of #3) 
 
Ex: decode_rle([3, 15, 6, 4]) yields list [15, 15, 15, 4, 4, 4, 4, 4, 4]. 
 
6. string_to_data(data_string) 
 
Translates a string in hexadecimal format into byte data (can be raw or RLE). (Inverse of #1) 
 
Ex: string_to_data ("3f64") yields list [3, 15, 6, 4]. 
 
7. to_rle_string(rle_data) 
 
Translates RLE data into a human-readable representation. For each run, in order, it should display the run 
length in decimal (**2 digits); the run value in hexadecimal (1 digit); and a delimiter, ‘:’, between runs. (See 
examples in standalone section.) 
 
Ex: to_rle_string([15, 15, 6, 4]) yields string "15f:64". 
 
8. string_to_rle(rle_string) 
Translates a string in human-readable RLE format (with delimiters) into RLE byte data. (Inverse of #7) 
 
Ex: string_to_rle("15f:64") yields list [15, 15, 6, 4]. Submissions 
 
NOTE: Your output must match the example output *exactly*. If it does not, you will not receive full credit for 
your submission! 
 
File: 
Method: 
 
 
rle_program.py 
 
Submit on ZyLabs 
 
Do not submit any other files! 
 
Part A (5 points) 
 
For part A of this assignment, students will set up the standalone menu alongside the 4 requirements listed on 
page 2 of this document. In addition to this, students should also set up menu options 1 (loading an image), 2 
(loading specifically the test image), and 6 (displaying whatever image was loaded) in order to help grasp the 
bigger picture of the project. 
 
This involves correctly setting up the console_gfx.py file and utilizing its methods. You will use 
ConsoleGfx.display_image(...) to display images. Notice how it takes in a decoded list. This is the 
 
format in which you will locally (in your program) store any image data that you are working with. When 
the document mentions that something is “loaded” it means that something is stored as a list of flat 
(decoded) data. 
 
Part B (60 points) 
 
For part B of this assignment, students will complete the first 6 methods on page 3 of this document. They 
must match specifications and pass test cases on chapter 12.2 in Zybooks, which will be your means of 
submission for this part of the assignment. Your grade will be the score received on Zybooks. To guarantee 
functionality moving forward to part C, it is expected that you will receive full marks for this section. 
 
Part C (35 points) 
 
For part C of this assignment, students will now complete the final 2 methods on page 3 of this document as well 
as the remainder of the project involving the menu options and understanding how all the individual methods are 
intertwined with each other. You will submit your whole program including the 8 methods listed above and the 
main method in chapter 12.3 in Zybooks. We will only test your remaining 2 methods and the main method in 
part C. 


請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp





 

掃一掃在手機打開當前頁
  • 上一篇:代寫ECE 4122、代做C++編程語言
  • 下一篇:代寫SD6502、代做C++程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日韩欧美视频第二区| 日韩精品一区二区在线视频| 欧美精品亚洲精品| 亚洲一区二区三区香蕉| 国产精品自拍小视频| 中文字幕剧情在线观看一区| 国产一级做a爰片久久毛片男| 久久婷婷国产麻豆91天堂| 欧美日韩dvd| 亚州av一区二区| 久久久久一区二区三区| 欧美日韩不卡在线视频| 欧美一区二区中文字幕| 欧美亚洲视频在线看网址| 欧美乱偷一区二区三区在线| 美女在线免费视频| 亚洲一区免费网站| 大地资源第二页在线观看高清版| 午夜免费福利小电影| 日本精品久久久久久久久久| 国产精品老女人精品视频| 99视频日韩| 男人的天堂99| 青草青草久热精品视频在线观看 | 国产精品18久久久久久首页狼| 无码内射中文字幕岛国片| 欧美一级视频免费看| 久久一区二区三区av| 国产成人精品优优av| 北条麻妃在线视频观看| 91免费看片在线| 国产精品综合久久久| 国产成人精品国内自产拍免费看| 国产美女99p| 久久久久久久亚洲精品| 精品毛片久久久久久| 国产精品免费一区豆花| 国产精品免费一区二区三区在线观看| 久久久久久com| 久久97精品久久久久久久不卡 | 国产精品啪啪啪视频| 亚洲自拍小视频| 少妇精品久久久久久久久久| 国产区一区二区三区| 国产精品夜间视频香蕉| 久久频这里精品99香蕉| 亚洲熟妇av日韩熟妇在线| 国产日韩精品一区二区| 久久夜色精品国产| 国产一区二区在线播放| 国产精品裸体瑜伽视频| 少妇特黄a一区二区三区| 日本丰满少妇黄大片在线观看| 精品视频高清无人区区二区三区| 日本不卡一区| 国产精品自拍偷拍视频| 久久久久久久香蕉网| 九九综合九九综合| 极品尤物一区二区三区| 日本一区二区在线| 成人免费观看a| 国产精品国产三级国产aⅴ9色| 日韩欧美猛交xxxxx无码| 91精品综合视频| 在线观看污视频| 国产视频一区二区视频| 欧美日韩高清免费| 日韩在线中文字幕| 亚洲精品影院| 日本精品视频在线播放| 国产精品av电影| 精品久久久久久无码国产| 国内一区二区三区在线视频| 播播国产欧美激情| 久久久影视精品| 日韩专区第三页| 久草视频国产在线| 人妻无码视频一区二区三区| 视频在线一区二区三区| 色老头一区二区三区在线观看| 精品国产一区二区三区久久狼5月 精品国产一区二区三区久久久狼 精品国产一区二区三区久久久 | 午夜精品一区二区三区av| 国产日韩第一页| 伊人久久大香线蕉av一区| 国产精品有限公司| 欧美一区二区色| 国产精国产精品| 欧美日韩国产精品激情在线播放| 久久久噜噜噜久久| 亚洲高清乱码| 久久精品亚洲一区| 久久久99免费视频| 免费在线黄网站| 国产精品二区三区| aaa级精品久久久国产片| 区一区二区三区中文字幕| 国产精品二区在线观看| 国产高清免费在线| 国产免费一区视频观看免费| 天天在线免费视频| 国产精品第100页| 久久精品国产99精品国产亚洲性色| 免费不卡av在线| 日本精品视频在线观看| 精品国偷自产一区二区三区| 久久久久欧美| 成人在线小视频| 免费av一区二区三区| 在线视频福利一区| 国产精品免费看久久久无码| 久久综合一区| 91免费精品视频| 国产亚洲精品美女久久久m| 日本免费久久高清视频| 国产精品日本精品| 国产mv久久久| 国产免费亚洲高清| 韩国v欧美v日本v亚洲| 欧日韩在线观看| 日韩免费观看高清| 日本久久久久亚洲中字幕| 亚洲v日韩v综合v精品v| 米奇精品一区二区三区在线观看| 色阁综合伊人av| www.色综合| 国产精品视频免费在线观看| 久久视频这里只有精品| 日韩有码在线观看| 国产精品私拍pans大尺度在线| 久久久久久久av| 精品国产一区二区三区在线观看| 久久久久久久一区二区三区| 久久视频在线观看免费| 久久精品福利视频| 国产精品三级在线| 欧美精品生活片| 一卡二卡三卡视频| 欧美一级黄色网| 亚洲乱码日产精品bd在线观看| 成人做爰www免费看视频网站| 欧美有码在线视频| 免费看欧美一级片| www.中文字幕在线| 国产成人在线免费看| 国产成人久久777777| 欧美激情亚洲精品| 日本一区二区在线免费播放| 黄色一区三区| 97人人模人人爽视频一区二区| 成人久久久久爱| 色老头一区二区三区在线观看| 欧美激情在线观看视频| 日本不卡在线观看| 黄色av免费在线播放| 麻豆亚洲一区| 久久免费观看视频| 超在线视频97| 日本91av在线播放| 国产美女精品视频| 久久精品免费电影| 一区二区三区四区国产| 欧美在线亚洲一区| 久久亚洲国产成人精品无码区| 另类美女黄大片| 欧美亚洲成人网| 国产精品97在线| 在线视频一区观看| 免费观看美女裸体网站| 国产成人综合精品在线| 在线视频欧美一区| 国产日韩欧美一区二区| 久久精品夜夜夜夜夜久久| 日韩福利在线| 久久久久久久久久久久久国产| 亚洲一区在线直播| 国产综合视频在线观看| 国产精品视频在线免费观看| 日韩欧美精品久久| 国产精品国产精品国产专区不卡 | 最新av网址在线观看| 久久久久久国产精品mv| 欧美大香线蕉线伊人久久 | 色偷偷88888欧美精品久久久| 韩国福利视频一区| 视频在线99| 久久成年人视频| 久久久久久综合网天天| 国产精品专区h在线观看| 日本婷婷久久久久久久久一区二区| 久久久久久亚洲精品不卡 | 国产成人精品自拍| 91精品久久香蕉国产线看观看| 欧美日韩精品久久久免费观看| 欧美成人免费在线观看| 国产成人精品日本亚洲| 国产欧美日韩免费看aⅴ视频| 日本香蕉视频在线观看| 国产999精品视频| 国产精品久久久久久久7电影| 久久亚洲精品欧美|