/// <inheritdoc /> public TiffPixelSpanHandle <TSource> GetColumnSpan(int colIndex, int start, int length) { if (_writer is null) { ThrowObjectDisposedException(); } int width = _writer.Width; int height = _writer.Height; if ((uint)colIndex >= (uint)width) { throw new ArgumentOutOfRangeException(nameof(colIndex)); } if ((uint)start > (uint)height) { throw new ArgumentOutOfRangeException(nameof(start)); } if (length < 0 || (uint)(start + length) > (uint)height) { throw new ArgumentOutOfRangeException(nameof(length)); } ConverterHandle?handle = Interlocked.Exchange(ref _cachedHandle, null); if (handle is null) { handle = new ConverterHandle(); } handle.SetHandle(this, _writer.GetColumnSpan(colIndex, start, length), _canInPlaceConvert); return(handle); }
static MaterialConverterBase GetConverter(ConverterHandle handler) { switch (handler) { case ConverterHandle.BOTW: return(new MaterialConverterBOTW()); case ConverterHandle.MK8: return(new MaterialConverterMK8()); default: return(new MaterialConverterBase()); } }
internal static void ConvertToWiiUMaterial(Material material, ConverterHandle handler) { MaterialConverterBase converter = GetConverter(handler); converter.ConvertToWiiUMaterial(material); }