File: vectorimage.h

package info (click to toggle)
aoflagger 3.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,960 kB
  • sloc: cpp: 83,076; python: 10,187; sh: 260; makefile: 178
file content (27 lines) | stat: -rw-r--r-- 753 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef VECTOR_IMAGE_H
#define VECTOR_IMAGE_H

#include "imageinterface.h"

#include <memory>

class VectorImage final : public ImageInterface {
 public:
  VectorImage() : ImageInterface() {}

  VectorImage(std::vector<float>&& image, size_t width)
      : ImageInterface(width, image.size() / width, width),
        _image(std::move(image)) {}

  const float* Data() const override { return _image.data(); }

 private:
  std::vector<float> _image;
};

std::unique_ptr<VectorImage> ShrinkHorizontally(const ImageInterface& source,
                                                size_t shrinkFactor);
std::unique_ptr<VectorImage> ShrinkVertically(const ImageInterface& source,
                                              size_t shrinkFactor);

#endif