Пример #1
0
        private unsafe int OnFormatCallback(void **opaque, char *chroma, int *width, int *height, int *pitches, int *lines)
        {
            IntPtr     pChroma   = new IntPtr(chroma);
            string     chromaStr = Marshal.PtrToStringAnsi(pChroma);
            ChromaType type      = chromaStr.TryParseChromaType();

            m_format = new BitmapFormat(*width, *height, type);
            if (m_formatSetupCB != null)
            {
                m_format = m_formatSetupCB(m_format);
            }

            Marshal.Copy(m_format.Chroma.ToUtf8(), 0, pChroma, 4);
            *width  = m_format.Width;
            *height = m_format.Height;

            for (int i = 0; i < m_format.Planes; i++)
            {
                pitches[i] = m_format.Pitches[i];
                lines[i]   = m_format.Lines[i];
            }

            m_pixelData = new PlanarPixelData(m_format.PlaneSizes);

            return(m_format.Planes);
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            PlanarPixelData pd = (PlanarPixelData)obj;

            if (pd == null)
            {
                return(false);
            }

            return(this == pd);
        }