nrkno / sofie-atem-connection

Sofie ATEM Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
129 stars 36 forks source link

feat: generate multiviewer labels #123

Closed Julusian closed 2 years ago

Julusian commented 2 years ago

feature closes #59

When setting the longName for an input, the multiviewer is not updated

There is a new method to generate and upload the label image for the multiviewer. This uses freetype2 to render the text, with a similar drawing style to the default atem rendering.

This has been left as a separate method for now to avoid complex logic to figure out when or if the images should be uploaded. There is also a small risk that the upload could crash an atem if it contains a bad bitmap, so it is safer to make it opt-in.

There is also a method to upload a custom buffer, more documentation is needed on how that buffer should look

Julusian commented 2 years ago

PXL_20220328_222624854 Top is this library, bottom is original

I'm pretty happy now. Not 100% perfect, but its getting close enough. I don't think we can use the original font due to licensing (I think it might be Helvetica), but this free font is close

codecov-commenter commented 2 years ago

Codecov Report

Merging #123 (46e175f) into master (80b8513) will decrease coverage by 0.92%. The diff coverage is 77.88%.

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
- Coverage   87.44%   86.52%   -0.93%     
==========================================
  Files         160      164       +4     
  Lines        4900     5269     +369     
  Branches      825      878      +53     
==========================================
+ Hits         4285     4559     +274     
- Misses        607      694      +87     
- Partials        8       16       +8     
Impacted Files Coverage Δ
...DataTransfer/DataTransferDownloadRequestCommand.ts 30.00% <0.00%> (+2.72%) :arrow_up:
...DataTransfer/DataTransferFileDescriptionCommand.ts 100.00% <ø> (ø)
src/dataTransfer/dataTransferMacro.ts 13.88% <13.88%> (ø)
src/atem.ts 21.20% <23.68%> (-0.20%) :arrow_down:
src/dataTransfer/dataTransferUploadBuffer.ts 72.34% <72.34%> (ø)
src/lib/multiviewLabel.ts 77.27% <77.27%> (ø)
src/dataTransfer/dataTransferQueue.ts 86.36% <86.36%> (ø)
src/dataTransfer/index.ts 83.47% <86.36%> (+3.10%) :arrow_up:
src/dataTransfer/dataTransfer.ts 89.47% <86.66%> (-10.53%) :arrow_down:
src/dataTransfer/dataTransferUploadClip.ts 89.55% <89.55%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 80b8513...46e175f. Read the comment docs.

Julusian commented 2 years ago

Im not 100% happy with the error handling for dataTransfers, but I don't think it is any worse than before