* Use .empty() and .data() * Use nullptr instead of 0 * No else after return * Simple class member initialization * Add override for virtual methods * Include C++ instead of C headers * Remove some unused includes * Use default constructors * Always use braces * Consistent names in definition and declaration * Change typedef to using Pull Request: https://projects.blender.org/blender/blender/pulls/132361
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#pragma once
|
|
|
|
#include "integrator/denoiser.h"
|
|
#include "util/thread.h"
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
/* Implementation of a CPU based denoiser which uses OpenImageDenoise library. */
|
|
class OIDNDenoiser : public Denoiser {
|
|
public:
|
|
/* Forwardly declared state which might be using compile-flag specific fields, such as
|
|
* OpenImageDenoise device and filter handles. */
|
|
class State;
|
|
|
|
OIDNDenoiser(Device *denoiser_device, const DenoiseParams ¶ms);
|
|
|
|
bool denoise_buffer(const BufferParams &buffer_params,
|
|
RenderBuffers *render_buffers,
|
|
const int num_samples,
|
|
bool allow_inplace_modification) override;
|
|
|
|
protected:
|
|
uint get_device_type_mask() const override;
|
|
|
|
/* We only perform one denoising at a time, since OpenImageDenoise itself is multithreaded.
|
|
* Use this mutex whenever images are passed to the OIDN and needs to be denoised. */
|
|
static thread_mutex mutex_;
|
|
};
|
|
|
|
CCL_NAMESPACE_END
|