Exemple #1
0
        private StciIndexed LoadStciIndexed(BinaryReader aReader, Ja2Data.StciHeader aHeader)
        {
            StciIndexed _newStciIndexed = new StciIndexed();

            Ja2Data.StciIndexed _stciIndexed = new Ja2Data.StciIndexed(aHeader);
            _stciIndexed.Load(aReader);

            Ja2Data.StciIndexedHeader _subHeader = (Ja2Data.StciIndexedHeader)aHeader.SubHeader;

            _newStciIndexed.BlueDepth         = _subHeader.BlueDepth;
            _newStciIndexed.GreenDepth        = _subHeader.GreenDepth;
            _newStciIndexed.NumberOfColours   = _subHeader.NumberOfColous;
            _newStciIndexed.NumberOfSubImages = (int)_subHeader.NumberOfSubImages;
            _newStciIndexed.RedDepth          = _subHeader.RedDepth;
            _newStciIndexed.Unused            = _subHeader.Unused;

            _newStciIndexed.DateCreated = DateTime.Now;
            _newStciIndexed.UserId      = this.FUserId;

            _newStciIndexed.Palette = _stciIndexed.Palette;

            for (int i = 0; i < _subHeader.NumberOfSubImages; i++)
            {
                StciIndexedSubImage _subImage = this.LoadSubImage(_stciIndexed.Images[i]);
                _subImage.StciIndexed = _newStciIndexed;
                this.FSubImages.Add(_subImage);
            }

            return(_newStciIndexed);
        }
Exemple #2
0
        private StciIndexedSubImage LoadSubImage(Ja2Data.StciSubImage aStciSubImage)
        {
            StciIndexedSubImage _subImage = new StciIndexedSubImage();

            if (aStciSubImage.AuxData != null)
            {
                AuxObjectData _auxData = this.LoadAuxData(aStciSubImage.AuxData);

                _subImage.AuxObjectData = _auxData;
                base.FAuxData.Add(_auxData);
            }

            UnstructuredData _data = new UnstructuredData();

            _data.Data        = aStciSubImage.ImageData;
            _data.UserId      = this.FUserId;
            _data.DateCreated = DateTime.Now;
            this.FUnstructuredData.Add(_data);
            _subImage.UnstructuredData = _data;

            _subImage.DataLength = aStciSubImage.Header.DataLength;
            _subImage.DataOffset = aStciSubImage.Header.DataOffset;
            _subImage.Height     = aStciSubImage.Header.Height;
            _subImage.OffsetX    = aStciSubImage.Header.OffsetX;
            _subImage.OffsetY    = aStciSubImage.Header.OffsetY;
            _subImage.Width      = aStciSubImage.Header.Width;

            _subImage.DateCreated = DateTime.Now;
            _subImage.UserId      = this.FUserId;

            return(_subImage);
        }
Exemple #3
0
        private Ja2Data.StciSubImage DownloadStciSubimage(StciIndexedSubImage aSubImage)
        {
            Ja2Data.StciSubImageHeader _header = new Ja2Data.StciSubImageHeader();
            _header.DataLength = (uint)aSubImage.DataLength;
            _header.DataOffset = (uint)aSubImage.DataOffset;
            _header.Height     = (ushort)aSubImage.Height;
            _header.OffsetX    = (short)aSubImage.OffsetX;
            _header.OffsetY    = (short)aSubImage.OffsetY;
            _header.Width      = (ushort)aSubImage.Width;

            Ja2Data.StciSubImage _stciSubImage = new Ja2Data.StciSubImage(_header);
            _stciSubImage.ImageData = aSubImage.UnstructuredData.Data;
            if (aSubImage.AuxObjectData != null)
            {
                _stciSubImage.AuxData = this.DownloadAuxObjectData(aSubImage.AuxObjectData);
            }

            return(_stciSubImage);
        }