Skip to main content
Participant
November 15, 2012
Question

Calculating the blending ratio

  • November 15, 2012
  • 1 reply
  • 918 views

Hey guys!

I'm trying to blend two images together using the WorldTransformSuite->blend function. I want to be able to control the blending ratio with a slider. Now, I looked into the AE_EffectCB Header where this function is defined, and a comment behind ratio states that 0x00010000 makes source 2 fully visible. Now I'm trying to figure out to calculate this number. It seems to be a weird blend of hex and binary...anybody know how this is done? It's propably super obvious and I'm just missing something

Thanks in advance,

Markus

This topic has been closed for replies.

1 reply

Inspiring
November 15, 2012

its a 16bit (PF_Fixed) value, e.g. 

double zero_to_one_opacity_value = 0.5;

int value_to_pass_to_blend = static_cast<PF_Fixed> (zero_to_one_opacity_value * (1 << 16));

Participant
November 16, 2012

Awesome! Thanks!!