public void Initialise(CVImageAttributes attributes)
        {
            FImageAttributes = attributes;

            InitialiseBack();
            InitialiseFrontFromBack();
        }
예제 #2
0
 public override void OnImageAttributesUpdate(CVImageAttributes attributes)
 {
     if (ImageAttributesUpdate == null)
     {
         return;
     }
     ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
 }
예제 #3
0
 protected void OnImageAttributesUpdate(CVImageAttributes attributes)
 {
     if (ImageAttributesUpdate == null)
     {
         return;
     }
     ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
 }
        void InitialiseFrontFromBack()
        {
            lock (FBackLock)
                lock (FAttributesLock)
                {
                    FImageAttributes = FBackBuffer.ImageAttributes;

                    FFrontLock.AcquireWriterLock(LockTimeout);
                    try
                    {
                        FFrontBuffer.SetImage(FBackBuffer);
                    }
                    finally
                    {
                        FFrontLock.ReleaseWriterLock();
                    }
                }

            OnImageAttributesUpdate(FImageAttributes);
        }
예제 #5
0
        public static Texture CreateTexture(CVImageAttributes attributes, Device device)
        {
            var          format = attributes.ColorFormat;
            TColorFormat newFormat;
            var          useConverted = NeedsConversion(format, out newFormat);


            var ex    = device is DeviceEx;
            var pool  = ex ? Pool.Default : Pool.Managed;
            var usage = (ex ? Usage.Dynamic : Usage.None) & ~Usage.AutoGenerateMipMap;

            try
            {
                return(new Texture(device, Math.Max(attributes.Width, 1), Math.Max(attributes.Height, 1), 1, usage, GetDXFormat(useConverted ? newFormat : format), pool));
            }
            catch (Exception e)
            {
                Log(e);
                return(new Texture(device, 1, 1, 1, usage, Format.X8R8G8B8, Pool.Managed));
            }
        }
 public virtual void OnImageAttributesUpdate(CVImageAttributes attributes)
 {
 }
예제 #7
0
		protected void OnImageAttributesUpdate(CVImageAttributes attributes)
		{
			if (ImageAttributesUpdate == null)
				return;
			ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
		}
예제 #8
0
 public ImageAttributesChangedEventArgs(CVImageAttributes attributes)
 {
     this.Attributes = attributes;
 }
예제 #9
0
 public void Initialise(CVImageAttributes attributes)
 {
     Initialise(attributes.Size, attributes.ColorFormat);
 }
		public virtual void OnImageAttributesUpdate(CVImageAttributes attributes) { }
		void InitialiseFrontFromBack()
		{
			lock (FBackLock)
				lock (FAttributesLock)
				{
					FImageAttributes = FBackBuffer.ImageAttributes;

					FFrontLock.AcquireWriterLock(LockTimeout);
					try
					{
						FFrontBuffer.SetImage(FBackBuffer);
					}
					finally
					{
						FFrontLock.ReleaseWriterLock();
					}
				}

			OnImageAttributesUpdate(FImageAttributes);
		}
		public void Initialise(CVImageAttributes attributes)
		{
			FImageAttributes = attributes;

			InitialiseBack();
			InitialiseFrontFromBack();
		}
예제 #13
0
		public void Initialise(CVImageAttributes attributes)
		{
			Initialise(attributes.Size, attributes.ColorFormat);
		}
예제 #14
0
		public override void OnImageAttributesUpdate(CVImageAttributes attributes)
		{
			if (ImageAttributesUpdate == null)
				return;
			ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
		}
예제 #15
0
		public ImageAttributesChangedEventArgs(CVImageAttributes attributes)
		{
			this.Attributes = attributes;
		}
		public static Texture CreateTexture(CVImageAttributes attributes, Device device)
		{ 
			TColorFormat format = attributes.ColorFormat;
			TColorFormat newFormat;
			bool useConverted = NeedsConversion(format, out newFormat);


			bool ex = device is DeviceEx;
			var pool = ex ? Pool.Default : Pool.Managed;
			var usage = (ex ? Usage.Dynamic : Usage.None) & ~Usage.AutoGenerateMipMap;

			try
			{
				return new Texture(device, Math.Max(attributes.Width, 1), Math.Max(attributes.Height, 1), 1, usage, GetDXFormat(useConverted ? newFormat : format), pool);
			}
			catch (Exception e)
			{
				ImageUtils.Log(e);
                return new Texture(device, 1, 1, 1, usage, Format.X8R8G8B8, Pool.Managed);
			}
		}
예제 #17
0
		void UpdateAttributes(CVImageAttributes attributes)
		{
			FImage.Initialise(attributes);
		}