code: private void savePreviousImageValues() {
          if (matrix != null && viewHeight != 0 && viewWidth != 0) {
              matrix.getValues(m);
              prevMatrix.setValues(m);
              prevMatchViewHeight = matchViewHeight;
              prevMatchViewWidth = matchViewWidth;
              prevViewHeight = viewHeight;
              prevViewWidth = viewWidth;
          }
      }
docs: Save the current matrix and view dimensions
  in the prevMatrix and prevView variables.