mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
std: fix frame config background_color re alpha
This commit is contained in:
1 parent
b76af12139
commit
b369d233ce
14 files changed
+97
-24
No files matched your search
@@ -417,6 +417,8 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
}
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if this.call_sequence == 0x20 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x20 {
|
||||
@@ -433,6 +435,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.src_pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: 0,
|
||||
min_incl_y: 0,
|
||||
@@ -444,7 +447,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: true,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0xFF00_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -164,6 +164,8 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
}
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if this.call_sequence == 0x20 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x20 {
|
||||
@@ -180,6 +182,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: 0,
|
||||
min_incl_y: 0,
|
||||
@@ -191,7 +194,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: this.pixfmt == base.PIXEL_FORMAT__BGRX,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0xFF00_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -250,7 +250,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: false,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0x0000_0000)
|
||||
background_color: 0xFF00_0000)
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -119,6 +119,8 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
}
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if this.call_sequence == 0x20 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x20 {
|
||||
@@ -135,6 +137,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: 0,
|
||||
min_incl_y: 0,
|
||||
@@ -146,7 +149,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: false,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0x0000_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -966,6 +966,7 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var checksum_have : base.u32
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if (this.call_sequence & 0x10) <> 0 {
|
||||
return base."#bad call sequence"
|
||||
@@ -1033,6 +1034,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.src_pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: this.frame_rect_x0,
|
||||
min_incl_y: this.frame_rect_y0,
|
||||
@@ -1044,7 +1046,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: this.frame_disposal,
|
||||
opaque_within_bounds: (this.color_type <= 3) and (not this.seen_trns),
|
||||
overwrite_instead_of_blend: this.frame_overwrite_instead_of_blend,
|
||||
background_color: 0x0000_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.num_decoded_frame_configs_value ~sat+= 1
|
||||
|
||||
@@ -119,6 +119,8 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
}
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if this.call_sequence == 0x20 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x20 {
|
||||
@@ -135,6 +137,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: 0,
|
||||
min_incl_y: 0,
|
||||
@@ -146,7 +149,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: this.pixfmt == base.PIXEL_FORMAT__BGRX,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0x0000_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -252,6 +252,8 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
}
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if this.call_sequence == 0x20 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x20 {
|
||||
@@ -268,6 +270,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.src_pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: 0,
|
||||
min_incl_y: 0,
|
||||
@@ -279,7 +282,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: this.opaque,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0xFF00_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -301,6 +301,8 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
}
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if this.call_sequence == 0x20 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x20 {
|
||||
@@ -317,6 +319,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: 0,
|
||||
min_incl_y: 0,
|
||||
@@ -328,7 +331,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: this.has_alpha == 0,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0x0000_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -128,7 +128,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: false,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0x0000_0000)
|
||||
background_color: 0xFF00_0000)
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
@@ -308,6 +308,8 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
}
|
||||
|
||||
pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.io_reader) {
|
||||
var pixfmt : base.pixel_format
|
||||
|
||||
if this.call_sequence == 0x20 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x20 {
|
||||
@@ -324,6 +326,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
}
|
||||
|
||||
if args.dst <> nullptr {
|
||||
pixfmt = this.util.make_pixel_format(repr: this.pixfmt)
|
||||
args.dst.set!(bounds: this.util.make_rect_ie_u32(
|
||||
min_incl_x: 0,
|
||||
min_incl_y: 0,
|
||||
@@ -335,7 +338,7 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
|
||||
disposal: 0,
|
||||
opaque_within_bounds: false,
|
||||
overwrite_instead_of_blend: false,
|
||||
background_color: 0x0000_0000)
|
||||
background_color: pixfmt.default_background_color())
|
||||
}
|
||||
|
||||
this.call_sequence = 0x40
|
||||
|
||||
Reference in new issue
Block a user