check if a pixmap is a subrect of another

BlitzMax Forums/BlitzMax Programming/check if a pixmap is a subrect of another

nitti(Posted 2012) [#1]
Hi

actual question:

what would be the fastest way of checking if an image/pixmap is also actually a subrect on another image/pixmap ?


context:
I am in the process of writing a texture atlas generator, it's working rather well. In my case I'll be having many pre-rendered rotated 'voxel' bodyparts as images.

because i plan to have bodyparts that are rolled/yawed/pitched and bones of a few lengths/shapes/dimensions the numbers add up very quickly.

so i had an idea to drastically cut down the amount of images in the atlas; start with saving bones images with the biggest length, and for each bone that is sort of the same but shorter -> check if the desired image would be an subimage of the bigger length bone image ...

oh and the actual rectpacking is working and might be usefull for someone:


on my system it packs 10000 images in 18 ms, very neatly packed also