Commit 0196c9ed45748100c33a77cc1a8c23174d61f7d4

Authored by David Mayerich
1 parent f2c883d8

temporarily removed support for different data types in image.h

Showing 1 changed file with 6 additions and 4 deletions   Show diff stats
stim/image/image.h
@@ -61,7 +61,7 @@ class image{ @@ -61,7 +61,7 @@ class image{
61 61
62 62
63 int cv_type(){ 63 int cv_type(){
64 - if(std::is_same<T, unsigned char>::value) return CV_MAKETYPE(CV_8U, (int)C()); 64 + /*if(std::is_same<T, unsigned char>::value) return CV_MAKETYPE(CV_8U, (int)C());
65 if(std::is_same<T, char>::value) return CV_MAKETYPE(CV_8S, (int)C()); 65 if(std::is_same<T, char>::value) return CV_MAKETYPE(CV_8S, (int)C());
66 if(std::is_same<T, unsigned short>::value) return CV_MAKETYPE(CV_16U, (int)C()); 66 if(std::is_same<T, unsigned short>::value) return CV_MAKETYPE(CV_16U, (int)C());
67 if(std::is_same<T, short>::value) return CV_MAKETYPE(CV_16S, (int)C()); 67 if(std::is_same<T, short>::value) return CV_MAKETYPE(CV_16S, (int)C());
@@ -70,12 +70,13 @@ class image{ @@ -70,12 +70,13 @@ class image{
70 if(std::is_same<T, double>::value) return CV_MAKETYPE(CV_64F, (int)C()); 70 if(std::is_same<T, double>::value) return CV_MAKETYPE(CV_64F, (int)C());
71 71
72 std::cout<<"ERROR in stim::image::cv_type - no valid data type found"<<std::endl; 72 std::cout<<"ERROR in stim::image::cv_type - no valid data type found"<<std::endl;
73 - exit(1); 73 + exit(1);*/
  74 + return CV_MAKETYPE(CV_8U, (int)C());
74 } 75 }
75 76
76 /// Returns the value for "white" based on the dynamic range (assumes white is 1.0 for floating point images) 77 /// Returns the value for "white" based on the dynamic range (assumes white is 1.0 for floating point images)
77 T white(){ 78 T white(){
78 - if(std::is_same<T, unsigned char>::value) return UCHAR_MAX; 79 + /*if(std::is_same<T, unsigned char>::value) return UCHAR_MAX;
79 if(std::is_same<T, unsigned short>::value) return SHRT_MAX; 80 if(std::is_same<T, unsigned short>::value) return SHRT_MAX;
80 if(std::is_same<T, unsigned>::value) return UINT_MAX; 81 if(std::is_same<T, unsigned>::value) return UINT_MAX;
81 if(std::is_same<T, unsigned long>::value) return ULONG_MAX; 82 if(std::is_same<T, unsigned long>::value) return ULONG_MAX;
@@ -84,7 +85,8 @@ class image{ @@ -84,7 +85,8 @@ class image{
84 if(std::is_same<T, double>::value) return 1.0; 85 if(std::is_same<T, double>::value) return 1.0;
85 86
86 std::cout<<"ERROR in stim::image::white - no white value known for this data type"<<std::endl; 87 std::cout<<"ERROR in stim::image::white - no white value known for this data type"<<std::endl;
87 - 88 + */
  89 + return UCHAR_MAX;
88 } 90 }
89 91
90 92