Fix qualified name 47/228447/1
authorhyunho <hhstark.kang@samsung.com>
Mon, 23 Mar 2020 06:55:39 +0000 (15:55 +0900)
committerhyunho <hhstark.kang@samsung.com>
Mon, 23 Mar 2020 06:55:39 +0000 (15:55 +0900)
internal is a C++ reserved word

Change-Id: Ie404de6da23ce610ff3a6a02aa85e15e12b80b45
Signed-off-by: hyunho <hhstark.kang@samsung.com>
ambient-viewer/src/internal.cc [deleted file]
ambient-viewer/src/internal.hh [deleted file]
ambient-viewer/src/top-app-surface.cc
ambient-viewer/src/util.cc [new file with mode: 0644]
ambient-viewer/src/util.hh [new file with mode: 0644]
ambient-viewer/src/watch-surface.cc

diff --git a/ambient-viewer/src/internal.cc b/ambient-viewer/src/internal.cc
deleted file mode 100644 (file)
index c3fd82d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <system_info.h>
-
-#include "internal.hh"
-
-#define KEY_SCREEN_SHAPE_CIRCLE "http://tizen.org/feature/screen.shape.circle"
-
-namespace ambient_viewer::internal {
-
-float GetOpr(void* source_data, int width, int height) {
-  int *source;
-  int x;
-  int y;
-  int idx;
-  int max_rad;
-  int rad;
-  int pos;
-  unsigned int r = 0;
-  unsigned int g = 0;
-  unsigned int b = 0;
-  unsigned int pixel_sum;
-  float opr;
-  float max_opr;
-  bool shape_circle = false;
-
-  system_info_get_platform_bool(KEY_SCREEN_SHAPE_CIRCLE, &shape_circle);;
-
-  source = static_cast<int*>(source_data);
-  pos = width / 2;
-  max_rad = (height * height) >> 2;
-
-  for (y = 0; y < height; ++y) {
-    for (x = 0; x < width; ++x) {
-      if (shape_circle) {
-        rad = (pos - x) * (pos - x) + (pos - y) * (pos - y);
-        if (rad <= max_rad) {
-          idx = y * width + x;
-          r += ((source[idx] & 0x00ff0000) >> 16);
-          g += ((source[idx] & 0x0000ff00) >> 8);
-          b += (source[idx] & 0x000000ff);
-        }
-      } else {
-        idx = y * width + x;
-        r += ((source[idx] & 0x00ff0000) >> 16);
-        g += ((source[idx] & 0x0000ff00) >> 8);
-        b += (source[idx] & 0x000000ff);
-      }
-    }
-  }
-
-  if (shape_circle)
-    max_opr = (width / 2) * (height / 2) * 3.14 * 3 * 255;
-  else
-    max_opr = width * height * 3 * 255;
-
-  pixel_sum = r + g + b;
-  opr = ((float)pixel_sum) / max_opr;
-
-  return opr;
-}
-
-}  // namespace ambient_viewer::internal
diff --git a/ambient-viewer/src/internal.hh b/ambient-viewer/src/internal.hh
deleted file mode 100644 (file)
index 0457719..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __AMBIENT_VIEWER_INTERNAL_H__
-#define __AMBIENT_VIEWER_INTERNAL_H__
-
-namespace ambient_viewer::internal {
-
-  float GetOpr(void* source_data, int width, int height);
-
-}  // namespace ambient_viewer::internal
-
-#endif  // __AMBIENT_VIEWER_INTERNAL_H__
-
-
-
index 312d524cf5b2070713d0c90c861afadea40f1158..194eb363bea6c2fb30f51aefa3c91ed334cf8f04 100644 (file)
@@ -17,7 +17,7 @@
 #include <dlog.h>
 
 #include "top-app-surface.hh"
-#include "internal.hh"
+#include "util.hh"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -89,7 +89,7 @@ float TopAppSurface::GetOpr() const {
     return 0;
   }
 
-  opr = ambient_viewer::internal::GetOpr(source_data, width, height);
+  opr = ambient_viewer::util::GetOpr(source_data, width, height);
 
   tbm_surface_unmap(surface);
 
diff --git a/ambient-viewer/src/util.cc b/ambient-viewer/src/util.cc
new file mode 100644 (file)
index 0000000..742ed52
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <system_info.h>
+
+#include "util.hh"
+
+#define KEY_SCREEN_SHAPE_CIRCLE "http://tizen.org/feature/screen.shape.circle"
+
+namespace ambient_viewer::util {
+
+float GetOpr(void* source_data, int width, int height) {
+  int *source;
+  int x;
+  int y;
+  int idx;
+  int max_rad;
+  int rad;
+  int pos;
+  unsigned int r = 0;
+  unsigned int g = 0;
+  unsigned int b = 0;
+  unsigned int pixel_sum;
+  float opr;
+  float max_opr;
+  bool shape_circle = false;
+
+  system_info_get_platform_bool(KEY_SCREEN_SHAPE_CIRCLE, &shape_circle);;
+
+  source = static_cast<int*>(source_data);
+  pos = width / 2;
+  max_rad = (height * height) >> 2;
+
+  for (y = 0; y < height; ++y) {
+    for (x = 0; x < width; ++x) {
+      if (shape_circle) {
+        rad = (pos - x) * (pos - x) + (pos - y) * (pos - y);
+        if (rad <= max_rad) {
+          idx = y * width + x;
+          r += ((source[idx] & 0x00ff0000) >> 16);
+          g += ((source[idx] & 0x0000ff00) >> 8);
+          b += (source[idx] & 0x000000ff);
+        }
+      } else {
+        idx = y * width + x;
+        r += ((source[idx] & 0x00ff0000) >> 16);
+        g += ((source[idx] & 0x0000ff00) >> 8);
+        b += (source[idx] & 0x000000ff);
+      }
+    }
+  }
+
+  if (shape_circle)
+    max_opr = (width / 2) * (height / 2) * 3.14 * 3 * 255;
+  else
+    max_opr = width * height * 3 * 255;
+
+  pixel_sum = r + g + b;
+  opr = ((float)pixel_sum) / max_opr;
+
+  return opr;
+}
+
+}  // namespace ambient_viewer::util
diff --git a/ambient-viewer/src/util.hh b/ambient-viewer/src/util.hh
new file mode 100644 (file)
index 0000000..d2f9ddb
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __AMBIENT_VIEWER_UTIL_H__
+#define __AMBIENT_VIEWER_UTIL_H__
+
+namespace ambient_viewer::util {
+
+  float GetOpr(void* source_data, int width, int height);
+
+}  // namespace ambient_viewer::util
+
+#endif  // __AMBIENT_VIEWER_UTIL_H__
+
+
+
index 7f455d9ec9585eebae37c2470d19d29e9957d02f..ff964a3c4954103aa550225044c417116fa26567 100644 (file)
@@ -16,7 +16,7 @@
 #include <dlog.h>
 
 #include "watch-surface.hh"
-#include "internal.hh"
+#include "util.hh"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -91,7 +91,7 @@ float WatchSurface::GetOpr() const {
     return 0;
   }
 
-  opr = ambient_viewer::internal::GetOpr(source_data, width, height);
+  opr = ambient_viewer::util::GetOpr(source_data, width, height);
   tbm_surface_unmap(surface);
 
   return opr;