public void GetSetLinked() { var vectors = new Vectors(_image, "firstVector"); Assert.IsFalse(vectors.Linked); vectors.Linked = true; Assert.IsTrue(vectors.Linked); }
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); }
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); }
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); }
// [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); }
// [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); }
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); }
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); }
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); }
public void GetSetTattoo() { var vectors = new Vectors(_image, "firstVector"); var tattoo = new Tattoo(13); vectors.Tattoo = tattoo; Assert.AreEqual(tattoo, vectors.Tattoo); }
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(); } }
public Vectors(Vectors vectors) : base(gimp_vectors_copy(vectors.ID)) { }
public void Constructor() { var vectors = new Vectors(_image, "firstVector"); Assert.AreEqual("firstVector", vectors.Name); }
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); }
public void IsValid() { var vectors = new Vectors(_image, "firstVector"); Assert.IsTrue(vectors.IsValid); }
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); }
public void ExportToString() { var vector = new Vectors(_image, "firstVector"); string s = vector.ExportToString(); Assert.IsNotNull(s); }
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)); }
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(); } }
public void GetSetVisible() { var vectors = new Vectors(_image, "firstVector"); Assert.IsFalse(vectors.Visible); vectors.Visible = true; Assert.IsTrue(vectors.Visible); }
public void Remove() { var first = new Vectors(_image, "firstVector"); _image.AddVectors(first, -1); _image.RemoveVectors(first); }
public void AddVectors(Vectors vectors, int position = 0) { InsertVectors(vectors, null, position); }
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); }
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); }
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(); } }
public void GetSetName() { var vectors = new Vectors(_image, "firstVector"); vectors.Name = "renamedVector"; Assert.AreEqual("renamedVector", vectors.Name); }
public void RemoveStroke() { var vectors = new Vectors(_image, "firstVector"); var stroke = AddStroke(vectors); vectors.RemoveStroke(stroke); Assert.AreEqual(0, vectors.Strokes.Count); }