// Keeps the type of alpha (premultiplied, postmultiplied, blank)
// unchanged from input to output. Usually appropriate if you
// process all color channels in a linear fashion, do not change
- // alpha, and do not produce any new pixels thare have alpha != 1.0.
+ // alpha, and do not produce any new pixels that have alpha != 1.0.
//
// Does not make sense for inputs.
DONT_CARE_ALPHA_TYPE,
// and allow dependent effects to change that sampler state.
virtual bool is_single_texture() const { return false; }
+ // If set, this effect should never be bounced to an output, even if a
+ // dependent effect demands texture bounce.
+ //
+ // Note that setting this can invoke undefined behavior, up to and including crashing,
+ // so you should only use it if you have deep understanding of your entire chain
+ // and Movit's processing of it. The most likely use case is if you have an input
+ // that's cheap to compute but not a single texture (e.g. YCbCrInput), and want
+ // to run a ResampleEffect directly from it. Normally, this would require a bounce,
+ // but it's faster not to. (However, also note that in this case, effective texel
+ // subpixel precision will be too optimistic, since chroma is already subsampled.)
+ //
+ // Has no effect if is_single_texture() is set.
+ virtual bool override_disable_bounce() const { return false; }
+
// If changes_output_size() is true, you must implement this to tell
// the framework what output size you want. Also, you can set a
// virtual width/height, which is the size the next effect (if any)
//
// Neither of these take ownership of the pointer.
- // int is special since GLSL pre-1.30 doesn't have integer uniforms.
- // Thus, ints that you register will _not_ be converted to GLSL uniforms.
+ // These correspond directly to int/float/vec2/vec3/vec4 in GLSL.
void register_int(const std::string &key, int *value);
-
- // These correspond directly to float/vec2/vec3/vec4 in GLSL.
void register_float(const std::string &key, float *value);
void register_vec2(const std::string &key, float *values);
void register_vec3(const std::string &key, float *values);
//
// Calling register_* will automatically imply register_uniform_*,
// except for register_int as noted above.
+ void register_uniform_sampler2d(const std::string &key, const int *value);
void register_uniform_bool(const std::string &key, const bool *value);
void register_uniform_int(const std::string &key, const int *value); // Note: Requires GLSL 1.30 or newer.
- void register_uniform_sampler2d(const std::string &key, const int *value);
void register_uniform_float(const std::string &key, const float *value);
void register_uniform_vec2(const std::string &key, const float *values);
void register_uniform_vec3(const std::string &key, const float *values);
void register_uniform_vec4(const std::string &key, const float *values);
+ void register_uniform_float_array(const std::string &key, const float *values, size_t num_values);
void register_uniform_vec2_array(const std::string &key, const float *values, size_t num_values);
+ void register_uniform_vec3_array(const std::string &key, const float *values, size_t num_values);
void register_uniform_vec4_array(const std::string &key, const float *values, size_t num_values);
void register_uniform_mat3(const std::string &key, const Eigen::Matrix3d *matrix);
std::map<std::string, float *> params_vec4;
// Picked out by EffectChain during finalization.
+ std::vector<Uniform<int> > uniforms_sampler2d;
std::vector<Uniform<bool> > uniforms_bool;
std::vector<Uniform<int> > uniforms_int;
- std::vector<Uniform<int> > uniforms_sampler2d;
std::vector<Uniform<float> > uniforms_float;
std::vector<Uniform<float> > uniforms_vec2;
std::vector<Uniform<float> > uniforms_vec3;
std::vector<Uniform<float> > uniforms_vec4;
+ std::vector<Uniform<float> > uniforms_float_array;
std::vector<Uniform<float> > uniforms_vec2_array;
+ std::vector<Uniform<float> > uniforms_vec3_array;
std::vector<Uniform<float> > uniforms_vec4_array;
std::vector<Uniform<Eigen::Matrix3d> > uniforms_mat3;
friend class EffectChain;