mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
272 lines
14 KiB
272 lines
14 KiB
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
namespace SixLabors.ImageSharp.Tests.TestDataIcc;
|
|
|
|
internal static class IccTestDataPrimitives
|
|
{
|
|
public static readonly byte[] UInt160 = { 0x00, 0x00 };
|
|
public static readonly byte[] UInt161 = { 0x00, 0x01 };
|
|
public static readonly byte[] UInt162 = { 0x00, 0x02 };
|
|
public static readonly byte[] UInt163 = { 0x00, 0x03 };
|
|
public static readonly byte[] UInt164 = { 0x00, 0x04 };
|
|
public static readonly byte[] UInt165 = { 0x00, 0x05 };
|
|
public static readonly byte[] UInt166 = { 0x00, 0x06 };
|
|
public static readonly byte[] UInt167 = { 0x00, 0x07 };
|
|
public static readonly byte[] UInt168 = { 0x00, 0x08 };
|
|
public static readonly byte[] UInt169 = { 0x00, 0x09 };
|
|
public static readonly byte[] UInt1632768 = { 0x80, 0x00 };
|
|
public static readonly byte[] UInt16Max = { 0xFF, 0xFF };
|
|
|
|
public static readonly byte[] Int16Min = { 0x80, 0x00 };
|
|
public static readonly byte[] Int160 = { 0x00, 0x00 };
|
|
public static readonly byte[] Int161 = { 0x00, 0x01 };
|
|
public static readonly byte[] Int162 = { 0x00, 0x02 };
|
|
public static readonly byte[] Int163 = { 0x00, 0x03 };
|
|
public static readonly byte[] Int164 = { 0x00, 0x04 };
|
|
public static readonly byte[] Int165 = { 0x00, 0x05 };
|
|
public static readonly byte[] Int166 = { 0x00, 0x06 };
|
|
public static readonly byte[] Int167 = { 0x00, 0x07 };
|
|
public static readonly byte[] Int168 = { 0x00, 0x08 };
|
|
public static readonly byte[] Int169 = { 0x00, 0x09 };
|
|
public static readonly byte[] Int16Max = { 0x7F, 0xFF };
|
|
|
|
public static readonly byte[] UInt320 = { 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] UInt321 = { 0x00, 0x00, 0x00, 0x01 };
|
|
public static readonly byte[] UInt322 = { 0x00, 0x00, 0x00, 0x02 };
|
|
public static readonly byte[] UInt323 = { 0x00, 0x00, 0x00, 0x03 };
|
|
public static readonly byte[] UInt324 = { 0x00, 0x00, 0x00, 0x04 };
|
|
public static readonly byte[] UInt325 = { 0x00, 0x00, 0x00, 0x05 };
|
|
public static readonly byte[] UInt326 = { 0x00, 0x00, 0x00, 0x06 };
|
|
public static readonly byte[] UInt327 = { 0x00, 0x00, 0x00, 0x07 };
|
|
public static readonly byte[] UInt328 = { 0x00, 0x00, 0x00, 0x08 };
|
|
public static readonly byte[] UInt329 = { 0x00, 0x00, 0x00, 0x09 };
|
|
public static readonly byte[] UInt32Max = { 0xFF, 0xFF, 0xFF, 0xFF };
|
|
|
|
public static readonly uint UInt32ValRand1 = 1749014123;
|
|
public static readonly uint UInt32ValRand2 = 3870560989;
|
|
public static readonly uint UInt32ValRand3 = 1050090334;
|
|
public static readonly uint UInt32ValRand4 = 3550252874;
|
|
|
|
public static readonly byte[] UInt32Rand1 = { 0x68, 0x3F, 0xD6, 0x6B };
|
|
public static readonly byte[] UInt32Rand2 = { 0xE6, 0xB4, 0x12, 0xDD };
|
|
public static readonly byte[] UInt32Rand3 = { 0x3E, 0x97, 0x1B, 0x5E };
|
|
public static readonly byte[] UInt32Rand4 = { 0xD3, 0x9C, 0x8F, 0x4A };
|
|
|
|
public static readonly byte[] Int32Min = { 0x80, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Int320 = { 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Int321 = { 0x00, 0x00, 0x00, 0x01 };
|
|
public static readonly byte[] Int322 = { 0x00, 0x00, 0x00, 0x02 };
|
|
public static readonly byte[] Int323 = { 0x00, 0x00, 0x00, 0x03 };
|
|
public static readonly byte[] Int324 = { 0x00, 0x00, 0x00, 0x04 };
|
|
public static readonly byte[] Int325 = { 0x00, 0x00, 0x00, 0x05 };
|
|
public static readonly byte[] Int326 = { 0x00, 0x00, 0x00, 0x06 };
|
|
public static readonly byte[] Int327 = { 0x00, 0x00, 0x00, 0x07 };
|
|
public static readonly byte[] Int328 = { 0x00, 0x00, 0x00, 0x08 };
|
|
public static readonly byte[] Int329 = { 0x00, 0x00, 0x00, 0x09 };
|
|
public static readonly byte[] Int32Max = { 0x7F, 0xFF, 0xFF, 0xFF };
|
|
|
|
public static readonly byte[] UInt640 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] UInt641 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
|
|
public static readonly byte[] UInt642 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 };
|
|
public static readonly byte[] UInt643 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
|
|
public static readonly byte[] UInt644 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 };
|
|
public static readonly byte[] UInt645 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05 };
|
|
public static readonly byte[] UInt646 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06 };
|
|
public static readonly byte[] UInt647 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 };
|
|
public static readonly byte[] UInt648 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 };
|
|
public static readonly byte[] UInt649 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09 };
|
|
public static readonly byte[] UInt64Max = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
|
|
|
public static readonly byte[] Int64Min = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Int640 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Int641 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
|
|
public static readonly byte[] Int642 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 };
|
|
public static readonly byte[] Int643 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
|
|
public static readonly byte[] Int644 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 };
|
|
public static readonly byte[] Int645 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05 };
|
|
public static readonly byte[] Int646 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06 };
|
|
public static readonly byte[] Int647 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 };
|
|
public static readonly byte[] Int648 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 };
|
|
public static readonly byte[] Int649 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09 };
|
|
public static readonly byte[] Int64Max = { 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
|
|
|
public static readonly byte[] SingleMin = { 0xFF, 0x7F, 0xFF, 0xFF };
|
|
public static readonly byte[] Single0 = { 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Single1 = { 0x3F, 0x80, 0x00, 0x00 };
|
|
public static readonly byte[] Single2 = { 0x40, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Single3 = { 0x40, 0x40, 0x00, 0x00 };
|
|
public static readonly byte[] Single4 = { 0x40, 0x80, 0x00, 0x00 };
|
|
public static readonly byte[] Single5 = { 0x40, 0xA0, 0x00, 0x00 };
|
|
public static readonly byte[] Single6 = { 0x40, 0xC0, 0x00, 0x00 };
|
|
public static readonly byte[] Single7 = { 0x40, 0xE0, 0x00, 0x00 };
|
|
public static readonly byte[] Single8 = { 0x41, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Single9 = { 0x41, 0x10, 0x00, 0x00 };
|
|
public static readonly byte[] SingleMax = { 0x7F, 0x7F, 0xFF, 0xFF };
|
|
|
|
public static readonly byte[] DoubleMin = { 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
|
public static readonly byte[] Double0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Double1 = { 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] DoubleMax = { 0x7F, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
|
|
|
public const float Fix16ValMin = short.MinValue;
|
|
public const float Fix16ValMax = short.MaxValue + (65535f / 65536f);
|
|
|
|
public static readonly byte[] Fix16Min = { 0x80, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Fix160 = { 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] Fix161 = { 0x00, 0x01, 0x00, 0x00 };
|
|
public static readonly byte[] Fix162 = { 0x00, 0x02, 0x00, 0x00 };
|
|
public static readonly byte[] Fix163 = { 0x00, 0x03, 0x00, 0x00 };
|
|
public static readonly byte[] Fix164 = { 0x00, 0x04, 0x00, 0x00 };
|
|
public static readonly byte[] Fix165 = { 0x00, 0x05, 0x00, 0x00 };
|
|
public static readonly byte[] Fix166 = { 0x00, 0x06, 0x00, 0x00 };
|
|
public static readonly byte[] Fix167 = { 0x00, 0x07, 0x00, 0x00 };
|
|
public static readonly byte[] Fix168 = { 0x00, 0x08, 0x00, 0x00 };
|
|
public static readonly byte[] Fix169 = { 0x00, 0x09, 0x00, 0x00 };
|
|
public static readonly byte[] Fix16Max = { 0x7F, 0xFF, 0xFF, 0xFF };
|
|
|
|
public static readonly object[][] Fix16TestData =
|
|
{
|
|
new object[] { Fix16Min, Fix16ValMin },
|
|
new object[] { Fix160, 0 },
|
|
new object[] { Fix164, 4 },
|
|
new object[] { Fix16Max, Fix16ValMax },
|
|
};
|
|
|
|
public const float UFix16ValMin = 0;
|
|
public const float UFix16ValMax = ushort.MaxValue + (65535f / 65536f);
|
|
|
|
public static readonly byte[] UFix160 = { 0x00, 0x00, 0x00, 0x00 };
|
|
public static readonly byte[] UFix161 = { 0x00, 0x01, 0x00, 0x00 };
|
|
public static readonly byte[] UFix162 = { 0x00, 0x02, 0x00, 0x00 };
|
|
public static readonly byte[] UFix163 = { 0x00, 0x03, 0x00, 0x00 };
|
|
public static readonly byte[] UFix164 = { 0x00, 0x04, 0x00, 0x00 };
|
|
public static readonly byte[] UFix165 = { 0x00, 0x05, 0x00, 0x00 };
|
|
public static readonly byte[] UFix166 = { 0x00, 0x06, 0x00, 0x00 };
|
|
public static readonly byte[] UFix167 = { 0x00, 0x07, 0x00, 0x00 };
|
|
public static readonly byte[] UFix168 = { 0x00, 0x08, 0x00, 0x00 };
|
|
public static readonly byte[] UFix169 = { 0x00, 0x09, 0x00, 0x00 };
|
|
public static readonly byte[] UFix16Max = { 0xFF, 0xFF, 0xFF, 0xFF };
|
|
|
|
public static readonly object[][] UFix16TestData =
|
|
{
|
|
new object[] { UFix160, 0 },
|
|
new object[] { UFix164, 4 },
|
|
new object[] { UFix16Max, UFix16ValMax },
|
|
};
|
|
|
|
public const float U1Fix15ValMin = 0;
|
|
public const float U1Fix15ValMax = 1f + (32767f / 32768f);
|
|
|
|
public static readonly byte[] U1Fix150 = { 0x00, 0x00 };
|
|
public static readonly byte[] U1Fix151 = { 0x80, 0x00 };
|
|
public static readonly byte[] U1Fix15Max = { 0xFF, 0xFF };
|
|
|
|
public static readonly object[][] U1Fix15TestData =
|
|
{
|
|
new object[] { U1Fix150, 0 },
|
|
new object[] { U1Fix151, 1 },
|
|
new object[] { U1Fix15Max, U1Fix15ValMax },
|
|
};
|
|
|
|
public const float UFix8ValMin = 0;
|
|
public const float UFix8ValMax = byte.MaxValue + (255f / 256f);
|
|
|
|
public static readonly byte[] UFix80 = { 0x00, 0x00 };
|
|
public static readonly byte[] UFix81 = { 0x01, 0x00 };
|
|
public static readonly byte[] UFix82 = { 0x02, 0x00 };
|
|
public static readonly byte[] UFix83 = { 0x03, 0x00 };
|
|
public static readonly byte[] UFix84 = { 0x04, 0x00 };
|
|
public static readonly byte[] UFix85 = { 0x05, 0x00 };
|
|
public static readonly byte[] UFix86 = { 0x06, 0x00 };
|
|
public static readonly byte[] UFix87 = { 0x07, 0x00 };
|
|
public static readonly byte[] UFix88 = { 0x08, 0x00 };
|
|
public static readonly byte[] UFix89 = { 0x09, 0x00 };
|
|
public static readonly byte[] UFix8Max = { 0xFF, 0xFF };
|
|
|
|
public static readonly object[][] UFix8TestData =
|
|
{
|
|
new object[] { UFix80, 0 },
|
|
new object[] { UFix84, 4 },
|
|
new object[] { UFix8Max, UFix8ValMax },
|
|
};
|
|
|
|
public const string AsciiValRand = "aBcdEf1234";
|
|
public const string AsciiValRand1 = "Ecf3a";
|
|
public const string AsciiValRand2 = "2Bd4c";
|
|
public const string AsciiValRand3 = "cad14";
|
|
public const string AsciiValRand4 = "fd4E1";
|
|
public const string AsciiValRandLength4 = "aBcd";
|
|
public const string AsciiValNullRand = "aBcd\0Ef\0123";
|
|
|
|
public static readonly byte[] AsciiRand = { 97, 66, 99, 100, 69, 102, 49, 50, 51, 52 };
|
|
public static readonly byte[] AsciiRand1 = { 69, 99, 102, 51, 97 };
|
|
public static readonly byte[] AsciiRand2 = { 50, 66, 100, 52, 99 };
|
|
public static readonly byte[] AsciiRand3 = { 99, 97, 100, 49, 52 };
|
|
public static readonly byte[] AsciiRand4 = { 102, 100, 52, 69, 49 };
|
|
public static readonly byte[] AsciiRandLength4 = { 97, 66, 99, 100 };
|
|
public static readonly byte[] AsciiPaddedRand = { 97, 66, 99, 100, 69, 102, 49, 50, 51, 52, 0, 0, 0, 0 };
|
|
public static readonly byte[] AsciiNullRand = { 97, 66, 99, 100, 0, 69, 102, 0, 49, 50, 51 };
|
|
|
|
public const int AsciiRandLength = 10;
|
|
public const int AsciiPaddedRandLength = 14;
|
|
public const int AsciiNullRandLength = 11;
|
|
public const int AsciiNullRandLengthNoNull = 4;
|
|
|
|
public static readonly object[][] AsciiTestData =
|
|
{
|
|
new object[] { AsciiRand, AsciiRandLength, AsciiValRand },
|
|
new object[] { AsciiRand, 4, AsciiValRandLength4 },
|
|
new object[] { AsciiNullRand, AsciiNullRandLengthNoNull, AsciiValRandLength4 },
|
|
};
|
|
|
|
public static readonly object[][] AsciiWriteTestData =
|
|
{
|
|
new object[] { AsciiRand, AsciiValRand },
|
|
new object[] { AsciiNullRand, AsciiValNullRand },
|
|
};
|
|
|
|
public static readonly object[][] AsciiPaddingTestData =
|
|
{
|
|
new object[] { AsciiPaddedRand, AsciiPaddedRandLength, AsciiValRand, true },
|
|
new object[] { AsciiRandLength4, 4, AsciiValRand, false },
|
|
};
|
|
|
|
public const string UnicodeValRand1 = ".6Abäñ$€β𐐷𤭢";
|
|
public const string UnicodeValRand2 = ".6Abäñ";
|
|
public const string UnicodeValRand3 = "$€β𐐷𤭢";
|
|
|
|
public static readonly byte[] UnicodeRand1 =
|
|
{
|
|
0x00, 0x2e, // .
|
|
0x00, 0x36, // 6
|
|
0x00, 0x41, // A
|
|
0x00, 0x62, // b
|
|
0x00, 0xe4, // ä
|
|
0x00, 0xf1, // ñ
|
|
0x00, 0x24, // $
|
|
0x20, 0xAC, // €
|
|
0x03, 0xb2, // β
|
|
0xD8, 0x01, 0xDC, 0x37, // 𐐷
|
|
0xD8, 0x52, 0xDF, 0x62, // 𤭢
|
|
};
|
|
|
|
public static readonly byte[] UnicodeRand2 =
|
|
{
|
|
0x00, 0x2e, // .
|
|
0x00, 0x36, // 6
|
|
0x00, 0x41, // A
|
|
0x00, 0x62, // b
|
|
0x00, 0xe4, // ä
|
|
0x00, 0xf1, // ñ
|
|
};
|
|
|
|
public static readonly byte[] UnicodeRand3 =
|
|
{
|
|
0x00, 0x24, // $
|
|
0x20, 0xAC, // €
|
|
0x03, 0xb2, // β
|
|
0xD8, 0x01, 0xDC, 0x37, // 𐐷
|
|
0xD8, 0x52, 0xDF, 0x62, // 𤭢
|
|
};
|
|
}
|
|
|