gst-plugins-rs/video/videofx/src/border/mod.rs
Sanchayan Maity 2c2cd8c2be Implement rounded corners
This plugin takes I420/YUV and appends an alpha plane to give YUVA/A420
to round the corners analogous to the border-radius in CSS. Other video
formats like NV12 not supported yet. Support for other planar formats
will follow.

Not all ways of specifying border-radius as in CSS are implemented at
the moment. Currently, we only support specifying it in pixels and it
gets applied uniformly to all corners.
2021-11-22 17:04:07 +05:30

30 lines
861 B
Rust

// Copyright (C) 2021 Asymptotic Inc.
// Author: Sanchayan Maity <sanchayan@asymptotic.io>
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at
// <https://mozilla.org/MPL/2.0/>.
//
// SPDX-License-Identifier: MPL-2.0
use gst::glib;
use gst::prelude::*;
pub mod roundedcorners;
glib::wrapper! {
pub struct RoundedCorners(ObjectSubclass<roundedcorners::RoundedCorners>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
}
unsafe impl Send for RoundedCorners {}
unsafe impl Sync for RoundedCorners {}
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst::Element::register(
Some(plugin),
"roundedcorners",
gst::Rank::None,
RoundedCorners::static_type(),
)
}