Ejemplo n.º 1
0
        public ImagePsd(string p_FileFullPath)
        {
            if (!File.Exists(p_FileFullPath))
            {
                return;
            }
            FileStream _PSD = File.Open(p_FileFullPath, FileMode.Open);

            byte[] _HeadByte = new byte[26];
            _PSD.Read(_HeadByte, 0, 26);
            m_Head       = new PSDHEAD(_HeadByte);
            m_ColorModel = new ColorModel(_PSD);

            long _ReadCount = _PSD.Position;

            while (true)
            {
                BIM _Bim = new BIM(_PSD);
                if (!_Bim.Read || _PSD.Position - _ReadCount >= m_ColorModel.BIMSize)
                {
                    break;
                }
                m_8BIMList.Add(_Bim);
            }
            m_LayerMaskInfo = new LayerMaskInfo(_PSD);
            m_ImageData     = new ImageData(_PSD, m_Head);
            if (m_Head.ColorMode == 2)
            {
                m_ImageData.PSDImage.Palette = m_ColorModel.ColorData;
            }
            _PSD.Close();
        }
Ejemplo n.º 2
0
 public void NewPsd()
 {
     m_Head          = new PSDHEAD(new byte[] { 0x38, 0x42, 0x50, 0x53, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x2C, 0x00, 0x00, 0x01, 0xB4, 0x00, 0x08, 0x00, 0x03 });
     m_ColorModel    = new ColorModel();
     m_ImageData     = new ImageData();
     m_LayerMaskInfo = new LayerMaskInfo();
 }
Ejemplo n.º 3
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    void OnEnable()
    {
        for (int i = 0; i < layerMaskInfos.Count; ++i)
        {
            int           layerMask     = 0;
            LayerMaskInfo layerMaskInfo = layerMaskInfos[i];

            for (int j = 0; j < layerMaskInfo.layerIDs.Count; ++j)
            {
                int layerID = layerMaskInfo.layerIDs[j];
                layerMask |= 1 << layerID;
            }

            nameToLayerMask[layerMaskInfo.name] = layerMask;
        }
    }