1 / 44

BITMAP FILE & T-ENGINE

BITMAP FILE & T-ENGINE. Prepared by: HỒ HOÀNG NGUYÊN - 50701616 LÊ HỮU KHÔI NGUYÊN - 50701619. 2. 1. Bitmap’s structure. How to load a bitmap file on T-engine. Contents. 1. Bitmap’s structure. BITMAP FILE & T-ENGINE. Presented by Ho Hoang Nguyen. Bitmap’s Structure.

zonta
Download Presentation

BITMAP FILE & T-ENGINE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BITMAP FILE & T-ENGINE Prepared by: HỒ HOÀNG NGUYÊN - 50701616 LÊ HỮU KHÔI NGUYÊN - 50701619

  2. 2 1 Bitmap’s structure How to load a bitmap file on T-engine Contents Ứng dụng hệ thống nhúng

  3. 1 Bitmap’s structure BITMAP FILE & T-ENGINE Presented by Ho Hoang Nguyen Ứng dụng hệ thống nhúng

  4. Bitmap’s Structure Uncompressed standard image file format by Microsoft Color depth of 1, 4, 8, 16, 24, 32, 48, or 64 bits per pixel Little-endian. CónhiềuphiênbảnđịnhdạngBMP. Version 1.x, 2.x, 3.x Ứng dụng hệ thống nhúng

  5. Bitmap’s Structure File Header File Header: 14 bytes Bitmap Header: 40 bytes Color Palette: Bitmap Data: Bitmap Header ColorPalette Bitmap Data Ứng dụng hệ thống nhúng

  6. FileHeader(14 bytes) Signature: 2 bytes, always ‘BM’ (4D42h) File size:4 bytes Reserved: 4 bytes, always 0 Data offset: 4 bytes, starting position of image data in bytes Ứng dụng hệ thống nhúng

  7. Bitmap Header Size: 4 bytes, size of this header in bytes Width: 4 bytes, image width in pixels Height: 4 bytes, image height in pixels Planes: 2 bytes, number of color planes (usual1) Bitcount: 2 bytes, number of bits per pixel. Colours in Bitmap file = 2Bitcount Ứng dụng hệ thống nhúng

  8. Bitmap Header(cont) • Compression: 4 bytes • = 0: the data is uncompressed • = 1:the 8-bit RLE(Run Length Encoding) algorithm was used • = 2: the 4-bit RLE algorithm was used • Image Size: • the size of the stored bitmap in bytes. • This value is typically zero when the bitmap data is uncompressed Ứng dụng hệ thống nhúng

  9. Bitmap Header(cont) XpixelsPerM: 4 bytes horizontal resolutions of the bitmap in pixels per meter YpixelsPerM: 4 bytes vertical resolutions of the bitmap in pixels per meter. ColorsUsed: 4 bytes, the number of colors present in the palette ColorsImportant: 4 bytes ,the number of significant colors in the palette Ứng dụng hệ thống nhúng

  10. Color Palette • When Bitcount ≤ 8 (256 colors), • Arranged in order of importance of each element • Size = 4 bytes * elements. • Each element of the palette is three bytes in length: • Red:1 byte • Green: 1 byte • Blue:1 byte • Reserve: 1 byte, always 0 Ứng dụng hệ thống nhúng

  11. Bitmap Data Depend on BitCount andbit compression. Pixelsare stored from the bottom up and from left to right Add 0 to be full in 32 bits No compression => each pixel’s line has fix length. Màu Pixel’s line= 0 => 1st of Color Palette Pixel’s line= 255 => 256th of Color Palette Pixel’s line>255 => this bitmap file doesn’t use Color Palette Ứng dụng hệ thống nhúng

  12. Bitmap Data(cont) • BitCount =1 and compression = 0 • 1 byte => 8 pixels • 2 colors: black and white • Add 3 bytes 0 => 32 bits • BitCount =4 and compression = 0 • 1 byte => 2 pixels • 16 colors • Add 3 bytes 0 =>32 bits Ứng dụng hệ thống nhúng

  13. Bitmap Data(cont) • BitCount =8 and compression = 0 • 1 byte => 1 pixel • 256 colors • Add 3 bytes 0 => 32 bits • BitCount =24 and compression = 0 • 4 bytes => 1 pixel • No color palette Ứng dụng hệ thống nhúng

  14. Bitmap data(cont) BitCount =4 và compression = 2 Ứng dụng hệ thống nhúng

  15. Bitmap data(cont) Ứng dụng hệ thống nhúng

  16. Bitmap data(cont) BitCount =8 và compression = 1 Ứng dụng hệ thống nhúng

  17. Bitmap data(cont) Ứng dụng hệ thống nhúng

  18. 2 How to load a bitmap file on T-engine BITMAP FILE & T-ENGINE Presented by Le HuuKhoi Nguyen Ứng dụng hệ thống nhúng

  19. How to load a bitmap file on T-Engine • Analyses: • Subsystem UNIX Emulator (provided by T-Kernel Extension) devotes specific functions for browsing and reading files in CF card (SYSDISK). • The main task (bmp_task) will be responsible for controlling the SCREEN device and initializing bmpialization screen. Ứng dụng hệ thống nhúng

  20. How to load a bitmap file on T-Engine Flowchart: Ứng dụng hệ thống nhúng

  21. bmp_task Ứng dụng hệ thống nhúng

  22. bmp_task Open SCREEN device Ứng dụng hệ thống nhúng

  23. bmp_task Read device in specific image area Ứng dụng hệ thống nhúng

  24. bmp_task Color map setting Ứng dụng hệ thống nhúng

  25. bmp_task Initbmpialize screen Ứng dụng hệ thống nhúng

  26. bmp_task • Terminate & delete bmp_task Close SCREEN device Ứngdụnghệthốngnhúng

  27. How to load a bitmap file on T-Engine • So far, we learnt about the structure of a bitmap file: • Bitmap File Header • Bitmap Infor Header • ColourPallette (Optional) • Data Image • Certainly, we need to define some structures for future use. Ứngdụnghệthốngnhúng

  28. How to load a bitmap file on T-Engine Bitmap File Header Ứngdụnghệthốngnhúng

  29. How to load a bitmap file on T-Engine Bitmap Info Header Ứngdụnghệthốngnhúng

  30. Major functions for reading and loading a bitmap file int charArray2Int: Ứngdụnghệthốngnhúng

  31. Major functions for reading and loading a bitmap file void show_BMP: Ứngdụnghệthốngnhúng

  32. Major functions for reading and loading a bitmap file unsigned long ** read_BMP: Ứngdụnghệthốngnhúng

  33. unsigned long ** read_BMP Open File: Ứngdụnghệthốngnhúng

  34. unsigned long ** read_BMP Read BMFH: Ứngdụnghệthốngnhúng

  35. unsigned long ** read_BMP Read BMIH: Ứngdụnghệthốngnhúng

  36. unsigned long ** read_BMP Calculate the pad based on bitcount: Ứngdụnghệthốngnhúng

  37. unsigned long ** read_BMP Calculate the pad based on bitcount: Ứngdụnghệthốngnhúng

  38. unsigned long ** read_BMP Calculate the pad based on bitcount: Ứngdụnghệthốngnhúng

  39. unsigned long ** read_BMP Update pixels’ value: Ứngdụnghệthốngnhúng

  40. unsigned long ** read_BMP Update pixels’ value: Ứngdụnghệthốngnhúng

  41. unsigned long ** read_BMP Update pixels’ value: Ứngdụnghệthốngnhúng

  42. How to load a bitmap file on T-Engine How about GIF, JPEG format?? Ứngdụnghệthốngnhúng

  43. REFERENCE • T-Engine/SH7760 Development Kit, T-Kernel specification. • T-Engine/ SH7760 Development Kit, Device driver manager. • T-Engine/ SH7760 Development Kit Manual. • Personal Media Corporation: Sample Programs • NguyễnHoàngAnh, Vũ TuấnThanh, NguyễnPhạmAnhKhoa, “Tìmhiểuvà pháttriểnứngdụngtrênthiết bị T-Enigne SH7760”, LuậnVănĐạiHọc. • NguyễnThị ThanhTrúc, “Hiệnthựcchươngtrình Paint trênthiết bị T-Engine SH7760”, LuậnVănĐạiHọc. • http://www.t-engine.org • http://tronweb.super-nova.co.jp • http://www.personal-media.co.jp/te/en/tekit.html Ứngdụnghệthốngnhúng

  44. Thank You !

More Related