MCPcopy Create free account
hub / github.com/creatale/node-dv / icvWriteSeq

Function icvWriteSeq

deps/opencv/modules/core/src/persistence.cpp:4142–4187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4140
4141
4142static void
4143icvWriteSeq( CvFileStorage* fs, const char* name,
4144 const void* struct_ptr,
4145 CvAttrList attr, int level )
4146{
4147 const CvSeq* seq = (CvSeq*)struct_ptr;
4148 CvSeqBlock* block;
4149 char buf[128];
4150 char dt_buf[128], *dt;
4151
4152 assert( CV_IS_SEQ( seq ));
4153 cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_SEQ );
4154
4155 if( level >= 0 )
4156 cvWriteInt( fs, "level", level );
4157
4158 dt = icvGetFormat( seq, "dt", &attr, 0, dt_buf );
4159
4160 strcpy(buf, "");
4161 if( CV_IS_SEQ_CLOSED(seq) )
4162 strcat(buf, " closed");
4163 if( CV_IS_SEQ_HOLE(seq) )
4164 strcat(buf, " hole");
4165 if( CV_IS_SEQ_CURVE(seq) )
4166 strcat(buf, " curve");
4167 if( CV_SEQ_ELTYPE(seq) == 0 && seq->elem_size != 1 )
4168 strcat(buf, " untyped");
4169
4170 cvWriteString( fs, "flags", buf + (buf[0] ? 1 : 0), 1 );
4171
4172 cvWriteInt( fs, "count", seq->total );
4173
4174 cvWriteString( fs, "dt", dt, 0 );
4175
4176 icvWriteHeaderData( fs, seq, &attr, sizeof(CvSeq) );
4177 cvStartWriteStruct( fs, "data", CV_NODE_SEQ + CV_NODE_FLOW );
4178
4179 for( block = seq->first; block; block = block->next )
4180 {
4181 cvWriteRawData( fs, block->data, block->count, dt );
4182 if( block == seq->first->prev )
4183 break;
4184 }
4185 cvEndWriteStruct( fs );
4186 cvEndWriteStruct( fs );
4187}
4188
4189
4190static void

Callers 1

icvWriteSeqTreeFunction · 0.85

Calls 7

cvStartWriteStructFunction · 0.85
cvWriteIntFunction · 0.85
icvGetFormatFunction · 0.85
cvWriteStringFunction · 0.85
icvWriteHeaderDataFunction · 0.85
cvWriteRawDataFunction · 0.85
cvEndWriteStructFunction · 0.85

Tested by

no test coverage detected