template<class ArrayT>
Definition at line 246 of file WriteRaw.h. References Endian(), Impala::Util::IOBuffer::NativeTypeWrite(), Impala::Util::IOBuffer::Puts(), and Impala::Util::IOBuffer::Write(). Referenced by Impala::Core::VideoSet::ExportStills::HandleNewFile(), and WriteRawListVar(). 00247 { 00248 typedef typename ArrayT::StorType StorT; 00249 00250 String typeStr = Element::TypeString<StorT>(0); 00251 String formatStr = "version: 2, binary: %d, type: " + typeStr + 00252 ", elemSize: %lld, nr: %lld"; 00253 Int64 elemSize = ArrayT::ElemSize(); 00254 Int64 nrA = list.size(); 00255 char buf[200]; 00256 memset(buf, 0, 200); 00257 sprintf(buf, formatStr.c_str(), binary, elemSize, nrA); 00258 00259 if (binary) 00260 { // write binary data 00261 buffer->Write(buf, 200); 00262 for (Int64 n=0 ; n<nrA ; n++) 00263 { 00264 Endian(list[n], list[n]); 00265 Int64 width = list[n]->CW(); 00266 Int64 height = list[n]->CH(); 00267 memset(buf, 0, 200); 00268 sprintf(buf, "%lld %lld", width, height); 00269 buffer->Write(buf, 20); 00270 for (Int64 y=0 ; y<height ; y++) 00271 { 00272 StorT* srcPtr = list[n]->CPB(0, y); 00273 buffer->Write(srcPtr, sizeof(StorT) * width * elemSize); 00274 } 00275 } 00276 } 00277 else 00278 { // write text data 00279 buffer->Puts(buf); 00280 for (Int64 n=0 ; n<nrA ; n++) 00281 { 00282 Int64 width = list[n]->CW(); 00283 Int64 height = list[n]->CH(); 00284 buffer->NativeTypeWrite(width); 00285 buffer->NativeTypeWrite(height); 00286 for(Int64 i=0 ; i<height ; i++) 00287 { 00288 StorT* srcPtr = list[n]->CPB(0, i); 00289 for(Int64 j=0 ; j<width ; j++) 00290 for (Int64 k=0 ; k<elemSize ; k++) 00291 buffer->NativeTypeWrite(*srcPtr++); 00292 buffer->Puts(""); // adds newline 00293 } 00294 } 00295 } 00296 }
Here is the call graph for this function:
|