Ink effect

From FusionWiki

(Redirected from Ink effects)
Jump to: navigation, search

An ink effect defines how an object will be drawn on-screen, often with regard to its background.

Contents

Available ink effects

Currently, there are 9 ink effects available in MMF2:

Ink Effect Depends on background Supported in HWA Notes
None No Yes Has no effect
Semi-transparent Yes Yes1 Blends the foreground on the background
Inverted No Yes Inverts each color channel
XOR Yes No Bitwise exclusive or
AND Yes No Bitwise and
OR Yes No Bitwise or
Monochrome No Yes Sets each color channel to the average of all three (red, green and blue)
Add Yes Yes Adds each color channel to the corresponding background channel
Subtract Yes Yes Subtracts each color channel from the corresponding background channel

Note that all ink effects depend on the background when using alpha channels.

1. Although being supported, there is a separate setting called blend coefficient available which should be used instead.

Bitwise ink effects

There are three bitwise ink effects available in MMF2: AND, OR, XOR. Each of these calculates the output bits based on the two input bits (Foreground and background).
MMF stores colors in three bytes for red, green and blue, each consisting of eight bits. The maximum value 8 bits can hold is 28-1 = 255.
For RGB(255,0,0), all red bits are 1, and all green and blue bits are 0:
11111111 00000000 00000000

AND

The output bit is 1 if both input bits are 1 as well. The output color is never brighter than either of the input colors.

OR

The output bit is 1 if at least one of the input bits is 1. The output color is never darker than either of the input colors.

XOR

The output bit is 1 if exactly one of the input bits is 1.

Examples

Input 1 Input 2 AND OR XOR
RGB(255,0,0) RGB(0,255,0) RGB(0,0,0) RGB(255,255,0) RGB(255,255,0)
RGB(0,255,255) RGB(255,0,255) RGB(0,0,255) RGB(0,255,255) RGB(255,255,0)
RGB(255,255,255) RGB(0,0,0) RGB(0,0,0) RGB(255,255,255) RGB(255,255,255)

See also

Personal tools