kaleidoscope 1.4.0
 
Loading...
Searching...
No Matches
kaleidoscope.hpp
Go to the documentation of this file.
1#pragma once
2
3extern "C"
4{
5#include "kaleidoscope.h"
6}
7
8#include <cstdint>
9#include <stdexcept>
10
11namespace kalos
12{
17 {
18 private:
19 double k;
21
22 public:
32 Kaleidoscope(int nImage, int width, int height, int nComponents, double scaleDown, double dimConst)
33 : k(dimConst)
34 {
35 if (initKaleidoscope(&handler, nImage, width, height, nComponents, scaleDown) != 0)
36 throw std::runtime_error("Can't init kaleidoscope structure for these inputs");
37 }
38
46 void processImage(uint8_t *inImg, uint8_t *outImg, size_t size, double dimConst)
47 {
48 processKaleidoscope(&handler, dimConst, inImg, outImg);
49 }
50
57 void processImage(uint8_t *inImg, uint8_t *outImg, size_t size) { processImage(inImg, outImg, size, k); }
58
63 };
64
65} // 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.
KaleidoscopeHandle handler
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.
void processKaleidoscope(KaleidoscopeHandle *handler, double k, unsigned char *imgIn, unsigned char *imgOut)
Applies kaleidoscope effect to image.
void deInitKaleidoscope(KaleidoscopeHandle *handler)
Deinitializes kaleidoscope handler.
Struct for kaleidoscope effect generator.