mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-29 22:10:27 +00:00
Improve documentation
The Cosmo API documentation page is pretty good now https://justine.lol/cosmopolitan/documentation.html
This commit is contained in:
parent
13437dd19b
commit
1bc3a25505
367 changed files with 2542 additions and 26178 deletions
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "dsp/core/core.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/hefty/spawn.h"
|
||||
#include "libc/calls/ioctl.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "dsp/tty/tty.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/termios.h"
|
||||
#include "libc/log/check.h"
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/avir/lanczos.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/stb/stb_image.h"
|
||||
#include "third_party/stb/stb_image_resize.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/limits.h"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/str/str.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "tool/viz/lib/formatstringtable.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "tool/viz/lib/formatstringtable.h"
|
||||
|
||||
|
|
33
tool/viz/lib/knobs.c
Normal file
33
tool/viz/lib/knobs.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2020 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ This program is free software; you can redistribute it and/or modify │
|
||||
│ it under the terms of the GNU General Public License as published by │
|
||||
│ the Free Software Foundation; version 2 of the License. │
|
||||
│ │
|
||||
│ This program is distributed in the hope that it will be useful, but │
|
||||
│ WITHOUT ANY WARRANTY; without even the implied warranty of │
|
||||
│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU │
|
||||
│ General Public License for more details. │
|
||||
│ │
|
||||
│ You should have received a copy of the GNU General Public License │
|
||||
│ along with this program; if not, write to the Free Software │
|
||||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "tool/viz/lib/knobs.h"
|
||||
|
||||
bool pf1_;
|
||||
bool pf2_;
|
||||
bool pf3_;
|
||||
bool pf4_;
|
||||
bool pf5_;
|
||||
bool pf6_;
|
||||
bool pf7_;
|
||||
bool pf8_;
|
||||
bool pf9_;
|
||||
bool pf10_;
|
||||
bool pf11_;
|
||||
bool pf12_;
|
|
@ -46,7 +46,6 @@ TOOL_VIZ_LIB_A_DIRECTDEPS = \
|
|||
LIBC_TINYMATH \
|
||||
LIBC_UNICODE \
|
||||
LIBC_X \
|
||||
THIRD_PARTY_AVIR \
|
||||
THIRD_PARTY_GDTOA \
|
||||
THIRD_PARTY_DLMALLOC
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/avir/lanczos.h"
|
||||
#include "tool/viz/lib/graphic.h"
|
||||
#include "tool/viz/lib/knobs.h"
|
||||
#include "tool/viz/lib/ycbcr.h"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "dsp/scale/scale.h"
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/popcnt.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/bits/xchg.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/ioctl.h"
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/avir/lanczos1b.h"
|
||||
#include "third_party/avir/lanczos1f.h"
|
||||
#include "third_party/gdtoa/gdtoa.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/stb/stb_image.h"
|
||||
|
@ -590,34 +588,6 @@ void ProcessImageMagikarp(unsigned yn, unsigned xn,
|
|||
yn, xn, lround(r_));
|
||||
}
|
||||
|
||||
void *ProcessImageLanczosImpl(unsigned dyn, unsigned dxn,
|
||||
float dst[4][dyn][dxn], unsigned syn,
|
||||
unsigned sxn, float src[4][syn][sxn]) {
|
||||
unsigned k;
|
||||
struct lanczos1f scaler = {0};
|
||||
lanczos1finit(&scaler);
|
||||
for (k = 0; k < 4; ++k) {
|
||||
lanczos1f(&scaler, dyn, dxn, dst[k], syn, sxn, sxn, src[k], r_, r_, 0, 0);
|
||||
}
|
||||
lanczos1ffree(&scaler);
|
||||
return dst;
|
||||
}
|
||||
|
||||
void ProcessImageLanczos(unsigned yn, unsigned xn,
|
||||
unsigned char img[yn][xn][4]) {
|
||||
unsigned dyn, dxn;
|
||||
dyn = lround(yn / r_);
|
||||
dxn = lround(xn / r_);
|
||||
PrintImage2(
|
||||
dyn, dxn,
|
||||
f2b(dyn * dxn * 4, gc(xmalloc(dyn * dxn * 4)),
|
||||
ProcessImageLanczosImpl(
|
||||
dyn, dxn, gc(xmalloc(dyn * dxn * 4 * 4)), yn, xn,
|
||||
b2f(yn * xn * 4, gc(xmalloc(yn * xn * 4 * 4)),
|
||||
DeblinterlaceRgba2(yn, xn, gc(xmalloc(yn * xn * 4)), img)))),
|
||||
dyn, dxn);
|
||||
}
|
||||
|
||||
noinline void WithImageFile(const char *path,
|
||||
void fn(unsigned yn, unsigned xn,
|
||||
unsigned char img[yn][xn][4])) {
|
||||
|
@ -658,9 +628,6 @@ int main(int argc, char *argv[]) {
|
|||
case 'S':
|
||||
scaler = ProcessImageGyarados;
|
||||
break;
|
||||
case 'l':
|
||||
scaler = ProcessImageLanczos;
|
||||
break;
|
||||
case 'b':
|
||||
scaler = ProcessImageBilinear;
|
||||
break;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/hilbert.h"
|
||||
#include "libc/bits/morton.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/ioctl.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "dsp/tty/tty.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/ioctl.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/dce.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "libc/alg/arraylist.internal.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/bits/xchg.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/hefty/spawn.h"
|
||||
|
@ -94,7 +94,6 @@
|
|||
#include "libc/time/time.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/avir/lanczos.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/stb/stb_image_resize.h"
|
||||
#include "tool/viz/lib/graphic.h"
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "third_party/avir/resize.h"
|
||||
#include "third_party/zlib/zlib.h"
|
||||
|
||||
void ProcessFile(const char *path) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/alg/arraylist.internal.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/log/check.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/macros.h"
|
||||
|
|
|
@ -48,7 +48,6 @@ TOOL_VIZ_DIRECTDEPS = \
|
|||
LIBC_UNICODE \
|
||||
LIBC_X \
|
||||
NET_HTTP \
|
||||
THIRD_PARTY_AVIR \
|
||||
THIRD_PARTY_DLMALLOC \
|
||||
THIRD_PARTY_GDTOA \
|
||||
THIRD_PARTY_GETOPT \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue