Пример #1
0
//----------------------------------------------------------------------------------------------------------------------

        //Wrappers so that the code to decide the currentFrame is gathered in one place

        internal static void GetImageDataInto(string fileName, int imageType, out ImageData readResult)
        {
            StreamingImageSequencePlugin.GetImageDataInto(fileName, imageType, GetCurrentFrame(),
                                                          out readResult);

            //Display not enough memory warning.
            switch (readResult.ReadStatus)
            {
            case StreamingImageSequenceConstants.READ_STATUS_OUT_OF_MEMORY: {
                if (m_showWarningOnOOM)
                {
                    Debug.LogWarning("[SIS] Out of memory when loading images");
                    m_showWarningOnOOM = false;
                }
                break;
            }

            case StreamingImageSequenceConstants.READ_STATUS_SUCCESS: {
                m_showWarningOnOOM = true;
                break;
            }

            default: {
                break;
            };
            }
        }
//----------------------------------------------------------------------------------------------------------------------

        public override void Execute()
        {
            string imagePath    = GetImagePath();
            int    requestFrame = GetRequestFrame();

#if DEBUG_FULL_IMAGE
            const int IMAGE_TYPE = StreamingImageSequenceConstants.IMAGE_TYPE_FULL;
            StreamingImageSequencePlugin.GetImageDataInto(imagePath, IMAGE_TYPE, requestFrame, out ImageData imageData);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_LOADING, imageData.ReadStatus);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_SUCCESS, imageData.ReadStatus);
#endif

            StreamingImageSequencePlugin.LoadAndAllocFullImage(imagePath, requestFrame);
        }
//----------------------------------------------------------------------------------------------------------------------

        public override void Execute()
        {
            string imagePath    = GetImagePath();
            int    requestFrame = GetRequestFrame();

#if DEBUG_PREVIEW_IMAGE
            const int TEX_TYPE = StreamingImageSequenceConstants.IMAGE_TYPE_PREVIEW;
            StreamingImageSequencePlugin.GetImageDataInto(imagePath, TEX_TYPE, requestFrame, out ImageData imageData);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_LOADING, imageData.ReadStatus);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_SUCCESS, imageData.ReadStatus);
#endif

            StreamingImageSequencePlugin.LoadAndAllocPreviewImage(imagePath, m_width, m_height, requestFrame);
        }
Пример #4
0
//----------------------------------------------------------------------------------------------------------------------

        //Wrappers so that the code to decide the currentFrame is gathered in one place

        internal static void GetImageDataInto(string fileName, int imageType, out ImageData readResult)
        {
            StreamingImageSequencePlugin.GetImageDataInto(fileName, imageType, GetCurrentFrame(),
                                                          out readResult);
        }