| 715 | /* This one is NOT static since needed in psimage, at least for now */ |
| 716 | |
| 717 | unsigned 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 |
no outgoing calls
no test coverage detected