How To Crop Input Video (Programming Of Acquisition Rectangle) - DIGITAL-LOGIC MICROSPACE PCC-P5 Technical User's Manual

Table of Contents

Advertisement

DIGITAL-LOGIC AG

4.11.10 How to crop input video (programming of acquisition rectangle)

Video acquisition rectangle is used to crop the unwanted video input data before the 6555x hardware scales it and grabs
it into off-screen buffer. This is also used to crop vertical blank interval data (Closed Caption or Tele Text) from the NTSC
video.
//-------------------------------------------------------------------------
// SetCropRect() : Sets cropping rectrangle on input video recctangle.
//
// +----------------+
// | +----------+ |
// | |
| |
// | | CropRect | |
// | |
| |
// | +----------+ |
// | Input Video
|
// +----------------+
//
// Enter:
// lpRect Crop Rectangle withing Input Video rectangle (NTSC/PAL dependent)
// rCrop - local copy of Cropping Rectangle
// bVideoFlowingIn = 0 if video is not flowing into the port, 1 normally.
// Exit :
// Nothing
//-------------------------------------------------------------------------
void SetCropRect(LPRECTL lpRect)
{
UINT mr0e,mr0f,mr10,mr11,mr12,mr13,mr14,mr15;
union WORD16 u;
if(&rCrop != lpRect) rCrop = *lpRect; // copy crop rectangle into our area
if(!bVideoFlowingIn) return;
// Use NULL Rectangle done by static initialization
u.w = (USHORT)((int)rCrop.left);
mr0e = ((UINT)u.b[0] << 8) + MR_VIN_AQW_XL_L;
mr0f = ((UINT)u.b[1] << 8) + MR_VIN_AQW_XL_H;
u.w = (USHORT)((int)rCrop.right -1);
mr10 = ((UINT)u.b[0] << 8) + MR_VIN_AQW_XR_L;
mr11 = ((UINT)u.b[1] << 8) + MR_VIN_AQW_XR_H;
u.w = (USHORT)((int)rCrop.top);
mr12 = ((UINT)u.b[0] << 8) + MR_VIN_AQW_YT_L;
mr13 = ((UINT)u.b[1] << 8) + MR_VIN_AQW_YT_H;
u.w = (USHORT)((int)rCrop.bottom -1);
mr14 = ((UINT)u.b[0] << 8) + MR_VIN_AQW_YB_L;
mr15 = ((UINT)u.b[1] << 8) + MR_VIN_AQW_YB_H;
WritePortUshort(ulMrAddr,mr0e); // program Left
WritePortUshort(ulMrAddr,mr0f);
WritePortUshort(ulMrAddr,mr10); // program right
WritePortUshort(ulMrAddr,mr11);
WritePortUshort(ulMrAddr,mr12); // program top
WritePortUshort(ulMrAddr,mr13);
WritePortUshort(ulMrAddr,mr14); // program bottom
WritePortUshort(ulMrAddr,mr15);
79
PCCP5 Manual V2.3

Advertisement

Table of Contents
loading

Table of Contents