Re: [問題] 快速 90/270度 旋轉

看板Programming作者 (IWH68S0XZ8M89)時間18年前 (2008/01/04 02:14), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/8 (看更多)
※ 引述《cjjj21 (追求平凡的幸福)》之銘言: : 由於工作的關係需要一個快速的旋轉函式... : 需求是將一塊 bitmap buffer 旋轉後填到另一塊 buffer 上... : 例如 320x240 的 buffer, 旋轉後貼到 240x320 的 buffer 上... : 一個一個pixel搬的速度實在慢到無法接受... : 有沒有哪位大大知道一些比較快速的演算法? : 非常感謝!! 個人以為以cpu cache的角度來說 頂多只能加速到一次搬幾行/列 因為這幾乎等同於矩陣轉置 不管是讀出方或寫入方總要有一個是直的跑下來 而這個地方對cpu cache是最不利的 (因為陣列是row major排列 但直的讀下來卻相當於column major順序) -- 'You've sort of made up for it tonight,' said Harry. 'Getting the sword. Finishing the Horcrux. Saving my life.' 'That makes me sound a lot cooler then I was,' Ron mumbled. 'Stuff like that always sounds cooler then it really was,' said Harry. 'I've been trying to tell you that for years.' -- Harry Potter and the Deathly Hollows, P.308 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.30.84
文章代碼(AID): #17VINhw5 (Programming)
討論串 (同標題文章)
文章代碼(AID): #17VINhw5 (Programming)