Skip to content

Returning values from ProcessPixelRows #2950

Answered by antonfirsov
JohnJScott asked this question in Q&A
Discussion options

You must be logged in to vote
public MyThing Foo(Image<Rgba32> image)
{
    MyThing? result = null;

    image.ProcessPixelRows(accessor =>
    {
        // Your processing logic

        // Make sure result is always instantiated
        result = new MyThing(...);
    });

    return result!;
}

Does this answer your question? If not, can you elaborate on it with a short code example?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JohnJScott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants