Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DepthMapAcceleration"/> class with an existing <see cref="Json.LytroDepthMap"/> storage.
        /// </summary>
        /// <param name="depthMap">A <see cref="Json.LytroDepthMap"/> to use as a storage for the parallax.</param>
        public DepthMapAcceleration(Json.LytroDepthMap depthMap)
        {
            if (depthMap == null)
            {
                throw new ArgumentNullException("depthMap");
            }

            JsonDepthMap = depthMap;
        }
        /// <summary>
        /// When overriden in derived class, initializes the accessor and returns whether any content is available.
        /// </summary>
        /// <returns>true if the package contains any frames; false otherwise.</returns>
        protected override bool Initialize()
        {
            if (Metadata == null || Metadata.Picture == null || Metadata.Picture.AccelerationArray == null)
            {
                return(false);
            }

            foreach (Json.AccelerationItem accelerationItem in Metadata.Picture.AccelerationArray)
            {
                if (accelerationItem.Type == Json.LytroDepthMap.Key)
                {
                    _depthMap = accelerationItem.VendorContent as Json.LytroDepthMap;

                    if (_depthMap != null)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DepthMapAcceleration"/> class.
 /// </summary>
 public DepthMapAcceleration()
 {
     JsonDepthMap = new Json.LytroDepthMap();
 }