NEST  2.6.0,not_revisioned_source_dir@0
sligraphics.h
Go to the documentation of this file.
1 /*
2  * sligraphics.h
3  *
4  * This file is part of NEST.
5  *
6  * Copyright (C) 2004 The NEST Initiative
7  *
8  * NEST is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * NEST is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef SLIPGM_H
24 #define SLIPGM_H
25 
26 #include <iostream>
27 #include <string>
28 #include <vector>
29 #include "stringdatum.h"
30 #include "fdstream.h"
31 #include "slimodule.h"
32 #include "slifunction.h"
33 #include "interpret.h"
34 
35 
36 using std::vector;
37 using std::string;
38 
39 class SLIgraphics: public SLIModule
40 {
41 
43  {
44  private:
45  std::istream * openPGMFile(StringDatum*) const;
46  void readMagicNumber(std::istream*, char[2]) const;
47  void initRead(std::istream*, int&, int&, int &) const;
48  void readImage(std::istream*, char[2], vector<long> &, int, int, int) const;
49 
50  public:
51  virtual void execute(SLIInterpreter*) const;
52 
53 
54  };
55 
57  {
58  public:
59  virtual void execute(SLIInterpreter*) const;
60  };
61 
64 
65 public:
66 
68 
69  void init(SLIInterpreter *);
70  const string name(void) const;
71  const string commandstring(void) const;
72 
73 };
74 
75 
76 #endif
ReadPGMFunction readpgmfunction
Definition: sligraphics.h:62
An implementation of C++ filestreams that supports an interface to the file descriptor.
std::istream * openPGMFile(StringDatum *) const
opens the file
Definition: sligraphics.cc:115
Definition: slifunction.h:35
Definition: sligraphics.h:56
Definition: aggregatedatum.h:53
const string name(void) const
Return name of the module.
Definition: sligraphics.cc:342
Definition: interpret.h:69
WritePGMFunction writepgmfunction
Definition: sligraphics.h:63
SLIgraphics()
Definition: sligraphics.h:67
void readMagicNumber(std::istream *, char[2]) const
reads the magic number into string magic
Definition: sligraphics.cc:129
void init(SLIInterpreter *)
Initialise the module.
Definition: sligraphics.cc:336
Definition: sligraphics.h:42
Base class for all SLI Interpreter modules.
Definition: slimodule.h:34
const string commandstring(void) const
Return sli command sequence to be executed for initialisation.
Definition: sligraphics.cc:347
virtual void execute(SLIInterpreter *) const
Definition: sligraphics.cc:68
Definition: sligraphics.h:39
void readImage(std::istream *, char[2], vector< long > &, int, int, int) const
reads the image
Definition: sligraphics.cc:174
virtual void execute(SLIInterpreter *) const
Definition: sligraphics.cc:253
void initRead(std::istream *, int &, int &, int &) const
reads width, height, maxval
Definition: sligraphics.cc:143