add acb&awb support

This commit is contained in:
1605296300@qq.com
2022-09-07 01:22:44 +08:00
parent d55c0ecd4d
commit 7607c8b4d2
57 changed files with 5676 additions and 34 deletions
@@ -0,0 +1,28 @@
using System;
namespace ClHcaSharp
{
internal static class JaggedArray
{
public static T CreateJaggedArray<T>(params int[] lengths)
{
return (T)InitJaggedArray(typeof(T).GetElementType(), lengths, 0);
}
private static object InitJaggedArray(Type type, int[] lengths, int arrayIndex)
{
Array array = Array.CreateInstance(type, lengths[arrayIndex]);
Type subElementType = type.GetElementType();
if (type.HasElementType)
{
for (int i = 0; i < lengths[arrayIndex]; i++)
{
array.SetValue(InitJaggedArray(subElementType, lengths, arrayIndex + 1), i);
}
}
return array;
}
}
}