something about BMP
2011-05-24 17:36
225 查看
1, bmp格式的读取什么的看cximage这个open source的项目最好了
http://www.codeproject.com/KB/graphics/cximage.aspx
有源代码
2,不太喜欢把整个库引入?
那可以摘抄一部分进去。
bmp的pitch计算:当然可以把32和4合并,但是这样会比较给人混淆,所以这里依旧是/32)*4
3,bmp中cpu端读取数据,比如从bmp获取heightmap。
有mspaint打开一个bmp图,左下是内存的开始点(0,0)点,右上是(1,1)点。
x方向是右,y方向是上。
而在gpu中sample的时候(0,0)点是左上,(1,1)点是右下,必要的情况下要做一些处理来对应好。
http://www.codeproject.com/KB/graphics/cximage.aspx
有源代码
2,不太喜欢把整个库引入?
那可以摘抄一部分进去。
bmp的pitch计算:当然可以把32和4合并,但是这样会比较给人混淆,所以这里依旧是/32)*4
u32 GetBmp24BitPitch( u32 sizeX ) { return (((24*sizeX)+31)/32)*4; }
3,bmp中cpu端读取数据,比如从bmp获取heightmap。
有mspaint打开一个bmp图,左下是内存的开始点(0,0)点,右上是(1,1)点。
x方向是右,y方向是上。
而在gpu中sample的时候(0,0)点是左上,(1,1)点是右下,必要的情况下要做一些处理来对应好。
相关文章推荐
- Something about the Sampling of OSNs Data
- something about linux Signals
- something about Macro
- Something about Music
- Something About Pretect Mode
- something about vm migration
- Something about SnagIt
- something about development of hardware
- Something about Java
- 解决:ruby We're sorry, but something went wrong.We've been notified about this issue and we'll take a look at it shortly.
- Something about "for"
- something about jquery
- Something About Singleton
- Something must be done about it.
- to tell something in brief about default init receive window of TCP
- Something About RMSEP
- something about com
- something about teletext
- Something about overloaded
- Learn something basic about ADO.NET [From 程序员大本营]