示例#1
0
//--------------------------------------------------------------------------
void VeWindows::InitDisplayModes()
{
	DISPLAY_DEVICE kDevice;
	kDevice.cb = sizeof(DISPLAY_DEVICE);
	for(VeInt32 i32Pass(0); i32Pass < 2; ++i32Pass)
	{
		for(VeDWord i(0); ; ++i)
		{
			VeChar8 acDeviceName[32];
			if(!EnumDisplayDevicesA(NULL, i, &kDevice, 0)) 
				break;
			if(!(kDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
				continue;
			if(i32Pass == 0)
			{
				if(!(kDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE))
					continue;
			}
			else
			{
				if(kDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
					continue;
			}
			VeStrcpy(acDeviceName, kDevice.DeviceName);
			VeDWord dwCount(0);
			for(VeDWord j(0); ; ++j)
			{
				if(!EnumDisplayDevices(acDeviceName, j, &kDevice, 0))
					break;
				if(!(kDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
					continue;
				if(i32Pass == 0)
				{
					if(!(kDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE))
						continue;
				}
				else
				{
					if(kDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
						continue;
				}
				dwCount += AddDisplay(kDevice.DeviceName);
			}
			if(dwCount == 0)
			{
				AddDisplay(acDeviceName);
			}
		}
	}
	VE_ASSERT(m_kDisplays.Size());
}
THISCLASS::ComponentOutputImageStatisticsGray(SwisTrackCore *stc):
		Component(stc, wxT("OutputImageStatisticsGray")),
		mCalculateNonZero(true), mCalculateSum(true), mCalculateMeanStdDev(true), mCalculateMinMax(true),
		mDisplayOutput(wxT("Output"), wxT("Image Statistics: Input Frame")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryOutput);
	AddDisplay(&mDisplayOutput);
	AddDataStructureRead(&(mCore->mDataStructureImageGray));

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentOutputImageOverlayColor(SwisTrackCore *stc):
		Component(stc, wxT("OutputImageOverlayColor")),
		mFinalImage(0), mMode(sMode_Addition),
		mDisplayOutput(wxT("Output"), wxT("Image overlay")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryOutput);
	AddDataStructureRead(&(mCore->mDataStructureImageColor));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentInputCamera1394(SwisTrackCore *stc):
		Component(stc, wxT("InputCamera1394")),
		mCamera(), mOutputImage(0), mFrameNumber(0),
		mDisplayOutput(wxT("Output"), wxT("1394 Camera: Input Frame")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryInput);
	AddDataStructureWrite(&(mCore->mDataStructureInput));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentGrayMask(SwisTrackCore *stc):
		Component(stc, wxT("GrayMask")),
		mMaskImage(0),
		mDisplayOutput(wxT("Output"), wxT("After applying mask")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryPreprocessingGray);
	AddDataStructureRead(&(mCore->mDataStructureImageGray));
	AddDataStructureWrite(&(mCore->mDataStructureImageGray));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentBinaryErosion(SwisTrackCore *stc):
		Component(stc, wxT("BinaryErosion")),
		mIterations(1),
		mDisplayOutput(wxT("Output"), wxT("After erosion")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryPreprocessingBinary);
	AddDataStructureRead(&(mCore->mDataStructureImageBinary));
	AddDataStructureWrite(&(mCore->mDataStructureImageBinary));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentInvertBinary(SwisTrackCore *stc):
		Component(stc, wxT("InvertBinary")),
		mOutputImage(0),
		mDisplayOutput(wxT("Output"), wxT("Invert binary image.")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryPreprocessingBinary);
	AddDataStructureRead(&(mCore->mDataStructureImageBinary));
	AddDataStructureWrite(&(mCore->mDataStructureImageBinary));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentBlobDetectionMinMax(SwisTrackCore *stc):
		Component(stc, wxT("BlobDetectionMinMax")),
		mMinArea(0), mMaxArea(1000000), mMaxNumber(10), mParticles(),
		mDisplayOutput(wxT("Output"), wxT("Particles")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryParticleDetection);
	AddDataStructureRead(&(mCore->mDataStructureImageBinary));
	AddDataStructureWrite(&(mCore->mDataStructureParticles));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentThresholdColorIndependent(SwisTrackCore *stc):
    Component(stc, wxT("ThresholdColorIndependent")),
    mOutputImage(0), mBlueThreshold(128), mGreenThreshold(128), mRedThreshold(128), mOrBool(true), mInvertThreshold(false),
    mDisplayOutput(wxT("Output"), wxT("After thresholding")) {

    // Data structure relations
    mCategory = &(mCore->mCategoryThresholdingColor);
    AddDataStructureRead(&(mCore->mDataStructureImageColor));
    AddDataStructureWrite(&(mCore->mDataStructureImageBinary));
    AddDisplay(&mDisplayOutput);

    // Read the XML configuration file
    Initialize();
}
THISCLASS::ComponentBackgroundSubtractionColor(SwisTrackCore *stc):
		Component(stc, wxT("BackgroundSubtractionColor")),
		mBackgroundImage(0), mBackgroundImageMean(cvScalarAll(0)), mCorrectMean(true),
		mDisplayOutput(wxT("Output"), wxT("After background subtraction")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryPreprocessingColor);
	AddDataStructureRead(&(mCore->mDataStructureImageColor));
	AddDataStructureWrite(&(mCore->mDataStructureImageColor));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentConvertBayerToColor(SwisTrackCore *stc):
		Component(stc, wxT("ConvertBayerToColor")),
		mBayerType(0), mOutputImage(0),
		mDisplayOutput(wxT("Output"), wxT("After conversion from Bayer to BGR")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryInputConversion);
	AddDataStructureRead(&(mCore->mDataStructureImageGray));
	AddDataStructureWrite(&(mCore->mDataStructureImageColor));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentInputFileAVI(SwisTrackCore *stc):
		Component(stc, wxT("InputFileAVI")),
		mFlipVertically(false),
		mCapture(0), mOutputImage(0),
		mDisplayOutput(wxT("Output"), wxT("AVI File: Unprocessed Frame")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryInput);
	AddDataStructureWrite(&(mCore->mDataStructureInput));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
示例#13
0
THISCLASS::ComponentColorBlur(SwisTrackCore *stc):
		Component(stc, wxT("ColorBlur")),
		mBlurType(CV_GAUSSIAN), mRadius(1),
		mDisplayOutput(wxT("Output"), wxT("After blurring the image")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryPreprocessingColor);
	AddDataStructureRead(&(mCore->mDataStructureImageColor));
	AddDataStructureWrite(&(mCore->mDataStructureImageColor));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentSimulationParticles(SwisTrackCore *stc):
		Component(stc, wxT("SimulationParticles")),
		mCameraOrigin(cvPoint2D32f(0, 0)), mCameraRotation(0), mCameraPixelSize(1), mCameraSize(cvSize2D32f(640, 480)),
		mSimulationParticles(0), mParticles(),
		mDisplayOutput(wxT("Output"), wxT("Particle Simulation: Output")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryParticleDetection);
	AddDataStructureWrite(&(mCore->mDataStructureInput));
	AddDataStructureWrite(&(mCore->mDataStructureParticles));
	AddDisplay(&mDisplayOutput);

	// Read the XML configuration file
	Initialize();
}
THISCLASS::ComponentOutputFileAVI(SwisTrackCore *stc):
		Component(stc, wxT("OutputFileAVI")),
		mWriter(0), mFrameRate(15), mInputSelection(0), mFrameBufferCount(1), mFrameBuffer(0), mFrameBufferWriteCounter(0), codecString(wxString(wxT("Def."))),
		mDisplayOutput(wxT("Output"), wxT("AVI File: Unprocessed Frame")) {

	// Data structure relations
	mCategory = &(mCore->mCategoryOutput);
	AddDisplay(&mDisplayOutput);
	AddDataStructureRead(&(mCore->mDataStructureImageGray));
	AddDataStructureRead(&(mCore->mDataStructureImageColor));
	AddDataStructureRead(&(mCore->mDataStructureImageBinary));

	// Read the XML configuration file
	Initialize();
}
//-------------------------------------------------------------------------
void CCocos2dxDBDisplayBridge::SetDisplay( IObject* p_pValue )
{
	CCSprite* pParent = NULL;
	int nZOrder = 0;
	if( m_pDisplayNode )
	{
		pParent = (CCSprite*)m_pDisplayNode->GetNode()->getParent();
		nZOrder = m_pDisplayNode->GetNode()->getZOrder();

		RemoveDisplay();
	}
	m_pDisplay		= p_pValue;
	m_pDisplayNode	= dynamic_cast<CCocos2dxDBObj*>( p_pValue );

	if( m_pDisplayNode && pParent )
	{
		CCocos2dxDBObj tagParentNode( pParent );
		AddDisplay( &tagParentNode, nZOrder );
	}
}
示例#17
0
//--------------------------------------------------------------------------
void WindowsVideoDevice::InitModes() noexcept
{
	VeInt32 pass;
	DWORD i, j, count;
	DISPLAY_DEVICEA device;

	device.cb = sizeof(device);

	for (pass = 0; pass < 2; ++pass)
	{
		for (i = 0;; ++i)
		{
			CHAR DeviceName[32];

			if (!EnumDisplayDevicesA(nullptr, i, &device, 0))
			{
				break;
			}
			if (!(device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
			{
				continue;
			}
			if (pass == 0)
			{
				if (!(device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE))
				{
					continue;
				}
			}
			else
			{
				if (device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
				{
					continue;
				}
			}
			VeMemoryCopy(DeviceName, device.DeviceName, sizeof(DeviceName));

			VeDebugOutputCore("Device: %s\n", DeviceName);

			count = 0;
			for (j = 0;; ++j)
			{
				if (!EnumDisplayDevicesA(DeviceName, j, &device, 0))
				{
					break;
				}
				if (!(device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
				{
					continue;
				}
				if (pass == 0)
				{
					if (!(device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE))
					{
						continue;
					}
				}
				else {
					if (device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
					{
						continue;
					}
				}
				count += AddDisplay(device.DeviceName);
			}
			if (count == 0)
			{
				AddDisplay(DeviceName);
			}
		}
	}

	VE_ASSERT(m_kDisplayList.size());
}