Created
July 18, 2019 17:00
Star
You must be signed in to star a gist
-save-temps result for pkg/54383 (firefox 68.0 build fails on NetBSD/i386 8.1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
# 1 "<built-in>" | |
# 1 "<command-line>" | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/config/gcc_hidden.h" 1 | |
#pragma GCC visibility push(hidden) | |
# 1 "<command-line>" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/mozilla-config.h" 1 | |
# 1 "<command-line>" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 1 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdbool.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdbool.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stdbool.h" 1 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdbool.h" 2 3 | |
#pragma GCC visibility pop | |
# 17 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stddef.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stddef.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stddef.h" 1 3 4 | |
# 52 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stddef.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/i386/ansi.h" 1 3 4 | |
# 37 "/usr/include/i386/ansi.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/sys/cdefs.h" 1 3 4 | |
# 62 "/usr/include/sys/cdefs.h" 3 4 | |
# 1 "/usr/include/i386/cdefs.h" 1 3 4 | |
# 63 "/usr/include/sys/cdefs.h" 2 3 4 | |
# 1 "/usr/include/sys/cdefs_elf.h" 1 3 4 | |
# 65 "/usr/include/sys/cdefs.h" 2 3 4 | |
# 616 "/usr/include/sys/cdefs.h" 3 4 | |
# 616 "/usr/include/sys/cdefs.h" 3 4 | |
static inline long long __zeroll(void) { return 0; } | |
static inline unsigned long long __zeroull(void) { return 0; } | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 2 3 | |
#pragma GCC visibility pop | |
# 38 "/usr/include/i386/ansi.h" 2 3 4 | |
# 1 "/usr/include/i386/int_types.h" 1 3 4 | |
# 38 "/usr/include/i386/int_types.h" 3 4 | |
# 1 "/usr/include/sys/common_int_types.h" 1 3 4 | |
# 45 "/usr/include/sys/common_int_types.h" 3 4 | |
typedef signed char __int8_t; | |
typedef unsigned char __uint8_t; | |
typedef short int __int16_t; | |
typedef short unsigned int __uint16_t; | |
typedef int __int32_t; | |
typedef unsigned int __uint32_t; | |
typedef long long int __int64_t; | |
typedef long long unsigned int __uint64_t; | |
typedef int __intptr_t; | |
typedef unsigned int __uintptr_t; | |
# 39 "/usr/include/i386/int_types.h" 2 3 4 | |
# 40 "/usr/include/i386/ansi.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 2 3 | |
#pragma GCC visibility pop | |
# 53 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stddef.h" 2 3 4 | |
# 149 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stddef.h" 3 4 | |
typedef int ptrdiff_t; | |
# 216 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stddef.h" 3 4 | |
typedef unsigned int size_t; | |
# 426 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stddef.h" 3 4 | |
typedef struct { | |
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); | |
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); | |
} max_align_t; | |
typedef decltype(nullptr) nullptr_t; | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stddef.h" 2 3 | |
#pragma GCC visibility pop | |
# 18 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdint.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdint.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stdint.h" 1 3 4 | |
# 9 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stdint.h" 3 4 | |
# 1 "/usr/include/stdint.h" 1 3 4 | |
# 35 "/usr/include/stdint.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 36 "/usr/include/stdint.h" 2 3 4 | |
typedef __int8_t int8_t; | |
typedef __uint8_t uint8_t; | |
typedef __int16_t int16_t; | |
typedef __uint16_t uint16_t; | |
typedef __int32_t int32_t; | |
typedef __uint32_t uint32_t; | |
typedef __int64_t int64_t; | |
typedef __uint64_t uint64_t; | |
typedef __intptr_t intptr_t; | |
typedef __uintptr_t uintptr_t; | |
# 1 "/usr/include/i386/int_mwgwtypes.h" 1 3 4 | |
# 36 "/usr/include/i386/int_mwgwtypes.h" 3 4 | |
# 1 "/usr/include/sys/common_int_mwgwtypes.h" 1 3 4 | |
# 45 "/usr/include/sys/common_int_mwgwtypes.h" 3 4 | |
typedef signed char int_least8_t; | |
typedef unsigned char uint_least8_t; | |
typedef short int int_least16_t; | |
typedef short unsigned int uint_least16_t; | |
typedef int int_least32_t; | |
typedef unsigned int uint_least32_t; | |
typedef long long int int_least64_t; | |
typedef long long unsigned int uint_least64_t; | |
typedef int int_fast8_t; | |
typedef unsigned int uint_fast8_t; | |
typedef int int_fast16_t; | |
typedef unsigned int uint_fast16_t; | |
typedef int int_fast32_t; | |
typedef unsigned int uint_fast32_t; | |
typedef long long int int_fast64_t; | |
typedef long long unsigned int uint_fast64_t; | |
typedef long long int intmax_t; | |
typedef long long unsigned int uintmax_t; | |
# 37 "/usr/include/i386/int_mwgwtypes.h" 2 3 4 | |
# 89 "/usr/include/stdint.h" 2 3 4 | |
# 1 "/usr/include/i386/int_limits.h" 1 3 4 | |
# 36 "/usr/include/i386/int_limits.h" 3 4 | |
# 1 "/usr/include/sys/common_int_limits.h" 1 3 4 | |
# 37 "/usr/include/i386/int_limits.h" 2 3 4 | |
# 93 "/usr/include/stdint.h" 2 3 4 | |
# 1 "/usr/include/i386/int_const.h" 1 3 4 | |
# 98 "/usr/include/stdint.h" 2 3 4 | |
# 1 "/usr/include/i386/wchar_limits.h" 1 3 4 | |
# 101 "/usr/include/stdint.h" 2 3 4 | |
# 10 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/stdint.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdint.h" 2 3 | |
#pragma GCC visibility pop | |
# 19 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/string.h" 1 3 4 | |
# 36 "/usr/include/string.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 37 "/usr/include/string.h" 2 3 4 | |
# 1 "/usr/include/sys/null.h" 1 3 4 | |
# 44 "/usr/include/string.h" 2 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 46 "/usr/include/string.h" 2 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 47 "/usr/include/string.h" 2 3 4 | |
# 48 "/usr/include/string.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 48 "/usr/include/string.h" 3 4 | |
extern "C" { | |
void *memchr(const void *, int, size_t); | |
int memcmp(const void *, const void *, size_t); | |
void *memcpy(void * __restrict__, const void * __restrict__, size_t); | |
void *memmove(void *, const void *, size_t); | |
void *memset(void *, int, size_t); | |
char *strcat(char * __restrict__, const char * __restrict__); | |
char *strchr(const char *, int); | |
int strcmp(const char *, const char *); | |
int strcoll(const char *, const char *); | |
char *strcpy(char * __restrict__, const char * __restrict__); | |
size_t strcspn(const char *, const char *); | |
char *strerror(int); | |
size_t strlen(const char *); | |
char *strncat(char * __restrict__, const char * __restrict__, size_t); | |
int strncmp(const char *, const char *, size_t); | |
char *strncpy(char * __restrict__, const char * __restrict__, size_t); | |
char *strpbrk(const char *, const char *); | |
char *strrchr(const char *, int); | |
size_t strspn(const char *, const char *); | |
char *strstr(const char *, const char *); | |
char *strtok(char * __restrict__, const char * __restrict__); | |
char *strtok_r(char *, const char *, char **); | |
int strerror_r(int, char *, size_t); | |
size_t strxfrm(char * __restrict__, const char * __restrict__, size_t); | |
void *memccpy(void *, const void *, int, size_t); | |
char *strdup(const char *); | |
char *stpcpy(char * __restrict__, const char * __restrict__); | |
char *stpncpy(char * __restrict__, const char * __restrict__, size_t); | |
char *strndup(const char *, size_t); | |
size_t strnlen(const char *, size_t); | |
char *strsignal(int); | |
} | |
# 95 "/usr/include/string.h" 3 4 | |
#pragma GCC visibility pop | |
# 95 "/usr/include/string.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/strings.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/strings.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/strings.h" 1 3 4 | |
# 35 "/usr/include/strings.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 36 "/usr/include/strings.h" 2 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 37 "/usr/include/strings.h" 2 3 4 | |
# 47 "/usr/include/strings.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 48 "/usr/include/strings.h" 2 3 4 | |
# 51 "/usr/include/strings.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 51 "/usr/include/strings.h" 3 4 | |
extern "C" { | |
int bcmp(const void *, const void *, size_t); | |
void bcopy(const void *, void *, size_t); | |
void bzero(void *, size_t); | |
int ffs(int); | |
char *index(const char *, int); | |
unsigned int popcount(unsigned int) __attribute__((__const__)); | |
unsigned int popcountl(unsigned long) __attribute__((__const__)); | |
unsigned int popcountll(unsigned long long) __attribute__((__const__)); | |
unsigned int popcount32(__uint32_t) __attribute__((__const__)); | |
unsigned int popcount64(__uint64_t) __attribute__((__const__)); | |
char *rindex(const char *, int); | |
int strcasecmp(const char *, const char *); | |
int strncasecmp(const char *, const char *, size_t); | |
} | |
# 65 "/usr/include/strings.h" 3 4 | |
#pragma GCC visibility pop | |
# 65 "/usr/include/strings.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/string.h" 1 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 2 3 | |
#pragma GCC visibility pop | |
# 69 "/usr/include/strings.h" 2 3 4 | |
# 1 "/usr/include/ssp/strings.h" 1 3 4 | |
# 34 "/usr/include/ssp/strings.h" 3 4 | |
# 1 "/usr/include/ssp/ssp.h" 1 3 4 | |
# 34 "/usr/include/ssp/ssp.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 35 "/usr/include/ssp/ssp.h" 2 3 4 | |
# 84 "/usr/include/ssp/ssp.h" 3 4 | |
# 84 "/usr/include/ssp/ssp.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 84 "/usr/include/ssp/ssp.h" 3 4 | |
extern "C" { | |
void __stack_chk_fail(void) __attribute__((__noreturn__)); | |
void __chk_fail(void) __attribute__((__noreturn__)); | |
} | |
# 87 "/usr/include/ssp/ssp.h" 3 4 | |
#pragma GCC visibility pop | |
# 87 "/usr/include/ssp/ssp.h" 3 4 | |
# 35 "/usr/include/ssp/strings.h" 2 3 4 | |
# 73 "/usr/include/strings.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/strings.h" 2 3 | |
#pragma GCC visibility pop | |
# 99 "/usr/include/string.h" 2 3 4 | |
# 99 "/usr/include/string.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 99 "/usr/include/string.h" 3 4 | |
extern "C" { | |
void *memmem(const void *, size_t, const void *, size_t); | |
char *strcasestr(const char *, const char *); | |
char *strchrnul(const char *, int); | |
size_t strlcat(char *, const char *, size_t); | |
size_t strlcpy(char *, const char *, size_t); | |
char *strsep(char **, const char *); | |
char *stresep(char **, const char *, int); | |
char *strnstr(const char *, const char *, size_t); | |
void *memrchr(const void *, int, size_t); | |
void *explicit_memset(void *, int, size_t); | |
int consttime_memequal(const void *, const void *, size_t); | |
} | |
# 111 "/usr/include/string.h" 3 4 | |
#pragma GCC visibility pop | |
# 111 "/usr/include/string.h" 3 4 | |
typedef struct _locale *locale_t; | |
# 119 "/usr/include/string.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 119 "/usr/include/string.h" 3 4 | |
extern "C" { | |
int strcoll_l(const char *, const char *, locale_t); | |
size_t strxfrm_l(char * __restrict__, const char * __restrict__, size_t, locale_t); | |
char *strerror_l(int, locale_t); | |
} | |
# 123 "/usr/include/string.h" 3 4 | |
#pragma GCC visibility pop | |
# 123 "/usr/include/string.h" 3 4 | |
# 1 "/usr/include/ssp/string.h" 1 3 4 | |
# 34 "/usr/include/ssp/string.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 35 "/usr/include/ssp/string.h" 2 3 4 | |
# 37 "/usr/include/ssp/string.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 37 "/usr/include/ssp/string.h" 3 4 | |
extern "C" { | |
void *__memcpy_chk(void *, const void *, size_t, size_t); | |
void *__memmove_chk(void *, void *, size_t, size_t); | |
void *__memset_chk(void *, int, size_t, size_t); | |
char *__stpcpy_chk(char *, const char *, size_t); | |
char *__strcat_chk(char *, const char *, size_t); | |
char *__strcpy_chk(char *, const char *, size_t); | |
char *__strncat_chk(char *, const char *, size_t, size_t); | |
char *__strncpy_chk(char *, const char *, size_t, size_t); | |
} | |
# 46 "/usr/include/ssp/string.h" 3 4 | |
#pragma GCC visibility pop | |
# 46 "/usr/include/ssp/string.h" 3 4 | |
# 128 "/usr/include/string.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 2 3 | |
#pragma GCC visibility pop | |
# 20 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 2 | |
# 22 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
extern "C" { | |
typedef struct skcms_Matrix3x3 { | |
float vals[3][3]; | |
} skcms_Matrix3x3; | |
bool skcms_Matrix3x3_invert(const skcms_Matrix3x3*, skcms_Matrix3x3*); | |
skcms_Matrix3x3 skcms_Matrix3x3_concat(const skcms_Matrix3x3*, const skcms_Matrix3x3*); | |
typedef struct skcms_Matrix3x4 { | |
float vals[3][4]; | |
} skcms_Matrix3x4; | |
# 46 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
typedef struct skcms_TransferFunction { | |
float g, a,b,c,d,e,f; | |
} skcms_TransferFunction; | |
float skcms_TransferFunction_eval (const skcms_TransferFunction*, float); | |
bool skcms_TransferFunction_invert(const skcms_TransferFunction*, | |
skcms_TransferFunction*); | |
typedef union skcms_Curve { | |
struct { | |
# 57 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 57 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
alias_of_table_entries; | |
skcms_TransferFunction parametric; | |
}; | |
struct { | |
# 61 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 61 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
table_entries; | |
const | |
# 62 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint8_t | |
# 62 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
* table_8; | |
const | |
# 63 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint8_t | |
# 63 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
* table_16; | |
}; | |
} skcms_Curve; | |
typedef struct skcms_A2B { | |
# 71 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 71 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
input_channels; | |
skcms_Curve input_curves[4]; | |
# 73 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint8_t | |
# 73 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
grid_points[4]; | |
const | |
# 74 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint8_t | |
# 74 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
* grid_8; | |
const | |
# 75 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint8_t | |
# 75 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
* grid_16; | |
# 80 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 80 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
matrix_channels; | |
skcms_Curve matrix_curves[3]; | |
skcms_Matrix3x4 matrix; | |
# 85 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 85 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
output_channels; | |
skcms_Curve output_curves[3]; | |
} skcms_A2B; | |
typedef struct skcms_ICCProfile { | |
const | |
# 90 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint8_t | |
# 90 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
* buffer; | |
# 92 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 92 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
size; | |
# 93 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 93 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
data_color_space; | |
# 94 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 94 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
pcs; | |
# 95 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 95 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
tag_count; | |
bool has_trc; | |
skcms_Curve trc[3]; | |
bool has_toXYZD50; | |
skcms_Matrix3x3 toXYZD50; | |
bool has_A2B; | |
skcms_A2B A2B; | |
} skcms_ICCProfile; | |
const skcms_ICCProfile* skcms_sRGB_profile(void); | |
const skcms_ICCProfile* skcms_XYZD50_profile(void); | |
const skcms_TransferFunction* skcms_sRGB_TransferFunction(void); | |
const skcms_TransferFunction* skcms_sRGB_Inverse_TransferFunction(void); | |
const skcms_TransferFunction* skcms_Identity_TransferFunction(void); | |
bool skcms_ApproximatelyEqualProfiles(const skcms_ICCProfile* A, | |
const skcms_ICCProfile* B); | |
bool skcms_AreApproximateInverses(const skcms_Curve* curve, | |
const skcms_TransferFunction* inv_tf); | |
bool skcms_TRCs_AreApproximateInverse(const skcms_ICCProfile* profile, | |
const skcms_TransferFunction* inv_tf); | |
bool skcms_Parse(const void*, size_t, skcms_ICCProfile*); | |
bool skcms_ApproximateCurve(const skcms_Curve* curve, | |
skcms_TransferFunction* approx, | |
float* max_error); | |
typedef struct skcms_ICCTag { | |
# 152 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 152 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
signature; | |
# 153 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 153 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
type; | |
# 154 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 154 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
size; | |
const | |
# 155 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint8_t | |
# 155 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
* buf; | |
} skcms_ICCTag; | |
void skcms_GetTagByIndex (const skcms_ICCProfile*, | |
# 158 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 158 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
idx, skcms_ICCTag*); | |
bool skcms_GetTagBySignature(const skcms_ICCProfile*, | |
# 159 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" 3 4 | |
__uint32_t | |
# 159 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
sig, skcms_ICCTag*); | |
enum { | |
skcms_Signature_CMYK = 0x434D594B, | |
skcms_Signature_Gray = 0x47524159, | |
skcms_Signature_RGB = 0x52474220, | |
skcms_Signature_Lab = 0x4C616220, | |
skcms_Signature_XYZ = 0x58595A20, | |
}; | |
typedef enum skcms_PixelFormat { | |
skcms_PixelFormat_A_8, | |
skcms_PixelFormat_A_8_, | |
skcms_PixelFormat_G_8, | |
skcms_PixelFormat_G_8_, | |
skcms_PixelFormat_RGBA_8888_Palette8, | |
skcms_PixelFormat_BGRA_8888_Palette8, | |
skcms_PixelFormat_RGB_565, | |
skcms_PixelFormat_BGR_565, | |
skcms_PixelFormat_ABGR_4444, | |
skcms_PixelFormat_ARGB_4444, | |
skcms_PixelFormat_RGB_888, | |
skcms_PixelFormat_BGR_888, | |
skcms_PixelFormat_RGBA_8888, | |
skcms_PixelFormat_BGRA_8888, | |
skcms_PixelFormat_RGBA_1010102, | |
skcms_PixelFormat_BGRA_1010102, | |
skcms_PixelFormat_RGB_161616LE, | |
skcms_PixelFormat_BGR_161616LE, | |
skcms_PixelFormat_RGBA_16161616LE, | |
skcms_PixelFormat_BGRA_16161616LE, | |
skcms_PixelFormat_RGB_161616BE, | |
skcms_PixelFormat_BGR_161616BE, | |
skcms_PixelFormat_RGBA_16161616BE, | |
skcms_PixelFormat_BGRA_16161616BE, | |
skcms_PixelFormat_RGB_161616 = skcms_PixelFormat_RGB_161616BE, | |
skcms_PixelFormat_BGR_161616 = skcms_PixelFormat_BGR_161616BE, | |
skcms_PixelFormat_RGBA_16161616 = skcms_PixelFormat_RGBA_16161616BE, | |
skcms_PixelFormat_BGRA_16161616 = skcms_PixelFormat_BGRA_16161616BE, | |
skcms_PixelFormat_RGB_hhh, | |
skcms_PixelFormat_BGR_hhh, | |
skcms_PixelFormat_RGBA_hhhh, | |
skcms_PixelFormat_BGRA_hhhh, | |
skcms_PixelFormat_RGB_fff, | |
skcms_PixelFormat_BGR_fff, | |
skcms_PixelFormat_RGBA_ffff, | |
skcms_PixelFormat_BGRA_ffff, | |
} skcms_PixelFormat; | |
# 232 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.h" | |
typedef enum skcms_AlphaFormat { | |
skcms_AlphaFormat_Opaque, | |
skcms_AlphaFormat_Unpremul, | |
skcms_AlphaFormat_PremulAsEncoded, | |
} skcms_AlphaFormat; | |
bool skcms_Transform(const void* src, | |
skcms_PixelFormat srcFmt, | |
skcms_AlphaFormat srcAlpha, | |
const skcms_ICCProfile* srcProfile, | |
void* dst, | |
skcms_PixelFormat dstFmt, | |
skcms_AlphaFormat dstAlpha, | |
const skcms_ICCProfile* dstProfile, | |
size_t npixels); | |
bool skcms_TransformWithPalette(const void* src, | |
skcms_PixelFormat srcFmt, | |
skcms_AlphaFormat srcAlpha, | |
const skcms_ICCProfile* srcProfile, | |
void* dst, | |
skcms_PixelFormat dstFmt, | |
skcms_AlphaFormat dstAlpha, | |
const skcms_ICCProfile* dstProfile, | |
size_t npixels, | |
const void* palette); | |
bool skcms_MakeUsableAsDestination(skcms_ICCProfile* profile); | |
bool skcms_MakeUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile); | |
bool skcms_PrimariesToXYZD50(float rx, float ry, | |
float gx, float gy, | |
float bx, float by, | |
float wx, float wy, | |
skcms_Matrix3x3* toXYZD50); | |
static inline void skcms_Init(skcms_ICCProfile* p) { | |
memset(p, 0, sizeof(*p)); | |
p->data_color_space = skcms_Signature_RGB; | |
p->pcs = skcms_Signature_XYZ; | |
} | |
static inline void skcms_SetTransferFunction(skcms_ICCProfile* p, | |
const skcms_TransferFunction* tf) { | |
p->has_trc = true; | |
for (int i = 0; i < 3; ++i) { | |
p->trc[i].table_entries = 0; | |
p->trc[i].parametric = *tf; | |
} | |
} | |
static inline void skcms_SetXYZD50(skcms_ICCProfile* p, const skcms_Matrix3x3* m) { | |
p->has_toXYZD50 = true; | |
p->toXYZD50 = *m; | |
} | |
} | |
# 9 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms_internal.h" 1 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdbool.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdbool.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 15 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms_internal.h" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdint.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdint.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 16 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms_internal.h" 2 | |
extern "C" { | |
bool skcms_GetCHAD(const skcms_ICCProfile* profile, skcms_Matrix3x3* m); | |
extern const | |
# 30 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms_internal.h" 3 4 | |
__uint8_t | |
# 30 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms_internal.h" | |
skcms_252_random_bytes[252]; | |
static inline float floorf_(float x) { | |
float roundtrip = (float)((int)x); | |
return roundtrip > x ? roundtrip - 1 : roundtrip; | |
} | |
static inline float fabsf_(float x) { return x < 0 ? -x : x; } | |
float powf_(float, float); | |
static inline bool needs_palette(skcms_PixelFormat fmt) { | |
return (fmt >> 1) == (skcms_PixelFormat_RGBA_8888_Palette8 >> 1); | |
} | |
} | |
# 10 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/assert.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/assert.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/assert.h" 1 3 4 | |
# 44 "/usr/include/assert.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 45 "/usr/include/assert.h" 2 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 46 "/usr/include/assert.h" 2 3 4 | |
# 100 "/usr/include/assert.h" 3 4 | |
# 100 "/usr/include/assert.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 100 "/usr/include/assert.h" 3 4 | |
# 100 "/usr/include/assert.h" 3 4 | |
extern "C" { | |
__attribute__((__noreturn__)) void __assert(const char *, int, const char *); | |
__attribute__((__noreturn__)) void __assert13(const char *, int, const char *, const char *); | |
void __diagassert(const char *, int, const char *); | |
void __diagassert13(const char *, int, const char *, const char *); | |
} | |
# 105 "/usr/include/assert.h" 3 4 | |
#pragma GCC visibility pop | |
# 105 "/usr/include/assert.h" 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/assert.h" 2 3 | |
#pragma GCC visibility pop | |
# 11 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/float.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/float.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include/float.h" 1 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/float.h" 2 3 | |
#pragma GCC visibility pop | |
# 12 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/limits.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/limits.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/limits.h" 1 3 4 | |
# 34 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/limits.h" 3 4 | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/syslimits.h" 1 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/limits.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/limits.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/limits.h" 1 3 4 | |
# 168 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/limits.h" 3 4 | |
# 1 "/usr/include/limits.h" 1 3 4 | |
# 37 "/usr/include/limits.h" 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 38 "/usr/include/limits.h" 2 3 4 | |
# 156 "/usr/include/limits.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/limits.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/limits.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/i386/limits.h" 1 3 4 | |
# 37 "/usr/include/i386/limits.h" 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 38 "/usr/include/i386/limits.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/limits.h" 2 3 | |
#pragma GCC visibility pop | |
# 157 "/usr/include/limits.h" 2 3 4 | |
# 166 "/usr/include/limits.h" 3 4 | |
# 1 "/usr/include/sys/syslimits.h" 1 3 4 | |
# 37 "/usr/include/sys/syslimits.h" 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 38 "/usr/include/sys/syslimits.h" 2 3 4 | |
# 167 "/usr/include/limits.h" 2 3 4 | |
# 169 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/limits.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/limits.h" 2 3 | |
#pragma GCC visibility pop | |
# 8 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/syslimits.h" 2 3 4 | |
# 35 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/limits.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/limits.h" 2 3 | |
#pragma GCC visibility pop | |
# 13 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdlib.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdlib.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/include/c++/stdlib.h" 1 3 | |
# 30 "/usr/pkg/gcc6/include/c++/stdlib.h" 3 | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 1 3 4 | |
# 46 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 47 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 2 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 48 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 2 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 1 3 4 | |
# 51 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 52 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
# 1 "/usr/include/i386/types.h" 1 3 4 | |
# 40 "/usr/include/i386/types.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 41 "/usr/include/i386/types.h" 2 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 42 "/usr/include/i386/types.h" 2 3 4 | |
typedef int __register_t; | |
typedef unsigned long __vaddr_t; | |
typedef unsigned char __cpu_simple_lock_nv_t; | |
# 55 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 57 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
# 1 "/usr/include/sys/ansi.h" 1 3 4 | |
# 35 "/usr/include/sys/ansi.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 36 "/usr/include/sys/ansi.h" 2 3 4 | |
typedef char * __caddr_t; | |
typedef __uint32_t __gid_t; | |
typedef __uint32_t __in_addr_t; | |
typedef __uint16_t __in_port_t; | |
typedef __uint32_t __mode_t; | |
typedef __int64_t __off_t; | |
typedef __int32_t __pid_t; | |
typedef __uint8_t __sa_family_t; | |
typedef unsigned int __socklen_t; | |
typedef __uint32_t __uid_t; | |
typedef __uint64_t __fsblkcnt_t; | |
typedef __uint64_t __fsfilcnt_t; | |
struct __tag_wctrans_t; | |
typedef struct __tag_wctrans_t *__wctrans_t; | |
struct __tag_wctype_t; | |
typedef struct __tag_wctype_t *__wctype_t; | |
typedef union { | |
__int64_t __mbstateL; | |
char __mbstate8[128]; | |
} __mbstate_t; | |
# 72 "/usr/include/sys/ansi.h" 3 4 | |
typedef __builtin_va_list __va_list; | |
# 61 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
# 102 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
typedef __uint8_t u_int8_t; | |
typedef __uint16_t u_int16_t; | |
typedef __uint32_t u_int32_t; | |
typedef __uint64_t u_int64_t; | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/endian.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/endian.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/i386/endian.h" 1 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/endian.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/endian.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/include/sys/endian.h" 1 3 4 | |
# 37 "/usr/include/sys/endian.h" 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 38 "/usr/include/sys/endian.h" 2 3 4 | |
# 54 "/usr/include/sys/endian.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 55 "/usr/include/sys/endian.h" 2 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 3 | |
#pragma GCC visibility push(default) | |
# 1 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 1 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 2 3 | |
#pragma GCC visibility pop | |
# 56 "/usr/include/sys/endian.h" 2 3 4 | |
typedef __in_addr_t in_addr_t; | |
typedef __in_port_t in_port_t; | |
# 67 "/usr/include/sys/endian.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 67 "/usr/include/sys/endian.h" 3 4 | |
extern "C" { | |
__uint32_t htonl(__uint32_t) __attribute__((__const__)); | |
__uint16_t htons(__uint16_t) __attribute__((__const__)); | |
__uint32_t ntohl(__uint32_t) __attribute__((__const__)); | |
__uint16_t ntohs(__uint16_t) __attribute__((__const__)); | |
} | |
# 72 "/usr/include/sys/endian.h" 3 4 | |
#pragma GCC visibility pop | |
# 72 "/usr/include/sys/endian.h" 3 4 | |
# 1 "/usr/include/i386/endian_machdep.h" 1 3 4 | |
# 79 "/usr/include/sys/endian.h" 2 3 4 | |
# 107 "/usr/include/sys/endian.h" 3 4 | |
# 1 "/usr/include/i386/bswap.h" 1 3 4 | |
# 1 "/usr/include/i386/byte_swap.h" 1 3 4 | |
# 35 "/usr/include/i386/byte_swap.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 36 "/usr/include/i386/byte_swap.h" 2 3 4 | |
# 38 "/usr/include/i386/byte_swap.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 38 "/usr/include/i386/byte_swap.h" 3 4 | |
extern "C" { | |
static inline __uint32_t __byte_swap_u32_variable(__uint32_t); | |
static inline __uint32_t | |
__byte_swap_u32_variable(__uint32_t x) | |
{ | |
__asm volatile ( | |
"bswap %1" | |
: "=r" (x) : "0" (x)); | |
return (x); | |
} | |
static inline __uint16_t __byte_swap_u16_variable(__uint16_t); | |
static inline __uint16_t | |
__byte_swap_u16_variable(__uint16_t x) | |
{ | |
__asm volatile ("rorw $8, %w1" : "=r" (x) : "0" (x)); | |
return (x); | |
} | |
} | |
# 60 "/usr/include/i386/byte_swap.h" 3 4 | |
#pragma GCC visibility pop | |
# 60 "/usr/include/i386/byte_swap.h" 3 4 | |
# 9 "/usr/include/i386/bswap.h" 2 3 4 | |
# 1 "/usr/include/sys/bswap.h" 1 3 4 | |
# 9 "/usr/include/sys/bswap.h" 3 4 | |
# 1 "/usr/include/sys/stdint.h" 1 3 4 | |
# 10 "/usr/include/sys/bswap.h" 2 3 4 | |
# 1 "/usr/include/i386/bswap.h" 1 3 4 | |
# 12 "/usr/include/sys/bswap.h" 2 3 4 | |
# 13 "/usr/include/sys/bswap.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 13 "/usr/include/sys/bswap.h" 3 4 | |
extern "C" { | |
__uint16_t bswap16(__uint16_t) __asm("__bswap16") __attribute__((__const__)); | |
__uint32_t bswap32(__uint32_t) __asm("__bswap32") __attribute__((__const__)); | |
__uint64_t bswap64(__uint64_t) __attribute__((__const__)); | |
} | |
# 23 "/usr/include/sys/bswap.h" 3 4 | |
#pragma GCC visibility pop | |
# 23 "/usr/include/sys/bswap.h" 3 4 | |
# 12 "/usr/include/i386/bswap.h" 2 3 4 | |
# 108 "/usr/include/sys/endian.h" 2 3 4 | |
# 203 "/usr/include/sys/endian.h" 3 4 | |
static inline void __attribute__((__unused__)) be16enc(void *dst, __uint16_t u) { u = static_cast<__uint16_t>(__builtin_constant_p((static_cast<__uint16_t>((u)))) ? (static_cast<__uint16_t>(((((static_cast<__uint16_t>((u))) & 0xff00) >> 8) | (((static_cast<__uint16_t>((u))) & 0x00ff) << 8)))) : __byte_swap_u16_variable(static_cast<__uint16_t>((u)))); __builtin_memcpy(dst, &u, sizeof(u)); } | |
static inline void __attribute__((__unused__)) be32enc(void *dst, __uint32_t u) { u = static_cast<__uint32_t>(__builtin_constant_p((static_cast<__uint32_t>((u)))) ? (static_cast<__uint32_t>(((((static_cast<__uint32_t>((u))) & 0xff000000) >> 24) | (((static_cast<__uint32_t>((u))) & 0x00ff0000) >> 8) | (((static_cast<__uint32_t>((u))) & 0x0000ff00) << 8) | (((static_cast<__uint32_t>((u))) & 0x000000ff) << 24)))) : __byte_swap_u32_variable(static_cast<__uint32_t>((u)))); __builtin_memcpy(dst, &u, sizeof(u)); } | |
static inline void __attribute__((__unused__)) be64enc(void *dst, __uint64_t u) { u = static_cast<__uint64_t>(__builtin_constant_p((static_cast<__uint64_t>((u)))) ? (static_cast<__uint64_t>(((((static_cast<__uint64_t>((u))) & 0xff00000000000000ull) >> 56) | (((static_cast<__uint64_t>((u))) & 0x00ff000000000000ull) >> 40) | (((static_cast<__uint64_t>((u))) & 0x0000ff0000000000ull) >> 24) | (((static_cast<__uint64_t>((u))) & 0x000000ff00000000ull) >> 8) | (((static_cast<__uint64_t>((u))) & 0x00000000ff000000ull) << 8) | (((static_cast<__uint64_t>((u))) & 0x0000000000ff0000ull) << 24) | (((static_cast<__uint64_t>((u))) & 0x000000000000ff00ull) << 40) | (((static_cast<__uint64_t>((u))) & 0x00000000000000ffull) << 56)))) : bswap64(static_cast<__uint64_t>((u)))); __builtin_memcpy(dst, &u, sizeof(u)); } | |
static inline void __attribute__((__unused__)) le16enc(void *dst, __uint16_t u) { u = (u); __builtin_memcpy(dst, &u, sizeof(u)); } | |
static inline void __attribute__((__unused__)) le32enc(void *dst, __uint32_t u) { u = (u); __builtin_memcpy(dst, &u, sizeof(u)); } | |
static inline void __attribute__((__unused__)) le64enc(void *dst, __uint64_t u) { u = (u); __builtin_memcpy(dst, &u, sizeof(u)); } | |
# 220 "/usr/include/sys/endian.h" 3 4 | |
static inline __uint16_t __attribute__((__unused__)) be16dec(const void *buf) { __uint16_t u; __builtin_memcpy(&u, buf, sizeof(u)); return static_cast<__uint16_t>(__builtin_constant_p((static_cast<__uint16_t>((u)))) ? (static_cast<__uint16_t>(((((static_cast<__uint16_t>((u))) & 0xff00) >> 8) | (((static_cast<__uint16_t>((u))) & 0x00ff) << 8)))) : __byte_swap_u16_variable(static_cast<__uint16_t>((u)))); } | |
static inline __uint32_t __attribute__((__unused__)) be32dec(const void *buf) { __uint32_t u; __builtin_memcpy(&u, buf, sizeof(u)); return static_cast<__uint32_t>(__builtin_constant_p((static_cast<__uint32_t>((u)))) ? (static_cast<__uint32_t>(((((static_cast<__uint32_t>((u))) & 0xff000000) >> 24) | (((static_cast<__uint32_t>((u))) & 0x00ff0000) >> 8) | (((static_cast<__uint32_t>((u))) & 0x0000ff00) << 8) | (((static_cast<__uint32_t>((u))) & 0x000000ff) << 24)))) : __byte_swap_u32_variable(static_cast<__uint32_t>((u)))); } | |
static inline __uint64_t __attribute__((__unused__)) be64dec(const void *buf) { __uint64_t u; __builtin_memcpy(&u, buf, sizeof(u)); return static_cast<__uint64_t>(__builtin_constant_p((static_cast<__uint64_t>((u)))) ? (static_cast<__uint64_t>(((((static_cast<__uint64_t>((u))) & 0xff00000000000000ull) >> 56) | (((static_cast<__uint64_t>((u))) & 0x00ff000000000000ull) >> 40) | (((static_cast<__uint64_t>((u))) & 0x0000ff0000000000ull) >> 24) | (((static_cast<__uint64_t>((u))) & 0x000000ff00000000ull) >> 8) | (((static_cast<__uint64_t>((u))) & 0x00000000ff000000ull) << 8) | (((static_cast<__uint64_t>((u))) & 0x0000000000ff0000ull) << 24) | (((static_cast<__uint64_t>((u))) & 0x000000000000ff00ull) << 40) | (((static_cast<__uint64_t>((u))) & 0x00000000000000ffull) << 56)))) : bswap64(static_cast<__uint64_t>((u)))); } | |
static inline __uint16_t __attribute__((__unused__)) le16dec(const void *buf) { __uint16_t u; __builtin_memcpy(&u, buf, sizeof(u)); return (u); } | |
static inline __uint32_t __attribute__((__unused__)) le32dec(const void *buf) { __uint32_t u; __builtin_memcpy(&u, buf, sizeof(u)); return (u); } | |
static inline __uint64_t __attribute__((__unused__)) le64dec(const void *buf) { __uint64_t u; __builtin_memcpy(&u, buf, sizeof(u)); return (u); } | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/endian.h" 2 3 | |
#pragma GCC visibility pop | |
# 3 "/usr/include/i386/endian.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/endian.h" 2 3 | |
#pragma GCC visibility pop | |
# 108 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
typedef unsigned char u_char; | |
typedef unsigned short u_short; | |
typedef unsigned int u_int; | |
typedef unsigned long u_long; | |
typedef unsigned char unchar; | |
typedef unsigned short ushort; | |
typedef unsigned int uint; | |
typedef unsigned long ulong; | |
typedef __uint64_t u_quad_t; | |
typedef __int64_t quad_t; | |
typedef quad_t * qaddr_t; | |
# 135 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
typedef __int64_t longlong_t; | |
typedef __uint64_t u_longlong_t; | |
typedef __int64_t blkcnt_t; | |
typedef __int32_t blksize_t; | |
typedef __fsblkcnt_t fsblkcnt_t; | |
typedef __fsfilcnt_t fsfilcnt_t; | |
typedef __caddr_t caddr_t; | |
# 163 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
typedef __int64_t daddr_t; | |
typedef __uint64_t dev_t; | |
typedef __uint32_t fixpt_t; | |
typedef __gid_t gid_t; | |
typedef __uint32_t id_t; | |
typedef __uint64_t ino_t; | |
typedef long key_t; | |
typedef __mode_t mode_t; | |
typedef __uint32_t nlink_t; | |
typedef __off_t off_t; | |
typedef __pid_t pid_t; | |
typedef __int32_t lwpid_t; | |
typedef __uint64_t rlim_t; | |
typedef __int32_t segsz_t; | |
typedef __int32_t swblk_t; | |
typedef __uid_t uid_t; | |
typedef int mqd_t; | |
typedef unsigned long cpuid_t; | |
typedef int psetid_t; | |
typedef volatile __cpu_simple_lock_nv_t __cpu_simple_lock_t; | |
# 252 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 253 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
# 253 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 253 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
extern "C" { | |
__off_t lseek(int, __off_t, int); | |
int ftruncate(int, __off_t); | |
int truncate(const char *, __off_t); | |
} | |
# 257 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
#pragma GCC visibility pop | |
# 257 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
typedef __int32_t __devmajor_t, __devminor_t; | |
# 277 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
typedef unsigned int clock_t; | |
# 301 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
typedef int ssize_t; | |
typedef __int64_t time_t; | |
typedef int clockid_t; | |
typedef int timer_t; | |
typedef int suseconds_t; | |
typedef unsigned int useconds_t; | |
# 1 "/usr/include/sys/fd_set.h" 1 3 4 | |
# 37 "/usr/include/sys/fd_set.h" 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/cdefs.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 38 "/usr/include/sys/fd_set.h" 2 3 4 | |
# 1 "/usr/include/sys/featuretest.h" 1 3 4 | |
# 39 "/usr/include/sys/fd_set.h" 2 3 4 | |
typedef __uint32_t __fd_mask; | |
# 66 "/usr/include/sys/fd_set.h" 3 4 | |
typedef struct fd_set { | |
__fd_mask fds_bits[(((256) + ((32) - 1)) / (32))]; | |
} fd_set; | |
# 332 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
typedef struct kauth_cred *kauth_cred_t; | |
typedef int pri_t; | |
# 371 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 3 4 | |
# 1 "/usr/include/pthread_types.h" 1 3 4 | |
# 43 "/usr/include/pthread_types.h" 3 4 | |
typedef __cpu_simple_lock_t pthread_spin_t; | |
typedef __cpu_simple_lock_nv_t __pthread_spin_t; | |
# 61 "/usr/include/pthread_types.h" 3 4 | |
struct pthread_queue_struct_t { struct __pthread_st *ptqh_first; struct __pthread_st **ptqh_last; }; | |
typedef struct pthread_queue_struct_t pthread_queue_t; | |
struct __pthread_st; | |
struct __pthread_attr_st; | |
struct __pthread_mutex_st; | |
struct __pthread_mutexattr_st; | |
struct __pthread_cond_st; | |
struct __pthread_condattr_st; | |
struct __pthread_spin_st; | |
struct __pthread_rwlock_st; | |
struct __pthread_rwlockattr_st; | |
struct __pthread_barrier_st; | |
struct __pthread_barrierattr_st; | |
typedef struct __pthread_st *pthread_t; | |
typedef struct __pthread_attr_st pthread_attr_t; | |
typedef struct __pthread_mutex_st pthread_mutex_t; | |
typedef struct __pthread_mutexattr_st pthread_mutexattr_t; | |
typedef struct __pthread_cond_st pthread_cond_t; | |
typedef struct __pthread_condattr_st pthread_condattr_t; | |
typedef struct __pthread_once_st pthread_once_t; | |
typedef struct __pthread_spinlock_st pthread_spinlock_t; | |
typedef struct __pthread_rwlock_st pthread_rwlock_t; | |
typedef struct __pthread_rwlockattr_st pthread_rwlockattr_t; | |
typedef struct __pthread_barrier_st pthread_barrier_t; | |
typedef struct __pthread_barrierattr_st pthread_barrierattr_t; | |
typedef int pthread_key_t; | |
struct __pthread_attr_st { | |
unsigned int pta_magic; | |
int pta_flags; | |
void *pta_private; | |
}; | |
# 112 "/usr/include/pthread_types.h" 3 4 | |
struct __pthread_mutex_st { | |
unsigned int ptm_magic; | |
__pthread_spin_t ptm_errorcheck; | |
__uint8_t ptm_pad1[3]; | |
# 125 "/usr/include/pthread_types.h" 3 4 | |
union { | |
unsigned char ptm_ceiling; | |
__pthread_spin_t ptm_unused; | |
}; | |
__uint8_t ptm_pad2[3]; | |
pthread_t ptm_owner; | |
pthread_t * ptm_waiters; | |
unsigned int ptm_recursed; | |
void *ptm_spare2; | |
}; | |
# 161 "/usr/include/pthread_types.h" 3 4 | |
struct __pthread_mutexattr_st { | |
unsigned int ptma_magic; | |
void *ptma_private; | |
}; | |
struct __pthread_cond_st { | |
unsigned int ptc_magic; | |
__pthread_spin_t ptc_lock; | |
pthread_queue_t ptc_waiters; | |
pthread_mutex_t *ptc_mutex; | |
void *ptc_private; | |
}; | |
# 191 "/usr/include/pthread_types.h" 3 4 | |
struct __pthread_condattr_st { | |
unsigned int ptca_magic; | |
void *ptca_private; | |
}; | |
struct __pthread_once_st { | |
pthread_mutex_t pto_mutex; | |
int pto_done; | |
}; | |
struct __pthread_spinlock_st { | |
unsigned int pts_magic; | |
__pthread_spin_t pts_spin; | |
int pts_flags; | |
}; | |
# 222 "/usr/include/pthread_types.h" 3 4 | |
struct __pthread_rwlock_st { | |
unsigned int ptr_magic; | |
__pthread_spin_t ptr_interlock; | |
pthread_queue_t ptr_rblocked; | |
pthread_queue_t ptr_wblocked; | |
unsigned int ptr_nreaders; | |
pthread_t ptr_owner; | |
void *ptr_private; | |
}; | |
# 247 "/usr/include/pthread_types.h" 3 4 | |
struct __pthread_rwlockattr_st { | |
unsigned int ptra_magic; | |
void *ptra_private; | |
}; | |
struct __pthread_barrier_st { | |
unsigned int ptb_magic; | |
pthread_spin_t ptb_lock; | |
pthread_queue_t ptb_waiters; | |
unsigned int ptb_initcount; | |
unsigned int ptb_curcount; | |
unsigned int ptb_generation; | |
void *ptb_private; | |
}; | |
struct __pthread_barrierattr_st { | |
unsigned int ptba_magic; | |
void *ptba_private; | |
}; | |
# 372 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/sys/types.h" 2 3 4 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/sys/types.h" 2 3 | |
#pragma GCC visibility pop | |
# 51 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 2 3 4 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 1 3 4 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/machine/ansi.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 54 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 2 3 4 | |
# 73 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
typedef struct { | |
int quot; | |
int rem; | |
} div_t; | |
typedef struct { | |
long quot; | |
long rem; | |
} ldiv_t; | |
typedef struct { | |
long long int quot; | |
long long int rem; | |
} lldiv_t; | |
typedef struct { | |
quad_t quot; | |
quad_t rem; | |
} qdiv_t; | |
# 109 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
extern size_t __mb_cur_max; | |
# 112 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
#pragma GCC visibility push(default) | |
# 112 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
extern "C" { | |
__attribute__((__noreturn__)) void _Exit(int); | |
__attribute__((__noreturn__)) void abort(void); | |
__attribute__((__pure__)) int abs(int); | |
int atexit(void (*)(void)); | |
double atof(const char *); | |
int atoi(const char *); | |
long atol(const char *); | |
void *bsearch(const void *, const void *, size_t, size_t, | |
int (*)(const void *, const void *)); | |
void *calloc(size_t, size_t); | |
div_t div(int, int); | |
__attribute__((__noreturn__)) void exit(int); | |
void free(void *); | |
char *getenv(const char *); | |
__attribute__((__pure__)) long | |
labs(long); | |
ldiv_t ldiv(long, long); | |
void *malloc(size_t); | |
void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); | |
int rand(void); | |
void *realloc(void *, size_t); | |
void srand(unsigned); | |
double strtod(const char * __restrict__, char ** __restrict__); | |
long strtol(const char * __restrict__, char ** __restrict__, int); | |
unsigned long | |
strtoul(const char * __restrict__, char ** __restrict__, int); | |
int system(const char *); | |
int mblen(const char *, size_t); | |
size_t mbstowcs(wchar_t * __restrict__, const char * __restrict__, size_t); | |
int wctomb(char *, wchar_t); | |
int mbtowc(wchar_t * __restrict__, const char * __restrict__, size_t); | |
size_t wcstombs(char * __restrict__, const wchar_t * __restrict__, size_t); | |
# 165 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
int rand_r(unsigned int *); | |
double drand48(void); | |
double erand48(unsigned short[3]); | |
long jrand48(unsigned short[3]); | |
void lcong48(unsigned short[7]); | |
long lrand48(void); | |
long mrand48(void); | |
long nrand48(unsigned short[3]); | |
unsigned short * | |
seed48(unsigned short[3]); | |
void srand48(long); | |
int putenv(char *) __asm("__putenv50"); | |
# 195 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
long a64l(const char *); | |
char *l64a(long); | |
long random(void); | |
char *setstate(char *); | |
char *initstate(unsigned int, char *, size_t) __asm("__initstate60"); | |
void srandom(unsigned int) __asm("__srandom60"); | |
int mkostemp(char *, int); | |
int mkostemps(char *, int, int); | |
char *mkdtemp(char *); | |
int mkstemp(char *); | |
char *mktemp(char *) | |
; | |
int setkey(const char *); | |
char *realpath(const char * __restrict__, char * __restrict__); | |
int ttyslot(void); | |
void *valloc(size_t); | |
int grantpt(int); | |
int unlockpt(int); | |
char *ptsname(int); | |
# 238 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
long long int atoll(const char *); | |
long long int llabs(long long int); | |
lldiv_t lldiv(long long int, long long int); | |
long long int strtoll(const char * __restrict__, char ** __restrict__, int); | |
unsigned long long int | |
strtoull(const char * __restrict__, char ** __restrict__, int); | |
float strtof(const char * __restrict__, char ** __restrict__); | |
long double strtold(const char * __restrict__, char ** __restrict__); | |
void *aligned_alloc(size_t, size_t); | |
int at_quick_exit(void (*)(void)); | |
__attribute__((__noreturn__)) void quick_exit(int); | |
int setenv(const char *, const char *, int); | |
int unsetenv(const char *) __asm("__unsetenv13"); | |
int posix_openpt(int); | |
int posix_memalign(void **, size_t, size_t); | |
# 283 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
void *alloca(size_t); | |
__uint32_t arc4random(void); | |
void arc4random_stir(void); | |
void arc4random_buf(void *, size_t); | |
__uint32_t arc4random_uniform(__uint32_t); | |
void arc4random_addrandom(u_char *, int); | |
char *getbsize(int *, long *); | |
char *cgetcap(char *, const char *, int); | |
int cgetclose(void); | |
int cgetent(char **, const char * const *, const char *); | |
int cgetfirst(char **, const char * const *); | |
int cgetmatch(const char *, const char *); | |
int cgetnext(char **, const char * const *); | |
int cgetnum(char *, const char *, long *); | |
int cgetset(const char *); | |
int cgetstr(char *, const char *, char **); | |
int cgetustr(char *, const char *, char **); | |
void csetexpandtc(int); | |
int daemon(int, int); | |
int devname_r(dev_t, __mode_t, char *, size_t); | |
char *devname(dev_t, __mode_t) __asm("__devname50"); | |
# 318 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
int humanize_number(char *, size_t, __int64_t, const char *, int, int); | |
int dehumanize_number(const char *, __int64_t *); | |
ssize_t hmac(const char *, const void *, size_t, const void *, size_t, void *, | |
size_t); | |
__devmajor_t getdevmajor(const char *, __mode_t); | |
int getloadavg(double [], int); | |
int getenv_r(const char *, char *, size_t); | |
void cfree(void *); | |
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); | |
int mergesort(void *, size_t, size_t, | |
int (*)(const void *, const void *)); | |
int ptsname_r(int, char *, size_t); | |
int radixsort(const unsigned char **, int, const unsigned char *, | |
unsigned); | |
int sradixsort(const unsigned char **, int, const unsigned char *, | |
unsigned); | |
void mi_vector_hash(const void * __restrict__, size_t, __uint32_t, | |
__uint32_t[3]); | |
void setproctitle(const char *, ...) | |
__attribute__((__format__ (__printf__, 1, 2))); | |
const char *getprogname(void) __attribute__((__const__)); | |
void setprogname(const char *); | |
quad_t qabs(quad_t); | |
quad_t strtoq(const char * __restrict__, char ** __restrict__, int); | |
u_quad_t strtouq(const char * __restrict__, char ** __restrict__, int); | |
long long strsuftoll(const char *, const char *, long long, long long); | |
long long strsuftollx(const char *, const char *, long long, long long, | |
char *, size_t); | |
int l64a_r(long, char *, int); | |
size_t shquote(const char *, char *, size_t); | |
size_t shquotev(int, char * const *, char *, size_t); | |
int reallocarr(void *, size_t, size_t); | |
qdiv_t qdiv(quad_t, quad_t); | |
double strtod_l(const char * __restrict__, char ** __restrict__, locale_t); | |
float strtof_l(const char * __restrict__, char ** __restrict__, locale_t); | |
long double strtold_l(const char * __restrict__, char ** __restrict__, | |
locale_t); | |
long strtol_l(const char * __restrict__, char ** __restrict__, int, locale_t); | |
unsigned long | |
strtoul_l(const char * __restrict__, char ** __restrict__, int, locale_t); | |
long long int | |
strtoll_l(const char * __restrict__, char ** __restrict__, int, locale_t); | |
unsigned long long int | |
strtoull_l(const char * __restrict__, char ** __restrict__, int, locale_t); | |
quad_t strtoq_l(const char * __restrict__, char ** __restrict__, int, locale_t); | |
u_quad_t strtouq_l(const char * __restrict__, char ** __restrict__, int, locale_t); | |
size_t _mb_cur_max_l(locale_t); | |
int mblen_l(const char *, size_t, locale_t); | |
size_t mbstowcs_l(wchar_t * __restrict__, const char * __restrict__, size_t, | |
locale_t); | |
int wctomb_l(char *, wchar_t, locale_t); | |
int mbtowc_l(wchar_t * __restrict__, const char * __restrict__, size_t, | |
locale_t); | |
size_t wcstombs_l(char * __restrict__, const wchar_t * __restrict__, size_t, | |
locale_t); | |
} | |
# 407 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
#pragma GCC visibility pop | |
# 407 "/usr/pkg/gcc6/lib/gcc/i486--netbsdelf/6.5.0/include-fixed/stdlib.h" 3 4 | |
# 31 "/usr/pkg/gcc6/include/c++/stdlib.h" 2 3 | |
# 4 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/stdlib.h" 2 3 | |
#pragma GCC visibility pop | |
# 14 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 1 | |
# 2 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/build/dist/system_wrappers/string.h" 3 | |
#pragma GCC visibility push(default) | |
#pragma GCC visibility pop | |
# 15 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
# 32 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
# 32 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
static const union { | |
# 33 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 33 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
bits; | |
float f; | |
} inf_ = { 0x7f800000 }; | |
static float fmaxf_(float x, float y) { return x > y ? x : y; } | |
static float fminf_(float x, float y) { return x < y ? x : y; } | |
static bool isfinitef_(float x) { return 0 == x*0; } | |
static float minus_1_ulp(float x) { | |
# 44 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 44 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
bits; | |
memcpy(&bits, &x, sizeof(bits)); | |
bits = bits - 1; | |
memcpy(&x, &bits, sizeof(bits)); | |
return x; | |
} | |
static float eval_curve(const skcms_Curve* curve, float x) { | |
if (curve->table_entries == 0) { | |
return skcms_TransferFunction_eval(&curve->parametric, x); | |
} | |
float ix = fmaxf_(0, fminf_(x, 1)) * (curve->table_entries - 1); | |
int lo = (int) ix , | |
hi = (int)(float)minus_1_ulp(ix + 1.0f); | |
float t = ix - (float)lo; | |
float l, h; | |
if (curve->table_8) { | |
l = curve->table_8[lo] * (1/255.0f); | |
h = curve->table_8[hi] * (1/255.0f); | |
} else { | |
# 66 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 66 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
be_l, be_h; | |
memcpy(&be_l, curve->table_16 + 2*lo, 2); | |
memcpy(&be_h, curve->table_16 + 2*hi, 2); | |
# 69 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 69 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff; | |
# 70 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 70 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff; | |
l = le_l * (1/65535.0f); | |
h = le_h * (1/65535.0f); | |
} | |
return l + (h-l)*t; | |
} | |
static float max_roundtrip_error(const skcms_Curve* curve, const skcms_TransferFunction* inv_tf) { | |
# 78 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 78 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
N = curve->table_entries > 256 ? curve->table_entries : 256; | |
const float dx = 1.0f / (N - 1); | |
float err = 0; | |
for ( | |
# 81 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 81 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < N; i++) { | |
float x = i * dx, | |
y = eval_curve(curve, x); | |
err = fmaxf_(err, fabsf_(x - skcms_TransferFunction_eval(inv_tf, y))); | |
} | |
return err; | |
} | |
bool skcms_AreApproximateInverses(const skcms_Curve* curve, const skcms_TransferFunction* inv_tf) { | |
return max_roundtrip_error(curve, inv_tf) < (1/512.0f); | |
} | |
enum { | |
skcms_Signature_acsp = 0x61637370, | |
skcms_Signature_rTRC = 0x72545243, | |
skcms_Signature_gTRC = 0x67545243, | |
skcms_Signature_bTRC = 0x62545243, | |
skcms_Signature_kTRC = 0x6B545243, | |
skcms_Signature_rXYZ = 0x7258595A, | |
skcms_Signature_gXYZ = 0x6758595A, | |
skcms_Signature_bXYZ = 0x6258595A, | |
skcms_Signature_A2B0 = 0x41324230, | |
skcms_Signature_A2B1 = 0x41324231, | |
skcms_Signature_mAB = 0x6D414220, | |
skcms_Signature_CHAD = 0x63686164, | |
skcms_Signature_curv = 0x63757276, | |
skcms_Signature_mft1 = 0x6D667431, | |
skcms_Signature_mft2 = 0x6D667432, | |
skcms_Signature_para = 0x70617261, | |
skcms_Signature_sf32 = 0x73663332, | |
}; | |
static | |
# 124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
read_big_u16(const | |
# 124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* ptr) { | |
# 125 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 125 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
be; | |
memcpy(&be, ptr, sizeof(be)); | |
return __builtin_bswap16(be); | |
} | |
static | |
# 134 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 134 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
read_big_u32(const | |
# 134 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 134 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* ptr) { | |
# 135 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 135 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
be; | |
memcpy(&be, ptr, sizeof(be)); | |
return __builtin_bswap32(be); | |
} | |
static | |
# 144 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 144 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
read_big_i32(const | |
# 144 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 144 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* ptr) { | |
return ( | |
# 145 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 145 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)read_big_u32(ptr); | |
} | |
static float read_big_fixed(const | |
# 148 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 148 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* ptr) { | |
return read_big_i32(ptr) * (1.0f / 65536.0f); | |
} | |
typedef struct { | |
# 155 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 155 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
size [ 4]; | |
# 156 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 156 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
cmm_type [ 4]; | |
# 157 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 157 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
version [ 4]; | |
# 158 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 158 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
profile_class [ 4]; | |
# 159 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 159 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
data_color_space [ 4]; | |
# 160 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 160 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
pcs [ 4]; | |
# 161 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 161 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
creation_date_time [12]; | |
# 162 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 162 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
signature [ 4]; | |
# 163 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 163 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
platform [ 4]; | |
# 164 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 164 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
flags [ 4]; | |
# 165 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 165 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
device_manufacturer [ 4]; | |
# 166 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 166 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
device_model [ 4]; | |
# 167 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 167 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
device_attributes [ 8]; | |
# 168 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 168 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
rendering_intent [ 4]; | |
# 169 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 169 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
illuminant_X [ 4]; | |
# 170 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 170 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
illuminant_Y [ 4]; | |
# 171 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 171 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
illuminant_Z [ 4]; | |
# 172 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 172 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
creator [ 4]; | |
# 173 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 173 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
profile_id [16]; | |
# 174 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 174 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved [28]; | |
# 175 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 175 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
tag_count [ 4]; | |
} header_Layout; | |
typedef struct { | |
# 179 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 179 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
signature [4]; | |
# 180 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 180 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
offset [4]; | |
# 181 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 181 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
size [4]; | |
} tag_Layout; | |
static const tag_Layout* get_tag_table(const skcms_ICCProfile* profile) { | |
return (const tag_Layout*)(profile->buffer + (( | |
# 185 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 185 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(header_Layout))); | |
} | |
typedef struct { | |
# 191 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 191 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
type [ 4]; | |
# 192 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 192 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved [ 4]; | |
# 193 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 193 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
values [36]; | |
} sf32_Layout; | |
bool skcms_GetCHAD(const skcms_ICCProfile* profile, skcms_Matrix3x3* m) { | |
skcms_ICCTag tag; | |
if (!skcms_GetTagBySignature(profile, skcms_Signature_CHAD, &tag)) { | |
return false; | |
} | |
if (tag.type != skcms_Signature_sf32 || tag.size < (( | |
# 202 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 202 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(sf32_Layout))) { | |
return false; | |
} | |
const sf32_Layout* sf32Tag = (const sf32_Layout*)tag.buf; | |
const | |
# 207 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 207 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* values = sf32Tag->values; | |
for (int r = 0; r < 3; ++r) | |
for (int c = 0; c < 3; ++c, values += 4) { | |
m->vals[r][c] = read_big_fixed(values); | |
} | |
return true; | |
} | |
typedef struct { | |
# 218 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 218 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
type [4]; | |
# 219 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 219 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved [4]; | |
# 220 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 220 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
X [4]; | |
# 221 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 221 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
Y [4]; | |
# 222 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 222 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
Z [4]; | |
} XYZ_Layout; | |
static bool read_tag_xyz(const skcms_ICCTag* tag, float* x, float* y, float* z) { | |
if (tag->type != skcms_Signature_XYZ || tag->size < (( | |
# 226 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 226 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(XYZ_Layout))) { | |
return false; | |
} | |
const XYZ_Layout* xyzTag = (const XYZ_Layout*)tag->buf; | |
*x = read_big_fixed(xyzTag->X); | |
*y = read_big_fixed(xyzTag->Y); | |
*z = read_big_fixed(xyzTag->Z); | |
return true; | |
} | |
static bool read_to_XYZD50(const skcms_ICCTag* rXYZ, const skcms_ICCTag* gXYZ, | |
const skcms_ICCTag* bXYZ, skcms_Matrix3x3* toXYZ) { | |
return read_tag_xyz(rXYZ, &toXYZ->vals[0][0], &toXYZ->vals[1][0], &toXYZ->vals[2][0]) && | |
read_tag_xyz(gXYZ, &toXYZ->vals[0][1], &toXYZ->vals[1][1], &toXYZ->vals[2][1]) && | |
read_tag_xyz(bXYZ, &toXYZ->vals[0][2], &toXYZ->vals[1][2], &toXYZ->vals[2][2]); | |
} | |
static bool tf_is_valid(const skcms_TransferFunction* tf) { | |
if (!isfinitef_(tf->a + tf->b + tf->c + tf->d + tf->e + tf->f + tf->g)) { | |
return false; | |
} | |
if (tf->a < 0 || tf->c < 0 || tf->d < 0 || tf->g < 0) { | |
return false; | |
} | |
return true; | |
} | |
typedef struct { | |
# 260 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 260 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
type [4]; | |
# 261 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 261 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved_a [4]; | |
# 262 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 262 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
function_type [2]; | |
# 263 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 263 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved_b [2]; | |
# 264 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 264 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable [1 ]; | |
} para_Layout; | |
static bool read_curve_para(const | |
# 267 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 267 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* buf, | |
# 267 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 267 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
size, | |
skcms_Curve* curve, | |
# 268 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 268 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* curve_size) { | |
if (size < (( | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
para_Layout | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 269 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)) { | |
return false; | |
} | |
const para_Layout* paraTag = (const para_Layout*)buf; | |
enum { kG = 0, kGAB = 1, kGABC = 2, kGABCD = 3, kGABCDEF = 4 }; | |
# 276 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 276 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
function_type = read_big_u16(paraTag->function_type); | |
if (function_type > kGABCDEF) { | |
return false; | |
} | |
static const | |
# 281 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 281 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
curve_bytes[] = { 4, 12, 16, 20, 28 }; | |
if (size < (( | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
para_Layout | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 282 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) + curve_bytes[function_type]) { | |
return false; | |
} | |
if (curve_size) { | |
*curve_size = (( | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
para_Layout | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 287 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) + curve_bytes[function_type]; | |
} | |
curve->table_entries = 0; | |
curve->parametric.a = 1.0f; | |
curve->parametric.b = 0.0f; | |
curve->parametric.c = 0.0f; | |
curve->parametric.d = 0.0f; | |
curve->parametric.e = 0.0f; | |
curve->parametric.f = 0.0f; | |
curve->parametric.g = read_big_fixed(paraTag->variable); | |
switch (function_type) { | |
case kGAB: | |
curve->parametric.a = read_big_fixed(paraTag->variable + 4); | |
curve->parametric.b = read_big_fixed(paraTag->variable + 8); | |
if (curve->parametric.a == 0) { | |
return false; | |
} | |
curve->parametric.d = -curve->parametric.b / curve->parametric.a; | |
break; | |
case kGABC: | |
curve->parametric.a = read_big_fixed(paraTag->variable + 4); | |
curve->parametric.b = read_big_fixed(paraTag->variable + 8); | |
curve->parametric.e = read_big_fixed(paraTag->variable + 12); | |
if (curve->parametric.a == 0) { | |
return false; | |
} | |
curve->parametric.d = -curve->parametric.b / curve->parametric.a; | |
curve->parametric.f = curve->parametric.e; | |
break; | |
case kGABCD: | |
curve->parametric.a = read_big_fixed(paraTag->variable + 4); | |
curve->parametric.b = read_big_fixed(paraTag->variable + 8); | |
curve->parametric.c = read_big_fixed(paraTag->variable + 12); | |
curve->parametric.d = read_big_fixed(paraTag->variable + 16); | |
break; | |
case kGABCDEF: | |
curve->parametric.a = read_big_fixed(paraTag->variable + 4); | |
curve->parametric.b = read_big_fixed(paraTag->variable + 8); | |
curve->parametric.c = read_big_fixed(paraTag->variable + 12); | |
curve->parametric.d = read_big_fixed(paraTag->variable + 16); | |
curve->parametric.e = read_big_fixed(paraTag->variable + 20); | |
curve->parametric.f = read_big_fixed(paraTag->variable + 24); | |
break; | |
} | |
return tf_is_valid(&curve->parametric); | |
} | |
typedef struct { | |
# 337 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 337 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
type [4]; | |
# 338 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 338 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved [4]; | |
# 339 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 339 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
value_count [4]; | |
# 340 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 340 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable [1 ]; | |
} curv_Layout; | |
static bool read_curve_curv(const | |
# 343 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 343 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* buf, | |
# 343 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 343 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
size, | |
skcms_Curve* curve, | |
# 344 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 344 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* curve_size) { | |
if (size < (( | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
curv_Layout | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 345 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)) { | |
return false; | |
} | |
const curv_Layout* curvTag = (const curv_Layout*)buf; | |
# 351 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 351 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
value_count = read_big_u32(curvTag->value_count); | |
if (size < (( | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
curv_Layout | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) + value_count * (( | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof( | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 352 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
))) { | |
return false; | |
} | |
if (curve_size) { | |
*curve_size = (( | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
curv_Layout | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) + value_count * (( | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof( | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 357 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)); | |
} | |
if (value_count < 2) { | |
curve->table_entries = 0; | |
curve->parametric.a = 1.0f; | |
curve->parametric.b = 0.0f; | |
curve->parametric.c = 0.0f; | |
curve->parametric.d = 0.0f; | |
curve->parametric.e = 0.0f; | |
curve->parametric.f = 0.0f; | |
if (value_count == 0) { | |
curve->parametric.g = 1.0f; | |
} else { | |
curve->parametric.g = read_big_u16(curvTag->variable) * (1.0f / 256.0f); | |
} | |
} else { | |
curve->table_8 = nullptr; | |
curve->table_16 = curvTag->variable; | |
curve->table_entries = value_count; | |
} | |
return true; | |
} | |
static bool read_curve(const | |
# 386 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 386 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* buf, | |
# 386 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 386 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
size, | |
skcms_Curve* curve, | |
# 387 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 387 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* curve_size) { | |
if (!buf || size < 4 || !curve) { | |
return false; | |
} | |
# 392 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 392 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
type = read_big_u32(buf); | |
if (type == skcms_Signature_para) { | |
return read_curve_para(buf, size, curve, curve_size); | |
} else if (type == skcms_Signature_curv) { | |
return read_curve_curv(buf, size, curve, curve_size); | |
} | |
return false; | |
} | |
typedef struct { | |
# 404 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 404 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
type [ 4]; | |
# 405 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 405 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved_a [ 4]; | |
# 406 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 406 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
input_channels [ 1]; | |
# 407 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 407 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
output_channels [ 1]; | |
# 408 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 408 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
grid_points [ 1]; | |
# 409 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 409 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved_b [ 1]; | |
# 410 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 410 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
matrix [36]; | |
} mft_CommonLayout; | |
typedef struct { | |
mft_CommonLayout common [1]; | |
# 416 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 416 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable [1 ]; | |
} mft1_Layout; | |
typedef struct { | |
mft_CommonLayout common [1]; | |
# 422 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 422 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
input_table_entries [2]; | |
# 423 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 423 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
output_table_entries [2]; | |
# 424 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 424 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable [1 ]; | |
} mft2_Layout; | |
static bool read_mft_common(const mft_CommonLayout* mftTag, skcms_A2B* a2b) { | |
a2b->matrix_channels = 0; | |
a2b->input_channels = mftTag->input_channels[0]; | |
a2b->output_channels = mftTag->output_channels[0]; | |
if (a2b->output_channels != (int)(sizeof((a2b->output_curves)) / sizeof(*(a2b->output_curves)))) { | |
return false; | |
} | |
if (a2b->input_channels < 1 || a2b->input_channels > (int)(sizeof((a2b->input_curves)) / sizeof(*(a2b->input_curves)))) { | |
return false; | |
} | |
for ( | |
# 446 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 446 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < a2b->input_channels; ++i) { | |
a2b->grid_points[i] = mftTag->grid_points[0]; | |
} | |
if (a2b->grid_points[0] < 2) { | |
return false; | |
} | |
return true; | |
} | |
static bool init_a2b_tables(const | |
# 457 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 457 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* table_base, | |
# 457 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 457 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
max_tables_len, | |
# 457 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 457 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
byte_width, | |
# 458 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 458 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
input_table_entries, | |
# 458 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 458 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
output_table_entries, | |
skcms_A2B* a2b) { | |
# 461 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 461 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
byte_len_per_input_table = input_table_entries * byte_width; | |
# 462 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 462 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
byte_len_per_output_table = output_table_entries * byte_width; | |
# 465 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 465 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
byte_len_all_input_tables = a2b->input_channels * byte_len_per_input_table; | |
# 466 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 466 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
byte_len_all_output_tables = a2b->output_channels * byte_len_per_output_table; | |
# 468 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 468 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
grid_size = a2b->output_channels * byte_width; | |
for ( | |
# 469 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 469 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
axis = 0; axis < a2b->input_channels; ++axis) { | |
grid_size *= a2b->grid_points[axis]; | |
} | |
if (max_tables_len < byte_len_all_input_tables + grid_size + byte_len_all_output_tables) { | |
return false; | |
} | |
for ( | |
# 477 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 477 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < a2b->input_channels; ++i) { | |
a2b->input_curves[i].table_entries = input_table_entries; | |
if (byte_width == 1) { | |
a2b->input_curves[i].table_8 = table_base + i * byte_len_per_input_table; | |
a2b->input_curves[i].table_16 = nullptr; | |
} else { | |
a2b->input_curves[i].table_8 = nullptr; | |
a2b->input_curves[i].table_16 = table_base + i * byte_len_per_input_table; | |
} | |
} | |
if (byte_width == 1) { | |
a2b->grid_8 = table_base + byte_len_all_input_tables; | |
a2b->grid_16 = nullptr; | |
} else { | |
a2b->grid_8 = nullptr; | |
a2b->grid_16 = table_base + byte_len_all_input_tables; | |
} | |
const | |
# 496 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 496 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* output_table_base = table_base + byte_len_all_input_tables + grid_size; | |
for ( | |
# 497 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 497 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < a2b->output_channels; ++i) { | |
a2b->output_curves[i].table_entries = output_table_entries; | |
if (byte_width == 1) { | |
a2b->output_curves[i].table_8 = output_table_base + i * byte_len_per_output_table; | |
a2b->output_curves[i].table_16 = nullptr; | |
} else { | |
a2b->output_curves[i].table_8 = nullptr; | |
a2b->output_curves[i].table_16 = output_table_base + i * byte_len_per_output_table; | |
} | |
} | |
return true; | |
} | |
static bool read_tag_mft1(const skcms_ICCTag* tag, skcms_A2B* a2b) { | |
if (tag->size < (( | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
mft1_Layout | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 512 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)) { | |
return false; | |
} | |
const mft1_Layout* mftTag = (const mft1_Layout*)tag->buf; | |
if (!read_mft_common(mftTag->common, a2b)) { | |
return false; | |
} | |
# 521 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 521 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
input_table_entries = 256; | |
# 522 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 522 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
output_table_entries = 256; | |
return init_a2b_tables(mftTag->variable, tag->size - (( | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
mft1_Layout | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 524 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
), 1, | |
input_table_entries, output_table_entries, a2b); | |
} | |
static bool read_tag_mft2(const skcms_ICCTag* tag, skcms_A2B* a2b) { | |
if (tag->size < (( | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
mft2_Layout | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 529 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)) { | |
return false; | |
} | |
const mft2_Layout* mftTag = (const mft2_Layout*)tag->buf; | |
if (!read_mft_common(mftTag->common, a2b)) { | |
return false; | |
} | |
# 538 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 538 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
input_table_entries = read_big_u16(mftTag->input_table_entries); | |
# 539 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 539 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
output_table_entries = read_big_u16(mftTag->output_table_entries); | |
if (input_table_entries < 2 || input_table_entries > 4096 || | |
output_table_entries < 2 || output_table_entries > 4096) { | |
return false; | |
} | |
return init_a2b_tables(mftTag->variable, tag->size - (( | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
mft2_Layout | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 547 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
), 2, | |
input_table_entries, output_table_entries, a2b); | |
} | |
static bool read_curves(const | |
# 551 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 551 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* buf, | |
# 551 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 551 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
size, | |
# 551 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 551 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
curve_offset, | |
# 552 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 552 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
num_curves, skcms_Curve* curves) { | |
for ( | |
# 553 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 553 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < num_curves; ++i) { | |
if (curve_offset > size) { | |
return false; | |
} | |
# 558 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 558 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
curve_bytes; | |
if (!read_curve(buf + curve_offset, size - curve_offset, &curves[i], &curve_bytes)) { | |
return false; | |
} | |
if (curve_bytes > 0xffffffffU - 3) { | |
return false; | |
} | |
curve_bytes = (curve_bytes + 3) & ~3U; | |
# 568 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 568 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
new_offset_64 = ( | |
# 568 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 568 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)curve_offset + curve_bytes; | |
curve_offset = ( | |
# 569 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 569 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)new_offset_64; | |
if (new_offset_64 != curve_offset) { | |
return false; | |
} | |
} | |
return true; | |
} | |
typedef struct { | |
# 579 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 579 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
type [ 4]; | |
# 580 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 580 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved_a [ 4]; | |
# 581 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 581 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
input_channels [ 1]; | |
# 582 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 582 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
output_channels [ 1]; | |
# 583 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 583 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved_b [ 2]; | |
# 584 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 584 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
b_curve_offset [ 4]; | |
# 585 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 585 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
matrix_offset [ 4]; | |
# 586 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 586 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
m_curve_offset [ 4]; | |
# 587 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 587 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
clut_offset [ 4]; | |
# 588 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 588 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
a_curve_offset [ 4]; | |
} mAB_Layout; | |
typedef struct { | |
# 592 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 592 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
grid_points [16]; | |
# 593 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 593 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
grid_byte_width [ 1]; | |
# 594 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 594 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
reserved [ 3]; | |
# 595 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 595 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable [1 ]; | |
} mABCLUT_Layout; | |
static bool read_tag_mab(const skcms_ICCTag* tag, skcms_A2B* a2b, bool pcs_is_xyz) { | |
if (tag->size < (( | |
# 599 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 599 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(mAB_Layout))) { | |
return false; | |
} | |
const mAB_Layout* mABTag = (const mAB_Layout*)tag->buf; | |
a2b->input_channels = mABTag->input_channels[0]; | |
a2b->output_channels = mABTag->output_channels[0]; | |
if (a2b->output_channels != (int)(sizeof((a2b->output_curves)) / sizeof(*(a2b->output_curves)))) { | |
return false; | |
} | |
if (a2b->input_channels > (int)(sizeof((a2b->input_curves)) / sizeof(*(a2b->input_curves)))) { | |
return false; | |
} | |
# 617 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 617 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
b_curve_offset = read_big_u32(mABTag->b_curve_offset); | |
# 618 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 618 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
matrix_offset = read_big_u32(mABTag->matrix_offset); | |
# 619 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 619 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
m_curve_offset = read_big_u32(mABTag->m_curve_offset); | |
# 620 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 620 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
clut_offset = read_big_u32(mABTag->clut_offset); | |
# 621 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 621 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
a_curve_offset = read_big_u32(mABTag->a_curve_offset); | |
if (0 == b_curve_offset) { | |
return false; | |
} | |
if (!read_curves(tag->buf, tag->size, b_curve_offset, a2b->output_channels, | |
a2b->output_curves)) { | |
return false; | |
} | |
if (0 != m_curve_offset) { | |
if (0 == matrix_offset) { | |
return false; | |
} | |
a2b->matrix_channels = a2b->output_channels; | |
if (!read_curves(tag->buf, tag->size, m_curve_offset, a2b->matrix_channels, | |
a2b->matrix_curves)) { | |
return false; | |
} | |
if (tag->size < matrix_offset + 12 * (( | |
# 645 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 645 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof( | |
# 645 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 645 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
))) { | |
return false; | |
} | |
float encoding_factor = pcs_is_xyz ? 65535 / 32768.0f : 1.0f; | |
const | |
# 649 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 649 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
* mtx_buf = tag->buf + matrix_offset; | |
a2b->matrix.vals[0][0] = encoding_factor * read_big_fixed(mtx_buf + 0); | |
a2b->matrix.vals[0][1] = encoding_factor * read_big_fixed(mtx_buf + 4); | |
a2b->matrix.vals[0][2] = encoding_factor * read_big_fixed(mtx_buf + 8); | |
a2b->matrix.vals[1][0] = encoding_factor * read_big_fixed(mtx_buf + 12); | |
a2b->matrix.vals[1][1] = encoding_factor * read_big_fixed(mtx_buf + 16); | |
a2b->matrix.vals[1][2] = encoding_factor * read_big_fixed(mtx_buf + 20); | |
a2b->matrix.vals[2][0] = encoding_factor * read_big_fixed(mtx_buf + 24); | |
a2b->matrix.vals[2][1] = encoding_factor * read_big_fixed(mtx_buf + 28); | |
a2b->matrix.vals[2][2] = encoding_factor * read_big_fixed(mtx_buf + 32); | |
a2b->matrix.vals[0][3] = encoding_factor * read_big_fixed(mtx_buf + 36); | |
a2b->matrix.vals[1][3] = encoding_factor * read_big_fixed(mtx_buf + 40); | |
a2b->matrix.vals[2][3] = encoding_factor * read_big_fixed(mtx_buf + 44); | |
} else { | |
if (0 != matrix_offset) { | |
return false; | |
} | |
a2b->matrix_channels = 0; | |
} | |
if (0 != a_curve_offset) { | |
if (0 == clut_offset) { | |
return false; | |
} | |
if (!read_curves(tag->buf, tag->size, a_curve_offset, a2b->input_channels, | |
a2b->input_curves)) { | |
return false; | |
} | |
if (tag->size < clut_offset + (( | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
mABCLUT_Layout | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 679 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)) { | |
return false; | |
} | |
const mABCLUT_Layout* clut = (const mABCLUT_Layout*)(tag->buf + clut_offset); | |
if (clut->grid_byte_width[0] == 1) { | |
a2b->grid_8 = clut->variable; | |
a2b->grid_16 = nullptr; | |
} else if (clut->grid_byte_width[0] == 2) { | |
a2b->grid_8 = nullptr; | |
a2b->grid_16 = clut->variable; | |
} else { | |
return false; | |
} | |
# 694 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 694 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
grid_size = a2b->output_channels * clut->grid_byte_width[0]; | |
for ( | |
# 695 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 695 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < a2b->input_channels; ++i) { | |
a2b->grid_points[i] = clut->grid_points[i]; | |
if (a2b->grid_points[i] < 2) { | |
return false; | |
} | |
grid_size *= a2b->grid_points[i]; | |
} | |
if (tag->size < clut_offset + (( | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__builtin_offsetof ( | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
mABCLUT_Layout | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
, | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
variable | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
) | |
# 703 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) + grid_size) { | |
return false; | |
} | |
} else { | |
if (0 != clut_offset) { | |
return false; | |
} | |
if (a2b->input_channels != a2b->output_channels) { | |
return false; | |
} | |
a2b->input_channels = 0; | |
} | |
return true; | |
} | |
static int fit_linear(const skcms_Curve* curve, int N, float tol, | |
float* c, float* d, float* f = nullptr) { | |
# 727 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
(static_cast<void>(0)) | |
# 727 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
; | |
# 738 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
const float dx = 1.0f / (N - 1); | |
int lin_points = 1; | |
float f_zero = 0.0f; | |
if (f) { | |
*f = eval_curve(curve, 0); | |
} else { | |
f = &f_zero; | |
} | |
float slope_min = -inf_.f; | |
float slope_max = +inf_.f; | |
for (int i = 1; i < N; ++i) { | |
float x = i * dx; | |
float y = eval_curve(curve, x); | |
float slope_max_i = (y + tol - *f) / x, | |
slope_min_i = (y - tol - *f) / x; | |
if (slope_max_i < slope_min || slope_max < slope_min_i) { | |
break; | |
} | |
slope_max = fminf_(slope_max, slope_max_i); | |
slope_min = fmaxf_(slope_min, slope_min_i); | |
float cur_slope = (y - *f) / x; | |
if (slope_min <= cur_slope && cur_slope <= slope_max) { | |
lin_points = i + 1; | |
*c = cur_slope; | |
} | |
} | |
*d = (lin_points - 1) * dx; | |
return lin_points; | |
} | |
static bool read_a2b(const skcms_ICCTag* tag, skcms_A2B* a2b, bool pcs_is_xyz) { | |
bool ok = false; | |
if (tag->type == skcms_Signature_mft1) { | |
ok = read_tag_mft1(tag, a2b); | |
} else if (tag->type == skcms_Signature_mft2) { | |
ok = read_tag_mft2(tag, a2b); | |
} else if (tag->type == skcms_Signature_mAB) { | |
ok = read_tag_mab(tag, a2b, pcs_is_xyz); | |
} | |
if (!ok) { | |
return false; | |
} | |
skcms_Curve* curves[] = { | |
a2b->input_channels > 0 ? a2b->input_curves + 0 : nullptr, | |
a2b->input_channels > 1 ? a2b->input_curves + 1 : nullptr, | |
a2b->input_channels > 2 ? a2b->input_curves + 2 : nullptr, | |
a2b->input_channels > 3 ? a2b->input_curves + 3 : nullptr, | |
a2b->matrix_channels > 0 ? a2b->matrix_curves + 0 : nullptr, | |
a2b->matrix_channels > 1 ? a2b->matrix_curves + 1 : nullptr, | |
a2b->matrix_channels > 2 ? a2b->matrix_curves + 2 : nullptr, | |
a2b->output_channels > 0 ? a2b->output_curves + 0 : nullptr, | |
a2b->output_channels > 1 ? a2b->output_curves + 1 : nullptr, | |
a2b->output_channels > 2 ? a2b->output_curves + 2 : nullptr, | |
}; | |
for (int i = 0; i < (int)(sizeof((curves)) / sizeof(*(curves))); i++) { | |
skcms_Curve* curve = curves[i]; | |
if (curve && curve->table_entries && curve->table_entries <= ( | |
# 807 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 807 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)0x7fffffff) { | |
int N = (int)curve->table_entries; | |
float c = 0.0f, d = 0.0f, f = 0.0f; | |
if (N == fit_linear(curve, N, 1.0f/(2*N), &c,&d,&f) | |
&& c == 1.0f | |
&& f == 0.0f) { | |
curve->table_entries = 0; | |
curve->table_8 = nullptr; | |
curve->table_16 = nullptr; | |
curve->parametric = skcms_TransferFunction{1,1,0,0,0,0,0}; | |
} | |
} | |
} | |
return true; | |
} | |
void skcms_GetTagByIndex(const skcms_ICCProfile* profile, | |
# 825 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 825 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
idx, skcms_ICCTag* tag) { | |
if (!profile || !profile->buffer || !tag) { return; } | |
if (idx > profile->tag_count) { return; } | |
const tag_Layout* tags = get_tag_table(profile); | |
tag->signature = read_big_u32(tags[idx].signature); | |
tag->size = read_big_u32(tags[idx].size); | |
tag->buf = read_big_u32(tags[idx].offset) + profile->buffer; | |
tag->type = read_big_u32(tag->buf); | |
} | |
bool skcms_GetTagBySignature(const skcms_ICCProfile* profile, | |
# 835 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 835 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
sig, skcms_ICCTag* tag) { | |
if (!profile || !profile->buffer || !tag) { return false; } | |
const tag_Layout* tags = get_tag_table(profile); | |
for ( | |
# 838 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 838 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < profile->tag_count; ++i) { | |
if (read_big_u32(tags[i].signature) == sig) { | |
tag->signature = sig; | |
tag->size = read_big_u32(tags[i].size); | |
tag->buf = read_big_u32(tags[i].offset) + profile->buffer; | |
tag->type = read_big_u32(tag->buf); | |
return true; | |
} | |
} | |
return false; | |
} | |
static bool usable_as_src(const skcms_ICCProfile* profile) { | |
return profile->has_A2B | |
|| (profile->has_trc && profile->has_toXYZD50); | |
} | |
bool skcms_Parse(const void* buf, size_t len, skcms_ICCProfile* profile) { | |
# 856 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
(static_cast<void>(0)) | |
# 856 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
; | |
if (!profile) { | |
return false; | |
} | |
memset(profile, 0, (( | |
# 861 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 861 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(*profile))); | |
if (len < (( | |
# 863 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 863 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(header_Layout))) { | |
return false; | |
} | |
const header_Layout* header = (const header_Layout*)buf; | |
profile->buffer = (const | |
# 869 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 869 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
*)buf; | |
profile->size = read_big_u32(header->size); | |
# 871 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 871 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
version = read_big_u32(header->version); | |
profile->data_color_space = read_big_u32(header->data_color_space); | |
profile->pcs = read_big_u32(header->pcs); | |
# 874 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 874 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
signature = read_big_u32(header->signature); | |
float illuminant_X = read_big_fixed(header->illuminant_X); | |
float illuminant_Y = read_big_fixed(header->illuminant_Y); | |
float illuminant_Z = read_big_fixed(header->illuminant_Z); | |
profile->tag_count = read_big_u32(header->tag_count); | |
# 882 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 882 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
tag_table_size = profile->tag_count * (( | |
# 882 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 882 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(tag_Layout)); | |
if (signature != skcms_Signature_acsp || | |
profile->size > len || | |
profile->size < (( | |
# 885 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 885 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)sizeof(header_Layout)) + tag_table_size || | |
(version >> 24) > 4) { | |
return false; | |
} | |
if (fabsf_(illuminant_X - 0.9642f) > 0.0100f || | |
fabsf_(illuminant_Y - 1.0000f) > 0.0100f || | |
fabsf_(illuminant_Z - 0.8249f) > 0.0100f) { | |
return false; | |
} | |
const tag_Layout* tags = get_tag_table(profile); | |
for ( | |
# 899 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 899 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
i = 0; i < profile->tag_count; ++i) { | |
# 900 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 900 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
tag_offset = read_big_u32(tags[i].offset); | |
# 901 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 901 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
tag_size = read_big_u32(tags[i].size); | |
# 902 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 902 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
tag_end = ( | |
# 902 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 902 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)tag_offset + ( | |
# 902 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 902 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)tag_size; | |
if (tag_size < 4 || tag_end > profile->size) { | |
return false; | |
} | |
} | |
if (profile->pcs != skcms_Signature_XYZ && profile->pcs != skcms_Signature_Lab) { | |
return false; | |
} | |
bool pcs_is_xyz = profile->pcs == skcms_Signature_XYZ; | |
skcms_ICCTag kTRC; | |
if (profile->data_color_space == skcms_Signature_Gray && | |
skcms_GetTagBySignature(profile, skcms_Signature_kTRC, &kTRC)) { | |
if (!read_curve(kTRC.buf, kTRC.size, &profile->trc[0], nullptr)) { | |
return false; | |
} | |
profile->trc[1] = profile->trc[0]; | |
profile->trc[2] = profile->trc[0]; | |
profile->has_trc = true; | |
if (pcs_is_xyz) { | |
profile->toXYZD50.vals[0][0] = illuminant_X; | |
profile->toXYZD50.vals[1][1] = illuminant_Y; | |
profile->toXYZD50.vals[2][2] = illuminant_Z; | |
profile->has_toXYZD50 = true; | |
} | |
} else { | |
skcms_ICCTag rTRC, gTRC, bTRC; | |
if (skcms_GetTagBySignature(profile, skcms_Signature_rTRC, &rTRC) && | |
skcms_GetTagBySignature(profile, skcms_Signature_gTRC, &gTRC) && | |
skcms_GetTagBySignature(profile, skcms_Signature_bTRC, &bTRC)) { | |
if (!read_curve(rTRC.buf, rTRC.size, &profile->trc[0], nullptr) || | |
!read_curve(gTRC.buf, gTRC.size, &profile->trc[1], nullptr) || | |
!read_curve(bTRC.buf, bTRC.size, &profile->trc[2], nullptr)) { | |
return false; | |
} | |
profile->has_trc = true; | |
} | |
skcms_ICCTag rXYZ, gXYZ, bXYZ; | |
if (skcms_GetTagBySignature(profile, skcms_Signature_rXYZ, &rXYZ) && | |
skcms_GetTagBySignature(profile, skcms_Signature_gXYZ, &gXYZ) && | |
skcms_GetTagBySignature(profile, skcms_Signature_bXYZ, &bXYZ)) { | |
if (!read_to_XYZD50(&rXYZ, &gXYZ, &bXYZ, &profile->toXYZD50)) { | |
return false; | |
} | |
profile->has_toXYZD50 = true; | |
} | |
} | |
skcms_ICCTag a2b_tag; | |
const | |
# 964 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 964 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
sigs[] = { skcms_Signature_A2B0, skcms_Signature_A2B1 }; | |
for (int i = 0; i < (int)(sizeof((sigs)) / sizeof(*(sigs))); i++) { | |
if (skcms_GetTagBySignature(profile, sigs[i], &a2b_tag)) { | |
if (!read_a2b(&a2b_tag, &profile->A2B, pcs_is_xyz)) { | |
return false; | |
} | |
profile->has_A2B = true; | |
break; | |
} | |
} | |
return usable_as_src(profile); | |
} | |
const skcms_ICCProfile* skcms_sRGB_profile() { | |
static const skcms_ICCProfile sRGB_profile = { | |
nullptr, | |
0, | |
skcms_Signature_RGB, | |
skcms_Signature_XYZ, | |
0, | |
true, | |
{ | |
{{0, {2.4f, (float)(1/1.055), (float)(0.055/1.055), (float)(1/12.92), 0.04045f, 0, 0}}}, | |
{{0, {2.4f, (float)(1/1.055), (float)(0.055/1.055), (float)(1/12.92), 0.04045f, 0, 0}}}, | |
{{0, {2.4f, (float)(1/1.055), (float)(0.055/1.055), (float)(1/12.92), 0.04045f, 0, 0}}}, | |
}, | |
true, | |
{{ | |
{ 0.436065674f, 0.385147095f, 0.143066406f }, | |
{ 0.222488403f, 0.716873169f, 0.060607910f }, | |
{ 0.013916016f, 0.097076416f, 0.714096069f }, | |
}}, | |
false, | |
{ | |
0, | |
{ | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
}, | |
{0,0,0,0}, | |
nullptr, | |
nullptr, | |
0, | |
{ | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
}, | |
{{ | |
{ 0,0,0,0 }, | |
{ 0,0,0,0 }, | |
{ 0,0,0,0 }, | |
}}, | |
0, | |
{ | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
}, | |
}, | |
}; | |
return &sRGB_profile; | |
} | |
const skcms_ICCProfile* skcms_XYZD50_profile() { | |
static const skcms_ICCProfile XYZD50_profile = { | |
nullptr, | |
0, | |
skcms_Signature_RGB, | |
skcms_Signature_XYZ, | |
0, | |
true, | |
{ | |
{{0, {1,1, 0,0,0,0,0}}}, | |
{{0, {1,1, 0,0,0,0,0}}}, | |
{{0, {1,1, 0,0,0,0,0}}}, | |
}, | |
true, | |
{{ | |
{ 1,0,0 }, | |
{ 0,1,0 }, | |
{ 0,0,1 }, | |
}}, | |
false, | |
{ | |
0, | |
{ | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
}, | |
{0,0,0,0}, | |
nullptr, | |
nullptr, | |
0, | |
{ | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
}, | |
{{ | |
{ 0,0,0,0 }, | |
{ 0,0,0,0 }, | |
{ 0,0,0,0 }, | |
}}, | |
0, | |
{ | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
{{0, {0,0, 0,0,0,0,0}}}, | |
}, | |
}, | |
}; | |
return &XYZD50_profile; | |
} | |
const skcms_TransferFunction* skcms_sRGB_TransferFunction() { | |
return &skcms_sRGB_profile()->trc[0].parametric; | |
} | |
const skcms_TransferFunction* skcms_sRGB_Inverse_TransferFunction() { | |
static const skcms_TransferFunction sRGB_inv = | |
{0.416666657f, 1.137283325f, -0.0f, 12.920000076f, 0.003130805f, -0.054969788f, -0.0f}; | |
return &sRGB_inv; | |
} | |
const skcms_TransferFunction* skcms_Identity_TransferFunction() { | |
static const skcms_TransferFunction identity = {1,1,0,0,0,0,0}; | |
return &identity; | |
} | |
const | |
# 1117 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 1117 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
skcms_252_random_bytes[] = { | |
8, 179, 128, 204, 253, 38, 134, 184, 68, 102, 32, 138, 99, 39, 169, 215, | |
119, 26, 3, 223, 95, 239, 52, 132, 114, 74, 81, 234, 97, 116, 244, 205, 30, | |
154, 173, 12, 51, 159, 122, 153, 61, 226, 236, 178, 229, 55, 181, 220, 191, | |
194, 160, 126, 168, 82, 131, 18, 180, 245, 163, 22, 246, 69, 235, 252, 57, | |
108, 14, 6, 152, 240, 255, 171, 242, 20, 227, 177, 238, 96, 85, 16, 211, | |
70, 200, 149, 155, 146, 127, 145, 100, 151, 109, 19, 165, 208, 195, 164, | |
137, 254, 182, 248, 64, 201, 45, 209, 5, 147, 207, 210, 113, 162, 83, 225, | |
9, 31, 15, 231, 115, 37, 58, 53, 24, 49, 197, 56, 120, 172, 48, 21, 214, | |
129, 111, 11, 50, 187, 196, 34, 60, 103, 71, 144, 47, 203, 77, 80, 232, | |
140, 222, 250, 206, 166, 247, 139, 249, 221, 72, 106, 27, 199, 117, 54, | |
219, 135, 118, 40, 79, 41, 251, 46, 93, 212, 92, 233, 148, 28, 121, 63, | |
123, 158, 105, 59, 29, 42, 143, 23, 0, 107, 176, 87, 104, 183, 156, 193, | |
189, 90, 188, 65, 190, 17, 198, 7, 186, 161, 1, 124, 78, 125, 170, 133, | |
174, 218, 67, 157, 75, 101, 89, 217, 62, 33, 141, 228, 25, 35, 91, 230, 4, | |
2, 13, 73, 86, 167, 237, 84, 243, 44, 185, 66, 130, 110, 150, 142, 216, 88, | |
112, 36, 224, 136, 202, 76, 94, 98, 175, 213 | |
}; | |
bool skcms_ApproximatelyEqualProfiles(const skcms_ICCProfile* A, const skcms_ICCProfile* B) { | |
if (A == B || 0 == memcmp(A,B, sizeof(skcms_ICCProfile))) { | |
return true; | |
} | |
# 1152 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
if (A->data_color_space != B->data_color_space) { | |
return false; | |
} | |
skcms_PixelFormat fmt = skcms_PixelFormat_RGB_888; | |
size_t npixels = 84; | |
if (A->data_color_space == skcms_Signature_CMYK) { | |
fmt = skcms_PixelFormat_RGBA_8888; | |
npixels = 63; | |
} | |
# 1167 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 1167 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
dstA[252], | |
dstB[252]; | |
if (!skcms_Transform( | |
skcms_252_random_bytes, fmt, skcms_AlphaFormat_Unpremul, A, | |
dstA, skcms_PixelFormat_RGB_888, skcms_AlphaFormat_Unpremul, skcms_XYZD50_profile(), | |
npixels)) { | |
return false; | |
} | |
if (!skcms_Transform( | |
skcms_252_random_bytes, fmt, skcms_AlphaFormat_Unpremul, B, | |
dstB, skcms_PixelFormat_RGB_888, skcms_AlphaFormat_Unpremul, skcms_XYZD50_profile(), | |
npixels)) { | |
return false; | |
} | |
for (size_t i = 0; i < 252; i++) { | |
if (abs((int)dstA[i] - (int)dstB[i]) > 1) { | |
return false; | |
} | |
} | |
return true; | |
} | |
bool skcms_TRCs_AreApproximateInverse(const skcms_ICCProfile* profile, | |
const skcms_TransferFunction* inv_tf) { | |
if (!profile || !profile->has_trc) { | |
return false; | |
} | |
return skcms_AreApproximateInverses(&profile->trc[0], inv_tf) && | |
skcms_AreApproximateInverses(&profile->trc[1], inv_tf) && | |
skcms_AreApproximateInverses(&profile->trc[2], inv_tf); | |
} | |
static bool is_zero_to_one(float x) { | |
return 0 <= x && x <= 1; | |
} | |
typedef struct { float vals[3]; } skcms_Vector3; | |
static skcms_Vector3 mv_mul(const skcms_Matrix3x3* m, const skcms_Vector3* v) { | |
skcms_Vector3 dst = {{0,0,0}}; | |
for (int row = 0; row < 3; ++row) { | |
dst.vals[row] = m->vals[row][0] * v->vals[0] | |
+ m->vals[row][1] * v->vals[1] | |
+ m->vals[row][2] * v->vals[2]; | |
} | |
return dst; | |
} | |
bool skcms_PrimariesToXYZD50(float rx, float ry, | |
float gx, float gy, | |
float bx, float by, | |
float wx, float wy, | |
skcms_Matrix3x3* toXYZD50) { | |
if (!is_zero_to_one(rx) || !is_zero_to_one(ry) || | |
!is_zero_to_one(gx) || !is_zero_to_one(gy) || | |
!is_zero_to_one(bx) || !is_zero_to_one(by) || | |
!is_zero_to_one(wx) || !is_zero_to_one(wy) || | |
!toXYZD50) { | |
return false; | |
} | |
skcms_Matrix3x3 primaries = {{ | |
{ rx, gx, bx }, | |
{ ry, gy, by }, | |
{ 1 - rx - ry, 1 - gx - gy, 1 - bx - by }, | |
}}; | |
skcms_Matrix3x3 primaries_inv; | |
if (!skcms_Matrix3x3_invert(&primaries, &primaries_inv)) { | |
return false; | |
} | |
skcms_Vector3 wXYZ = { { wx / wy, 1, (1 - wx - wy) / wy } }; | |
skcms_Vector3 XYZ = mv_mul(&primaries_inv, &wXYZ); | |
skcms_Matrix3x3 toXYZ = {{ | |
{ XYZ.vals[0], 0, 0 }, | |
{ 0, XYZ.vals[1], 0 }, | |
{ 0, 0, XYZ.vals[2] }, | |
}}; | |
toXYZ = skcms_Matrix3x3_concat(&primaries, &toXYZ); | |
skcms_Vector3 wXYZD50 = { { 0.96422f, 1.0f, 0.82521f } }; | |
skcms_Matrix3x3 xyz_to_lms = {{ | |
{ 0.8951f, 0.2664f, -0.1614f }, | |
{ -0.7502f, 1.7135f, 0.0367f }, | |
{ 0.0389f, -0.0685f, 1.0296f }, | |
}}; | |
skcms_Matrix3x3 lms_to_xyz = {{ | |
{ 0.9869929f, -0.1470543f, 0.1599627f }, | |
{ 0.4323053f, 0.5183603f, 0.0492912f }, | |
{ -0.0085287f, 0.0400428f, 0.9684867f }, | |
}}; | |
skcms_Vector3 srcCone = mv_mul(&xyz_to_lms, &wXYZ); | |
skcms_Vector3 dstCone = mv_mul(&xyz_to_lms, &wXYZD50); | |
skcms_Matrix3x3 DXtoD50 = {{ | |
{ dstCone.vals[0] / srcCone.vals[0], 0, 0 }, | |
{ 0, dstCone.vals[1] / srcCone.vals[1], 0 }, | |
{ 0, 0, dstCone.vals[2] / srcCone.vals[2] }, | |
}}; | |
DXtoD50 = skcms_Matrix3x3_concat(&DXtoD50, &xyz_to_lms); | |
DXtoD50 = skcms_Matrix3x3_concat(&lms_to_xyz, &DXtoD50); | |
*toXYZD50 = skcms_Matrix3x3_concat(&DXtoD50, &toXYZ); | |
return true; | |
} | |
bool skcms_Matrix3x3_invert(const skcms_Matrix3x3* src, skcms_Matrix3x3* dst) { | |
double a00 = src->vals[0][0], | |
a01 = src->vals[1][0], | |
a02 = src->vals[2][0], | |
a10 = src->vals[0][1], | |
a11 = src->vals[1][1], | |
a12 = src->vals[2][1], | |
a20 = src->vals[0][2], | |
a21 = src->vals[1][2], | |
a22 = src->vals[2][2]; | |
double b0 = a00*a11 - a01*a10, | |
b1 = a00*a12 - a02*a10, | |
b2 = a01*a12 - a02*a11, | |
b3 = a20, | |
b4 = a21, | |
b5 = a22; | |
double determinant = b0*b5 | |
- b1*b4 | |
+ b2*b3; | |
if (determinant == 0) { | |
return false; | |
} | |
double invdet = 1.0 / determinant; | |
if (invdet > +3.40282346638528859812e+38F || invdet < -3.40282346638528859812e+38F || !isfinitef_((float)invdet)) { | |
return false; | |
} | |
b0 *= invdet; | |
b1 *= invdet; | |
b2 *= invdet; | |
b3 *= invdet; | |
b4 *= invdet; | |
b5 *= invdet; | |
dst->vals[0][0] = (float)( a11*b5 - a12*b4 ); | |
dst->vals[1][0] = (float)( a02*b4 - a01*b5 ); | |
dst->vals[2][0] = (float)( + b2 ); | |
dst->vals[0][1] = (float)( a12*b3 - a10*b5 ); | |
dst->vals[1][1] = (float)( a00*b5 - a02*b3 ); | |
dst->vals[2][1] = (float)( - b1 ); | |
dst->vals[0][2] = (float)( a10*b4 - a11*b3 ); | |
dst->vals[1][2] = (float)( a01*b3 - a00*b4 ); | |
dst->vals[2][2] = (float)( + b0 ); | |
for (int r = 0; r < 3; ++r) | |
for (int c = 0; c < 3; ++c) { | |
if (!isfinitef_(dst->vals[r][c])) { | |
return false; | |
} | |
} | |
return true; | |
} | |
skcms_Matrix3x3 skcms_Matrix3x3_concat(const skcms_Matrix3x3* A, const skcms_Matrix3x3* B) { | |
skcms_Matrix3x3 m = { { { 0,0,0 },{ 0,0,0 },{ 0,0,0 } } }; | |
for (int r = 0; r < 3; r++) | |
for (int c = 0; c < 3; c++) { | |
m.vals[r][c] = A->vals[r][0] * B->vals[0][c] | |
+ A->vals[r][1] * B->vals[1][c] | |
+ A->vals[r][2] * B->vals[2][c]; | |
} | |
return m; | |
} | |
static float log2f_(float x) { | |
# 1362 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 1362 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
bits; | |
__builtin_memcpy(&bits, &x, sizeof(bits)); | |
float e = (float)bits * (1.0f / (1<<23)); | |
# 1368 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 1368 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
m_bits = (bits & 0x007fffff) | 0x3f000000; | |
float m; | |
__builtin_memcpy(&m, &m_bits, sizeof(m)); | |
return (e - 124.225514990f | |
- 1.498030302f*m | |
- 1.725879990f/(0.3520887068f + m)); | |
} | |
static float exp2f_(float x) { | |
float fract = x - floorf_(x); | |
float fbits = (1.0f * (1<<23)) * (x + 121.274057500f | |
- 1.490129070f*fract | |
+ 27.728023300f/(4.84252568f - fract)); | |
if (fbits > 0x7fffffff) { | |
return inf_.f; | |
} else if (fbits < | |
# 1385 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
(-0x7fffffff - 1) | |
# 1385 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
) { | |
return -inf_.f; | |
} | |
# 1388 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 1388 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
bits = ( | |
# 1388 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 1388 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)fbits; | |
__builtin_memcpy(&x, &bits, sizeof(x)); | |
return x; | |
} | |
float powf_(float x, float y) { | |
return (x == 0) || (x == 1) ? x | |
: exp2f_(log2f_(x) * y); | |
} | |
float skcms_TransferFunction_eval(const skcms_TransferFunction* tf, float x) { | |
float sign = x < 0 ? -1.0f : 1.0f; | |
x *= sign; | |
return sign * (x < tf->d ? tf->c * x + tf->f | |
: powf_(tf->a * x + tf->b, tf->g) + tf->e); | |
} | |
bool skcms_TransferFunction_invert(const skcms_TransferFunction* src, skcms_TransferFunction* dst) { | |
if (!tf_is_valid(src)) { | |
return false; | |
} | |
skcms_TransferFunction inv = {0,0,0,0,0,0,0}; | |
float d_l = src->c * src->d + src->f, | |
d_r = powf_(src->a * src->d + src->b, src->g) + src->e; | |
if (fabsf_(d_l - d_r) > 1/512.0f) { | |
return false; | |
} | |
inv.d = d_l; | |
if (inv.d > 0) { | |
inv.c = 1.0f/src->c; | |
inv.f = -src->f/src->c; | |
} | |
# 1452 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
float k = powf_(src->a, -src->g); | |
inv.g = 1.0f / src->g; | |
inv.a = k; | |
inv.b = -k * src->e; | |
inv.e = -src->b / src->a; | |
float s = powf_(src->a + src->b, src->g) + src->e; | |
inv.e = 1.0f - powf_(inv.a * s + inv.b, inv.g); | |
*dst = inv; | |
return tf_is_valid(dst); | |
} | |
# 1508 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
static float rg_nonlinear(float x, | |
const skcms_Curve* curve, | |
const skcms_TransferFunction* tf, | |
const float P[3], | |
float dfdP[3]) { | |
const float y = eval_curve(curve, x); | |
const float g = P[0], a = P[1], b = P[2], | |
c = tf->c, d = tf->d, f = tf->f; | |
const float Y = fmaxf_(a*y + b, 0.0f), | |
D = a*d + b; | |
# 1520 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
(static_cast<void>(0)) | |
# 1520 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
; | |
dfdP[0] = 0.69314718f*log2f_(Y)*powf_(Y, g) | |
- 0.69314718f*log2f_(D)*powf_(D, g); | |
dfdP[1] = y*g*powf_(Y, g-1) | |
- d*g*powf_(D, g-1); | |
dfdP[2] = g*powf_(Y, g-1) | |
- g*powf_(D, g-1); | |
const float f_inv = powf_(Y, g) | |
- powf_(D, g) | |
+ c*d + f; | |
return x - f_inv; | |
} | |
static bool gauss_newton_step(const skcms_Curve* curve, | |
const skcms_TransferFunction* tf, | |
float P[3], | |
float x0, float dx, int N) { | |
# 1574 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
skcms_Matrix3x3 lhs = {{ {0,0,0}, {0,0,0}, {0,0,0} }}; | |
skcms_Vector3 rhs = { {0,0,0} }; | |
for (int i = 0; i < N; i++) { | |
float x = x0 + i*dx; | |
float dfdP[3] = {0,0,0}; | |
float resid = rg_nonlinear(x,curve,tf,P, dfdP); | |
for (int r = 0; r < 3; r++) { | |
for (int c = 0; c < 3; c++) { | |
lhs.vals[r][c] += dfdP[r] * dfdP[c]; | |
} | |
rhs.vals[r] += dfdP[r] * resid; | |
} | |
} | |
for (int k = 0; k < 3; k++) { | |
if (lhs.vals[0][k]==0 && lhs.vals[1][k]==0 && lhs.vals[2][k]==0 && | |
lhs.vals[k][0]==0 && lhs.vals[k][1]==0 && lhs.vals[k][2]==0) { | |
lhs.vals[k][k] = 1; | |
} | |
} | |
skcms_Matrix3x3 lhs_inv; | |
if (!skcms_Matrix3x3_invert(&lhs, &lhs_inv)) { | |
return false; | |
} | |
skcms_Vector3 dP = mv_mul(&lhs_inv, &rhs); | |
P[0] += dP.vals[0]; | |
P[1] += dP.vals[1]; | |
P[2] += dP.vals[2]; | |
return isfinitef_(P[0]) && isfinitef_(P[1]) && isfinitef_(P[2]); | |
} | |
static bool fit_nonlinear(const skcms_Curve* curve, int L, int N, skcms_TransferFunction* tf) { | |
float P[3] = { tf->g, tf->a, tf->b }; | |
const float dx = 1.0f / (N-1); | |
for (int j = 0; j < 3 ; j++) { | |
if (P[1] < 0) { | |
return false; | |
} | |
if (P[1] * tf->d + P[2] < 0) { | |
P[2] = -P[1] * tf->d; | |
} | |
# 1635 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
(static_cast<void>(0)) | |
# 1636 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
; | |
if (!gauss_newton_step(curve, tf, | |
P, | |
L*dx, dx, N-L)) { | |
return false; | |
} | |
} | |
if (P[1] < 0) { | |
return false; | |
} | |
if (P[1] * tf->d + P[2] < 0) { | |
P[2] = -P[1] * tf->d; | |
} | |
tf->g = P[0]; | |
tf->a = P[1]; | |
tf->b = P[2]; | |
tf->e = tf->c*tf->d + tf->f | |
- powf_(tf->a*tf->d + tf->b, tf->g); | |
return true; | |
} | |
bool skcms_ApproximateCurve(const skcms_Curve* curve, | |
skcms_TransferFunction* approx, | |
float* max_error) { | |
if (!curve || !approx || !max_error) { | |
return false; | |
} | |
if (curve->table_entries == 0) { | |
return false; | |
} | |
if (curve->table_entries == 1 || curve->table_entries > ( | |
# 1673 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 1673 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
)0x7fffffff) { | |
return false; | |
} | |
int N = (int)curve->table_entries; | |
const float dx = 1.0f / (N - 1); | |
*max_error = inf_.f; | |
const float kTolerances[] = { 1.5f / 65535.0f, 1.0f / 512.0f }; | |
for (int t = 0; t < (int)(sizeof((kTolerances)) / sizeof(*(kTolerances))); t++) { | |
skcms_TransferFunction tf, | |
tf_inv; | |
tf.f = 0.0f; | |
int L = fit_linear(curve, N, kTolerances[t], &tf.c, &tf.d); | |
if (L == N) { | |
tf.g = 1; | |
tf.a = tf.c; | |
tf.b = tf.f; | |
tf.c = tf.d = tf.e = tf.f = 0; | |
} else if (L == N - 1) { | |
tf.g = 1; | |
tf.a = (eval_curve(curve, (N-1)*dx) - | |
eval_curve(curve, (N-2)*dx)) | |
/ dx; | |
tf.b = eval_curve(curve, (N-2)*dx) | |
- tf.a * (N-2)*dx; | |
tf.e = 0; | |
} else { | |
int mid = (L + N) / 2; | |
float mid_x = mid / (N - 1.0f); | |
float mid_y = eval_curve(curve, mid_x); | |
tf.g = log2f_(mid_y) / log2f_(mid_x);; | |
tf.a = 1; | |
tf.b = 0; | |
tf.e = tf.c*tf.d + tf.f | |
- powf_(tf.a*tf.d + tf.b, tf.g); | |
if (!skcms_TransferFunction_invert(&tf, &tf_inv) || | |
!fit_nonlinear(curve, L,N, &tf_inv)) { | |
continue; | |
} | |
if (!skcms_TransferFunction_invert(&tf_inv, &tf)) { | |
continue; | |
} | |
} | |
# 1737 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
if (!skcms_TransferFunction_invert(&tf, &tf_inv)) { | |
continue; | |
} | |
float err = max_roundtrip_error(curve, &tf_inv); | |
if (*max_error > err) { | |
*max_error = err; | |
*approx = tf; | |
} | |
} | |
return isfinitef_(*max_error); | |
} | |
typedef enum { | |
Op_load_a8, | |
Op_load_g8, | |
Op_load_8888_palette8, | |
Op_load_4444, | |
Op_load_565, | |
Op_load_888, | |
Op_load_8888, | |
Op_load_1010102, | |
Op_load_161616LE, | |
Op_load_16161616LE, | |
Op_load_161616BE, | |
Op_load_16161616BE, | |
Op_load_hhh, | |
Op_load_hhhh, | |
Op_load_fff, | |
Op_load_ffff, | |
Op_swap_rb, | |
Op_clamp, | |
Op_invert, | |
Op_force_opaque, | |
Op_premul, | |
Op_unpremul, | |
Op_matrix_3x3, | |
Op_matrix_3x4, | |
Op_lab_to_xyz, | |
Op_tf_r, | |
Op_tf_g, | |
Op_tf_b, | |
Op_tf_a, | |
Op_table_r, | |
Op_table_g, | |
Op_table_b, | |
Op_table_a, | |
Op_clut, | |
Op_store_a8, | |
Op_store_g8, | |
Op_store_4444, | |
Op_store_565, | |
Op_store_888, | |
Op_store_8888, | |
Op_store_1010102, | |
Op_store_161616LE, | |
Op_store_16161616LE, | |
Op_store_161616BE, | |
Op_store_16161616BE, | |
Op_store_hhh, | |
Op_store_hhhh, | |
Op_store_fff, | |
Op_store_ffff, | |
} Op; | |
template <int N, typename T> | |
struct VecHelper { typedef T __attribute__((vector_size(N*sizeof(T)))) V; }; | |
template <int N, typename T> using Vec = typename VecHelper<N,T>::V; | |
namespace baseline { | |
# 1851 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
using F = Vec<4,float>; | |
using I32 = Vec<4, | |
# 1852 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__int32_t | |
# 1852 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
>; | |
using U64 = Vec<4, | |
# 1853 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint64_t | |
# 1853 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
>; | |
using U32 = Vec<4, | |
# 1854 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint32_t | |
# 1854 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
>; | |
using U16 = Vec<4, | |
# 1855 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint16_t | |
# 1855 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
>; | |
using U8 = Vec<4, | |
# 1856 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
__uint8_t | |
# 1856 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
>; | |
# 1 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 1 | |
# 26 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
static constexpr F F0 = F() + 0.0f, | |
F1 = F() + 1.0f; | |
# 88 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
template <typename T, typename P> | |
static inline __attribute__((always_inline)) T load(const P* ptr) { | |
T val; | |
__builtin_memcpy(&val, ptr, sizeof(val)); | |
return val; | |
} | |
template <typename T, typename P> | |
static inline __attribute__((always_inline)) void store(P* ptr, const T& val) { | |
__builtin_memcpy(ptr, &val, sizeof(val)); | |
} | |
template <typename D, typename S> | |
static inline __attribute__((always_inline)) D cast(const S& v) { | |
return D{v[0],v[1],v[2],v[3]}; | |
} | |
template <typename D, typename S> | |
static inline __attribute__((always_inline)) D bit_pun(const S& v) { | |
static_assert(sizeof(D) == sizeof(v), ""); | |
return load<D>(&v); | |
} | |
static inline __attribute__((always_inline)) I32 to_fixed(F f) { return cast<I32>(f + 0.5f); } | |
template <typename T> | |
static inline __attribute__((always_inline)) T if_then_else(I32 cond, T t, T e) { | |
return bit_pun<T>( ( cond & bit_pun<I32>(t)) | | |
(~cond & bit_pun<I32>(e)) ); | |
} | |
static inline __attribute__((always_inline)) F F_from_Half(U16 half) { | |
# 147 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
U32 wide = cast<U32>(half); | |
U32 s = wide & 0x8000, | |
em = wide ^ s; | |
F norm = bit_pun<F>( (s<<16) + (em<<13) + ((127-15)<<23) ); | |
return if_then_else(em < 0x0400, F0, norm); | |
} | |
static inline __attribute__((always_inline)) U16 Half_from_F(F f) { | |
# 174 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
U32 sem = bit_pun<U32>(f), | |
s = sem & 0x80000000, | |
em = sem ^ s; | |
return cast<U16>(if_then_else(em < 0x38800000, (U32)F0 | |
, (s>>16) + (em>>13) - ((127-15)<<10))); | |
} | |
# 191 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
static inline __attribute__((always_inline)) U64 swap_endian_16x4(const U64& rgba) { | |
return (rgba & 0x00ff00ff00ff00ff) << 8 | |
| (rgba & 0xff00ff00ff00ff00) >> 8; | |
} | |
static inline __attribute__((always_inline)) F min_(F x, F y) { return if_then_else(x > y, y, x); } | |
static inline __attribute__((always_inline)) F max_(F x, F y) { return if_then_else(x < y, y, x); } | |
static inline __attribute__((always_inline)) F floor_(F x) { | |
# 217 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
F roundtrip = cast<F>(cast<I32>(x)); | |
return roundtrip - if_then_else(roundtrip > x, F1, F0); | |
} | |
static inline __attribute__((always_inline)) F approx_log2(F x) { | |
I32 bits = bit_pun<I32>(x); | |
F e = cast<F>(bits) * (1.0f / (1<<23)); | |
F m = bit_pun<F>( (bits & 0x007fffff) | 0x3f000000 ); | |
return e - 124.225514990f | |
- 1.498030302f*m | |
- 1.725879990f/(0.3520887068f + m); | |
} | |
static inline __attribute__((always_inline)) F approx_exp2(F x) { | |
F fract = x - floor_(x); | |
I32 bits = cast<I32>((1.0f * (1<<23)) * (x + 121.274057500f | |
- 1.490129070f*fract | |
+ 27.728023300f/(4.84252568f - fract))); | |
return bit_pun<F>(bits); | |
} | |
static inline __attribute__((always_inline)) F approx_pow(F x, float y) { | |
return if_then_else((x == F0) | (x == F1), x | |
, approx_exp2(approx_log2(x) * y)); | |
} | |
static inline __attribute__((always_inline)) F apply_tf(const skcms_TransferFunction* tf, F x) { | |
U32 bits = bit_pun<U32>(x), | |
sign = bits & 0x80000000; | |
x = bit_pun<F>(bits ^ sign); | |
F v = if_then_else(x < tf->d, tf->c*x + tf->f | |
, approx_pow(tf->a*x + tf->b, tf->g) + tf->e); | |
return bit_pun<F>(sign | bit_pun<U32>(v)); | |
} | |
template <typename T, typename P> | |
static inline __attribute__((always_inline)) T load_3(const P* p) { | |
return T{p[ 0],p[ 3],p[ 6],p[ 9]}; | |
} | |
template <typename T, typename P> | |
static inline __attribute__((always_inline)) T load_4(const P* p) { | |
return T{p[ 0],p[ 4],p[ 8],p[12]}; | |
} | |
template <typename T, typename P> | |
static inline __attribute__((always_inline)) void store_3(P* p, const T& v) { | |
p[ 0] = v[ 0]; p[ 3] = v[ 1]; p[ 6] = v[ 2]; p[ 9] = v[ 3]; | |
# 314 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
} | |
template <typename T, typename P> | |
static inline __attribute__((always_inline)) void store_4(P* p, const T& v) { | |
p[ 0] = v[ 0]; p[ 4] = v[ 1]; p[ 8] = v[ 2]; p[12] = v[ 3]; | |
# 331 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
} | |
static inline __attribute__((always_inline)) U8 gather_8(const | |
# 334 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 334 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* p, I32 ix) { | |
U8 v = { p[ix[0]], p[ix[1]], p[ix[2]], p[ix[3]] }; | |
# 348 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
return v; | |
} | |
static inline __attribute__((always_inline)) U16 gather_16(const | |
# 351 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 351 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* p, I32 ix) { | |
auto load_16 = [p](int i) { | |
return load< | |
# 354 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 354 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
>(p + 2*i); | |
}; | |
U16 v = { load_16(ix[0]), load_16(ix[1]), load_16(ix[2]), load_16(ix[3]) }; | |
# 369 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
return v; | |
} | |
static inline __attribute__((always_inline)) U32 gather_32(const | |
# 372 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 372 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* p, I32 ix) { | |
auto load_32 = [p](int i) { | |
return load< | |
# 375 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint32_t | |
# 375 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
>(p + 4*i); | |
}; | |
U32 v = { load_32(ix[0]), load_32(ix[1]), load_32(ix[2]), load_32(ix[3]) }; | |
# 391 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
return v; | |
} | |
static inline __attribute__((always_inline)) U32 gather_24(const | |
# 394 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 394 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* p, I32 ix) { | |
p -= 1; | |
auto load_24_32 = [p](int i) { | |
return load< | |
# 401 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint32_t | |
# 401 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
>(p + 3*i); | |
}; | |
U32 v = { load_24_32(ix[0]), load_24_32(ix[1]), load_24_32(ix[2]), load_24_32(ix[3]) }; | |
# 433 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
return v >> 8; | |
} | |
static inline __attribute__((always_inline)) void gather_48(const | |
# 437 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 437 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* p, I32 ix, U64* v) { | |
p -= 2; | |
auto load_48_64 = [p](int i) { | |
return load< | |
# 443 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint64_t | |
# 443 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
>(p + 6*i); | |
}; | |
*v = U64{ | |
load_48_64(ix[0]), load_48_64(ix[1]), load_48_64(ix[2]), load_48_64(ix[3]), | |
}; | |
# 491 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*v >>= 16; | |
} | |
static inline __attribute__((always_inline)) F F_from_U8(U8 v) { | |
return cast<F>(v) * (1/255.0f); | |
} | |
static inline __attribute__((always_inline)) F F_from_U16_BE(U16 v) { | |
v = (U16)( ((v<<8)|(v>>8)) & 0xffff ); | |
return cast<F>(v) * (1/65535.0f); | |
} | |
static inline __attribute__((always_inline)) F minus_1_ulp(F v) { | |
return bit_pun<F>( bit_pun<I32>(v) - 1 ); | |
} | |
static inline __attribute__((always_inline)) F table(const skcms_Curve* curve, F v) { | |
F ix = max_(F0, min_(v, F1)) * (float)(curve->table_entries - 1); | |
I32 lo = cast<I32>( ix ), | |
hi = cast<I32>(minus_1_ulp(ix+1.0f)); | |
F t = ix - cast<F>(lo); | |
F l,h; | |
if (curve->table_8) { | |
l = F_from_U8(gather_8(curve->table_8, lo)); | |
h = F_from_U8(gather_8(curve->table_8, hi)); | |
} else { | |
l = F_from_U16_BE(gather_16(curve->table_16, lo)); | |
h = F_from_U16_BE(gather_16(curve->table_16, hi)); | |
} | |
return l + (h-l)*t; | |
} | |
static inline __attribute__((always_inline)) void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) { | |
U32 rgb = gather_24(a2b->grid_8, ix); | |
*r = cast<F>((rgb >> 0) & 0xff) * (1/255.0f); | |
*g = cast<F>((rgb >> 8) & 0xff) * (1/255.0f); | |
*b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f); | |
} | |
static inline __attribute__((always_inline)) void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) { | |
U64 rgb; | |
gather_48(a2b->grid_16, ix, &rgb); | |
rgb = swap_endian_16x4(rgb); | |
*r = cast<F>((rgb >> 0) & 0xffff) * (1/65535.0f); | |
*g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f); | |
*b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f); | |
} | |
# 568 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
static void clut(const skcms_A2B* a2b, F* r, F* g, F* b, F a) { | |
const int dim = (int)a2b->input_channels; | |
# 571 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 571 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
I32 index [8]; | |
F weight[8]; | |
const F inputs[] = { *r,*g,*b,a }; | |
for (int i = dim-1, stride = 1; i >= 0; i--) { | |
F x = inputs[i] * (float)(a2b->grid_points[i] - 1); | |
I32 lo = cast<I32>( x ), | |
hi = cast<I32>(minus_1_ulp(x+1.0f)); | |
index[i+0] = lo * stride; | |
index[i+4] = hi * stride; | |
stride *= a2b->grid_points[i]; | |
F t = x - cast<F>(lo); | |
weight[i+0] = 1-t; | |
weight[i+4] = t; | |
} | |
*r = *g = *b = F0; | |
for (int combo = 0; combo < (1<<dim); combo++) { | |
I32 ix = index [0 + (combo&1)*4]; | |
F w = weight[0 + (combo&1)*4]; | |
switch ((dim-1)&3) { | |
case 3: ix += index [3 + (combo&8)/2]; | |
w *= weight[3 + (combo&8)/2]; | |
; | |
case 2: ix += index [2 + (combo&4)*1]; | |
w *= weight[2 + (combo&4)*1]; | |
; | |
case 1: ix += index [1 + (combo&2)*2]; | |
w *= weight[1 + (combo&2)*2]; | |
} | |
F R,G,B; | |
if (a2b->grid_8) { | |
sample_clut_8 (a2b,ix, &R,&G,&B); | |
} else { | |
sample_clut_16(a2b,ix, &R,&G,&B); | |
} | |
*r += w*R; | |
*g += w*G; | |
*b += w*B; | |
} | |
} | |
static void exec_ops(const Op* ops, const void** args, | |
const char* src, char* dst, int i) { | |
F r = F0, g = F0, b = F0, a = F1; | |
while (true) { | |
switch (*ops++) { | |
case Op_load_a8:{ | |
a = F_from_U8(load<U8>(src + 1*i)); | |
} break; | |
case Op_load_g8:{ | |
r = g = b = F_from_U8(load<U8>(src + 1*i)); | |
} break; | |
case Op_load_4444:{ | |
U16 abgr = load<U16>(src + 2*i); | |
r = cast<F>((abgr >> 12) & 0xf) * (1/15.0f); | |
g = cast<F>((abgr >> 8) & 0xf) * (1/15.0f); | |
b = cast<F>((abgr >> 4) & 0xf) * (1/15.0f); | |
a = cast<F>((abgr >> 0) & 0xf) * (1/15.0f); | |
} break; | |
case Op_load_565:{ | |
U16 rgb = load<U16>(src + 2*i); | |
r = cast<F>(rgb & ( | |
# 665 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 665 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(31<< 0)) * (1.0f / (31<< 0)); | |
g = cast<F>(rgb & ( | |
# 666 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 666 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(63<< 5)) * (1.0f / (63<< 5)); | |
b = cast<F>(rgb & ( | |
# 667 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 667 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(31<<11)) * (1.0f / (31<<11)); | |
} break; | |
case Op_load_888:{ | |
const | |
# 671 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 671 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = (const | |
# 671 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 671 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)(src + 3*i); | |
# 689 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
r = cast<F>(load_3<U32>(rgb+0) ) * (1/255.0f); | |
g = cast<F>(load_3<U32>(rgb+1) ) * (1/255.0f); | |
b = cast<F>(load_3<U32>(rgb+2) ) * (1/255.0f); | |
} break; | |
case Op_load_8888:{ | |
U32 rgba = load<U32>(src + 4*i); | |
r = cast<F>((rgba >> 0) & 0xff) * (1/255.0f); | |
g = cast<F>((rgba >> 8) & 0xff) * (1/255.0f); | |
b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f); | |
a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f); | |
} break; | |
case Op_load_8888_palette8:{ | |
const | |
# 705 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 705 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* palette = (const | |
# 705 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 705 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*) *args++; | |
I32 ix = cast<I32>(load<U8>(src + 1*i)); | |
U32 rgba = gather_32(palette, ix); | |
r = cast<F>((rgba >> 0) & 0xff) * (1/255.0f); | |
g = cast<F>((rgba >> 8) & 0xff) * (1/255.0f); | |
b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f); | |
a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f); | |
} break; | |
case Op_load_1010102:{ | |
U32 rgba = load<U32>(src + 4*i); | |
r = cast<F>((rgba >> 0) & 0x3ff) * (1/1023.0f); | |
g = cast<F>((rgba >> 10) & 0x3ff) * (1/1023.0f); | |
b = cast<F>((rgba >> 20) & 0x3ff) * (1/1023.0f); | |
a = cast<F>((rgba >> 30) & 0x3 ) * (1/ 3.0f); | |
} break; | |
case Op_load_161616LE:{ | |
# 725 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 725 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 725 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 725 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 6*i); | |
# 726 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 726 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const | |
# 727 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 727 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = (const | |
# 727 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 727 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f); | |
g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f); | |
b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f); | |
} break; | |
case Op_load_16161616LE:{ | |
# 741 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 741 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 741 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 741 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 8*i); | |
# 742 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 742 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const | |
# 743 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 743 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgba = (const | |
# 743 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 743 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
U64 px = load<U64>(rgba); | |
r = cast<F>((px >> 0) & 0xffff) * (1/65535.0f); | |
g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f); | |
b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f); | |
a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f); | |
} break; | |
case Op_load_161616BE:{ | |
# 761 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 761 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 761 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 761 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 6*i); | |
# 762 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 762 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const | |
# 763 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 763 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = (const | |
# 763 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 763 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
U32 R = load_3<U32>(rgb+0), | |
G = load_3<U32>(rgb+1), | |
B = load_3<U32>(rgb+2); | |
r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f); | |
g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f); | |
b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f); | |
} break; | |
case Op_load_16161616BE:{ | |
# 781 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 781 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 781 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 781 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 8*i); | |
# 782 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 782 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const | |
# 783 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 783 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgba = (const | |
# 783 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 783 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
U64 px = swap_endian_16x4(load<U64>(rgba)); | |
r = cast<F>((px >> 0) & 0xffff) * (1/65535.0f); | |
g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f); | |
b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f); | |
a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f); | |
} break; | |
case Op_load_hhh:{ | |
# 801 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 801 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 801 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 801 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 6*i); | |
# 802 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 802 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const | |
# 803 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 803 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = (const | |
# 803 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 803 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
U16 R = load_3<U16>(rgb+0), | |
G = load_3<U16>(rgb+1), | |
B = load_3<U16>(rgb+2); | |
r = F_from_Half(R); | |
g = F_from_Half(G); | |
b = F_from_Half(B); | |
} break; | |
case Op_load_hhhh:{ | |
# 820 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 820 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 820 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 820 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 8*i); | |
# 821 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 821 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const | |
# 822 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 822 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgba = (const | |
# 822 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 822 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
U64 px = load<U64>(rgba); | |
U16 R = cast<U16>((px >> 0) & 0xffff), | |
G = cast<U16>((px >> 16) & 0xffff), | |
B = cast<U16>((px >> 32) & 0xffff), | |
A = cast<U16>((px >> 48) & 0xffff); | |
r = F_from_Half(R); | |
g = F_from_Half(G); | |
b = F_from_Half(B); | |
a = F_from_Half(A); | |
} break; | |
case Op_load_fff:{ | |
# 843 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 843 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 843 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 843 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 12*i); | |
# 844 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 844 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const float* rgb = (const float*)ptr; | |
r = load_3<F>(rgb+0); | |
g = load_3<F>(rgb+1); | |
b = load_3<F>(rgb+2); | |
} break; | |
case Op_load_ffff:{ | |
# 859 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 859 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 859 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 859 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(src + 16*i); | |
# 860 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 860 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
const float* rgba = (const float*)ptr; | |
r = load_4<F>(rgba+0); | |
g = load_4<F>(rgba+1); | |
b = load_4<F>(rgba+2); | |
a = load_4<F>(rgba+3); | |
} break; | |
case Op_swap_rb:{ | |
F t = r; | |
r = b; | |
b = t; | |
} break; | |
case Op_clamp:{ | |
r = max_(F0, min_(r, F1)); | |
g = max_(F0, min_(g, F1)); | |
b = max_(F0, min_(b, F1)); | |
a = max_(F0, min_(a, F1)); | |
} break; | |
case Op_invert:{ | |
r = F1 - r; | |
g = F1 - g; | |
b = F1 - b; | |
a = F1 - a; | |
} break; | |
case Op_force_opaque:{ | |
a = F1; | |
} break; | |
case Op_premul:{ | |
r *= a; | |
g *= a; | |
b *= a; | |
} break; | |
case Op_unpremul:{ | |
F scale = if_then_else(F1 / a < inf_.f, F1 / a, F0); | |
r *= scale; | |
g *= scale; | |
b *= scale; | |
} break; | |
case Op_matrix_3x3:{ | |
const skcms_Matrix3x3* matrix = (const skcms_Matrix3x3*) *args++; | |
const float* m = &matrix->vals[0][0]; | |
F R = m[0]*r + m[1]*g + m[2]*b, | |
G = m[3]*r + m[4]*g + m[5]*b, | |
B = m[6]*r + m[7]*g + m[8]*b; | |
r = R; | |
g = G; | |
b = B; | |
} break; | |
case Op_matrix_3x4:{ | |
const skcms_Matrix3x4* matrix = (const skcms_Matrix3x4*) *args++; | |
const float* m = &matrix->vals[0][0]; | |
F R = m[0]*r + m[1]*g + m[ 2]*b + m[ 3], | |
G = m[4]*r + m[5]*g + m[ 6]*b + m[ 7], | |
B = m[8]*r + m[9]*g + m[10]*b + m[11]; | |
r = R; | |
g = G; | |
b = B; | |
} break; | |
case Op_lab_to_xyz:{ | |
F L = r * 100.0f, | |
A = g * 255.0f - 128.0f, | |
B = b * 255.0f - 128.0f; | |
F Y = (L + 16.0f) * (1/116.0f), | |
X = Y + A*(1/500.0f), | |
Z = Y - B*(1/200.0f); | |
X = if_then_else(X*X*X > 0.008856f, X*X*X, (X - (16/116.0f)) * (1/7.787f)); | |
Y = if_then_else(Y*Y*Y > 0.008856f, Y*Y*Y, (Y - (16/116.0f)) * (1/7.787f)); | |
Z = if_then_else(Z*Z*Z > 0.008856f, Z*Z*Z, (Z - (16/116.0f)) * (1/7.787f)); | |
r = X * 0.9642f; | |
g = Y ; | |
b = Z * 0.8249f; | |
} break; | |
case Op_tf_r:{ r = apply_tf((const skcms_TransferFunction*)*args++, r); } break; | |
case Op_tf_g:{ g = apply_tf((const skcms_TransferFunction*)*args++, g); } break; | |
case Op_tf_b:{ b = apply_tf((const skcms_TransferFunction*)*args++, b); } break; | |
case Op_tf_a:{ a = apply_tf((const skcms_TransferFunction*)*args++, a); } break; | |
case Op_table_r: { r = table((const skcms_Curve*)*args++, r); } break; | |
case Op_table_g: { g = table((const skcms_Curve*)*args++, g); } break; | |
case Op_table_b: { b = table((const skcms_Curve*)*args++, b); } break; | |
case Op_table_a: { a = table((const skcms_Curve*)*args++, a); } break; | |
case Op_clut: { | |
const skcms_A2B* a2b = (const skcms_A2B*) *args++; | |
clut(a2b, &r,&g,&b,a); | |
if (a2b->input_channels == 4) { | |
a = F1; | |
} | |
} break; | |
case Op_store_a8: { | |
store(dst + 1*i, cast<U8>(to_fixed(a * 255))); | |
} return; | |
case Op_store_g8: { | |
store(dst + 1*i, cast<U8>(to_fixed(g * 255))); | |
} return; | |
case Op_store_4444: { | |
store<U16>(dst + 2*i, cast<U16>(to_fixed(r * 15) << 12) | |
| cast<U16>(to_fixed(g * 15) << 8) | |
| cast<U16>(to_fixed(b * 15) << 4) | |
| cast<U16>(to_fixed(a * 15) << 0)); | |
} return; | |
case Op_store_565: { | |
store<U16>(dst + 2*i, cast<U16>(to_fixed(r * 31) << 0 ) | |
| cast<U16>(to_fixed(g * 63) << 5 ) | |
| cast<U16>(to_fixed(b * 31) << 11 )); | |
} return; | |
case Op_store_888: { | |
# 1005 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 1005 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = ( | |
# 1005 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint8_t | |
# 1005 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)dst + 3*i; | |
# 1020 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
store_3(rgb+0, cast<U8>(to_fixed(r * 255)) ); | |
store_3(rgb+1, cast<U8>(to_fixed(g * 255)) ); | |
store_3(rgb+2, cast<U8>(to_fixed(b * 255)) ); | |
} return; | |
case Op_store_8888: { | |
store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 0) | |
| cast<U32>(to_fixed(g * 255) << 8) | |
| cast<U32>(to_fixed(b * 255) << 16) | |
| cast<U32>(to_fixed(a * 255) << 24)); | |
} return; | |
case Op_store_1010102: { | |
store(dst + 4*i, cast<U32>(to_fixed(r * 1023) << 0) | |
| cast<U32>(to_fixed(g * 1023) << 10) | |
| cast<U32>(to_fixed(b * 1023) << 20) | |
| cast<U32>(to_fixed(a * 3) << 30)); | |
} return; | |
case Op_store_161616LE: { | |
# 1041 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1041 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1041 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1041 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 6*i); | |
# 1042 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1042 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
# 1043 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1043 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = ( | |
# 1043 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1043 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
# 1052 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
store_3(rgb+0, cast<U16>(to_fixed(r * 65535))); | |
store_3(rgb+1, cast<U16>(to_fixed(g * 65535))); | |
store_3(rgb+2, cast<U16>(to_fixed(b * 65535))); | |
} return; | |
case Op_store_16161616LE: { | |
# 1060 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1060 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1060 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1060 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 8*i); | |
# 1061 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1061 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
# 1062 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1062 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgba = ( | |
# 1062 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1062 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
# 1072 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
U64 px = cast<U64>(to_fixed(r * 65535)) << 0 | |
| cast<U64>(to_fixed(g * 65535)) << 16 | |
| cast<U64>(to_fixed(b * 65535)) << 32 | |
| cast<U64>(to_fixed(a * 65535)) << 48; | |
store(rgba, px); | |
} return; | |
case Op_store_161616BE: { | |
# 1081 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1081 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1081 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1081 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 6*i); | |
# 1082 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1082 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
# 1083 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1083 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = ( | |
# 1083 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1083 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
# 1092 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
I32 R = to_fixed(r * 65535), | |
G = to_fixed(g * 65535), | |
B = to_fixed(b * 65535); | |
store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) ); | |
store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) ); | |
store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) ); | |
} return; | |
case Op_store_16161616BE: { | |
# 1103 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1103 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1103 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1103 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 8*i); | |
# 1104 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1104 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
# 1105 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1105 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgba = ( | |
# 1105 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1105 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
# 1115 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
U64 px = cast<U64>(to_fixed(r * 65535)) << 0 | |
| cast<U64>(to_fixed(g * 65535)) << 16 | |
| cast<U64>(to_fixed(b * 65535)) << 32 | |
| cast<U64>(to_fixed(a * 65535)) << 48; | |
store(rgba, swap_endian_16x4(px)); | |
} return; | |
case Op_store_hhh: { | |
# 1124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1124 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 6*i); | |
# 1125 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1125 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
# 1126 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1126 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgb = ( | |
# 1126 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1126 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
U16 R = Half_from_F(r), | |
G = Half_from_F(g), | |
B = Half_from_F(b); | |
# 1139 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
store_3(rgb+0, R); | |
store_3(rgb+1, G); | |
store_3(rgb+2, B); | |
} return; | |
case Op_store_hhhh: { | |
# 1146 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1146 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1146 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1146 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 8*i); | |
# 1147 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1147 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
# 1148 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1148 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
* rgba = ( | |
# 1148 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uint16_t | |
# 1148 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
*)ptr; | |
U16 R = Half_from_F(r), | |
G = Half_from_F(g), | |
B = Half_from_F(b), | |
A = Half_from_F(a); | |
# 1163 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
store(rgba, cast<U64>(R) << 0 | |
| cast<U64>(G) << 16 | |
| cast<U64>(B) << 32 | |
| cast<U64>(A) << 48); | |
} return; | |
case Op_store_fff: { | |
# 1172 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1172 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1172 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1172 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 12*i); | |
# 1173 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1173 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
float* rgb = (float*)ptr; | |
# 1183 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
store_3(rgb+0, r); | |
store_3(rgb+1, g); | |
store_3(rgb+2, b); | |
} return; | |
case Op_store_ffff: { | |
# 1190 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1190 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
ptr = ( | |
# 1190 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
__uintptr_t | |
# 1190 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
)(dst + 16*i); | |
# 1191 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" 3 4 | |
(static_cast<void>(0)) | |
# 1191 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
; | |
float* rgba = (float*)ptr; | |
# 1202 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h" | |
store_4(rgba+0, r); | |
store_4(rgba+1, g); | |
store_4(rgba+2, b); | |
store_4(rgba+3, a); | |
} return; | |
} | |
} | |
} | |
static void run_program(const Op* program, const void** arguments, | |
const char* src, char* dst, int n, | |
const size_t src_bpp, const size_t dst_bpp) { | |
int i = 0; | |
while (n >= 4) { | |
exec_ops(program, arguments, src, dst, i); | |
i += 4; | |
n -= 4; | |
} | |
if (n > 0) { | |
char tmp[4*4*4] = {0}; | |
memcpy(tmp, (const char*)src + (size_t)i*src_bpp, (size_t)n*src_bpp); | |
exec_ops(program, arguments, tmp, tmp, 0); | |
memcpy((char*)dst + (size_t)i*dst_bpp, tmp, (size_t)n*dst_bpp); | |
} | |
} | |
# 1860 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 2 | |
} | |
# 1944 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
static bool is_identity_tf(const skcms_TransferFunction* tf) { | |
return tf->g == 1 && tf->a == 1 | |
&& tf->b == 0 && tf->c == 0 && tf->d == 0 && tf->e == 0 && tf->f == 0; | |
} | |
typedef struct { | |
Op op; | |
const void* arg; | |
} OpAndArg; | |
static OpAndArg select_curve_op(const skcms_Curve* curve, int channel) { | |
static const struct { Op parametric, table; } ops[] = { | |
{ Op_tf_r, Op_table_r }, | |
{ Op_tf_g, Op_table_g }, | |
{ Op_tf_b, Op_table_b }, | |
{ Op_tf_a, Op_table_a }, | |
}; | |
const OpAndArg noop = { Op_load_a8 , nullptr }; | |
if (curve->table_entries == 0) { | |
return is_identity_tf(&curve->parametric) | |
? noop | |
: OpAndArg{ ops[channel].parametric, &curve->parametric }; | |
} | |
return OpAndArg{ ops[channel].table, curve }; | |
} | |
static size_t bytes_per_pixel(skcms_PixelFormat fmt) { | |
switch (fmt >> 1) { | |
case skcms_PixelFormat_A_8 >> 1: return 1; | |
case skcms_PixelFormat_G_8 >> 1: return 1; | |
case skcms_PixelFormat_RGBA_8888_Palette8 >> 1: return 1; | |
case skcms_PixelFormat_ABGR_4444 >> 1: return 2; | |
case skcms_PixelFormat_RGB_565 >> 1: return 2; | |
case skcms_PixelFormat_RGB_888 >> 1: return 3; | |
case skcms_PixelFormat_RGBA_8888 >> 1: return 4; | |
case skcms_PixelFormat_RGBA_1010102 >> 1: return 4; | |
case skcms_PixelFormat_RGB_161616LE >> 1: return 6; | |
case skcms_PixelFormat_RGBA_16161616LE >> 1: return 8; | |
case skcms_PixelFormat_RGB_161616BE >> 1: return 6; | |
case skcms_PixelFormat_RGBA_16161616BE >> 1: return 8; | |
case skcms_PixelFormat_RGB_hhh >> 1: return 6; | |
case skcms_PixelFormat_RGBA_hhhh >> 1: return 8; | |
case skcms_PixelFormat_RGB_fff >> 1: return 12; | |
case skcms_PixelFormat_RGBA_ffff >> 1: return 16; | |
} | |
# 1992 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
(static_cast<void>(0)) | |
# 1992 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
; | |
return 0; | |
} | |
static bool prep_for_destination(const skcms_ICCProfile* profile, | |
skcms_Matrix3x3* fromXYZD50, | |
skcms_TransferFunction* invR, | |
skcms_TransferFunction* invG, | |
skcms_TransferFunction* invB) { | |
return profile->has_trc | |
&& profile->has_toXYZD50 | |
&& profile->trc[0].table_entries == 0 | |
&& profile->trc[1].table_entries == 0 | |
&& profile->trc[2].table_entries == 0 | |
&& skcms_TransferFunction_invert(&profile->trc[0].parametric, invR) | |
&& skcms_TransferFunction_invert(&profile->trc[1].parametric, invG) | |
&& skcms_TransferFunction_invert(&profile->trc[2].parametric, invB) | |
&& skcms_Matrix3x3_invert(&profile->toXYZD50, fromXYZD50); | |
} | |
bool skcms_Transform(const void* src, | |
skcms_PixelFormat srcFmt, | |
skcms_AlphaFormat srcAlpha, | |
const skcms_ICCProfile* srcProfile, | |
void* dst, | |
skcms_PixelFormat dstFmt, | |
skcms_AlphaFormat dstAlpha, | |
const skcms_ICCProfile* dstProfile, | |
size_t npixels) { | |
return skcms_TransformWithPalette(src, srcFmt, srcAlpha, srcProfile, | |
dst, dstFmt, dstAlpha, dstProfile, | |
npixels, nullptr); | |
} | |
bool skcms_TransformWithPalette(const void* src, | |
skcms_PixelFormat srcFmt, | |
skcms_AlphaFormat srcAlpha, | |
const skcms_ICCProfile* srcProfile, | |
void* dst, | |
skcms_PixelFormat dstFmt, | |
skcms_AlphaFormat dstAlpha, | |
const skcms_ICCProfile* dstProfile, | |
size_t nz, | |
const void* palette) { | |
const size_t dst_bpp = bytes_per_pixel(dstFmt), | |
src_bpp = bytes_per_pixel(srcFmt); | |
if (nz * dst_bpp > 0x7fffffff || nz * src_bpp > 0x7fffffff) { | |
return false; | |
} | |
int n = (int)nz; | |
if (!srcProfile) { | |
srcProfile = skcms_sRGB_profile(); | |
} | |
if (!dstProfile) { | |
dstProfile = skcms_sRGB_profile(); | |
} | |
if (dst == src && dst_bpp != src_bpp) { | |
return false; | |
} | |
if (needs_palette(srcFmt) && !palette) { | |
return false; | |
} | |
Op program [32]; | |
const void* arguments[32]; | |
Op* ops = program; | |
const void** args = arguments; | |
skcms_TransferFunction inv_dst_tf_r, inv_dst_tf_g, inv_dst_tf_b; | |
skcms_Matrix3x3 from_xyz; | |
switch (srcFmt >> 1) { | |
default: return false; | |
case skcms_PixelFormat_A_8 >> 1: *ops++ = Op_load_a8; break; | |
case skcms_PixelFormat_G_8 >> 1: *ops++ = Op_load_g8; break; | |
case skcms_PixelFormat_ABGR_4444 >> 1: *ops++ = Op_load_4444; break; | |
case skcms_PixelFormat_RGB_565 >> 1: *ops++ = Op_load_565; break; | |
case skcms_PixelFormat_RGB_888 >> 1: *ops++ = Op_load_888; break; | |
case skcms_PixelFormat_RGBA_8888 >> 1: *ops++ = Op_load_8888; break; | |
case skcms_PixelFormat_RGBA_1010102 >> 1: *ops++ = Op_load_1010102; break; | |
case skcms_PixelFormat_RGB_161616LE >> 1: *ops++ = Op_load_161616LE; break; | |
case skcms_PixelFormat_RGBA_16161616LE >> 1: *ops++ = Op_load_16161616LE; break; | |
case skcms_PixelFormat_RGB_161616BE >> 1: *ops++ = Op_load_161616BE; break; | |
case skcms_PixelFormat_RGBA_16161616BE >> 1: *ops++ = Op_load_16161616BE; break; | |
case skcms_PixelFormat_RGB_hhh >> 1: *ops++ = Op_load_hhh; break; | |
case skcms_PixelFormat_RGBA_hhhh >> 1: *ops++ = Op_load_hhhh; break; | |
case skcms_PixelFormat_RGB_fff >> 1: *ops++ = Op_load_fff; break; | |
case skcms_PixelFormat_RGBA_ffff >> 1: *ops++ = Op_load_ffff; break; | |
case skcms_PixelFormat_RGBA_8888_Palette8 >> 1: *ops++ = Op_load_8888_palette8; | |
*args++ = palette; | |
break; | |
} | |
if (srcFmt & 1) { | |
*ops++ = Op_swap_rb; | |
} | |
skcms_ICCProfile gray_dst_profile; | |
if ((dstFmt >> 1) == (skcms_PixelFormat_G_8 >> 1)) { | |
gray_dst_profile = *dstProfile; | |
skcms_SetXYZD50(&gray_dst_profile, &skcms_XYZD50_profile()->toXYZD50); | |
dstProfile = &gray_dst_profile; | |
} | |
if (srcProfile->data_color_space == skcms_Signature_CMYK) { | |
*ops++ = Op_invert; | |
srcAlpha = skcms_AlphaFormat_Unpremul; | |
} | |
if (srcAlpha == skcms_AlphaFormat_Opaque) { | |
*ops++ = Op_force_opaque; | |
} else if (srcAlpha == skcms_AlphaFormat_PremulAsEncoded) { | |
*ops++ = Op_unpremul; | |
} | |
if (dstProfile != srcProfile) { | |
if (!prep_for_destination(dstProfile, | |
&from_xyz, &inv_dst_tf_r, &inv_dst_tf_b, &inv_dst_tf_g)) { | |
return false; | |
} | |
if (srcProfile->has_A2B) { | |
if (srcProfile->A2B.input_channels) { | |
for (int i = 0; i < (int)srcProfile->A2B.input_channels; i++) { | |
OpAndArg oa = select_curve_op(&srcProfile->A2B.input_curves[i], i); | |
if (oa.arg) { | |
*ops++ = oa.op; | |
*args++ = oa.arg; | |
} | |
} | |
*ops++ = Op_clamp; | |
*ops++ = Op_clut; | |
*args++ = &srcProfile->A2B; | |
} | |
if (srcProfile->A2B.matrix_channels == 3) { | |
for (int i = 0; i < 3; i++) { | |
OpAndArg oa = select_curve_op(&srcProfile->A2B.matrix_curves[i], i); | |
if (oa.arg) { | |
*ops++ = oa.op; | |
*args++ = oa.arg; | |
} | |
} | |
static const skcms_Matrix3x4 I = {{ | |
{1,0,0,0}, | |
{0,1,0,0}, | |
{0,0,1,0}, | |
}}; | |
if (0 != memcmp(&I, &srcProfile->A2B.matrix, sizeof(I))) { | |
*ops++ = Op_matrix_3x4; | |
*args++ = &srcProfile->A2B.matrix; | |
} | |
} | |
if (srcProfile->A2B.output_channels == 3) { | |
for (int i = 0; i < 3; i++) { | |
OpAndArg oa = select_curve_op(&srcProfile->A2B.output_curves[i], i); | |
if (oa.arg) { | |
*ops++ = oa.op; | |
*args++ = oa.arg; | |
} | |
} | |
} | |
if (srcProfile->pcs == skcms_Signature_Lab) { | |
*ops++ = Op_lab_to_xyz; | |
} | |
} else if (srcProfile->has_trc && srcProfile->has_toXYZD50) { | |
for (int i = 0; i < 3; i++) { | |
OpAndArg oa = select_curve_op(&srcProfile->trc[i], i); | |
if (oa.arg) { | |
*ops++ = oa.op; | |
*args++ = oa.arg; | |
} | |
} | |
} else { | |
return false; | |
} | |
# 2192 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" 3 4 | |
(static_cast<void>(0)) | |
# 2192 "/r/cvs/netbsd/pkgsrc/www/firefox/work.i386/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc" | |
; | |
static const skcms_Matrix3x3 I = {{ | |
{ 1.0f, 0.0f, 0.0f }, | |
{ 0.0f, 1.0f, 0.0f }, | |
{ 0.0f, 0.0f, 1.0f }, | |
}}; | |
const skcms_Matrix3x3* to_xyz = srcProfile->has_A2B ? &I : &srcProfile->toXYZD50; | |
if (0 != memcmp(&dstProfile->toXYZD50, to_xyz, sizeof(skcms_Matrix3x3))) { | |
from_xyz = skcms_Matrix3x3_concat(&from_xyz, to_xyz); | |
*ops++ = Op_matrix_3x3; | |
*args++ = &from_xyz; | |
} | |
if (!is_identity_tf(&inv_dst_tf_r)) { *ops++ = Op_tf_r; *args++ = &inv_dst_tf_r; } | |
if (!is_identity_tf(&inv_dst_tf_g)) { *ops++ = Op_tf_g; *args++ = &inv_dst_tf_g; } | |
if (!is_identity_tf(&inv_dst_tf_b)) { *ops++ = Op_tf_b; *args++ = &inv_dst_tf_b; } | |
} | |
if (dstFmt < skcms_PixelFormat_RGB_hhh) { | |
*ops++ = Op_clamp; | |
} | |
if (dstAlpha == skcms_AlphaFormat_Opaque) { | |
*ops++ = Op_force_opaque; | |
} else if (dstAlpha == skcms_AlphaFormat_PremulAsEncoded) { | |
*ops++ = Op_premul; | |
} | |
if (dstFmt & 1) { | |
*ops++ = Op_swap_rb; | |
} | |
switch (dstFmt >> 1) { | |
default: return false; | |
case skcms_PixelFormat_A_8 >> 1: *ops++ = Op_store_a8; break; | |
case skcms_PixelFormat_G_8 >> 1: *ops++ = Op_store_g8; break; | |
case skcms_PixelFormat_ABGR_4444 >> 1: *ops++ = Op_store_4444; break; | |
case skcms_PixelFormat_RGB_565 >> 1: *ops++ = Op_store_565; break; | |
case skcms_PixelFormat_RGB_888 >> 1: *ops++ = Op_store_888; break; | |
case skcms_PixelFormat_RGBA_8888 >> 1: *ops++ = Op_store_8888; break; | |
case skcms_PixelFormat_RGBA_1010102 >> 1: *ops++ = Op_store_1010102; break; | |
case skcms_PixelFormat_RGB_161616LE >> 1: *ops++ = Op_store_161616LE; break; | |
case skcms_PixelFormat_RGBA_16161616LE >> 1: *ops++ = Op_store_16161616LE; break; | |
case skcms_PixelFormat_RGB_161616BE >> 1: *ops++ = Op_store_161616BE; break; | |
case skcms_PixelFormat_RGBA_16161616BE >> 1: *ops++ = Op_store_16161616BE; break; | |
case skcms_PixelFormat_RGB_hhh >> 1: *ops++ = Op_store_hhh; break; | |
case skcms_PixelFormat_RGBA_hhhh >> 1: *ops++ = Op_store_hhhh; break; | |
case skcms_PixelFormat_RGB_fff >> 1: *ops++ = Op_store_fff; break; | |
case skcms_PixelFormat_RGBA_ffff >> 1: *ops++ = Op_store_ffff; break; | |
} | |
auto run = baseline::run_program; | |
run(program, arguments, (const char*)src, (char*)dst, n, src_bpp,dst_bpp); | |
return true; | |
} | |
static void assert_usable_as_destination(const skcms_ICCProfile* profile) { | |
(void)profile; | |
} | |
bool skcms_MakeUsableAsDestination(skcms_ICCProfile* profile) { | |
skcms_Matrix3x3 fromXYZD50; | |
if (!profile->has_trc || !profile->has_toXYZD50 | |
|| !skcms_Matrix3x3_invert(&profile->toXYZD50, &fromXYZD50)) { | |
return false; | |
} | |
skcms_TransferFunction tf[3]; | |
for (int i = 0; i < 3; i++) { | |
skcms_TransferFunction inv; | |
if (profile->trc[i].table_entries == 0 | |
&& skcms_TransferFunction_invert(&profile->trc[i].parametric, &inv)) { | |
tf[i] = profile->trc[i].parametric; | |
continue; | |
} | |
float max_error; | |
if (!skcms_ApproximateCurve(&profile->trc[i], &tf[i], &max_error)) { | |
return false; | |
} | |
} | |
for (int i = 0; i < 3; ++i) { | |
profile->trc[i].table_entries = 0; | |
profile->trc[i].parametric = tf[i]; | |
} | |
assert_usable_as_destination(profile); | |
return true; | |
} | |
bool skcms_MakeUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile) { | |
skcms_ICCProfile result = *profile; | |
if (!skcms_MakeUsableAsDestination(&result)) { | |
return false; | |
} | |
int best_tf = 0; | |
float min_max_error = inf_.f; | |
for (int i = 0; i < 3; i++) { | |
skcms_TransferFunction inv; | |
if (!skcms_TransferFunction_invert(&result.trc[i].parametric, &inv)) { | |
return false; | |
} | |
float err = 0; | |
for (int j = 0; j < 3; ++j) { | |
err = fmaxf_(err, max_roundtrip_error(&profile->trc[j], &inv)); | |
} | |
if (min_max_error > err) { | |
min_max_error = err; | |
best_tf = i; | |
} | |
} | |
for (int i = 0; i < 3; i++) { | |
result.trc[i].parametric = result.trc[best_tf].parametric; | |
} | |
*profile = result; | |
assert_usable_as_destination(profile); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment