mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Tweak pixel_format bits
This commit is contained in:
1 parent
ddc41cb43f
commit
9a1b8def46
9 files changed
+212
-148
No files matched your search
@@ -128,14 +128,14 @@ pub func decoder.decode_image_config?(dst: nptr base.image_config, src: base.io_
|
||||
this.pad_per_row = this.width & 3
|
||||
// TODO: a Wuffs (not just C) name for the
|
||||
// WUFFS_BASE__PIXEL_FORMAT__BGR magic pixfmt constant.
|
||||
this.pixfmt = this.util.make_pixel_format(repr: 0x4000_0888)
|
||||
this.pixfmt = this.util.make_pixel_format(repr: 0x8000_0888)
|
||||
} else if bits_per_pixel == 32 {
|
||||
this.bits_per_pixel = 32
|
||||
this.bytes_per_row = (this.width as base.u64) * 4
|
||||
this.pad_per_row = 0
|
||||
// TODO: a Wuffs (not just C) name for the
|
||||
// WUFFS_BASE__PIXEL_FORMAT__BGRA_NONPREMUL magic pixfmt constant.
|
||||
this.pixfmt = this.util.make_pixel_format(repr: 0x4500_8888)
|
||||
this.pixfmt = this.util.make_pixel_format(repr: 0x8100_8888)
|
||||
} else {
|
||||
// TODO: support other bits_per_pixel's.
|
||||
return "#unsupported BMP file"
|
||||
@@ -181,7 +181,7 @@ pub func decoder.decode_image_config?(dst: nptr base.image_config, src: base.io_
|
||||
// TODO: a Wuffs (not just C) name for the
|
||||
// WUFFS_BASE__PIXEL_FORMAT__BGRA_NONPREMUL magic pixfmt constant.
|
||||
args.dst.set!(
|
||||
pixfmt: 0x4500_8888, // TODO: this.pixfmt instead?
|
||||
pixfmt: 0x8100_8888, // TODO: this.pixfmt instead?
|
||||
pixsub: 0,
|
||||
width: this.width,
|
||||
height: this.height,
|
||||
|
||||
Reference in new issue
Block a user