Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ImageSharp project #7

Merged
merged 11 commits into from
Jan 30, 2021
Merged

Conversation

slang25
Copy link
Contributor

@slang25 slang25 commented Mar 4, 2020

Fixes #6

Needs tests!

@slang25 slang25 changed the title Add ImageSharp project [WIP] Add ImageSharp project Mar 4, 2020
Copy link
Contributor

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generic method seems incorrect.

/// Converts the given bitmap to the library-independent representation used within the Blurhash-core
/// </summary>
/// <param name="sourceBitmap">The bitmap to encode</param>
internal static Pixel[,] ConvertBitmap<T>(Image<T> sourceBitmap) where T : struct, IPixel<T>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering the implementation, you should consume Image<Rgb24> or use proper conversion with PixelOperations<T>.ToRgb24(...).

Blurhash.ImageSharp/Encoder.cs Show resolved Hide resolved
var height = pixelData.GetLength(1);

var data = Enumerable.Range(0, height)
.SelectMany(y => Enumerable.Range(0, width).Select(x => (x, y)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a for loop? This linq expression is a perf killer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was copied from another implementation, I'll expand it, as I think perf is key if it's to be used in a Xamarin app for example, which is my primary use-case.

@slang25 slang25 changed the title [WIP] Add ImageSharp project Add ImageSharp project Mar 7, 2020
@Daniel15
Copy link

Daniel15 commented Oct 17, 2020

Has this been published to NuGet yet?

Will this be merged at some point? :)

@JimBobSquarePants
Copy link

I need to have a hack at this. I was given permission, just haven’t gotten to it yet.

@MarkusPalcer MarkusPalcer merged commit 97fe21c into MarkusPalcer:master Jan 30, 2021
@MarkusPalcer
Copy link
Owner

Sorry, I seeem to have notifications setup completely wrong - I didn't get notified that there was activity on the repo, so I didn't react to anything.

@MarkusPalcer
Copy link
Owner

MarkusPalcer commented Jan 30, 2021

Has this been published to NuGet yet?

Will this be merged at some point? :)

To publish it on NuGet a .nuspec file is needed for the project. Edit: I should not be doing this just before midnight...

I'm currently setting up GitHub actions, so all NuGet packages of the repo will be published in a feed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create cross-plat package using ImageSharp
6 participants