Skip to content

Commit

Permalink
remove noise option from encoder options form
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwedit committed Jul 3, 2022
1 parent 68d6cb2 commit ddc6f32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 58 deletions.
42 changes: 4 additions & 38 deletions JxlExample/EncoderOptionsForm2.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions JxlExample/EncoderOptionsForm2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,12 @@ private void SetOptions()
{
quality = 1;
}
int noiseLevel;
if (!int.TryParse(txtNoise.Text, out noiseLevel))
{
noiseLevel = 0;
}
int keepInvisible = chkPreserveColor.Checked ? 1: 0;

this.EncoderOptions.LossyMode = lossyMode;
this.EncoderOptions.Quality = quality;
this.EncoderOptions.Settings[JxlEncoderFrameSettingId.Effort] = effort;
this.EncoderOptions.Settings[JxlEncoderFrameSettingId.DecodingSpeed] = decodeSpeed;
this.EncoderOptions.Settings[JxlEncoderFrameSettingId.PhotonNoise] = noiseLevel;
this.EncoderOptions.Settings[JxlEncoderFrameSettingId.KeepInvisible] = keepInvisible;
}

Expand All @@ -84,16 +78,6 @@ private void ReadOptions()
decodingSpeed = 0;
}

int photonNoise = 0;
if (this.EncoderOptions.Settings.TryGetValue(JxlEncoderFrameSettingId.PhotonNoise, out photonNoise) && photonNoise != -1)
{

}
else
{
photonNoise = 0;
}

int keepInvisible = 0;
if (this.EncoderOptions.Settings.TryGetValue(JxlEncoderFrameSettingId.KeepInvisible, out keepInvisible) && keepInvisible != -1)
{
Expand Down Expand Up @@ -144,7 +128,6 @@ private void ReadOptions()
}

txtQuality.Text = Math.Round(quality, 4).ToString();
txtNoise.Text = photonNoise.ToString();
chkPreserveColor.Checked = keepInvisible == 1;
}
}
Expand All @@ -159,7 +142,6 @@ public EncoderOptions()
this.LossyMode = JxlLossyMode.Default;
this.Settings[JxlEncoderFrameSettingId.Effort] = 7;
this.Settings[JxlEncoderFrameSettingId.DecodingSpeed] = 0;
this.Settings[JxlEncoderFrameSettingId.PhotonNoise] = 0;
this.Settings[JxlEncoderFrameSettingId.KeepInvisible] = 1;
this.Quality = 1.0f;
}
Expand Down
4 changes: 2 additions & 2 deletions JxlExample/EncoderOptionsForm2.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lblQualityHelp.Text" xml:space="preserve">
<value>Sets the distance level for lossy compression
Expand Down

0 comments on commit ddc6f32

Please sign in to comment.