Clang-format aos
It has drifted... Clean it up a bit.
Change-Id: I2fe31a2187b4f690634ae6942786575db20192af
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/vision/blob/codec_test.cc b/aos/vision/blob/codec_test.cc
index 53dc3bb..d510e58 100644
--- a/aos/vision/blob/codec_test.cc
+++ b/aos/vision/blob/codec_test.cc
@@ -1,6 +1,7 @@
#include "aos/vision/blob/codec.h"
#include <algorithm>
+
#include "gtest/gtest.h"
namespace aos {
diff --git a/aos/vision/blob/range_image.h b/aos/vision/blob/range_image.h
index a735442..d962788 100644
--- a/aos/vision/blob/range_image.h
+++ b/aos/vision/blob/range_image.h
@@ -38,8 +38,12 @@
RangeImage() {}
bool operator==(const RangeImage &other) const {
- if (min_y_ != other.min_y_) { return false; }
- if (ranges_ != other.ranges_) { return false; }
+ if (min_y_ != other.min_y_) {
+ return false;
+ }
+ if (ranges_ != other.ranges_) {
+ return false;
+ }
return true;
}
bool operator!=(const RangeImage &other) const { return !(*this == other); }
diff --git a/aos/vision/blob/stream_view.h b/aos/vision/blob/stream_view.h
index 4cee7b4..0db69e5 100644
--- a/aos/vision/blob/stream_view.h
+++ b/aos/vision/blob/stream_view.h
@@ -1,12 +1,12 @@
#ifndef _AOS_VISION_BLOB_STREAM_VIEW_H_
#define _AOS_VISION_BLOB_STREAM_VIEW_H_
+#include <memory>
+
#include "aos/vision/blob/range_image.h"
#include "aos/vision/debug/debug_window.h"
#include "aos/vision/image/image_types.h"
-#include <memory>
-
namespace aos {
namespace vision {
diff --git a/aos/vision/blob/threshold.cc b/aos/vision/blob/threshold.cc
index 047d8db..c4f8a9e 100644
--- a/aos/vision/blob/threshold.cc
+++ b/aos/vision/blob/threshold.cc
@@ -29,14 +29,16 @@
for (int x = 0; x < fmt.w / kChunkSize; ++x) {
// The per-channel (YUYV) values in the current chunk.
uint8_t chunk_channels[2 * kChunkSize];
- memcpy(&chunk_channels[0], current_row + x * kChunkSize * 2, 2 * kChunkSize);
+ memcpy(&chunk_channels[0], current_row + x * kChunkSize * 2,
+ 2 * kChunkSize);
__builtin_prefetch(current_row + (x + 1) * kChunkSize * 2);
for (int i = 0; i < kChunkSize; ++i) {
if ((chunk_channels[i * 2] > value) != in_range) {
const int here = x * kChunkSize + i;
if (in_range) {
- current_row_ranges.emplace_back(ImageRange(current_range_start, here));
+ current_row_ranges.emplace_back(
+ ImageRange(current_range_start, here));
} else {
current_range_start = here;
}
diff --git a/aos/vision/blob/transpose_test.cc b/aos/vision/blob/transpose_test.cc
index a5c2964..374b5bf 100644
--- a/aos/vision/blob/transpose_test.cc
+++ b/aos/vision/blob/transpose_test.cc
@@ -1,8 +1,9 @@
#include "aos/vision/blob/transpose.h"
-#include "aos/vision/blob/test_utils.h"
#include <algorithm>
#include <string>
+
+#include "aos/vision/blob/test_utils.h"
#include "gtest/gtest.h"
namespace aos {
diff --git a/aos/vision/debug/aveugle-source.cc b/aos/vision/debug/aveugle-source.cc
index d03be14..65a8e84 100644
--- a/aos/vision/debug/aveugle-source.cc
+++ b/aos/vision/debug/aveugle-source.cc
@@ -1,9 +1,9 @@
-#include "aos/vision/debug/debug_framework.h"
-
#include <gdk/gdk.h>
+
#include <fstream>
#include <string>
+#include "aos/vision/debug/debug_framework.h"
#include "aos/vision/image/camera_params.pb.h"
#include "aos/vision/image/image_stream.h"
@@ -46,9 +46,8 @@
++i_;
}
});
- interface_->InstallSetExposure([this](int abs_exp) {
- this->SetExposure(abs_exp);
- });
+ interface_->InstallSetExposure(
+ [this](int abs_exp) { this->SetExposure(abs_exp); });
}
void ProcessImage(DataRef data, aos::monotonic_clock::time_point) override {
prev_data_ = std::string(data);
diff --git a/aos/vision/debug/blob_log-source.cc b/aos/vision/debug/blob_log-source.cc
index 26706bb..006c09a 100644
--- a/aos/vision/debug/blob_log-source.cc
+++ b/aos/vision/debug/blob_log-source.cc
@@ -1,17 +1,16 @@
-#include "aos/vision/debug/debug_framework.h"
-
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <sys/stat.h>
#include <unistd.h>
+
#include <fstream>
#include <functional>
#include <string>
#include "aos/vision/blob/codec.h"
#include "aos/vision/blob/stream_view.h"
+#include "aos/vision/debug/debug_framework.h"
#include "aos/vision/debug/overlay.h"
-
#include "glog/logging.h"
namespace aos {
diff --git a/aos/vision/debug/camera-source.cc b/aos/vision/debug/camera-source.cc
index 5eeabfc..578ebc1 100644
--- a/aos/vision/debug/camera-source.cc
+++ b/aos/vision/debug/camera-source.cc
@@ -1,9 +1,9 @@
-#include "aos/vision/debug/debug_framework.h"
-
#include <gdk/gdk.h>
+
#include <fstream>
#include <string>
+#include "aos/vision/debug/debug_framework.h"
#include "aos/vision/image/camera_params.pb.h"
#include "aos/vision/image/image_stream.h"
diff --git a/aos/vision/debug/debug_framework.h b/aos/vision/debug/debug_framework.h
index d8ed4a1..c2913c2 100644
--- a/aos/vision/debug/debug_framework.h
+++ b/aos/vision/debug/debug_framework.h
@@ -44,9 +44,8 @@
void InstallSetExposure(std::function<void(int)> set_exp) {
set_exposure_ = set_exp;
}
- void SetExposure(int abs_exp) {
- set_exposure_(abs_exp);
- }
+ void SetExposure(int abs_exp) { set_exposure_(abs_exp); }
+
private:
std::function<void(int)> set_exposure_;
};
diff --git a/aos/vision/debug/debug_window.h b/aos/vision/debug/debug_window.h
index aa31a8c..573cef5 100644
--- a/aos/vision/debug/debug_window.h
+++ b/aos/vision/debug/debug_window.h
@@ -2,7 +2,9 @@
#define AOS_VISION_DEBUG_DEBUG_WINDOW_H_
#include <cairo.h>
+
#include <functional>
+
#include "aos/vision/debug/overlay.h"
#include "aos/vision/image/image_types.h"
diff --git a/aos/vision/debug/jpeg_list-source.cc b/aos/vision/debug/jpeg_list-source.cc
index 027acc9..ecc3f14 100644
--- a/aos/vision/debug/jpeg_list-source.cc
+++ b/aos/vision/debug/jpeg_list-source.cc
@@ -1,11 +1,11 @@
-#include "aos/vision/debug/debug_framework.h"
-
-#include "aos/vision/image/image_dataset.h"
-
#include <gdk/gdk.h>
+
#include <fstream>
#include <string>
+#include "aos/vision/debug/debug_framework.h"
+#include "aos/vision/image/image_dataset.h"
+
namespace aos {
namespace vision {
@@ -37,16 +37,15 @@
interface_->NewJpeg(frame.data);
} else {
const auto &data = frame.data;
- interface_->NewImage({640, 480},
- [&](ImagePtr img_data) {
- for (int y = 0; y < 480; ++y) {
- for (int x = 0; x < 640; ++x) {
- uint8_t v = data[y * 640 * 2 + x * 2 + 0];
- img_data.get_px(x, y) = PixelRef{v, v, v};
- }
- }
- return false;
- });
+ interface_->NewImage({640, 480}, [&](ImagePtr img_data) {
+ for (int y = 0; y < 480; ++y) {
+ for (int x = 0; x < 640; ++x) {
+ uint8_t v = data[y * 640 * 2 + x * 2 + 0];
+ img_data.get_px(x, y) = PixelRef{v, v, v};
+ }
+ }
+ return false;
+ });
}
}
diff --git a/aos/vision/debug/overlay.h b/aos/vision/debug/overlay.h
index c668e17..a2cecd5 100644
--- a/aos/vision/debug/overlay.h
+++ b/aos/vision/debug/overlay.h
@@ -239,7 +239,7 @@
std::vector<std::pair<Vector<2>, double>> circles_;
};
-} // vision
-} // aos
+} // namespace vision
+} // namespace aos
#endif // _AOS_VISION_IMAGE_DEBUG_OVERLAY_H_
diff --git a/aos/vision/debug/tcp-source.cc b/aos/vision/debug/tcp-source.cc
index b95e189..de406ae 100644
--- a/aos/vision/debug/tcp-source.cc
+++ b/aos/vision/debug/tcp-source.cc
@@ -1,15 +1,15 @@
-#include "aos/vision/debug/debug_framework.h"
-
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <sys/stat.h>
#include <unistd.h>
+
#include <cstdlib>
#include <fstream>
#include <functional>
#include <string>
#include "aos/vision/blob/codec.h"
+#include "aos/vision/debug/debug_framework.h"
#include "aos/vision/events/tcp_client.h"
namespace aos {
diff --git a/aos/vision/events/gtk_event.cc b/aos/vision/events/gtk_event.cc
index d1f60a1..e1e4e08 100644
--- a/aos/vision/events/gtk_event.cc
+++ b/aos/vision/events/gtk_event.cc
@@ -1,12 +1,13 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <sys/epoll.h>
+
#include <condition_variable>
#include <mutex>
#include <thread>
-#include "aos/vision/events/epoll_events.h"
#include "aos/logging/logging.h"
+#include "aos/vision/events/epoll_events.h"
namespace aos {
namespace events {
diff --git a/aos/vision/events/tcp_client.h b/aos/vision/events/tcp_client.h
index 74f1418..8aab2cc 100644
--- a/aos/vision/events/tcp_client.h
+++ b/aos/vision/events/tcp_client.h
@@ -1,11 +1,11 @@
#ifndef _AOS_VISION_DEBUG_TCP_CLIENT_H_
#define _AOS_VISION_DEBUG_TCP_CLIENT_H_
-#include "aos/vision/events/epoll_events.h"
-
#include <memory>
#include <string>
+#include "aos/vision/events/epoll_events.h"
+
namespace aos {
namespace events {
diff --git a/aos/vision/events/tcp_server.h b/aos/vision/events/tcp_server.h
index 3116f55..24b4f60 100644
--- a/aos/vision/events/tcp_server.h
+++ b/aos/vision/events/tcp_server.h
@@ -1,12 +1,12 @@
#ifndef _AOS_VISION_EVENTS_TCP_SERVER_H_
#define _AOS_VISION_EVENTS_TCP_SERVER_H_
-#include "aos/vision/events/epoll_events.h"
-#include "aos/vision/events/intrusive_free_list.h"
-
#include <memory>
#include <vector>
+#include "aos/vision/events/epoll_events.h"
+#include "aos/vision/events/intrusive_free_list.h"
+
namespace aos {
namespace events {
diff --git a/aos/vision/image/V4L2.h b/aos/vision/image/V4L2.h
index d02229a..ed93606 100644
--- a/aos/vision/image/V4L2.h
+++ b/aos/vision/image/V4L2.h
@@ -4,10 +4,9 @@
// This file handles including everything needed to use V4L2 and has some
// utility functions.
-#include <sys/ioctl.h>
-
#include <asm/types.h> /* for videodev2.h */
#include <linux/videodev2.h>
+#include <sys/ioctl.h>
namespace camera {
diff --git a/aos/vision/image/image_stream.h b/aos/vision/image/image_stream.h
index 5d88d32..60e71b2 100644
--- a/aos/vision/image/image_stream.h
+++ b/aos/vision/image/image_stream.h
@@ -1,12 +1,12 @@
#ifndef AOS_VISION_IMAGE_IMAGE_STREAM_H_
#define AOS_VISION_IMAGE_IMAGE_STREAM_H_
+#include <memory>
+
#include "aos/vision/events/epoll_events.h"
#include "aos/vision/image/camera_params.pb.h"
#include "aos/vision/image/reader.h"
-#include <memory>
-
namespace aos {
namespace vision {
diff --git a/aos/vision/image/image_types.h b/aos/vision/image/image_types.h
index 0238841..ee56f7d 100644
--- a/aos/vision/image/image_types.h
+++ b/aos/vision/image/image_types.h
@@ -2,8 +2,8 @@
#define _AOS_VISION_IMAGE_IMAGE_TYPES_H_
#include <cstdint>
-#include <limits>
#include <cstring>
+#include <limits>
#include <memory>
#include <sstream>
#include <string_view>