Add chroma key controls, media pool, FTB enable/disable, fix mask flags #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Chroma Key Sampling & Adjustment Commands
Overview
This PR adds comprehensive support for ATEM chroma key sampling and adjustment features, including new protocol commands, setter methods, state handlers, and state data structures. It also includes fixes for mask and transition flag handling.
New Features
1. Chroma Key Sampling (CACC Protocol)
Added support for controlling the chroma key sampling cursor and preview:
New Setter Methods:
setKeyChromaSample(mE, keyer, sample)- Enable/disable chroma sample cursorsetKeyChromaSamplePosition(mE, keyer, x, y)- Set cursor position (normalized 0.0-1.0)setKeyChromaSampleSize(mE, keyer, size)- Set cursor size (normalized 0.0-1.0)setKeyChromaSamplePreview(mE, keyer, preview)- Enable/disable chroma sample previewProtocol Support:
CACCcommand toATEMProtocol.commandsdictionaryKACCstatus handler to receive chroma sample status updatesState Data:
chroma.sample(bool) - Sample cursor enabled statechroma.preview(bool) - Preview mode statechroma.samplePosition(Position object with x, y) - Cursor positionchroma.sampleSize(float) - Cursor sizechroma.sampledColor(dict) - Sampled YCbCr color values with normalized and raw data2. Chroma Key Adjustments (CACK Protocol)
Added granular control over chroma key adjustment parameters:
New Setter Methods:
setKeyChromaForeground(mE, keyer, foreground)- Set foreground level (0.0-1.0)setKeyChromaBackground(mE, keyer, background)- Set background level (0.0-1.0)setKeyChromaKeyEdge(mE, keyer, keyEdge)- Set key edge (0.0-1.0)setKeyChromaSpill(mE, keyer, spill)- Set spill suppression (0.0-1.0)setKeyChromaFlareSuppression(mE, keyer, flareSuppression)- Set flare suppression (0.0-1.0)setKeyChromaBrightness(mE, keyer, brightness)- Set brightness (-1.0 to 1.0)setKeyChromaContrast(mE, keyer, contrast)- Set contrast (-1.0 to 1.0)setKeyChromaSaturation(mE, keyer, saturation)- Set saturation (0.0 to 2.0)setKeyChromaRed(mE, keyer, red)- Set red adjustment (-1.0 to 1.0)setKeyChromaGreen(mE, keyer, green)- Set green adjustment (-1.0 to 1.0)setKeyChromaBlue(mE, keyer, blue)- Set blue adjustment (-1.0 to 1.0)Protocol Support:
CACKcommand toATEMProtocol.commandsdictionaryKACkstatus handler to receive chroma adjustment status updates_prepareCACKCommandPacket()inATEMConnectionManagerfor proper sequence number handlingState Data:
chroma.foreground(float) - Foreground levelchroma.background(float) - Background levelchroma.keyEdge(float) - Key edge parameterchroma.spill(float) - Spill suppressionchroma.flareSuppression(float) - Flare suppressionchroma.brightness(float) - Brightness adjustmentchroma.contrast(float) - Contrast adjustmentchroma.saturation(float) - Saturation adjustmentchroma.red(float) - Red color adjustmentchroma.green(float) - Green color adjustmentchroma.blue(float) - Blue color adjustment3. Bug Fixes
Mask/Transition Flags:
setU8Flag()calls to use proper byte and bit indicesTechnical Details
Protocol Implementation
State Management
StateData/Key.pyBackward Compatibility
Testing
Files Modified
ATEMProtocol.py- Added CACC, CACK, KACC, KACk command definitionsATEMSetterMethods.py- Added 15 new setter methods for chroma sampling and adjustmentsATEMCommandHandlers.py- Added_handleKACC()and_handleKACk()handlersATEMConnectionManager.py- Added_prepareCACKCommandPacket()methodStateData/Key.py- ExtendedKey.Chromaclass with new state fieldsUsage Example
Related Issues