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

fix "as" usage #959

Merged
merged 2 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ImageSharp/Advanced/AotCompilerTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private static void AotCompileResizeOperations<TPixel>()
where TPixel : struct, IPixel<TPixel>
{
var resizeProcessor = new ResizeProcessor(new ResizeOptions(), default);
var genericResizeProcessor = new ResizeProcessor<TPixel>(resizeProcessor.CreatePixelSpecificProcessor<TPixel>() as ResizeProcessor);
var genericResizeProcessor = new ResizeProcessor<TPixel>((ResizeProcessor)resizeProcessor.CreatePixelSpecificProcessor<TPixel>());
genericResizeProcessor.AotCreateDestination(new Image<TPixel>(0, 0), default);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System.Numerics;
Expand Down Expand Up @@ -118,9 +118,9 @@ public int WriteCurveSegment(IccCurveSegment value)
switch (value.Signature)
{
case IccCurveSegmentSignature.FormulaCurve:
return count + this.WriteFormulaCurveElement(value as IccFormulaCurveElement);
return count + this.WriteFormulaCurveElement((IccFormulaCurveElement)value);
case IccCurveSegmentSignature.SampledCurve:
return count + this.WriteSampledCurveElement(value as IccSampledCurveElement);
return count + this.WriteSampledCurveElement((IccSampledCurveElement)value);
default:
throw new InvalidIccProfileException($"Invalid CurveSegment type of {value.Signature}");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
Expand All @@ -22,11 +22,11 @@ public int WriteMultiProcessElement(IccMultiProcessElement value)
switch (value.Signature)
{
case IccMultiProcessElementSignature.CurveSet:
return count + this.WriteCurveSetProcessElement(value as IccCurveSetProcessElement);
return count + this.WriteCurveSetProcessElement((IccCurveSetProcessElement)value);
case IccMultiProcessElementSignature.Matrix:
return count + this.WriteMatrixProcessElement(value as IccMatrixProcessElement);
return count + this.WriteMatrixProcessElement((IccMatrixProcessElement)value);
case IccMultiProcessElementSignature.Clut:
return count + this.WriteClutProcessElement(value as IccClutProcessElement);
return count + this.WriteClutProcessElement((IccClutProcessElement)value);

case IccMultiProcessElementSignature.BAcs:
case IccMultiProcessElementSignature.EAcs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System.Linq;
Expand Down Expand Up @@ -37,102 +37,102 @@ public int WriteTagDataEntry(IccTagDataEntry entry)
switch (entry.Signature)
{
case IccTypeSignature.Chromaticity:
count += this.WriteChromaticityTagDataEntry(entry as IccChromaticityTagDataEntry);
count += this.WriteChromaticityTagDataEntry((IccChromaticityTagDataEntry)entry);
break;
case IccTypeSignature.ColorantOrder:
count += this.WriteColorantOrderTagDataEntry(entry as IccColorantOrderTagDataEntry);
count += this.WriteColorantOrderTagDataEntry((IccColorantOrderTagDataEntry)entry);
break;
case IccTypeSignature.ColorantTable:
count += this.WriteColorantTableTagDataEntry(entry as IccColorantTableTagDataEntry);
count += this.WriteColorantTableTagDataEntry((IccColorantTableTagDataEntry)entry);
break;
case IccTypeSignature.Curve:
count += this.WriteCurveTagDataEntry(entry as IccCurveTagDataEntry);
count += this.WriteCurveTagDataEntry((IccCurveTagDataEntry)entry);
break;
case IccTypeSignature.Data:
count += this.WriteDataTagDataEntry(entry as IccDataTagDataEntry);
count += this.WriteDataTagDataEntry((IccDataTagDataEntry)entry);
break;
case IccTypeSignature.DateTime:
count += this.WriteDateTimeTagDataEntry(entry as IccDateTimeTagDataEntry);
count += this.WriteDateTimeTagDataEntry((IccDateTimeTagDataEntry)entry);
break;
case IccTypeSignature.Lut16:
count += this.WriteLut16TagDataEntry(entry as IccLut16TagDataEntry);
count += this.WriteLut16TagDataEntry((IccLut16TagDataEntry)entry);
break;
case IccTypeSignature.Lut8:
count += this.WriteLut8TagDataEntry(entry as IccLut8TagDataEntry);
count += this.WriteLut8TagDataEntry((IccLut8TagDataEntry)entry);
break;
case IccTypeSignature.LutAToB:
count += this.WriteLutAtoBTagDataEntry(entry as IccLutAToBTagDataEntry);
count += this.WriteLutAtoBTagDataEntry((IccLutAToBTagDataEntry)entry);
break;
case IccTypeSignature.LutBToA:
count += this.WriteLutBtoATagDataEntry(entry as IccLutBToATagDataEntry);
count += this.WriteLutBtoATagDataEntry((IccLutBToATagDataEntry)entry);
break;
case IccTypeSignature.Measurement:
count += this.WriteMeasurementTagDataEntry(entry as IccMeasurementTagDataEntry);
count += this.WriteMeasurementTagDataEntry((IccMeasurementTagDataEntry)entry);
break;
case IccTypeSignature.MultiLocalizedUnicode:
count += this.WriteMultiLocalizedUnicodeTagDataEntry(entry as IccMultiLocalizedUnicodeTagDataEntry);
count += this.WriteMultiLocalizedUnicodeTagDataEntry((IccMultiLocalizedUnicodeTagDataEntry)entry);
break;
case IccTypeSignature.MultiProcessElements:
count += this.WriteMultiProcessElementsTagDataEntry(entry as IccMultiProcessElementsTagDataEntry);
count += this.WriteMultiProcessElementsTagDataEntry((IccMultiProcessElementsTagDataEntry)entry);
break;
case IccTypeSignature.NamedColor2:
count += this.WriteNamedColor2TagDataEntry(entry as IccNamedColor2TagDataEntry);
count += this.WriteNamedColor2TagDataEntry((IccNamedColor2TagDataEntry)entry);
break;
case IccTypeSignature.ParametricCurve:
count += this.WriteParametricCurveTagDataEntry(entry as IccParametricCurveTagDataEntry);
count += this.WriteParametricCurveTagDataEntry((IccParametricCurveTagDataEntry)entry);
break;
case IccTypeSignature.ProfileSequenceDesc:
count += this.WriteProfileSequenceDescTagDataEntry(entry as IccProfileSequenceDescTagDataEntry);
count += this.WriteProfileSequenceDescTagDataEntry((IccProfileSequenceDescTagDataEntry)entry);
break;
case IccTypeSignature.ProfileSequenceIdentifier:
count += this.WriteProfileSequenceIdentifierTagDataEntry(entry as IccProfileSequenceIdentifierTagDataEntry);
count += this.WriteProfileSequenceIdentifierTagDataEntry((IccProfileSequenceIdentifierTagDataEntry)entry);
break;
case IccTypeSignature.ResponseCurveSet16:
count += this.WriteResponseCurveSet16TagDataEntry(entry as IccResponseCurveSet16TagDataEntry);
count += this.WriteResponseCurveSet16TagDataEntry((IccResponseCurveSet16TagDataEntry)entry);
break;
case IccTypeSignature.S15Fixed16Array:
count += this.WriteFix16ArrayTagDataEntry(entry as IccFix16ArrayTagDataEntry);
count += this.WriteFix16ArrayTagDataEntry((IccFix16ArrayTagDataEntry)entry);
break;
case IccTypeSignature.Signature:
count += this.WriteSignatureTagDataEntry(entry as IccSignatureTagDataEntry);
count += this.WriteSignatureTagDataEntry((IccSignatureTagDataEntry)entry);
break;
case IccTypeSignature.Text:
count += this.WriteTextTagDataEntry(entry as IccTextTagDataEntry);
count += this.WriteTextTagDataEntry((IccTextTagDataEntry)entry);
break;
case IccTypeSignature.U16Fixed16Array:
count += this.WriteUFix16ArrayTagDataEntry(entry as IccUFix16ArrayTagDataEntry);
count += this.WriteUFix16ArrayTagDataEntry((IccUFix16ArrayTagDataEntry)entry);
break;
case IccTypeSignature.UInt16Array:
count += this.WriteUInt16ArrayTagDataEntry(entry as IccUInt16ArrayTagDataEntry);
count += this.WriteUInt16ArrayTagDataEntry((IccUInt16ArrayTagDataEntry)entry);
break;
case IccTypeSignature.UInt32Array:
count += this.WriteUInt32ArrayTagDataEntry(entry as IccUInt32ArrayTagDataEntry);
count += this.WriteUInt32ArrayTagDataEntry((IccUInt32ArrayTagDataEntry)entry);
break;
case IccTypeSignature.UInt64Array:
count += this.WriteUInt64ArrayTagDataEntry(entry as IccUInt64ArrayTagDataEntry);
count += this.WriteUInt64ArrayTagDataEntry((IccUInt64ArrayTagDataEntry)entry);
break;
case IccTypeSignature.UInt8Array:
count += this.WriteUInt8ArrayTagDataEntry(entry as IccUInt8ArrayTagDataEntry);
count += this.WriteUInt8ArrayTagDataEntry((IccUInt8ArrayTagDataEntry)entry);
break;
case IccTypeSignature.ViewingConditions:
count += this.WriteViewingConditionsTagDataEntry(entry as IccViewingConditionsTagDataEntry);
count += this.WriteViewingConditionsTagDataEntry((IccViewingConditionsTagDataEntry)entry);
break;
case IccTypeSignature.Xyz:
count += this.WriteXyzTagDataEntry(entry as IccXyzTagDataEntry);
count += this.WriteXyzTagDataEntry((IccXyzTagDataEntry)entry);
break;

// V2 Types:
case IccTypeSignature.TextDescription:
count += this.WriteTextDescriptionTagDataEntry(entry as IccTextDescriptionTagDataEntry);
count += this.WriteTextDescriptionTagDataEntry((IccTextDescriptionTagDataEntry)entry);
break;
case IccTypeSignature.CrdInfo:
count += this.WriteCrdInfoTagDataEntry(entry as IccCrdInfoTagDataEntry);
count += this.WriteCrdInfoTagDataEntry((IccCrdInfoTagDataEntry)entry);
break;
case IccTypeSignature.Screening:
count += this.WriteScreeningTagDataEntry(entry as IccScreeningTagDataEntry);
count += this.WriteScreeningTagDataEntry((IccScreeningTagDataEntry)entry);
break;
case IccTypeSignature.UcrBg:
count += this.WriteUcrBgTagDataEntry(entry as IccUcrBgTagDataEntry);
count += this.WriteUcrBgTagDataEntry((IccUcrBgTagDataEntry)entry);
break;

// Unsupported or unknown
Expand Down