Skip to content

Commit

Permalink
Merge pull request #52 from AllenNeuralDynamics/51-setting-gamma-valu…
Browse files Browse the repository at this point in the history
…e-when-gamma-is-disable-throws-an-exception-from-spinnaker-api

Fix order by which cmaera settings are set
  • Loading branch information
bruno-f-cruz authored Jun 25, 2024
2 parents d2b6c89 + ac81b10 commit 6365a99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected override void Configure(IManagedCamera camera)
{
try { camera.AcquisitionStop.Execute(); }
catch { }
camera.PixelFormat.Value = PixelFormat.ToString();
camera.BinningSelector.Value = BinningSelectorEnums.All.ToString();
camera.BinningHorizontalMode.Value = BinningHorizontalModeEnums.Sum.ToString();
camera.BinningVerticalMode.Value = BinningVerticalModeEnums.Sum.ToString();
Expand All @@ -55,9 +56,15 @@ protected override void Configure(IManagedCamera camera)
camera.DeviceLinkThroughputLimit.Value = camera.DeviceLinkThroughputLimit.Max;
camera.GainAuto.Value = GainAutoEnums.Off.ToString();
camera.Gain.Value = Gain;
camera.Gamma.Value = Gamma.HasValue ? Gamma.Value : 1.0;
camera.GammaEnable.Value = Gamma.HasValue;
camera.PixelFormat.Value = PixelFormat.ToString();

if (Gamma.HasValue){
camera.GammaEnable.Value = true;
camera.Gamma.Value = Gamma.Value;
}
else{
camera.GammaEnable.Value = false;
}

base.Configure(camera);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageTags>Bonsai Rx Core AllenNeuralDynamics</PackageTags>
<TargetFramework>net472</TargetFramework>
<Features>strict</Features>
<Version>0.1.4</Version>
<Version>0.1.5</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#version 400

uniform float brightness = 1.0;
uniform float contrast = 1.0;
uniform float brightness = 0.0; // -1.0 to 1.0. 0.0 is no change
uniform float contrast = 1.0; // -1.0 to 1.0. 1.0 is maximum contrast, 0.0 is gray, -1.0 is maximum inverted contrast
uniform vec2 shift;
uniform vec2 scale = vec2(1, 1);

Expand Down

0 comments on commit 6365a99

Please sign in to comment.