Exemplo n.º 1
0
 /// <summary>
 /// Apply <see cref="HSVShift"/> values to the image, based on the
 /// channels in the <paramref name="mask"/>.
 /// </summary>
 /// <param name="mask">The <see cref="System.IO.Stream"/> containing the DDS image to use as a mask.</param>
 /// <param name="ch1Shift">A shift to apply to the image when the first channel of the mask is active.</param>
 /// <param name="ch2Shift">A shift to apply to the image when the second channel of the mask is active.</param>
 /// <param name="ch3Shift">A shift to apply to the image when the third channel of the mask is active.</param>
 /// <param name="ch4Shift">A shift to apply to the image when the fourth channel of the mask is active.</param>
 /// <param name="blend">When true, each channel's shift adds; when false, each channel's shift overrides.</param>
 public void ApplyHSVShift(Stream mask, HSVShift ch1Shift, HSVShift ch2Shift, HSVShift ch3Shift, HSVShift ch4Shift, bool blend)
 {
     if (!SupportsHSV)
     {
         return;
     }
     LoadMask(mask);
     ApplyHSVShift(ch1Shift, ch2Shift, ch3Shift, ch4Shift, blend);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Apply a hue, saturation and value shift to the image.
 /// </summary>
 /// <param name="h">Hue shift, default 0</param>
 /// <param name="s">Saturation shift, default 0</param>
 /// <param name="v">Value shift, default 0</param>
 public void HSVShift(decimal h = 0, decimal s = 0, decimal v = 0)
 {
     hsvShift = new HSVShift {
         h = (float)h, s = (float)s, v = (float)v,
     };
     if (SupportsHSV)
     {
         ckb_CheckedChanged(null, null);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Apply <see cref="HSVShift"/> values to the image, based on the
        /// channels in the currently loaded mask.
        /// </summary>
        /// <param name="ch1Shift">A shift to apply to the image when the first channel of the mask is active.</param>
        /// <param name="ch2Shift">A shift to apply to the image when the second channel of the mask is active.</param>
        /// <param name="ch3Shift">A shift to apply to the image when the third channel of the mask is active.</param>
        /// <param name="ch4Shift">A shift to apply to the image when the fourth channel of the mask is active.</param>
        /// <param name="blend">When true, each channel's shift adds; when false, each channel's shift overrides.</param>
        public void ApplyHSVShift(HSVShift ch1Shift, HSVShift ch2Shift, HSVShift ch3Shift, HSVShift ch4Shift, bool blend)
        {
            if (!SupportsHSV || !MaskLoaded)
            {
                return;
            }
            if (blend)
            {
                ddsFile.MaskedHSVShift(ddsMask, ch1Shift, ch2Shift, ch3Shift, ch4Shift);
            }
            else
            {
                ddsFile.MaskedHSVShiftNoBlend(ddsMask, ch1Shift, ch2Shift, ch3Shift, ch4Shift);
            }

            ckb_CheckedChanged(null, null);
        }