Class: HexaPDF::Content::Operator::ConcatenateMatrix
- Inherits:
-
BaseOperator
- Object
- BaseOperator
- HexaPDF::Content::Operator::ConcatenateMatrix
- Defined in:
- lib/hexapdf/content/operator.rb
Overview
Implementation of the ‘cm’ operator.
See: PDF2.0 s8.4.4
Instance Attribute Summary
Attributes inherited from BaseOperator
Instance Method Summary collapse
-
#initialize ⇒ ConcatenateMatrix
constructor
Creates the operator.
-
#invoke(processor, a, b, c, d, e, f) ⇒ Object
:nodoc:.
-
#serialize(serializer, a, b, c, d, e, f) ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ ConcatenateMatrix
Creates the operator.
185 186 187 |
# File 'lib/hexapdf/content/operator.rb', line 185 def initialize super('cm') end |
Instance Method Details
#invoke(processor, a, b, c, d, e, f) ⇒ Object
:nodoc:
189 190 191 |
# File 'lib/hexapdf/content/operator.rb', line 189 def invoke(processor, a, b, c, d, e, f) #:nodoc: processor.graphics_state.ctm.premultiply(a, b, c, d, e, f) end |
#serialize(serializer, a, b, c, d, e, f) ⇒ Object
:nodoc:
193 194 195 196 197 |
# File 'lib/hexapdf/content/operator.rb', line 193 def serialize(serializer, a, b, c, d, e, f) #:nodoc: "#{serializer.serialize_numeric(a)} #{serializer.serialize_numeric(b)} " \ "#{serializer.serialize_numeric(c)} #{serializer.serialize_numeric(d)} " \ "#{serializer.serialize_numeric(e)} #{serializer.serialize_numeric(f)} cm\n" end |