Class GLSinCityVideoEffect
- Namespace
- VisioForge.Core.Types.X.OpenGL
- Assembly
- VisioForge.Core.dll
Applies hardware-accelerated Sin City-style selective color effect to video frames using OpenGL/OpenGL ES shaders. This effect creates the iconic neo-noir visual style popularized by Frank Miller's graphic novels and film adaptations, rendering most of the scene in monochrome while preserving red color tones for dramatic emphasis.
public class GLSinCityVideoEffect : GLBaseVideoEffectInheritance
Inherited Members
Remarks
SDK Availability: Available in: VideoCaptureCoreX, MediaPlayerCoreX, Media Blocks SDK (Cross-platform)
Platform Support: Windows, Linux, macOS, Android, iOS (OpenGL ES)
OpenGL Acceleration: This effect is fully GPU-accelerated using OpenGL 3.0+ on desktop platforms and OpenGL ES 2.0+ on mobile devices. The selective color transformation is implemented as a fragment shader that performs per-pixel color analysis to detect red hues, preserving them while desaturating all other colors to grayscale. The shader uses HSV color space conversion for accurate red detection and smooth transitions. All processing occurs on the GPU in a single rendering pass, enabling real-time selective color effects with no CPU overhead.
Effect Description: The Sin City effect recreates the distinctive visual style of the graphic novels and films, characterized by high-contrast black and white imagery with selective preservation of red colors. The effect analyzes each pixel's color, detecting red hues (including variations like crimson, scarlet, and deep red) and preserving their saturation and intensity. All non-red colors are desaturated to grayscale, creating a stark monochrome backdrop. This creates powerful visual contrast where red elements (clothing, lights, blood, objects) stand out dramatically against the black and white environment. The result is a neo-noir, comic book aesthetic with intense dramatic impact. The effect emphasizes composition, lighting, and the psychological significance of red elements in the scene.
Use Cases:
- Neo-noir films and videos recreating Sin City or graphic novel aesthetics
- Music videos requiring dramatic, stylized visuals with selective color emphasis
- Artistic projects and experimental films with bold visual statements
- Thriller and crime genre productions emphasizing danger, passion, or violence
- Fashion and beauty videos highlighting red clothing, lipstick, or accessories
- Commercial advertising featuring red brand elements or products
Performance Characteristics: This effect has minimal performance impact as it runs entirely on the GPU. Typical overhead is less than 1ms per frame on modern hardware. The selective color detection requires HSV color space conversion and hue range checking, but these operations are highly efficient on modern GPUs. Performance scales with resolution but remains real-time capable even at 4K on mid-range GPUs. The effect uses a single rendering pass with no texture lookups or multi-pass operations. On mobile devices with OpenGL ES, performance is excellent for resolutions up to 1080p, with good performance at higher resolutions on modern mobile GPUs.
Constructors
GLSinCityVideoEffect()
Initializes a new instance of the VisioForge.Core.Types.X.OpenGL.GLSinCityVideoEffect class.
public GLSinCityVideoEffect()