From cd9c363a4875c66f02a2a2f020d2fd34d844d257 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 2 Dec 2021 13:22:11 +0900 Subject: [PATCH] Minor doc fixes, disable copy, allow move on Video --- src/image.h | 6 ++++++ src/opencl_handle.h | 2 ++ src/video.h | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/src/image.h b/src/image.h index 797f19b..5d06464 100644 --- a/src/image.h +++ b/src/image.h @@ -103,6 +103,9 @@ class Image { /*! * \brief Returns a grayscaled and dithered version of the current Image. * + * Using std::optional would be ideal here, but this program is aiming for + * compatibility up to C++11, and std::optional was made available in C++17. + * * \return A std::unique_ptr holding an Image on success, empty otherwise. */ std::unique_ptr ToGrayscaleDitheredWithBlueNoise(Image *blue_noise); @@ -114,6 +117,9 @@ class Image { * channels. There may be mixed pixels as a result, such as yellow, cyan, * magenta, or white. * + * Using std::optional would be ideal here, but this program is aiming for + * compatibility up to C++11, and std::optional was made available in C++17. + * * \return A std::unique_ptr holding an Image on success, empty otherwise. */ std::unique_ptr ToColorDitheredWithBlueNoise(Image *blue_noise); diff --git a/src/opencl_handle.h b/src/opencl_handle.h index 8618189..e6ae975 100644 --- a/src/opencl_handle.h +++ b/src/opencl_handle.h @@ -121,6 +121,8 @@ class OpenCLContext { * \brief Assign a previously created buffer to a kernel function's * parameter. * + * idx refers to the parameter index for the kernel function. + * * \return true on success. */ bool AssignKernelBuffer(const std::string &kernel_name, unsigned int idx, diff --git a/src/video.h b/src/video.h index 506b068..3662598 100644 --- a/src/video.h +++ b/src/video.h @@ -25,6 +25,14 @@ class Video { ~Video(); + // disable copy + Video(const Video &other) = delete; + Video &operator=(const Video &other) = delete; + + // allow move + Video(Video &&other) = default; + Video &operator=(Video &&other) = default; + /// Same as DitherVideo(const std::string&, Image*, bool, bool) bool DitherVideo(const char *output_filename, Image *blue_noise, bool grayscale = false, bool overwrite = false);