blender(3x)
π blender(3x) π
okay bestie, come sit with me, because you just opened the manual page for blender from the AfterStep X11 window manager crew, and it's a whole mood π
it's the 3x page, it's part of the 3rd Berkeley Distribution, it rides along with AfterStep v.2.2.12, and it lives in the libAfterImage/blender.h header. we'll do the cute sign-off at the very end, promise π«Ά
β¨ NAME β¨
blender β functionality for blending of image data using diofferent algorithms, from libAfterImage/blender.h.
(yeah, "diofferent" is a typo and it is canon, we do not touch her π she's part of the family now)
and also, one more time for the people in the back: blender β the page literally names itself twice, it's giving main-character energy π
πΈ DESCRIPTION πΈ
so what does this thing do? It defines the implemented methods for ASScanline combining β the kind you'd pass into merge_layers() through an ASImageLayer structure. slay π
it also tosses in the functions for colorspace conversion, RGB<->HSV and RGB<->HLS, because why not do two jobs flawlessly β¨
π SEE ALSO π
Functions :
- Colorspace conversion :
rgb2value(),rgb2saturation(),rgb2hue(),rgb2luminance(),rgb2hsv(),rgb2hls(),hsv2rgb(),hls2rgb(). merge_scanlinemethods :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.hasfont.hasimage.hasvisual.hblender.hexport.himport.htransform.hximage.h
π«Ά AUTHOR π«Ά
Sasha Vasko <sasha at aftercode dot net>
source file for this one: libAfterImage/colorspace π
π« NAME: colorspace π«
π¨ DESCRIPTION π¨
RGB colorspace: every color is a combo of red, green and blue values. Each of those values can live in one of 2 formats: 8 bit and 24.8 bit. The 24.8 bit situation makes for a 32bit value where the lower 8 bits get used as a fraction, so your calculations come out with better precision π
HSV colorspace: every color is a combo of hue, saturation and value. Hue is generally the colorizing component, and value is the one carrying the brightness. π
HLS colorspace: every color is a combo of hue, luminance and saturation. It's analogous to HSV, except value got swapped out for luminance β with the twist that luminance can be both negative and positive. π
an alpha channel can be added to any of those colorspaces, and it's generally used to define transparentness of the color. libAfterImage is using ARGB colorspace as its base colorspace, and represents most colors as ARGB32 values or ASScanline scanlines of pixels. β¨
πΊ NAME: libAfterImage/rgb2value() πΊ
rgb2value(), rgb2saturation(), rgb2hue(), rgb2luminance()
π SYNOPSIS π
CARD32 rgb2value( CARD32 red, CARD32 green, CARD32 blue );
CARD32 rgb2saturation( CARD32 red, CARD32 green, CARD32 blue );
CARD32 rgb2hue( CARD32 red, CARD32 green, CARD32 blue );
CARD32 rgb2luminance (CARD32 red, CARD32 green, CARD32 blue );
π INPUTS π
redβ 32 bit value, 16 lower bits of which represent the red channel.greenβ 32 bit value, 16 lower bits of which represent the green channel.blueβ 32 bit value, 16 lower bits of which represent the blue channel.
π RETURN VALUE π
a 32 bit value, 16 lower bits of which represent value, saturation, hue, or luminance respectively.
π DESCRIPTION π
these functions translate an RGB color into the respective coordinates of the HSV and HLS colorspaces. Returned hue values come in 16bit format, ok? so to translate that to and from the conventional 0-360 degree range, please bestie use:
degrees2hue16()β converts conventional hue in 0-360 range intohue16hue162degree()β converts 16bit hue value into conventional degrees.
also from:libAfterImage/rgb2hsv()
π¦ NAME: rgb2hsv() π¦
rgb2hsv(), rgb2hls()
π SYNOPSIS π
CARD32 rgb2hsv( CARD32 red, CARD32 green, CARD32 blue,
CARD32 *saturation, CARD32 *value );
CARD32 rgb2hls( CARD32 red, CARD32 green, CARD32 blue,
CARD32 *luminance, CARD32 *saturation );
π INPUTS π
redβ 32 bit value, 16 lower bits of which represent the red channel.greenβ 32 bit value, 16 lower bits of which represent the green channel.blueβ 32 bit value, 16 lower bits of which represent the blue channel.
π RETURN VALUE π
a 32 bit value, 16 lower bits of which represent hue. The 32bit value pointed to by luminance, value and saturation will be set respectively to the color's luminance, value and saturation. π€
π DESCRIPTION π
these functions translate an RGB color into the full set of HSV and HLS coordinates all at once β and real talk, they work faster than doing separate translations into each channel. efficiency queen π
π§ NAME: hsv2rgb() π§
hsv2rgb(), hls2rgb()
π SYNOPSIS π
void hsv2rgb( CARD32 hue, CARD32 saturation, CARD32 value,
CARD32 *red, CARD32 *green, CARD32 *blue);
void hls2rgb( CARD32 hue, CARD32 luminance, CARD32 saturation,
CARD32 *red, CARD32 *green, CARD32 *blue);
π INPUTS π
hueβ 32 bit value, 16 lower bits of which represent hue.saturationβ 32 bit value, 16 lower bits of which represent saturation.valueβ 32 bit value, 16 lower bits of which represent value.luminanceβ 32 bit value, 16 lower bits of which represent luminance.
π RETURN VALUE π
the 32bit value pointed to by red, green and blue will be set respectively to the RGB color channels. β¨
π DESCRIPTION π
these functions perform the reverse translation from HSV and HSL back to RGB color.
π NAME: merge_scanline π
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()
okay this is the fun part, the entire roster of merging moods π
each one is a merge_scanline method you can hand to merge_layers() via ASImageLayer:
alphablend_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 was 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()β subtracts top scanline from bottom scanline with saturation to prevent overflow:bottom = bottom-top;diff_scanlines()β for each pixel calculates the absolute difference between bottom and top color value :bottom = (bottom>top)?bottom-top:top-bottom;darken_scanlines()β substitutes each pixel with the minimum color value of top and bottom :bottom = (bottom>top)?top:bottom;lighten_scanlines()β substitutes each pixel with the 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 the hue of bottom scanline with the hue of top scanline;saturate_scanlines()β substitute the saturation of bottom scanline with the saturation of top scanline;value_scanlines()β substitute the value of bottom scanline with the value of top scanline;colorize_scanlines()β combine the luminance of bottom scanline with the hue and saturation of top scanline;dissipate_scanlines()β randomly alpha-blend bottom and top scanlines, using the alpha value of top scanline as a threshold for random values.
π SYNOPSIS π
void alphablend_scanlines( ASScanline *bottom, ASScanline *top, int );
void allanon_scanlines ( ASScanline *bottom, ASScanline *top, int );
void tint_scanlines ( ASScanline *bottom, ASScanline *top, int );
void add_scanlines ( ASScanline *bottom, ASScanline *top, int );
void sub_scanlines ( ASScanline *bottom, ASScanline *top, int );
void diff_scanlines ( ASScanline *bottom, ASScanline *top, int );
void darken_scanlines ( ASScanline *bottom, ASScanline *top, int );
void lighten_scanlines ( ASScanline *bottom, ASScanline *top, int );
void screen_scanlines ( ASScanline *bottom, ASScanline *top, int );
void overlay_scanlines ( ASScanline *bottom, ASScanline *top, int );
void hue_scanlines ( ASScanline *bottom, ASScanline *top, int );
void saturate_scanlines ( ASScanline *bottom, ASScanline *top, int );
void value_scanlines ( ASScanline *bottom, ASScanline *top, int );
void colorize_scanlines ( ASScanline *bottom, ASScanline *top, int );
void dissipate_scanlines ( ASScanline *bottom, ASScanline *top, int );
π INPUTS π
bottomβ pointer to theASScanlinethat will be overalayedtopβ pointer toASScanlinethat will overlaybottom.
π DESCRIPTION π
these functions accept 2 scanlines as arguments, stored in ASScanline structures with data in 24.8 format. The merging operation is performed on those scanlines, and the result gets stored in the bottom ASScanline. The following are the merging methods used in each function :
π©· NAME: blend_scanlines_name2func() π©·
blend_scanlines_name2func(), list_scanline_merging()
π SYNOPSIS π
merge_scanlines_func blend_scanlines_name2func( const char *name );
void list_scanline_merging(FILE* stream, const char *format);
π INPUTS π
nameβ string, identifying scanline merging function.
π RETURN VALUE π
returns a pointer to the scanline merging function on succes. NULL on failure. (yes, one wrong turn and you get NULL, no cap π)
π DESCRIPTION π
blend_scanlines_name2func() will strip leading whitespaces off of the supplied name, and then it will attempt to match it against the list of names of merging functions. If it vibes with one, it returns a pointer to the function with the matching name. π₯
list_scanline_merging() simply prints out the description of the implemented blending/merging methods onto the supplied stream, in the supplied format. That format must include 2 string specs, like so : "%s - %s" β where the first one gets substituted with the short method name, and the second one with the description. π
and that's the whole page bestie, you ate it π«Ά this was blender(3x) from the 3rd Berkeley Distribution, AfterStep v.2.2.12, so go forth and blend some scanlines β periodt π
β¨
π¦ where this page comes from
- ubuntu resolute: libafterimage-dev 2.2.12-19 Β· GPL-2.0-or-later
- ubuntu stonking: libafterimage-dev 2.2.12-19 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms