@@ -20,82 +20,46 @@ internal sealed partial class IccDataReader
2020 public IccTagDataEntry ReadTagDataEntry ( IccTagTableEntry info )
2121 {
2222 this . currentIndex = ( int ) info . Offset ;
23- switch ( this . ReadTagDataEntryHeader ( ) )
24- {
25- case IccTypeSignature . Chromaticity :
26- return this . ReadChromaticityTagDataEntry ( ) ;
27- case IccTypeSignature . ColorantOrder :
28- return this . ReadColorantOrderTagDataEntry ( ) ;
29- case IccTypeSignature . ColorantTable :
30- return this . ReadColorantTableTagDataEntry ( ) ;
31- case IccTypeSignature . Curve :
32- return this . ReadCurveTagDataEntry ( ) ;
33- case IccTypeSignature . Data :
34- return this . ReadDataTagDataEntry ( info . DataSize ) ;
35- case IccTypeSignature . DateTime :
36- return this . ReadDateTimeTagDataEntry ( ) ;
37- case IccTypeSignature . Lut16 :
38- return this . ReadLut16TagDataEntry ( ) ;
39- case IccTypeSignature . Lut8 :
40- return this . ReadLut8TagDataEntry ( ) ;
41- case IccTypeSignature . LutAToB :
42- return this . ReadLutAtoBTagDataEntry ( ) ;
43- case IccTypeSignature . LutBToA :
44- return this . ReadLutBtoATagDataEntry ( ) ;
45- case IccTypeSignature . Measurement :
46- return this . ReadMeasurementTagDataEntry ( ) ;
47- case IccTypeSignature . MultiLocalizedUnicode :
48- return this . ReadMultiLocalizedUnicodeTagDataEntry ( ) ;
49- case IccTypeSignature . MultiProcessElements :
50- return this . ReadMultiProcessElementsTagDataEntry ( ) ;
51- case IccTypeSignature . NamedColor2 :
52- return this . ReadNamedColor2TagDataEntry ( ) ;
53- case IccTypeSignature . ParametricCurve :
54- return this . ReadParametricCurveTagDataEntry ( ) ;
55- case IccTypeSignature . ProfileSequenceDesc :
56- return this . ReadProfileSequenceDescTagDataEntry ( ) ;
57- case IccTypeSignature . ProfileSequenceIdentifier :
58- return this . ReadProfileSequenceIdentifierTagDataEntry ( ) ;
59- case IccTypeSignature . ResponseCurveSet16 :
60- return this . ReadResponseCurveSet16TagDataEntry ( ) ;
61- case IccTypeSignature . S15Fixed16Array :
62- return this . ReadFix16ArrayTagDataEntry ( info . DataSize ) ;
63- case IccTypeSignature . Signature :
64- return this . ReadSignatureTagDataEntry ( ) ;
65- case IccTypeSignature . Text :
66- return this . ReadTextTagDataEntry ( info . DataSize ) ;
67- case IccTypeSignature . U16Fixed16Array :
68- return this . ReadUFix16ArrayTagDataEntry ( info . DataSize ) ;
69- case IccTypeSignature . UInt16Array :
70- return this . ReadUInt16ArrayTagDataEntry ( info . DataSize ) ;
71- case IccTypeSignature . UInt32Array :
72- return this . ReadUInt32ArrayTagDataEntry ( info . DataSize ) ;
73- case IccTypeSignature . UInt64Array :
74- return this . ReadUInt64ArrayTagDataEntry ( info . DataSize ) ;
75- case IccTypeSignature . UInt8Array :
76- return this . ReadUInt8ArrayTagDataEntry ( info . DataSize ) ;
77- case IccTypeSignature . ViewingConditions :
78- return this . ReadViewingConditionsTagDataEntry ( ) ;
79- case IccTypeSignature . Xyz :
80- return this . ReadXyzTagDataEntry ( info . DataSize ) ;
23+ return this . ReadTagDataEntryHeader ( ) switch
24+ {
25+ IccTypeSignature . Chromaticity => this . ReadChromaticityTagDataEntry ( ) ,
26+ IccTypeSignature . ColorantOrder => this . ReadColorantOrderTagDataEntry ( ) ,
27+ IccTypeSignature . ColorantTable => this . ReadColorantTableTagDataEntry ( ) ,
28+ IccTypeSignature . Curve => this . ReadCurveTagDataEntry ( ) ,
29+ IccTypeSignature . Data => this . ReadDataTagDataEntry ( info . DataSize ) ,
30+ IccTypeSignature . DateTime => this . ReadDateTimeTagDataEntry ( ) ,
31+ IccTypeSignature . Lut16 => this . ReadLut16TagDataEntry ( ) ,
32+ IccTypeSignature . Lut8 => this . ReadLut8TagDataEntry ( ) ,
33+ IccTypeSignature . LutAToB => this . ReadLutAtoBTagDataEntry ( ) ,
34+ IccTypeSignature . LutBToA => this . ReadLutBtoATagDataEntry ( ) ,
35+ IccTypeSignature . Measurement => this . ReadMeasurementTagDataEntry ( ) ,
36+ IccTypeSignature . MultiLocalizedUnicode => this . ReadMultiLocalizedUnicodeTagDataEntry ( ) ,
37+ IccTypeSignature . MultiProcessElements => this . ReadMultiProcessElementsTagDataEntry ( ) ,
38+ IccTypeSignature . NamedColor2 => this . ReadNamedColor2TagDataEntry ( ) ,
39+ IccTypeSignature . ParametricCurve => this . ReadParametricCurveTagDataEntry ( ) ,
40+ IccTypeSignature . ProfileSequenceDesc => this . ReadProfileSequenceDescTagDataEntry ( ) ,
41+ IccTypeSignature . ProfileSequenceIdentifier => this . ReadProfileSequenceIdentifierTagDataEntry ( ) ,
42+ IccTypeSignature . ResponseCurveSet16 => this . ReadResponseCurveSet16TagDataEntry ( ) ,
43+ IccTypeSignature . S15Fixed16Array => this . ReadFix16ArrayTagDataEntry ( info . DataSize ) ,
44+ IccTypeSignature . Signature => this . ReadSignatureTagDataEntry ( ) ,
45+ IccTypeSignature . Text => this . ReadTextTagDataEntry ( info . DataSize ) ,
46+ IccTypeSignature . U16Fixed16Array => this . ReadUFix16ArrayTagDataEntry ( info . DataSize ) ,
47+ IccTypeSignature . UInt16Array => this . ReadUInt16ArrayTagDataEntry ( info . DataSize ) ,
48+ IccTypeSignature . UInt32Array => this . ReadUInt32ArrayTagDataEntry ( info . DataSize ) ,
49+ IccTypeSignature . UInt64Array => this . ReadUInt64ArrayTagDataEntry ( info . DataSize ) ,
50+ IccTypeSignature . UInt8Array => this . ReadUInt8ArrayTagDataEntry ( info . DataSize ) ,
51+ IccTypeSignature . ViewingConditions => this . ReadViewingConditionsTagDataEntry ( ) ,
52+ IccTypeSignature . Xyz => this . ReadXyzTagDataEntry ( info . DataSize ) ,
8153
8254 // V2 Types:
83- case IccTypeSignature . TextDescription :
84- return this . ReadTextDescriptionTagDataEntry ( ) ;
85- case IccTypeSignature . CrdInfo :
86- return this . ReadCrdInfoTagDataEntry ( ) ;
87- case IccTypeSignature . Screening :
88- return this . ReadScreeningTagDataEntry ( ) ;
89- case IccTypeSignature . UcrBg :
90- return this . ReadUcrBgTagDataEntry ( info . DataSize ) ;
55+ IccTypeSignature . TextDescription => this . ReadTextDescriptionTagDataEntry ( ) ,
56+ IccTypeSignature . CrdInfo => this . ReadCrdInfoTagDataEntry ( ) ,
57+ IccTypeSignature . Screening => this . ReadScreeningTagDataEntry ( ) ,
58+ IccTypeSignature . UcrBg => this . ReadUcrBgTagDataEntry ( info . DataSize ) ,
9159
9260 // Unsupported or unknown
93- case IccTypeSignature . DeviceSettings :
94- case IccTypeSignature . NamedColor :
95- case IccTypeSignature . Unknown :
96- default :
97- return this . ReadUnknownTagDataEntry ( info . DataSize ) ;
98- }
61+ _ => this . ReadUnknownTagDataEntry ( info . DataSize ) ,
62+ } ;
9963 }
10064
10165 /// <summary>
@@ -477,7 +441,7 @@ public IccMultiLocalizedUnicodeTagDataEntry ReadMultiLocalizedUnicodeTagDataEntr
477441
478442 return new IccMultiLocalizedUnicodeTagDataEntry ( text ) ;
479443
480- CultureInfo ReadCulture ( string language , string country )
444+ static CultureInfo ReadCulture ( string language , string country )
481445 {
482446 if ( string . IsNullOrWhiteSpace ( language ) )
483447 {
0 commit comments