Search in sources :

Example 1 with GetPositionParameters

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);
}
Also used : GetPositionParameters(com.helospark.tactview.core.timeline.GetPositionParameters) ReadOnlyClipImage(com.helospark.tactview.core.timeline.image.ReadOnlyClipImage) VisualTimelineClip(com.helospark.tactview.core.timeline.VisualTimelineClip) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) RegularRectangle(com.helospark.tactview.core.timeline.TimelineRenderResult.RegularRectangle)

Aggregations

GetPositionParameters (com.helospark.tactview.core.timeline.GetPositionParameters)1 TimelinePosition (com.helospark.tactview.core.timeline.TimelinePosition)1 RegularRectangle (com.helospark.tactview.core.timeline.TimelineRenderResult.RegularRectangle)1 VisualTimelineClip (com.helospark.tactview.core.timeline.VisualTimelineClip)1 ReadOnlyClipImage (com.helospark.tactview.core.timeline.image.ReadOnlyClipImage)1