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

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫COP3502、Python程序設(shè)計(jì)代做
代寫COP3502、Python程序設(shè)計(jì)代做

時(shí)間:2024-10-23  來源:合肥網(wǎng)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





 

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

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手,多多出評軟件徽y1698861
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁版入口 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    伊人久久青草| 99精品视频播放| 国产另类自拍| 精品国产综合| 国产精品午夜av在线| 亚洲一区二区不卡视频| 99精彩视频| 天堂av在线中文| 深夜福利日韩在线看| 精品999在线观看| 欧美人交a欧美精品| 91久久精品美女| 日韩视频一二三| 国产精品旅馆在线| 丰满人妻中伦妇伦精品app| 亚洲欧洲一二三| 久久艹中文字幕| 欧美xxxx黑人又粗又长密月| 久久亚洲成人精品| 成人精品视频久久久久| 日本不卡一二三区| 操91在线视频| 久久综合狠狠综合久久综青草| 欧美亚洲午夜视频在线观看| 精品免费日产一区一区三区免费| 91精品视频网站| 欧美亚洲视频在线看网址| 欧美片一区二区三区| 国产二区视频在线播放| 黄色大片中文字幕| 亚洲国产精品一区在线观看不卡| 色偷偷888欧美精品久久久| 黑人中文字幕一区二区三区| 在线视频不卡一区二区| 久久久久久久免费视频| 国产欧美 在线欧美| 日本欧美精品在线| 欧美精品在线免费播放| 国产v综合ⅴ日韩v欧美大片| 精品视频免费观看| 婷婷五月综合缴情在线视频| 国产精品久久久久久久久影视| 91精品视频在线免费观看| 欧美极品欧美精品欧美| 亚洲国产一区二区三区在线播| 国产精品爽爽爽| 91久久久久久久久久久| 欧美日韩亚洲一区二区三区在线观看| 中文字幕中文字幕在线中一区高清 | 精品国产乱码久久久久久88av | 日韩网站在线免费观看| 在线丝袜欧美日韩制服| 国产成人精品视频在线观看| av在线免费观看国产| 黄瓜视频免费观看在线观看www| 午夜精品蜜臀一区二区三区免费| 国产精品黄页免费高清在线观看| 久久精品一二三区| 成人在线小视频| 欧美日韩天天操| 日韩在线电影一区| 一区二区不卡在线观看 | 国产精品福利网站| 日韩在线视频一区| 91精品国产网站| 国产欧美日韩中文| 狠狠精品干练久久久无码中文字幕| 亚洲国产一区二区三区在线播| 国产精品久久亚洲7777| 久久99精品国产一区二区三区| 99久久国产免费免费| 国产这里只有精品| 国内精品视频在线播放| 欧美日韩国产综合视频在线| 日韩av不卡在线| 五月天亚洲综合情| 亚洲精品乱码久久久久久蜜桃91| 久久99精品久久久久久噜噜| 国产精品视频福利| 精品国内产的精品视频在线观看| 久久精品国产精品亚洲精品色| 69av视频在线播放| 68精品久久久久久欧美| 国产精品亚洲激情| 国产精品香蕉av| 国产欧美日韩一区| 国产一区二区在线免费视频| 狠狠爱一区二区三区| 欧美日韩一区二区三区免费 | 亚洲免费av网| 亚洲精品一区二区三区蜜桃久 | 国产精品果冻传媒潘| 久久精品影视伊人网| 国产精品偷伦免费视频观看的| 日韩专区在线播放| 国产精品日本精品| 久久在线免费观看视频| 久久777国产线看观看精品| 中文字幕色呦呦| 亚洲电影一二三区| 欧美一区二区三区四区夜夜大片| 性亚洲最疯狂xxxx高清| 日本最新高清不卡中文字幕| 日韩精品免费一区| 欧美视频小说| 国内精品久久久| 国产日产久久高清欧美一区| 成人精品一区二区三区电影免费| 91久久精品国产91性色| 久久精品ww人人做人人爽| 日韩亚洲在线观看| 国产精品日韩专区| 欧美成在线观看| 一本色道久久88亚洲精品综合| 亚洲精品蜜桃久久久久久| 日本精品一区二区三区高清 久久| 欧美视频小说| 国产热re99久久6国产精品| 99视频免费观看蜜桃视频| 国产精成人品localhost| 久久波多野结衣| 国产精品日韩欧美一区二区三区| 精品国产91亚洲一区二区三区www| 亚洲尤物视频网| 日韩视频第二页| 国外色69视频在线观看| 国产精品尤物福利片在线观看| 91精品综合久久久久久五月天| 久久亚洲综合网| 国产精品毛片a∨一区二区三区|国 | 日本欧美中文字幕| 蜜桃在线一区二区三区精品| 国产精品一区二区三区久久久 | 国产高清免费在线| 国产精品爽爽爽爽爽爽在线观看| 久色乳综合思思在线视频| 亚洲自拍小视频| 日韩视频在线免费播放| 国产在线观看91精品一区| 114国产精品久久免费观看| 久久精品福利视频| 一区二区三区国产福利| 欧美最猛性xxxx| 国产精品午夜视频| 久久精品色欧美aⅴ一区二区| 在线视频一二三区| 日韩精品一区二区三区久久 | 国产99视频精品免费视频36| 日日噜噜夜夜狠狠久久丁香五月| 黄色一级大片在线观看| 91精品综合视频| 国产精品电影一区| 日本免费久久高清视频| 国产麻花豆剧传媒精品mv在线| 久久久久久九九| 亚洲影院在线看| 国语自产精品视频在线看一大j8| 久久伊人一区二区| 久久99久久99精品免观看粉嫩| 日韩精品一区中文字幕| 99热在线播放| 久久久久久久999| 亚洲精品久久区二区三区蜜桃臀 | 欧美一级爱爱| 国产精品99久久99久久久二8| 国产精品对白刺激久久久| 日本不卡在线观看| youjizz.com亚洲| 欧美精品一区三区| 欧美日韩精品免费观看| 国产福利成人在线| 亚洲国产精品一区在线观看不卡 | 欧美一区二区三区四区夜夜大片| 国产欧美一区二区在线播放| 精品国产视频在线| 日韩在线视频在线观看| 成人做爽爽免费视频| 国产精品久久久久久亚洲影视 | 日本高清久久一区二区三区| 成人久久18免费网站漫画| 国产精品初高中精品久久| 欧美久久久久久久久久久久久| 国产suv精品一区二区三区88区| 亚洲天堂av免费在线观看| 国产亚洲欧美一区二区三区| 久久精品国产欧美亚洲人人爽| 日本亚洲导航| 国产激情片在线观看| 亚洲成熟丰满熟妇高潮xxxxx| 国产精品一区av| 国产99久久九九精品无码| 欧美第一黄网| 播播国产欧美激情| 欧日韩一区二区三区| 日韩专区在线播放| 青青视频免费在线观看| 久久久久久久久久久久久国产 | 欧美极品在线播放| 欧美日韩国产精品激情在线播放| 91久色国产|