From b71e8c2f39d823891aab4c681cccab9af5a49406 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Fri, 25 Jun 2021 02:15:54 +0100 Subject: libcamera/base: Move span to base library Move span, and adjust the Doxygen exclusion as well. Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- Documentation/Doxyfile.in | 2 +- include/libcamera/base/file.h | 3 +- include/libcamera/base/meson.build | 1 + include/libcamera/base/span.h | 424 ++++++++++++++++++++++++ include/libcamera/controls.h | 2 +- include/libcamera/internal/buffer.h | 2 +- include/libcamera/internal/byte_stream_buffer.h | 3 +- include/libcamera/internal/pub_key.h | 2 +- include/libcamera/internal/v4l2_device.h | 2 +- include/libcamera/meson.build | 1 - include/libcamera/span.h | 424 ------------------------ src/android/camera_buffer.h | 3 +- src/android/jpeg/encoder.h | 3 +- src/android/jpeg/exif.h | 3 +- src/ipa/libipa/histogram.h | 2 +- src/ipa/raspberrypi/cam_helper.hpp | 3 +- src/ipa/raspberrypi/md_parser.hpp | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 2 +- src/libcamera/control_serializer.cpp | 2 +- src/libcamera/ipa_module.cpp | 3 +- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 2 +- test/span.cpp | 2 +- test/utils.cpp | 6 +- 23 files changed, 448 insertions(+), 451 deletions(-) create mode 100644 include/libcamera/base/span.h delete mode 100644 include/libcamera/span.h diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in index 8305f56a..a79d3770 100644 --- a/Documentation/Doxyfile.in +++ b/Documentation/Doxyfile.in @@ -834,7 +834,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = @TOP_SRCDIR@/include/libcamera/span.h \ +EXCLUDE = @TOP_SRCDIR@/include/libcamera/base/span.h \ @TOP_SRCDIR@/include/libcamera/internal/device_enumerator_sysfs.h \ @TOP_SRCDIR@/include/libcamera/internal/device_enumerator_udev.h \ @TOP_SRCDIR@/include/libcamera/internal/ipc_pipe_unixsocket.h \ diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h index 5cd98579..465f3ef8 100644 --- a/include/libcamera/base/file.h +++ b/include/libcamera/base/file.h @@ -13,8 +13,7 @@ #include #include - -#include +#include namespace libcamera { diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build index 83c664af..6b90f9f7 100644 --- a/include/libcamera/base/meson.build +++ b/include/libcamera/base/meson.build @@ -14,6 +14,7 @@ libcamera_base_headers = files([ 'object.h', 'semaphore.h', 'signal.h', + 'span.h', 'thread.h', 'timer.h', 'utils.h', diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h new file mode 100644 index 00000000..21099d56 --- /dev/null +++ b/include/libcamera/base/span.h @@ -0,0 +1,424 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020, Google Inc. + * + * span.h - C++20 std::span<> implementation for C++11 + */ + +#ifndef __LIBCAMERA_BASE_SPAN_H__ +#define __LIBCAMERA_BASE_SPAN_H__ + +#include +#include +#include +#include +#include + +namespace libcamera { + +static constexpr std::size_t dynamic_extent = std::numeric_limits::max(); + +template +class Span; + +namespace details { + +template +struct is_array : public std::false_type { +}; + +template +struct is_array> : public std::true_type { +}; + +template +struct is_span : public std::false_type { +}; + +template +struct is_span> : public std::true_type { +}; + +} /* namespace details */ + +namespace utils { + +template +constexpr auto size(const C &c) -> decltype(c.size()) +{ + return c.size(); +} + +template +constexpr auto data(const C &c) -> decltype(c.data()) +{ + return c.data(); +} + +template +constexpr auto data(C &c) -> decltype(c.data()) +{ + return c.data(); +} + +template +constexpr T *data(T (&array)[N]) noexcept +{ + return array; +} + +template +struct tuple_element; + +template +struct tuple_element> { + using type = T; +}; + +template +struct tuple_size; + +template +struct tuple_size> : public std::integral_constant { +}; + +template +struct tuple_size>; + +} /* namespace utils */ + +template +class Span +{ +public: + using element_type = T; + using value_type = typename std::remove_cv_t; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using pointer = T *; + using const_pointer = const T *; + using reference = T &; + using const_reference = const T &; + using iterator = pointer; + using const_iterator = const_pointer; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + + static constexpr std::size_t extent = Extent; + + template> + constexpr Span() noexcept + : data_(nullptr) + { + } + + explicit constexpr Span(pointer ptr, [[maybe_unused]] size_type count) + : data_(ptr) + { + } + + explicit constexpr Span(pointer first, [[maybe_unused]] pointer last) + : data_(first) + { + } + + template + constexpr Span(element_type (&arr)[N], + std::enable_if_t (*)[], + element_type (*)[]>::value && + N == Extent, + std::nullptr_t> = nullptr) noexcept + : data_(arr) + { + } + + template + constexpr Span(std::array &arr, + std::enable_if_t (*)[], + element_type (*)[]>::value && + N == Extent, + std::nullptr_t> = nullptr) noexcept + : data_(arr.data()) + { + } + + template + constexpr Span(const std::array &arr, + std::enable_if_t (*)[], + element_type (*)[]>::value && + N == Extent, + std::nullptr_t> = nullptr) noexcept + : data_(arr.data()) + { + } + + template + explicit constexpr Span(Container &cont, + std::enable_if_t::value && + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, + std::nullptr_t> = nullptr) + : data_(utils::data(cont)) + { + } + + template + explicit constexpr Span(const Container &cont, + std::enable_if_t::value && + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, + std::nullptr_t> = nullptr) + : data_(utils::data(cont)) + { + static_assert(utils::size(cont) == Extent, "Size mismatch"); + } + + template + explicit constexpr Span(const Span &s, + std::enable_if_t::value && + N == Extent, + std::nullptr_t> = nullptr) noexcept + : data_(s.data()) + { + } + + constexpr Span(const Span &other) noexcept = default; + constexpr Span &operator=(const Span &other) noexcept = default; + + constexpr iterator begin() const { return data(); } + constexpr const_iterator cbegin() const { return begin(); } + constexpr iterator end() const { return data() + size(); } + constexpr const_iterator cend() const { return end(); } + constexpr reverse_iterator rbegin() const { return reverse_iterator(end()); } + constexpr const_reverse_iterator crbegin() const { return rbegin(); } + constexpr reverse_iterator rend() const { return reverse_iterator(begin()); } + constexpr const_reverse_iterator crend() const { return rend(); } + + constexpr reference front() const { return *data(); } + constexpr reference back() const { return *(data() + size() - 1); } + constexpr reference operator[](size_type idx) const { return data()[idx]; } + constexpr pointer data() const noexcept { return data_; } + + constexpr size_type size() const noexcept { return Extent; } + constexpr size_type size_bytes() const noexcept { return size() * sizeof(element_type); } + constexpr bool empty() const noexcept { return size() == 0; } + + template + constexpr Span first() const + { + static_assert(Count <= Extent, "Count larger than size"); + return Span{ data(), Count }; + } + + constexpr Span first(std::size_t Count) const + { + return Span{ data(), Count }; + } + + template + constexpr Span last() const + { + static_assert(Count <= Extent, "Count larger than size"); + return Span{ data() + size() - Count, Count }; + } + + constexpr Span last(std::size_t Count) const + { + return Span{ data() + size() - Count, Count }; + } + + template + constexpr Span subspan() const + { + static_assert(Offset <= Extent, "Offset larger than size"); + static_assert(Count == dynamic_extent || Count + Offset <= Extent, + "Offset + Count larger than size"); + return Span{ + data() + Offset, + Count == dynamic_extent ? size() - Offset : Count + }; + } + + constexpr Span + subspan(std::size_t Offset, std::size_t Count = dynamic_extent) const + { + return Span{ + data() + Offset, + Count == dynamic_extent ? size() - Offset : Count + }; + } + +private: + pointer data_; +}; + +template +class Span +{ +public: + using element_type = T; + using value_type = typename std::remove_cv_t; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using pointer = T *; + using const_pointer = const T *; + using reference = T &; + using const_reference = const T &; + using iterator = T *; + using const_iterator = const T *; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + + static constexpr std::size_t extent = dynamic_extent; + + constexpr Span() noexcept + : data_(nullptr), size_(0) + { + } + + constexpr Span(pointer ptr, size_type count) + : data_(ptr), size_(count) + { + } + + constexpr Span(pointer first, pointer last) + : data_(first), size_(last - first) + { + } + + template + constexpr Span(element_type (&arr)[N], + std::enable_if_t (*)[], + element_type (*)[]>::value, + std::nullptr_t> = nullptr) noexcept + : data_(arr), size_(N) + { + } + + template + constexpr Span(std::array &arr, + std::enable_if_t (*)[], + element_type (*)[]>::value, + std::nullptr_t> = nullptr) noexcept + : data_(utils::data(arr)), size_(N) + { + } + + template + constexpr Span(const std::array &arr) noexcept + : data_(utils::data(arr)), size_(N) + { + } + + template + constexpr Span(Container &cont, + std::enable_if_t::value && + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, + std::nullptr_t> = nullptr) + : data_(utils::data(cont)), size_(utils::size(cont)) + { + } + + template + constexpr Span(const Container &cont, + std::enable_if_t::value && + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, + std::nullptr_t> = nullptr) + : data_(utils::data(cont)), size_(utils::size(cont)) + { + } + + template + constexpr Span(const Span &s, + std::enable_if_t::value, + std::nullptr_t> = nullptr) noexcept + : data_(s.data()), size_(s.size()) + { + } + + constexpr Span(const Span &other) noexcept = default; + + constexpr Span &operator=(const Span &other) noexcept + { + data_ = other.data_; + size_ = other.size_; + return *this; + } + + constexpr iterator begin() const { return data(); } + constexpr const_iterator cbegin() const { return begin(); } + constexpr iterator end() const { return data() + size(); } + constexpr const_iterator cend() const { return end(); } + constexpr reverse_iterator rbegin() const { return reverse_iterator(end()); } + constexpr const_reverse_iterator crbegin() const { return rbegin(); } + constexpr reverse_iterator rend() const { return reverse_iterator(begin()); } + constexpr const_reverse_iterator crend() const { return rend(); } + + constexpr reference front() const { return *data(); } + constexpr reference back() const { return *(data() + size() - 1); } + constexpr reference operator[](size_type idx) const { return data()[idx]; } + constexpr pointer data() const noexcept { return data_; } + + constexpr size_type size() const noexcept { return size_; } + constexpr size_type size_bytes() const noexcept { return size() * sizeof(element_type); } + constexpr bool empty() const noexcept { return size() == 0; } + + template + constexpr Span first() const + { + return Span{ data(), Count }; + } + + constexpr Span first(std::size_t Count) const + { + return { data(), Count }; + } + + template + constexpr Span last() const + { + return Span{ data() + size() - Count, Count }; + } + + constexpr Span last(std::size_t Count) const + { + return Span{ data() + size() - Count, Count }; + } + + template + constexpr Span subspan() const + { + return Span{ + data() + Offset, + Count == dynamic_extent ? size() - Offset : Count + }; + } + + constexpr Span + subspan(std::size_t Offset, std::size_t Count = dynamic_extent) const + { + return Span{ + data() + Offset, + Count == dynamic_extent ? size() - Offset : Count + }; + } + +private: + pointer data_; + size_type size_; +}; + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_BASE_SPAN_H__ */ diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index f62b6cf0..1bc958a4 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -15,9 +15,9 @@ #include #include +#include #include -#include namespace libcamera { diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h index 91dd2496..beae0cb9 100644 --- a/include/libcamera/internal/buffer.h +++ b/include/libcamera/internal/buffer.h @@ -11,9 +11,9 @@ #include #include +#include #include -#include namespace libcamera { diff --git a/include/libcamera/internal/byte_stream_buffer.h b/include/libcamera/internal/byte_stream_buffer.h index 7eefb1a7..d0f0df5e 100644 --- a/include/libcamera/internal/byte_stream_buffer.h +++ b/include/libcamera/internal/byte_stream_buffer.h @@ -12,8 +12,7 @@ #include #include - -#include +#include namespace libcamera { diff --git a/include/libcamera/internal/pub_key.h b/include/libcamera/internal/pub_key.h index f5f988b5..9261c9c2 100644 --- a/include/libcamera/internal/pub_key.h +++ b/include/libcamera/internal/pub_key.h @@ -9,7 +9,7 @@ #include -#include +#include #if HAVE_GNUTLS struct gnutls_pubkey_st; diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 1edd664a..77b835b3 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -15,9 +15,9 @@ #include #include +#include #include -#include namespace libcamera { diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index c69d63d2..e4d5c655 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -12,7 +12,6 @@ libcamera_public_headers = files([ 'logging.h', 'pixel_format.h', 'request.h', - 'span.h', 'stream.h', 'transform.h', ]) diff --git a/include/libcamera/span.h b/include/libcamera/span.h deleted file mode 100644 index 7a35806b..00000000 --- a/include/libcamera/span.h +++ /dev/null @@ -1,424 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2020, Google Inc. - * - * span.h - C++20 std::span<> implementation for C++11 - */ - -#ifndef __LIBCAMERA_SPAN_H__ -#define __LIBCAMERA_SPAN_H__ - -#include -#include -#include -#include -#include - -namespace libcamera { - -static constexpr std::size_t dynamic_extent = std::numeric_limits::max(); - -template -class Span; - -namespace details { - -template -struct is_array : public std::false_type { -}; - -template -struct is_array> : public std::true_type { -}; - -template -struct is_span : public std::false_type { -}; - -template -struct is_span> : public std::true_type { -}; - -} /* namespace details */ - -namespace utils { - -template -constexpr auto size(const C &c) -> decltype(c.size()) -{ - return c.size(); -} - -template -constexpr auto data(const C &c) -> decltype(c.data()) -{ - return c.data(); -} - -template -constexpr auto data(C &c) -> decltype(c.data()) -{ - return c.data(); -} - -template -constexpr T *data(T (&array)[N]) noexcept -{ - return array; -} - -template -struct tuple_element; - -template -struct tuple_element> { - using type = T; -}; - -template -struct tuple_size; - -template -struct tuple_size> : public std::integral_constant { -}; - -template -struct tuple_size>; - -} /* namespace utils */ - -template -class Span -{ -public: - using element_type = T; - using value_type = typename std::remove_cv_t; - using size_type = std::size_t; - using difference_type = std::ptrdiff_t; - using pointer = T *; - using const_pointer = const T *; - using reference = T &; - using const_reference = const T &; - using iterator = pointer; - using const_iterator = const_pointer; - using reverse_iterator = std::reverse_iterator; - using const_reverse_iterator = std::reverse_iterator; - - static constexpr std::size_t extent = Extent; - - template> - constexpr Span() noexcept - : data_(nullptr) - { - } - - explicit constexpr Span(pointer ptr, [[maybe_unused]] size_type count) - : data_(ptr) - { - } - - explicit constexpr Span(pointer first, [[maybe_unused]] pointer last) - : data_(first) - { - } - - template - constexpr Span(element_type (&arr)[N], - std::enable_if_t (*)[], - element_type (*)[]>::value && - N == Extent, - std::nullptr_t> = nullptr) noexcept - : data_(arr) - { - } - - template - constexpr Span(std::array &arr, - std::enable_if_t (*)[], - element_type (*)[]>::value && - N == Extent, - std::nullptr_t> = nullptr) noexcept - : data_(arr.data()) - { - } - - template - constexpr Span(const std::array &arr, - std::enable_if_t (*)[], - element_type (*)[]>::value && - N == Extent, - std::nullptr_t> = nullptr) noexcept - : data_(arr.data()) - { - } - - template - explicit constexpr Span(Container &cont, - std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, - std::nullptr_t> = nullptr) - : data_(utils::data(cont)) - { - } - - template - explicit constexpr Span(const Container &cont, - std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, - std::nullptr_t> = nullptr) - : data_(utils::data(cont)) - { - static_assert(utils::size(cont) == Extent, "Size mismatch"); - } - - template - explicit constexpr Span(const Span &s, - std::enable_if_t::value && - N == Extent, - std::nullptr_t> = nullptr) noexcept - : data_(s.data()) - { - } - - constexpr Span(const Span &other) noexcept = default; - constexpr Span &operator=(const Span &other) noexcept = default; - - constexpr iterator begin() const { return data(); } - constexpr const_iterator cbegin() const { return begin(); } - constexpr iterator end() const { return data() + size(); } - constexpr const_iterator cend() const { return end(); } - constexpr reverse_iterator rbegin() const { return reverse_iterator(end()); } - constexpr const_reverse_iterator crbegin() const { return rbegin(); } - constexpr reverse_iterator rend() const { return reverse_iterator(begin()); } - constexpr const_reverse_iterator crend() const { return rend(); } - - constexpr reference front() const { return *data(); } - constexpr reference back() const { return *(data() + size() - 1); } - constexpr reference operator[](size_type idx) const { return data()[idx]; } - constexpr pointer data() const noexcept { return data_; } - - constexpr size_type size() const noexcept { return Extent; } - constexpr size_type size_bytes() const noexcept { return size() * sizeof(element_type); } - constexpr bool empty() const noexcept { return size() == 0; } - - template - constexpr Span first() const - { - static_assert(Count <= Extent, "Count larger than size"); - return Span{ data(), Count }; - } - - constexpr Span first(std::size_t Count) const - { - return Span{ data(), Count }; - } - - template - constexpr Span last() const - { - static_assert(Count <= Extent, "Count larger than size"); - return Span{ data() + size() - Count, Count }; - } - - constexpr Span last(std::size_t Count) const - { - return Span{ data() + size() - Count, Count }; - } - - template - constexpr Span subspan() const - { - static_assert(Offset <= Extent, "Offset larger than size"); - static_assert(Count == dynamic_extent || Count + Offset <= Extent, - "Offset + Count larger than size"); - return Span{ - data() + Offset, - Count == dynamic_extent ? size() - Offset : Count - }; - } - - constexpr Span - subspan(std::size_t Offset, std::size_t Count = dynamic_extent) const - { - return Span{ - data() + Offset, - Count == dynamic_extent ? size() - Offset : Count - }; - } - -private: - pointer data_; -}; - -template -class Span -{ -public: - using element_type = T; - using value_type = typename std::remove_cv_t; - using size_type = std::size_t; - using difference_type = std::ptrdiff_t; - using pointer = T *; - using const_pointer = const T *; - using reference = T &; - using const_reference = const T &; - using iterator = T *; - using const_iterator = const T *; - using reverse_iterator = std::reverse_iterator; - using const_reverse_iterator = std::reverse_iterator; - - static constexpr std::size_t extent = dynamic_extent; - - constexpr Span() noexcept - : data_(nullptr), size_(0) - { - } - - constexpr Span(pointer ptr, size_type count) - : data_(ptr), size_(count) - { - } - - constexpr Span(pointer first, pointer last) - : data_(first), size_(last - first) - { - } - - template - constexpr Span(element_type (&arr)[N], - std::enable_if_t (*)[], - element_type (*)[]>::value, - std::nullptr_t> = nullptr) noexcept - : data_(arr), size_(N) - { - } - - template - constexpr Span(std::array &arr, - std::enable_if_t (*)[], - element_type (*)[]>::value, - std::nullptr_t> = nullptr) noexcept - : data_(utils::data(arr)), size_(N) - { - } - - template - constexpr Span(const std::array &arr) noexcept - : data_(utils::data(arr)), size_(N) - { - } - - template - constexpr Span(Container &cont, - std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, - std::nullptr_t> = nullptr) - : data_(utils::data(cont)), size_(utils::size(cont)) - { - } - - template - constexpr Span(const Container &cont, - std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, - std::nullptr_t> = nullptr) - : data_(utils::data(cont)), size_(utils::size(cont)) - { - } - - template - constexpr Span(const Span &s, - std::enable_if_t::value, - std::nullptr_t> = nullptr) noexcept - : data_(s.data()), size_(s.size()) - { - } - - constexpr Span(const Span &other) noexcept = default; - - constexpr Span &operator=(const Span &other) noexcept - { - data_ = other.data_; - size_ = other.size_; - return *this; - } - - constexpr iterator begin() const { return data(); } - constexpr const_iterator cbegin() const { return begin(); } - constexpr iterator end() const { return data() + size(); } - constexpr const_iterator cend() const { return end(); } - constexpr reverse_iterator rbegin() const { return reverse_iterator(end()); } - constexpr const_reverse_iterator crbegin() const { return rbegin(); } - constexpr reverse_iterator rend() const { return reverse_iterator(begin()); } - constexpr const_reverse_iterator crend() const { return rend(); } - - constexpr reference front() const { return *data(); } - constexpr reference back() const { return *(data() + size() - 1); } - constexpr reference operator[](size_type idx) const { return data()[idx]; } - constexpr pointer data() const noexcept { return data_; } - - constexpr size_type size() const noexcept { return size_; } - constexpr size_type size_bytes() const noexcept { return size() * sizeof(element_type); } - constexpr bool empty() const noexcept { return size() == 0; } - - template - constexpr Span first() const - { - return Span{ data(), Count }; - } - - constexpr Span first(std::size_t Count) const - { - return { data(), Count }; - } - - template - constexpr Span last() const - { - return Span{ data() + size() - Count, Count }; - } - - constexpr Span last(std::size_t Count) const - { - return Span{ data() + size() - Count, Count }; - } - - template - constexpr Span subspan() const - { - return Span{ - data() + Offset, - Count == dynamic_extent ? size() - Offset : Count - }; - } - - constexpr Span - subspan(std::size_t Offset, std::size_t Count = dynamic_extent) const - { - return Span{ - data() + Offset, - Count == dynamic_extent ? size() - Offset : Count - }; - } - -private: - pointer data_; - size_type size_; -}; - -} /* namespace libcamera */ - -#endif /* __LIBCAMERA_SPAN_H__ */ diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h index e850c4e3..2617ff6b 100644 --- a/src/android/camera_buffer.h +++ b/src/android/camera_buffer.h @@ -10,8 +10,7 @@ #include #include - -#include +#include class CameraBuffer final : public libcamera::Extensible { diff --git a/src/android/jpeg/encoder.h b/src/android/jpeg/encoder.h index 8d449369..28e7f92a 100644 --- a/src/android/jpeg/encoder.h +++ b/src/android/jpeg/encoder.h @@ -7,8 +7,9 @@ #ifndef __ANDROID_JPEG_ENCODER_H__ #define __ANDROID_JPEG_ENCODER_H__ +#include + #include -#include #include class Encoder diff --git a/src/android/jpeg/exif.h b/src/android/jpeg/exif.h index 8aa1b123..23b0e097 100644 --- a/src/android/jpeg/exif.h +++ b/src/android/jpeg/exif.h @@ -13,8 +13,9 @@ #include +#include + #include -#include class Exif { diff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h index e06f1884..c2761cb2 100644 --- a/src/ipa/libipa/histogram.h +++ b/src/ipa/libipa/histogram.h @@ -13,7 +13,7 @@ #include -#include +#include namespace libcamera { diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp index a6664819..b19c95f6 100644 --- a/src/ipa/raspberrypi/cam_helper.hpp +++ b/src/ipa/raspberrypi/cam_helper.hpp @@ -8,8 +8,7 @@ #include -#include - +#include #include #include "camera_mode.h" diff --git a/src/ipa/raspberrypi/md_parser.hpp b/src/ipa/raspberrypi/md_parser.hpp index 65aab02d..8497216f 100644 --- a/src/ipa/raspberrypi/md_parser.hpp +++ b/src/ipa/raspberrypi/md_parser.hpp @@ -8,7 +8,7 @@ #include -#include +#include /* * Camera metadata parser class. Usage as shown below. diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index a3f01449..4d09a84f 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include "libcamera/internal/buffer.h" diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp index dd5a2608..30046628 100644 --- a/src/libcamera/control_serializer.cpp +++ b/src/libcamera/control_serializer.cpp @@ -12,11 +12,11 @@ #include #include +#include #include #include #include -#include #include "libcamera/internal/byte_stream_buffer.h" diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index 984c1fed..adfb8d40 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -21,10 +21,9 @@ #include #include -#include - #include #include +#include #include #include "libcamera/internal/pipeline_handler.h" diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index c185ac39..91757600 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -11,11 +11,11 @@ #include #include +#include #include #include #include -#include #include "libcamera/internal/media_object.h" #include "libcamera/internal/v4l2_videodevice.h" diff --git a/test/span.cpp b/test/span.cpp index ca037c8f..abf3a5d6 100644 --- a/test/span.cpp +++ b/test/span.cpp @@ -9,7 +9,7 @@ * Include first to ensure the header is self-contained, as there's no span.cpp * in libcamera. */ -#include +#include #include #include diff --git a/test/utils.cpp b/test/utils.cpp index 9cd2cd07..d7f810e9 100644 --- a/test/utils.cpp +++ b/test/utils.cpp @@ -11,11 +11,11 @@ #include #include -#include -#include - +#include #include +#include + #include "test.h" using namespace std; -- cgit v1.2.1