Rename table.row as table.row_u32

This commit is contained in:
Nigel Tao committed 2021-11-15 10:49:42 +11:00
1 parent fa56d92410
commit 0045ce49f3
9 files changed
+18 -18

No files matched your search

+1 -1
View File
@@ -1026,7 +1026,7 @@ func (g *gen) writeBuiltinTable(b *buffer, recv *a.Expr, method t.ID, args []*a.
case t.IDWidth:
field = "width"
case t.IDRow:
case t.IDRowU32:
// TODO: don't assume that the table is a table of base.u8.
b.writes("wuffs_base__table_u8__row(")
if err := g.writeExpr(b, recv, false, depth); err != nil {
+1 -1
View File
@@ -963,7 +963,7 @@ var TableFuncs = []string{
"GENERIC T2.stride() u64",
"GENERIC T2.width() u64",
"GENERIC T2.row(y: u32) T1",
"GENERIC T2.row_u32(y: u32) T1",
"GENERIC T2.subtable(" +
"min_incl_x: u64, min_incl_y: u64, max_incl_x: u64, max_incl_y: u64) T2",
}
+2 -2
View File
@@ -668,7 +668,7 @@ const (
IDIO = ID(0x242)
IDLimit = ID(0x243)
IDPrefix = ID(0x244)
IDRow = ID(0x245)
IDRowU32 = ID(0x245)
IDStride = ID(0x246)
IDSubslice = ID(0x247)
IDSubtable = ID(0x248)
@@ -1094,7 +1094,7 @@ var builtInsByID = [nBuiltInIDs]string{
IDIO: "io",
IDLimit: "limit",
IDPrefix: "prefix",
IDRow: "row",
IDRowU32: "row_u32",
IDStride: "stride",
IDSubslice: "subslice",
IDSubtable: "subtable",
+6 -6
View File
@@ -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() {
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
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() {
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 {
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() {
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
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() {
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
// -------- 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() {
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() {
dst = dst[.. dst_bytes_per_row]
}
+3 -3
View File
@@ -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
// 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 {
dst = dst[.. 0]
} 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
(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_y1 = this.dst_y ~sat+ (INTERLACE_COUNT[this.interlace] as base.u32)
replicate_y1 = replicate_y1.min(a: this.frame_rect_y1)
while replicate_y0 < 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_y0 += 1
} endwhile
+1 -1
View File
@@ -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() {
dst = dst[.. dst_bytes_per_row]
}
+1 -1
View File
@@ -67,7 +67,7 @@ pri func decoder.filter_and_swizzle!(dst: ptr base.pixel_buffer, workbuf: slice
y = this.frame_rect_y0
while y < 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() {
return "#internal error: inconsistent workbuf length"
+1 -1
View File
@@ -62,7 +62,7 @@ pri func decoder.filter_and_swizzle_tricky!(dst: ptr base.pixel_buffer, workbuf:
}
while y < 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() {
dst = dst[.. dst_bytes_per_row1]
}
+2 -2
View File
@@ -196,7 +196,7 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader,
tab = args.dst.plane(p: 0)
while dst_y < 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
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"
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
if dst_x_in_bytes <= dst.length() {
dst = dst[dst_x_in_bytes ..]