MCPcopy Create free account
hub / github.com/apngasm/apngasm / disassemble

Method disassemble

cli/src/cli.cpp:235–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235int CLI::disassemble(const std::string &src) {
236 // Dissassemble apng file.
237 std::vector<apngasm::APNGFrame> frames = assembler.disassemble(src);
238 std::cout << frames.size() << " Frames" << std::endl;
239
240 // Output png image files.
241 std::string outdir;
242 if (!options.outputFile(outdir)) {
243 std::filesystem::path path = src;
244 outdir = path.replace_extension("").string();
245 }
246 if (!assembler.savePNGs(outdir))
247 return 1;
248
249 // Output json spec files.
250 std::string outSpecFile;
251 if (options.outputJSONFile(outSpecFile)) {
252 std::filesystem::path path = outSpecFile;
253 if (path.is_relative())
254 outSpecFile = outdir + separator + outSpecFile;
255
256 assembler.saveJSON(outSpecFile, outdir);
257 }
258
259 // Output XML spec files.
260 if (options.outputXMLFile(outSpecFile)) {
261 std::filesystem::path path = outSpecFile;
262 if (path.is_relative())
263 outSpecFile = outdir + separator + outSpecFile;
264
265 assembler.saveXML(outSpecFile, outdir);
266 }
267
268 return 0;
269}
270} // namespace apngasm_cli

Callers 1

mainFunction · 0.80

Calls 6

outputFileMethod · 0.80
savePNGsMethod · 0.80
outputJSONFileMethod · 0.80
saveJSONMethod · 0.80
outputXMLFileMethod · 0.80
saveXMLMethod · 0.80

Tested by 1

mainFunction · 0.64