Skip to content

Allow passing custom Configuration instances to processors #650

Closed

Description

@antonfirsov

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Problem

At the moment it's not possible to pass Configuration instances to image processors. We can't do this without changing the public API which means we need to act before RC1 is out.

Suggestion:

  • IImageProcessor<T>.Apply() needs a Configuration argument
  • IImageProcessingContext<TPixel> should hold a Configuration instead of MemoryAllocator
  • We need overloads for Mutate() and Clone() taking a Configuration

Activity

  1. funcylambda commented on Sep 26, 2018

    @funcylambda

    @antonfirsov - Do you mind if I take this one to get my feet wet with ImageSharp? :)

  2. antonfirsov commented on Oct 1, 2018

    @antonfirsov
    MemberAuthor

    @funcylambda thanks volunteering, and sorry for the late reaction!

    Actually, I received some critical voices on this proposal from @JimBobSquarePants and @tocsoft, because it's possible to control the Configuration instances with the current API by binding them to Image<T> instances at initalization.

    Their opinion is that it should be good enough for 1.0, mine is that we can add more flexibility with this feature. (IImageProcessingContext<T>.Configuration > Image<T>.Configuration > Configuration.Default)

    I think a community PR won't do any harm here, because it won't distract the core team from our main priorities. @JimBobSquarePants @tocsoft thoughts?

  3. funcylambda commented on Oct 1, 2018

    @funcylambda

    @antonfirsov

    Cool, and no worries! I'm probably going to be refactoring some imaging code from an old C# library to ImageSharp at work (you have some good publicity going around thanks to a few bloggers!), so I thought it'd be good to give back as it were, and also learn a bit more about the library. If this isn't a good task, I do have some spare time this weekend so feel free to point me in the direction of another one :)

  4. JimBobSquarePants commented on Oct 2, 2018

    @JimBobSquarePants
    Member

    @antonfirsov I actually thought this would be more disruptive than I thought but looking at the source it might well be ok. @funcylambda You have my blessing.

    We'll have to also update ICloningImageProcessor<TPixel>.CloneAndApply.

  5. funcylambda commented on Oct 2, 2018

    @funcylambda

    @JimBobSquarePants - Cool, I'll send a PR when it's done/message if I have any problems. Probably towards the end of Sunday.

  6. added a commit that references this issue on Mar 21, 2019
  7. added a commit that references this issue on Jan 6, 2020
    d7eeb2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions