From f59c1c01357e9c92910c8ec055544f8f9deaf550 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 4 Jul 2025 18:15:36 +0200 Subject: [PATCH] plop --- src/main/org/atriasoft/esvg/EsvgDocument.java | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/main/org/atriasoft/esvg/EsvgDocument.java b/src/main/org/atriasoft/esvg/EsvgDocument.java index 388ac92..50007b3 100644 --- a/src/main/org/atriasoft/esvg/EsvgDocument.java +++ b/src/main/org/atriasoft/esvg/EsvgDocument.java @@ -28,19 +28,19 @@ public class EsvgDocument extends Base { private Uri uri = null; //!< reference elements ... private String version = "0.0"; private static final boolean envDisplayRefs = "true".equals(System.getenv("ESQG_DISPLAY_REFS")); - + public EsvgDocument() { - + } - + public EsvgDocument(final Vector2i size) { this.size = new Vector2f(size.x(), size.y()); } - + public void addElement(final Base elem) { this.subElementList.add(elem); } - + /** * change all style in a xml atribute */ @@ -73,7 +73,7 @@ public class EsvgDocument extends Base { } return true; } - + public void clear() { this.uri = null; this.version = "0.0"; @@ -81,7 +81,7 @@ public class EsvgDocument extends Base { this.paint.clear(); this.size = Vector2f.ZERO; } - + /** * Display all the node in the svg file. */ @@ -100,7 +100,7 @@ public class EsvgDocument extends Base { } } } - + @Override protected void draw(final Renderer myRenderer, final Matrix2x3f basicTrans, final int level) { for (final Base element : this.subElementList) { @@ -109,7 +109,7 @@ public class EsvgDocument extends Base { } } } - + @Override protected void drawShapePoints( final List> out, @@ -124,16 +124,16 @@ public class EsvgDocument extends Base { } } } - + // TODO remove this fucntion : use generic function ... public Vector2f getDefinedSize() { return this.size; } - + public List> getLines() { return getLines(new Vector2f(256, 256)); } - + public List> getLines(Vector2f size) { final List> out = new ArrayList<>(); if (size.x() <= 0) { @@ -149,7 +149,7 @@ public class EsvgDocument extends Base { drawShapePoints(out, 10, 0.25f, basicTrans); return out; } - + public Base getReference(final String name) { if (name.isEmpty()) { LOGGER.error("request a reference with no name ... "); @@ -166,11 +166,11 @@ public class EsvgDocument extends Base { LOGGER.error("Can not find reference name : '" + name + "'"); return null; } - + public boolean isLoadOk() { return this.loadOK; } - + /* //! @previous public List renderImageFloatRGB(final Vector2i size) { @@ -183,7 +183,7 @@ public class EsvgDocument extends Base { } return out; } - + //! @previous public List> renderImageU8RGBA(final Vector2i size) { List data = renderImageFloatRGBA(size); @@ -195,7 +195,7 @@ public class EsvgDocument extends Base { } return out; } - + //! @previous public List> renderImageU8RGB(final Vector2i size) { List data = renderImageFloatRGBA(size); @@ -239,7 +239,7 @@ public class EsvgDocument extends Base { } return this.loadOK; } - + /** * parse a string that contain an svg stream * @param data Data to parse @@ -271,11 +271,11 @@ public class EsvgDocument extends Base { } return this.loadOK; } - + public boolean parseXMLData(final XmlElement root) { return parseXMLData(root, false); } - + public boolean parseXMLData(final XmlElement root, final boolean isReference) { // get the svg version : this.version = root.getAttribute("version", ""); @@ -290,7 +290,7 @@ public class EsvgDocument extends Base { } else { LOGGER.trace("Parse Reference section ... (no attibute)"); } - + Vector2f maxSize = Vector2f.ZERO; final Dynamic size = new Dynamic<>(Vector2f.ZERO); // parse all sub node: @@ -386,12 +386,12 @@ public class EsvgDocument extends Base { } return true; } - + /* public float[][] renderImageFloat(final Vector2i size) { return renderImageFloat(size, false); } - + public float[][] renderImageFloat(Vector2i size, final boolean visualDebug) { if (size == null) { size = new Vector2i((int) this.size.x(), (int) this.size.y()); @@ -408,7 +408,7 @@ public class EsvgDocument extends Base { // create the first element matrix modification ... Matrix2x3f basicTrans = Matrix2x3f.IDENTITY.multiply(Matrix2x3f.createScale(new Vector2f(size.x() / this.size.x(), size.y() / this.size.y()))); draw(renderedElement, basicTrans); - + // direct return the generated data ... return renderedElement.getData(); } @@ -421,7 +421,7 @@ public class EsvgDocument extends Base { public ImageFloatRGBA renderImageFloatRGBA(final Vector2i size) { return renderImageFloatRGBA(size, false); } - + public ImageFloatRGBA renderImageFloatRGBA(Vector2i size, final boolean visualDebug) { if (size == null) { size = new Vector2i((int) this.size.x(), (int) this.size.y()); @@ -445,9 +445,9 @@ public class EsvgDocument extends Base { final Matrix2x3f basicTrans = Matrix2x3f.IDENTITY .multiply(Matrix2x3f.createScale(new Vector2f(size.x() / this.size.x(), size.y() / this.size.y()))); draw(renderedElement, basicTrans); - + // direct return the generated data ... return renderedElement.getData(); } - + }