kaleidoscope  1.4.0
kaleidoscope.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 extern "C"
4 {
5 #include "kaleidoscope.h"
6 }
7 
8 #include <stdexcept>
9 
10 namespace kalos
11 {
16  {
17  private:
18  double k;
19  KaleidoscopeHandle handler;
20 
21  public:
31  Kaleidoscope(int nImage, int width, int height, int nComponents, double scaleDown, double dimConst)
32  : k(dimConst)
33  {
34  if (initKaleidoscope(&handler, nImage, width, height, nComponents, scaleDown) != 0)
35  throw std::runtime_error("Can't init kaleidoscope structure for these inputs");
36  }
37 
45  void processImage(uint8_t *inImg, uint8_t *outImg, size_t size, double dimConst)
46  {
47  processKaleidoscope(&handler, dimConst, inImg, outImg);
48  }
49 
56  void processImage(uint8_t *inImg, uint8_t *outImg, size_t size) { processImage(inImg, outImg, size, k); }
57 
62  };
63 
64 } // namespace kalos
Kaleidoscope effect generator.
~Kaleidoscope()
Destroy the Kaleidoscope object.
void processImage(uint8_t *inImg, uint8_t *outImg, size_t size)
Creates kaleidoscope effect. Uses dim constant provided in constructor.
Kaleidoscope(int nImage, int width, int height, int nComponents, double scaleDown, double dimConst)
Construct a new Kaleidoscope object.
void processImage(uint8_t *inImg, uint8_t *outImg, size_t size, double dimConst)
Creates kaleidoscope effect.
int initKaleidoscope(KaleidoscopeHandle *handler, int n, int width, int height, int nComponents, double scaleDown)
Initializes kaleidoscope handler.
Definition: kaleidoscope.c:199
void processKaleidoscope(KaleidoscopeHandle *handler, double k, unsigned char *imgIn, unsigned char *imgOut)
Applies kaleidoscope effect to image.
Definition: kaleidoscope.c:288
void deInitKaleidoscope(KaleidoscopeHandle *handler)
Deinitializes kaleidoscope handler.
Definition: kaleidoscope.c:304
Struct for kaleidoscope effect generator.
Definition: kaleidoscope.h:34