00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Martial Papillon (oct 2014) 00022 **=======================================================================*/ 00023 00024 #ifndef _SB_KERNEL_2I32_H_ 00025 #define _SB_KERNEL_2I32_H_ 00026 00027 #include <ImageViz/SoImageViz.h> 00028 #include <Inventor/SbVec.h> 00029 #include <Inventor/SbDataType.h> 00030 00045 class SbKernel2i32 00046 { 00047 public: 00051 SbKernel2i32(); 00052 00057 SbKernel2i32(int numRows, int numCols); 00058 00063 SbKernel2i32(const SbVec2i32& size); 00064 00068 ~SbKernel2i32(); 00069 00074 SbVec2i32 getSize() const; 00075 00079 size_t getNumRows() const; 00080 00084 size_t getNumCols() const; 00085 00087 00096 void setSize(size_t numRows, size_t numCols); 00097 void setSize(const SbVec2i32& dimension); 00098 // @} 00099 00104 int32_t getValue(int indexRow, int indexCol) const; 00105 00110 void setValue(int indexRow, int indexCol, int32_t value); 00111 00121 int32_t& operator()(int indexRow, int indexCol); 00122 00132 const int32_t& operator()(int indexRow, int indexCol) const ; 00133 00137 friend int operator ==(const SbKernel2i32 &k1, const SbKernel2i32 &k2); 00138 00142 friend int operator !=(const SbKernel2i32 &k1, const SbKernel2i32 &k2) 00143 { return !(k1 == k2); } 00144 00145 private: 00147 std::vector<int32_t> m_kernelsValues; 00148 size_t m_numRows; 00149 size_t m_numCols; 00150 }; 00151 00152 #endif