Post Reply 
PIXON with alpha channel support
09-27-2015, 03:49 PM
Post: #1
PIXON with alpha channel support
Hi,

I need semi transparent pixels and I know that I can do workaround using RECT/RECT_P, but in this case it is really slow. I need something little faster and I'm sure that adding alpha channel support to the current PIXON/PIXON_P functions will be sufficient.
Can I ask for this functionality in the next firmware release?

BR,
Piotr
Find all posts by this user
Quote this message in a reply
09-27-2015, 04:16 PM (This post was last modified: 09-27-2015 04:22 PM by Tim Wessman.)
Post: #2
RE: PIXON with alpha channel support
I'll put it on the list. Note that I can't promise anything regarding any specific release, or even that there will be any more releases, but I've entered it in. There is some general cleanup in the drawing routines to bring a bit more consistency in a few places that I'd like to get done as well...

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
09-27-2015, 08:01 PM
Post: #3
RE: PIXON with alpha channel support
Can you post an example why you need alpha support? You can create a workaround reading the pixel first

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
09-28-2015, 05:34 AM
Post: #4
RE: PIXON with alpha channel support
Hello,

You can use RECT which does handle alpha blending.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
09-28-2015, 07:51 AM (This post was last modified: 09-28-2015 07:51 AM by Martin Hepperle.)
Post: #5
RE: PIXON with alpha channel support
(09-27-2015 04:16 PM)Tim Wessman Wrote:  I'll put it on the list. Note that I can't promise anything regarding any specific release, or even that there will be any more releases, but I've entered it in. There is some general cleanup in the drawing routines to bring a bit more consistency in a few places that I'd like to get done as well...

Tim,

RE: cleaning up:
.. it would be nice to have the G argument in the parameter lists always in the same position (e.g. the first argument should be the Grob to draw on)... (maybe this can be done without breaking old code by checking the parameter types)
Martin
Find all posts by this user
Quote this message in a reply
09-28-2015, 09:06 AM
Post: #6
RE: PIXON with alpha channel support
(09-28-2015 05:34 AM)cyrille de brĂ©bisson Wrote:  You can use RECT which does handle alpha blending.

As I said in my first post I know it and I used it in my program, but it is very slow.
PIXON is very fast and I hope that it will be much quicker than RECT for single pixels.
Of course, even better would be to get the BLIT with alpha blending Wink

BR,
Piotr
Find all posts by this user
Quote this message in a reply
09-28-2015, 01:00 PM
Post: #7
RE: PIXON with alpha channel support
(09-28-2015 07:51 AM)Martin Hepperle Wrote:  .. it would be nice to have the G argument in the parameter lists always in the same position (e.g. the first argument should be the Grob to draw on)... (maybe this can be done without breaking old code by checking the parameter types)
Martin

I thought that one was already consistent. Which commands are you thinking about?

If you don't specify it, it assume G0... I did think that the grob was already the first arg though in all of them.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
09-30-2015, 07:37 AM
Post: #8
RE: PIXON with alpha channel support
Why not to write ur own version which would call GETPIX_P -> Calculate Color -> PIXON_P ? Could be slow, but it is solution. I needed transparency, and it is supported, alpha blending really is not very useful.
Find all posts by this user
Quote this message in a reply
09-30-2015, 06:06 PM
Post: #9
RE: PIXON with alpha channel support
(09-30-2015 07:37 AM)xset Wrote:  Why not to write ur own version which would call GETPIX_P -> Calculate Color -> PIXON_P ? Could be slow, but it is solution. I needed transparency, and it is supported, alpha blending really is not very useful.

I created my own version using RECT_P and I did not have to do the calculation, because RECT_P supports alpha channel and I got BLIT_P with transparency.

Code:
BLIT_P_ALPHA(gd,x,y,a,gs)
BEGIN
 local w,h;
 FOR h FROM 0 TO GROBH_P(gs)-1 DO
  FOR w FROM 0 TO GROBW_P(gs)-1 DO
   RECT_P(gd,x+w,y+h,x+w,y+h,{GETPIX_P(gs,w,h),a});
  END;
 END;
END;

where:
gd - destination GROB
x,y - coordinates (destination)
a - alpha channel (transparency from 0 to 255)
gs - source GROB (GROB to draw with transparency)

Of course we can check if version using method: GETPIX -> manual calculation -> PIXON maybe will be faster. I will check it later.

--
Best regards,
Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
09-30-2015, 06:14 PM
Post: #10
RE: PIXON with alpha channel support
(09-30-2015 06:06 PM)komame Wrote:  I created my own version using RECT_P and I did not have to do the calculation, because RECT_P supports alpha channel and I got BLIT_P with transparency.

Best regards,
Piotr Kowalewski

Cool !
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: