Class: Pdfrb::Content::Operator::BeginInlineImage
- Defined in:
- lib/pdfrb/content/operators/inline_image.rb
Overview
Inline image operators (s8.9.7). Inline images embed raw image data directly in the content stream, framed by BI ... ID ... EI. They're an alternative to /XObject /Image for one-shot images: smaller overhead per image, no /Resources entry needed, but the bytes live in the content stream so they can't be reused.
The serialise path emits the BI dict, ID marker, raw bytes, and EI marker. The invoke path is intentionally a no-op; the content Parser handles BI/ID/EI as a single bounded block rather than via the operator dispatch table.
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.invoke(_processor, *_operands) ⇒ Object
30 |
# File 'lib/pdfrb/content/operators/inline_image.rb', line 30 def invoke(_processor, *_operands); end |
.name ⇒ Object
19 |
# File 'lib/pdfrb/content/operators/inline_image.rb', line 19 def name; "BI"; end |
.serialize(serializer, **dict) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/pdfrb/content/operators/inline_image.rb', line 21 def serialize(serializer, **dict) buf = +"BI\n" dict.each do |k, v| buf << serializer.serialize(k) << " " << serializer.serialize(v) << "\n" end buf << "ID\n" buf end |