generateNextConfig method

KenBurnsGeneratorConfig generateNextConfig(
  1. {double width,
  2. double height,
  3. double maxScale,
  4. double lastScale,
  5. bool scaleDown,
  6. double minDurationMillis,
  7. double maxDurationMillis,
  8. Offset lastTranslation}
)

Implementation

KenBurnsGeneratorConfig generateNextConfig({
  double width,
  double height,
  double maxScale,
  double lastScale,
  bool scaleDown,
  double minDurationMillis,
  double maxDurationMillis,
  Offset lastTranslation,
}) {
  Duration nextDuration;
  double nextScale;
  Offset nextTranslation;

  nextDuration = generateNextDuration(
    minDurationMillis: minDurationMillis,
    maxDurationMillis: maxDurationMillis,
  );

  nextScale = generateNextScale(
    lastScale: lastScale,
    maxScale: maxScale,
    scaleDown: scaleDown,
  );

  Size nextSize = Size(width * nextScale, height * nextScale);

  nextTranslation = generateNextTranslation(
    width: width,
    height: height,
    nextScale: nextScale,
    nextSize: nextSize,
  );

  return KenBurnsGeneratorConfig(
    newDuration: nextDuration,
    newTranslation: nextTranslation,
    newScale: nextScale,
  );
}