mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 00:47:56 +01:00
Add a decode_frame_options type
This commit is contained in:
1 parent
8b1e023e6a
commit
555a72d7a9
10 files changed
+90
-43
No files matched your search
@@ -861,6 +861,24 @@ wuffs_base__pixel_buffer::palette() {
|
|||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
// --------
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
// Do not access the private_impl's fields directly. There is no API/ABI
|
||||||
|
// compatibility or safety guarantee if you do so.
|
||||||
|
struct {
|
||||||
|
uint8_t TODO;
|
||||||
|
} private_impl;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
} wuffs_base__decode_frame_options;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
@@ -157,5 +157,7 @@ const baseImagePublicH = "" +
|
|||||||
"// --------\n\ntypedef struct {\n wuffs_base__pixel_config pixcfg;\n\n // Do not access the private_impl's fields directly. There is no API/ABI\n // compatibility or safety guarantee if you do so.\n struct {\n wuffs_base__table_u8 planes[WUFFS_BASE__PIXEL_FORMAT__NUM_PLANES_MAX];\n uint8_t palette[1024];\n // TODO: color spaces.\n } private_impl;\n\n#ifdef __cplusplus\n inline wuffs_base__status set_from_slice(wuffs_base__pixel_config* pixcfg,\n wuffs_base__slice_u8 pixbuf_memory);\n inline void set_palette(wuffs_base__slice_u8 palette);\n inline wuffs_base__table_u8 plane(uint32_t p);\n inline wuffs_base__slice_u8 palette();\n#endif // __cplusplus\n\n} wuffs_base__pixel_buffer;\n\nstatic inline wuffs_base__status //\nwuffs_base__pixel_buffer__set_from_slice(wuffs_base__pixel_buffer* b,\n wuffs_base__pixel_config* pixcfg,\n wuffs_base__slice_u8 pixbuf_memory) {\n if (!b) {\n return wuffs_base_" +
|
"// --------\n\ntypedef struct {\n wuffs_base__pixel_config pixcfg;\n\n // Do not access the private_impl's fields directly. There is no API/ABI\n // compatibility or safety guarantee if you do so.\n struct {\n wuffs_base__table_u8 planes[WUFFS_BASE__PIXEL_FORMAT__NUM_PLANES_MAX];\n uint8_t palette[1024];\n // TODO: color spaces.\n } private_impl;\n\n#ifdef __cplusplus\n inline wuffs_base__status set_from_slice(wuffs_base__pixel_config* pixcfg,\n wuffs_base__slice_u8 pixbuf_memory);\n inline void set_palette(wuffs_base__slice_u8 palette);\n inline wuffs_base__table_u8 plane(uint32_t p);\n inline wuffs_base__slice_u8 palette();\n#endif // __cplusplus\n\n} wuffs_base__pixel_buffer;\n\nstatic inline wuffs_base__status //\nwuffs_base__pixel_buffer__set_from_slice(wuffs_base__pixel_buffer* b,\n wuffs_base__pixel_config* pixcfg,\n wuffs_base__slice_u8 pixbuf_memory) {\n if (!b) {\n return wuffs_base_" +
|
||||||
"_error__bad_receiver;\n }\n *b = ((wuffs_base__pixel_buffer){});\n if (!pixcfg) {\n return wuffs_base__error__bad_argument;\n }\n // TODO: don't assume 1 byte per pixel. Don't assume packed.\n uint64_t wh = ((uint64_t)pixcfg->private_impl.width) *\n ((uint64_t)pixcfg->private_impl.height);\n if (wh > pixbuf_memory.len) {\n return wuffs_base__error__bad_argument_length_too_short;\n }\n b->pixcfg = *pixcfg;\n wuffs_base__table_u8* tab = &b->private_impl.planes[0];\n tab->ptr = pixbuf_memory.ptr;\n tab->width = pixcfg->private_impl.width;\n tab->height = pixcfg->private_impl.height;\n tab->stride = pixcfg->private_impl.width;\n return NULL;\n}\n\n// The palette argument is ignored unless its length is exactly 1024.\nstatic inline void //\nwuffs_base__pixel_buffer__set_palette(wuffs_base__pixel_buffer* b,\n wuffs_base__slice_u8 palette) {\n if (b && palette.ptr && (palette.len == 1024)) {\n memmove(b->private_impl.palette, palette.ptr, 1024);\n }\n}\n\nstatic inlin" +
|
"_error__bad_receiver;\n }\n *b = ((wuffs_base__pixel_buffer){});\n if (!pixcfg) {\n return wuffs_base__error__bad_argument;\n }\n // TODO: don't assume 1 byte per pixel. Don't assume packed.\n uint64_t wh = ((uint64_t)pixcfg->private_impl.width) *\n ((uint64_t)pixcfg->private_impl.height);\n if (wh > pixbuf_memory.len) {\n return wuffs_base__error__bad_argument_length_too_short;\n }\n b->pixcfg = *pixcfg;\n wuffs_base__table_u8* tab = &b->private_impl.planes[0];\n tab->ptr = pixbuf_memory.ptr;\n tab->width = pixcfg->private_impl.width;\n tab->height = pixcfg->private_impl.height;\n tab->stride = pixcfg->private_impl.width;\n return NULL;\n}\n\n// The palette argument is ignored unless its length is exactly 1024.\nstatic inline void //\nwuffs_base__pixel_buffer__set_palette(wuffs_base__pixel_buffer* b,\n wuffs_base__slice_u8 palette) {\n if (b && palette.ptr && (palette.len == 1024)) {\n memmove(b->private_impl.palette, palette.ptr, 1024);\n }\n}\n\nstatic inlin" +
|
||||||
"e wuffs_base__table_u8 //\nwuffs_base__pixel_buffer__plane(wuffs_base__pixel_buffer* b, uint32_t p) {\n return (b && (p < WUFFS_BASE__PIXEL_FORMAT__NUM_PLANES_MAX))\n ? b->private_impl.planes[p]\n : ((wuffs_base__table_u8){});\n}\n\n// wuffs_base__pixel_buffer__palette returns the palette that the pixel data\n// can index. The backing array is inside b and has length 1024.\nstatic inline wuffs_base__slice_u8 //\nwuffs_base__pixel_buffer__palette(wuffs_base__pixel_buffer* b) {\n return b ? ((wuffs_base__slice_u8){.ptr = b->private_impl.palette,\n .len = 1024})\n : ((wuffs_base__slice_u8){});\n}\n\n#ifdef __cplusplus\n\ninline wuffs_base__status //\nwuffs_base__pixel_buffer::set_from_slice(wuffs_base__pixel_config* pixcfg,\n wuffs_base__slice_u8 pixbuf_memory) {\n return wuffs_base__pixel_buffer__set_from_slice(this, pixcfg, pixbuf_memory);\n}\n\ninline void //\nwuffs_base__pixel_buffer::set_palette(wuffs_base__slice_u8 " +
|
"e wuffs_base__table_u8 //\nwuffs_base__pixel_buffer__plane(wuffs_base__pixel_buffer* b, uint32_t p) {\n return (b && (p < WUFFS_BASE__PIXEL_FORMAT__NUM_PLANES_MAX))\n ? b->private_impl.planes[p]\n : ((wuffs_base__table_u8){});\n}\n\n// wuffs_base__pixel_buffer__palette returns the palette that the pixel data\n// can index. The backing array is inside b and has length 1024.\nstatic inline wuffs_base__slice_u8 //\nwuffs_base__pixel_buffer__palette(wuffs_base__pixel_buffer* b) {\n return b ? ((wuffs_base__slice_u8){.ptr = b->private_impl.palette,\n .len = 1024})\n : ((wuffs_base__slice_u8){});\n}\n\n#ifdef __cplusplus\n\ninline wuffs_base__status //\nwuffs_base__pixel_buffer::set_from_slice(wuffs_base__pixel_config* pixcfg,\n wuffs_base__slice_u8 pixbuf_memory) {\n return wuffs_base__pixel_buffer__set_from_slice(this, pixcfg, pixbuf_memory);\n}\n\ninline void //\nwuffs_base__pixel_buffer::set_palette(wuffs_base__slice_u8 " +
|
||||||
"palette) {\n wuffs_base__pixel_buffer__set_palette(this, palette);\n}\n\ninline wuffs_base__table_u8 //\nwuffs_base__pixel_buffer::plane(uint32_t p) {\n return wuffs_base__pixel_buffer__plane(this, p);\n}\n\ninline wuffs_base__slice_u8 //\nwuffs_base__pixel_buffer::palette() {\n return wuffs_base__pixel_buffer__palette(this);\n}\n\n#endif // __cplusplus\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n" +
|
"palette) {\n wuffs_base__pixel_buffer__set_palette(this, palette);\n}\n\ninline wuffs_base__table_u8 //\nwuffs_base__pixel_buffer::plane(uint32_t p) {\n return wuffs_base__pixel_buffer__plane(this, p);\n}\n\ninline wuffs_base__slice_u8 //\nwuffs_base__pixel_buffer::palette() {\n return wuffs_base__pixel_buffer__palette(this);\n}\n\n#endif // __cplusplus\n\n" +
|
||||||
|
"" +
|
||||||
|
"// --------\n\ntypedef struct {\n // Do not access the private_impl's fields directly. There is no API/ABI\n // compatibility or safety guarantee if you do so.\n struct {\n uint8_t TODO;\n } private_impl;\n\n#ifdef __cplusplus\n#endif // __cplusplus\n\n} wuffs_base__decode_frame_options;\n\n#ifdef __cplusplus\n\n#endif // __cplusplus\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n" +
|
||||||
""
|
""
|
||||||
@@ -356,11 +356,12 @@ const char* play() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
|
z = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader,
|
||||||
((wuffs_base__slice_u8){
|
((wuffs_base__slice_u8){
|
||||||
.ptr = work_buffer,
|
.ptr = work_buffer,
|
||||||
.len = work_len,
|
.len = work_len,
|
||||||
}));
|
}),
|
||||||
|
NULL);
|
||||||
if (z) {
|
if (z) {
|
||||||
if (z == wuffs_base__warning__end_of_data) {
|
if (z == wuffs_base__warning__end_of_data) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -109,11 +109,12 @@ const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
|
|||||||
|
|
||||||
bool seen_ok = false;
|
bool seen_ok = false;
|
||||||
while (true) {
|
while (true) {
|
||||||
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
|
z = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader,
|
||||||
((wuffs_base__slice_u8){
|
((wuffs_base__slice_u8){
|
||||||
.ptr = workbuf,
|
.ptr = workbuf,
|
||||||
.len = workbuf_size,
|
.len = workbuf_size,
|
||||||
}));
|
}),
|
||||||
|
NULL);
|
||||||
if (z) {
|
if (z) {
|
||||||
if ((z != wuffs_base__warning__end_of_data) || !seen_ok) {
|
if ((z != wuffs_base__warning__end_of_data) || !seen_ok) {
|
||||||
ret = z;
|
ret = z;
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ var Types = []string{
|
|||||||
"image_config",
|
"image_config",
|
||||||
"pixel_buffer",
|
"pixel_buffer",
|
||||||
"pixel_config",
|
"pixel_config",
|
||||||
|
|
||||||
|
"decode_frame_options",
|
||||||
}
|
}
|
||||||
|
|
||||||
var Funcs = []string{
|
var Funcs = []string{
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ var (
|
|||||||
typeExprPixelBuffer = a.NewTypeExpr(0, t.IDBase, t.IDPixelBuffer, 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)
|
typeExprPixelConfig = a.NewTypeExpr(0, t.IDBase, t.IDPixelConfig, nil, nil, nil)
|
||||||
|
|
||||||
|
typeExprDecodeFrameOptions = a.NewTypeExpr(0, t.IDBase, t.IDDecodeFrameOptions, nil, nil, nil)
|
||||||
|
|
||||||
typeExprSliceU8 = a.NewTypeExpr(t.IDSlice, 0, 0, nil, nil, typeExprU8)
|
typeExprSliceU8 = a.NewTypeExpr(t.IDSlice, 0, 0, nil, nil, typeExprU8)
|
||||||
typeExprTableU8 = a.NewTypeExpr(t.IDTable, 0, 0, nil, nil, typeExprU8)
|
typeExprTableU8 = a.NewTypeExpr(t.IDTable, 0, 0, nil, nil, typeExprU8)
|
||||||
)
|
)
|
||||||
@@ -103,6 +105,8 @@ var builtInTypeMap = typeMap{
|
|||||||
t.IDImageConfig: typeExprImageConfig,
|
t.IDImageConfig: typeExprImageConfig,
|
||||||
t.IDPixelBuffer: typeExprPixelBuffer,
|
t.IDPixelBuffer: typeExprPixelBuffer,
|
||||||
t.IDPixelConfig: typeExprPixelConfig,
|
t.IDPixelConfig: typeExprPixelConfig,
|
||||||
|
|
||||||
|
t.IDDecodeFrameOptions: typeExprDecodeFrameOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Checker) parseBuiltInFuncs(ss []string, generic bool) (map[t.QQID]*a.Func, error) {
|
func (c *Checker) parseBuiltInFuncs(ss []string, generic bool) (map[t.QQID]*a.Func, error) {
|
||||||
|
|||||||
+14
-10
@@ -413,11 +413,6 @@ const (
|
|||||||
IDIOWriter = ID(0x111)
|
IDIOWriter = ID(0x111)
|
||||||
IDStatus = ID(0x112)
|
IDStatus = ID(0x112)
|
||||||
|
|
||||||
IDFrameConfig = ID(0x114)
|
|
||||||
IDImageConfig = ID(0x115)
|
|
||||||
IDPixelBuffer = ID(0x116)
|
|
||||||
IDPixelConfig = ID(0x117)
|
|
||||||
|
|
||||||
IDT1 = ID(0x118)
|
IDT1 = ID(0x118)
|
||||||
IDT2 = ID(0x119)
|
IDT2 = ID(0x119)
|
||||||
IDDagger1 = ID(0x11A)
|
IDDagger1 = ID(0x11A)
|
||||||
@@ -526,6 +521,13 @@ const (
|
|||||||
IDCopyNFromReader = ID(0x193)
|
IDCopyNFromReader = ID(0x193)
|
||||||
IDCopyNFromSlice = ID(0x194)
|
IDCopyNFromSlice = ID(0x194)
|
||||||
|
|
||||||
|
IDFrameConfig = ID(0x1C0)
|
||||||
|
IDImageConfig = ID(0x1C1)
|
||||||
|
IDPixelBuffer = ID(0x1C2)
|
||||||
|
IDPixelConfig = ID(0x1C3)
|
||||||
|
|
||||||
|
IDDecodeFrameOptions = ID(0x1C8)
|
||||||
|
|
||||||
// -------- 0x200 block.
|
// -------- 0x200 block.
|
||||||
|
|
||||||
IDReset = ID(0x200)
|
IDReset = ID(0x200)
|
||||||
@@ -680,11 +682,6 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
IDIOWriter: "io_writer",
|
IDIOWriter: "io_writer",
|
||||||
IDStatus: "status",
|
IDStatus: "status",
|
||||||
|
|
||||||
IDFrameConfig: "frame_config",
|
|
||||||
IDImageConfig: "image_config",
|
|
||||||
IDPixelBuffer: "pixel_buffer",
|
|
||||||
IDPixelConfig: "pixel_config",
|
|
||||||
|
|
||||||
// Some of the next few IDs are never returned by the tokenizer, as it
|
// Some of the next few IDs are never returned by the tokenizer, as it
|
||||||
// rejects non-ASCII input. The string representations "¶", "ℤ" etc. are
|
// rejects non-ASCII input. The string representations "¶", "ℤ" etc. are
|
||||||
// specifically non-ASCII so that no user-defined (non built-in) identifier
|
// specifically non-ASCII so that no user-defined (non built-in) identifier
|
||||||
@@ -810,6 +807,13 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
IDCopyNFromReader: "copy_n_from_reader",
|
IDCopyNFromReader: "copy_n_from_reader",
|
||||||
IDCopyNFromSlice: "copy_n_from_slice",
|
IDCopyNFromSlice: "copy_n_from_slice",
|
||||||
|
|
||||||
|
IDFrameConfig: "frame_config",
|
||||||
|
IDImageConfig: "image_config",
|
||||||
|
IDPixelBuffer: "pixel_buffer",
|
||||||
|
IDPixelConfig: "pixel_config",
|
||||||
|
|
||||||
|
IDDecodeFrameOptions: "decode_frame_options",
|
||||||
|
|
||||||
// -------- 0x200 block.
|
// -------- 0x200 block.
|
||||||
|
|
||||||
IDReset: "reset",
|
IDReset: "reset",
|
||||||
|
|||||||
@@ -1967,6 +1967,24 @@ wuffs_base__pixel_buffer::palette() {
|
|||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
// --------
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
// Do not access the private_impl's fields directly. There is no API/ABI
|
||||||
|
// compatibility or safety guarantee if you do so.
|
||||||
|
struct {
|
||||||
|
uint8_t TODO;
|
||||||
|
} private_impl;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
} wuffs_base__decode_frame_options;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
@@ -2544,11 +2562,11 @@ typedef struct {
|
|||||||
uint64_t a_io_position);
|
uint64_t a_io_position);
|
||||||
inline wuffs_base__status decode_frame_config(wuffs_base__frame_config* a_dst,
|
inline wuffs_base__status decode_frame_config(wuffs_base__frame_config* a_dst,
|
||||||
wuffs_base__io_reader a_src);
|
wuffs_base__io_reader a_src);
|
||||||
inline wuffs_base__status decode_frame(wuffs_base__pixel_buffer* a_dst,
|
inline wuffs_base__status decode_frame(
|
||||||
uint32_t a_pixbuf_origin_x,
|
wuffs_base__pixel_buffer* a_dst,
|
||||||
uint32_t a_pixbuf_origin_y,
|
wuffs_base__io_reader a_src,
|
||||||
wuffs_base__io_reader a_src,
|
wuffs_base__slice_u8 a_work_buffer,
|
||||||
wuffs_base__slice_u8 a_work_buffer);
|
wuffs_base__decode_frame_options* a_opts);
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
} wuffs_gif__decoder;
|
} wuffs_gif__decoder;
|
||||||
@@ -2594,10 +2612,9 @@ wuffs_gif__decoder__decode_frame_config(wuffs_gif__decoder* self,
|
|||||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__status //
|
WUFFS_BASE__MAYBE_STATIC wuffs_base__status //
|
||||||
wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
|
wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
|
||||||
wuffs_base__pixel_buffer* a_dst,
|
wuffs_base__pixel_buffer* a_dst,
|
||||||
uint32_t a_pixbuf_origin_x,
|
|
||||||
uint32_t a_pixbuf_origin_y,
|
|
||||||
wuffs_base__io_reader a_src,
|
wuffs_base__io_reader a_src,
|
||||||
wuffs_base__slice_u8 a_work_buffer);
|
wuffs_base__slice_u8 a_work_buffer,
|
||||||
|
wuffs_base__decode_frame_options* a_opts);
|
||||||
|
|
||||||
// ---------------- C++ Convenience Methods
|
// ---------------- C++ Convenience Methods
|
||||||
|
|
||||||
@@ -2644,12 +2661,11 @@ wuffs_gif__decoder::decode_frame_config(wuffs_base__frame_config* a_dst,
|
|||||||
|
|
||||||
inline wuffs_base__status //
|
inline wuffs_base__status //
|
||||||
wuffs_gif__decoder::decode_frame(wuffs_base__pixel_buffer* a_dst,
|
wuffs_gif__decoder::decode_frame(wuffs_base__pixel_buffer* a_dst,
|
||||||
uint32_t a_pixbuf_origin_x,
|
|
||||||
uint32_t a_pixbuf_origin_y,
|
|
||||||
wuffs_base__io_reader a_src,
|
wuffs_base__io_reader a_src,
|
||||||
wuffs_base__slice_u8 a_work_buffer) {
|
wuffs_base__slice_u8 a_work_buffer,
|
||||||
return wuffs_gif__decoder__decode_frame(
|
wuffs_base__decode_frame_options* a_opts) {
|
||||||
this, a_dst, a_pixbuf_origin_x, a_pixbuf_origin_y, a_src, a_work_buffer);
|
return wuffs_gif__decoder__decode_frame(this, a_dst, a_src, a_work_buffer,
|
||||||
|
a_opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
@@ -6728,10 +6744,9 @@ exit:
|
|||||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__status //
|
WUFFS_BASE__MAYBE_STATIC wuffs_base__status //
|
||||||
wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
|
wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
|
||||||
wuffs_base__pixel_buffer* a_dst,
|
wuffs_base__pixel_buffer* a_dst,
|
||||||
uint32_t a_pixbuf_origin_x,
|
|
||||||
uint32_t a_pixbuf_origin_y,
|
|
||||||
wuffs_base__io_reader a_src,
|
wuffs_base__io_reader a_src,
|
||||||
wuffs_base__slice_u8 a_work_buffer) {
|
wuffs_base__slice_u8 a_work_buffer,
|
||||||
|
wuffs_base__decode_frame_options* a_opts) {
|
||||||
if (!self) {
|
if (!self) {
|
||||||
return wuffs_base__error__bad_receiver;
|
return wuffs_base__error__bad_receiver;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,8 +234,8 @@ pri func decoder.skip_frame!??(src base.io_reader) {
|
|||||||
this.reset_gc!()
|
this.reset_gc!()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: honor pixbuf_origin_x and pixbuf_origin_y args.
|
// TODO: honor args.opts.
|
||||||
pub func decoder.decode_frame!??(dst ptr base.pixel_buffer, pixbuf_origin_x base.u32, pixbuf_origin_y base.u32, src base.io_reader, work_buffer slice base.u8) {
|
pub func decoder.decode_frame!??(dst ptr base.pixel_buffer, src base.io_reader, work_buffer slice base.u8, opts nptr base.decode_frame_options) {
|
||||||
if args.work_buffer.length() != (this.width as base.u64) {
|
if args.work_buffer.length() != (this.width as base.u64) {
|
||||||
return status "?bad work buffer length"
|
return status "?bad work buffer length"
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -239,8 +239,8 @@ const char* wuffs_gif_decode(wuffs_base__io_buffer* dst,
|
|||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
|
z = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader, work_buffer,
|
||||||
work_buffer);
|
NULL);
|
||||||
if (z) {
|
if (z) {
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
@@ -376,7 +376,7 @@ bool do_test_wuffs_gif_decode(const char* filename,
|
|||||||
size_t old_ri = src.ri;
|
size_t old_ri = src.ri;
|
||||||
|
|
||||||
wuffs_base__status z = wuffs_gif__decoder__decode_frame(
|
wuffs_base__status z = wuffs_gif__decoder__decode_frame(
|
||||||
&dec, &pb, 0, 0, src_reader, work_buffer);
|
&dec, &pb, src_reader, work_buffer, NULL);
|
||||||
|
|
||||||
if (!z) {
|
if (!z) {
|
||||||
break;
|
break;
|
||||||
@@ -447,7 +447,7 @@ bool do_test_wuffs_gif_decode(const char* filename,
|
|||||||
}
|
}
|
||||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||||
wuffs_base__status z = wuffs_gif__decoder__decode_frame(
|
wuffs_base__status z = wuffs_gif__decoder__decode_frame(
|
||||||
&dec, &pb, 0, 0, src_reader, work_buffer);
|
&dec, &pb, src_reader, work_buffer, NULL);
|
||||||
if (z != wuffs_base__warning__end_of_data) {
|
if (z != wuffs_base__warning__end_of_data) {
|
||||||
FAIL("decode_frame: got \"%s\", want \"%s\"", z,
|
FAIL("decode_frame: got \"%s\", want \"%s\"", z,
|
||||||
wuffs_base__warning__end_of_data);
|
wuffs_base__warning__end_of_data);
|
||||||
@@ -560,8 +560,8 @@ bool do_test_wuffs_gif_decode_animated(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
|
z = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader, work_buffer,
|
||||||
work_buffer);
|
NULL);
|
||||||
if (z) {
|
if (z) {
|
||||||
FAIL("decode_frame #%" PRIu32 ": got \"%s\"", i, z);
|
FAIL("decode_frame #%" PRIu32 ": got \"%s\"", i, z);
|
||||||
return false;
|
return false;
|
||||||
@@ -585,8 +585,8 @@ bool do_test_wuffs_gif_decode_animated(
|
|||||||
// There should be no more frames, no matter how many times we call
|
// There should be no more frames, no matter how many times we call
|
||||||
// decode_frame.
|
// decode_frame.
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
|
z = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader, work_buffer,
|
||||||
work_buffer);
|
NULL);
|
||||||
if (z != wuffs_base__warning__end_of_data) {
|
if (z != wuffs_base__warning__end_of_data) {
|
||||||
FAIL("decode_frame: got \"%s\", want \"%s\"", z,
|
FAIL("decode_frame: got \"%s\", want \"%s\"", z,
|
||||||
wuffs_base__warning__end_of_data);
|
wuffs_base__warning__end_of_data);
|
||||||
@@ -797,8 +797,8 @@ bool do_test_wuffs_gif_num_decoded(bool frame_config) {
|
|||||||
if (frame_config) {
|
if (frame_config) {
|
||||||
z = wuffs_gif__decoder__decode_frame_config(&dec, NULL, src_reader);
|
z = wuffs_gif__decoder__decode_frame_config(&dec, NULL, src_reader);
|
||||||
} else {
|
} else {
|
||||||
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
|
z = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader, work_buffer,
|
||||||
work_buffer);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!z) {
|
if (!z) {
|
||||||
|
|||||||
Reference in new issue
Block a user