Exemple #1
0
 public void GetSetLinked()
 {
     var vectors = new Vectors(_image, "firstVector");
       Assert.IsFalse(vectors.Linked);
       vectors.Linked = true;
       Assert.IsTrue(vectors.Linked);
 }
Exemple #2
0
 public void AttachParasite()
 {
     var vectors = new Vectors(_image, "firstVector");
       var parasite = new Parasite("foo", 0, 13);
       vectors.AttachParasite(parasite);
       Assert.AreEqual(1, vectors.ParasiteList.Count);
 }
Exemple #3
0
 public void Add()
 {
     var vectors = new Vectors(_image, "firstVector");
       Assert.AreEqual(0, _image.Vectors.Count);
       _image.AddVectors(vectors, -1);
       Assert.AreEqual(1, _image.Vectors.Count);
       Assert.IsTrue(vectors.IsValid);
 }
Exemple #4
0
 public void ConstructorFromTextLayer()
 {
     var layer = new TextLayer(_image, "Hello World", "Sans",
         new FontSize(32, Unit.Pixel));
       _image.InsertLayer(layer, 0);
       var vectors = new Vectors(_image, layer);
       Assert.IsTrue(vectors.IsValid);
       Assert.IsTrue(vectors.Strokes.Count > 0);
 }
Exemple #5
0
 // [Test]
 public void Close()
 {
     var vectors = new Vectors(_image, "firstVector");
       var controlpoints = new CoordinateList<double>() {
     new Coordinate<double>(50, 50),
     new Coordinate<double>(100, 100),
     new Coordinate<double>(150, 150)
       };
       var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
              controlpoints, false);
       stroke.Close();
       bool closed;
       stroke.GetPoints(out closed);
       Assert.IsTrue(closed);
 }
Exemple #6
0
        // [Test]
        public void Close()
        {
            var vectors       = new Vectors(_image, "firstVector");
            var controlpoints = new CoordinateList <double>()
            {
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100),
                new Coordinate <double>(150, 150)
            };
            var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                                               controlpoints, false);

            stroke.Close();
            bool closed;

            stroke.GetPoints(out closed);
            Assert.IsTrue(closed);
        }
Exemple #7
0
        public void GetPoints()
        {
            var vectors = new Vectors(_image, "firstVector");
              var controlpoints = new CoordinateList<double>() {
            new Coordinate<double>(50, 50),
            new Coordinate<double>(100, 100),
            new Coordinate<double>(150, 150)
              };
              var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                     controlpoints, false);
              bool closed;

              // Fix me: this one segfaults
              // var points = stroke.GetPoints(out closed);
              // Assert.AreEqual(controlpoints.Count, points.Count);
              // Assert.AreEqual(controlpoints, points);
              // Assert.IsFalse(closed);
        }
Exemple #8
0
        public void GetPoints()
        {
            var vectors       = new Vectors(_image, "firstVector");
            var controlpoints = new CoordinateList <double>()
            {
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100),
                new Coordinate <double>(150, 150)
            };
            var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                                               controlpoints, false);
            bool closed;

            // Fix me: this one segfaults
            // var points = stroke.GetPoints(out closed);
            // Assert.AreEqual(controlpoints.Count, points.Count);
            // Assert.AreEqual(controlpoints, points);
            // Assert.IsFalse(closed);
        }
Exemple #9
0
        public void Scale()
        {
            var vectors       = new Vectors(_image, "firstVector");
            var controlpoints = new CoordinateList <double>()
            {
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100),
                new Coordinate <double>(150, 150)
            };
            var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                                               controlpoints, false);
            double precision = 0.001;

            stroke.Close();
            double oldLength = stroke.GetLength(precision);

            stroke.Scale(2, 2);
            double newLength = stroke.GetLength(precision);

            Assert.IsTrue(Math.Abs(2 * oldLength - newLength) < precision);
        }
Exemple #10
0
 public void GetSetTattoo()
 {
     var vectors = new Vectors(_image, "firstVector");
       var tattoo = new Tattoo(13);
       vectors.Tattoo = tattoo;
       Assert.AreEqual(tattoo, vectors.Tattoo);
 }
Exemple #11
0
 public void ToSelection()
 {
     var vectors = new Vectors(_image, "firstVector");
       _image.AddVectors(vectors, -1);
       AddStroke(vectors);
       Assert.IsTrue(_image.Selection.Empty);
       vectors.ToSelection(ChannelOps.Replace, true);
       Assert.IsFalse(_image.Selection.Empty);
 }
 public void RemoveVectors(Vectors vectors)
 {
     if (!gimp_image_remove_vectors(ID, vectors.ID))
     {
       throw new GimpSharpException();
     }
 }
 public void LowerVectorsToBottom(Vectors vectors)
 {
     if (!gimp_image_lower_vectors_to_bottom(ID, vectors.ID))
     {
       throw new GimpSharpException();
     }
 }
 public void AddVectors(Vectors vectors, int position)
 {
     if (!gimp_image_add_vectors(ID, vectors.ID, position))
     {
       throw new GimpSharpException();
     }
 }
Exemple #15
0
 public Vectors(Vectors vectors) : base(gimp_vectors_copy(vectors.ID))
 {
 }
Exemple #16
0
 public void Constructor()
 {
     var vectors = new Vectors(_image, "firstVector");
       Assert.AreEqual("firstVector", vectors.Name);
 }
Exemple #17
0
 Stroke AddStroke(Vectors vectors)
 {
     var controlpoints = new CoordinateList<double> {
     new Coordinate<double>(10, 10),
     new Coordinate<double>(50, 50),
     new Coordinate<double>(100, 100)
       };
       return vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints,
            true);
 }
Exemple #18
0
 public Vectors(Vectors vectors)
     : base(gimp_vectors_copy(vectors.ID))
 {
 }
Exemple #19
0
        public void IsValid()
        {
            var vectors = new Vectors(_image, "firstVector");

            Assert.IsTrue(vectors.IsValid);
        }
Exemple #20
0
        public void ImportFromString()
        {
            string name = "firstVector";
              var vector = new Vectors(_image, name);
              string s = vector.ExportToString();

              var vectors = _image.ImportVectorsFromString(s, false, false);
              Assert.AreEqual(1, vectors.Count);
              Assert.AreEqual(name, vectors[0].Name);
        }
Exemple #21
0
 public void ExportToString()
 {
     var vector = new Vectors(_image, "firstVector");
       string s = vector.ExportToString();
       Assert.IsNotNull(s);
 }
Exemple #22
0
        public void RaiseVectorsToTop()
        {
            var first = new Vectors(_image, "firstVector");
              var second = new Vectors(_image, "secondVector");
              _image.AddVectors(first, -1);
              _image.AddVectors(second, -1);

              _image.RaiseItemToTop(first);
              Assert.AreEqual(0, _image.GetItemPosition(first));
              Assert.AreEqual(1, _image.GetItemPosition(second));
        }
Exemple #23
0
 public void InsertVectors(Vectors vectors, Item parent, int position)
 {
     if (!gimp_image_insert_vectors(ID, vectors.ID,
              parent != null ? parent.ID : 0, position))
     {
       throw new GimpSharpException();
     }
 }
Exemple #24
0
 public void GetSetVisible()
 {
     var vectors = new Vectors(_image, "firstVector");
       Assert.IsFalse(vectors.Visible);
       vectors.Visible = true;
       Assert.IsTrue(vectors.Visible);
 }
Exemple #25
0
 public void Remove()
 {
     var first = new Vectors(_image, "firstVector");
       _image.AddVectors(first, -1);
       _image.RemoveVectors(first);
 }
Exemple #26
0
 public void AddVectors(Vectors vectors, int position = 0)
 {
     InsertVectors(vectors, null, position);
 }
Exemple #27
0
 public void IsValid()
 {
     var vectors = new Vectors(_image, "firstVector");
       Assert.IsTrue(vectors.IsValid);
 }
Exemple #28
0
 public void AddVectors(Vectors vectors, int position = 0)
 {
     InsertVectors(vectors, null, position);
 }
Exemple #29
0
 public void ParasiteFind()
 {
     var vectors = new Vectors(_image, "firstVector");
       var parasite = new Parasite("foo", 0, 13);
       vectors.AttachParasite(parasite);
       var found = vectors.ParasiteFind("foo");
       Assert.AreEqual(parasite, found);
       Assert.IsNull(vectors.ParasiteFind("bar"));
 }
 public Vectors(Vectors vectors)
 {
     _ID = gimp_vectors_copy(vectors.ID);
 }
Exemple #31
0
 public void GetImage()
 {
     var vectors = new Vectors(_image, "firstVector");
       _image.AddVectors(vectors, -1);
       Assert.AreEqual(_image, vectors.Image);
 }
 public int GetVectorsPosition(Vectors vectors)
 {
     return gimp_image_get_vectors_position(ID, vectors.ID);
 }
Exemple #33
0
 public void PositionTwo()
 {
     var first = new Vectors(_image, "firstVector");
       var second = new Vectors(_image, "secondVector");
       _image.AddVectors(first, -1);
       _image.AddVectors(second, -1);
       Assert.AreEqual(1, first.Position);
       Assert.AreEqual(0, second.Position);
 }
 public void RaiseVectorsToTop(Vectors vectors)
 {
     if (!gimp_image_raise_vectors_to_top(ID, vectors.ID))
     {
       throw new GimpSharpException();
     }
 }
Exemple #35
0
 public void GetSetName()
 {
     var vectors = new Vectors(_image, "firstVector");
       vectors.Name = "renamedVector";
       Assert.AreEqual("renamedVector", vectors.Name);
 }
Exemple #36
0
        public void Constructor()
        {
            var vectors = new Vectors(_image, "firstVector");

            Assert.AreEqual("firstVector", vectors.Name);
        }
Exemple #37
0
 public void RemoveStroke()
 {
     var vectors = new Vectors(_image, "firstVector");
       var stroke = AddStroke(vectors);
       vectors.RemoveStroke(stroke);
       Assert.AreEqual(0, vectors.Strokes.Count);
 }