예제 #1
0
        public void CustomApply()
        {
            pageRoot.ImageLoadingRing.IsActive = true;

            if (pageRoot.pictureIsLoaded)
            {
                pageRoot.prepareImage(pageRoot.bitmapStream, pageRoot.bitmapImage, pageRoot.imageOriginal);
                int[,] coeff = new int[5, 5];
                int offset = 0, scale = 0;
                CustomFilter_SetValues(ref coeff, ref offset, ref scale);

                CustomFilter custom_image = new CustomFilter(pageRoot.imageOriginal.srcPixels, pageRoot.imageOriginal.width, pageRoot.imageOriginal.height, offset, scale, coeff);
                pageRoot.imageOriginal.dstPixels = custom_image.Filter();

                pageRoot.setStream(pageRoot.bitmapStream, pageRoot.bitmapImage, pageRoot.imageOriginal);
            }

            pageRoot.imageOriginal.srcPixels = (byte[])pageRoot.imageOriginal.dstPixels.Clone();
            pageRoot.Panel.ArchiveAddArray();
            pageRoot.OptionsPopup.effectsApplied.Add("Custom applyed");
            CustomFilter_ResetValues();

            pageRoot.ImageLoadingRing.IsActive = false;
        }
예제 #2
0
        // EdgeEnhance filter function
        public void OnEdgeEnhanceClick(object sender, RoutedEventArgs e)
        {
            if (rootPage.pictureIsLoaded)
            {
                appliedFilters = "EdgeEnhance";
                rootPage.prepareImage(rootPage.exampleStream, rootPage.exampleBitmap, rootPage.image);
                int[,] coeff = new int[5, 5];
                int offset = 0, scale = 0;
                EdgeEnhance_SetValues(ref coeff, ref offset, ref scale);

                CustomFilter customImage = new CustomFilter(rootPage.image.srcPixels, rootPage.image.width, rootPage.image.height, offset, scale, coeff);
                rootPage.image.dstPixels = customImage.Filter();

                rootPage.setStream(rootPage.exampleStream, rootPage.exampleBitmap, rootPage.image);
            }
        }
예제 #3
0
        public void CustomReview()
        {
            pageRoot.ImageLoadingRing.IsActive = true;

            if (pageRoot.pictureIsLoaded)
            {
                pageRoot.prepareImage(pageRoot.bitmapStream, pageRoot.bitmapImage, pageRoot.imageOriginal);
                int[,] coeff = new int[5, 5];
                int offset = 0, scale = 0;
                CustomFilter_SetValues(ref coeff, ref offset, ref scale);

                CustomFilter custom_image = new CustomFilter(pageRoot.imageOriginal.srcPixels, pageRoot.imageOriginal.width, pageRoot.imageOriginal.height, offset, scale, coeff);
                pageRoot.imageOriginal.dstPixels = custom_image.Filter();

                pageRoot.setStream(pageRoot.bitmapStream, pageRoot.bitmapImage, pageRoot.imageOriginal);
            }

            pageRoot.ImageLoadingRing.IsActive = false;
        }
예제 #4
0
        // Change the image with edgeEnhance filter applied
        public void doEdgeEnhance(Stream stream, WriteableBitmap bitmap, RemedyImage givenImage)
        {
            rootPage.prepareImage(stream, bitmap, givenImage);
            int[,] coeff = new int[5, 5];
            int offset = 0, scale = 0;
            EdgeEnhance_SetValues(ref coeff, ref offset, ref scale);
            CustomFilter custom_image = new CustomFilter(givenImage.srcPixels, givenImage.width, givenImage.height, offset, scale, coeff);
            givenImage.dstPixels = custom_image.Filter();
            rootPage.setStream(stream, bitmap, givenImage);

        }