99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

代寫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++程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                亚洲男同性视频| 亚洲欧美日韩国产综合在线| 亚洲特级片在线| 岛国一区二区在线观看| 国产精品无遮挡| 色88888久久久久久影院野外| 亚洲精品乱码久久久久| 欧美日韩一区二区欧美激情| 另类的小说在线视频另类成人小视频在线 | 国产一区二区福利视频| 欧美v亚洲v综合ⅴ国产v| 成人午夜激情视频| 亚洲在线免费播放| 精品少妇一区二区三区在线播放| 99热99精品| 久久成人免费电影| 亚洲一本大道在线| 中文字幕 久热精品 视频在线 | 欧美一区二区三区四区五区| 国模大尺度一区二区三区| 亚洲精品中文字幕乱码三区| 欧美精品黑人性xxxx| 91网站最新地址| 国产精品综合在线视频| 亚洲精品福利视频网站| 久久精品亚洲一区二区三区浴池| 欧美日韩一区二区三区不卡| 青青青伊人色综合久久| 亚洲综合小说图片| 精品成人a区在线观看| 欧美影院一区二区| 91亚洲国产成人精品一区二三| 美女网站色91| 图片区小说区区亚洲影院| 国产精品色哟哟| 日韩精品自拍偷拍| 日韩一区二区免费在线观看| 91久久精品网| 成av人片一区二区| 国产精品一区二区三区99| 日韩电影在线观看电影| 一区二区在线看| 日韩伦理av电影| 亚洲欧洲精品天堂一级| 久久久www成人免费毛片麻豆 | 亚洲素人一区二区| 欧美国产日韩a欧美在线观看| 91精品久久久久久久99蜜桃| 欧美伊人久久久久久午夜久久久久| voyeur盗摄精品| av欧美精品.com| 99久久精品国产观看| 色婷婷综合中文久久一本| 成人av网站在线观看免费| 国产成人h网站| 成人免费毛片app| av在线不卡观看免费观看| 成人国产视频在线观看| 东方aⅴ免费观看久久av| 高清视频一区二区| aaa亚洲精品| 在线观看三级视频欧美| 日本道免费精品一区二区三区| 在线精品视频免费观看| 蜜臀av一区二区在线观看| 奇米影视一区二区三区小说| 日本成人在线网站| 久久99国产精品麻豆| 国产精品主播直播| 成人精品小蝌蚪| 欧美在线一区二区三区| 91精品国产色综合久久久蜜香臀| 日韩欧美一区二区免费| 国产三级精品视频| 伊人婷婷欧美激情| 久久99久国产精品黄毛片色诱| 懂色一区二区三区免费观看| 99麻豆久久久国产精品免费优播| 欧美午夜电影在线播放| 久久综合五月天婷婷伊人| 中文字幕av不卡| 亚洲一二三区不卡| 国产成人一区二区精品非洲| 欧美丝袜丝交足nylons| 久久综合资源网| 亚洲综合图片区| 高清国产一区二区| 欧美一区二区三区视频免费 | 777午夜精品视频在线播放| 欧美一区二区在线免费播放| 国产农村妇女毛片精品久久麻豆| 亚洲永久免费av| 东方欧美亚洲色图在线| 91精品久久久久久蜜臀| 亚洲乱码国产乱码精品精可以看| 激情五月激情综合网| 在线观看免费视频综合| 精品国产乱码久久久久久牛牛| 亚洲婷婷国产精品电影人久久| 蜜臀a∨国产成人精品| 欧美在线|欧美| 精品盗摄一区二区三区| 亚洲一区二区三区视频在线| 懂色一区二区三区免费观看| 日韩视频一区二区三区在线播放| 国产精品毛片高清在线完整版| 亚洲地区一二三色| 色综合久久88色综合天天6| 精品粉嫩超白一线天av| 日本伊人色综合网| 欧美性大战久久久| 樱花草国产18久久久久| 成人国产一区二区三区精品| 久久夜色精品国产噜噜av| 五月天一区二区三区| 99在线精品观看| 久久精品亚洲麻豆av一区二区| 免费久久99精品国产| 欧美午夜精品久久久久久孕妇 | 久久99九九99精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 久久综合九色综合97_久久久| 另类综合日韩欧美亚洲| 欧美蜜桃一区二区三区| 亚洲免费av观看| 成人性生交大合| 久久精品在线免费观看| 精品在线一区二区三区| 久久香蕉国产线看观看99| 日本不卡在线视频| 欧美色图在线观看| 日韩国产一区二| 日韩一区二区在线观看视频 | 久久se精品一区二区| 91麻豆精品国产91久久久使用方法 | 国产日韩精品一区二区浪潮av | 日韩电影在线观看一区| 日韩欧美国产一二三区| 免费久久99精品国产| 精品久久国产字幕高潮| 精品一区二区三区免费视频| 精品国产精品一区二区夜夜嗨| 午夜久久电影网| 欧美日韩你懂得| 26uuu久久天堂性欧美| 亚洲欧美电影院| 欧美v亚洲v综合ⅴ国产v| 精品美女在线观看| 久久国产婷婷国产香蕉| 欧美日韩国产三级| 五月婷婷久久综合| 91精品国产综合久久久久| 亚洲靠逼com| 欧美猛男超大videosgay| 青青草国产精品97视觉盛宴| 91精品国产手机| 国产一区二区91| 中文字幕在线不卡视频| 91福利国产精品| 亚洲高清免费观看高清完整版在线观看| 99久久精品免费看国产免费软件| 一区二区三区影院| 欧美男人的天堂一二区| 久久99精品久久久久久国产越南| 久久众筹精品私拍模特| 99久久久免费精品国产一区二区| 伊人一区二区三区| 日韩一区二区在线看| 成人av第一页| 美女一区二区久久| 中文字幕中文字幕一区| 欧美在线不卡视频| 国产福利一区在线| 亚洲激情五月婷婷| 欧美大片在线观看一区二区| 大胆欧美人体老妇| 午夜伊人狠狠久久| 国产欧美精品一区| 欧美美女喷水视频| 色综合久久综合网| 久久国产精品一区二区| 日韩毛片视频在线看| 日韩精品一区二区三区在线 | 91精品国产综合久久久久| 99精品视频在线免费观看| 五月天丁香久久| 一区二区三区丝袜| 中文字幕乱码久久午夜不卡| 这里只有精品免费| 欧美性高清videossexo| 成人av网在线| 成人国产视频在线观看| 午夜精品久久久久久久| 国产精品久久久久一区二区三区| 精品久久久久久久久久久院品网| 91精品国产综合久久精品性色| 色又黄又爽网站www久久| 国产精品一二三四| 国产一区二区三区黄视频 | 91视频免费播放|