LScope Reference Manual & Video Scope Analyzer Guide
#include "LScope.h"The LScope class is a dedicated, real-time video analyzer and rendering sink within the now2sdk broadcast framework. Operating analogously to an endpoint sink like LPreview, it binds directly to any parent UI widget (such as a Qt QWidget or native window handle) and monitors any upstream broadcast video source (LFile, LLive, LMixer, LColor, LStreamPlay).
LScope utilizes an ultra-fast OpenGL GPU pipeline that plots up to 172,800 sample points per frame via a custom GLSL vertex point-cloud shader with hardware additive blending (GL_SRC_ALPHA, GL_ONE). This emulates the warm, continuous phosphor glow of classic broadcast cathode-ray tube (CRT) oscilloscopes (like Tektronix and Leader) with virtually zero CPU utilization.
1. Architecture Overview
graph LR
A[Upstream Video Source<br/>LLive / LFile / LMixer / LColor] -->|Video Frames| B[LScope Sink Controller]
B -->|Auto Format Conversion| C[Cached YUV420P Textures]
C --> D[GPU Vertex Shader<br/>720x240 Sampling Grid]
D -->|Subpixel Horizontal Jitter| E[Hardware Additive Blending]
subgraph sg_1["6 Analyzer Modes"]
E --> M0[0: Waveform Luma - 0-100 IRE]
E --> M1[1: Waveform RGB Overlay]
E --> M2[2: RGB Parade - 3 Columns]
E --> M3[3: Vectorscope - Cb/Cr + 75% Targets]
E --> M4[4: Histogram - 256-Bin Smooth Areas]
E --> M5[5: Quad View - 2x2 Multi-Scope]
end
M0 & M1 & M2 & M3 & M4 & M5 --> F[Clean GL State Restore]
F --> G[Vector Graticule Overlay<br/>Crisp Anti-Aliased Typography]
G --> H[Target UI Widget]
2. Supported Broadcast Scope Modes
1. Waveform (Luma) — Scope_WaveformLuma
Displays the luminance ($Y$) distribution across the horizontal width of the video signal against a standard 0 to 100 IRE graticule scale:
- Highlights (100 IRE): Identifies clipping and legal broadcast ceiling thresholds.
- Midtones (50 IRE): Monitors exposure levels on key subjects and faces.
- Shadows (0 IRE): Verifies black floor crushing and legal pedestal limits.
- Sub-Pixel Jitter: Eliminates discrete column aliasing, yielding a continuous, silky-smooth analog CRT phosphor trace.
2. Waveform (RGB) — Scope_WaveformRGB
Overlays Red, Green, and Blue luminance curves simultaneously on the same horizontal axis. Color overlapping illustrates channel imbalances and highlights color casts directly in shadows, midtones, or peaks.
3. RGB Parade — Scope_ParadeRGB
Separates the video signal into 3 distinct side-by-side columns: RED | GREEN | BLUE. Indispensable for camera color temperature balancing, white balance calibration, and lens chromatic matching.
4. Vectorscope — Scope_Vectorscope
Plots the chrominance phase (Cb along horizontal X axis, Cr along vertical Y axis) in polar coordinates:
- 75% Saturated Color Targets: Dedicated target boxes for
Red (R),Magenta (Mg),Blue (B),Cyan (Cy),Green (G), andYellow (Yl)accurately positioned on the 75% radius circle. - I/SKIN Line: Standard 123° skin-tone reference line. Regardless of ethnicity, natural human skin tones fall directly along this vector.
5. Histogram — Scope_Histogram
Computes instantaneous 256-bin tonal distribution area curves for Red, Green, and Blue channels. Uses additive color blending where overlapping areas naturally render Yellow, Cyan, Magenta, or White.
6. Quad View (4-Up) — Scope_QuadView
Simultaneous 2x2 multi-screen matrix utilizing hardware glViewport and glScissor isolation:
- Top-Left: Waveform (Luma)
- Top-Right: RGB Parade
- Bottom-Left: Vectorscope
- Bottom-Right: Histogram (RGB)
3. API Reference
C++ Methods (LScope)
void scopeEnable(void* parentWidget);
Attaches and embeds the OpenGL scope renderer into a parent UI widget (e.g. Qt QWidget*).
void scopeObject(LObject* source);
Connects an upstream video source (LFile, LLive, LMixer, LColor) to the scope.
void setScopeType(ScopeType type);
Selects the active scope visualization mode (0: Luma, 1: RGB, 2: Parade, 3: Vectorscope, 4: Histogram, 5: Quad View).
ScopeType getScopeType() const;
Returns the currently active scope mode.
void setIntensity(float gain);
Adjusts phosphor trace brightness multiplier (0.2 to 5.0, default: 1.0).
float getIntensity() const;
Returns the current trace brightness multiplier.
void setShowGraticule(bool show);
Shows or hides the graticule lines, IRE scales, vector targets, and text labels (default: true).
bool getShowGraticule() const;
Returns whether the graticule overlay is visible.
void setEnabled(bool enabled);
void statusGet(int& status);
Enables or pauses real-time analysis, and queries active rendering state (1 active, 0 paused/idle).
void clear();
Flushes the internal frame queue and resets the scope trace.
void setProps(const std::string& key, const std::string& value);
Key-value property configuration interface ("type", "intensity", "graticule", "enabled").
4. Complete C++ Code Example
#include <QApplication>
#include <QWidget>
#include <QVBoxLayout>
#include "now2sdk.h"
int main(int argc, char* argv[]) {
QApplication app(argc, argv);
QWidget window;
window.resize(1280, 720);
window.setWindowTitle("now2sdk Broadcast Video Scope Analyzer");
QWidget* scopeContainer = new QWidget(&window);
scopeContainer->setGeometry(0, 0, 1280, 720);
// 1. Ingest camera feed from DeckLink SDI
LLive* camera = new LLive();
camera->DeviceSet(0);
camera->Start();
// 2. Attach real-time GPU color grader
LColor* color = new LColor();
color->setSource(camera);
color->setContrast(1.10f);
// 3. Create LScope and embed in Qt widget
LScope* scope = new LScope();
scope->scopeEnable(scopeContainer);
scope->scopeObject(color); // Analyze post-grade color output
// 4. Configure Scope parameters
scope->setScopeType(LScope::Scope_QuadView); // 4-Up Multi-Scope
scope->setIntensity(1.20f); // Boost phosphor brightness
scope->setShowGraticule(true);
window.show();
return app.exec();
}
5. C API Integration (now2sdk_c_api.h)
#include "now2sdk_c_api.h"
void setup_scope_monitor(void* parent_widget_handle, void* color_processor_handle) {
// Create scope analyzer instance
void* scope = now2sdk_scope_create();
// Embed into target UI widget
now2sdk_scope_enable(scope, parent_widget_handle);
// Attach stream source
now2sdk_scope_set_source(scope, color_processor_handle);
// Select RGB Parade mode (2)
now2sdk_scope_set_type(scope, 2);
// Enable graticules & set brightness
now2sdk_scope_set_show_graticule(scope, 1);
now2sdk_scope_set_intensity(scope, 1.0f);
}