国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女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怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    欧美精品一区二区性色a+v| 欧美日韩高清在线观看| 日韩一二三在线视频播| 亚洲精品一品区二品区三品区| 国内精品免费午夜毛片| 久久久久久久久久久免费精品| 国产精品美女999| 日本精品久久中文字幕佐佐木| 欧美老熟妇喷水| 性色av香蕉一区二区| 久久99精品久久久久久三级| 欧美日韩高清在线观看| 激情五月婷婷六月| 国产精品美女www爽爽爽视频| 欧美日韩亚洲一二三| 九色自拍视频在线观看| 黄色一级一级片| 久久国产精品偷| 日本一区二区三区视频在线播放| av无码久久久久久不卡网站| 一卡二卡三卡视频| 国产色婷婷国产综合在线理论片a 国产色一区二区三区 | 久久久噜噜噜久久久| 亚洲精品国产系列| 91精品91久久久中77777老牛| 亚洲精品欧美一区二区三区| 91福利视频在线观看| 欧美一级视频免费在线观看| 国产国语刺激对白av不卡| 日本一区二区三区视频免费看 | 久操手机在线视频| 日韩精品久久久免费观看| 久久国产午夜精品理论片最新版本| 日本精品免费视频| 日韩在线免费av| 欧美xxxx黑人又粗又长密月| 久久成年人免费电影| 成人久久一区二区| 色噜噜狠狠色综合网| 日韩中文字幕在线观看| 国产尤物av一区二区三区| 一道本在线观看视频| 91精品视频免费看| 日韩精品无码一区二区三区| 久久久久久久激情视频| 欧美诱惑福利视频| 久久亚洲国产精品| 99久热re在线精品视频| 日韩一级特黄毛片| 日韩视频免费中文字幕| 精品视频在线观看一区二区| 九色精品免费永久在线| 久久久亚洲精品无码| 欧美在线一级视频| 精品国产一区二区三区久久久久久| 99视频日韩| 欧美精品与人动性物交免费看| 欧美xxxx18性欧美| 91好吊色国产欧美日韩在线| 日本一区二区三区四区高清视频 | 欧美日韩精品久久| 精品国产乱码久久久久| 99久久免费观看| 日本中文字幕成人| 国产精品久久电影观看| 91精品久久久久久蜜桃| 加勒比海盗1在线观看免费国语版 加勒比在线一区二区三区观看 | 一区二区三区不卡在线| 911国产网站尤物在线观看| 欧美在线欧美在线| 欧美激情在线一区| 久久久久久久久久久久久久国产| 国产又黄又爽免费视频| 无码人妻h动漫| 国产精品露脸自拍| 91九色丨porny丨国产jk| 欧美日韩精品一区| 亚洲高清视频一区| 国产精品久久久久久久久久久新郎| 国产欧美123| 人偷久久久久久久偷女厕| 一区二区三区观看| www.美女亚洲精品| 91麻豆桃色免费看| 黄色国产精品一区二区三区| 午夜精品久久久内射近拍高清| 91久久久一线二线三线品牌| 国产精品户外野外| 久久这里只有精品视频首页| 久久资源免费视频| 日本新janpanese乱熟| 色欲av无码一区二区人妻| 黄色成人在线免费观看| 99国产精品久久久久老师| www污在线观看| 久久99久久99精品中文字幕| 欧美精品一区二区三区国产精品| 久久久人成影片一区二区三区观看| 好吊色欧美一区二区三区四区| 无码人妻精品一区二区三区99v| 国产精品免费在线播放| 久久精品日韩| 国产精品27p| 成人精品在线观看| 国内自拍欧美激情| 欧美又大又粗又长| 日韩视频在线观看视频| 亚洲 日韩 国产第一区| 久久精品人人做人人爽| 国产精品亚洲一区二区三区| 精品欧美一区二区三区久久久 | 欧美日韩一区在线视频| 少妇熟女一区二区| 亚洲人成人77777线观看| 久久99热这里只有精品国产| 国产精品第10页| 国产精品成人久久电影| 国产精品免费网站| 精品国产依人香蕉在线精品| 九色91视频| 深夜福利日韩在线看| 久久av二区| 久久99影院| 国产福利视频一区| 久久久免费精品| 国产成人精品a视频一区www| 久久久成人精品一区二区三区| 久久久人成影片一区二区三区| 99高清视频有精品视频| av中文字幕av| 成人欧美一区二区三区黑人| 国产日韩一区二区三区| 痴汉一区二区三区| 欧美在线一区二区三区四区| 久久精品国产2020观看福利| 欧美亚洲国产日韩2020| 久久精品视频免费播放| 国产精品自产拍在线观| 一区二区三区四区欧美日韩| 久久综合色一本| 91久久久久久国产精品| 亚洲不卡1区| 午夜免费电影一区在线观看| 亚洲欧美丝袜| 亚洲国产日韩美| 日本一区不卡| 青青草原av在线播放| 欧美中文在线观看| 免费黄色福利视频| 国产精品一区二区三区不卡| 97欧洲一区二区精品免费| 久热免费在线观看| 久久九九亚洲综合| 久久精品99国产精品酒店日本| 久久天天躁狠狠躁夜夜av| 精品乱色一区二区中文字幕| 一区二区不卡在线视频 午夜欧美不卡' | 国产肥臀一区二区福利视频| 久草视频这里只有精品| 国产精品视频免费在线| 九色成人免费视频| 涩涩日韩在线| 虎白女粉嫩尤物福利视频| 国产剧情久久久久久| 久久人人97超碰精品888| 久久免费看av| 国产精品秘入口18禁麻豆免会员| 欧美精品在线免费观看| 亚洲国产精品视频一区| 日本中文字幕在线视频观看 | 久久夜色精品国产| 最新不卡av| 日韩国产一区久久| 国产亚洲精品网站| 91精品国产成人| www.日韩视频| 久久久久久91| 日本va中文字幕| 精品人伦一区二区三区| 成人久久一区二区三区| 久久久久久久91| 米奇精品一区二区三区在线观看| 日本欧美精品在线| 国产精品综合网站| 久久riav| 日韩在线小视频| 日韩视频免费看| 国产精品久久久久久久久久直播| 久久中国妇女中文字幕| 中文字幕av导航| 无码av天堂一区二区三区| 欧美一区1区三区3区公司| 好吊色欧美一区二区三区| 久久久久久久久久久亚洲| 日韩在线小视频| 亚洲一区国产精品| 欧美凹凸一区二区三区视频| 91成人在线视频观看| 精品中文字幕乱| 青草青草久热精品视频在线网站|