pdc32.h

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· C头文件 代码 · 共 82 行

H
82
字号
//
// Windows CE Software Graphics Library
// pdc32.h
//
// Copyright (c) 2000 Microsoft Corporation. All rights reserved.
//
// This header file contains the function template for special case blit
// fill routines with 32 Bpp destinations and constant fill values.

#if !defined(FUNCTION)
#error Must define FUNCTION
#endif

#if !defined(BLOCK_OP) && !defined(DWORD_OP)
#error Must define either BLOCK_OP or DWORD_OP
#endif

#if defined(BLOCK_OP) && defined(DWORD_OP)
#error Cannot define both BLOCK_OP and DWORD_OP
#endif

BOOL 
FUNCTION(
  BLT_PARAM * Parameters
  )
{
  // Local variables.

  // Destination-related info.

  const RECT * DstRect = Parameters->DestRect;
  LONG         DstScanStride  = Parameters->Destination->Stride / sizeof(DWORD);
  DWORD      * DstScanLine = (DWORD *)Parameters->Destination->Ptr +
                             DstRect->top * DstScanStride  +
                             DstRect->left;

  DWORD Color = Parameters->FillValue;

  ULONG Rows = RectHeight(DstRect);
  ULONG Cols = RectWidth(DstRect);

  ULONG Row;

  // Check parameters.

  // !TODO!

#ifdef DWORD_OP

  DWORD * DstPixel;
  DWORD * Lim;

  for (Row = 0; Row < Rows; Row++) {

    DstPixel = DstScanLine;
    Lim      = DstPixel + Cols;

    while (DstPixel < Lim) {

      *DstPixel = DWORD_OP(*DstPixel, Color);
      DstPixel++;
      SrcPixel++;
    }

    DstScanLine += DstScanStride;
  }

#endif

#ifdef BLOCK_OP

  for (Row = 0; Row < Rows; Row++) {

    BLOCK_OP(DstScanLine, Color, (Cols * sizeof(DWORD)));
    DstScanLine += DstScanStride;
  }

#endif

  return TRUE;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?