kaleidoscope  1.4.0
Public Member Functions | List of all members
kalos::Kaleidoscope Class Reference

Kaleidoscope effect generator. More...

#include <kaleidoscope.hpp>

Public Member Functions

 Kaleidoscope (int nImage, int width, int height, int nComponents, double scaleDown, double dimConst)
 Construct a new Kaleidoscope object. More...
 
void processImage (uint8_t *inImg, uint8_t *outImg, size_t size, double dimConst)
 Creates kaleidoscope effect. More...
 
void processImage (uint8_t *inImg, uint8_t *outImg, size_t size)
 Creates kaleidoscope effect. Uses dim constant provided in constructor. More...
 
 ~Kaleidoscope ()
 Destroy the Kaleidoscope object. More...
 

Detailed Description

Kaleidoscope effect generator.

Definition at line 15 of file kaleidoscope.hpp.

Constructor & Destructor Documentation

◆ Kaleidoscope()

kalos::Kaleidoscope::Kaleidoscope ( int  nImage,
int  width,
int  height,
int  nComponents,
double  scaleDown,
double  dimConst 
)
inline

Construct a new Kaleidoscope object.

Parameters
[in]nImageNumber of images for effect
[in]widthImage width
[in]heightImage height
[in]nComponentsNumber of color components (eg 3 for RGB)
[in]scaleDownScale down ratio to shrink image. Must be between 0.0 and 1.0
[in]dimConstVariable to dim background. Should be between 0.0 and 1.0

Definition at line 31 of file kaleidoscope.hpp.

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  }
int initKaleidoscope(KaleidoscopeHandle *handler, int n, int width, int height, int nComponents, double scaleDown)
Initializes kaleidoscope handler.
Definition: kaleidoscope.c:199

◆ ~Kaleidoscope()

kalos::Kaleidoscope::~Kaleidoscope ( )
inline

Destroy the Kaleidoscope object.

Definition at line 61 of file kaleidoscope.hpp.

61 { deInitKaleidoscope(&handler); }
void deInitKaleidoscope(KaleidoscopeHandle *handler)
Deinitializes kaleidoscope handler.
Definition: kaleidoscope.c:304

Member Function Documentation

◆ processImage() [1/2]

void kalos::Kaleidoscope::processImage ( uint8_t *  inImg,
uint8_t *  outImg,
size_t  size 
)
inline

Creates kaleidoscope effect. Uses dim constant provided in constructor.

Parameters
inImgInput image
outImgOutput image
sizeSize of the images

Definition at line 56 of file kaleidoscope.hpp.

56 { processImage(inImg, outImg, size, k); }
void processImage(uint8_t *inImg, uint8_t *outImg, size_t size, double dimConst)
Creates kaleidoscope effect.

◆ processImage() [2/2]

void kalos::Kaleidoscope::processImage ( uint8_t *  inImg,
uint8_t *  outImg,
size_t  size,
double  dimConst 
)
inline

Creates kaleidoscope effect.

Parameters
inImgInput image
outImgOutput image
sizeSize of the images
dimConstVariable to dim background. Should be between 0.0 and 1.0

Definition at line 45 of file kaleidoscope.hpp.

46  {
47  processKaleidoscope(&handler, dimConst, inImg, outImg);
48  }
void processKaleidoscope(KaleidoscopeHandle *handler, double k, unsigned char *imgIn, unsigned char *imgOut)
Applies kaleidoscope effect to image.
Definition: kaleidoscope.c:288

The documentation for this class was generated from the following file: