OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.6 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../fbgrab/565-fixup.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. Fixed fbgrab for big-endian systems, including a code cleanup on the way.
  17. - Rene Rebe
  18. --- fbgrab-1.0/fbgrab.c 2002-04-15 22:22:54.000000000 +0200
  19. +++ fbgrab-1.0-fixed/fbgrab.c 2004-09-05 16:12:42.874276472 +0200
  20. @@ -166,15 +166,17 @@
  21. for (i=0; i < (unsigned int) height*width*2; i+=2)
  22. {
  23. - /* BLUE = 0 */
  24. - outbuffer[(i<<1)+0] = (inbuffer[i] & 0x1f) << 3;
  25. - /* GREEN = 1 */
  26. - outbuffer[(i<<1)+1] = (((inbuffer[i+1] & 0x7) << 3) |
  27. - (inbuffer[i] & 0xE0) >> 5) << 2;
  28. - /* RED = 2 */
  29. - outbuffer[(i<<1)+2] = (inbuffer[i+1] & 0xF8);
  30. - /* ALPHA = 3 */
  31. - outbuffer[(i<<1)+3] = '\0';
  32. + int16_t v =
  33. +#ifdef __BIG_ENDIAN__
  34. + (inbuffer[i] << 8) + inbuffer[i+1];
  35. +#else
  36. + (inbuffer[i+1] << 8) + inbuffer[i];
  37. +#endif
  38. +
  39. + outbuffer[(i<<1)+0] = (v << 3) & 0xf8; /* B */
  40. + outbuffer[(i<<1)+1] = (v >> 3) & 0xfc; /* G */
  41. + outbuffer[(i<<1)+2] = (v >> 8) & 0xf8; /* R */
  42. + outbuffer[(i<<1)+3] = 0; /* A */
  43. }
  44. }