Image Filter art-Punch Filter, punchfilter
| (Punch Filter) This article introduces the code implementation of a cross-printing effect. As for the principle, it is not cumbersome. Let's look at the code: int f_TPunchFilter (unsigned char * srcData, int width, int height, int stride, unsigned char * dstData, int dw, int dh, int dStride) {if (srcData = NULL | dstData = NULL) return-1; unsigned char * pSrc = srcData; unsigned char * pDst = dstData; int I, j, gray, value, r, g, B; int offset = stride-width * 4; int rMap [256], gMap [256], bMap [256]; for (int I = 0; I <256; I ++) {value = I <128? I: 256-I; gray = value * value/16384; rMap [I] = I <128? Gray: 256-gray; gray = value * value/128; gMap [I] = I <128? Gray: 256-gray; bMap [I] = I/2 + 0x25;} for (j = 0; j ,
Source image
Cross Printing Finally put a complete C # program DEMO download connection: http://www.zealpixel.com/thread-68-1-1.html |
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.