|
|
|
@@ -22,7 +22,8 @@ const baseBasePublicH = "" +
|
|
|
|
|
"nt.com/nothings/stb/master/docs/stb_howto.txt\n#ifdef WUFFS_CONFIG__STATIC_FUNCTIONS\n#define WUFFS_BASE__MAYBE_STATIC static\n#else\n#define WUFFS_BASE__MAYBE_STATIC\n#endif\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n#else\n#define WUFFS_BASE__WARN_UNUSED_RESULT\n#endif\n\n// wuffs_base__empty_struct is used when a Wuffs function returns an empty\n// struct. In C, if a function f returns void, you can't say \"x = f()\", but in\n// Wuffs, if a function g returns empty, you can say \"y = g()\".\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n " +
|
|
|
|
|
"//\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__empty_struct;\n\n// wuffs_base__utility is a placeholder receiver type. It enables what Java\n// calls static methods, as opposed to regular methods.\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__utility;\n\n" +
|
|
|
|
|
"" +
|
|
|
|
|
"// --------\n\n// A status code is either zero (OK), positive (a recoverable suspension or\n// pause in processing) or negative (a non-recoverable error). Its bits:\n// - bit 31 (the sign bit) indicates unrecoverable-ness: an error.\n// - bits 30 .. 24 are a package-namespaced numeric code\n// - bits 23 .. 21 are reserved.\n// - bits 20 .. 0 are the packageid (a namespace) as a base38 value.\n//\n// Do not manipulate these bits directly; they are private implementation\n// details. Use methods such as wuffs_base__status__is_error instead.\ntypedef int32_t wuffs_base__status;\n\n// !! INSERT wuffs_base__status names.\n\nstatic inline bool //\nwuffs_base__status__is_error(wuffs_base__status s) {\n return s < 0;\n}\n\nstatic inline bool //\nwuffs_base__status__is_ok(wuffs_base__status s) {\n return s == 0;\n}\n\nstatic inline bool //\nwuffs_base__status__is_suspension(wuffs_base__status s) {\n return s > 0;\n}\n\nconst char* //\nwuffs_base__status__string(wuffs_base__status s);\n\n" +
|
|
|
|
|
"// --------\n\n// A status code is either zero (OK), positive (a recoverable suspension or\n// pause in processing) or negative (a non-recoverable error). Its bits:\n// - bit 31 (the sign bit) indicates unrecoverable-ness: an error.\n// - bits 30 .. 24 are a package-namespaced numeric code\n// - bits 23 .. 21 are reserved.\n// - bits 20 .. 0 are the packageid (a namespace) as a base38 value.\n//\n// Do not manipulate these bits directly; they are private implementation\n// details. Use methods such as wuffs_base__status__is_error instead.\ntypedef struct {\n int32_t code;\n} wuffs_base__status;\n\n// !! INSERT wuffs_base__status names.\n\n// TODO: turn WUFFS_BASE__MAKE_STATUS into a macro, and add a msg field.\n\nstatic inline wuffs_base__status //\nWUFFS_BASE__MAKE_STATUS(int32_t code) {\n return ((wuffs_base__status){\n .code = code,\n });\n}\n\nstatic inline bool //\nwuffs_base__status__is_error(wuffs_base__status s) {\n return s.code < 0;\n}\n\nstatic inline bool //\nwuffs_base__status__is_ok(wuffs_base__status s" +
|
|
|
|
|
") {\n return s.code == 0;\n}\n\nstatic inline bool //\nwuffs_base__status__is_suspension(wuffs_base__status s) {\n return s.code > 0;\n}\n\nconst char* //\nwuffs_base__status__string(int32_t status_code);\n\n" +
|
|
|
|
|
"" +
|
|
|
|
|
"// --------\n\n// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a\n// second. See https://github.com/OculusVR/Flicks\ntypedef int64_t wuffs_base__flicks;\n\n#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)\n#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)\n\n" +
|
|
|
|
|
"" +
|
|
|
|
@@ -73,7 +74,7 @@ const baseBasePublicH = "" +
|
|
|
|
|
const baseBasePrivateH = "" +
|
|
|
|
|
"#ifndef WUFFS_INCLUDE_GUARD__BASE_PRIVATE\n#define WUFFS_INCLUDE_GUARD__BASE_PRIVATE\n\n// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)\n\nstatic inline void wuffs_base__ignore_check_wuffs_version_status(\n wuffs_base__status z) {}\n\n// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.\n// It's not foolproof, given C doesn't automatically zero me" +
|
|
|
|
|
"mory before use,\n// but it should catch 99.99% of cases.\n//\n// Its (non-zero) value is arbitrary, based on md5sum(\"wuffs\").\n#define WUFFS_BASE__MAGIC ((uint32_t)0x3CCB6C71)\n\n// Denote intentional fallthroughs for -Wimplicit-fallthrough.\n//\n// The order matters here. Clang also defines \"__GNUC__\".\n#if defined(__clang__) && __cplusplus >= 201103L\n#define WUFFS_BASE__FALLTHROUGH [[clang::fallthrough]]\n#elif !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 7)\n#define WUFFS_BASE__FALLTHROUGH __attribute__((fallthrough))\n#else\n#define WUFFS_BASE__FALLTHROUGH\n#endif\n\n// Use switch cases for coroutine suspension points, similar to the technique\n// in https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html\n//\n// We use trivial macros instead of an explicit assignment and case statement\n// so that clang-format doesn't get confused by the unusual \"case\"s.\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0 case 0:;\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT(n) \\\n coro_susp_point = n; " +
|
|
|
|
|
" \\\n WUFFS_BASE__FALLTHROUGH; \\\n case n:;\n\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(n) \\\n if (status < 0) { \\\n goto exit; \\\n } else if (status == 0) { \\\n goto ok; \\\n } \\\n coro_susp_point = n; \\\n goto suspend; \\\n case n:;\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__LIKELY(expr) (__builtin_expect(!!(expr), 1))\n#define WUFFS_BASE__UNLIKELY(expr) (__builtin_expect(!!(expr), 0))\n#else\n#define WUFFS_BASE__LIKELY(expr) (expr)\n#define WUFFS_BASE__UNLIKELY(expr) (expr)\n#endif\n\n// The helpers below are functions, instead of macros, because their arguments\n// can be an expression that we shouldn't evaluat" +
|
|
|
|
|
" \\\n WUFFS_BASE__FALLTHROUGH; \\\n case n:;\n\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(n) \\\n if (status.code < 0) { \\\n goto exit; \\\n } else if (status.code == 0) { \\\n goto ok; \\\n } \\\n coro_susp_point = n; \\\n goto suspend; \\\n case n:;\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__LIKELY(expr) (__builtin_expect(!!(expr), 1))\n#define WUFFS_BASE__UNLIKELY(expr) (__builtin_expect(!!(expr), 0))\n#else\n#define WUFFS_BASE__LIKELY(expr) (expr)\n#define WUFFS_BASE__UNLIKELY(expr) (expr)\n#endif\n\n// The helpers below are functions, instead of macros, because their arguments\n// can be an expression that we shouldn't evaluat" +
|
|
|
|
|
"e more than once.\n//\n// They are static, so that linking multiple wuffs .o files won't complain about\n// duplicate function definitions.\n//\n// They are explicitly marked inline, even if modern compilers don't use the\n// inline attribute to guide optimizations such as inlining, to avoid the\n// -Wunused-function warning, and we like to compile with -Wall -Werror.\n\nstatic inline wuffs_base__empty_struct //\nwuffs_base__return_empty_struct() {\n return ((wuffs_base__empty_struct){});\n}\n\n" +
|
|
|
|
|
"" +
|
|
|
|
|
"// ---------------- Numeric Types\n\nstatic inline uint8_t //\nwuffs_base__load_u8be(uint8_t* p) {\n return p[0];\n}\n\nstatic inline uint16_t //\nwuffs_base__load_u16be(uint8_t* p) {\n return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);\n}\n\nstatic inline uint16_t //\nwuffs_base__load_u16le(uint8_t* p) {\n return ((uint16_t)(p[0]) << 0) | ((uint16_t)(p[1]) << 8);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u24be(uint8_t* p) {\n return ((uint32_t)(p[0]) << 16) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 0);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u24le(uint8_t* p) {\n return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 16);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u32be(uint8_t* p) {\n return ((uint32_t)(p[0]) << 24) | ((uint32_t)(p[1]) << 16) |\n ((uint32_t)(p[2]) << 8) | ((uint32_t)(p[3]) << 0);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u32le(uint8_t* p) {\n return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |\n ((uin" +
|
|
|
|
@@ -108,8 +109,8 @@ const baseBasePrivateH = "" +
|
|
|
|
|
""
|
|
|
|
|
|
|
|
|
|
const baseBaseImplC = "" +
|
|
|
|
|
"// Copyright 2018 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// !! INSERT base-public.h.\n\n#ifdef WUFFS_IMPLEMENTATION\n\n// !! INSERT base-private.h.\n\n#if !defined(WUFFS_CONFIG__MODULES) || defined(WUFFS_CONFIG__MODULE__BASE)\n\n// !! INSERT wuffs_base__status__string data.\n\nconst char* //\nwuffs_base__status__string(wuffs_base__status s) {\n uint16_t o = wuffs_base__status__string_offsets[(uint8_t)(s >> 24)];\n return o ? wuffs_base__status__string_data + o : \"unknown status\";\n}\n\n#endif " +
|
|
|
|
|
" // !defined(WUFFS_CONFIG__MODULES) ||\n // defined(WUFFS_CONFIG__MODULE__BASE)\n\n#endif // WUFFS_IMPLEMENTATION\n" +
|
|
|
|
|
"// Copyright 2018 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// !! INSERT base-public.h.\n\n#ifdef WUFFS_IMPLEMENTATION\n\n// !! INSERT base-private.h.\n\n#if !defined(WUFFS_CONFIG__MODULES) || defined(WUFFS_CONFIG__MODULE__BASE)\n\n// !! INSERT wuffs_base__status__string data.\n\nconst char* //\nwuffs_base__status__string(int32_t status_code) {\n uint16_t o = wuffs_base__status__string_offsets[(uint8_t)(status_code >> 24)];\n return o ? wuffs_base__status__string_data + o : \"unknown status\";\n}" +
|
|
|
|
|
"\n\n#endif // !defined(WUFFS_CONFIG__MODULES) ||\n // defined(WUFFS_CONFIG__MODULE__BASE)\n\n#endif // WUFFS_IMPLEMENTATION\n" +
|
|
|
|
|
""
|
|
|
|
|
|
|
|
|
|
const baseImagePublicH = "" +
|
|
|
|
@@ -154,8 +155,8 @@ const baseImagePublicH = "" +
|
|
|
|
|
"wuffs_base__frame_config__height(this);\n}\n\ninline wuffs_base__flicks //\nwuffs_base__frame_config::duration() {\n return wuffs_base__frame_config__duration(this);\n}\n\ninline bool //\nwuffs_base__frame_config::blend() {\n return wuffs_base__frame_config__blend(this);\n}\n\ninline wuffs_base__animation_disposal //\nwuffs_base__frame_config::disposal() {\n return wuffs_base__frame_config__disposal(this);\n}\n\ninline bool //\nwuffs_base__frame_config::palette_changed() {\n return wuffs_base__frame_config__palette_changed(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 wuffs_base__pixel_config pixcfg;\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__pixel_config* pixel_config();\n inline wuffs_base__rect_ie_u32 bounds();\n inline uint32_t width();\n inline uint32_t height();\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->private_impl.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 WUFFS_BASE__STATUS_OK;\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\n// wuffs_base__pixel_config returns the overall configuration for this frame.\nstatic inline wuffs_base__pixel_config* //\nwuffs_base__pixel_buffer__pixel_config(wuffs_base__pixel_buffer* b) {\n return b ? &b->private_impl.pixcfg : NULL;\n}\n\nstatic inline wuffs_base__rect_ie_u32 //\nwuffs_base__pixel_buffer__bounds(wuffs_base__pixel_buffer* b) {\n return b ? wuffs_base__pixel_config__bounds(&b->private_impl.pixcfg)\n : ((wuffs_base__rect_ie_u32){});\n}\n\nstatic inline uint32_t //\nwuffs_base__pixel_buffer__width(wuffs_base__pixel_buffer* b) {\n return b ? wuffs_base__pixel_config__width(&b->private_impl.pixcfg) : 0;\n}\n\nstatic inline uint32_t //\nwuffs_base__pixel_buffer__height(wuffs_base__pixel_buffer* b) {\n return b ? wuffs_base__pixel_config__height(&b->private_impl.pixcfg) : 0;\n}\n\nstatic inline 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_pa" +
|
|
|
|
|
"lette(this, palette);\n}\n\ninline wuffs_base__pixel_config* //\nwuffs_base__pixel_buffer::pixel_config() {\n return wuffs_base__pixel_buffer__pixel_config(this);\n}\n\ninline wuffs_base__rect_ie_u32 //\nwuffs_base__pixel_buffer::bounds() {\n return wuffs_base__pixel_buffer__bounds(this);\n}\n\ninline uint32_t //\nwuffs_base__pixel_buffer::width() {\n return wuffs_base__pixel_buffer__width(this);\n}\n\ninline uint32_t //\nwuffs_base__pixel_buffer::height() {\n return wuffs_base__pixel_buffer__height(this);\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" +
|
|
|
|
|
" wuffs_base__pixel_config* pixcfg,\n wuffs_base__slice_u8 pixbuf_memory) {\n if (!b) {\n return WUFFS_BASE__MAKE_STATUS(WUFFS_BASE__ERROR_BAD_RECEIVER);\n }\n *b = ((wuffs_base__pixel_buffer){});\n if (!pixcfg) {\n return WUFFS_BASE__MAKE_STATUS(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__MAKE_STATUS(\n WUFFS_BASE__ERROR_BAD_ARGUMENT_LENGTH_TOO_SHORT);\n }\n b->private_impl.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 WUFFS_BASE__MAKE_STATUS(WUFFS_BASE__STATUS_OK);\n}\n\n// The palette argument is ignored unless its length is exactly 1024.\ns" +
|
|
|
|
|
"tatic 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\n// wuffs_base__pixel_config returns the overall configuration for this frame.\nstatic inline wuffs_base__pixel_config* //\nwuffs_base__pixel_buffer__pixel_config(wuffs_base__pixel_buffer* b) {\n return b ? &b->private_impl.pixcfg : NULL;\n}\n\nstatic inline wuffs_base__rect_ie_u32 //\nwuffs_base__pixel_buffer__bounds(wuffs_base__pixel_buffer* b) {\n return b ? wuffs_base__pixel_config__bounds(&b->private_impl.pixcfg)\n : ((wuffs_base__rect_ie_u32){});\n}\n\nstatic inline uint32_t //\nwuffs_base__pixel_buffer__width(wuffs_base__pixel_buffer* b) {\n return b ? wuffs_base__pixel_config__width(&b->private_impl.pixcfg) : 0;\n}\n\nstatic inline uint32_t //\nwuffs_base__pixel_buffer__height(wuffs_base__pixel_buffer* b) {\n return b ? wuffs_base__pi" +
|
|
|
|
|
"xel_config__height(&b->private_impl.pixcfg) : 0;\n}\n\nstatic inline 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__pixel_config* //\nwuffs_base__pixel_buffer::pixel_config() {\n return wuffs_base__pixel_buffer__pixel_config(this);\n}\n\ninline wuffs_base__rect_ie_u32 //\nwuffs_base__pixel_buffer::bounds() {\n return wuffs_base__pixel_buffer__bounds(this);\n}\n\ninline uint32_t //\nwuffs_base__pixel_buffer::width() {\n return wuffs_base__pixel_buffer__width(this);\n}\n\ninline uint32_t //\nwuffs_base__pixel_buffer::height() {\n return wuffs_base__pixel_buffer__height(this);\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" +
|
|
|
|
|
""
|