mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
LibPDF: Get inline image data from parser to renderer
We create a inline_image_end operator that has all the relevant data in a synthetic StreamObject. inline_image_end is still a RENDERER_TODO(), so no real behavior change. (Previously we'd call only inline_image_begin, so string the todo message is about is now a bit different. But no interesting behavior change.)
This commit is contained in:
parent
3285502ec6
commit
022fce75a6
2 changed files with 19 additions and 5 deletions
|
@ -591,9 +591,12 @@ PDFErrorOr<Vector<Operator>> Parser::parse_operators()
|
||||||
m_reader.consume_whitespace();
|
m_reader.consume_whitespace();
|
||||||
|
|
||||||
auto stream_bytes = m_reader.bytes().slice(stream_start, stream_end - stream_start);
|
auto stream_bytes = m_reader.bytes().slice(stream_start, stream_end - stream_start);
|
||||||
// FIXME: Do more with inline images than just skipping them.
|
|
||||||
(void)map;
|
Vector<Value> inline_image_args;
|
||||||
(void)stream_bytes;
|
auto map_object = make_object<DictObject>(move(map));
|
||||||
|
inline_image_args.append(make_object<StreamObject>(move(map_object), MUST(ByteBuffer::copy(stream_bytes))));
|
||||||
|
operators.append(Operator(OperatorType::InlineImageEnd, move(inline_image_args)));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
operators.append(Operator(operator_type, move(operator_args)));
|
operators.append(Operator(operator_type, move(operator_args)));
|
||||||
|
|
|
@ -688,8 +688,19 @@ RENDERER_HANDLER(set_painting_color_and_space_to_cmyk)
|
||||||
}
|
}
|
||||||
|
|
||||||
RENDERER_TODO(shade)
|
RENDERER_TODO(shade)
|
||||||
RENDERER_TODO(inline_image_begin)
|
|
||||||
RENDERER_TODO(inline_image_begin_data)
|
RENDERER_HANDLER(inline_image_begin)
|
||||||
|
{
|
||||||
|
// The parser only calls the inline_image_end handler for inline images.
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
}
|
||||||
|
|
||||||
|
RENDERER_HANDLER(inline_image_begin_data)
|
||||||
|
{
|
||||||
|
// The parser only calls the inline_image_end handler for inline images.
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
}
|
||||||
|
|
||||||
RENDERER_TODO(inline_image_end)
|
RENDERER_TODO(inline_image_end)
|
||||||
RENDERER_HANDLER(paint_xobject)
|
RENDERER_HANDLER(paint_xobject)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue