Leaked source code of windows server 2003
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.

171 lines
3.0 KiB

  1. /**************************************************************************\
  2. *
  3. * Copyright (c) 1999-2000 Microsoft Corporation
  4. *
  5. * Module name:
  6. *
  7. * The "Copy" scan operation.
  8. *
  9. * Abstract:
  10. *
  11. * See Gdiplus\Specs\ScanOperation.doc for an overview.
  12. *
  13. * Scan operations for copying a scan. Because the operation doesn't need
  14. * to interpret the pixel data, we only need one function per pixel
  15. * size (in bits).
  16. *
  17. * Notes:
  18. *
  19. * The destination and source scans must not overlap in memory.
  20. *
  21. * Revision History:
  22. *
  23. * 05/13/1999 davidx
  24. * Created it.
  25. * 12/02/1999 agodfrey
  26. * Moved it from Imaging\Api\convertfmt.cpp.
  27. *
  28. \**************************************************************************/
  29. #include "precomp.hpp"
  30. /**************************************************************************\
  31. *
  32. * Operation Description:
  33. *
  34. * Copy: Copy a scan, to the same destination format.
  35. *
  36. * Arguments:
  37. *
  38. * dst - The destination scan (same format as src)
  39. * src - The source scan
  40. * count - The length of the scan, in pixels
  41. * otherParams - Additional data. (Ignored.)
  42. *
  43. * Return Value:
  44. *
  45. * None
  46. *
  47. * History:
  48. *
  49. * 05/13/1999 davidx
  50. * Created it.
  51. * 12/02/1999 agodfrey
  52. * Moved & reorganized it.
  53. *
  54. \**************************************************************************/
  55. // Copy 1bpp
  56. VOID FASTCALL
  57. ScanOperation::Copy_1(
  58. VOID *dst,
  59. const VOID *src,
  60. INT count,
  61. const OtherParams *otherParams
  62. )
  63. {
  64. GpMemcpy(dst, src, (count + 7) >> 3);
  65. }
  66. // Copy 4bpp
  67. VOID FASTCALL
  68. ScanOperation::Copy_4(
  69. VOID *dst,
  70. const VOID *src,
  71. INT count,
  72. const OtherParams *otherParams
  73. )
  74. {
  75. GpMemcpy(dst, src, (4*count + 4) >> 3);
  76. }
  77. // Copy 8bpp
  78. VOID FASTCALL
  79. ScanOperation::Copy_8(
  80. VOID *dst,
  81. const VOID *src,
  82. INT count,
  83. const OtherParams *otherParams
  84. )
  85. {
  86. GpMemcpy(dst, src, count);
  87. }
  88. // Copy 16bpp
  89. VOID FASTCALL
  90. ScanOperation::Copy_16(
  91. VOID *dst,
  92. const VOID *src,
  93. INT count,
  94. const OtherParams *otherParams
  95. )
  96. {
  97. GpMemcpy(dst, src, 2*count);
  98. }
  99. // Copy 24bpp
  100. VOID FASTCALL
  101. ScanOperation::Copy_24(
  102. VOID *dst,
  103. const VOID *src,
  104. INT count,
  105. const OtherParams *otherParams
  106. )
  107. {
  108. GpMemcpy(dst, src, 3*count);
  109. }
  110. // Copy 32bpp
  111. VOID FASTCALL
  112. ScanOperation::Copy_32(
  113. VOID *dst,
  114. const VOID *src,
  115. INT count,
  116. const OtherParams *otherParams
  117. )
  118. {
  119. DEFINE_POINTERS(ARGB, ARGB)
  120. while (count--)
  121. {
  122. *d++ = *s++;
  123. }
  124. }
  125. // Copy 48bpp
  126. VOID FASTCALL
  127. ScanOperation::Copy_48(
  128. VOID *dst,
  129. const VOID *src,
  130. INT count,
  131. const OtherParams *otherParams
  132. )
  133. {
  134. GpMemcpy(dst, src, 6*count);
  135. }
  136. // Copy 64bpp
  137. VOID FASTCALL
  138. ScanOperation::Copy_64(
  139. VOID *dst,
  140. const VOID *src,
  141. INT count,
  142. const OtherParams *otherParams
  143. )
  144. {
  145. DEFINE_POINTERS(ARGB64, ARGB64)
  146. while (count--)
  147. {
  148. *d++ = *s++;
  149. }
  150. }