MCode for 64bit Gdip_AlphaMask
Posted: 28 Oct 2017, 09:21
Can someone help to make a 64bit compatible mcode from Tic's example for Gdip_AlphaMask , the one posted is x86 machine code only.
Or am i wrong to think that this is the reason it works with ahk 32bit and not with ahk 64bit or does it depend on the cpu only?
Thank you in advance
see https://autohotkey.com/board/topic/1034 ... -aliasing/
Or am i wrong to think that this is the reason it works with ahk 32bit and not with ahk 64bit or does it depend on the cpu only?
Thank you in advance

see https://autohotkey.com/board/topic/1034 ... -aliasing/
Code: Select all
int Gdip_AlphaMask(unsigned int * Bitmap, unsigned int * BitmapMask, unsigned int * BitmapNew, int w1, int h1, int w2, int h2, int Stride1, int Stride2, int sx, int sy, int invert)
{
int o1 = Stride1/4, o2 = Stride2/4;
if (!invert)
{
for (int y = 0; y < h2; ++y)
{
for (int x = 0; x < w2; ++x)
{
BitmapNew[(x+sx)+(y+sy)*o1] = (BitmapMask[x+(y*o2)] & 0xff000000) | (Bitmap[(x+sx)+(y+sy)*o1] & 0x00ffffff);
}
}
}
else
{
for (int y = 0; y < h2; ++y)
{
for (int x = 0; x < w2; ++x)
{
BitmapNew[(x+sx)+(y+sy)*o1] = (0xff000000 - (BitmapMask[x+(y*o2)] & 0xff000000)) | (Bitmap[(x+sx)+(y+sy)*o1] & 0x00ffffff);
}
}
}
return 0;
}