Copy link to clipboard
Copied
Super new to this SDK stuff! So your help will be greatly appreciated!
As a basic example of my problem, if I were to use the skeleton code, how will I retrieve the values of the width and height of the layer from within the "MySimpleGainFunc16" portion?
MySimpleGainFunc16 (
void *refcon,
A_long xL,
A_long yL,
PF_Pixel16 *inP,
PF_Pixel16 *outP)
{
PF_Err err = PF_Err_NONE;
GainInfo *giP = reinterpret_cast<GainInfo*>(refcon);
PF_FpLong tempF = 0;
if (giP)
{
tempF = giP->gainF * PF_MAX_CHAN16 / 100.0;
if (tempF > PF_MAX_CHAN16)
{
tempF = PF_MAX_CHAN16;
}
;
outP->alpha = inP->alpha;
outP->red = MIN((inP->red + (A_u_char) tempF), PF_MAX_CHAN16);
outP->green = MIN((inP->green + (A_u_char) tempF), PF_MAX_CHAN16);
outP->blue = MIN((inP->blue + (A_u_char) tempF), PF_MAX_CHAN16);
}
return err;
}
Thanks!
Copy link to clipboard
Copied
the void *refcon param is a pointer to whatever you want. in this case,
that pointer is used to pass a GainInfo struct.
either create your own struct and put whatever data you want into it, or
add your missing data to the GainInfo struct. either way is good. it's up
to you to decide how to use the void *refcon arg.