Ejemplo n.º 1
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var key = operandStack.Pop();

            operandStack.Push(new DictionaryOperand());
        }
Ejemplo n.º 2
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operand = interpreter.OperandStack.Pop();

            GraphicsState graphicState = interpreter.GraphicState;

            graphicState.ColorSpace = ColorSpaceActivator.CreateColorSpace(interpreter, operand);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Register the resource commands
 /// </summary>
 static public void Register(EpsInterpreter interpreter)
 {
     interpreter.RegisterCommand("defineresource", new DefineResourceOperand());
     interpreter.RegisterCommand("findresource", new FindResourceOperand());
     interpreter.RegisterCommand("undefineresource", new UndefineResourceOperand());
     interpreter.RegisterCommand("resourceforall", new ResourceForAllOperand());
     interpreter.RegisterCommand("resourcestatus", new ResourceStatusOperand());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Register painting commands
 /// </summary>
 static public void Register(EpsInterpreter interpreter)
 {
     interpreter.RegisterCommand("eofill", new EoFillOperand());
     interpreter.RegisterCommand("fill", new FillOperand());
     interpreter.RegisterCommand("image", new PaintNotingCmd());
     interpreter.RegisterCommand("imagemask", new PaintNotingCmd());
     interpreter.RegisterCommand("stroke", new StrokeCmd());
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Register the string command
 /// </summary>
 static public void Register(EpsInterpreter interpreter)
 {
     interpreter.RegisterCommand("status", new StatusCmd());
     interpreter.RegisterCommand("string", new StringCmd());
     interpreter.RegisterCommand("search", new SearchCmd());
     interpreter.RegisterCommand("anchorsearch", new AnchorSearchCmd());
     interpreter.RegisterCommand("token", new TokenCmd());
 }
Ejemplo n.º 6
0
 static public void Register(EpsInterpreter interpreter)
 {
     interpreter.RegisterCommand("currentfile", new CurrentFileCmd());
     interpreter.RegisterCommand("filter", new FilterCmd());
     interpreter.RegisterCommand("flushfile", new FlushFileCmd());
     interpreter.RegisterCommand("readstring", new ReadStringCmd());
     interpreter.RegisterCommand("readline", new ReadLineCmd());
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Bind the operand
        /// </summary>
        public override void Bind(EpsInterpreter interpreter)
        {
            var name = new NameOperand {
                Value = this.Name
            };

            BoundOperand = DictionaryStackHelper.FindValue(interpreter.DictionaryStack, name);
        }
Ejemplo n.º 8
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var lineCap = interpreter.OperandStack.PopInteger();

            GraphicsState graphicState = interpreter.GraphicState;

            graphicState.LineCap = GetLineCap(lineCap.Value);
        }
        public override void Execute(EpsInterpreter interpreter)
        {
            GraphicsState graphicState = interpreter.GraphicState;

            var colorComponents = graphicState.FillBrush.GetRGBColorOperands();

            interpreter.OperandStack.PushFromList(colorComponents);
        }
Ejemplo n.º 10
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            operandStack.Push(new NullOperand());
            operandStack.Push(new NullOperand());
            operandStack.Push(new NullOperand());
        }
Ejemplo n.º 11
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var miterLimit = interpreter.OperandStack.PopRealValue();

            GraphicsState graphicState = interpreter.GraphicState;

            graphicState.MiterLimit = miterLimit;
        }
Ejemplo n.º 12
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var file = new FileOperand {
                Reader = interpreter.FileReader
            };

            interpreter.OperandStack.Push(file);
        }
Ejemplo n.º 13
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var lineWidth = interpreter.OperandStack.PopRealValue();

            GraphicsState graphicState = interpreter.GraphicState;

            graphicState.LineWidth = lineWidth;
        }
Ejemplo n.º 14
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var array = operandStack.Pop();

            operandStack.Push(array);
        }
Ejemplo n.º 15
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var topOperand   = operandStack.Pop();
            var graphicState = interpreter.GraphicState;
            var ctm          = graphicState.CurrentTransformationMatrix;
            var geometry     = new GraphicPathGeometry();

            switch (topOperand)
            {
            case IntegerOperand integerOperand:
            case RealOperand realOperand:
            {
                var height = OperandHelper.GetRealValue(topOperand);
                var width  = operandStack.PopRealValue();
                var y      = operandStack.PopRealValue();
                var x      = operandStack.PopRealValue();

                AddRectangle(geometry, x, y, width, height, ctm);
                break;
            }

            case ArrayOperand arrayOperand:
            {
                for (int i = 0; i < arrayOperand.Values.Count; i += 4)
                {
                    var x      = OperandHelper.GetRealValue(arrayOperand.Values[i].Operand);
                    var y      = OperandHelper.GetRealValue(arrayOperand.Values[i + 1].Operand);
                    var height = OperandHelper.GetRealValue(arrayOperand.Values[i + 2].Operand);
                    var width  = OperandHelper.GetRealValue(arrayOperand.Values[i + 3].Operand);

                    AddRectangle(geometry, x, y, width, height, ctm);
                }
                break;
            }

            case StringOperand stringOperand:
            {
                var values = HomogeneousNumberArrayDecoder.Decode(stringOperand);

                for (int i = 0; i < values.Count; i += 4)
                {
                    var x      = values[i];
                    var y      = values[i + 1];
                    var height = values[i + 2];
                    var width  = values[i + 3];

                    AddRectangle(geometry, x, y, width, height, ctm);
                }

                break;
            }
            }

            ClipHelper.SetClip(interpreter, geometry);
            interpreter.ResetCurrentGeometry();
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Register array commands
 /// </summary>
 static public void Register(EpsInterpreter interpreter)
 {
     interpreter.RegisterCommand("aload", new ALoadCmd());
     interpreter.RegisterCommand("array", new ArrayCmd());
     interpreter.RegisterCommand("astore", new AStoreCmd());
     interpreter.RegisterCommand("currentpacking", new CurrentPackingCmd());
     interpreter.RegisterCommand("packedarray", new ArrayCmd());
     interpreter.RegisterCommand("setpacking", new SetPackingCmd());
 }
Ejemplo n.º 17
0
        public override void Execute(EpsInterpreter interpreter)
        {
            if (!interpreter.IsInStoppedContext)
            {
                interpreter.QuitExecution();
            }

            interpreter.StopProcedure();
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Register commands that work on more than one type
 /// </summary>
 static public void Register(EpsInterpreter interpreter)
 {
     interpreter.RegisterCommand("copy", new CopyCmd());
     interpreter.RegisterCommand("get", new GetCmd());
     interpreter.RegisterCommand("getinterval", new GetIntervalCmd());
     interpreter.RegisterCommand("length", new LengthCmd());
     interpreter.RegisterCommand("put", new PutCmd());
     interpreter.RegisterCommand("putinterval", new PutIntervalCmd());
 }
Ejemplo n.º 19
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            operandStack.Pop();
            operandStack.Pop();
            operandStack.Pop();
            operandStack.Pop();
        }
Ejemplo n.º 20
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var operand = operandStack.Pop();
            var boolOp  = new BooleanOperand(false);

            operandStack.Push(boolOp);
        }
Ejemplo n.º 21
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var name = new NameOperand {
                Value = this.Name
            };
            var op = DictionaryStackHelper.FindValue(interpreter.DictionaryStack, name);

            interpreter.OperandStack.Push(op);
        }
Ejemplo n.º 22
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var offset = operandStack.PopRealValue();
            var array  = operandStack.PopArray();

            SetDashPattern(interpreter.GraphicState, offset, array);
        }
Ejemplo n.º 23
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var op = interpreter.ErrorDict.TryFind("handleerror");

            if (op != null)
            {
                interpreter.Execute(op);
            }
        }
Ejemplo n.º 24
0
        public override void Execute(EpsInterpreter interpreter)
        {
            GraphicsState graphicState = interpreter.GraphicState;

            graphicState.ColorSpace = ColorSpaceActivator.CreateColorSpace(interpreter, EpsKeys.DeviceCMYK);

            graphicState.FillBrush = graphicState.ColorSpace.GetBrushDescriptor(interpreter.OperandStack.PopToList(graphicState.ColorSpace.GetNumberOfValuesPerColor()),
                                                                                graphicState.CurrentTransformationMatrix);
        }
Ejemplo n.º 25
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var key  = operandStack.Pop();
            var dict = (DictionaryOperand)operandStack.Pop();

            dict.Dictionary.Remove(key);
        }
Ejemplo n.º 26
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var res = new RealOperand();

            res.Value = RandomHelper.Rrand();
            operandStack.Push(res);
        }
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var category = operandStack.PopStringValue();
            var key      = operandStack.Pop();

            interpreter.ResourceManager.UndefineResource(category, key);
        }
Ejemplo n.º 28
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var count = new IntegerOperand {
                Value = operandStack.Count
            };

            operandStack.Push(count);
        }
Ejemplo n.º 29
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var operand = operandStack.Pop();

            var b = new BooleanOperand(operand.IsExecutable);

            operandStack.Push(b);
        }
Ejemplo n.º 30
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var operand2 = operandStack.Pop();
            var operand1 = operandStack.Pop();

            operandStack.Push(operand2);
            operandStack.Push(operand1);
        }