private static MultiProcessElement GetElement(multiProcessElementSignature type, byte[] iccData, int idx, ushort InputChannelCount, ushort OutputChannelCount) { MultiProcessElement elem = null; switch (type) { case multiProcessElementSignature.CurveSet: elem = new CurveSetProcessElement(); break; case multiProcessElementSignature.CLUT: elem = new CLUTProcessElement(); break; case multiProcessElementSignature.Matrix: elem = new MatrixProcessElement(); break; case multiProcessElementSignature.bACS: elem = new bACSProcessElement(); break; case multiProcessElementSignature.eACS: elem = new eACSProcessElement(); break; default: throw new CorruptProfileException("MultiProcessElement"); } elem.GetElementData(iccData, idx, InputChannelCount, OutputChannelCount, BitConverter.IsLittleEndian); return(elem); }
internal static MultiProcessElement CreateElement(byte[] iccData, int idx, bool isLittleEndian = false) { //Tag signature (byte position 0 to 3) (4 to 7 are zero) multiProcessElementSignature t = (multiProcessElementSignature)HighEndianReader.GetUint32(iccData, idx); //Number of input channels (2 bytes) ushort InputChannelCount = HighEndianReader.GetUInt16(iccData, idx + 8); //Number of output channels (2 bytes) ushort OutputChannelCount = HighEndianReader.GetUInt16(iccData, idx + 10, isLittleEndian); return(GetElement(t, iccData, idx + 12, InputChannelCount, OutputChannelCount)); }
internal static MultiProcessElement CreateElement(int idx) { //Tag signature (byte position 0 to 3) (4 to 7 are zero) multiProcessElementSignature t = (multiProcessElementSignature)Helper.GetUInt32(idx); //Number of input channels (2 bytes) ushort InputChannelCount = Helper.GetUInt16(idx + 8); //Number of output channels (2 bytes) ushort OutputChannelCount = Helper.GetUInt16(idx + 10); return(GetElement(t, idx + 12, InputChannelCount, OutputChannelCount)); }
private static MultiProcessElement GetElement(multiProcessElementSignature type, int idx, ushort InputChannelCount, ushort OutputChannelCount) { switch (type) { case multiProcessElementSignature.CurveSet: return(new CurveSetProcessElement(idx, InputChannelCount, OutputChannelCount)); case multiProcessElementSignature.CLUT: return(new CLUTProcessElement(idx, InputChannelCount, OutputChannelCount)); case multiProcessElementSignature.Matrix: return(new MatrixProcessElement(idx, InputChannelCount, OutputChannelCount)); case multiProcessElementSignature.bACS: return(new bACSProcessElement(idx, InputChannelCount, OutputChannelCount)); case multiProcessElementSignature.eACS: return(new eACSProcessElement(idx, InputChannelCount, OutputChannelCount)); default: throw new CorruptProfileException("MultiProcessElement"); } }
private static MultiProcessElement GetElement(multiProcessElementSignature type, int idx, ushort InputChannelCount, ushort OutputChannelCount) { switch (type) { case multiProcessElementSignature.CurveSet: return new CurveSetProcessElement(idx, InputChannelCount, OutputChannelCount); case multiProcessElementSignature.CLUT: return new CLUTProcessElement(idx, InputChannelCount, OutputChannelCount); case multiProcessElementSignature.Matrix: return new MatrixProcessElement(idx, InputChannelCount, OutputChannelCount); case multiProcessElementSignature.bACS: return new bACSProcessElement(idx, InputChannelCount, OutputChannelCount); case multiProcessElementSignature.eACS: return new eACSProcessElement(idx, InputChannelCount, OutputChannelCount); default: throw new CorruptProfileException("MultiProcessElement"); } }