Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public void AddChannel(Channel channel, int position)
 {
     if (!gimp_image_add_channel(ID, channel.ID, position))
     {
       throw new GimpSharpException();
     }
 }
Ejemplo n.º 7
0
 public void CombineMasks(Channel channel, ChannelOps operation,
     Offset offset)
 {
     CombineMasks(channel, operation, offset.X, offset.Y);
 }
Ejemplo n.º 8
0
 public Channel(Channel channel)
     : base(gimp_channel_copy(channel.ID))
 {
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 11
0
 public void Combine(Channel channel, ChannelOps operation)
 {
     if (!gimp_selection_combine(channel.ID, operation))
     {
       throw new GimpSharpException();
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 13
0
 public void LowerChannel(Channel channel)
 {
     if (!gimp_image_lower_channel(ID, channel.ID))
     {
       throw new GimpSharpException();
     }
 }
Ejemplo n.º 14
0
 public void AddChannel(Channel channel)
 {
     AddChannel(channel, 0);
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 16
0
 public void AddChannel(Channel channel, int position = 0)
 {
     InsertChannel(channel, null, position);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 18
0
 public int GetChannelPosition(Channel channel)
 {
     return gimp_image_get_channel_position(ID, channel.ID);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 20
0
 public void RemoveChannel(Channel channel)
 {
     if (!gimp_image_remove_channel(ID, channel.ID))
     {
       throw new GimpSharpException();
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 22
0
 public void Load(Channel channel)
 {
     if (!gimp_selection_load(channel.ID))
     {
       throw new GimpSharpException();
     }
 }
Ejemplo n.º 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);
        }