2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2021-09-28 01:48:08 +00:00
|
|
|
|
|
|
|
#pragma once
|
2021-10-26 22:43:33 +00:00
|
|
|
#include "nvidia-vfx-effect.hpp"
|
2021-09-28 01:48:08 +00:00
|
|
|
#include "nvidia-vfx.hpp"
|
|
|
|
#include "nvidia/cuda/nvidia-cuda-gs-texture.hpp"
|
|
|
|
#include "nvidia/cuda/nvidia-cuda-obs.hpp"
|
|
|
|
#include "nvidia/cuda/nvidia-cuda.hpp"
|
|
|
|
#include "nvidia/cv/nvidia-cv-image.hpp"
|
|
|
|
#include "nvidia/cv/nvidia-cv-texture.hpp"
|
|
|
|
#include "obs/gs/gs-texture.hpp"
|
|
|
|
|
|
|
|
namespace streamfx::nvidia::vfx {
|
2021-10-26 22:43:33 +00:00
|
|
|
class denoising : protected effect {
|
|
|
|
bool _dirty;
|
2021-09-28 01:48:08 +00:00
|
|
|
|
|
|
|
std::shared_ptr<::streamfx::nvidia::cv::texture> _input;
|
|
|
|
std::shared_ptr<::streamfx::nvidia::cv::image> _convert_to_fp32;
|
|
|
|
std::shared_ptr<::streamfx::nvidia::cv::image> _source;
|
|
|
|
std::shared_ptr<::streamfx::nvidia::cv::image> _destination;
|
|
|
|
std::shared_ptr<::streamfx::nvidia::cv::image> _convert_to_u8;
|
|
|
|
std::shared_ptr<::streamfx::nvidia::cv::texture> _output;
|
|
|
|
std::shared_ptr<::streamfx::nvidia::cv::image> _tmp;
|
|
|
|
|
2021-10-26 22:43:33 +00:00
|
|
|
void* _states[1];
|
|
|
|
::streamfx::nvidia::cuda::device_ptr_t _state;
|
|
|
|
uint32_t _state_size;
|
2021-09-28 01:48:08 +00:00
|
|
|
|
2021-10-26 22:43:33 +00:00
|
|
|
float _strength;
|
2021-09-28 01:48:08 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
~denoising();
|
|
|
|
denoising();
|
|
|
|
|
|
|
|
void set_strength(float strength);
|
|
|
|
float strength();
|
|
|
|
|
|
|
|
void size(std::pair<uint32_t, uint32_t>& size);
|
|
|
|
|
|
|
|
std::shared_ptr<::streamfx::obs::gs::texture> process(std::shared_ptr<::streamfx::obs::gs::texture> in);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void resize(uint32_t width, uint32_t height);
|
|
|
|
|
|
|
|
void load();
|
|
|
|
};
|
|
|
|
} // namespace streamfx::nvidia::vfx
|