code: public static void getImagePosition(State state, Settings settings, Rect out) {
          state.get(tmpMatrix);
          getImagePosition(tmpMatrix, settings, out);
      }
docs: Calculates image position (scaled and rotated) within viewport area with gravity applied.
  
  @param state Image state
  @param settings Image settings
  @param out Output rectangle