Exemplo n.º 1
0
 //--------------------------------------------------------------------------
 public void init()
 {
     m_IsTarga        = false;
     m_IDFieldLength  = 0;
     m_ColorMapType   = false;
     m_ImageType      = TagraImageType.none;
     m_ColorMapIndex  = 0;
     m_ColorMapLength = 0;
     m_ColorMapSize   = 0;
     m_ImageOriginX   = 0;
     m_ImageOriginY   = 0;
     m_ImageWidth     = 0;
     m_ImageHeight    = 0;
     m_BitPerPixel    = 0;
     m_Discripter     = 0;
 }
Exemplo n.º 2
0
        //--------------------------------------------------------------------------
        public bool getHeader(byte[] hed)
        {
            init();
            if (hed.Length < HeaderSzie)
            {
                return(false);
            }
            m_IDFieldLength  = (int)hed[0x00];
            m_ColorMapType   = (hed[0x01] == 1);
            m_ImageType      = ImageType(hed[0x02]);
            m_ColorMapIndex  = (int)hed[0x03] + ((int)hed[0x04] << 8);
            m_ColorMapLength = (int)hed[0x05] + ((int)hed[0x06] << 8);
            m_ColorMapSize   = (int)hed[0x07];
            m_ImageOriginX   = (int)hed[0x08] + ((int)hed[0x09] << 8);
            m_ImageOriginY   = (int)hed[0x0A] + ((int)hed[0x0B] << 8);
            m_ImageWidth     = (int)hed[0x0C] + ((int)hed[0x0D] << 8);
            m_ImageHeight    = (int)hed[0x0E] + ((int)hed[0x0F] << 8);
            m_BitPerPixel    = (int)hed[0x10];
            m_Discripter     = (int)hed[0x11];

            m_VurLeftTo   = (((m_Discripter >> 4) & 1) == 0);
            m_HorBottomTo = (((m_Discripter >> 5) & 1) == 0);
            m_IsTarga     = true;
            if (m_IDFieldLength != 0)
            {
                m_IsTarga = false;
            }
            if (m_ColorMapType == true)
            {
                m_IsTarga = false;
            }
            if (m_ImageType == TagraImageType.none)
            {
                m_IsTarga = false;
            }
            if (m_BitPerPixel < 24)
            {
                m_IsTarga = false;
            }
            return(m_IsTarga);
        }