int main( int argc, char** argv ) { if(argc < 2) { printf("Veuillez specifier l'image a nettoyer...\n"); return; } char* filename = argv[1]; IplImage* frame = cvLoadImage(filename, CV_LOAD_IMAGE_COLOR); if(frame == NULL) { fprintf(stderr, "Erreur de lecture de l'image %s\n", filename); } // // a) une ouverture seule // openSave(frame, 3, "frameOpen3.jpg"); openSave(frame, 5, "frameOpen5.jpg"); // // b) une ouverture puis une fermeture // openCloseSave(frame, 3, "frameOpenClose3.jpg"); openCloseSave(frame, 5, "frameOpenClose5.jpg"); }
// Open the save and read it bool SaveReader::load() { Common::InSaveFile *in = 0; Common::SeekableReadStream *stream; if (!_fileName.empty()) { in = openSave(); if (!in) return false; stream = in; } else if (_stream) stream = _stream; else return false; if (!SaveContainer::read(*stream)) { delete in; return false; } delete in; _loaded = true; return true; }
uint32 SaveConverter::getActualSize(Common::InSaveFile **save) const { Common::InSaveFile *saveFile = openSave(); if (!saveFile) return false; // Is it a valid new save? if (SaveContainer::isSave(*saveFile)) { delete saveFile; return false; } int32 saveSize = saveFile->size(); if (saveSize <= 0) { delete saveFile; return 0; } if (save) *save = saveFile; else delete saveFile; return saveSize; }
bool SaveReader::getInfo(const Common::String &fileName, SavePartInfo &info) { Common::InSaveFile *in = openSave(fileName); if (!in) return false; bool result = getInfo(*in, info); delete in; return result; }
bool SaveWriter::save() { Common::OutSaveFile *out = openSave(); if (!out) return false; bool success = save(*out); delete out; return success; }
Common::InSaveFile *SaveReader::openSave() { return openSave(_fileName); }
Common::OutSaveFile *SaveWriter::openSave() { return openSave(_fileName); }