Giter VIP home page Giter VIP logo

Comments (9)

aslpavel avatar aslpavel commented on July 23, 2024 1

Could you please test the latest version 0.2.2 and see if it has fixed the issue?

from rasterize.

lnicola avatar lnicola commented on July 23, 2024 1

If it's intentional, yes, I can work around it on my side.

(if you were wondering, I've used your crate for this).

from rasterize.

aslpavel avatar aslpavel commented on July 23, 2024

Sorry for the delayed response, but could you please provide an example of the scene

from rasterize.

lnicola avatar lnicola commented on July 23, 2024

I can't (easily), but the relevant code is https://github.com/lnicola/walker/blob/master/src/main.rs#L237-L256.

from rasterize.

lnicola avatar lnicola commented on July 23, 2024

If you have an email address, I can send you a trace of the Scenes and Layers I get in the two versions (for the same input data).

from rasterize.

lnicola avatar lnicola commented on July 23, 2024

Actually, here's an example:

# rasterize 0.1
[src/main.rs:248] &scene = Stroke {
    path: Line 2.912e6,5.524e6 2.912e6,5.523e6
    Line 2.912e6,5.523e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    End
    ,
    paint: LinColor(
        [
            1.0,
            0.11697067,
            0.0056053917,
            1.0,
        ],
    ),
    style: StrokeStyle {
        width: 20.0,
        line_join: Round,
        line_cap: Butt,
    },
}
[src/main.rs:255] &layer = Layer {
    image: ImageOwned {
        shape: Shape {
            width: 882,
            height: 632,
            row_stride: 882,
            col_stride: 1,
        },
        dtype: "rasterize::color::LinColor",
        ..
    },
    x: 363456,
    y: -690725,
}

# rasterize 0.2
[src/main.rs:248] &scene = Stroke {
    style: StrokeStyle {
        width: 20.0,
        line_join: Round,
        line_cap: Butt,
    },
    paint: LinColor(
        [
            1.0,
            0.11697067,
            0.0056053917,
            1.0,
        ],
    ),
    path: Line 2.912e6,5.524e6 2.912e6,5.523e6
    Line 2.912e6,5.523e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    Line 2.912e6,5.524e6 2.912e6,5.524e6
    End
    ,
}
[src/main.rs:255] &layer = Layer {
    image: ImageOwned {
        shape: Shape {
            width: 7,
            height: 11,
            row_stride: 7,
            col_stride: 1,
        },
        dtype: "rasterize::color::LinColor",
        ..
    },
    x: 363975,
    y: -690447,
}

The paths are identical, but the output shape is not.

from rasterize.

lnicola avatar lnicola commented on July 23, 2024

Thanks for looking into it. It almost works, but it's still diverging from 0.1 at one point:

# 0.1
[src/main.rs:248] &scene = Stroke {
    path: Line 2.911e6,5.524e6 2.911e6,5.524e6
    Line 2.911e6,5.524e6 2.911e6,5.524e6
    Line 2.911e6,5.524e6 2.911e6,5.524e6
    End
    ,
    paint: LinColor(
        [
            1.0,
            0.11697067,
            0.0056053917,
            1.0,
        ],
    ),
    style: StrokeStyle {
        width: 20.0,
        line_join: Round,
        line_cap: Butt,
    },
}
[src/main.rs:255] &layer = Layer {
    image: ImageOwned {
        shape: Shape {
            width: 882,
            height: 632,
            row_stride: 882,
            col_stride: 1,
        },
        dtype: "rasterize::color::LinColor",
        ..
    },
    x: 363456,
    y: -690725,
}

# 0.2.2
[src/main.rs:248] &scene = Stroke {
    style: StrokeStyle {
        width: 20.0,
        line_join: Round,
        line_cap: Butt,
    },
    paint: LinColor(
        [
            1.0,
            0.11697067,
            0.0056053917,
            1.0,
        ],
    ),
    path: Line 2.911e6,5.524e6 2.911e6,5.524e6
    Line 2.911e6,5.524e6 2.911e6,5.524e6
    Line 2.911e6,5.524e6 2.911e6,5.524e6
    End
    ,
}
[src/main.rs:255] &layer = Layer {
    x: 0,
    y: 0,
    w: 0,
    h: 0,
}

from rasterize.

lnicola avatar lnicola commented on July 23, 2024

This one's on me, I suppose. The path has three lines of length 0 (all six points have the same coordinates).

from rasterize.

aslpavel avatar aslpavel commented on July 23, 2024

I think new implementation tries to throw away layers that do not produce any output when bounding box is empty, this might explain this. Should we close this issue or are there any other problems?

from rasterize.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.