Menu

#109 Allow alpha value in [image put]

open
6
2009-08-24
2002-05-17
No

Default format handler doesn't deal with alpha value.
I am writing a format handler, "pixel", where user can
specify
the following options:
-colormodel hsv|rgb
Color model to use for color cells
-packed /boolean/
Specifies the format of each color cells. If
false, a color
cell is a list of 3 (or 4) values, between 0 and
255,
specifying the red, green, blue (and alpha)
values,
or hue, saturation, value (and alpha) values.
if true, a color cell is a single integer, i,
where
(i >> 24) & 0xff is the alpha value,
(i >> 16) & 0xff is the red or hue value,
(i >> 8) & 0xff is the green or saturation value,
(i ) & 0xff is the blue or value
(brightness) value.
-alpha /boolean/
Specifies wheter or not to use the alpha value
when
copying the data. If true, each color cell must
have
4 values. If false, each color cell must have 3 or
4 values,
and alpha value is set to 255.
(another option could specify the alpha value to
use for all pixels instead of 255).

This new format handler allow among other things to
specify
alpha value at the tcl level.
Perhaps we could also allow alpha specification in the
default
format handler, with a syntax like #rrggbb@aa.

Discussion

  • Eric Boudaillier

    Logged In: YES
    user_id=493507

    The following patch allow specification of the alpha value
    in default format handler, with the syntax <xcolor>@<hex>,
    where <xcolor> is a valid X color and <hex> is 1 to 4 hex
    digit.

     
  • Eric Boudaillier

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    I'm not sure how to evaluate this in the light of TIP#98,
    though I suspect there is a need for a lot more work in this
    area. If only I understood the issues better.

     
  • Donal K. Fellows

    • assigned_to: nobody --> dkf
     
  • Donal K. Fellows

    • priority: 5 --> 6
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.