CARLA
ImageConverter.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
10 
11 namespace carla {
12 namespace image {
13 
15  public:
16 
17  template <typename SrcViewT, typename DstViewT>
18  static void CopyPixels(const SrcViewT &src, DstViewT &dst) {
19  boost::gil::copy_pixels(src, dst);
20  }
21 
22  template <typename ColorConverter, typename MutableImageView>
23  static void ConvertInPlace(
24  MutableImageView &image_view,
25  ColorConverter converter = ColorConverter()) {
26  using DstPixelT = typename MutableImageView::value_type;
27  CopyPixels(
28  ImageView::MakeColorConvertedView<MutableImageView, DstPixelT>(image_view, converter),
29  image_view);
30  }
31  };
32 
33 } // namespace image
34 } // namespace carla
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
static void ConvertInPlace(MutableImageView &image_view, ColorConverter converter=ColorConverter())
static void CopyPixels(const SrcViewT &src, DstViewT &dst)