/// <summary> /// Removes specified codec from a list of registered codecs. /// </summary> /// <param name="codec">The codec to remove from a list of registered codecs.</param> public void UnRegisterCodec(TiffCodec codec) { if (m_registeredCodecs == null) return; codecList temp; if (m_registeredCodecs.codec == codec) { temp = m_registeredCodecs.next; m_registeredCodecs = temp; return; } for (codecList list = m_registeredCodecs; list != null; list = list.next) { if (list.next != null) { if (list.next.codec == codec) { temp = list.next.next; list.next = temp; return; } } } ErrorExt(this, 0, "UnRegisterCodec", "Cannot remove compression scheme {0}; not registered", codec.m_name); }
/// <summary> /// Adds specified codec to a list of registered codec. /// </summary> /// <param name="codec">The codec to register.</param> /// <remarks> /// This method can be used to augment or override the set of codecs available to an /// application. If the <paramref name="codec"/> is for a scheme that already has a /// registered codec then it is overridden and any images with data encoded with this /// compression scheme will be decoded using the supplied codec. /// </remarks> public void RegisterCodec(TiffCodec codec) { if (codec == null) throw new ArgumentNullException("codec"); codecList list = new codecList(); list.codec = codec; list.next = m_registeredCodecs; m_registeredCodecs = list; }