Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineContents: add line2fbf #8

Closed
wants to merge 1 commit into from

Conversation

PhosCity
Copy link

@PhosCity PhosCity commented Dec 23, 2022

fixes #5

This PR adds a new method to split lines to frames. Supports for move, transforms and fade. Returns a list of lines.

Additionally adds a method to lerp fade value and return alpha and lerp colors in RGB colorspace(it would only lerp using HSV earlier). Also fixes lerp for rectangular clips.

You could do something like this to convert line2fbf in your script.

main = (sub, sel) ->
  lines = LineCollection sub, sel
  toDelete = {}
  lines\runCallback ((lines, line, i) ->
    data = ASS\parse line
    fbf = data\line2fbf!
    lines\addLine split for split in *[line for line in *fbf]
    toDelete[#toDelete+1] = line
  ), true
  lines\insertLines!
  lines\deleteLines toDelete

The code above only converts the line to fbf but if you desire, you could also loop through each line the method returns and do your own stuff before inserting the line to subtitle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RGB interpolation for colours
1 participant