[bitmaps]
allegro=../examples/data/allegro.pcx
green=../examples/data/green.png
bkg=../examples/data/bkg.png

# We can't assume that a backbuffer with alpha is available, so draw
# to a temporary bitmap.
[template]
op0=b = al_create_bitmap(640, 480)
op1=al_set_target_bitmap(b)
op2=al_draw_tinted_scaled_bitmap(allegro, #aaaaaa80, 0, 0, 320, 200, 0, 0, 640, 480, 0)
op3=al_set_blender(mode, src, dst1)
op4=al_draw_bitmap(green, x, 5, 0)
op5=al_set_blender(mode, src, dst2)
op6=al_draw_bitmap(green, x, 125, 0)
op7=al_set_blender(mode, src, dst3)
op8=al_draw_bitmap(green, x, 245, 0)
op9=al_set_blender(mode, src, dst4)
op10=al_draw_bitmap(green, x, 365, 0)
op11=al_set_target_bitmap(target)
op12=al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO)
op13=al_draw_bitmap(bkg, 0, 0, 0)
op14=al_set_separate_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, ALLEGRO_ADD, ALLEGRO_ZERO, ALLEGRO_ONE)
op15=al_draw_bitmap(b, 0, 0, 0)
x=140

[template dst=1,0,a,ia]
extend=template
dst1=ALLEGRO_ONE
dst2=ALLEGRO_ZERO
dst3=ALLEGRO_ALPHA
dst4=ALLEGRO_INVERSE_ALPHA

[template dst=sc,dc,isc,idc]
extend=template
dst1=ALLEGRO_SRC_COLOR
dst2=ALLEGRO_DEST_COLOR
dst3=ALLEGRO_INVERSE_SRC_COLOR
dst4=ALLEGRO_INVERSE_DEST_COLOR

#-----------------------------------------------------------------------------#

[template mode=ADD dst=1,0,a,ia]
extend=template dst=1,0,a,ia
mode=ALLEGRO_ADD

[test blend mode=ADD src=1 dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_ONE
hash=7bc85f46
sig=GDD9PNGlHJJqJIHHHHEDL3566KLCCH78T6QCBCCBDFHCF9A76MM5bBCAZ66676BBAP7B8ALAABJ8CUBQA

[test blend mode=ADD src=0 dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_ZERO
hash=441baf02
sig=GDA9BAGHHJJJJIHHHHED665767LCC676766CBCCBDFHCF9A66A95ABCA866676BBA77A7A6AAB6886B5A

[test blend mode=ADD src=a dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_ALPHA
hash=a8d416f9
sig=GDB9NMGlHJJoJIHHHHEDJ5576KLCCH76T6PCBCCBDFHCF9A66LL5bBCAY66676BBAM7A9ALAABI89TBPA

[test blend mode=ADD src=ia dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_INVERSE_ALPHA
hash=16223282
sig=GDB9DCGIHJJMJIHHHHED655566LCC676666CBCCBDFHCF9A76BB5ABCA966676BBA87B7A6AAB6896B5A

[test blend mode=ADD src=sc dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_SRC_COLOR
hash=f926f4cd
sig=GDA9KJGeHJJhJIHHHHEDF5556ELCCB76L6ICBCCBDFHCF9A66II5TBCAR66676BBAH7A7AFAABC89LBIA

[test blend mode=ADD src=dc dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_DEST_COLOR
hash=b2630b89
sig=GDA9HGGeHJJjJIHHHHED855568LCC776D68CBCCBDFHCF9A66IH5MBCAE66676BBA87A6A6AAB6885B6A

[test blend mode=ADD src=isc dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_INVERSE_SRC_COLOR
hash=1e52eaf0
sig=GDC9FEGLHJJQJIHHHHED655566LCC676766CBCCBDFHCF9A76DC5EBCAC66676BBA97B7A7AAB6896B6A

[test blend mode=ADD src=idc dst=1,0,a,ia]
extend=template mode=ADD dst=1,0,a,ia
src=ALLEGRO_INVERSE_DEST_COLOR
hash=fe52c382
sig=GDC9LKGgHJJiJIHHHHED955568LCC87686ACBCCBDFHCF9A76JI5YBCAW66676BBAD7A7ABAABB8AFBCA

#-----------------------------------------------------------------------------#

[template mode=ADD dst=sc,dc,isc,idc]
extend=template dst=sc,dc,isc,idc
mode=ALLEGRO_ADD

[test blend mode=ADD src=1 dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_ONE
hash=0ce01bb8
sig=GD76AA6VHJJZ66676HEDV6AG7YLCCT6Dn8ZCBCCBDFIDF9ACCPPDYBCAXCCEFABBAU98E7TAABR7Ca8YA

[test blend mode=ADD src=0 dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_ZERO
hash=90e041ac
sig=GD664468HJJA66676HED869879LCC867C88CBCCBDFIDF9AAC88D5BCA6CCEFABBA878878AAB777787A

[test blend mode=ADD src=a dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_ALPHA
hash=a2c1dee3
sig=GD66BA6VHJJY66676HEDS69F7XLCCR6An8ZCBCCBDFIDF9AACMMDXBCAUCCEFABBAS88D7SAABQ79a8YA

[test blend mode=ADD src=ia dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_ALPHA
hash=597e5032
sig=GD763369HJJC66676HED96A97ALCC969D88CBCCBDFIDF9ABCAAD6BCA7CCEFABBA988978AAB878787A

[test blend mode=ADD src=sc dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_SRC_COLOR
hash=901f4244
sig=GD66776NHJJR66676HEDN69D7RLCCM69f8RCBCCBDFIDF9AACJJDQBCAOCCEFABBAN88C7MAABK78S8QA

[test blend mode=ADD src=dc dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_DEST_COLOR
hash=b80bdb24
sig=GD66556OHJJS66676HEDI6AC7LLCCH69a8JCBCCBDFIDF9AACEEDBBCA8CCEFABBAE88A7DAABC77B8EA

[test blend mode=ADD src=isc dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_SRC_COLOR
hash=020d43da
sig=GD76556CHJJF66676HEDB6AA7CLCCB69F8ACBCCBDFIDF9ABCBBD6BCA8CCEFABBAB8897AAABA79989A

[test blend mode=ADD src=idc dst=sc,dc,isc,idc]
extend=template mode=ADD dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_DEST_COLOR
hash=2349d015
sig=GD76996QHJJS66676HEDI6AC7LLCCH6AU8MCBCCBDFIDF9ABCFEDGBCAICCEFABBAL88B7KAABJ79Q8OA

#-----------------------------------------------------------------------------#

[template mode=DEST_MINUS_SRC dst=1,0,a,ia]
extend=template dst=1,0,a,ia
mode=ALLEGRO_DEST_MINUS_SRC

[test blend mode=DEST_MINUS_SRC src=1 dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_ONE
hash=2e819fcc
sig=GD9966G6HJJ7JIHHHHED665767LCC676766CBCCBDFHCF9A666556BCA666676BBA76A7A7AAB6886B6A

[test blend mode=DEST_MINUS_SRC src=0 dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_ZERO
hash=441baf02
sig=GDA9BAGHHJJJJIHHHHED665767LCC676766CBCCBDFHCF9A66A95ABCA866676BBA77A7A6AAB6886B5A

[test blend mode=DEST_MINUS_SRC src=a dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_ALPHA
hash=6fcd619c
sig=GD9977G6HJJ7JIHHHHED665767LCC676766CBCCBDFHCF9A666556BCA666676BBA86A7A7AAB6886B6A

[test blend mode=DEST_MINUS_SRC src=ia dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_INVERSE_ALPHA
hash=77192dfe
sig=GD9998GGHJJHJIHHHHED665767LCC676766CBCCBDFHCF9A66985ABCA766676BBA76A7A7AAB6886B6A

[test blend mode=DEST_MINUS_SRC src=sc dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_SRC_COLOR
hash=2dc73562
sig=GD9977G6HJJ7JIHHHHED665767LCC676766CBCCBDFHCF9A666556BCA666676BBA86A7A7AAB6886B6A

[test blend mode=DEST_MINUS_SRC src=dc dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_DEST_COLOR
hash=683a8d24
sig=GD9977G6HJJ7JIHHHHED665767LCC676766CBCCBDFHCF9A666556BCA666676BBA86A7A7AAB6886B6A

[test blend mode=DEST_MINUS_SRC src=isc dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_INVERSE_SRC_COLOR
hash=c590b4b7
sig=GD9977GCHJJEJIHHHHED665767LCC676766CBCCBDFHCF9A668756BCA566676BBA76A7A7AAB6886B6A

[test blend mode=DEST_MINUS_SRC src=idc dst=1,0,a,ia]
extend=template mode=DEST_MINUS_SRC dst=1,0,a,ia
src=ALLEGRO_INVERSE_DEST_COLOR
hash=c0986966
sig=GD9977G6HJJ7JIHHHHED665767LCC676766CBCCBDFHCF9A666556BCA666676BBA76A7A7AAB6886B6A

#-----------------------------------------------------------------------------#

[template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc]
extend=template dst=sc,dc,isc,idc
mode=ALLEGRO_DEST_MINUS_SRC

[test blend mode=DEST_MINUS_SRC src=1 dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_ONE
hash=8b11d273
sig=GD666666HJJ666676HED669777LCC667786CBCCBDFIDF9AAC65D6BCA6CCEFABBA768777AAB677686A

[test blend mode=DEST_MINUS_SRC src=0 dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_ZERO
hash=90e041ac
sig=GD664468HJJA66676HED869879LCC867C88CBCCBDFIDF9AAC88D5BCA6CCEFABBA878878AAB777787A

[test blend mode=DEST_MINUS_SRC src=a dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_ALPHA
hash=b4a2ce11
sig=GD666666HJJ666676HED669777LCC667786CBCCBDFIDF9AAC55D6BCA6CCEFABBA768777AAB677686A

[test blend mode=DEST_MINUS_SRC src=ia dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_ALPHA
hash=59fcf94a
sig=GD665568HJJA66676HED769778LCC767B88CBCCBDFIDF9AAC55D6BCA6CCEFABBA768777AAB777686A

[test blend mode=DEST_MINUS_SRC src=sc dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_SRC_COLOR
hash=861e7e3e
sig=GD666666HJJ666676HED669777LCC667786CBCCBDFIDF9AAC55D6BCA6CCEFABBA768777AAB677686A

[test blend mode=DEST_MINUS_SRC src=dc dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_DEST_COLOR
hash=d0317d02
sig=GD666666HJJ666676HED669777LCC667786CBCCBDFIDF9AAC55D6BCA6CCEFABBA768777AAB677686A

[test blend mode=DEST_MINUS_SRC src=isc dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_SRC_COLOR
hash=6d493d98
sig=GD664466HJJ866676HED669777LCC667A87CBCCBDFIDF9AAC55D6BCA6CCEFABBA668776AAB677585A

[test blend mode=DEST_MINUS_SRC src=idc dst=sc,dc,isc,idc]
extend=template mode=DEST_MINUS_SRC dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_DEST_COLOR
hash=18079776
sig=GD666666HJJ666676HED669777LCC667786CBCCBDFIDF9AAC55D6BCA6CCEFABBA768777AAB677686A

#-----------------------------------------------------------------------------#

[template mode=SRC_MINUS_DEST dst=1,0,a,ia]
extend=template dst=1,0,a,ia
mode=ALLEGRO_SRC_MINUS_DEST

[test blend mode=SRC_MINUS_DEST src=1 dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_ONE
hash=2a79c7ac
sig=GD666667HJJ766676HEDL3566KLCCH78T6QCBCCBDFHCF9A665559BCAC66676BBAL5775KAABH67T7PA

[test blend mode=SRC_MINUS_DEST src=0 dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_ZERO
hash=82bce5d4
sig=GD666666HJJ666676HED665767LCC676766CBCCBDFHCF9A666556BCA666676BBA767757AAB666676A

[test blend mode=SRC_MINUS_DEST src=a dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_ALPHA
hash=98761b88
sig=GD666667HJJ766676HEDJ5576KLCCH76T6PCBCCBDFHCF9A666659BCAB66676BBAJ6785KAABG67S7PA

[test blend mode=SRC_MINUS_DEST src=ia dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_INVERSE_ALPHA
hash=5bc32bdb
sig=GD666666HJJ666676HED655566LCC676666CBCCBDFHCF9A666556BCA666676BBA767757AAB666676A

[test blend mode=SRC_MINUS_DEST src=sc dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_SRC_COLOR
hash=bebf46ff
sig=GD666667HJJ766676HEDF5556ELCCB76L6ICBCCBDFHCF9A665558BCAA66676BBAF6765EAABB66L7IA

[test blend mode=SRC_MINUS_DEST src=dc dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_DEST_COLOR
hash=721318ba
sig=GD666666HJJ666676HED855568LCC776D68CBCCBDFHCF9A666556BCA666676BBA767656AAB666576A

[test blend mode=SRC_MINUS_DEST src=isc dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_INVERSE_SRC_COLOR
hash=b3cf8aac
sig=GD666666HJJ666676HED655566LCC676766CBCCBDFHCF9A666556BCA666676BBA767757AAB666676A

[test blend mode=SRC_MINUS_DEST src=idc dst=1,0,a,ia]
extend=template mode=SRC_MINUS_DEST dst=1,0,a,ia
src=ALLEGRO_INVERSE_DEST_COLOR
hash=0793889c
sig=GD666666HJJ666676HED955568LCC87686ACBCCBDFHCF9A666556BCA666676BBAB6775BAABA67F7CA

#-----------------------------------------------------------------------------#

[template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc]
extend=template dst=sc,dc,isc,idc
mode=ALLEGRO_SRC_MINUS_DEST

[test blend mode=SRC_MINUS_DEST src=1 dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_ONE
hash=a5bc2ba0
sig=GD666669HJJA66676HEDB55569LCC97696ECBCCBDFHCF9A66885IBCAM66676BBAC5755BAAB967H7DA

[test blend mode=SRC_MINUS_DEST src=0 dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_ZERO
hash=82bce5d4
sig=GD666666HJJ666676HED665767LCC676766CBCCBDFHCF9A666556BCA666676BBA767757AAB666676A

[test blend mode=SRC_MINUS_DEST src=a dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_ALPHA
hash=eda1ec1b
sig=GD667769HJJ966676HEDA65769LCC97696ECBCCBDFHCF9A66985IBCAL66676BBAB6765BAAB966G7DA

[test blend mode=SRC_MINUS_DEST src=ia dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_ALPHA
hash=33a0483e
sig=GD666666HJJ666676HED665767LCC676766CBCCBDFHCF9A665555BCA666676BBA767757AAB666676A

[test blend mode=SRC_MINUS_DEST src=sc dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_SRC_COLOR
hash=fb2978c6
sig=GD666667HJJ766676HED965669LCC77696BCBCCBDFHCF9A66775FBCAG66676BBAA67659AAB866D7BA

[test blend mode=SRC_MINUS_DEST src=dc dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_DEST_COLOR
hash=5a1c8feb
sig=GD666666HJJ666676HED665666LCC675666CBCCBDFHCF9A665555BCA566676BBA667655AAB566574A

[test blend mode=SRC_MINUS_DEST src=isc dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_SRC_COLOR
hash=612ad8c8
sig=GD666666HJJ666676HED665767LCC676766CBCCBDFHCF9A665555BCA666676BBA767757AAB666676A

[test blend mode=SRC_MINUS_DEST src=idc dst=sc,dc,isc,idc]
extend=template mode=SRC_MINUS_DEST dst=sc,dc,isc,idc
src=ALLEGRO_INVERSE_DEST_COLOR
hash=77b28a0b
sig=GD666666HJJ666676HED665666LCC676567CBCCBDFHCF9A666659BCAC66676BBA767757AAB766876A

#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#

[test blend bullet]
op0=image = al_create_bitmap(180, 160)
op1=al_set_target_bitmap(image)
op2=al_clear_to_color(#ffffff)
op3=al_set_target_bitmap(target)
op4=al_clear_to_color(#808080)
op5=al_draw_line(10, 10, 190, 10, white, 2)
op6=al_set_blender(ALLEGRO_DEST_MINUS_SRC, ALLEGRO_ALPHA, ALLEGRO_ONE)
op7=al_draw_bitmap(image, 10, 20, 0)
op8=al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA)
op9=al_draw_line(10, 190, 190, 190, white, 2)
hash=610f2805
