コード例 #1
0
        public void MofifyImage(Effect effect)
        {
            switch (effect.action)
            {
                case PhotoAction.Gray:
                    MofifyImageImpl(originalImagePixels, effect.xClick, effect.yClick, effect.cRaidus);
                    break;

                case PhotoAction.Color:
                    MofifyImageImpl(grayImagePixels, effect.xClick, effect.yClick, effect.cRaidus);
                    break;
            }
        }
コード例 #2
0
        public void MofifyImage(PhotoAction action,int xClick, int yClick)
        {
            if (InvalidCount > 0)
            {
                InvalidCount--;
                return;
            }

            bool mark = Interlocked.CompareExchange(ref marker, 0, 1) == 1;
            Effect effect = new Effect(action, xClick, yClick, radius, mark);
            switch (action)
            {
                case PhotoAction.Gray:
                    MofifyImageImpl(grayImagePixels, xClick, yClick, radius);
                    doneEffects.Push(effect);
                    break;

                case PhotoAction.Color:
                    MofifyImageImpl(originalImagePixels, xClick, yClick, radius);
                    doneEffects.Push(effect);
                    break;
            }
        }