Class: HexaPDF::Content::Operator::SetDeviceCMYKNonStrokingColor

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

#initializeSetDeviceCMYKNonStrokingColor

Creates the operator.



519
520
521
# File 'lib/hexapdf/content/operator.rb', line 519

def initialize
  super('k')
end

Instance Method Details

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

:nodoc:



523
524
525
526
# File 'lib/hexapdf/content/operator.rb', line 523

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

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

:nodoc:



528
529
530
531
# File 'lib/hexapdf/content/operator.rb', line 528

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".freeze
end