mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 08:47:28 +01:00
Add a base.image_buffer arg to decode_frame
This commit is contained in:
1 parent
33ca57b553
commit
2301c763c3
9 files changed
+59
-35
No files matched your search
+12
-8
@@ -72,10 +72,12 @@ var Types = []string{
|
||||
|
||||
"empty_struct",
|
||||
"bool",
|
||||
"status",
|
||||
|
||||
"image_buffer",
|
||||
"image_config",
|
||||
"io_reader",
|
||||
"io_writer",
|
||||
"image_config",
|
||||
"status",
|
||||
}
|
||||
|
||||
var Funcs = []string{
|
||||
@@ -99,11 +101,11 @@ var Funcs = []string{
|
||||
"u64.max(x u64)(ret u64)",
|
||||
"u64.min(x u64)(ret u64)",
|
||||
|
||||
// ---- status
|
||||
// ---- image_buffer
|
||||
|
||||
"status.is_error()(ret bool)",
|
||||
"status.is_ok()(ret bool)",
|
||||
"status.is_suspension()(ret bool)",
|
||||
// ---- image_config
|
||||
|
||||
"image_config.initialize!(pixfmt u32, pixsub u32, width u32, height u32, num_loops u32)()",
|
||||
|
||||
// ---- io_reader
|
||||
|
||||
@@ -146,9 +148,11 @@ var Funcs = []string{
|
||||
"io_writer.copy_from_slice!(s slice u8)(ret u64)",
|
||||
"io_writer.copy_from_slice32!(s slice u8, length u32)(ret u32)",
|
||||
|
||||
// ---- image_config
|
||||
// ---- status
|
||||
|
||||
"image_config.initialize!(pixfmt u32, pixsub u32, width u32, height u32, num_loops u32)()",
|
||||
"status.is_error()(ret bool)",
|
||||
"status.is_ok()(ret bool)",
|
||||
"status.is_suspension()(ret bool)",
|
||||
}
|
||||
|
||||
// The "T" types here are placeholders for generic "slice U" types. After
|
||||
|
||||
+13
-8
@@ -46,10 +46,12 @@ var (
|
||||
|
||||
typeExprEmptyStruct = a.NewTypeExpr(0, t.IDBase, t.IDEmptyStruct, nil, nil, nil)
|
||||
typeExprBool = a.NewTypeExpr(0, t.IDBase, t.IDBool, nil, nil, nil)
|
||||
typeExprStatus = a.NewTypeExpr(0, t.IDBase, t.IDStatus, nil, nil, nil)
|
||||
|
||||
typeExprImageBuffer = a.NewTypeExpr(0, t.IDBase, t.IDImageBuffer, 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)
|
||||
typeExprImageConfig = a.NewTypeExpr(0, t.IDBase, t.IDImageConfig, nil, nil, nil)
|
||||
typeExprStatus = a.NewTypeExpr(0, t.IDBase, t.IDStatus, nil, nil, nil)
|
||||
|
||||
typeExprSliceU8 = a.NewTypeExpr(t.IDSlice, 0, 0, nil, nil, typeExprU8)
|
||||
)
|
||||
@@ -58,16 +60,19 @@ var (
|
||||
type typeMap map[t.ID]*a.TypeExpr
|
||||
|
||||
var builtInTypeMap = typeMap{
|
||||
t.IDU8: typeExprU8,
|
||||
t.IDU16: typeExprU16,
|
||||
t.IDU32: typeExprU32,
|
||||
t.IDU64: typeExprU64,
|
||||
t.IDU8: typeExprU8,
|
||||
t.IDU16: typeExprU16,
|
||||
t.IDU32: typeExprU32,
|
||||
t.IDU64: typeExprU64,
|
||||
|
||||
t.IDEmptyStruct: typeExprEmptyStruct,
|
||||
t.IDBool: typeExprBool,
|
||||
t.IDStatus: typeExprStatus,
|
||||
|
||||
t.IDImageBuffer: typeExprImageBuffer,
|
||||
t.IDImageConfig: typeExprImageConfig,
|
||||
t.IDIOReader: typeExprIOReader,
|
||||
t.IDIOWriter: typeExprIOWriter,
|
||||
t.IDImageConfig: typeExprImageConfig,
|
||||
t.IDStatus: typeExprStatus,
|
||||
}
|
||||
|
||||
func (c *Checker) builtInFunc(qqid t.QQID) (*a.Func, error) {
|
||||
|
||||
+3
-1
@@ -400,7 +400,8 @@ const (
|
||||
IDIOReader = ID(0x103)
|
||||
IDIOWriter = ID(0x104)
|
||||
IDCapitalT = ID(0x105)
|
||||
IDImageConfig = ID(0x106)
|
||||
IDImageBuffer = ID(0x106)
|
||||
IDImageConfig = ID(0x107)
|
||||
|
||||
IDPilcrow = ID(0x10D)
|
||||
IDDiamond = ID(0x10E)
|
||||
@@ -586,6 +587,7 @@ var builtInsByID = [nBuiltInIDs]string{
|
||||
IDIOReader: "io_reader",
|
||||
IDIOWriter: "io_writer",
|
||||
IDCapitalT: "T",
|
||||
IDImageBuffer: "image_buffer",
|
||||
IDImageConfig: "image_config",
|
||||
|
||||
// The next few IDs are never returned by the tokenizer, as it rejects
|
||||
|
||||
Reference in new issue
Block a user