summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7f1fabb)
FFTConvolutionEffect remembered this, but ResampleEffect did not.
Patch by Dan Dennedy.
} // namespace
ResampleEffect::ResampleEffect()
} // namespace
ResampleEffect::ResampleEffect()
+ : owns_effects(true),
+ input_width(1280),
input_height(720),
offset_x(0.0f), offset_y(0.0f),
zoom_x(1.0f), zoom_y(1.0f),
input_height(720),
offset_x(0.0f), offset_y(0.0f),
zoom_x(1.0f), zoom_y(1.0f),
+ResampleEffect::~ResampleEffect()
+{
+ if (owns_effects) {
+ delete hpass;
+ delete vpass;
+ }
+}
+
void ResampleEffect::rewrite_graph(EffectChain *graph, Node *self)
{
Node *hpass_node = graph->add_node(hpass);
void ResampleEffect::rewrite_graph(EffectChain *graph, Node *self)
{
Node *hpass_node = graph->add_node(hpass);
graph->replace_receiver(self, hpass_node);
graph->replace_sender(self, vpass_node);
self->disabled = true;
graph->replace_receiver(self, hpass_node);
graph->replace_sender(self, vpass_node);
self->disabled = true;
}
// We get this information forwarded from the first blur pass,
}
// We get this information forwarded from the first blur pass,
class ResampleEffect : public Effect {
public:
ResampleEffect();
class ResampleEffect : public Effect {
public:
ResampleEffect();
virtual std::string effect_type_id() const { return "ResampleEffect"; }
virtual std::string effect_type_id() const { return "ResampleEffect"; }
void update_size();
void update_offset_and_zoom();
void update_size();
void update_offset_and_zoom();
+ // Both of these are owned by us if owns_effects is true (before finalize()),
+ // and otherwise owned by the EffectChain.
+ bool owns_effects;
SingleResamplePassEffect *hpass, *vpass;
int input_width, input_height, output_width, output_height;
SingleResamplePassEffect *hpass, *vpass;
int input_width, input_height, output_width, output_height;