/// Evolver Copyright 2000, Morgan McGuire
/// matrix@alum.mit.edu   http://graphics3d.com/matrix
public class Zoom extends TwoArgumentOperator implements ELOperator 
{

  public void apply(ELMatrix argument[], ELMatrix out, ELEnvironment environment)
  {
    checkArguments(argument);
    
    ELMatrix in = argument[0];
    ELMatrix amount = argument[1];

    double d = amount.average(1);

    // Make d between 1/2 and 2
    if (d < 0) {
	d = 1.0 / (-d + 1.0);
    } else {
	d = d + 1.0;
    }
    
    out.setScaled(in, d);
  }

  public String name()
  {
    return "Zoom";
  }

  public String description()
  {
    return "Increases the scale of the 1st argument by the average of the green channel of the 2nd";
  }  

  protected String iconString()
  {
    return "Zm";
  }


}





