mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Rename table.row as table.row_u32
This commit is contained in:
1 parent
fa56d92410
commit
0045ce49f3
9 files changed
+18
-18
No files matched your search
@@ -1026,7 +1026,7 @@ func (g *gen) writeBuiltinTable(b *buffer, recv *a.Expr, method t.ID, args []*a.
|
|||||||
case t.IDWidth:
|
case t.IDWidth:
|
||||||
field = "width"
|
field = "width"
|
||||||
|
|
||||||
case t.IDRow:
|
case t.IDRowU32:
|
||||||
// TODO: don't assume that the table is a table of base.u8.
|
// TODO: don't assume that the table is a table of base.u8.
|
||||||
b.writes("wuffs_base__table_u8__row(")
|
b.writes("wuffs_base__table_u8__row(")
|
||||||
if err := g.writeExpr(b, recv, false, depth); err != nil {
|
if err := g.writeExpr(b, recv, false, depth); err != nil {
|
||||||
|
|||||||
@@ -963,7 +963,7 @@ var TableFuncs = []string{
|
|||||||
"GENERIC T2.stride() u64",
|
"GENERIC T2.stride() u64",
|
||||||
"GENERIC T2.width() u64",
|
"GENERIC T2.width() u64",
|
||||||
|
|
||||||
"GENERIC T2.row(y: u32) T1",
|
"GENERIC T2.row_u32(y: u32) T1",
|
||||||
"GENERIC T2.subtable(" +
|
"GENERIC T2.subtable(" +
|
||||||
"min_incl_x: u64, min_incl_y: u64, max_incl_x: u64, max_incl_y: u64) T2",
|
"min_incl_x: u64, min_incl_y: u64, max_incl_x: u64, max_incl_y: u64) T2",
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -668,7 +668,7 @@ const (
|
|||||||
IDIO = ID(0x242)
|
IDIO = ID(0x242)
|
||||||
IDLimit = ID(0x243)
|
IDLimit = ID(0x243)
|
||||||
IDPrefix = ID(0x244)
|
IDPrefix = ID(0x244)
|
||||||
IDRow = ID(0x245)
|
IDRowU32 = ID(0x245)
|
||||||
IDStride = ID(0x246)
|
IDStride = ID(0x246)
|
||||||
IDSubslice = ID(0x247)
|
IDSubslice = ID(0x247)
|
||||||
IDSubtable = ID(0x248)
|
IDSubtable = ID(0x248)
|
||||||
@@ -1094,7 +1094,7 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
IDIO: "io",
|
IDIO: "io",
|
||||||
IDLimit: "limit",
|
IDLimit: "limit",
|
||||||
IDPrefix: "prefix",
|
IDPrefix: "prefix",
|
||||||
IDRow: "row",
|
IDRowU32: "row_u32",
|
||||||
IDStride: "stride",
|
IDStride: "stride",
|
||||||
IDSubslice: "subslice",
|
IDSubslice: "subslice",
|
||||||
IDSubtable: "subtable",
|
IDSubtable: "subtable",
|
||||||
|
|||||||
@@ -530,7 +530,7 @@ pri func decoder.swizzle_none!(dst: ptr base.pixel_buffer, src: base.io_reader)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dst = tab.row(y: this.dst_y)
|
dst = tab.row_u32(y: this.dst_y)
|
||||||
if dst_bytes_per_row < dst.length() {
|
if dst_bytes_per_row < dst.length() {
|
||||||
dst = dst[.. dst_bytes_per_row]
|
dst = dst[.. dst_bytes_per_row]
|
||||||
}
|
}
|
||||||
@@ -597,7 +597,7 @@ pri func decoder.swizzle_rle!(dst: ptr base.pixel_buffer, src: base.io_reader) b
|
|||||||
rle_state = this.rle_state
|
rle_state = this.rle_state
|
||||||
|
|
||||||
while.outer true {
|
while.outer true {
|
||||||
row = tab.row(y: this.dst_y)
|
row = tab.row_u32(y: this.dst_y)
|
||||||
if dst_bytes_per_row < row.length() {
|
if dst_bytes_per_row < row.length() {
|
||||||
row = row[.. dst_bytes_per_row]
|
row = row[.. dst_bytes_per_row]
|
||||||
}
|
}
|
||||||
@@ -771,7 +771,7 @@ pri func decoder.swizzle_rle!(dst: ptr base.pixel_buffer, src: base.io_reader) b
|
|||||||
if this.dst_y >= this.height {
|
if this.dst_y >= this.height {
|
||||||
return "#bad RLE compression"
|
return "#bad RLE compression"
|
||||||
}
|
}
|
||||||
row = tab.row(y: this.dst_y)
|
row = tab.row_u32(y: this.dst_y)
|
||||||
if dst_bytes_per_row < row.length() {
|
if dst_bytes_per_row < row.length() {
|
||||||
row = row[.. dst_bytes_per_row]
|
row = row[.. dst_bytes_per_row]
|
||||||
}
|
}
|
||||||
@@ -801,7 +801,7 @@ pri func decoder.swizzle_rle!(dst: ptr base.pixel_buffer, src: base.io_reader) b
|
|||||||
} endwhile.outer
|
} endwhile.outer
|
||||||
|
|
||||||
while this.dst_y < this.height {
|
while this.dst_y < this.height {
|
||||||
row = tab.row(y: this.dst_y)
|
row = tab.row_u32(y: this.dst_y)
|
||||||
if dst_bytes_per_row < row.length() {
|
if dst_bytes_per_row < row.length() {
|
||||||
row = row[.. dst_bytes_per_row]
|
row = row[.. dst_bytes_per_row]
|
||||||
}
|
}
|
||||||
@@ -921,7 +921,7 @@ pri func decoder.swizzle_bitfields!(dst: ptr base.pixel_buffer, src: base.io_rea
|
|||||||
} endwhile
|
} endwhile
|
||||||
// -------- END convert to PIXEL_FORMAT__BGRA_NONPREMUL_4X16LE.
|
// -------- END convert to PIXEL_FORMAT__BGRA_NONPREMUL_4X16LE.
|
||||||
|
|
||||||
dst = tab.row(y: this.dst_y)
|
dst = tab.row_u32(y: this.dst_y)
|
||||||
if dst_bytes_per_row < dst.length() {
|
if dst_bytes_per_row < dst.length() {
|
||||||
dst = dst[.. dst_bytes_per_row]
|
dst = dst[.. dst_bytes_per_row]
|
||||||
}
|
}
|
||||||
@@ -983,7 +983,7 @@ pri func decoder.swizzle_low_bit_depth!(dst: ptr base.pixel_buffer, src: base.io
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dst = tab.row(y: this.dst_y)
|
dst = tab.row_u32(y: this.dst_y)
|
||||||
if dst_bytes_per_row < dst.length() {
|
if dst_bytes_per_row < dst.length() {
|
||||||
dst = dst[.. dst_bytes_per_row]
|
dst = dst[.. dst_bytes_per_row]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1013,7 +1013,7 @@ pri func decoder.copy_to_image_buffer!(pb: ptr base.pixel_buffer, src: slice bas
|
|||||||
// First, copy from src to that part of the frame rect that is inside
|
// First, copy from src to that part of the frame rect that is inside
|
||||||
// args.pb's bounds (clipped to the image bounds).
|
// args.pb's bounds (clipped to the image bounds).
|
||||||
|
|
||||||
dst = tab.row(y: this.dst_y)
|
dst = tab.row_u32(y: this.dst_y)
|
||||||
if this.dst_y >= this.height {
|
if this.dst_y >= this.height {
|
||||||
dst = dst[.. 0]
|
dst = dst[.. 0]
|
||||||
} else if width_in_bytes < dst.length() {
|
} else if width_in_bytes < dst.length() {
|
||||||
@@ -1055,13 +1055,13 @@ pri func decoder.copy_to_image_buffer!(pb: ptr base.pixel_buffer, src: slice bas
|
|||||||
(not this.gc_has_transparent_index) and
|
(not this.gc_has_transparent_index) and
|
||||||
(this.interlace > 1) {
|
(this.interlace > 1) {
|
||||||
|
|
||||||
replicate_src = tab.row(y: this.dst_y)
|
replicate_src = tab.row_u32(y: this.dst_y)
|
||||||
replicate_y0 = this.dst_y ~sat+ 1
|
replicate_y0 = this.dst_y ~sat+ 1
|
||||||
replicate_y1 = this.dst_y ~sat+ (INTERLACE_COUNT[this.interlace] as base.u32)
|
replicate_y1 = this.dst_y ~sat+ (INTERLACE_COUNT[this.interlace] as base.u32)
|
||||||
replicate_y1 = replicate_y1.min(a: this.frame_rect_y1)
|
replicate_y1 = replicate_y1.min(a: this.frame_rect_y1)
|
||||||
while replicate_y0 < replicate_y1 {
|
while replicate_y0 < replicate_y1 {
|
||||||
assert replicate_y0 < 0xFFFF_FFFF via "a < b: a < c; c <= b"(c: replicate_y1)
|
assert replicate_y0 < 0xFFFF_FFFF via "a < b: a < c; c <= b"(c: replicate_y1)
|
||||||
replicate_dst = tab.row(y: replicate_y0)
|
replicate_dst = tab.row_u32(y: replicate_y0)
|
||||||
replicate_dst.copy_from_slice!(s: replicate_src)
|
replicate_dst.copy_from_slice!(s: replicate_src)
|
||||||
replicate_y0 += 1
|
replicate_y0 += 1
|
||||||
} endwhile
|
} endwhile
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ pri func decoder.swizzle!(dst: ptr base.pixel_buffer, src: base.io_reader) base.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dst = tab.row(y: this.dst_y)
|
dst = tab.row_u32(y: this.dst_y)
|
||||||
if dst_bytes_per_row < dst.length() {
|
if dst_bytes_per_row < dst.length() {
|
||||||
dst = dst[.. dst_bytes_per_row]
|
dst = dst[.. dst_bytes_per_row]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ pri func decoder.filter_and_swizzle!(dst: ptr base.pixel_buffer, workbuf: slice
|
|||||||
y = this.frame_rect_y0
|
y = this.frame_rect_y0
|
||||||
while y < this.frame_rect_y1 {
|
while y < this.frame_rect_y1 {
|
||||||
assert y < 0x00FF_FFFF via "a < b: a < c; c <= b"(c: this.frame_rect_y1)
|
assert y < 0x00FF_FFFF via "a < b: a < c; c <= b"(c: this.frame_rect_y1)
|
||||||
dst = tab.row(y: y)
|
dst = tab.row_u32(y: y)
|
||||||
|
|
||||||
if 1 > args.workbuf.length() {
|
if 1 > args.workbuf.length() {
|
||||||
return "#internal error: inconsistent workbuf length"
|
return "#internal error: inconsistent workbuf length"
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ pri func decoder.filter_and_swizzle_tricky!(dst: ptr base.pixel_buffer, workbuf:
|
|||||||
}
|
}
|
||||||
while y < this.frame_rect_y1 {
|
while y < this.frame_rect_y1 {
|
||||||
assert y < 0x00FF_FFFF via "a < b: a < c; c <= b"(c: this.frame_rect_y1)
|
assert y < 0x00FF_FFFF via "a < b: a < c; c <= b"(c: this.frame_rect_y1)
|
||||||
dst = tab.row(y: y)
|
dst = tab.row_u32(y: y)
|
||||||
if dst_bytes_per_row1 < dst.length() {
|
if dst_bytes_per_row1 < dst.length() {
|
||||||
dst = dst[.. dst_bytes_per_row1]
|
dst = dst[.. dst_bytes_per_row1]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader,
|
|||||||
tab = args.dst.plane(p: 0)
|
tab = args.dst.plane(p: 0)
|
||||||
while dst_y < this.height {
|
while dst_y < this.height {
|
||||||
assert dst_y < 0xFFFF_FFFF via "a < b: a < c; c <= b"(c: this.height)
|
assert dst_y < 0xFFFF_FFFF via "a < b: a < c; c <= b"(c: this.height)
|
||||||
dst = tab.row(y: dst_y)
|
dst = tab.row_u32(y: dst_y)
|
||||||
dst_x = 0
|
dst_x = 0
|
||||||
|
|
||||||
while dst_x < this.width,
|
while dst_x < this.width,
|
||||||
@@ -212,7 +212,7 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader,
|
|||||||
{
|
{
|
||||||
yield? base."$short read"
|
yield? base."$short read"
|
||||||
tab = args.dst.plane(p: 0)
|
tab = args.dst.plane(p: 0)
|
||||||
dst = tab.row(y: dst_y)
|
dst = tab.row_u32(y: dst_y)
|
||||||
dst_x_in_bytes = (dst_x as base.u64) * dst_bytes_per_pixel
|
dst_x_in_bytes = (dst_x as base.u64) * dst_bytes_per_pixel
|
||||||
if dst_x_in_bytes <= dst.length() {
|
if dst_x_in_bytes <= dst.length() {
|
||||||
dst = dst[dst_x_in_bytes ..]
|
dst = dst[dst_x_in_bytes ..]
|
||||||
|
|||||||
Reference in new issue
Block a user