-
-
Notifications
You must be signed in to change notification settings - Fork 888
Introduce non-generic ImageFrameCollection #941
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
dc08802
temporarily disable target frameworks
antonfirsov f8d1e00
drop DelegateProcessor
antonfirsov 02f6546
drop IImageProcessingContext<TPixel>
antonfirsov cd75b93
drop NamedColors<T>
antonfirsov 3d7d70b
drop ColorBuilder<T>
antonfirsov 949386a
drop the *Base postfix for clean class hierarchies
antonfirsov 68df822
Merge remote-tracking branch 'origin/master' into af/api-cleanup
antonfirsov 1668f0c
adding basic skeletons
antonfirsov 6b731aa
non-generic ImageFrameCollection API definition
antonfirsov 351e806
Merge remote-tracking branch 'origin/master' into af/nongeneric-frame…
antonfirsov 9738924
non-generic ImageFrameCollection tests
antonfirsov bb7a51f
cleanup + docs + more tests
antonfirsov ea34548
implement ImageFrameCollection methods
antonfirsov 5e05056
tests for generic PixelOperations.To<TDest>()
antonfirsov 87958af
experimental implementation
antonfirsov 7df1123
fix .ttinclude
antonfirsov 678beb0
generate generic From<TSourcePixel>(...)
antonfirsov d33bcf4
fix RgbaVector <--> BT709 Gray pixel conversion
antonfirsov c64936b
Gray8 and Gray16 using ConvertFromRgbaScaledVector4() by default
antonfirsov f0c1b1c
fixed all conversion tests
antonfirsov c8517f4
ConstructGif_FromDifferentPixelTypes
antonfirsov 06ea84f
fix xmldoc and other StyelCop findings
antonfirsov e108573
Merge branch 'master' into af/nongeneric-framecollection
antonfirsov f3c31f5
re-enable all target frameworks
antonfirsov 451c609
fix NonGenericAddFrame() and NonGenericInsertFrame()
antonfirsov 9ddee74
fix remaining bugs
antonfirsov 9f78352
Merge branch 'master' into af/nongeneric-framecollection
JimBobSquarePants File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| // Copyright (c) Six Labors and contributors. | ||
| // Licensed under the Apache License, Version 2.0. | ||
|
|
||
| using System; | ||
|
|
||
| using SixLabors.ImageSharp.Metadata; | ||
| using SixLabors.ImageSharp.PixelFormats; | ||
| using SixLabors.Memory; | ||
| using SixLabors.Primitives; | ||
|
|
||
| namespace SixLabors.ImageSharp | ||
| { | ||
| /// <summary> | ||
| /// Represents a pixel-agnostic image frame containing all pixel data and <see cref="ImageFrameMetadata"/>. | ||
| /// In case of animated formats like gif, it contains the single frame in a animation. | ||
| /// In all other cases it is the only frame of the image. | ||
| /// </summary> | ||
| public abstract partial class ImageFrame : IDisposable | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="ImageFrame"/> class. | ||
| /// </summary> | ||
| /// <param name="configuration">The <see cref="Configuration"/>.</param> | ||
| /// <param name="width">The width.</param> | ||
| /// <param name="height">The height.</param> | ||
| /// <param name="metadata">The <see cref="ImageFrameMetadata"/>.</param> | ||
| protected ImageFrame(Configuration configuration, int width, int height, ImageFrameMetadata metadata) | ||
| { | ||
| Guard.NotNull(configuration, nameof(configuration)); | ||
| Guard.NotNull(metadata, nameof(metadata)); | ||
|
|
||
| this.Configuration = configuration; | ||
| this.MemoryAllocator = configuration.MemoryAllocator; | ||
| this.Width = width; | ||
| this.Height = height; | ||
| this.Metadata = metadata; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the <see cref="MemoryAllocator" /> to use for buffer allocations. | ||
| /// </summary> | ||
| public MemoryAllocator MemoryAllocator { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the <see cref="Configuration"/> instance associated with this <see cref="ImageFrame{TPixel}"/>. | ||
| /// </summary> | ||
| internal Configuration Configuration { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the width. | ||
| /// </summary> | ||
| public int Width { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the height. | ||
| /// </summary> | ||
| public int Height { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the metadata of the frame. | ||
| /// </summary> | ||
| public ImageFrameMetadata Metadata { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the size of the frame. | ||
| /// </summary> | ||
| /// <returns>The <see cref="Size"/></returns> | ||
| public Size Size() => new Size(this.Width, this.Height); | ||
|
|
||
| /// <summary> | ||
| /// Gets the bounds of the frame. | ||
| /// </summary> | ||
| /// <returns>The <see cref="Rectangle"/></returns> | ||
| public Rectangle Bounds() => new Rectangle(0, 0, this.Width, this.Height); | ||
|
|
||
| /// <inheritdoc /> | ||
| public abstract void Dispose(); | ||
|
|
||
| internal abstract void CopyPixelsTo<TDestinationPixel>(Span<TDestinationPixel> destination) | ||
| where TDestinationPixel : struct, IPixel<TDestinationPixel>; | ||
|
|
||
| /// <summary> | ||
| /// Updates the size of the image frame. | ||
| /// </summary> | ||
| internal void UpdateSize(Size size) | ||
| { | ||
| this.Width = size.Width; | ||
| this.Height = size.Height; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason
ttincludefiles stop working withlffile endings.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, did some reading. No workaround I can find.