]> git.seodisparate.com - EN605.617.81.FA21_StephenSeo_DitheringProject/commitdiff
Minor doc fixes, disable copy, allow move on Video
authorStephen Seo <seo.disparate@gmail.com>
Thu, 2 Dec 2021 04:22:11 +0000 (13:22 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 2 Dec 2021 04:22:11 +0000 (13:22 +0900)
src/image.h
src/opencl_handle.h
src/video.h

index 797f19b89b2ab2b77526e247712507b3ed5f8c74..5d064642da644b85ba59e892d3d4f4881ae15fbb 100644 (file)
@@ -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<Image> 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<Image> ToColorDitheredWithBlueNoise(Image *blue_noise);
index 861818900277cbd358d4ce566582ab9243fa088a..e6ae975d89d2f34c8227f558676971234fbac9cc 100644 (file)
@@ -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,
index 506b0686b46a0cc587e048b38b9299497e8ea4fd..3662598792f2bdc414a06837ffba63f0d1610eed 100644 (file)
@@ -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);