「这是我参与11月更文挑战的第 14 天,活动详情查看:2021最后一次更文挑战」。
参加该活动的第 31 篇文章
正文
PF_PreRenderExtra
PF_PreRenderInput
描述 After Effects 需要渲染的内容(在 PF_RenderRequest 中),以及请求的位深(在恰当命名的位深成员中)。
typedef struct {
PF_LRect rect;
PF_Field field;
PF_ChannelMask channel_mask;
PF_Boolean preserve_rgb_of_zero_alpha;
char unused[3];
long reserved[4];
} PF_RenderRequest;
rect 是在层坐标系。field 也相对于层原点;激活 field 是落在输出缓冲器的偶数扫描线还是奇数扫描线上,这取决于输出缓冲器的原点。
channel_mask 指定该效果应该为哪些通道提供输出。
写入其他通道的数据将被无视。
它将是下列的一种或多种,或组合在一起:
PF_ChannelMask_ALPHAPF_ChannelMask_REDPF_ChannelMask_GREENPF_ChannelMask_BLUEPF_ChannelMask_ARGB
如果 preserve_rgb_of_zero_alpha 像素为 TRUE,则该效果必须将透明像素的颜色内容传送到输出中。
这与 PF_OutFlag2_REVEALS_ZERO_ALPHA 相关,但不同于 PF_OutFlag2_REVEALS_ZERO_ALPHA ,它告诉 After Effects,该效果可以将这样的像素的 alpha 设置为非零值,恢复它们的可见性。
PF_PreRenderInput
Describes what After Effects needs rendered (in the
PF_RenderRequest), and the bit depth requested (in the aptly-named bitdepth member).typedef struct { PF_LRect rect; PF_Field field; PF_ChannelMask channel_mask; PF_Boolean preserve_rgb_of_zero_alpha; char unused[3]; long reserved[4]; } PF_RenderRequest;
rectis in layer coordinates. field is also relative to the layer origin; whether the active field falls on even or odd scanlines of the output buffer depends on the origin of the output buffer.
channel_maskspecifies for which channels the effect should provide output.Data written to other channels will not be honored.
It will be one or more of the following, or’d together:
PF_ChannelMask_ALPHAPF_ChannelMask_REDPF_ChannelMask_GREENPF_ChannelMask_BLUEPF_ChannelMask_ARGBIf
preserve_rgb_of_zero_alphapixels isTRUE, the effect must propagate the color content of transparent pixels through to the output.This is related to, but distinct from, PF_OutFlag2_REVEALS_ZERO_ALPHA, which tells After Effects that the effect may set alpha to non-zero values for such pixels, restoring them to visibility.
PF_PreRenderOutput
由 effect 填充,以告诉 After Effects 它计划根据输入生成什么输出。
typedef struct {
PF_LRect result_rect;
PF_LRect max_result_rect;
PF_Boolean solid;
PF_Boolean reserved;
PF_RenderOutputFlags flags;
void* pre_render_data;
PF_DeletePreRenderDataFunc func;
} PF_PreRenderOutput;
pre_render_data 将在 PF_Cmd_SMART_RENDER 期间传递回效果。
目前,只有 PF_RenderOutputFlags 是 PF_RenderOutputFlag_RETURNS_EXTRA_PIXELS 。
PF_PreRenderOutput
Filled in by the effect to tell After Effects what output it plans to generate, based on the input.
typedef struct { PF_LRect result_rect; PF_LRect max_result_rect; PF_Boolean solid; PF_Boolean reserved; PF_RenderOutputFlags flags; void* pre_render_data; PF_DeletePreRenderDataFunc func; } PF_PreRenderOutput;
pre_render_datawill be passed back to the effect during PF_Cmd_SMART_RENDER.Currently, the only
PF_RenderOutputFlagsisPF_RenderOutputFlag_RETURNS_EXTRA_PIXELS.