CARLsim  5.0.0
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
VisualStimulus::readFramePoisson
PoissonRate * readFramePoisson(float maxPoisson, float minPoisson=0.0f)
Reads the next image frame and returns a pointer to a PoissonRate object.
Definition: visual_stimulus.cpp:233
BAR_STIM
@ BAR_STIM
Definition: visual_stimulus.h:16
VisualStimulus::getChannels
int getChannels()
returns the number of channels (1=grayscale, 3=RGB)
Definition: visual_stimulus.cpp:242
VisualStimulus::getType
stimType_t getType()
returns the stimulus type (STIM_GRAY, STIM_RGB, etc.)
Definition: visual_stimulus.cpp:243
VisualStimulus::rewind
void rewind()
Rewinds the file pointer to the top.
Definition: visual_stimulus.cpp:236
VisualStimulus::getWidth
int getWidth()
returns the stimulus width (number of pixels)
Definition: visual_stimulus.cpp:239
VisualStimulus::~VisualStimulus
~VisualStimulus()
default destructor
Definition: visual_stimulus.cpp:230
DOT_STIM
@ DOT_STIM
Definition: visual_stimulus.h:15
VisualStimulus::getLength
int getLength()
returns the stimulus length (number of frames)
Definition: visual_stimulus.cpp:241
VisualStimulus
Class to integrate CARLsim with a stimulus created using VisualStimulus.m Version: 4/11/14 Author: Mi...
Definition: visual_stimulus.h:56
PoissonRate
Class for generating Poisson spike trains.
Definition: poisson_rate.h:84
VisualStimulus::print
void print()
Definition: visual_stimulus.cpp:237
VisualStimulus::getCurrentFramePoisson
PoissonRate * getCurrentFramePoisson()
returns PoissonRate object of current frame
Definition: visual_stimulus.cpp:245
VisualStimulus::readFrameChar
unsigned char * readFrameChar()
Reads the next image frame and returns a pointer to the char array.
Definition: visual_stimulus.cpp:232
MOVIE_STIM
@ MOVIE_STIM
Definition: visual_stimulus.h:18
COMPOUND_STIM
@ COMPOUND_STIM
Definition: visual_stimulus.h:19
stimType_t
stimType_t
List of stimulus file types.
Definition: visual_stimulus.h:11
UNKNOWN_STIM
@ UNKNOWN_STIM
Definition: visual_stimulus.h:12
VisualStimulus::Impl
Definition: visual_stimulus.cpp:9
VisualStimulus::getCurrentFrameChar
unsigned char * getCurrentFrameChar()
returns char array of current frame
Definition: visual_stimulus.cpp:244
VisualStimulus::getHeight
int getHeight()
returns the stimulus height (number of pixels)
Definition: visual_stimulus.cpp:240
PICTURE_STIM
@ PICTURE_STIM
Definition: visual_stimulus.h:17
VisualStimulus::getCurrentFrameNumber
int getCurrentFrameNumber()
Definition: visual_stimulus.cpp:246
GRATING_STIM
@ GRATING_STIM
Definition: visual_stimulus.h:13
PLAID_STIM
@ PLAID_STIM
Definition: visual_stimulus.h:14
VisualStimulus::VisualStimulus
VisualStimulus(std::string fileName, bool wrapAroundEOF=true)
Default constructor.
Definition: visual_stimulus.cpp:229