MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / psl_gray_encode

Function psl_gray_encode

src/postscriptlight.c:717–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715/* This one is NOT static since needed in psimage, at least for now */
716
717unsigned char *psl_gray_encode (struct PSL_CTRL *PSL, size_t *nbytes, unsigned char *input) {
718 /* Recode RGB stream as gray-scale stream */
719
720 size_t in, out, nout;
721 unsigned char *output = NULL;
722
723 nout = *nbytes / 3;
724 output = PSL_memory (PSL, NULL, nout, unsigned char);
725
726 for (in = out = 0; in < *nbytes; out++, in += 3) output[out] = (char) lrint (PSL_YIQ ((&input[in])));
727 *nbytes = nout;
728 return (output);
729}
730
731/* Define local (static) support functions called inside the public PSL functions */
732

Callers 2

psl_stream_dumpFunction · 0.85
GMT_psimageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected