@Override
 public void resetScripts() {
   if (mScript != null) {
     mScript.destroy();
     mScript = null;
   }
 }
  @Override
  protected void runFilter() {
    int[] sat = new int[7];
    for (int i = 0; i < sat.length; i++) {
      sat[i] = mParameters.getValue(i);
    }

    int width = getInPixelsAllocation().getType().getX();
    int height = getInPixelsAllocation().getType().getY();
    Matrix m = getOriginalToScreenMatrix(width, height);

    mScript.set_saturation(sat);

    mScript.invoke_setupGradParams();
    runSelectiveAdjust(getInPixelsAllocation(), getOutPixelsAllocation());
  }
  private void runSelectiveAdjust(Allocation in, Allocation out) {
    int width = in.getType().getX();
    int height = in.getType().getY();

    LaunchOptions options = new LaunchOptions();
    int ty;
    options.setX(0, width);

    for (ty = 0; ty < height; ty += STRIP_SIZE) {
      int endy = ty + STRIP_SIZE;
      if (endy > height) {
        endy = height;
      }
      options.setY(ty, endy);
      mScript.forEach_selectiveAdjust(in, out, options);
      if (checkStop()) {
        return;
      }
    }
  }