blender - functionality for blending of image data using diofferent algorithms libAfterImage/blender.h
Contents
Description
blend_scanlines_name2func() will strip leading whitespaces off of the supplied name, and then will
attempt to match it against the list of names of merging functions. It will then return pointer to the
function with matching name. list_scanline_merging() simply prints out description of implemented
blending/merging methods onto the supplied stream, in supplied format. Format must include 2 string
specs, like so : "%s - %s" where first one will be substituted to short method name, and second -
description
3rd Berkeley Distribution AfterStep v.2.2.12 blender(3x)
Inputs
name - string, identifying scanline merging function.
Name
blender - functionality for blending of image data using diofferent algorithms libAfterImage/blender.h
Namealphablend_Scanlines()
- combines top and bottom RGB components based on alpha channel value: bottom =
bottom*(255-top_alpha)+top*top_alpha; allanon_scanlines() - averages each pixel between two scanlines.
This method has been first implemented by Ethan Fisher aka allanon as mode 130: bottom = (bottom+top)/2;
tint_scanlines() - tints bottom scanline with top scanline( with saturation to prevent overflow) : bottom
= (bottom*(top/2))/32768; add_scanlines() - adds top scanline to bottom scanline with saturation to
prevent overflow: bottom = bottom+top; sub_scanlines() - substrates top scanline from bottom scanline
with saturation to prevent overflow: bottom = bottom-top; diff_scanlines() - for each pixel calculates
absolute difference between bottom and top color value : bottom = (bottom>top)?bottom-top:top-bottom;
darken_scanlines() - substitutes each pixel with minimum color value of top and bottom : bottom =
(bottom>top)?top:bottom; lighten_scanlines() - substitutes each pixel with maximum color value of top and
bottom : bottom = (bottom>top)?bottom:top; screen_scanlines() - some weird merging algorithm taken from
GIMP; overlay_scanlines() - some weird merging algorithm taken from GIMP; hue_scanlines() - substitute
hue of bottom scanline with hue of top scanline; saturate_scanlines() - substitute saturation of bottom
scanline with the saturation of top scanline; value_scanlines() - substitute value of bottom scanline
with the value of top scanline; colorize_scanlines() - combine luminance of bottom scanline with hue and
saturation of top scanline; dissipate_scanlines()- randomly alpha-blend bottom and top scanlines, using
alpha value of top scanline as a threshold for random values.
Nameblend_Scanlines_Name2Func()
list_scanline_merging()
Nameblender
Namecolorspace
Namehsv2Rgb()
hls2rgb()
Namergb2Hsv()
rgb2hls()
Namergb2Value()
rgb2saturation()
rgb2hue()
rgb2luminance()
Return Value
returns pointer to the scanline merging function on succes. NULL on failure.
See Also
Functions :
Colorspace conversion :
rgb2value(), rgb2saturation(), rgb2hue(), rgb2luminance(),
rgb2hsv(), rgb2hls(), hsv2rgb(), hls2rgb().
merge_scanline methods :
alphablend_scanlines(), allanon_scanlines(),
tint_scanlines(), add_scanlines(), sub_scanlines(),
diff_scanlines(), darken_scanlines(), lighten_scanlines(),
screen_scanlines(), overlay_scanlines(), hue_scanlines(),
saturate_scanlines(), value_scanlines(),
colorize_scanlines(), dissipate_scanlines().
useful merging function name to function translator :
blend_scanlines_name2func()
Other libAfterImage modules :
ascmap.h asfont.h asimage.h asvisual.h blender.h export.h
import.h transform.h ximage.h
Synopsis
merge_scanlines_func blend_scanlines_name2func( const char *name ); void list_scanline_merging(FILE*
stream, const char *format);
