! * \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. * */
| 1796 | * </pre> |
| 1797 | */ |
| 1798 | l_int32 |
| 1799 | pixacompWrite(const char *filename, |
| 1800 | PIXAC *pixac) |
| 1801 | { |
| 1802 | l_int32 ret; |
| 1803 | FILE *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 | /*! |
nothing calls this directly
no test coverage detected