Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class ArrayT>
void Impala::Core::Array::WriteRawListVar ( std::vector< ArrayT * >  list,
Util::IOBuffer *  buffer,
bool  binary 
) [inline]

Definition at line 198 of file WriteRaw.h.

References Endian(), Impala::Util::IOBuffer::NativeTypeWrite(), Impala::Util::IOBuffer::Puts(), and Impala::Util::IOBuffer::Write().

Referenced by Impala::Core::ImageSet::Thumbnails::HandleDoneDir(), Impala::Core::VideoSet::ExportStills::HandleNewFile(), and WriteRawListVar().

00199 {
00200     typedef typename ArrayT::StorType StorT;
00201 
00202     String typeStr = Element::TypeString<StorT>(0);
00203     String formatStr = "version: 2, binary: %d, type: " + typeStr +
00204                        ", elemSize: %lld, nr: %lld";
00205     Int64 elemSize = ArrayT::ElemSize();
00206     Int64 nrA = list.size();
00207     char buf[200];
00208     memset(buf, 0, 200);
00209     sprintf(buf, formatStr.c_str(), binary, elemSize, nrA);
00210 
00211     if (binary)
00212     { // write binary data
00213         buffer->Write(buf, 200);
00214         for (Int64 n=0 ; n<nrA ; n++)
00215         {
00216             Endian(list[n], list[n]);
00217             Int64 width = list[n]->CW();
00218             Int64 height = list[n]->CH();
00219             memset(buf, 0, 200);
00220             sprintf(buf, "%lld %lld", width, height);
00221             buffer->Write(buf, 20);
00222             for (Int64 y=0 ; y<height ; y++)
00223             {
00224                 StorT* srcPtr = list[n]->CPB(0, y);
00225                 buffer->Write(srcPtr, sizeof(StorT) * width * elemSize);
00226             }
00227         }
00228     }
00229     else
00230     { // write text data
00231         buffer->Puts(buf);
00232         for (Int64 n=0 ; n<nrA ; n++)
00233         {
00234             Int64 width = list[n]->CW();
00235             Int64 height = list[n]->CH();
00236             buffer->NativeTypeWrite(width);
00237             buffer->NativeTypeWrite(height);
00238             for(Int64 i=0 ; i<height ; i++)
00239             {
00240                 StorT* srcPtr = list[n]->CPB(0, i);
00241                 for(Int64 j=0 ; j<width ; j++)
00242                     for (Int64 k=0 ; k<elemSize ; k++)
00243                         buffer->NativeTypeWrite(*srcPtr++);
00244                 buffer->Puts(""); // adds newline
00245             }
00246         }
00247     }
00248 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:59:02 2010 for ImpalaSrc by  doxygen 1.5.1