Skip to content

Add ImageSharp project#7

Merged
MarkusPalcer merged 11 commits into
MarkusPalcer:masterfrom
slang25:image-sharp
Jan 30, 2021
Merged

Add ImageSharp project#7
MarkusPalcer merged 11 commits into
MarkusPalcer:masterfrom
slang25:image-sharp

Conversation

@slang25

@slang25 slang25 commented Mar 4, 2020

Copy link
Copy Markdown
Contributor

Fixes #6

Needs tests!

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

@antonfirsov antonfirsov left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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(...).

Comment thread Blurhash.ImageSharp/Encoder.cs
Comment thread Blurhash.ImageSharp/Decoder.cs Outdated
var height = pixelData.GetLength(1);

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

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread Blurhash.ImageSharp/Encoder.cs
Comment thread Blurhash.ImageSharp/Decoder.cs Outdated
slang25 and others added 2 commits March 6, 2020 18:21
Co-Authored-By: Anton Firszov <antonfir@gmail.com>
@slang25 slang25 changed the title [WIP] Add ImageSharp project Add ImageSharp project Mar 7, 2020
@Daniel15

Daniel15 commented Oct 17, 2020

Copy link
Copy Markdown

Has this been published to NuGet yet?

Will this be merged at some point? :)

@JimBobSquarePants

Copy link
Copy Markdown

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
Copy Markdown
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

MarkusPalcer commented Jan 30, 2021

Copy link
Copy Markdown
Owner

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