예제 #1
0
 public void AddChannel()
 {
     int before = _image.Channels.Count;
       var channel = new Channel(_image, "test", new RGB(0, 255, 0));
       _image.AddChannel(channel);
       Assert.AreEqual(before + 1, _image.Channels.Count);
 }
예제 #2
0
        public void ChannelConstructorThree()
        {
            int before = _image.Channels.Count;
              var channel = new Channel(_image, ChannelType.Red, "test");
              _image.AddChannel(channel, 0);

              Assert.AreEqual(before + 1, _image.Channels.Count);
        }
예제 #3
0
        public void GetIndex()
        {
            string channelName = "test";
              var channel = new Channel(_image, ChannelType.Red, channelName);
              _image.AddChannel(channel, 0);

              var channels = _image.Channels;
              int index = channels.GetIndex(channel);
              Assert.IsTrue(index == 0);
        }
예제 #4
0
        public void ChannelConstructorOne()
        {
            int before = _image.Channels.Count;

              var channel = new Channel(_image, "test", _width, _height, 100,
                new RGB(0, 255, 0));
              Assert.IsTrue(channel.IsChannel);
              _image.AddChannel(channel, 0);

              Assert.AreEqual(before + 1, _image.Channels.Count);
        }
예제 #5
0
        public void ThisByIndex()
        {
            string channelName = "test";
              var channel = new Channel(_image, ChannelType.Red, channelName);
              _image.AddChannel(channel, 0);

              var channels = _image.Channels;
              var found = channels[0];
              Assert.IsNotNull(found);
              Assert.AreEqual(channel.Name, found.Name);
        }
예제 #6
0
 public void AddChannel(Channel channel, int position)
 {
     if (!gimp_image_add_channel(ID, channel.ID, position))
     {
       throw new GimpSharpException();
     }
 }
예제 #7
0
 public void CombineMasks(Channel channel, ChannelOps operation,
     Offset offset)
 {
     CombineMasks(channel, operation, offset.X, offset.Y);
 }
예제 #8
0
 public Channel(Channel channel)
     : base(gimp_channel_copy(channel.ID))
 {
 }
예제 #9
0
        public void GetSetShowMasked()
        {
            var channel = new Channel(_image, "test", _width, _height, 100,
                new RGB(0, 255, 0));
              _image.AddChannel(channel, 0);

              channel.ShowMasked = true;
              Assert.IsTrue(channel.ShowMasked);

              channel.ShowMasked = false;
              Assert.IsFalse(channel.ShowMasked);
        }
예제 #10
0
 public void CombineMasks(Channel channel, ChannelOps operation,
     int offx, int offy)
 {
     if (!gimp_channel_combine_masks(ID, channel.ID, operation,
               offx, offy))
     {
       throw new GimpSharpException();
     }
 }
예제 #11
0
 public void Combine(Channel channel, ChannelOps operation)
 {
     if (!gimp_selection_combine(channel.ID, operation))
     {
       throw new GimpSharpException();
     }
 }
예제 #12
0
        public void GetSetOpacity()
        {
            var channel = new Channel(_image, "test", _width, _height, 100,
                new RGB(0, 255, 0));
              _image.AddChannel(channel, 0);

              Assert.AreEqual(100, channel.Opacity);
              channel.Opacity = 13;
              Assert.AreEqual(13, channel.Opacity);
        }
예제 #13
0
 public void LowerChannel(Channel channel)
 {
     if (!gimp_image_lower_channel(ID, channel.ID))
     {
       throw new GimpSharpException();
     }
 }
예제 #14
0
 public void AddChannel(Channel channel)
 {
     AddChannel(channel, 0);
 }
예제 #15
0
 public void InsertChannel(Channel channel, Item parent, int position)
 {
     if (!gimp_image_insert_channel(ID, channel.ID, parent != null ? parent.ID : 0,
              position))
     {
       throw new GimpSharpException();
     }
 }
예제 #16
0
 public void AddChannel(Channel channel, int position = 0)
 {
     InsertChannel(channel, null, position);
 }
예제 #17
0
        public void CombineMasks()
        {
            RGB color = new RGB(0, 255, 0);
              var channelOne = new Channel(_image, "one", color);
              var channelTwo = new Channel(_image, "two", color);

              _image.AddChannel(channelOne, 0);
              _image.AddChannel(channelTwo, 0);

              channelOne.CombineMasks(channelTwo, ChannelOps.Add, 0, 0);
        }
예제 #18
0
 public int GetChannelPosition(Channel channel)
 {
     return gimp_image_get_channel_position(ID, channel.ID);
 }
예제 #19
0
 public void GetChannelPosition()
 {
     var channel1 = new Channel(_image, "test1", new RGB(0, 255, 0));
       _image.AddChannel(channel1);
       var channel2 = new Channel(_image, "test2", new RGB(0, 255, 0));
       _image.AddChannel(channel2);
       Assert.AreEqual(1, _image.GetItemPosition(channel1));
       Assert.AreEqual(0, _image.GetItemPosition(channel2));
 }
예제 #20
0
 public void RemoveChannel(Channel channel)
 {
     if (!gimp_image_remove_channel(ID, channel.ID))
     {
       throw new GimpSharpException();
     }
 }
예제 #21
0
        public void RaiseChannel()
        {
            var channel1 = new Channel(_image, "test1", new RGB(0, 255, 0));
              _image.AddChannel(channel1);
              var channel2 = new Channel(_image, "test2", new RGB(0, 255, 0));
              _image.AddChannel(channel2);

              int position = channel1.Position;
              _image.RaiseItem(channel1);
              Assert.AreEqual(position - 1, channel1.Position);
              Assert.AreEqual(position, channel2.Position);
        }
예제 #22
0
 public void Load(Channel channel)
 {
     if (!gimp_selection_load(channel.ID))
     {
       throw new GimpSharpException();
     }
 }
예제 #23
0
        public void GetSetColor()
        {
            RGB color = new RGB(0, 255, 0);
              var channel = new Channel(_image, "test", _width, _height, 100,
                color);
              _image.AddChannel(channel, 0);

              Assert.AreEqual(color.Bytes, channel.Color.Bytes);
              RGB red = new RGB(255, 0, 0);
              channel.Color = red;
              Assert.AreEqual(red.Bytes, channel.Color.Bytes);
        }