Beispiel #1
0
 /// <summary>
 /// Creates a mask with given <paramref name="maskChannels"/> active and of given <paramref name="width"/> and <paramref name="height"/>.
 /// </summary>
 /// <param name="maskChannels">Which channels in the mask should be activated.</param>
 /// <param name="width">Width of image.</param>
 /// <param name="height">Height of image.</param>
 public void CreateMask(MaskChannel maskChannels, int width, int height)
 {
     ClearMask();
     ddsMask = new DdsFile();
     ddsMask.CreateImage(
         MaskChannelToByte(maskChannels, MaskChannel.C1),
         MaskChannelToByte(maskChannels, MaskChannel.C2),
         MaskChannelToByte(maskChannels, MaskChannel.C3),
         MaskChannelToByte(maskChannels, MaskChannel.C4),
         width, height, false);
 }
Beispiel #2
0
 byte MaskChannelToByte(MaskChannel value, MaskChannel test, byte bTrue = 255, byte bFalse = 0) { return (value & test) != 0 ? bTrue : bFalse; }
Beispiel #3
0
 /// <summary>
 /// Creates a mask with given <paramref name="maskChannels"/> active and of given <paramref name="width"/> and <paramref name="height"/>.
 /// </summary>
 /// <param name="maskChannels">Which channels in the mask should be activated.</param>
 /// <param name="width">Width of image.</param>
 /// <param name="height">Height of image.</param>
 public void CreateMask(MaskChannel maskChannels, int width, int height)
 {
     ClearMask();
     ddsMask = new DdsFile();
     ddsMask.CreateImage(
         MaskChannelToByte(maskChannels, MaskChannel.C1),
         MaskChannelToByte(maskChannels, MaskChannel.C2),
         MaskChannelToByte(maskChannels, MaskChannel.C3),
         MaskChannelToByte(maskChannels, MaskChannel.C4),
         width, height, false);
 }
Beispiel #4
0
 /// <summary>
 /// Creates a mask with given <paramref name="maskChannels"/> active and of given <paramref name="size"/>.
 /// </summary>
 /// <param name="maskChannels">Which channels in the mask should be activated.</param>
 /// <param name="size">Size of image.</param>
 public void CreateMask(MaskChannel maskChannels, Size size)
 {
     CreateMask(maskChannels, size.Width, size.Height);
 }
Beispiel #5
0
 /// <summary>
 /// Creates a mask with given <paramref name="maskChannels"/> active and of given <paramref name="size"/>.
 /// </summary>
 /// <param name="maskChannels">Which channels in the mask should be activated.</param>
 /// <param name="size">Size of image.</param>
 public void CreateMask(MaskChannel maskChannels, Size size)
 {
     CreateMask(maskChannels, size.Width, size.Height);
 }
Beispiel #6
0
 byte MaskChannelToByte(MaskChannel value, MaskChannel test, byte bTrue = 255, byte bFalse = 0)
 {
     return((value & test) != 0 ? bTrue : bFalse);
 }