Browse Source

basic fixes after rebase + temporarily comment out target frameworks

af/merge-core
Anton Firszov 7 years ago
parent
commit
1978731ac1
  1. 8
      src/ImageSharp/Formats/PixelTypeInfo.cs
  2. 2
      src/ImageSharp/Image.Decode.cs
  3. 2
      src/ImageSharp/Image.FromBytes.cs
  4. 2
      src/ImageSharp/Image.FromFile.cs
  5. 2
      src/ImageSharp/Image.FromStream.cs
  6. 2
      src/ImageSharp/Image.LoadPixelData.cs
  7. 2
      src/ImageSharp/Image.WrapMemory.cs
  8. 5
      src/ImageSharp/ImageSharp.csproj
  9. 6
      src/ImageSharp/Image{TPixel}.cs

8
src/ImageSharp/Formats/PixelTypeInfo.cs

@ -1,6 +1,10 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats
{
/// <summary>
@ -21,5 +25,9 @@ namespace SixLabors.ImageSharp.Formats
/// Gets color depth, in number of bits per pixel.
/// </summary>
public int BitsPerPixel { get; }
internal static PixelTypeInfo Create<TPixel>()
where TPixel : struct, IPixel<TPixel> =>
new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8);
}
}

2
src/ImageSharp/Image.Decode.cs

@ -14,7 +14,7 @@ namespace SixLabors.ImageSharp
/// <content>
/// Adds static methods allowing the decoding of new images.
/// </content>
public static partial class Image
public abstract partial class Image
{
/// <summary>
/// Creates an <see cref="Image{TPixel}"/> instance backed by an uninitialized memory buffer.

2
src/ImageSharp/Image.FromBytes.cs

@ -11,7 +11,7 @@ namespace SixLabors.ImageSharp
/// <content>
/// Adds static methods allowing the creation of new image from a byte array.
/// </content>
public static partial class Image
public abstract partial class Image
{
/// <summary>
/// By reading the header on the provided byte array this calculates the images format.

2
src/ImageSharp/Image.FromFile.cs

@ -11,7 +11,7 @@ namespace SixLabors.ImageSharp
/// <content>
/// Adds static methods allowing the creation of new image from a given file.
/// </content>
public static partial class Image
public abstract partial class Image
{
/// <summary>
/// By reading the header on the provided file this calculates the images mime type.

2
src/ImageSharp/Image.FromStream.cs

@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp
/// <content>
/// Adds static methods allowing the creation of new image from a given stream.
/// </content>
public static partial class Image
public abstract partial class Image
{
/// <summary>
/// By reading the header on the provided stream this calculates the images mime type.

2
src/ImageSharp/Image.LoadPixelData.cs

@ -11,7 +11,7 @@ namespace SixLabors.ImageSharp
/// <content>
/// Adds static methods allowing the creation of new image from raw pixel data.
/// </content>
public static partial class Image
public abstract partial class Image
{
/// <summary>
/// Create a new instance of the <see cref="Image{TPixel}"/> class from the raw <typeparamref name="TPixel"/> data.

2
src/ImageSharp/Image.WrapMemory.cs

@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp
/// <content>
/// Adds static methods allowing wrapping an existing memory area as an image.
/// </content>
public static partial class Image
public abstract partial class Image
{
/// <summary>
/// Wraps an existing contiguous memory area of 'width' x 'height' pixels,

5
src/ImageSharp/ImageSharp.csproj

@ -10,7 +10,10 @@
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
<TargetFrameworks>netcoreapp2.1;netstandard1.3;netstandard2.0;net472</TargetFrameworks>
<!--<TargetFrameworks>netcoreapp2.1;netstandard1.3;netstandard2.0;net472</TargetFrameworks>-->
<TargetFramework>netcoreapp2.1</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>SixLabors.ImageSharp</AssemblyName>

6
src/ImageSharp/Image{TPixel}.cs

@ -128,10 +128,10 @@ namespace SixLabors.ImageSharp
public PixelTypeInfo PixelType { get; }
/// <inheritdoc/>
public int Width => this.Frames.RootFrame.Width;
public override int Width => this.Frames.RootFrame.Width;
/// <inheritdoc/>
public int Height => this.Frames.RootFrame.Height;
public override int Height => this.Frames.RootFrame.Height;
/// <inheritdoc/>
public ImageMetadata Metadata { get; }
@ -197,7 +197,7 @@ namespace SixLabors.ImageSharp
}
/// <inheritdoc/>
public void Dispose() => this.Frames.Dispose();
public override void Dispose() => this.Frames.Dispose();
internal override void AcceptVisitor(IImageVisitor visitor)
{

Loading…
Cancel
Save