! * \brief pixcompWriteFile() * * \param[in] rootname * \param[in] pixc * \return 0 if OK, 1 on error * * * Notes: * (1) The compressed data is written to file, and the filename is * generated by appending the format extension to %rootname. * */
| 2412 | * </pre> |
| 2413 | */ |
| 2414 | l_int32 |
| 2415 | pixcompWriteFile(const char *rootname, |
| 2416 | PIXC *pixc) |
| 2417 | { |
| 2418 | char buf[128]; |
| 2419 | |
| 2420 | PROCNAME("pixcompWriteFile"); |
| 2421 | |
| 2422 | if (!pixc) |
| 2423 | return ERROR_INT("pixc not defined", procName, 1); |
| 2424 | |
| 2425 | snprintf(buf, sizeof(buf), "%s.%s", rootname, |
| 2426 | ImageFileFormatExtensions[pixc->comptype]); |
| 2427 | l_binaryWrite(buf, "w", pixc->data, pixc->size); |
| 2428 | return 0; |
| 2429 | } |
| 2430 | |
| 2431 |
no test coverage detected