Hmm…
因為不知名的原因,The Foundry 並沒有在 Nuke 裏頭支援 .BMP。雖然說,.BMP 是個一點都不專業,用了它,還可能讓對方把你瞧低了的格式,但很不幸地,我們因為一些使用到的程式,不得不去處理 .BMP。在這個情況下,我又希望能保有使用 Nuke 的便利與強大,但又不想三不五時就使用 ImageMagick 的 convert 來轉檔(太慢了,尤其是當圖檔有上千上萬張的時候)的前提下,我用 FreeImage 給 Nuke 寫了個 bmpReader。
希望對某些人,也有幫上一點唯不足道的忙~
#include <stdio.h> #include <string.h> #include <freeimage.h> #include "DDImage/DDWindows.h" #include "DDImage/Reader.h" #include "DDImage/Row.h" #include "DDImage/Knob.h" #include "DDImage/Knobs.h" #include "DDImage/Thread.h" #include "DDImage/Memory.h" using namespace DD::Image; class BmpReader : public Reader { private: unsigned int m_bpp; unsigned int m_width; unsigned int m_height; FIBITMAP* m_bitmap; FreeImageIO m_io; public: BmpReader(Read*); ~BmpReader(); void engine(int y, int x, int r, ChannelMask, Row&); static const Description d; }; BmpReader::BmpReader(Read* r) : Reader(r) { FreeImage_Initialise(TRUE); m_bpp = 0; m_width = 0; m_height = 0; m_bitmap = FreeImage_Load(FIF_BMP, filename(), BMP_DEFAULT); if( m_bitmap ) { m_bpp = FreeImage_GetBPP(m_bitmap); m_width = FreeImage_GetWidth(m_bitmap); m_height = FreeImage_GetHeight(m_bitmap); //printf("bpp: %d\n", m_bpp); //printf("width: %d\n", m_width); //printf("height: %d\n", m_height); set_info(m_width, m_height, m_bpp/8); } else { } } BmpReader::~BmpReader() { if( m_bitmap ) { FreeImage_Unload(m_bitmap); m_bitmap = NULL; } FreeImage_DeInitialise(); } void BmpReader::engine(int y, int x, int r, ChannelMask channels, Row& row) { BYTE* pixel = FreeImage_GetScanLine(m_bitmap, y); // BGR !
For some reason I don’t know, The Foundry doesn’t make Nuke support .BMP’s read/write. License issue? Anyway, we does have some files coming as .BMP such that I code this bmpReader with help of FreeImage. Hopefully, someone gets benefits from it.
Some demo appear interesting to me this year:
Matrix LED Unit FuSA2 Touch Display 360-degree Autostereoscopic Display (It’s Autostereo! Definitely take a look at it!) Beyond the Surface (from Taiwan!) Head-mounted Photometric Stereo (This reminds me what has been done in ICT Graphics Lab led by Paul Debevec) Touch Light Through the Leaves (Anything more weird and abstract than this one?) QuintPixel (HDR Display?) Acroban the Humanoid (Much more interesting and cute than robots developed by CMU)
Check it out!
All other animations in 華夏技術學院/數位媒體設計系 : A4。
PS. 我印象最深刻的,就這部陀螺島與 Paper Deal 了,可惜 Paper Deal 沒有全片。
PS 2. 作品普遍都有「時間過長」的問題,得學著 narrow down storyline.
PS 3. 到一個學校演講完,看學生的作品,與他們一同吃飯聊聊,一直是件讓人心情很愉快的事,而且還挺「正面」的 :D
Our human perceptual systems have been driving changes in our entertainment media, one sensor at a time.
Since we are built to see motion, pictures naturally evolved into motion pictures. Motion pictures evolved to incorporate sound, color, 3D sound, and 3D vision. We use all of these, all day long. There’s no reason we would want to give any of them up when we watch a movie.