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

Function pixcompFastConvertToPdfData

deps/leptonica/src/pixcomp.c:2200–2226  ·  view source on GitHub ↗

! * \brief pixcompFastConvertToPdfData() * * \param[in] pixc containing images all at the same resolution * \param[in] title [optional] pdf title * \param[out] pdata output pdf data (of all images * \param[out] pnbytes size of output pdf data * \return 0 if OK, 1 on error * * * Notes: * (1) This generates the pdf without transcoding. * (2) It assumes all

Source from the content-addressed store, hash-verified

2198 * </pre>
2199 */
2200static l_int32
2201pixcompFastConvertToPdfData(PIXC *pixc,
2202 const char *title,
2203 l_uint8 **pdata,
2204 size_t *pnbytes)
2205{
2206l_uint8 *data;
2207L_COMP_DATA *cid;
2208
2209 PROCNAME("pixacompFastConvertToPdfData");
2210
2211 if (!pdata)
2212 return ERROR_INT("&data not defined", procName, 1);
2213 *pdata = NULL;
2214 if (!pnbytes)
2215 return ERROR_INT("&nbytes not defined", procName, 1);
2216 *pnbytes = 0;
2217 if (!pixc)
2218 return ERROR_INT("pixc not defined", procName, 1);
2219
2220 /* Make a copy of the data */
2221 data = l_binaryCopy(pixc->data, pixc->size);
2222 cid = l_generateJpegDataMem(data, pixc->size, 0);
2223
2224 /* Note: cid is destroyed, along with data, by this function */
2225 return cidConvertToPdfData(cid, title, pdata, pnbytes);
2226}
2227
2228
2229/*--------------------------------------------------------------------*

Callers 1

Calls 3

l_binaryCopyFunction · 0.85
l_generateJpegDataMemFunction · 0.70
cidConvertToPdfDataFunction · 0.70

Tested by

no test coverage detected