BitMiracle.LibTiff.Classic.Tiff.FindCodec C# (CSharp) Method

FindCodec() public method

Retrieves the codec registered for the specified compression scheme.

LibTiff.Net supports a variety of compression schemes implemented by software codecs. Each codec adheres to a modular interface that provides for the decoding and encoding of image data; as well as some other methods for initialization, setup, cleanup, and the control of default strip and tile sizes. Codecs are identified by the associated value of the TiffTag.COMPRESSION tag.

Other compression schemes may be registered. Registered schemes can also override the built-in versions provided by the library.

public FindCodec ( Compression scheme ) : TiffCodec
scheme Compression The compression scheme.
return TiffCodec
        public TiffCodec FindCodec(Compression scheme)
        {
            for (codecList list = m_registeredCodecs; list != null; list = list.next)
            {
                if (list.codec.m_scheme == scheme)
                    return list.codec;
            }

            for (int i = 0; m_builtInCodecs[i] != null; i++)
            {
                TiffCodec codec = m_builtInCodecs[i];
                if (codec.m_scheme == scheme)
                    return codec;
            }

            return null;
        }
Tiff