/* (non-Javadoc)
     * @see android.os.AsyncTask#doInBackground(Params[])
     */
    @Override
    protected Bitmap doInBackground(Types... params) {
      if (isCancelled()) return null;

      Bitmap result = null;
      mIsRendering = true;
      Types type = params[0];
      renderFilter.setType(type);

      try {
        result = renderFilter.execute(mBitmap, mPreview, -1, -1);
        mActions = renderFilter.getActions();
      } catch (JSONException e) {
        e.printStackTrace();
        mError = e.getMessage();
        return null;
      }

      if (isCancelled()) return null;
      return result;
    }
 @Override
 protected void onCancelled() {
   renderFilter.stop();
   super.onCancelled();
 }