Changeset 800 for trunk/applications/NXtranslate/node.cpp
- Timestamp:
- 01/08/06 16:35:04 (6 years ago)
- File:
-
- 1 edited
-
trunk/applications/NXtranslate/node.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/applications/NXtranslate/node.cpp
r683 r800 167 167 } 168 168 169 const std::vector<int> Node::comp_buffer_dims() const{ 170 return __comp_buffer_dims; 171 } 172 169 173 void* Node::data() const{ 170 174 return __value; … … 202 206 throw out_of_range("asked for attribute with higher index than size"); 203 207 return (*(__attrs.begin()+attr_num)); 208 } 209 210 const void Node::set_comp(const string &comp_type){ 211 if(string_util::starts_with(comp_type,"NONE")){ 212 __comp_type=COMP_NONE; 213 }else if(string_util::starts_with(comp_type,"LZW")){ 214 __comp_type=COMP_LZW; 215 }else if(string_util::starts_with(comp_type,"RLE")){ 216 __comp_type=COMP_RLE; 217 }else if(string_util::starts_with(comp_type,"HUF")){ 218 __comp_type=COMP_HUF; 219 }else{ 220 throw invalid_argument("Do not understand compression type: "+comp_type); 221 } 222 223 // work with user specified dimension information 224 vector<string> temp=string_util::split(comp_type,":"); 225 if(temp.size()==2){ 226 __comp_buffer_dims=string_util::str_to_intVec(*(temp.rbegin())); 227 } 228 229 // use default if anything is wrong 230 if(__comp_buffer_dims.size()!=__dims.size()){ 231 __comp_buffer_dims=__dims; 232 for( size_t i=0 ; i<__comp_buffer_dims.size()-1 ; ++i ){ 233 __comp_buffer_dims[i]=1; 234 } 235 } 204 236 } 205 237
Note: See TracChangeset
for help on using the changeset viewer.
