summaryrefslogtreecommitdiff
path: root/kms++util/inc
diff options
context:
space:
mode:
Diffstat (limited to 'kms++util/inc')
-rw-r--r--kms++util/inc/kms++util/color.h8
-rw-r--r--kms++util/inc/kms++util/cpuframebuffer.h8
-rw-r--r--kms++util/inc/kms++util/extcpuframebuffer.h5
-rw-r--r--kms++util/inc/kms++util/kms++util.h42
-rw-r--r--kms++util/inc/kms++util/opts.h1
-rw-r--r--kms++util/inc/kms++util/resourcemanager.h6
-rw-r--r--kms++util/inc/kms++util/strhelpers.h4
-rw-r--r--kms++util/inc/kms++util/videodevice.h3
8 files changed, 37 insertions, 40 deletions
diff --git a/kms++util/inc/kms++util/color.h b/kms++util/inc/kms++util/color.h
index fa05fbc..5232b37 100644
--- a/kms++util/inc/kms++util/color.h
+++ b/kms++util/inc/kms++util/color.h
@@ -14,8 +14,7 @@ enum class YUVType {
MAX,
};
-struct RGB
-{
+struct RGB {
RGB();
RGB(uint8_t r, uint8_t g, uint8_t b);
RGB(uint8_t a, uint8_t r, uint8_t g, uint8_t b);
@@ -47,8 +46,7 @@ struct RGB
uint8_t a;
};
-struct YUV
-{
+struct YUV {
YUV();
YUV(uint8_t y, uint8_t u, uint8_t v);
YUV(const RGB& rgb, YUVType type = YUVType::BT601_Lim);
@@ -58,4 +56,4 @@ struct YUV
uint8_t y;
uint8_t a;
};
-}
+} // namespace kms
diff --git a/kms++util/inc/kms++util/cpuframebuffer.h b/kms++util/inc/kms++util/cpuframebuffer.h
index 4273e0d..e4de150 100644
--- a/kms++util/inc/kms++util/cpuframebuffer.h
+++ b/kms++util/inc/kms++util/cpuframebuffer.h
@@ -4,8 +4,8 @@
namespace kms
{
-
-class CPUFramebuffer : public IFramebuffer {
+class CPUFramebuffer : public IFramebuffer
+{
public:
CPUFramebuffer(uint32_t width, uint32_t height, PixelFormat format);
@@ -30,7 +30,7 @@ private:
uint32_t size;
uint32_t stride;
uint32_t offset;
- uint8_t *map;
+ uint8_t* map;
};
uint32_t m_width;
@@ -41,4 +41,4 @@ private:
struct FramebufferPlane m_planes[4];
};
-}
+} // namespace kms
diff --git a/kms++util/inc/kms++util/extcpuframebuffer.h b/kms++util/inc/kms++util/extcpuframebuffer.h
index 92ca43a..29a06c0 100644
--- a/kms++util/inc/kms++util/extcpuframebuffer.h
+++ b/kms++util/inc/kms++util/extcpuframebuffer.h
@@ -4,7 +4,6 @@
namespace kms
{
-
class ExtCPUFramebuffer : public IFramebuffer
{
public:
@@ -30,7 +29,7 @@ private:
uint32_t size;
uint32_t stride;
uint32_t offset;
- uint8_t *map;
+ uint8_t* map;
};
uint32_t m_width;
@@ -40,4 +39,4 @@ private:
unsigned m_num_planes;
struct FramebufferPlane m_planes[4];
};
-}
+} // namespace kms
diff --git a/kms++util/inc/kms++util/kms++util.h b/kms++util/inc/kms++util/kms++util.h
index 8fc6c8b..52b6ce9 100644
--- a/kms++util/inc/kms++util/kms++util.h
+++ b/kms++util/inc/kms++util/kms++util.h
@@ -21,15 +21,15 @@ void draw_rgb_pixel(IFramebuffer& buf, unsigned x, unsigned y, RGB color);
void draw_yuv444_pixel(IFramebuffer& buf, unsigned x, unsigned y, YUV yuv);
void draw_yuv422_macropixel(IFramebuffer& buf, unsigned x, unsigned y, YUV yuv1, YUV yuv2);
void draw_yuv420_macropixel(IFramebuffer& buf, unsigned x, unsigned y,
- YUV yuv1, YUV yuv2, YUV yuv3, YUV yuv4);
-void draw_rect(IFramebuffer &fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color);
+ YUV yuv1, YUV yuv2, YUV yuv3, YUV yuv4);
+void draw_rect(IFramebuffer& fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color);
void draw_circle(IFramebuffer& fb, int32_t xCenter, int32_t yCenter, int32_t radius, RGB color);
void draw_text(IFramebuffer& buf, uint32_t x, uint32_t y, const std::string& str, RGB color);
void draw_color_bar(IFramebuffer& buf, int old_xpos, int xpos, int width);
-void draw_test_pattern(IFramebuffer &fb, YUVType yuvt = YUVType::BT601_Lim);
-}
+void draw_test_pattern(IFramebuffer& fb, YUVType yuvt = YUVType::BT601_Lim);
+} // namespace kms
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@ -42,32 +42,32 @@ void draw_test_pattern(IFramebuffer &fb, YUVType yuvt = YUVType::BT601_Lim);
#define __STRING(x) #x
#endif
-#define ASSERT(x) \
- if (unlikely(!(x))) { \
+#define ASSERT(x) \
+ if (unlikely(!(x))) { \
fprintf(stderr, "%s:%d: %s: ASSERT(%s) failed\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, __STRING(x)); \
- abort(); \
+ abort(); \
}
-#define FAIL(fmt, ...) \
- do { \
+#define FAIL(fmt, ...) \
+ do { \
fprintf(stderr, "%s:%d: %s:\n" fmt "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
- abort(); \
- } while(0)
+ abort(); \
+ } while (0)
-#define FAIL_IF(x, fmt, ...) \
- if (unlikely(x)) { \
+#define FAIL_IF(x, fmt, ...) \
+ if (unlikely(x)) { \
fprintf(stderr, "%s:%d: %s:\n" fmt "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
- abort(); \
+ abort(); \
}
-#define EXIT(fmt, ...) \
- do { \
+#define EXIT(fmt, ...) \
+ do { \
fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
- exit(-1); \
- } while(0)
+ exit(-1); \
+ } while (0)
-#define EXIT_IF(x, fmt, ...) \
- if (unlikely(x)) { \
+#define EXIT_IF(x, fmt, ...) \
+ if (unlikely(x)) { \
fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
- exit(-1); \
+ exit(-1); \
}
diff --git a/kms++util/inc/kms++util/opts.h b/kms++util/inc/kms++util/opts.h
index 1b0fd22..6058b27 100644
--- a/kms++util/inc/kms++util/opts.h
+++ b/kms++util/inc/kms++util/opts.h
@@ -7,6 +7,7 @@
class Option
{
friend class OptionSet;
+
public:
Option(const std::string& str, std::function<void()> func);
Option(const std::string& str, std::function<void(const std::string)> func);
diff --git a/kms++util/inc/kms++util/resourcemanager.h b/kms++util/inc/kms++util/resourcemanager.h
index 3301da2..11c11b3 100644
--- a/kms++util/inc/kms++util/resourcemanager.h
+++ b/kms++util/inc/kms++util/resourcemanager.h
@@ -2,8 +2,8 @@
#include <set>
#include <string>
-namespace kms {
-
+namespace kms
+{
class ResourceManager
{
public:
@@ -32,4 +32,4 @@ private:
std::set<Plane*> m_reserved_planes;
};
-}
+} // namespace kms
diff --git a/kms++util/inc/kms++util/strhelpers.h b/kms++util/inc/kms++util/strhelpers.h
index 2d35e93..c4032d7 100644
--- a/kms++util/inc/kms++util/strhelpers.h
+++ b/kms++util/inc/kms++util/strhelpers.h
@@ -5,7 +5,7 @@
std::string to_lower(const std::string& str);
-template <typename T>
+template<typename T>
std::string join(const T& values, const std::string& delim)
{
std::ostringstream ss;
@@ -17,7 +17,7 @@ std::string join(const T& values, const std::string& delim)
return ss.str();
}
-template <typename T>
+template<typename T>
std::string join(const std::vector<T>& values, const std::string& delim, std::function<std::string(T)> func)
{
std::ostringstream ss;
diff --git a/kms++util/inc/kms++util/videodevice.h b/kms++util/inc/kms++util/videodevice.h
index 0aaa103..3bce4a9 100644
--- a/kms++util/inc/kms++util/videodevice.h
+++ b/kms++util/inc/kms++util/videodevice.h
@@ -9,8 +9,7 @@ class VideoStreamer;
class VideoDevice
{
public:
- struct VideoFrameSize
- {
+ struct VideoFrameSize {
uint32_t min_w, max_w, step_w;
uint32_t min_h, max_h, step_h;
};