CARLsim  3.1.3
CARLsim: a GPU-accelerated SNN simulator
visual_stimulus.h
Go to the documentation of this file.
1 #ifndef _VISUAL_STIMULUS_H_
2 #define _VISUAL_STIMULUS_H_
3 
4 #include <string>
5 class PoissonRate;
6 
11  enum stimType_t {
20  };
21 
22 
57 public:
58  // +++++ PUBLIC METHODS: CONSTRUCTOR / DESTRUCTOR / MEMBERS +++++++++++++++++++++++++++++++++++++++++++++++++++++ //
59 
69  VisualStimulus(std::string fileName, bool wrapAroundEOF=true);
70 
73 
74 
75  // +++++ PUBLIC METHODS: READING FRAMES +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //
76 
89  unsigned char* readFrameChar();
90 
114  PoissonRate* readFramePoisson(float maxPoisson, float minPoisson=0.0f);
115 
122  void rewind();
123 
124  void print();
125 
126 
127  // +++++ PUBLIC METHODS: GETTERS / SETTERS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //
128 
129  int getWidth();
130  int getHeight();
131  int getLength();
132  int getChannels();
133  stimType_t getType();
134 
135  unsigned char* getCurrentFrameChar();
137  int getCurrentFrameNumber();
138 
139 
140 private:
141  // This class provides a pImpl for the CARLsim User API.
142  // \see https://marcmutz.wordpress.com/translated-articles/pimp-my-pimpl/
143  class Impl;
144  Impl* _impl;
145 };
146 
147 #endif
Class for generating Poisson spike trains.
Definition: poisson_rate.h:84
unsigned char * readFrameChar()
Reads the next image frame and returns a pointer to the char array.
PoissonRate * getCurrentFramePoisson()
returns PoissonRate object of current frame
int getHeight()
returns the stimulus height (number of pixels)
VisualStimulus(std::string fileName, bool wrapAroundEOF=true)
Default constructor.
int getLength()
returns the stimulus length (number of frames)
PoissonRate * readFramePoisson(float maxPoisson, float minPoisson=0.0f)
Reads the next image frame and returns a pointer to a PoissonRate object.
int getChannels()
returns the number of channels (1=grayscale, 3=RGB)
int getCurrentFrameNumber()
void rewind()
Rewinds the file pointer to the top.
~VisualStimulus()
default destructor
unsigned char * getCurrentFrameChar()
returns char array of current frame
stimType_t
List of stimulus file types.
stimType_t getType()
returns the stimulus type (STIM_GRAY, STIM_RGB, etc.)
int getWidth()
returns the stimulus width (number of pixels)
Class to integrate CARLsim with a stimulus created using VisualStimulus.m Version: 4/11/14 Author: Mi...