public static NativeArray <TImage> AllocateRgbChannels <TImage, TChannel>(Texture2D input, Allocator allocator, out ImageDataSplitRGB <TChannel> rgb) where TImage : struct where TChannel : struct { var data = input.GetRawTextureData <TImage>(); var red = new NativeArray <TChannel>(data.Length, allocator); var green = new NativeArray <TChannel>(data.Length, allocator); var blue = new NativeArray <TChannel>(data.Length, allocator); rgb = new ImageDataSplitRGB <TChannel>(red, green, blue, input.width, input.height); return(data); }
public void SetImageData(ImageDataSplitRGB <byte> data) { m_Data = data; }