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

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

Overview

Implementation of the ‘K’ operator.

See: PDF2.0 s8.6.8

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeSetDeviceCMYKStrokingColor

Creates the operator.



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

def initialize
  super('K')
end

Instance Method Details

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

:nodoc:



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

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

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

:nodoc:



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

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