Add wuffs_base__pixel_blend type

This commit is contained in:
Nigel Tao committed 2020-01-14 09:27:04 +11:00
1 parent 8562951be6
commit 1a791217de
12 files changed
+118 -53

No files matched your search

+5 -4
View File
@@ -422,7 +422,7 @@ pri func decoder.skip_frame?(src: base.io_reader) {
}
// TODO: honor args.opts.
pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader, workbuf: slice base.u8, opts: nptr base.decode_frame_options) {
pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader, blend: base.pixel_blend, workbuf: slice base.u8, opts: nptr base.decode_frame_options) {
this.ignore_metadata = true
if this.call_sequence <> 4 {
this.decode_frame_config?(dst: nullptr, src: args.src)
@@ -431,7 +431,7 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader,
((this.frame_rect_x0 == this.frame_rect_x1) or (this.frame_rect_y0 == this.frame_rect_y1)) {
return "#bad frame size"
}
this.decode_id_part1?(dst: args.dst, src: args.src)
this.decode_id_part1?(dst: args.dst, src: args.src, blend: args.blend)
this.decode_id_part2?(dst: args.dst, src: args.src, workbuf: args.workbuf)
this.num_decoded_frames_value ~sat+= 1
@@ -813,7 +813,7 @@ pri func decoder.decode_id_part0?(src: base.io_reader) {
}
}
pri func decoder.decode_id_part1?(dst: ptr base.pixel_buffer, src: base.io_reader) {
pri func decoder.decode_id_part1?(dst: ptr base.pixel_buffer, src: base.io_reader, blend: base.pixel_blend) {
var flags : base.u8
var which_palette : base.u8[..= 1]
var num_palette_entries : base.u32[..= 256]
@@ -882,7 +882,8 @@ pri func decoder.decode_id_part1?(dst: ptr base.pixel_buffer, src: base.io_reade
dst_pixfmt: args.dst.pixel_format(),
dst_palette: dst_palette,
src_pixfmt: this.util.make_pixel_format(repr: 0x47040008),
src_palette: this.palettes[which_palette][..])
src_palette: this.palettes[which_palette][..],
blend: args.blend)
if not status.is_ok() {
return status
}