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

Function pixacompWrite

deps/leptonica/src/pixcomp.c:1798–1819  ·  view source on GitHub ↗

! * \brief pixacompWrite() * * \param[in] filename * \param[in] pixac * \return 0 if OK, 1 on error * * * Notes: * (1) Unlike the situation with serialized Pixa, where the image * data is stored in png format, the Pixacomp image data * can be stored in tiffg4, png and jpg formats. * */

Source from the content-addressed store, hash-verified

1796 * </pre>
1797 */
1798l_int32
1799pixacompWrite(const char *filename,
1800 PIXAC *pixac)
1801{
1802l_int32 ret;
1803FILE *fp;
1804
1805 PROCNAME("pixacompWrite");
1806
1807 if (!filename)
1808 return ERROR_INT("filename not defined", procName, 1);
1809 if (!pixac)
1810 return ERROR_INT("pixacomp not defined", procName, 1);
1811
1812 if ((fp = fopenWriteStream(filename, "wb")) == NULL)
1813 return ERROR_INT("stream not opened", procName, 1);
1814 ret = pixacompWriteStream(fp, pixac);
1815 fclose(fp);
1816 if (ret)
1817 return ERROR_INT("pixacomp not written to stream", procName, 1);
1818 return 0;
1819}
1820
1821
1822/*!

Callers

nothing calls this directly

Calls 2

fopenWriteStreamFunction · 0.85
pixacompWriteStreamFunction · 0.85

Tested by

no test coverage detected