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-2020 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 00046 class SbKernel2i32 00047 { 00048 public: 00052 SbKernel2i32(); 00053 00058 SbKernel2i32(int numRows, int numCols); 00059 00064 SbKernel2i32(const SbVec2i32& size); 00065 00069 ~SbKernel2i32(); 00070 00075 SbVec2i32 getSize() const; 00076 00080 size_t getNumRows() const; 00081 00085 size_t getNumCols() const; 00086 00088 00097 void setSize(size_t numRows, size_t numCols); 00098 void setSize(const SbVec2i32& dimension); 00099 // @} 00100 00105 int32_t getValue(int indexRow, int indexCol) const; 00106 00111 void setValue(int indexRow, int indexCol, int32_t value); 00112 00122 int32_t& operator()(int indexRow, int indexCol); 00123 00133 const int32_t& operator()(int indexRow, int indexCol) const ; 00134 00138 friend int operator ==(const SbKernel2i32 &k1, const SbKernel2i32 &k2); 00139 00143 friend int operator !=(const SbKernel2i32 &k1, const SbKernel2i32 &k2) 00144 { return !(k1 == k2); } 00145 00146 private: 00148 std::vector<int32_t> m_kernelsValues; 00149 size_t m_numRows; 00150 size_t m_numCols; 00151 }; 00152 00153 #endif