• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Getting the layer dimensions

New Here ,
Mar 01, 2018 Mar 01, 2018

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!

TOPICS
SDK

Views

218

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2018 Mar 04, 2018

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines