Given two bitmaps how would you create a bitwise operation between the two without going pixel-by-pixel?
It appears you use al_set_blender() but I don't know how to derive the functions I need
Form my old legacy psudocode on a per-pixel basis I used the following operators:
t = the resulting texture
b = bitmap being applied
B_OR : t = t | b; //or
B_AND : t = t & b; //and
B_XOR : t = t ^ b; //xor
B_COPY : t = b; //normal blitting
B_NOT : t = ~b; //not
B_CUT : if(b != 0) t = b; //copy data only if the destination is black
B_REV : (Same as B_NOT due to turecolor palette)
I'm not sure how the ALLEGRO_ADD, ALLEGRO_ZERO, ALLEGRO_ONE stuff turns into bitwise math, unless I'm not seeing the mathematics properly or it's a type of math I don't understand.
From the documentation, it appears that I can make a B_COPY by
al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO)
Thinking this through, this means that of the bit on the source will be written over the destination which is treated as a "mask" of zero? Kinda? How does this work?