writes matrix, image, sequence, graph etc. */
| 5017 | |
| 5018 | /* writes matrix, image, sequence, graph etc. */ |
| 5019 | CV_IMPL void |
| 5020 | cvWrite( CvFileStorage* fs, const char* name, |
| 5021 | const void* ptr, CvAttrList attributes ) |
| 5022 | { |
| 5023 | CvTypeInfo* info; |
| 5024 | |
| 5025 | CV_CHECK_OUTPUT_FILE_STORAGE( fs ); |
| 5026 | |
| 5027 | if( !ptr ) |
| 5028 | CV_Error( CV_StsNullPtr, "Null pointer to the written object" ); |
| 5029 | |
| 5030 | info = cvTypeOf( ptr ); |
| 5031 | if( !info ) |
| 5032 | CV_Error( CV_StsBadArg, "Unknown object" ); |
| 5033 | |
| 5034 | if( !info->write ) |
| 5035 | CV_Error( CV_StsBadArg, "The object does not have write function" ); |
| 5036 | |
| 5037 | info->write( fs, name, ptr, attributes ); |
| 5038 | } |
| 5039 | |
| 5040 | |
| 5041 | /* simple API for reading/writing data */ |