cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
svlSampleMatrix.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Balazs Vagvolgyi
7  Created on: 2010
8 
9  (C) Copyright 2006-2010 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 
20 */
21 
22 #ifndef _svlSampleMatrix_h
23 #define _svlSampleMatrix_h
24 
26 
27 // Always include last!
29 
30 // Forward declarations
31 class svlSampleImage;
32 
33 
35 {
36 public:
38  svlSampleMatrix(const svlSampleMatrix & other);
39  virtual ~svlSampleMatrix();
40 
41  virtual svlSample* GetNewInstance() const = 0;
42  virtual svlStreamType GetType() const = 0;
43  virtual int SetSize(const svlSample* sample) = 0;
44  virtual int SetSize(const svlSample& sample) = 0;
45  virtual int CopyOf(const svlSample* sample) = 0;
46  virtual int CopyOf(const svlSample& sample) = 0;
47  virtual bool IsInitialized() const = 0;
48  virtual unsigned char* GetUCharPointer() = 0;
49  virtual const unsigned char* GetUCharPointer() const = 0;
50  virtual unsigned int GetDataSize() const = 0;
51  virtual void SerializeRaw(std::ostream & outputStream) const = 0;
52  virtual void DeSerializeRaw(std::istream & inputStream) = 0;
53 
54  virtual unsigned char* GetUCharPointer(const unsigned int col, const unsigned int row) = 0;
55  virtual const unsigned char* GetUCharPointer(const unsigned int col, const unsigned int row) const = 0;
56  virtual void SetSize(const unsigned int cols, const unsigned int rows) = 0;
57  virtual void Resize(const unsigned int cols, const unsigned int rows) = 0;
58  virtual unsigned int GetCols() const = 0;
59  virtual unsigned int GetRows() const = 0;
60  virtual unsigned int GetColStride() const = 0;
61  virtual unsigned int GetRowStride() const = 0;
62  virtual const std::string Str(const unsigned int width, const unsigned int precision, const int errorvalue) const = 0;
63  virtual const std::string Str(const unsigned int width, const unsigned int precision, const unsigned int errorvalue) const = 0;
64  virtual const std::string Str(const unsigned int width, const unsigned int precision, const double errorvalue) const = 0;
65 
66  template <class _TypeIn>
67  int ImportData(_TypeIn *input, const unsigned int size);
68  int ImportMatrix(const svlSampleMatrix* matrix);
69  int ImportImage(const svlSampleImage* image);
70  int ImportSample(const svlSample* sample);
71 
72 protected:
73  template <class _TypeIn, class _TypeOut>
74  int ConvertData(_TypeIn *input, const unsigned int size);
75 };
76 
77 
78 #endif // _svlSampleMatrix_h
79 
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Definition: svlSampleMatrix.h:34
virtual svlSample * GetNewInstance() const =0
int CISST_EXPORT Resize(svlSampleImage *src_img, unsigned int src_videoch, svlSampleImage *dst_img, unsigned int dst_videoch, bool interpolation)
svlStreamType
Definition: svlDefinitions.h:193
virtual svlStreamType GetType() const =0
virtual int CopyOf(const svlSample *sample)=0
virtual unsigned char * GetUCharPointer()=0
virtual unsigned int GetDataSize() const =0
virtual void SerializeRaw(std::ostream &outputStream) const =0
virtual int SetSize(const svlSample *sample)=0
virtual void DeSerializeRaw(std::istream &inputStream)=0
Definition: svlSampleImage.h:35
Macros to export the symbols of cisstStereoVision (in a Dll).
virtual bool IsInitialized() const
Definition: svlSample.h:31