Image Component Library (ICL)
MyrmexDecoder.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLIO/src/ICLIO/MyrmexDecoder.h **
10 ** Module : ICLIO **
11 ** Authors: Carsten Schuermann **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLCore/Img.h>
35 
36 #define ERROR_MARK 0xA000 //Top 4 Bits code on last pixel of last frame to mark that an error occurred during readout
37 //Connections
38 #define WEST 0
39 #define EAST 1
40 #define SOUTH 2
41 #define NORTH 3
42 #define NOGATE 4
43 #define SIDE 1
44 #define TOP 0
45 //Viewpoints
46 #define VIEW_W 0
47 #define VIEW_3 1
48 #define VIEW_M 2
49 #define VIEW_E 3
50 
51 
52 namespace icl{
53  namespace io{
54 
55  class MyrmexDecoder {
56 
57  public:
59  ICLIO_API void decode(const icl16s *data, const utils::Size &size, core::ImgBase **dst);
60 
61  private:
62  char attachedPosition; //store position of central unit
63  int bigtarget[16*16]; //table which maps module orientation
64  std::vector<char> conversionTable; //table which maps usb input texel position to grabber output texel position
65  std::vector<unsigned int> flat; //table which maps pixel order from per-module style to per-frame-line style
66  unsigned int image_width; //store converted width
67  unsigned int image_height; //store converted height
68 
69  std::vector<char> getConnectionsMeta(const icl16s *data, int size);
70  int grabMetadata(const icl16s *data, unsigned char metadata[256], int size);
71  int setCompression(unsigned int i);
72  int setSpeed(unsigned int i);
73  unsigned short swap16(unsigned short a);
74  void parseConnections( std::vector<char> connections, char* attached, int* weite, int* hoehe );
75  std::vector<char> makeConversiontable( int width, int height, std::vector<char> connections, char attached, char viewpoint );//generate conversiontable to match real world layout + using our viewpoint
76  int convertImage(const icl16s *data, icl16s *outputImageData, const utils::Size &size);
77  void init(const icl16s *data, const utils::Size &size,char viewpoint,unsigned char speed, unsigned char compression);
78  };
79 
80  } // namespace io
81 }
82 
int convertImage(const icl16s *data, icl16s *outputImageData, const utils::Size &size)
std::vector< char > makeConversiontable(int width, int height, std::vector< char > connections, char attached, char viewpoint)
int setSpeed(unsigned int i)
undocument this line if you encounter any issues!
Definition: Any.h:37
std::vector< unsigned int > flat
Definition: MyrmexDecoder.h:65
std::vector< char > getConnectionsMeta(const icl16s *data, int size)
void parseConnections(std::vector< char > connections, char *attached, int *weite, int *hoehe)
Definition: MyrmexDecoder.h:55
ICLQt_API ImgROI data(ImgQ &r)
creates full ROI ROI-struct
void init(const icl16s *data, const utils::Size &size, char viewpoint, unsigned char speed, unsigned char compression)
#define ICLIO_API
Definition: CompatMacros.h:176
Size class of the ICL.
Definition: Size.h:61
unsigned int image_width
Definition: MyrmexDecoder.h:66
ICLIO_API void decode(const icl16s *data, const utils::Size &size, core::ImgBase **dst)
int bigtarget[16 *16]
Definition: MyrmexDecoder.h:63
int setCompression(unsigned int i)
char attachedPosition
Definition: MyrmexDecoder.h:62
int grabMetadata(const icl16s *data, unsigned char metadata[256], int size)
unsigned int image_height
Definition: MyrmexDecoder.h:67
std::vector< char > conversionTable
Definition: MyrmexDecoder.h:64
unsigned short swap16(unsigned short a)
Ipp16s icl16s
16bit signed integer type for the ICL (range [-32767, 32768 ])
Definition: BasicTypes.h:61
ICLIO_API MyrmexDecoder()
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131