Example #1
0
        public void Blit( RasterBuffer rasterBuffer, int dx, int dy, int sx, int sy, int sw, int sh )
        {
            if( rasterBuffer.ColorMode != this.ColorMode )
                throw new NotSupportedException( "Can only blit to raster buffers with the same color mode" );

            PixelBuffer pb;
            rasterBuffer.LockPixels( out pb );

            int stride = this.Width * this.BytesPerPixel;
            int sourceOffset = ( sy * stride ) + ( sx * this.BytesPerPixel );
            int targetOffset = ( dy * pb.Stride ) + ( dx * pb.BytesPerPixel );
            for( int row = sy; row < sh; row++ )
            {
                Buffer.BlockCopy( this.Data, sourceOffset, pb.Buffer, targetOffset, sw * this.BytesPerPixel );
                sourceOffset += stride;
                targetOffset += pb.Stride;
            }

            rasterBuffer.UnlockPixels();
        }
Example #2
0
 public GL( RasterBuffer rasterBuffer )
 {
     RasterBuffer = rasterBuffer;
     this.SetupMath();
     this.SetupDrawing();
 }
Example #3
0
        private void CompositionTarget_Rendering( object sender, EventArgs e )
        {
            this.UpdateOSD();

            if( _rasterBuffer == null )
                _rasterBuffer = this.Surface.RasterBuffer;

            this.Surface.BeginUpdate();

            if( _rasterBuffer != null )
                this.RenderCore();

            this.Surface.EndUpdate();
        }
Example #4
0
        private void Page_Loaded( object sender, RoutedEventArgs e )
        {
            #if PALETTIZED
            this.Surface.ColorMode = ColorMode.Palettized;
            this.BuildPalette();
            #else
            this.Surface.ColorMode = ColorMode.RGB;
            #endif

            _isScaling = true;
            this.EnableScaling();

            _camera = new Camera();
            _rasterBuffer = this.Surface.RasterBuffer;

            CompositionTarget.Rendering += new EventHandler( CompositionTarget_Rendering );
        }
Example #5
0
        private void Page_Loaded( object sender, RoutedEventArgs e )
        {
            #if PALETTIZED
            this.Surface.ColorMode = ColorMode.Palettized;
            this.BuildPalette();
            #else
            this.Surface.ColorMode = ColorMode.RGBA;
            #endif

            multiScaleImage.Source = new DeepZoomImageTileSource( new Uri( "http://noxa.org/seadragon/Panoramas1/dzc_output_images/sodo7.xml" ) );

            _isScaling = true;
            this.EnableScaling();

            _camera = new Camera();
            _rasterBuffer = this.Surface.RasterBuffer;

            CompositionTarget.Rendering += new EventHandler( CompositionTarget_Rendering );
        }
Example #6
0
 public void Blit( RasterBuffer rasterBuffer, int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh )
 {
     // Need to scale
     throw new NotImplementedException();
 }
Example #7
0
 public void Blit( RasterBuffer rasterBuffer, int dx, int dy, int dw, int dh )
 {
     this.Blit( rasterBuffer, dx, dy, dw, dh, 0, 0, this.Width, this.Height );
 }