Example #1
0
void Flea3Camera::Configure(Config& config) {
  // Video Mode
  SetVideoMode(config.video_mode, config.format7_mode, config.pixel_format,
               config.width, config.height);

  // Update CameraInfo here after video mode is changed
  camera_info_ = GetCameraInfo(camera_);

  // Frame Rate
  SetFrameRate(config.fps);

  // Raw Bayer
  SetRawBayerOutput(config.raw_bayer_output);

  // White Balance
  SetWhiteBalanceRedBlue(config.white_balance, config.auto_white_balance,
                         config.wb_red, config.wb_blue);

  // Exposure
  SetExposure(config.exposure, config.auto_exposure, config.exposure_value);
  SetShutter(config.auto_shutter, config.shutter_ms);
  SetGain(config.auto_gain, config.gain_db);

  SetBrightness(config.brightness);
  SetGamma(config.gamma);

  // Strobe
  SetStrobe(config.strobe_control, config.strobe_polarity);
  // Trigger
  SetTrigger(config.trigger_source, config.trigger_polarity);

  // Save this config
  config_ = config;
}
void MonitorEx::OnUnIconify( void ) {
	if ( iconified ) {
		modified = SetMode( currentMode, fsWindow );
		iconified = false;
		SetGamma( desiredGamma );
	}
}
Example #3
0
func Initialize()
{
  var iTimeout,pWipf;
  SetGamma(RGB(15,15,15),RGB(118,118,118),RGB(215,215,215));
  SetSkyParallax(0,15,17,0,0,0,0); 
  //Handgemacht... ;)
  Meeresrauschen(170);
  Meeresrauschen(1100);
  Meeresrauschen(2060);
  Meeresrauschen(2900);
  Meeresrauschen(3800);
  Meeresrauschen(4800);
  Meeresrauschen(5700);
  Moewen(900);
  Moewen(2300);
  Moewen(3900);
  Moewen(5000);
  //Nebel platzieren
  for(var i;i<260;++i) 
    CreateParticle("Fog",Random(LandscapeWidth()),Random(LandscapeHeight()*2/3),RandomX(3,9),0,RandomX(1000,1500));
  //Wipfe platzieren
  while(pWipf=FindObject(WIPF,0,0,0,0,0,0,0,0,pWipf)) {
    iTimeout=0;
    while(Stuck(pWipf)||GetMaterial(GetX(pWipf),GetY(pWipf))!=Material("Tunnel")) {
      SetPosition(Random(LandscapeWidth()),RandomX(LandscapeHeight()*2/3,LandscapeHeight()),pWipf);
      if(iTimeout++ > 50000) { RemoveObject(pWipf); break; }
    }
  }  
  ScriptGo(1);
}
Example #4
0
void HandleKeyPresses(void)
{
	char k;

	k = gamemgl->LastKeyPressed();
	if (k)
	{
		lastKey = k;
		if ((lastKey >= 'a' && lastKey <= 'z') || (lastKey >= 'A' && lastKey <= 'Z'))
			CheatKey(lastKey);
	}
#ifdef _DEBUG
	// can't show stats unless in debug mode
	if (lastKey == 's')
	{
		showStats = 1 - showStats;
		lastKey = 0;
	}
#endif
	if (lastKey == 'g')
	{
		k = GetGamma();
		k++;
		if (k > 3)
			k = 0;
		gamemgl->GammaCorrect(k);
		SetGamma(k);
		lastKey = 0;
	}

}
Example #5
0
func FxFlashPlayersTimer(object pTarget, int iEffectNumber, int iEffectTime) 
{
	var change = iEffectTime*5;
	var darkcolors = 255-change;
	var middlecolors = 255-change/2;
	SetGamma(RGB(darkcolors, darkcolors, darkcolors), RGB(middlecolors, middlecolors, middlecolors), RGB(255,255,255), 5);
	if(darkcolors <= 0) return(-1);
}
Example #6
0
global func FxWaterTimer(pObj,iNum,iA)
{
  iA*=2;
  SetGamma(
    RGB(0,   0,   SinX(iA,20,100)),
    RGB(100, 100, CosX(iA,140,160)),
    RGB(200, 200, CosX(iA,220,255))
  );
}
Example #7
0
OSStatus	FadeToGamma( ScreenRef screen, const RLGammaTable *newGamma, float seconds )
{
	if( ! newGamma )
		return paramErr;

	DEBUGMESSAGE( "Fading to new gamma over " << seconds << " seconds." );

	//Calculate the starting and ending time for out fade
	double startTime = GetCurrentTime();
	double endTime = startTime + seconds;
	
	//Determine our starting gamma
	RLGammaTable	oldGamma, currentGamma;
	OSStatus error = GetGamma( screen, &oldGamma );
	if( error )
		return error;

	//Loop until we run out of time, resetting the gamma as fast as possible
	for( double currentTime = GetCurrentTime(); currentTime < endTime && ! error; currentTime = GetCurrentTime() )
	{
		//The fraction is the percentage of time that we have spend so far in this loop as a value between 0 and 1.0
		double fraction = (currentTime - startTime) / seconds;	
		
		//Calculate the new gamma based on the amount of time spent so far
		//(1-fraction)startGamma + fraction * endGamma = startGamma + fraction( endGamma - startGamma)
		for( int i = 0; i < kGammaTableEntryCount; i++ )
		{
			currentGamma.red[i] = oldGamma.red[i] + fraction * (newGamma->red[i] - oldGamma.red[i]);
			currentGamma.green[i] = oldGamma.green[i] + fraction * (newGamma->green[i] - oldGamma.green[i]);
			currentGamma.blue[i] = oldGamma.blue[i] + fraction * (newGamma->blue[i] - oldGamma.blue[i]);		
		}
		
		error = SetGamma( screen, &currentGamma );
	}
	
	if( error )
		DEBUGMESSAGE( "Got error # " << error << " doing a gamma fade in FadeToGamma(). Attempting to achieve the final gamma...." );
		
	return SetGamma( screen, newGamma );
}
Example #8
0
void CGameOptions::EnsureSettings() {
  SetScreenBrightness(x48_screenBrightness, true);
  SetGamma(m_gamma, true);
  SetScreenPositionX(x4c_screenXOffset, true);
  SetScreenPositionY(x50_screenYOffset, true);
  SetScreenStretch(x54_screenStretch, true);
  SetSfxVolume(x58_sfxVol, true);
  SetMusicVolume(x5c_musicVol, true);
  SetSurroundMode(int(x44_soundMode), true);
  SetHelmetAlpha(x64_helmetAlpha);
  SetHUDLag(x68_24_hudLag);
  SetInvertYAxis(x68_25_invertY);
  SetIsRumbleEnabled(x68_26_rumble);
  SetIsHintSystemEnabled(x68_28_hintSystem);
  SetSwapBeamControls(x68_27_swapBeamsControls);
}
//*************************************************
FX_ENTRY void FX_CALL
grGammaCorrectionValue( float value )
{
#ifdef OGL_PARTDONE
    GlideMsg( "grGammaCorrectionValue( %f )\n", value );
#endif
    RenderDrawTriangles();

    OpenGL.Gamma = value;

    SetGamma(value);

#ifdef OPENGL_DEBUG
    GLErro( "grGammaCorrectionValue" );
#endif
}
Example #10
0
bool BaseV4L2VideoCapture::SetCaptureFiltersToDefault() {
  if(!SetBrightness(_pVideoCaptureFiltersCapability->GetBrightnessConstraint().dflt))
    return false;
  if(!SetContrast(_pVideoCaptureFiltersCapability->GetContrastConstraint().dflt))
    return false;
  if(!SetHUE(_pVideoCaptureFiltersCapability->GetHueConstraint().dflt))
    return false;
  if(!SetSaturation(_pVideoCaptureFiltersCapability->GetSaturationConstraint().dflt))
    return false;
  if(!SetSharpness(_pVideoCaptureFiltersCapability->GetSharpnessConstraint().dflt))
    return false;
  if(!SetGamma(_pVideoCaptureFiltersCapability->GetGammaConstraint().dflt))
    return false;
  if(!SetBacklightCompensation(_pVideoCaptureFiltersCapability->GetBacklightCompensationConstraint().dflt))
    return false;

  return true;
}
Example #11
0
func FxFlashPlayersStart(object pTarget, int iEffectNumber) 
{
	SetGamma(RGB(255,255,255), RGB(255,255,255), RGB(255,255,255), 5);
}
Example #12
0
func FxFlashPlayersStart(object pTarget, proplist pEffect) 
{
	SetGamma(RGB(255,255,255), RGB(255,255,255), RGB(255,255,255), 5);
}
Example #13
0
/* Do a gamma fade to the gamma table provided over the time period desired	*/
OSStatus		FadeToGammaMultiple( ScreenRef *screen, unsigned int count, const RLGammaTable *newGamma, float seconds )
{
	int i;
	OSStatus error = noErr;

	if( ! newGamma )
		return paramErr;

	//Calculate the starting and ending time for out fade
	double startTime = GetCurrentTime();
	double endTime = startTime + seconds;
	
	//Determine our starting gamma
	RLGammaTable	*oldGamma = (RLGammaTable*) NewPtr( sizeof( RLGammaTable ) * count );
	RLGammaTable	*currentGamma = (RLGammaTable*) NewPtr( sizeof( RLGammaTable ) * count );
	
	if( NULL == oldGamma || NULL == currentGamma )
	{
		if( NULL != oldGamma )
			DisposePtr( Ptr( oldGamma ) );
		if( NULL != currentGamma )
			DisposePtr( Ptr( currentGamma ) );	
	
		return rlOutOfMemory;
	}
		
	for( i = 0; i < count; i++ )
	{
		error = GetGamma( screen[i], &oldGamma[i] );
		if( noErr != error )
			goto exit;
	}
	

	//Loop until we run out of time, resetting the gamma as fast as possible
	for( double currentTime = GetCurrentTime(); currentTime < endTime; currentTime = GetCurrentTime() )
	{
		//The fraction is the percentage of time that we have spend so far in this loop as a value between 0 and 1.0
		double fraction = (currentTime - startTime) / seconds;	
		
		for( i = 0; i < count; i++ )
		{
			
			//Calculate the new gamma based on the amount of time spent so far
			//(1-fraction)startGamma + fraction * endGamma = startGamma + fraction( endGamma - startGamma)
			for( int j = 0; j < kGammaTableEntryCount; j++ )
			{
				currentGamma[i].red[j] = oldGamma[i].red[j] + fraction * (newGamma[i].red[j] - oldGamma[i].red[j]);
				currentGamma[i].green[j] = oldGamma[i].green[j] + fraction * (newGamma[i].green[j] - oldGamma[i].green[j]);
				currentGamma[i].blue[j] = oldGamma[i].blue[j] + fraction * (newGamma[i].blue[j] - oldGamma[i].blue[j]);		
			}
			
			error = SetGamma( screen[i], &currentGamma[i] );
	
			if( noErr != error )
				goto finish;
		}

	}

finish:	
	if( error )
		DEBUGMESSAGE( "Got error # " << error << " doing a gamma fade in FadeToGamma(). Attempting to achieve the final gamma...." );
		
	for( i = 0; i < count; i++ )
		 SetGamma( screen[i], &newGamma[i] );

exit:
	DisposePtr( Ptr( oldGamma ) );
	DisposePtr( Ptr( currentGamma ) );

	return error;
}
Example #14
0
BOOL SetGamma(double gamma)
{
	return SetGamma(gamma, gamma, gamma);
}
Example #15
0
public func Initialize() {
  SetGamma(RGB(0,0,0),RGB(68,68,83),RGB(147,147,173));
  for(var y=0; y<LandscapeHeight(); (y+=510) && (x=0))
	for(var x=0; x<LandscapeWidth(); x+=530)
		ObjectSetAction(CreateObject(_CSN,x,y,-1),Format("Wait%d",Random(4)));
}
Example #16
0
protected func Initialize()
{
  SetGamma(RGB(10,9,10), RGB(161,157,159), RGB(255,254,255) );
}
Example #17
0
protected func Initialize()
{
  SetGamma(RGB(0,20,0), RGB(128,156,128), RGB(222,255,222) );
}
Example #18
0
func Initialize() {
  SetSkyAdjust(RGBa(117,103,116,127), RGB(244,181,184));
  SetGamma(RGB(50,0,0), RGB(140,100,100), RGB(255,220,220));
  DigBuildingsFree();
  return(1);
}
Example #19
0
void CPaletteManager::Init (void)
{
memset (&m_data, 0, sizeof (m_data));
SetGamma (-1);
m_save.Create (10);
}