Class: HexaPDF::Content::Operator::SetDeviceCMYKStrokingColor

Inherits:
BaseOperator
  • Object
show all
Defined in:
lib/hexapdf/content/operator.rb

Overview

Implementation of the ‘K’ operator.

See: PDF1.7 s8.6.8

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeSetDeviceCMYKStrokingColor

Creates the operator.



497
498
499
# File 'lib/hexapdf/content/operator.rb', line 497

def initialize
  super('K')
end

Instance Method Details

#invoke(processor, c, m, y, k) ⇒ Object

:nodoc:



501
502
503
504
# File 'lib/hexapdf/content/operator.rb', line 501

def invoke(processor, c, m, y, k) #:nodoc:
  processor.graphics_state.stroke_color =
    processor.resources.color_space(:DeviceCMYK).color(c, m, y, k)
end

#serialize(serializer, c, m, y, k) ⇒ Object

:nodoc:



506
507
508
509
# File 'lib/hexapdf/content/operator.rb', line 506

def serialize(serializer, c, m, y, k) #:nodoc:
  "#{serializer.serialize_numeric(c)} #{serializer.serialize_numeric(m)} " \
    "#{serializer.serialize_numeric(y)} #{serializer.serialize_numeric(k)} K\n"
end