Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef PCL_FEATURES_REGION_XY_
00039 #define PCL_FEATURES_REGION_XY_
00040
00041 #include <fstream>
00042
00043 namespace pcl
00044 {
00046 template <class Type>
00047 void read (std::istream & stream, Type & value)
00048 {
00049 stream.read (reinterpret_cast<char*> (&value), sizeof(value));
00050 }
00051
00053 template <class Type>
00054 void read (std::istream & stream, Type * value, int nr_values)
00055 {
00056 for (int value_index = 0; value_index < nr_values; ++value_index)
00057 {
00058 read (stream, value[value_index]);
00059 }
00060 }
00061
00063 template <class Type>
00064 void write (std::ostream & stream, Type value)
00065 {
00066 stream.write (reinterpret_cast<char*> (&value), sizeof (value));
00067 }
00068
00070 template <class Type>
00071 void write (std::ostream & stream, Type * value, int nr_values)
00072 {
00073 for (int value_index = 0; value_index < nr_values; ++value_index)
00074 {
00075 write (stream, value[value_index]);
00076 }
00077 }
00078
00082 struct PCL_EXPORTS RegionXY
00083 {
00085 RegionXY () : x (0), y (0), width (0), height (0) {}
00086
00088 int x;
00090 int y;
00092 int width;
00094 int height;
00095
00098 void
00099 serialize (std::ostream & stream) const
00100 {
00101 write (stream, x);
00102 write (stream, y);
00103 write (stream, width);
00104 write (stream, height);
00105 }
00106
00109 void
00110 deserialize (::std::istream & stream)
00111 {
00112 read (stream, x);
00113 read (stream, y);
00114 read (stream, width);
00115 read (stream, height);
00116 }
00117
00118 };
00119 }
00120
00121 #endif // PCL_FEATURES_REGION_XY_