use of com.helospark.tactview.core.timeline.GetPositionParameters in project tactview by helospark.
the class FrameExtender method expandFrame.
public ClipImage expandFrame(FrameExtendRequest request) {
ReadOnlyClipImage frameResult = request.getFrameResult();
TimelinePosition timelinePosition = request.getTimelinePosition();
VisualTimelineClip clip = request.getClip();
int previewHeight = request.getPreviewHeight();
int previewWidth = request.getPreviewWidth();
int anchorOffsetX = clip.getHorizontalAlignment(timelinePosition).apply(frameResult.getWidth(), previewWidth);
int anchorOffsetY = clip.getVerticalAlignment(timelinePosition).apply(frameResult.getHeight(), previewHeight);
double scale = request.getScale();
GetPositionParameters getPositionParameters = new GetPositionParameters(timelinePosition, scale, previewWidth, previewHeight);
int requestedXPosition = anchorOffsetX + clip.getXPosition(getPositionParameters);
int requestedYPosition = anchorOffsetY + clip.getYPosition(getPositionParameters);
request.outBoundPositions.put(clip.getId(), new RegularRectangle(requestedXPosition, requestedYPosition, frameResult.getWidth(), frameResult.getHeight()));
return expandAndTranslate(frameResult, previewWidth, previewHeight, requestedXPosition, requestedYPosition);
}
Aggregations