Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/denoising.h
| Show All 11 Lines | |||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #ifndef __DENOISING_H__ | #ifndef __DENOISING_H__ | ||||
| #define __DENOISING_H__ | #define __DENOISING_H__ | ||||
| #if 0 | |||||
| /* TODO(sergey): Make it explicit and clear when something is a denoiser, its pipeline or | |||||
| * parameters. Currently it is an annoying mixture of terms used interchangeably. */ | |||||
| #include "device/device.h" | # include "device/device.h" | ||||
| #include "device/device_denoising.h" | |||||
| #include "render/buffers.h" | # include "render/buffers.h" | ||||
| #include "util/util_string.h" | # include "util/util_string.h" | ||||
| #include "util/util_unique_ptr.h" | # include "util/util_unique_ptr.h" | ||||
| #include "util/util_vector.h" | # include "util/util_vector.h" | ||||
| #include <OpenImageIO/imageio.h> | # include <OpenImageIO/imageio.h> | ||||
| OIIO_NAMESPACE_USING | OIIO_NAMESPACE_USING | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Denoiser */ | /* Denoiser pipeline */ | ||||
| class Denoiser { | class DenoiserPipeline { | ||||
| public: | public: | ||||
| Denoiser(DeviceInfo &device_info); | DenoiserPipeline(DeviceInfo &device_info); | ||||
| ~Denoiser(); | ~DenoiserPipeline(); | ||||
| bool run(); | bool run(); | ||||
| /* Error message after running, in case of failure. */ | /* Error message after running, in case of failure. */ | ||||
| string error; | string error; | ||||
| /* Sequential list of frame filepaths to denoise. */ | /* Sequential list of frame filepaths to denoise. */ | ||||
| vector<string> input; | vector<string> input; | ||||
| ▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | protected: | ||||
| void close_input(); | void close_input(); | ||||
| }; | }; | ||||
| /* Denoise Task */ | /* Denoise Task */ | ||||
| class DenoiseTask { | class DenoiseTask { | ||||
| public: | public: | ||||
| DenoiseTask(Device *device, Denoiser *denoiser, int frame, const vector<int> &neighbor_frames); | DenoiseTask(Device *device, | ||||
| DenoiserPipeline *denoiser, | |||||
| int frame, | |||||
| const vector<int> &neighbor_frames); | |||||
| ~DenoiseTask(); | ~DenoiseTask(); | ||||
| /* Task stages */ | /* Task stages */ | ||||
| bool load(); | bool load(); | ||||
| bool exec(); | bool exec(); | ||||
| bool save(); | bool save(); | ||||
| void free(); | void free(); | ||||
| string error; | string error; | ||||
| protected: | protected: | ||||
| /* Denoiser parameters and device */ | /* Denoiser parameters and device */ | ||||
| Denoiser *denoiser; | DenoiserPipeline *denoiser; | ||||
| Device *device; | Device *device; | ||||
| /* Frame number to be denoised */ | /* Frame number to be denoised */ | ||||
| int frame; | int frame; | ||||
| vector<int> neighbor_frames; | vector<int> neighbor_frames; | ||||
| /* Image file data */ | /* Image file data */ | ||||
| DenoiseImage image; | DenoiseImage image; | ||||
| Show All 19 Lines | protected: | ||||
| void map_neighboring_tiles(RenderTileNeighbors &neighbors, Device *tile_device); | void map_neighboring_tiles(RenderTileNeighbors &neighbors, Device *tile_device); | ||||
| void unmap_neighboring_tiles(RenderTileNeighbors &neighbors); | void unmap_neighboring_tiles(RenderTileNeighbors &neighbors); | ||||
| void release_tile(); | void release_tile(); | ||||
| bool get_cancel(); | bool get_cancel(); | ||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif | |||||
| #endif /* __DENOISING_H__ */ | #endif /* __DENOISING_H__ */ | ||||