Class: Pdfrb::Model::Type::DeviceN
Overview
DeviceN attributes dictionary (s8.6.6.4, the 5th element of
the DeviceN color space array). Names extra colorants and
process/mixing hints.
Instance Attribute Summary
Attributes inherited from Object
#document, #gen, #oid, #value
Instance Method Summary
collapse
#[], #[]=, apply_arlington_definition, arlington_default, arlington_key_to_symbol, arlington_one_type_to_ruby, arlington_required?, arlington_scalar, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, merged_field, own_fields, #pdf_type, register_type, type_map, #validate
#arlington_object
Methods inherited from Object
#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type
Instance Method Details
#colorant_count ⇒ Object
20
21
22
23
24
25
|
# File 'lib/pdfrb/model/type/device_n.rb', line 20
def colorant_count
return 0 unless colorants
arr = colorants.is_a?(Pdfrb::Model::PdfArray) ? colorants.to_a : colorants
arr.is_a?(Array) ? arr.size : 0
end
|
#colorants ⇒ Object
12
|
# File 'lib/pdfrb/model/type/device_n.rb', line 12
def colorants; self[:Colorants]; end
|
#components ⇒ Object
27
28
29
|
# File 'lib/pdfrb/model/type/device_n.rb', line 27
def components
colorant_count
end
|
#each_colorant ⇒ Object
31
32
33
34
35
36
37
38
39
|
# File 'lib/pdfrb/model/type/device_n.rb', line 31
def each_colorant(&)
return enum_for(:each_colorant) unless block_given?
return unless colorants
arr = colorants.is_a?(Pdfrb::Model::PdfArray) ? colorants.to_a : colorants
return unless arr.is_a?(Array)
arr.each(&)
end
|
#mixing_hints ⇒ Object
14
|
# File 'lib/pdfrb/model/type/device_n.rb', line 14
def mixing_hints; self[:MixingHints]; end
|
#nchannel? ⇒ Boolean
16
17
18
|
# File 'lib/pdfrb/model/type/device_n.rb', line 16
def nchannel?
subtype == :NChannel
end
|
13
|
# File 'lib/pdfrb/model/type/device_n.rb', line 13
def process; self[:Process]; end
|
11
|
# File 'lib/pdfrb/model/type/device_n.rb', line 11
def subtype; self[:Subtype]&.to_sym; end
|