{"id":596,"date":"2013-06-24T14:44:43","date_gmt":"2013-06-24T06:44:43","guid":{"rendered":"http:\/\/guoh.ai\/lifelog\/?p=596"},"modified":"2013-06-24T15:05:15","modified_gmt":"2013-06-24T07:05:15","slug":"memos-about-bitmap","status":"publish","type":"post","link":"https:\/\/guoh.ai\/lifelog\/2013\/06\/memos-about-bitmap\/","title":{"rendered":"Bitmap\u5907\u5fd8"},"content":{"rendered":"<p>\u8fd9\u662f\u4e00\u7bc7\u9605\u8bfbBitmap\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0\uff01<br \/>\n\u7a0b\u5e8f\u8fd0\u884c\u73af\u5883\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">Linux KNIGHT 3.0.0-28-generic #45-Ubuntu SMP Wed Nov 14 21:57:26 UTC 2012 x86_64 x86_64 x86_64 GNU\/Linux<\/pre>\n<p>BMP\u56fe\u50cf\u6587\u4ef6\u88ab\u5206\u62104\u4e2a\u90e8\u5206\uff1a\u4f4d\u56fe\u6587\u4ef6\u5934(Bitmap File Header)\u3001\u4f4d\u56fe\u4fe1\u606f\u5934(Bitmap Info Header)\u3001\u989c\u8272\u8868(Color Map)\u548c\u4f4d\u56fe\u6570\u636e(\u5373\u56fe\u50cf\u6570\u636e\uff0cData Bits\u6216Data Body)\u3002<\/p>\n<p>\u8fd9\u672c\u4e66(<a href=\"http:\/\/vipbase.net\/ipbook\/chap01.htm\" target=\"_blank\">http:\/\/vipbase.net\/ipbook\/chap01.htm<\/a>)\u7b2c\u4e00\u7ae0\u8282\u6709\u8bb2\u8fd9\u4e9b\u3002<\/p>\n<p>biBitCount\uff1a\u6bcf\u4e2a\u50cf\u7d20\u6240\u5360\u7684\u4f4d\u6570(bit)\uff0c\u5176\u503c\u5fc5\u987b\u4e3a1(\u9ed1\u767d\u56fe\u50cf)\u30014(16\u8272\u56fe)\u30018(256\u8272)\u300124(\u771f\u5f69\u8272\u56fe)\uff0c32(\u5e26\u900f\u660e\u5ea6alpha\u901a\u9053\uff0c\u4f4d\u4e8e\u524d8\u4f4d)\u3002<\/p>\n<p>\u4ee5\u4e0b\u8fd9\u51e0\u7bc7\u535a\u5ba2\u6709\u8bb2\u4e9b\u57fa\u672c\u7684\u4e1c\u897f\u3002<br \/>\nhttp:\/\/www.cnblogs.com\/shengansong\/archive\/2011\/09\/23\/2186409.html<br \/>\nhttp:\/\/blog.csdn.net\/yutianzuijin\/article\/details\/8243343<br \/>\nhttp:\/\/blog.csdn.net\/scut1135\/article\/details\/5573395<\/p>\n<p>\u6211\u6709\u53c2\u8003\u4ee5\u4e0a\u8d44\u6599\u4fee\u6539\u51fa\u4e00\u4e2a\u53ef\u4ee5\u5728x86_64 GNU\/Linux\u7f16\u8bd1\u5e76\u8fd0\u884c\u7684\u7a0b\u5e8f\uff0c\u6ce8\u91ca\u91cc\u9762\u6709\u5199\u4e9b\u9700\u8981\u6ce8\u610f\u7684\u5730\u65b9\u3002<br \/>\n<script src=\"https:\/\/gist.github.com\/guohai\/5848088.js\"><\/script><\/p>\n<p>some pitfalls of __attribute__((packed)), plz refer<br \/>\nhttp:\/\/stackoverflow.com\/questions\/8568432\/is-gccs-attribute-packed-pragma-pack-unsafe<br \/>\nhttp:\/\/stackoverflow.com\/questions\/11770451\/what-is-the-meaning-of-attribute-packed-aligned4<br \/>\nhttp:\/\/stackoverflow.com\/questions\/11667181\/why-does-padding-have-to-be-a-power-of-two<br \/>\nhttp:\/\/stackoverflow.com\/questions\/119123\/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member<br \/>\nhttp:\/\/en.wikipedia.org\/wiki\/Data_structure_alignment<\/p>\n<p>Linux\u4e0bBMP\u8f6c\u5316\u4e3aJPEG\u7a0b\u5e8f\u6e90\u4ee3\u7801<br \/>\nhttp:\/\/www.linuxidc.com\/Linux\/2011-03\/33193.htm<\/p>\n<p>\u5982\u679c\u4f60\u81ea\u5df1\u8981\u5f00\u53d1JPEG\u76f8\u5173\u7684\u8bdd\uff0c\u786e\u4fdd\u8fd9\u4e9b\u5305\u662f\u6709\u5b89\u88c5\u7684\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo apt-get install libjpeg62\r\nsudo apt-get install libjpeg62-dev<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u7bc7\u9605\u8bfbBitmap\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0\uff01 \u7a0b\u5e8f\u8fd0\u884c\u73af\u5883\uff1a Linux KNIGHT 3.0.0-28-generic #45-Ubuntu SMP Wed Nov 14 21:57:26 UTC 2012 x86_64 x86_64 x86_64 GNU\/Linux BMP\u56fe\u50cf\u6587\u4ef6\u88ab\u5206\u62104\u4e2a\u90e8\u5206\uff1a\u4f4d\u56fe\u6587\u4ef6\u5934(Bitmap File Header)\u3001\u4f4d\u56fe\u4fe1\u606f\u5934(Bitmap Info Header)\u3001\u989c\u8272\u8868(Color Map)\u548c\u4f4d\u56fe\u6570\u636e(\u5373\u56fe\u50cf\u6570\u636e\uff0cData Bits\u6216Data Body)\u3002 \u8fd9\u672c\u4e66(http:\/\/vipbase.net\/ipbook\/chap01.htm)\u7b2c\u4e00\u7ae0\u8282\u6709\u8bb2\u8fd9\u4e9b\u3002 biBitCount\uff1a\u6bcf\u4e2a\u50cf\u7d20\u6240\u5360\u7684\u4f4d\u6570(bit)\uff0c\u5176\u503c\u5fc5\u987b\u4e3a1(\u9ed1\u767d\u56fe\u50cf)\u30014(16\u8272\u56fe)\u30018(256\u8272)\u300124(\u771f\u5f69\u8272\u56fe)\uff0c32(\u5e26\u900f\u660e\u5ea6alpha\u901a\u9053\uff0c\u4f4d\u4e8e\u524d8\u4f4d)\u3002 \u4ee5\u4e0b\u8fd9\u51e0\u7bc7\u535a\u5ba2\u6709\u8bb2\u4e9b\u57fa\u672c\u7684\u4e1c\u897f\u3002 http:\/\/www.cnblogs.com\/shengansong\/archive\/2011\/09\/23\/2186409.html http:\/\/blog.csdn.net\/yutianzuijin\/article\/details\/8243343 http:\/\/blog.csdn.net\/scut1135\/article\/details\/5573395 \u6211\u6709\u53c2\u8003\u4ee5\u4e0a\u8d44\u6599\u4fee\u6539\u51fa\u4e00\u4e2a\u53ef\u4ee5\u5728x86_64 GNU\/Linux\u7f16\u8bd1\u5e76\u8fd0\u884c\u7684\u7a0b\u5e8f\uff0c\u6ce8\u91ca\u91cc\u9762\u6709\u5199\u4e9b\u9700\u8981\u6ce8\u610f\u7684\u5730\u65b9\u3002 some pitfalls of __attribute__((packed)), plz refer http:\/\/stackoverflow.com\/questions\/8568432\/is-gccs-attribute-packed-pragma-pack-unsafe http:\/\/stackoverflow.com\/questions\/11770451\/what-is-the-meaning-of-attribute-packed-aligned4 http:\/\/stackoverflow.com\/questions\/11667181\/why-does-padding-have-to-be-a-power-of-two http:\/\/stackoverflow.com\/questions\/119123\/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member http:\/\/en.wikipedia.org\/wiki\/Data_structure_alignment Linux\u4e0bBMP\u8f6c\u5316\u4e3aJPEG\u7a0b\u5e8f\u6e90\u4ee3\u7801 http:\/\/www.linuxidc.com\/Linux\/2011-03\/33193.htm \u5982\u679c\u4f60\u81ea\u5df1\u8981\u5f00\u53d1JPEG\u76f8\u5173\u7684\u8bdd\uff0c\u786e\u4fdd\u8fd9\u4e9b\u5305\u662f\u6709\u5b89\u88c5\u7684\u3002 sudo apt-get install libjpeg62 sudo apt-get install libjpeg62-dev<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gfmr_meta_descriptions":[],"_gfmr_multilingual_taxonomy_terms":[],"footnotes":""},"categories":[29,34],"tags":[32],"class_list":["post-596","post","type-post","status-publish","format-standard","hentry","category-c","category-multimedia","tag-gfx"],"_links":{"self":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/comments?post=596"}],"version-history":[{"count":5,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/596\/revisions"}],"predecessor-version":[{"id":605,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/596\/revisions\/605"}],"wp:attachment":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/media?parent=596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/categories?post=596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/tags?post=596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}