From 485186e6f6dd78143648bf7209b8eb5adec0e6bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Tschumperl=C3=A9?= <david.tschumperle@gmail.com>
Date: Wed, 14 Nov 2018 16:30:18 +0100
Subject: [PATCH] Fix typos in comments.

---
 examples/edge_explorer2d.cpp      | 12 ++++++------
 examples/mcf_levelsets3d.cpp      |  4 ++--
 examples/spherical_function3d.cpp |  4 ++--
 examples/use_RGBclass.cpp         |  2 +-
 plugins/cvMat.h                   | 26 ++++++++++++-------------
 plugins/inpaint.h                 | 32 +++++++++++++++----------------
 6 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/examples/edge_explorer2d.cpp b/examples/edge_explorer2d.cpp
index 7e620c4..9d32ece 100644
--- a/examples/edge_explorer2d.cpp
+++ b/examples/edge_explorer2d.cpp
@@ -93,18 +93,18 @@ int main(int argc, char** argv) {
     if (disp_edge.is_closed()) disp_edge.show();
     if (disp.is_resized()) disp.resize(disp);
     if (disp.mouse_x()>=0) {
-      x = disp.mouse_x(); // Getting the current position of the mouse.
+      x = disp.mouse_x(); // Getting the current position of the mouse
       y = disp.mouse_y(); //
-      redraw = true;    // The image should be redrawn.
+      redraw = true;    // The image should be redrawn
     }
     if (redraw) {
       disp_edge.set_title("Edge explorer (alpha=%g)",alpha);
       const int
         x0 = x - factor, y0 = y - factor,  // These are the coordinates for the red rectangle
-        x1 = x + factor, y1 = y + factor;  // to be drawn on the original image.
+        x1 = x + factor, y1 = y + factor;  // to be drawn on the original image
       const unsigned char
         red[3] = { 255,0,0 },          //
-        black[3] = { 0,0,0 };          // Defining the colors we need for drawing.
+        black[3] = { 0,0,0 };          // Defining the colors we need for drawing
 
         (+img).draw_rectangle(x0,y0,x1,y1,red,1.0f,0x55555555U).display(disp);
         //^ We draw the red rectangle on the original window using 'draw_line'.
@@ -116,7 +116,7 @@ int main(int argc, char** argv) {
         CImg<> visu_bw = CImg<>(img).get_crop(x0,y0,x1,y1).get_norm().normalize(0,255).resize(-100,-100,1,2,2);
         // get_crop(x0,y0,x1,y1) gets the rectangle we are interested in.
 
-        edge.fill(255); // Background color in the edge-detection window is white.
+        edge.fill(255); // Background color in the edge-detection window is white
 
         // grad[0] is the gradient image of 'visu_bw' in x-direction.
         // grad[1] is the gradient image of 'visu_bw' in y-direction.
@@ -159,7 +159,7 @@ int main(int argc, char** argv) {
                 }
               };
               break;
-            case 2: // Angle 'theta' of the gradient (Gs,Gt) at the point (s,t).
+            case 2: // Angle 'theta' of the gradient (Gs,Gt) at the point (s,t)
               if(theta >= pi)theta-=pi;
               //rounding theta:
               if ((p8 < theta && theta <= p38 ) || (p78 < theta && theta <= pi)) {
diff --git a/examples/mcf_levelsets3d.cpp b/examples/mcf_levelsets3d.cpp
index 901703d..ef343c9 100644
--- a/examples/mcf_levelsets3d.cpp
+++ b/examples/mcf_levelsets3d.cpp
@@ -106,7 +106,7 @@ int main(int argc,char **argv) {
     img.draw_fill(s[0],s[1],s[2],tmp,1,region,alpha);
     ((img = region.normalize(-1,1))*=-1).blur(sigma);
   }
-  else { // Create synthetic implicit function.
+  else { // Create synthetic implicit function
     img.assign(60,60,60);
     const float exte[] = { 1 }, inte[] = { -1 };
     img.fill(*exte).draw_rectangle(15,15,15,45,45,45,inte).draw_rectangle(25,25,0,35,35,img.depth() - 1,exte).
@@ -130,7 +130,7 @@ int main(int argc,char **argv) {
     disp3d.set_title("Mean curvature flow 3D - Isosurface (iter. %u)",iteration);
 
     // Apply PDE on the distance function.
-    mcf_PDE(img,1,dt,narrow); // Do one iteration of mean curvature flow.
+    mcf_PDE(img,1,dt,narrow); // Do one iteration of mean curvature flow
     // Every 10 steps, do one iteration of distance function re-initialization.
     if (!(iteration%10)) img.distance_eikonal(1,narrow,0.5f);
 
diff --git a/examples/spherical_function3d.cpp b/examples/spherical_function3d.cpp
index 117ee4e..54b6cbc 100644
--- a/examples/spherical_function3d.cpp
+++ b/examples/spherical_function3d.cpp
@@ -55,7 +55,7 @@ int main() {
   CImgList<float> object_opacities;
 
   // Define a 3D centered box.
-  CImg<float> object_vertices = CImg<float>(3,8,1,1,  // Define the 8 vertices of the cube.
+  CImg<float> object_vertices = CImg<float>(3,8,1,1,  // Define the 8 vertices of the cube
                                             -1,-1,-1, // (x0,y0,z0)
                                             1,-1,-1,  // (x1,y1,z1)
                                             1,1,-1,   // ...
@@ -64,7 +64,7 @@ int main() {
                                             1,-1,1,
                                             1,1,1,     // (x6,y6,z6)
                                             -1,1,1).transpose(); // (x7,y7,z7)
-  CImgList<unsigned int> object_primitives(12,1,2,1,1, // Define the 12 segments of the cube.
+  CImgList<unsigned int> object_primitives(12,1,2,1,1, // Define the 12 segments of the cube
                                            0,1, 1,2, 2,3, 3,0,
                                            4,5, 5,6, 6,7, 7,4,
                                            0,4, 1,5, 2,6, 3,7);
diff --git a/examples/use_RGBclass.cpp b/examples/use_RGBclass.cpp
index 72dd92b..5b19d0a 100644
--- a/examples/use_RGBclass.cpp
+++ b/examples/use_RGBclass.cpp
@@ -45,7 +45,7 @@
 */
 
 #ifndef cimg_plugin
-#define cimg_plugin "examples/use_RGBclass.cpp"  // Path of the plugin is relative to the CImg.h file.
+#define cimg_plugin "examples/use_RGBclass.cpp"  // Path of the plugin is relative to the CImg.h file
 #include "CImg.h"
 using namespace cimg_library;
 #ifndef cimg_imagepath
diff --git a/plugins/cvMat.h b/plugins/cvMat.h
index af5d4ea..aba70cf 100644
--- a/plugins/cvMat.h
+++ b/plugins/cvMat.h
@@ -37,14 +37,14 @@ CImg(const cv::Mat& src):_width(0),_height(0),_depth(0),_spectrum(0),_is_shared(
 CImg<T>& assign(const cv::Mat & src) {
   if (src.isContinuous()) {
     switch (src.depth()) {
-        // case CV_1U: { // 1-bit int.
+        // case CV_1U: { // 1-bit int
         //    IplImage *src1 = cvCreateImage(cvGetSize(src),CV_8U,1);
         //    cvConvert(src,src1);
         //    CImg<ucharT>((unsigned char*)src1->imageData,src1->nChannels,src1.cols,src1.rows,1,true).
         //      get_permute_axes("yzcx").move_to(*this);
         //    cvReleaseImage(&src1);
         //  } break;
-    case CV_8U: // 8-bit unsigned int.
+    case CV_8U: // 8-bit unsigned int
       if (src.channels()==1) {
         CImg<ucharT>((unsigned char*)src.ptr(),src.cols,src.rows,true).move_to(*this);
       } else {
@@ -61,7 +61,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_8S: // 8-bit signed int.
+    case CV_8S: // 8-bit signed int
       if (src.channels()==1) {
         CImg<charT>((char*)src.ptr(),src.cols,src.rows,true).move_to(*this);
       } else {
@@ -78,7 +78,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_16U: // 16-bit unsigned int.
+    case CV_16U: // 16-bit unsigned int
       if (src.channels()==1) {
         CImg<ushortT>((unsigned short*)src.ptr(),src.cols,src.rows,true).move_to(*this);
       } else {
@@ -95,7 +95,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_16S: // 16-bit signed int.
+    case CV_16S: // 16-bit signed int
       if (src.channels()==1) {
         CImg<shortT>((short*)src.ptr(),src.cols,src.rows,true).move_to(*this);
       } else {
@@ -112,7 +112,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_32S: // 32-bit signed int.
+    case CV_32S: // 32-bit signed int
       if (src.channels()==1) {
         CImg<intT>((int*)src.ptr(),src.cols,src.rows,true).move_to(*this);
       } else {
@@ -129,7 +129,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_32F: // 32-bit float.
+    case CV_32F: // 32-bit float
       if (src.channels()==1) {
         CImg<floatT>((float*)src.ptr(),src.cols,src.rows,true).move_to(*this);
       } else {
@@ -146,7 +146,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_64F: // 64-bit double.
+    case CV_64F: // 64-bit double
       if (src.channels()==1) {
         CImg<doubleT>((double*)src.ptr(),src.cols,src.rows,true).move_to(*this);
       } else {
@@ -172,7 +172,7 @@ CImg<T>& assign(const cv::Mat & src) {
   } else {
     cv::Size size = src.size();
     switch (src.depth()) {
-    case CV_8U: // 8-bit unsigned int.
+    case CV_8U: // 8-bit unsigned int
       if (src.channels()==1) {
         CImg<ucharT> tmp(src.cols,src.rows);
         for (int i = 0; i<size.height; ++i) {
@@ -196,7 +196,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_8S: // 8-bit int.
+    case CV_8S: // 8-bit int
       if (src.channels()==1) {
         CImg<charT> tmp(src.cols,src.rows);
         for (int i = 0; i<size.height; ++i) {
@@ -220,7 +220,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_16S: // 16-bit int.
+    case CV_16S: // 16-bit int
       if (src.channels()==1) {
         CImg<shortT> tmp(src.cols,src.rows);
         for (int i = 0; i<size.height; ++i) {
@@ -244,7 +244,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_32F: // 32-bit float.float
+    case CV_32F: // 32-bit float
       if (src.channels()==1) {
         CImg<floatT> tmp(src.cols,src.rows);
         for (int i = 0; i<size.height; ++i) {
@@ -268,7 +268,7 @@ CImg<T>& assign(const cv::Mat & src) {
         tmp.move_to(*this);
       }
       break;
-    case CV_64F: // 64-bit double.
+    case CV_64F: // 64-bit double
       if (src.channels()==1) {
         CImg<doubleT> tmp(src.cols,src.rows);
         for (int i = 0; i<size.height; ++i) {
diff --git a/plugins/inpaint.h b/plugins/inpaint.h
index 99924aa..d7083f9 100644
--- a/plugins/inpaint.h
+++ b/plugins/inpaint.h
@@ -133,7 +133,7 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
 
   CImg<floatT> confidences(nmask), priorities(dx,dy,1,2,-1), pC;
   CImg<unsigned int> saved_patches(4,256), is_visited(width(),height(),1,1,0);
-  CImg<ucharT> pM, pN;  // Pre-declare patch variables (avoid iterative memory alloc/dealloc).
+  CImg<ucharT> pM, pN;  // Pre-declare patch variables (avoid iterative memory alloc/dealloc)
   CImg<T> pP, pbest;
   CImg<floatT> weights(patch_size,patch_size,1,1,0);
   weights.draw_gaussian((float)p1,(float)p1,patch_size/15.0f,&one)/=patch_size2;
@@ -148,13 +148,13 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
     CImg_5x5(M,unsigned char);
 
     cimg_for_in5x5(nmask,xm0,ym0,xm1,ym1,x,y,0,0,M,unsigned char)
-      if (!Mcc && (Mcp || Mcn || Mpc || Mnc)) { // Found mask border point.
+      if (!Mcc && (Mcp || Mcn || Mpc || Mnc)) { // Found mask border point
 
         float confidence_term = -1, data_term = -1;
-        if (priorities(x,y)>=0) { // If priority has already been computed.
+        if (priorities(x,y)>=0) { // If priority has already been computed
           confidence_term = priorities(x,y,0);
           data_term = priorities(x,y,1);
-        } else { // If priority must be computed/updated.
+        } else { // If priority must be computed/updated
 
           // Compute smoothed normal vector.
           const float
@@ -199,7 +199,7 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
             mean_ixiy += w*ix*iy;
             mean_iy2 += w*iy*iy;
           }
-          const float // Compute tensor-directed data term.
+          const float // Compute tensor-directed data term
             ux = mean_ix2*(-ny) + mean_ixiy*nx,
             uy = mean_ixiy*(-ny) + mean_iy2*nx;
           data_term = std::sqrt(ux*ux + uy*uy);
@@ -248,7 +248,7 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
     }
     const int l2 = (int)final_lookup_size/2, l1 = (int)final_lookup_size - l2 - 1;
 
-#ifdef gmic_debug
+#ifdef inpaint_debug
     CImg<ucharT> visu(*this,false);
     for (unsigned int C = 0; C<nb_lookup_candidates; ++C) {
       const int
@@ -265,7 +265,7 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
       disp_debug.display(visu).set_title("DEBUG");
     }
     ++foo;
-#endif // #ifdef gmic_debug
+#endif // #ifdef inpaint_debug
 
     // Find best patch candidate to fill target point.
     _inpaint_patch_crop(target_x - p1,target_y - p1,target_x + p2,target_y + p2,0).move_to(pP);
@@ -308,21 +308,21 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
           }
     }
 
-    if (best_x<0) { // If no best patch found.
-      priorities(target_x - ox,target_y - oy,0)/=10; // Reduce its priority (lower data_term).
+    if (best_x<0) { // If no best patch found
+      priorities(target_x - ox,target_y - oy,0)/=10; // Reduce its priority (lower data_term)
       if (++nb_fails>=4) { // If too much consecutive fails :
         nb_fails = 0;
-        _lookup_size+=_lookup_size/2; // Try to expand the lookup size.
+        _lookup_size+=_lookup_size/2; // Try to expand the lookup size
         if (++nb_lookups>=3) {
-          if (is_strict_search) { // If still fails, switch to non-strict search mode.
+          if (is_strict_search) { // If still fails, switch to non-strict search mode
             is_strict_search = false;
             _lookup_size = lookup_size;
             nb_lookups = 0;
           }
-          else return *this; // Pathological case, probably a weird mask.
+          else return *this; // Pathological case, probably a weird mask
         }
       }
-    } else { // Best patch found -> reconstruct missing part on the target patch.
+    } else { // Best patch found -> reconstruct missing part on the target patch
       _lookup_size = lookup_size;
       nb_lookups = nb_fails = 0;
       _inpaint_patch_crop(best_x - p1,best_y - p1,best_x + p2,best_y + p2,0).move_to(pbest);
@@ -345,7 +345,7 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
       if (++nb_saved_patches>=saved_patches._height) saved_patches.resize(4,-200,1,1,0);
     }
   }
-  nmask.assign();  // Free some unused memory resources.
+  nmask.assign();  // Free some unused memory resources
   priorities.assign();
   confidences.assign();
   is_visited.assign();
@@ -436,7 +436,7 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
           ys = (int)*(ptr++),
           xd = (int)*(ptr++),
           yd = (int)*(ptr++);
-        if (xs - b1<0 || ys - b1<0 || xs + b2>=width() || ys + b2>=height()) { // Blend with partial patch.
+        if (xs - b1<0 || ys - b1<0 || xs + b2>=width() || ys + b2>=height()) { // Blend with partial patch
           const int
             xs0 = std::max(0,xs - b1),
             ys0 = std::max(0,ys - b1),
@@ -446,7 +446,7 @@ CImg<T>& inpaint_patch(const CImg<t>& mask, const unsigned int patch_size=11,
           weights._inpaint_patch_crop(xs0 - xs + b1,ys0 - ys + b1,xs1 - xs + b1,ys1 - ys + b1,0).move_to(pC);
           blended.draw_image(xd + xs0 - xs - ox,yd + ys0 - ys - oy,pP,pC,-1);
           cumul.draw_image(xd + xs0 - xs - ox,yd + ys0 - ys - oy,pC,-1);
-        } else { // Blend with full-size patch.
+        } else { // Blend with full-size patch
           _inpaint_patch_crop(xs - b1,ys - b1,xs + b2,ys + b2,0).move_to(pP);
           blended.draw_image(xd - b1 - ox,yd - b1 - oy,pP,weights,-1);
           cumul.draw_image(xd - b1 - ox,yd - b1 - oy,weights,-1);
-- 
GitLab