dxfilter

Crates.iodxfilter
lib.rsdxfilter
version0.5.13
sourcesrc
created_at2022-07-30 22:56:04.029269
updated_at2024-06-08 21:50:47.66014
descriptionProcess textures with DirectX shaders. Includes few Scale, Color conversion filters and utils to make your own.
homepagehttps://github.com/rhinostream/dxfilter-rs
repositoryhttps://github.com/rhinostream/dxfilter-rs.git
max_upload_size
id635829
size60,228
Krishna Chaitanya (kittuov)

documentation

https://docs.rs/dxfilter-rs

README

DxFilter

docs.rs Crates.io Crates.io

Scale and ColorConversion done with DirectX filters. You can also create your own filters with the provided api.

Crate contains various tools to make these features possible.

  • generate_shader! and compile_shader! macros to write shaders that compile at compile time
  • various built filters for converting and scaling from RGB to YUV or NV12
  • DxFilter interface for writing custom filters
  • utils like create_device_context , create_input_tex, create_output_tex for easier setup.
  • utils like AdapterFactory, Adapter, TextureReader imported from win_desktop_duplication.

For example usage, look at examples/rgb_to_nv12.rs

Usage

// for more detailed example see examples/rgb_to_nv12.rs
fn main() {
    // {...}

    //                                    Texture    Texture    directx device
    let filter = ConvertARGBToNV12::new(&input_tex, &output_tex, &device).unwrap();
    //                directx device
    filter.apply_filter(&context).unwrap();

    // { ... }
}

AvailableFilters

  • ARGB to AYUV
  • ARGB to NV12
  • ARGB or AYUV scale only
  • ARGB to YUV planar
  • ARGB to YUV420 planar
  • ARGB16 to Y410
  • ARGB16 to YUV444 10bit planar
  • ARGB16 to YUV420 10bit planar
Commit count: 18

cargo fmt