Thread: how, using Math from differents HBITMAP's, combine the pixels for effects?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Registered User
    Join Date
    Aug 2013
    Posts
    451
    i'm sorry, but can you explain better your function?
    Code:
    Pixel alphaCompositePixel(Pixel p1, Pixel p2, Byte alpha = MaxAlpha) 
    {    
              double a1f = double(p1.a) / MaxAlpha,
               a2f = double(p2.a) / MaxAlpha,
               a0f = a1f + a2f * (1.0 - a1f);
        return {
            Byte((p1.r * a1f + p2.r * a2f * (1.0 - a1f)) / a0f),
            Byte((p1.g * a1f + p2.g * a2f * (1.0 - a1f)) / a0f),
            Byte((p1.b * a1f + p2.b * a2f * (1.0 - a1f)) / a0f),
            alpha
        };
    }
    maybe i can make my own function correctly
    Last edited by joaquim; 04-20-2022 at 02:07 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to combines differents pieces and form a package
    By sergioms in forum C Programming
    Replies: 9
    Last Post: 09-13-2018, 10:33 AM
  2. Differents results x86 and ARM
    By Eduardo Alfaia in forum C Programming
    Replies: 3
    Last Post: 01-21-2015, 08:46 PM
  3. Replies: 4
    Last Post: 03-13-2010, 05:10 AM
  4. copying differents maps
    By l2u in forum C++ Programming
    Replies: 20
    Last Post: 10-14-2008, 04:59 AM
  5. Using differents API in a program
    By gustavosserra in forum C++ Programming
    Replies: 2
    Last Post: 06-29-2003, 07:30 PM

Tags for this Thread