mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Redo {frame,image,pixel}_config and pixel_buffer
This commit is contained in:
1 parent
4e70498189
commit
1c75f7b748
12 files changed
+945
-560
No files matched your search
+21
-14
@@ -88,11 +88,14 @@ var Types = []string{
|
||||
"rect_ie_u32",
|
||||
"rect_ii_u32",
|
||||
|
||||
"image_buffer",
|
||||
"image_config",
|
||||
"io_reader",
|
||||
"io_writer",
|
||||
"status",
|
||||
|
||||
"frame_config",
|
||||
"image_config",
|
||||
"pixel_buffer",
|
||||
"pixel_config",
|
||||
}
|
||||
|
||||
var Funcs = []string{
|
||||
@@ -125,18 +128,6 @@ var Funcs = []string{
|
||||
"utility.make_rect_ii_u32(min_incl_x u32, min_incl_y u32, max_incl_x u32, max_incl_y u32)(ret rect_ii_u32)",
|
||||
"utility.make_rect_ie_u32(min_incl_x u32, min_incl_y u32, max_excl_x u32, max_excl_y u32)(ret rect_ie_u32)",
|
||||
|
||||
// ---- image_buffer
|
||||
|
||||
"image_buffer.plane(p u32[..3])(ret table u8)",
|
||||
// Duration's upper bound is the maximum possible i64 value.
|
||||
"image_buffer.update!(dirty_rect rect_ie_u32, duration u64[..0x7FFFFFFFFFFFFFFF], " +
|
||||
"blend bool, disposal u8, palette slice u8)()",
|
||||
|
||||
// ---- image_config
|
||||
|
||||
"image_config.initialize!(pixfmt u32, pixsub u32, width u32, height u32, " +
|
||||
"num_loops u32, first_frame_is_opaque bool)()",
|
||||
|
||||
// ---- io_reader
|
||||
|
||||
"io_reader.can_undo_byte()(ret bool)",
|
||||
@@ -256,6 +247,22 @@ var Funcs = []string{
|
||||
"status.is_error()(ret bool)",
|
||||
"status.is_ok()(ret bool)",
|
||||
"status.is_suspension()(ret bool)",
|
||||
|
||||
// ---- frame_config
|
||||
|
||||
// Duration's upper bound is the maximum possible i64 value.
|
||||
"frame_config.update!(bounds rect_ie_u32, duration u64[..0x7FFFFFFFFFFFFFFF], " +
|
||||
"blend bool, disposal u8, palette_changed bool)()",
|
||||
|
||||
// ---- image_config
|
||||
|
||||
"image_config.initialize!(pixfmt u32, pixsub u32, width u32, height u32, " +
|
||||
"num_loops u32, first_frame_is_opaque bool)()",
|
||||
|
||||
// ---- pixel_buffer
|
||||
|
||||
"pixel_buffer.plane(p u32[..3])(ret table u8)",
|
||||
"pixel_buffer.set_palette!(palette slice u8)()",
|
||||
}
|
||||
|
||||
// The "T1" and "T2" types here are placeholders for generic "slice T" or
|
||||
|
||||
+14
-8
@@ -58,11 +58,14 @@ var (
|
||||
typeExprRectIEU32 = a.NewTypeExpr(0, t.IDBase, t.IDRectIEU32, nil, nil, nil)
|
||||
typeExprRectIIU32 = a.NewTypeExpr(0, t.IDBase, t.IDRectIIU32, nil, nil, nil)
|
||||
|
||||
typeExprImageBuffer = a.NewTypeExpr(0, t.IDBase, t.IDImageBuffer, nil, nil, nil)
|
||||
typeExprIOReader = a.NewTypeExpr(0, t.IDBase, t.IDIOReader, nil, nil, nil)
|
||||
typeExprIOWriter = a.NewTypeExpr(0, t.IDBase, t.IDIOWriter, nil, nil, nil)
|
||||
typeExprStatus = a.NewTypeExpr(0, t.IDBase, t.IDStatus, nil, nil, nil)
|
||||
|
||||
typeExprFrameConfig = a.NewTypeExpr(0, t.IDBase, t.IDFrameConfig, nil, nil, nil)
|
||||
typeExprImageConfig = a.NewTypeExpr(0, t.IDBase, t.IDImageConfig, nil, nil, nil)
|
||||
typeExprIOReader = a.NewTypeExpr(0, t.IDBase, t.IDIOReader, nil, nil, nil)
|
||||
typeExprIOWriter = a.NewTypeExpr(0, t.IDBase, t.IDIOWriter, nil, nil, nil)
|
||||
typeExprStatus = a.NewTypeExpr(0, t.IDBase, t.IDStatus, nil, nil, nil)
|
||||
typeExprPixelBuffer = a.NewTypeExpr(0, t.IDBase, t.IDPixelBuffer, nil, nil, nil)
|
||||
typeExprPixelConfig = a.NewTypeExpr(0, t.IDBase, t.IDPixelConfig, nil, nil, nil)
|
||||
|
||||
typeExprSliceU8 = a.NewTypeExpr(t.IDSlice, 0, 0, nil, nil, typeExprU8)
|
||||
typeExprTableU8 = a.NewTypeExpr(t.IDTable, 0, 0, nil, nil, typeExprU8)
|
||||
@@ -93,11 +96,14 @@ var builtInTypeMap = typeMap{
|
||||
t.IDRectIEU32: typeExprRectIEU32,
|
||||
t.IDRectIIU32: typeExprRectIIU32,
|
||||
|
||||
t.IDImageBuffer: typeExprImageBuffer,
|
||||
t.IDIOReader: typeExprIOReader,
|
||||
t.IDIOWriter: typeExprIOWriter,
|
||||
t.IDStatus: typeExprStatus,
|
||||
|
||||
t.IDFrameConfig: typeExprFrameConfig,
|
||||
t.IDImageConfig: typeExprImageConfig,
|
||||
t.IDIOReader: typeExprIOReader,
|
||||
t.IDIOWriter: typeExprIOWriter,
|
||||
t.IDStatus: typeExprStatus,
|
||||
t.IDPixelBuffer: typeExprPixelBuffer,
|
||||
t.IDPixelConfig: typeExprPixelConfig,
|
||||
}
|
||||
|
||||
func (c *Checker) parseBuiltInFuncs(ss []string, generic bool) (map[t.QQID]*a.Func, error) {
|
||||
|
||||
+15
-9
@@ -412,11 +412,14 @@ const (
|
||||
IDRectIEU32 = ID(0x10C)
|
||||
IDRectIIU32 = ID(0x10D)
|
||||
|
||||
IDImageBuffer = ID(0x110)
|
||||
IDImageConfig = ID(0x111)
|
||||
IDIOReader = ID(0x112)
|
||||
IDIOWriter = ID(0x113)
|
||||
IDStatus = ID(0x114)
|
||||
IDIOReader = ID(0x110)
|
||||
IDIOWriter = ID(0x111)
|
||||
IDStatus = ID(0x112)
|
||||
|
||||
IDFrameConfig = ID(0x114)
|
||||
IDImageConfig = ID(0x115)
|
||||
IDPixelBuffer = ID(0x116)
|
||||
IDPixelConfig = ID(0x117)
|
||||
|
||||
IDT1 = ID(0x118)
|
||||
IDT2 = ID(0x119)
|
||||
@@ -679,11 +682,14 @@ var builtInsByID = [nBuiltInIDs]string{
|
||||
IDRectIEU32: "rect_ie_u32",
|
||||
IDRectIIU32: "rect_ii_u32",
|
||||
|
||||
IDImageBuffer: "image_buffer",
|
||||
IDIOReader: "io_reader",
|
||||
IDIOWriter: "io_writer",
|
||||
IDStatus: "status",
|
||||
|
||||
IDFrameConfig: "frame_config",
|
||||
IDImageConfig: "image_config",
|
||||
IDIOReader: "io_reader",
|
||||
IDIOWriter: "io_writer",
|
||||
IDStatus: "status",
|
||||
IDPixelBuffer: "pixel_buffer",
|
||||
IDPixelConfig: "pixel_config",
|
||||
|
||||
// Some of the next few IDs are never returned by the tokenizer, as it
|
||||
// rejects non-ASCII input. The string representations "¶", "ℤ" etc. are
|
||||
|
||||
Reference in new issue
Block a user