#ifndef lint static char sccsid[] = "@(#)pr_reverse.c 9.2 88/01/19 Copyr 1983 Sun Micro"; #endif /* * Copyright (c) 1983 by Sun Microsystems, Inc. */ /* * Two operations on operations, reversesrc and reversedst, are provided * for adjusting the operation code to take into account video reversing * of either the source or the destination. These are implemented by * table lookup. This process can be iterated, as in * pr_reversedst[pr_reversesrc[op]]. * * Note that the "op" that these tables reverses is shifted down one bit * from the "op" described in the header file. In other words, it's not * what you expect, so look again. FIXME. */ #include #ifdef REF #include #endif #include char pr_reversedst[16] = { /* NB: reverses both input and output */ 15, 13, 14, 12, 7, 5, 6, 4, 11, 9, 10, 8, 3, 1, 2, 0, }; char pr_reversesrc[16] = { /* transpose of the 4x4 identity */ 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, }; /* * NOTE THAT THE FOLLOWING FUNCTION IS ONLY INCLUDED HERE BECAUSE OF * CURRENT SUNWINDOWS DEPENDENCIES IN THE SUN CODE. WHEN SUNWINDOWS * DEPENDENCIES ARE ELIMINATED, THIS FUNCTION SHOULD BE ALSO. */ pr_reversevideo( pr, min, max) struct pixrect *pr; int min, max; { unsigned char bkgnd, frgnd; pr_getcolormap( pr, min, 1, &bkgnd,&bkgnd,&bkgnd); pr_getcolormap( pr, max, 1, &frgnd,&frgnd,&frgnd); pr_putcolormap( pr, max, 1, &bkgnd,&bkgnd,&bkgnd); pr_putcolormap( pr, min, 1, &frgnd,&frgnd,&frgnd); }