Unsafe Per Pixel access, 30ms access for 1756000 pixels

前端 未结 5 1523
轮回少年
轮回少年 2020-12-28 10:42

So I\'ve been sharing some thoughts on the above topic title on my website about fast, unsafe pixel access. A gentlemen gave me a rough example of how he\'d do it in C++, bu

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-28 11:19

    Instead of checking each and every pixel, you can just perform a basic memory compare of the 2 bitmaps. In C, something like memcmp().

    This would give you a much quicker test to let you know that the images are the same or not. Only when you know they are different do you need to resort to the more expensive code that will help you determine where they are different (if you even need to know that).

    I am not a C# person though, so I don't know how easy it is to get access to the raw memory.

提交回复
热议问题