Improve documentation

The Cosmo API documentation page is pretty good now
https://justine.lol/cosmopolitan/documentation.html
This commit is contained in:
Justine Tunney 2020-12-27 07:02:35 -08:00
parent 13437dd19b
commit 1bc3a25505
367 changed files with 2542 additions and 26178 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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
View 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_;

View file

@ -46,7 +46,6 @@ TOOL_VIZ_LIB_A_DIRECTDEPS = \
LIBC_TINYMATH \
LIBC_UNICODE \
LIBC_X \
THIRD_PARTY_AVIR \
THIRD_PARTY_GDTOA \
THIRD_PARTY_DLMALLOC

View file

@ -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"

View file

@ -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"

View file

@ -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;

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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) {

View file

@ -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"

View file

@ -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"

View file

@ -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 \