Пример #1
0
        internal virtual Array searchData(int tag)
        {
            TiffDirData dirData = search(tag);

            if (dirData == null)
            {
                return(Array.CreateInstance(typeof(object), 0));
            }
            return(dirData.Data.getContent());
        }
Пример #2
0
        /// <summary>
        /// Read a piece of info.
        /// </summary>
        /// <param name="tag">Tag of the info to be read.</param>
        /// <param name="fid">Zero-based index of images.</param>
        /// <returns>An instance of TIFFinfo that contains the info.</returns>
        public virtual TiffData getInfo(int tag, int fid)
        {
            if (fid < 0 || fid >= IFDs.Length)
            {
                return(null);
            }
            TiffStruct fileData = IFDs[fid];

            TiffDirData dir = fileData.search(tag);

            if (dir == null)
            {
                return(null);
            }
            if (dir.Offset > 0)
            {
                reader.BaseStream.Seek(dir.Offset, System.IO.SeekOrigin.Begin);
                dir.readData(reader);
            }
            return(dir.Data);
        }
Пример #3
0
        internal virtual void setFromInfoCollection(TiffInfoCollection allInfo)
        {
            List <TiffDirData> dirList = new List <TiffDirData>();

            foreach (KeyValuePair <ushort, TiffInfo> pair in allInfo.InfoCollection)
            {
                if (pair.Value.Data == null)
                {
                    continue;
                }
                if (pair.Value.Data.Count == 0)
                {
                    continue;
                }
                TiffDirData temp = new TiffDirData();
                temp.Tag  = pair.Value.Tag;
                temp.Data = pair.Value.Data.Clone() as TiffData;
                dirList.Add(temp);
            }
            dirArray = dirList.ToArray();
            sort();
        }