├── .coveralls.yml ├── .gitignore ├── .travis.yml ├── ChangeLog ├── LICENSE ├── LICENSE.images ├── LICENSE.mesa ├── LICENSE.pngsuite ├── LICENSE.pnmcolormap ├── LICENSE.sdump ├── LICENSE.sixel ├── LICENSE.stb ├── Makefile.am ├── Makefile.in ├── NEWS ├── README.md ├── aclocal.m4 ├── compile ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── converters ├── Makefile.am ├── Makefile.in ├── img2sixel.1 ├── img2sixel.c ├── malloc_stub.c ├── malloc_stub.h ├── shell-completion │ ├── bash │ │ └── img2sixel │ └── zsh │ │ └── _img2sixel ├── sixel2png.1 └── sixel2png.c ├── depcomp ├── examples ├── drawing │ ├── Makefile │ ├── README.md │ └── main.c ├── opengl │ ├── Makefile.am │ ├── Makefile.in │ ├── README.md │ ├── aclocal.m4 │ ├── compile │ ├── config.guess │ ├── config.h.in │ ├── config.sub │ ├── configure │ ├── configure.ac │ ├── depcomp │ ├── install-sh │ ├── main.c │ └── missing └── python │ ├── Makefile │ ├── README.md │ └── converter.py ├── images ├── egret.jpg ├── map16-palette.png ├── map16.png ├── map8-palette.png ├── map8.png ├── map8.six ├── pngsuite │ ├── background │ │ ├── bgai4a08.png │ │ ├── bgai4a16.png │ │ ├── bgan6a08.png │ │ ├── bgan6a16.png │ │ ├── bgbn4a08.png │ │ ├── bggn4a16.png │ │ ├── bgwn6a08.png │ │ └── bgyn6a16.png │ ├── basic │ │ ├── basn0g01.png │ │ ├── basn0g02.png │ │ ├── basn0g04.png │ │ ├── basn0g08.png │ │ ├── basn0g16.png │ │ ├── basn2c08.png │ │ ├── basn2c16.png │ │ ├── basn3p01.png │ │ ├── basn3p02.png │ │ ├── basn3p04.png │ │ ├── basn3p08.png │ │ ├── basn4a08.png │ │ ├── basn4a16.png │ │ ├── basn6a08.png │ │ └── basn6a16.png │ ├── chunk │ │ ├── ccwn2c08.png │ │ ├── ccwn3p08.png │ │ ├── cdfn2c08.png │ │ ├── cdhn2c08.png │ │ ├── cdsn2c08.png │ │ ├── cdun2c08.png │ │ ├── ch1n3p04.png │ │ ├── ch2n3p08.png │ │ ├── cm0n0g04.png │ │ ├── cm7n0g04.png │ │ ├── cm9n0g04.png │ │ ├── cs3n2c16.png │ │ ├── cs3n3p08.png │ │ ├── cs5n2c08.png │ │ ├── cs5n3p08.png │ │ ├── cs8n2c08.png │ │ ├── cs8n3p08.png │ │ ├── ct0n0g04.png │ │ ├── ct1n0g04.png │ │ ├── cten0g04.png │ │ ├── ctfn0g04.png │ │ ├── ctgn0g04.png │ │ ├── cthn0g04.png │ │ ├── ctjn0g04.png │ │ └── ctzn0g04.png │ ├── corrupted │ │ ├── xc1n0g08.png │ │ ├── xc9n2c08.png │ │ ├── xcrn0g04.png │ │ ├── xcsn0g01.png │ │ ├── xd0n2c08.png │ │ ├── xd3n2c08.png │ │ ├── xd9n2c08.png │ │ ├── xdtn0g01.png │ │ ├── xhdn0g08.png │ │ ├── xlfn0g04.png │ │ ├── xs1n0g01.png │ │ ├── xs2n0g01.png │ │ ├── xs4n0g01.png │ │ └── xs7n0g01.png │ ├── filter │ │ ├── f00n0g08.png │ │ ├── f00n2c08.png │ │ ├── f01n0g08.png │ │ ├── f01n2c08.png │ │ ├── f02n0g08.png │ │ ├── f02n2c08.png │ │ ├── f03n0g08.png │ │ ├── f03n2c08.png │ │ ├── f04n0g08.png │ │ ├── f04n2c08.png │ │ └── f99n0g04.png │ ├── gamma │ │ ├── g03n0g16.png │ │ ├── g03n2c08.png │ │ ├── g03n3p04.png │ │ ├── g04n0g16.png │ │ ├── g04n2c08.png │ │ ├── g04n3p04.png │ │ ├── g05n0g16.png │ │ ├── g05n2c08.png │ │ ├── g05n3p04.png │ │ ├── g07n0g16.png │ │ ├── g07n2c08.png │ │ ├── g07n3p04.png │ │ ├── g10n0g16.png │ │ ├── g10n2c08.png │ │ ├── g10n3p04.png │ │ ├── g25n0g16.png │ │ ├── g25n2c08.png │ │ └── g25n3p04.png │ ├── interlacing │ │ ├── basi0g01.png │ │ ├── basi0g02.png │ │ ├── basi0g04.png │ │ ├── basi0g08.png │ │ ├── basi0g16.png │ │ ├── basi2c08.png │ │ ├── basi2c16.png │ │ ├── basi3p01.png │ │ ├── basi3p02.png │ │ ├── basi3p04.png │ │ ├── basi3p08.png │ │ ├── basi4a08.png │ │ ├── basi4a16.png │ │ ├── basi6a08.png │ │ └── basi6a16.png │ ├── odd │ │ ├── s01i3p01.png │ │ ├── s01n3p01.png │ │ ├── s02i3p01.png │ │ ├── s02n3p01.png │ │ ├── s03i3p01.png │ │ ├── s03n3p01.png │ │ ├── s04i3p01.png │ │ ├── s04n3p01.png │ │ ├── s05i3p02.png │ │ ├── s05n3p02.png │ │ ├── s06i3p02.png │ │ ├── s06n3p02.png │ │ ├── s07i3p02.png │ │ ├── s07n3p02.png │ │ ├── s08i3p02.png │ │ ├── s08n3p02.png │ │ ├── s09i3p02.png │ │ ├── s09n3p02.png │ │ ├── s32i3p04.png │ │ ├── s32n3p04.png │ │ ├── s33i3p04.png │ │ ├── s33n3p04.png │ │ ├── s34i3p04.png │ │ ├── s34n3p04.png │ │ ├── s35i3p04.png │ │ ├── s35n3p04.png │ │ ├── s36i3p04.png │ │ ├── s36n3p04.png │ │ ├── s37i3p04.png │ │ ├── s37n3p04.png │ │ ├── s38i3p04.png │ │ ├── s38n3p04.png │ │ ├── s39i3p04.png │ │ ├── s39n3p04.png │ │ ├── s40i3p04.png │ │ └── s40n3p04.png │ ├── order │ │ ├── oi1n0g16.png │ │ ├── oi1n2c16.png │ │ ├── oi2n0g16.png │ │ ├── oi2n2c16.png │ │ ├── oi4n0g16.png │ │ ├── oi4n2c16.png │ │ ├── oi9n0g16.png │ │ └── oi9n2c16.png │ ├── palette │ │ ├── pp0n2c16.png │ │ ├── pp0n6a08.png │ │ ├── ps1n0g08.png │ │ ├── ps1n2c16.png │ │ ├── ps2n0g08.png │ │ └── ps2n2c16.png │ ├── transparency │ │ ├── tbbn0g04.png │ │ ├── tbbn2c16.png │ │ ├── tbbn3p08.png │ │ ├── tbgn2c16.png │ │ ├── tbgn3p08.png │ │ ├── tbrn2c08.png │ │ ├── tbwn0g16.png │ │ ├── tbwn3p08.png │ │ ├── tbyn3p08.png │ │ ├── tm3n3p02.png │ │ ├── tp0n0g08.png │ │ ├── tp0n2c08.png │ │ ├── tp0n3p08.png │ │ └── tp1n3p08.png │ └── zlib │ │ ├── z00n2c08.png │ │ ├── z03n2c08.png │ │ ├── z06n2c08.png │ │ └── z09n2c08.png ├── seq2gif.gif ├── snake-ascii.pbm ├── snake-ascii.pgm ├── snake-ascii.ppm ├── snake-grayscale.jpg ├── snake-grayscale.png ├── snake-monochrome.png ├── snake-palette.png ├── snake-progressive.jpg ├── snake.bmp ├── snake.gif ├── snake.jpg ├── snake.pbm ├── snake.pgm ├── snake.png ├── snake.ppm ├── snake.six ├── snake.tga ├── snake.tiff └── vimperator3.png ├── include ├── Makefile.am ├── Makefile.in └── sixel.h.in ├── install-sh ├── libsixel.pc.in ├── ltmain.sh ├── m4 ├── ax_gcc_builtin.m4 ├── ax_gcc_func_attribute.m4 ├── ax_gcc_var_attribute.m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 └── lt~obsolete.m4 ├── missing ├── package.json ├── package.json.in.in ├── perl ├── Build.PL ├── Changes ├── MANIFEST ├── MANIFEST.SKIP ├── META.json ├── META.yml ├── Makefile.PL ├── README.md ├── builder │ └── MyBuilder.pm ├── cpanfile ├── images │ ├── egret.jpg │ └── egret.six ├── lib │ └── Image │ │ ├── LibSIXEL.pm │ │ ├── LibSIXEL.xs │ │ ├── LibSIXEL │ │ ├── Decoder.pm │ │ └── Encoder.pm │ │ └── ppport.h ├── minil.toml └── t │ └── libsixel.t ├── php ├── .gitignore ├── CREDITS ├── EXPERIMENTAL ├── LICENSE ├── README ├── config.m4 ├── config.w32 ├── manual │ ├── Makefile │ ├── file-entities.ent │ ├── functions.xml │ ├── manual.xml.in │ └── sixel │ │ ├── configure.xml │ │ ├── constants.xml │ │ ├── ini.xml │ │ └── reference.xml ├── package.xml ├── package2.xml ├── php_sixel.h ├── sixel.c ├── sixel.dsp ├── sixel.xml └── tests │ ├── SixelEncoder____construct.phpt │ ├── SixelEncoder____destruct.phpt │ ├── SixelEncoder__encode.phpt │ └── SixelEncoder__setopt.phpt ├── py-compile ├── python ├── LICENSE ├── Makefile.am ├── Makefile.in ├── README.rst ├── libsixel │ ├── __init__.py │ ├── decoder.py │ └── encoder.py └── setup.py ├── ruby ├── .gitignore ├── .travis.yml ├── Gemfile ├── LICENSE.txt ├── README.md ├── Rakefile ├── ext │ └── libsixel │ │ ├── extconf.rb │ │ ├── libsixel.c │ │ └── libsixel.h ├── images │ ├── egret.jpg │ └── egret.six ├── lib │ ├── libsixel.rb │ └── libsixel │ │ └── version.rb ├── libsixel-ruby.gemspec └── test │ ├── minitest_helper.rb │ └── test_libsixel.rb ├── src ├── Makefile.am ├── Makefile.in ├── allocator.c ├── allocator.h ├── chunk.c ├── chunk.h ├── decoder.c ├── decoder.h ├── dither.c ├── dither.h ├── encoder.c ├── encoder.h ├── frame.c ├── frame.h ├── fromgif.c ├── fromgif.h ├── frompnm.c ├── frompnm.h ├── fromsixel.c ├── loader.c ├── loader.h ├── malloc_stub.c ├── malloc_stub.h ├── output.c ├── output.h ├── pixelformat.c ├── pixelformat.h ├── quant.c ├── quant.h ├── rgblookup.gperf ├── rgblookup.h ├── scale.c ├── sixel.5 ├── status.c ├── status.h ├── stb_image.h ├── stb_image_write.c ├── stb_image_write.h ├── tests.c ├── tosixel.c ├── tty.c ├── tty.h ├── writer.c └── writer.h ├── tools ├── Makefile.am ├── Makefile.in └── libsixel-config.in └── wic ├── wic.cc ├── wic_install.reg.in └── wic_uninstall.reg.in /.coveralls.yml: -------------------------------------------------------------------------------- 1 | 2 | repo_token: bD1axKh8NFv7xXkdK0KGWn7k43fklumoh 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # gcov 7 | *.gcno 8 | *.gcda 9 | *.gcov 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | 15 | # Compiled Static libraries 16 | *.lai 17 | *.la 18 | *.a 19 | 20 | # Compiled Executable binary 21 | *.exe 22 | 23 | # swap files 24 | *.swp 25 | \#*\# 26 | 27 | # generated by patch(1) 28 | *.rej 29 | *.orig 30 | 31 | # autotools 32 | autom4te.cache 33 | config.h 34 | config.h.in~ 35 | config.log 36 | config.status 37 | Makefile 38 | libtool 39 | stamp-h1 40 | .libs 41 | .deps 42 | 43 | # OSX 44 | .DS_Store 45 | 46 | # editor 47 | *.un~ 48 | 49 | # project.vim 50 | .vimprojects 51 | 52 | # project specific 53 | wic_install.reg 54 | wic_uninstall.reg 55 | libsixel.pc 56 | package.json.in 57 | include/*.h 58 | converters/img2sixel 59 | converters/sixel2png 60 | converters/*.sixel 61 | converters/*.png 62 | tools/libsixel-config 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 Hayaki Saito 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /LICENSE.images: -------------------------------------------------------------------------------- 1 | Test Images 2 | =========== 3 | 4 | ## PUBLIC-DOMAIN-PHOTOS 5 | 6 | The following test images in "image/" directory came from public-domain-photos.com. 7 | (http://public-domain-photos.com/) 8 | 9 | - images/egret.jpg 10 | 11 | author: Jon Sullivan 12 | url: http://public-domain-photos.com/animals/egret-4.htm 13 | 14 | - images/snake.jpg 15 | 16 | author: Jon Sullivan 17 | url: http://public-domain-photos.com/animals/snake-4.htm 18 | 19 | 20 | ## vimperator3.png (mascot of vimperator) 21 | 22 | images/vimperator3.png is in public domain. 23 | 24 | author: @k_wizard 25 | url: http://quadrantem.com/~k_wizard/vimprtan/ 26 | -------------------------------------------------------------------------------- /LICENSE.mesa: -------------------------------------------------------------------------------- 1 | Example program for libsixel-OpenGL integration 2 | examples/opengl/main.c 3 | 4 | GLX pbuffer initialization part is originally written by 5 | Brian Paul for the "OpenGL and Window System Integration" 6 | course presented at SIGGRAPH '97. Updated on 5 October 2002. 7 | 8 | Updated on 31 January 2004 to use native GLX by 9 | Andrew P. Lentvorski, Jr. 10 | 11 | Hayaki Saito added OSMesa and OSX pbuffer 12 | initialization code. 13 | 14 | original source: 15 | https://cgit.freedesktop.org/mesa/demos/tree/src/xdemos/glxpbdemo.c 16 | 17 | original license: 18 | 19 | Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a 22 | copy of this software and associated documentation files (the "Software"), 23 | to deal in the Software without restriction, including without limitation 24 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 25 | and/or sell copies of the Software, and to permit persons to whom the 26 | Software is furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included 29 | in all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 32 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 34 | BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 35 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 36 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | -------------------------------------------------------------------------------- /LICENSE.pngsuite: -------------------------------------------------------------------------------- 1 | PngSuite 2 | -------- 3 | 4 | Permission to use, copy, modify and distribute these images for any 5 | purpose and without fee is hereby granted. 6 | 7 | 8 | (c) Willem van Schaik, 1996, 2011 9 | -------------------------------------------------------------------------------- /LICENSE.pnmcolormap: -------------------------------------------------------------------------------- 1 | 2 | src/quant.c is derived from ppmquant, originally by Jef Poskanzer. 3 | 4 | Copyright (C) 1989, 1991 by Jef Poskanzer. 5 | Copyright (C) 2001 by Bryan Henderson. 6 | 7 | Permission to use, copy, modify, and distribute this software and its 8 | documentation for any purpose and without fee is hereby granted, provided 9 | that the above copyright notice appear in all copies and that both that 10 | copyright notice and this permission notice appear in supporting 11 | documentation. This software is provided "as is" without express or 12 | implied warranty. 13 | 14 | -------------------------------------------------------------------------------- /LICENSE.sdump: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 haru 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /LICENSE.sixel: -------------------------------------------------------------------------------- 1 | "sixel" license (original license) 2 | ================================== 3 | 4 | src/tosixel.c and src/fromsixel.c are derived from "sixel" original version (2014-3-2) 5 | 6 | Package: http://nanno.dip.jp/softlib/man/rlogin/sixel.tar.gz 7 | 8 | Unofficial repo: https://github.com/saitoha/sixel 9 | 10 | This work is written by kmiya@ culti. He distributes it under very permissive license. 11 | 12 | The original license text(in Japanese) is: 13 | 14 | ``` 15 | このプログラム及びソースコードの使用について個人・商用を問わず 16 | 17 | ご自由に使用していただいで結構です。 18 | 19 | また、配布・転載・紹介もご連絡の必要もありません。 20 | 21 | ソースの改変による配布も自由ですが、どのバージョンの改変かを 22 | 23 | 明記されることを希望します。 24 | 25 | バージョン情報が無い場合は、配布物の年月日を明記されることを 26 | 27 | 希望します。 28 | 29 | 2014/10/05 kmiya 30 | ``` 31 | 32 | The unofficial translation: 33 | 34 | ``` 35 | Anyone is free to use this program for any purpose, 36 | commercial or non-commercial, without any restriction. 37 | 38 | Anyone is free to distribute, copy, publish, or 39 | advertise this software, without any contact. 40 | 41 | Anyone is free to distribute with modification of the 42 | source code, but I "hope" that its based version or 43 | date will be written clearly. 44 | 45 | 2014/10/05 kmiya 46 | ``` 47 | 48 | kmiya also said this is compatible with MIT/BSD/GPL. 49 | 50 | -------------------------------------------------------------------------------- /LICENSE.stb: -------------------------------------------------------------------------------- 1 | 2 | This software includes some part of stb(https://github.com/nothings/stb), 3 | 4 | - src/stb_image.h: public domain JPEG/PNG reader. 5 | - src/stb_image_write.h: public domain PNG/BMP/TGA writer. 6 | - src/fromgif.c: derived from stb_image.h 7 | 8 | These great works is written by Sean Barrett(@nothings) and some contributers. 9 | 10 | src/fromgif.c is origined from some part of stb_image.h. 11 | 12 | License: 13 | This software is in the public domain. Where that dedication is not 14 | recognized, you are granted a perpetual, irrevocable license to copy 15 | and modify this file however you want. 16 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # @configure_input@ 3 | # 4 | SUBDIRS = include src converters tools python 5 | DIST_SUBDIRS = $(SUBDIRS) 6 | 7 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} 8 | 9 | srcdir = @srcdir@ 10 | VPATH = @srcdir@ 11 | 12 | # pkgconfig 13 | pkgconfigdir = @pkgconfigdir@ 14 | pkgconfig_DATA = $(builddir)/libsixel.pc 15 | 16 | CLEANFILES = $(builddir)/valgrind.log $(builddir)/test.log $(builddir)/unittest.log 17 | 18 | all-am: 19 | cp $(builddir)/package.json.in $(builddir)/package.json 20 | 21 | check-am: 22 | 23 | unittest: all 24 | cd $(srcdir)/src && $(MAKE) unittest 2>&1 |tee $(builddir)/unittest.log 25 | 26 | test: all 27 | cd src && $(MAKE) unittest 2>&1 |tee $(builddir)/test.log 28 | cd converters && $(MAKE) test 2>&1 |tee -a $(builddir)/test.log 29 | 30 | winetest: all 31 | cd converters && $(MAKE) winetest 32 | 33 | valgrind: all 34 | valgrind --leak-check=full --show-reachable=no --error-limit=no img2sixel images/snake.jpg -dfs 2>&1 \ 35 | | grep ^== \ 36 | | tee $(builddir)/valgrind.log 37 | grep "All heap blocks were freed" $(builddir)/valgrind.log || \ 38 | grep "definitely lost: 0 bytes in 0 blocks" valgrind.log 39 | grep "All heap blocks were freed" $(builddir)/valgrind.log || \ 40 | grep "indirectly lost: 0 bytes in 0 blocks" valgrind.log 41 | 42 | coveralls: 43 | coveralls -e config.h -e stb_image.h -e stb_image_write.h -e examples -e include -e perl -e php -e ruby -e wic 44 | 45 | coveralls-dryrun: test 46 | coveralls -e config.h -e stb_image.h -e stb_image_write.h -e examples -e include -e perl -e php -e ruby -e wic --dryrun 47 | -------------------------------------------------------------------------------- /converters/malloc_stub.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | #include "config.h" 24 | 25 | #if HAVE_SYS_TYPES_H 26 | #include 27 | #endif /* HAVE_SYS_TYPES_H */ 28 | 29 | #if HAVE_ERRNO_H 30 | #include 31 | #endif /* HAVE_ERRNO_H */ 32 | 33 | #if HAVE_MEMORY_H 34 | #include 35 | #endif /* HAVE_MEMORY_H */ 36 | 37 | #if !HAVE_MALLOC 38 | #undef malloc 39 | void * 40 | rpl_malloc(size_t n) 41 | { 42 | if(n == 0) { 43 | n = 1; 44 | } 45 | return (void *)malloc(n); 46 | } 47 | #endif /* !HAVE_MALLOC */ 48 | 49 | #if !HAVE_REALLOC 50 | #undef realloc 51 | void * 52 | rpl_realloc(void *p, size_t n) 53 | { 54 | if (n == 0) { 55 | n = 1; 56 | } 57 | if (p == 0) { 58 | return malloc(n); 59 | } 60 | return (void *)realloc(p, n); 61 | } 62 | #endif /* !HAVE_REALLOC */ 63 | 64 | #if 0 65 | int 66 | rpl_posix_memalign(void **memptr, size_t alignment, size_t size) 67 | { 68 | #if HAVE_POSIX_MEMALIGN 69 | return posix_memalign(memptr, alignment, size); 70 | #elif HAVE_ALIGNED_ALLOC 71 | *memptr = aligned_alloc(alignment, size); 72 | return *memptr ? 0: ENOMEM; 73 | #elif HAVE_MEMALIGN 74 | *memptr = memalign(alignment, size); 75 | return *memptr ? 0: ENOMEM; 76 | #elif HAVE__ALIGNED_MALLOC 77 | return _aligned_malloc(size, alignment); 78 | #else 79 | # error 80 | #endif /* _MSC_VER */ 81 | } 82 | #endif 83 | 84 | /* emacs Local Variables: */ 85 | /* emacs mode: c */ 86 | /* emacs tab-width: 4 */ 87 | /* emacs indent-tabs-mode: nil */ 88 | /* emacs c-basic-offset: 4 */ 89 | /* emacs End: */ 90 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 91 | /* EOF */ 92 | -------------------------------------------------------------------------------- /converters/malloc_stub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef MALLOC_STUB_H 23 | #define MALLOC_STUB_H 24 | 25 | #if HAVE_SYS_TYPES_H 26 | #include 27 | #endif /* HAVE_SYS_TYPES_H */ 28 | 29 | #if !HAVE_MALLOC 30 | void * rpl_malloc(size_t n); 31 | #endif /* !HAVE_MALLOC */ 32 | 33 | #if !HAVE_REALLOC 34 | void * rpl_realloc(void *p, size_t n); 35 | #endif /* !HAVE_REALLOC */ 36 | 37 | #if 0 38 | int rpl_posix_memalign(void **memptr, size_t alignment, size_t size); 39 | #endif 40 | 41 | #endif /* MALLOC_STUB_H */ 42 | 43 | /* emacs Local Variables: */ 44 | /* emacs mode: c */ 45 | /* emacs tab-width: 4 */ 46 | /* emacs indent-tabs-mode: nil */ 47 | /* emacs c-basic-offset: 4 */ 48 | /* emacs End: */ 49 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 50 | /* EOF */ 51 | -------------------------------------------------------------------------------- /converters/sixel2png.1: -------------------------------------------------------------------------------- 1 | .\" vi:set wm=5 2 | .TH SIXEL2PNG 1 "May 2015" 3 | .if n .ds Q \&" 4 | .if n .ds U \&" 5 | .if t .ds Q `` 6 | .if t .ds U '' 7 | .UC 4 8 | .SH NAME 9 | sixel2png \- convert DEC SIXEL images into PNG format images 10 | 11 | 12 | .SH SYNOPSIS 13 | .B sixel2png 14 | \fB-i\fP 15 | \fB-o\fP 16 | .br 17 | .B img2sixel 18 | \fB<\fP 19 | \fB>\fP 20 | .ta .5i 1.8i 21 | 22 | 23 | .SH DESCRIPTION 24 | .I img2sixel 25 | convert DEC SIXEL images into PNG format images. 26 | 27 | 28 | .SH "COMMAND-LINE OPTIONS" 29 | \fIimg2sixel\fP has the following command-line options: 30 | .TP 5 31 | .B \-i 32 | Specify input file. If it is omitted or "-", 33 | this command accepts SIXEL data from STDIN. 34 | .TP 5 35 | .B \-o 36 | Specify output file. If it is omitted or "-", 37 | this command emit SIXEL data into STDOUT. 38 | 39 | 40 | .SH "SEE ALSO" 41 | sixel(5) img2sixel(1) 42 | 43 | 44 | .SH AUTHORS 45 | \fIsixel2png\fP is maintained by Hayaki Saito. 46 | We imported whole code of \fIstbiw-1.01\fP, written by Sean Barrett and its contributers, for writing PNG images, 47 | 48 | 49 | .SH COPYRIGHT 50 | Copyright (c) 2014-2015 Hayaki Saito 51 | .PP 52 | Permission is hereby granted, free of charge, to any person obtaining a copy of 53 | this software and associated documentation files (the "Software"), to deal in 54 | the Software without restriction, including without limitation the rights to 55 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 56 | the Software, and to permit persons to whom the Software is furnished to do so, 57 | subject to the following conditions: 58 | .PP 59 | The above copyright notice and this permission notice shall be included in all 60 | copies or substantial portions of the Software. 61 | .PP 62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 64 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 65 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 66 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 67 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 68 | 69 | .SH THANKS 70 | This software derives from the following implementation. 71 | .br 72 | .TP 5 73 | .B stbiw-0.92 74 | This software includes \fIstbiw-0.92\fP (stb_image_write.h), 75 | a public domain PNG/BMP/TGA writer. 76 | .br 77 | .B http://nothings.org/stb/stb_image_write.h 78 | 79 | 80 | .SH CONTRIBUTORS 81 | .nf 82 | Masami HIRATA(@msmhrt) 83 | Bruce Mitchener (@waywardmonkeys) 84 | .fi 85 | 86 | 87 | .SH BUGS 88 | .PD 89 | .IP \(bu 90 | Send bug-reports, fixes, enhancements to 91 | .BR saitoha@me.com . 92 | 93 | -------------------------------------------------------------------------------- /examples/drawing/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | cc -Wall $$(libsixel-config --cflags) main.c -o demo $$(libsixel-config --libs) 3 | 4 | run: all 5 | ./demo 6 | 7 | clean: 8 | rm -vf ./demo 9 | -------------------------------------------------------------------------------- /examples/drawing/README.md: -------------------------------------------------------------------------------- 1 | Drawing Example 2 | =============== 3 | 4 | This example suggests how to implement the interaction among SIXEL terminals and pointer devices. 5 | 6 | [![drawing](https://raw.githubusercontent.com/saitoha/libsixel/data/data/drawing.png)](https://youtu.be/2-2FnoZp4Z0) 7 | 8 | 9 | Requirements 10 | ------------ 11 | To play this demo application, your terminal have to implement SIXEL graphics and DEC Locator mode. 12 | 13 | - XTerm (with --enable-dec-locator --enable-sixel-graphics --with-terminal-id=VT340 configure option) 14 | - RLogin 15 | - mlterm 16 | 17 | 18 | How to Build 19 | ------------ 20 | 21 | $ make 22 | 23 | 24 | Run (only works on SIXEL terminals) 25 | ----------------------------------- 26 | 27 | $ ./demo 28 | 29 | 30 | License 31 | -------- 32 | Hayaki Saito 33 | 34 | I declared main.c is in Public Domain (CC0 - "No Rights Reserved"). 35 | This example is offered AS-IS, without any warranty. 36 | -------------------------------------------------------------------------------- /examples/opengl/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | bin_PROGRAMS = demo 3 | demo_SOURCES = main.c 4 | demo_CFLAGS = -Wall -Wextra $(LIBSIXEL_CFLAGS) $(GL_CFLAGS) $(X_CFLAGS) 5 | demo_LDADD = -lm $(LIBSIXEL_LIBS) $(GL_LIBS) $(X_LIBS) 6 | 7 | check: check-am 8 | ./demo 9 | -------------------------------------------------------------------------------- /examples/opengl/README.md: -------------------------------------------------------------------------------- 1 | OpenGL Example 2 | ============== 3 | 4 | This example suggests how to port your OpenGL application to SIXEL terminal. 5 | 6 | ![opengl](https://raw.githubusercontent.com/saitoha/libsixel/data/data/example_opengl.gif) 7 | 8 | 9 | How to Build 10 | ------------ 11 | 12 | Linux/BSDs: 13 | 14 | 1. Install OSMesa package on your distribution 15 | 16 | $ sudo apt-get install libosmesa6-dev 17 | 18 | 2. Build 19 | 20 | $ ./configure && make 21 | 22 | OSX: 23 | 24 | 1. Build 25 | 26 | $ ./configure && make 27 | 28 | 29 | Run (only works on SIXEL terminals) 30 | ----------------------------------- 31 | 32 | $ ./demo 33 | 34 | 35 | License 36 | -------- 37 | 38 | GLX pbuffer initialization part is originally written by 39 | Brian Paul for the "OpenGL and Window System Integration" 40 | course presented at SIGGRAPH '97. Updated on 5 October 2002. 41 | 42 | Updated on 31 January 2004 to use native GLX by 43 | Andrew P. Lentvorski, Jr. 44 | 45 | Hayaki Saito added OSMesa and OSX pbuffer 46 | initialization code. 47 | 48 | original source: 49 | https://cgit.freedesktop.org/mesa/demos/tree/src/xdemos/glxpbdemo.c 50 | 51 | original license: 52 | 53 | ``` 54 | Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 55 | 56 | Permission is hereby granted, free of charge, to any person obtaining a 57 | copy of this software and associated documentation files (the "Software"), 58 | to deal in the Software without restriction, including without limitation 59 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 60 | and/or sell copies of the Software, and to permit persons to whom the 61 | Software is furnished to do so, subject to the following conditions: 62 | 63 | The above copyright notice and this permission notice shall be included 64 | in all copies or substantial portions of the Software. 65 | 66 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 67 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 68 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 69 | BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 70 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 71 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 72 | ``` 73 | 74 | Note that some configure scripts and m4 macros are distributed under the terms 75 | of the special exception to the GNU General Public License. 76 | 77 | OpenGL is a trademark of [Silicon Graphics Incorporated](http://www.sgi.com/). 78 | -------------------------------------------------------------------------------- /examples/opengl/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* whether CGL is available */ 4 | #undef HAVE_CGL 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_FCNTL_H 8 | 9 | /* whether GLX is available */ 10 | #undef HAVE_GLX 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_INTTYPES_H 14 | 15 | /* whether libsixel is available */ 16 | #undef HAVE_LIBSIXEL 17 | 18 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 19 | to 0 otherwise. */ 20 | #undef HAVE_MALLOC 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #undef HAVE_MEMORY_H 24 | 25 | /* Define to 1 if you have the `memset' function. */ 26 | #undef HAVE_MEMSET 27 | 28 | /* whether osmesa is available */ 29 | #undef HAVE_OSMESA 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #undef HAVE_STDINT_H 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #undef HAVE_STDLIB_H 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #undef HAVE_STRINGS_H 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #undef HAVE_STRING_H 42 | 43 | /* Define to 1 if you have the `strstr' function. */ 44 | #undef HAVE_STRSTR 45 | 46 | /* Define to 1 if you have the header file. */ 47 | #undef HAVE_SYS_IOCTL_H 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #undef HAVE_SYS_SELECT_H 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #undef HAVE_SYS_STAT_H 54 | 55 | /* Define to 1 if you have the header file. */ 56 | #undef HAVE_SYS_TYPES_H 57 | 58 | /* Define to 1 if you have the header file. */ 59 | #undef HAVE_TERMIOS_H 60 | 61 | /* Define to 1 if you have the header file. */ 62 | #undef HAVE_UNISTD_H 63 | 64 | /* Name of package */ 65 | #undef PACKAGE 66 | 67 | /* Define to the address where bug reports for this package should be sent. */ 68 | #undef PACKAGE_BUGREPORT 69 | 70 | /* Define to the full name of this package. */ 71 | #undef PACKAGE_NAME 72 | 73 | /* Define to the full name and version of this package. */ 74 | #undef PACKAGE_STRING 75 | 76 | /* Define to the one symbol short name of this package. */ 77 | #undef PACKAGE_TARNAME 78 | 79 | /* Define to the home page for this package. */ 80 | #undef PACKAGE_URL 81 | 82 | /* Define to the version of this package. */ 83 | #undef PACKAGE_VERSION 84 | 85 | /* Define to 1 if you have the ANSI C header files. */ 86 | #undef STDC_HEADERS 87 | 88 | /* Version number of package */ 89 | #undef VERSION 90 | 91 | /* Define to 1 if the X Window System is missing or not being used. */ 92 | #undef X_DISPLAY_MISSING 93 | 94 | /* Define to rpl_malloc if the replacement function should be used. */ 95 | #undef malloc 96 | 97 | /* Define to `unsigned int' if does not define. */ 98 | #undef size_t 99 | -------------------------------------------------------------------------------- /examples/opengl/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ([2.69]) 5 | AC_INIT([demo], [1.0.0], [user@zuse.jp]) 6 | AM_INIT_AUTOMAKE([foreign]) 7 | 8 | AC_CONFIG_SRCDIR([main.c]) 9 | AC_CONFIG_HEADERS([config.h]) 10 | 11 | AC_CANONICAL_HOST 12 | 13 | # Checks for programs. 14 | AC_PROG_CC 15 | 16 | # Checks for libraries. 17 | PKG_CHECK_MODULES([LIBSIXEL], [libsixel], [have_libsixel=yes], [have_libsixel=no]) 18 | if test x$have_libsixel != xno; then 19 | AC_MSG_NOTICE([libsixel: $have_libsixel]) 20 | AC_DEFINE(HAVE_LIBSIXEL, 1, [whether libsixel is available]) 21 | else 22 | AC_MSG_ERROR(libsixel is not available.) 23 | fi 24 | AC_SUBST(LIBSIXEL_CFLAGS) 25 | AC_SUBST(LIBSIXEL_LIBS) 26 | 27 | if test x$have_gl != xyes; then 28 | PKG_CHECK_MODULES([GL], [osmesa], [have_osmesa=yes], [have_osmesa=no]) 29 | if test x$have_osmesa != xno; then 30 | have_gl=yes 31 | AC_MSG_NOTICE([osmesa: $have_osmesa]) 32 | AC_DEFINE(HAVE_OSMESA, 1, [whether osmesa is available]) 33 | fi 34 | fi 35 | 36 | if test x$have_gl != xyes; then 37 | case $host in 38 | *-apple-darwin*) 39 | have_gl=yes 40 | GL_CFLAGS=-Wno-deprecated-declarations 41 | GL_LIBS="-framework OpenGL" 42 | AC_DEFINE(HAVE_CGL, 1, [whether CGL is available]) 43 | ;; 44 | esac 45 | fi 46 | 47 | if test x$have_gl != xyes; then 48 | AC_PATH_XTRA 49 | if test x$X_DISPLAY_MISSING = x; then 50 | AC_CHECK_HEADER([GL/gl.h], [ 51 | AC_CHECK_HEADER([GL/glx.h], [ 52 | AC_CHECK_LIB([GL], [glXCreateContext], [ 53 | have_gl=yes 54 | GL_CFLAGS= 55 | GL_LIBS=-lGL 56 | AC_DEFINE(HAVE_GLX, 1, [whether GLX is available]) 57 | ]) 58 | ]) 59 | ]) 60 | fi 61 | AC_SUBST(X_CFLAGS) 62 | AC_SUBST(X_LIBS) 63 | fi 64 | 65 | if test x$have_gl != xyes; then 66 | AC_MSG_ERROR([Please install osmesa (e.g. "apt-get install libosmesa6-dev")]) 67 | fi 68 | 69 | AC_SUBST(GL_CFLAGS) 70 | AC_SUBST(GL_LIBS) 71 | 72 | # Checks for header files. 73 | AC_CHECK_HEADERS([sys/select.h termios.h fcntl.h sys/ioctl.h]) 74 | 75 | # Checks for typedefs, structures, and compiler characteristics. 76 | AC_TYPE_SIZE_T 77 | 78 | # Checks for library functions. 79 | AC_FUNC_MALLOC 80 | AC_CHECK_FUNCS([memset strstr]) 81 | 82 | AC_CONFIG_FILES([Makefile]) 83 | AC_OUTPUT 84 | -------------------------------------------------------------------------------- /examples/python/Makefile: -------------------------------------------------------------------------------- 1 | all: test 2 | 3 | test: 4 | ./converter.py ../../images/snake-monochrome.png 5 | ./converter.py ../../images/snake-grayscale.png 6 | ./converter.py ../../images/snake-palette.png 7 | ./converter.py ../../images/snake.jpg 8 | -------------------------------------------------------------------------------- /examples/python/README.md: -------------------------------------------------------------------------------- 1 | Python Example 2 | ============== 3 | 4 | This example suggests how to convert PIL images into SIXEL using libsixel python interface. 5 | 6 | 7 | Requirements 8 | ------------ 9 | 10 | - libsixel-python 11 | - PIL (Python Imaging Library) or its compatible library 12 | 13 | 14 | Run (only works on SIXEL terminals) 15 | ----------------------------------- 16 | 17 | $ ./converter.py 18 | 19 | 20 | License 21 | -------- 22 | Hayaki Saito 23 | 24 | I declared main.c is in Public Domain (CC0 - "No Rights Reserved"). 25 | This example is offered AS-IS, without any warranty. 26 | -------------------------------------------------------------------------------- /examples/python/converter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from libsixel import * 5 | from PIL import Image 6 | from io import BytesIO 7 | 8 | s = BytesIO() 9 | 10 | file = sys.argv[1] 11 | image = Image.open(file) 12 | width, height = image.size 13 | try: 14 | data = image.tobytes() 15 | except NotImplementedError: 16 | data = image.tostring() 17 | output = sixel_output_new(lambda data, s: s.write(data), s) 18 | 19 | try: 20 | if image.mode == 'RGBA': 21 | dither = sixel_dither_new(256) 22 | sixel_dither_initialize(dither, data, width, height, SIXEL_PIXELFORMAT_RGBA8888) 23 | elif image.mode == 'RGB': 24 | dither = sixel_dither_new(256) 25 | sixel_dither_initialize(dither, data, width, height, SIXEL_PIXELFORMAT_RGB888) 26 | elif image.mode == 'P': 27 | palette = image.getpalette() 28 | dither = sixel_dither_new(256) 29 | sixel_dither_set_palette(dither, palette) 30 | sixel_dither_set_pixelformat(dither, SIXEL_PIXELFORMAT_PAL8) 31 | elif image.mode == 'L': 32 | dither = sixel_dither_get(SIXEL_BUILTIN_G8) 33 | sixel_dither_set_pixelformat(dither, SIXEL_PIXELFORMAT_G8) 34 | elif image.mode == '1': 35 | dither = sixel_dither_get(SIXEL_BUILTIN_G1) 36 | sixel_dither_set_pixelformat(dither, SIXEL_PIXELFORMAT_G1) 37 | else: 38 | raise RuntimeError('unexpected image mode') 39 | try: 40 | sixel_encode(data, width, height, 1, dither, output) 41 | print(s.getvalue().decode('ascii')) 42 | finally: 43 | sixel_dither_unref(dither) 44 | finally: 45 | sixel_output_unref(output) 46 | -------------------------------------------------------------------------------- /images/egret.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/egret.jpg -------------------------------------------------------------------------------- /images/map16-palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/map16-palette.png -------------------------------------------------------------------------------- /images/map16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/map16.png -------------------------------------------------------------------------------- /images/map8-palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/map8-palette.png -------------------------------------------------------------------------------- /images/map8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/map8.png -------------------------------------------------------------------------------- /images/map8.six: -------------------------------------------------------------------------------- 1 | Pq"1;1;93;14#0;2;60;0;0#1;2;0;66;0#2;2;56;60;0#3;2;47;38;97#4;2;72;0;69#5;2;0;66;72#6;2;72;72;72#7;2;0;0;0#0!11~#1!12~#2!12~#3!12~#4!12~#5!12~#6!12~#7!10~-#0!11~#1!12~#2!12~#3!12~#4!12~#5!12~#6!12~#7!10~-#0!11B#1!12B#2!12B#3!12B#4!12B#5!12B#6!12B#7!10B\ -------------------------------------------------------------------------------- /images/pngsuite/background/bgai4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bgai4a08.png -------------------------------------------------------------------------------- /images/pngsuite/background/bgai4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bgai4a16.png -------------------------------------------------------------------------------- /images/pngsuite/background/bgan6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bgan6a08.png -------------------------------------------------------------------------------- /images/pngsuite/background/bgan6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bgan6a16.png -------------------------------------------------------------------------------- /images/pngsuite/background/bgbn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bgbn4a08.png -------------------------------------------------------------------------------- /images/pngsuite/background/bggn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bggn4a16.png -------------------------------------------------------------------------------- /images/pngsuite/background/bgwn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bgwn6a08.png -------------------------------------------------------------------------------- /images/pngsuite/background/bgyn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/background/bgyn6a16.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn0g01.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn0g02.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn0g08.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn0g16.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn2c08.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn2c16.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn3p01.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn3p02.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn3p04.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn3p08.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn4a08.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn4a16.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn6a08.png -------------------------------------------------------------------------------- /images/pngsuite/basic/basn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/basic/basn6a16.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ccwn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ccwn2c08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ccwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ccwn3p08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cdfn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cdfn2c08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cdhn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cdhn2c08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cdsn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cdsn2c08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cdun2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cdun2c08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ch1n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ch1n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ch2n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ch2n3p08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cm0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cm0n0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cm7n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cm7n0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cm9n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cm9n0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cs3n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cs3n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cs3n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cs3n3p08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cs5n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cs5n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cs5n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cs5n3p08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cs8n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cs8n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cs8n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cs8n3p08.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ct0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ct0n0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ct1n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ct1n0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cten0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cten0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ctfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ctfn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ctgn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ctgn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/cthn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/cthn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ctjn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ctjn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/chunk/ctzn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/chunk/ctzn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xc1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xc1n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xc9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xc9n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xcrn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xcrn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xcsn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xcsn0g01.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xd0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xd0n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xd3n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xd3n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xd9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xd9n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xdtn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xdtn0g01.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xhdn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xhdn0g08.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xlfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xlfn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xs1n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xs1n0g01.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xs2n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xs2n0g01.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xs4n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xs4n0g01.png -------------------------------------------------------------------------------- /images/pngsuite/corrupted/xs7n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/corrupted/xs7n0g01.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f00n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f00n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f00n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f01n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f01n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f01n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f01n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f02n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f02n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f02n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f02n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f03n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f03n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f03n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f04n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f04n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f04n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/filter/f99n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/filter/f99n0g04.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g03n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g03n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g03n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g03n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g03n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g04n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g04n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g04n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g04n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g04n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g05n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g05n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g05n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g05n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g05n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g05n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g07n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g07n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g07n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g07n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g07n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g07n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g10n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g10n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g10n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g10n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g10n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g10n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g25n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g25n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g25n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g25n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/gamma/g25n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/gamma/g25n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi0g01.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi0g02.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi0g04.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi0g08.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi0g16.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi2c08.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi2c16.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi3p01.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi3p02.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi3p04.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi3p08.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi4a08.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi4a16.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi6a08.png -------------------------------------------------------------------------------- /images/pngsuite/interlacing/basi6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/interlacing/basi6a16.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s01i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s01i3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s01n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s01n3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s02i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s02i3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s02n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s02n3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s03i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s03i3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s03n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s03n3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s04i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s04i3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s04n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s04n3p01.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s05i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s05i3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s05n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s05n3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s06i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s06i3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s06n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s06n3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s07i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s07i3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s07n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s07n3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s08i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s08i3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s08n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s08n3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s09i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s09i3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s09n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s09n3p02.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s32i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s32i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s32n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s32n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s33i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s33i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s33n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s33n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s34i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s34i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s34n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s34n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s35i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s35i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s35n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s35n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s36i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s36i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s36n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s36n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s37i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s37i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s37n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s37n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s38i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s38i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s38n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s38n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s39i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s39i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s39n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s39n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s40i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s40i3p04.png -------------------------------------------------------------------------------- /images/pngsuite/odd/s40n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/odd/s40n3p04.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi1n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi1n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi1n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi2n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi2n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi2n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi4n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi4n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi4n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi4n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi9n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi9n0g16.png -------------------------------------------------------------------------------- /images/pngsuite/order/oi9n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/order/oi9n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/palette/pp0n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/palette/pp0n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/palette/pp0n6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/palette/pp0n6a08.png -------------------------------------------------------------------------------- /images/pngsuite/palette/ps1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/palette/ps1n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/palette/ps1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/palette/ps1n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/palette/ps2n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/palette/ps2n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/palette/ps2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/palette/ps2n2c16.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbbn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbbn0g04.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbbn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbbn2c16.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbbn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbbn3p08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbgn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbgn2c16.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbgn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbgn3p08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbrn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbrn2c08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbwn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbwn0g16.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbwn3p08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tbyn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tbyn3p08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tm3n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tm3n3p02.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tp0n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tp0n0g08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tp0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tp0n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tp0n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tp0n3p08.png -------------------------------------------------------------------------------- /images/pngsuite/transparency/tp1n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/transparency/tp1n3p08.png -------------------------------------------------------------------------------- /images/pngsuite/zlib/z00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/zlib/z00n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/zlib/z03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/zlib/z03n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/zlib/z06n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/zlib/z06n2c08.png -------------------------------------------------------------------------------- /images/pngsuite/zlib/z09n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/pngsuite/zlib/z09n2c08.png -------------------------------------------------------------------------------- /images/seq2gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/seq2gif.gif -------------------------------------------------------------------------------- /images/snake-grayscale.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake-grayscale.jpg -------------------------------------------------------------------------------- /images/snake-grayscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake-grayscale.png -------------------------------------------------------------------------------- /images/snake-monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake-monochrome.png -------------------------------------------------------------------------------- /images/snake-palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake-palette.png -------------------------------------------------------------------------------- /images/snake-progressive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake-progressive.jpg -------------------------------------------------------------------------------- /images/snake.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.bmp -------------------------------------------------------------------------------- /images/snake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.gif -------------------------------------------------------------------------------- /images/snake.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.jpg -------------------------------------------------------------------------------- /images/snake.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.pbm -------------------------------------------------------------------------------- /images/snake.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.pgm -------------------------------------------------------------------------------- /images/snake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.png -------------------------------------------------------------------------------- /images/snake.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.ppm -------------------------------------------------------------------------------- /images/snake.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.tga -------------------------------------------------------------------------------- /images/snake.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/snake.tiff -------------------------------------------------------------------------------- /images/vimperator3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/images/vimperator3.png -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | include_HEADERS = sixel.h 2 | -------------------------------------------------------------------------------- /libsixel.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsixel 7 | Description: @PACKAGE_DESCRIPTION@ 8 | Version: @PACKAGE_VERSION@ 9 | Libs: -L${libdir} -lsixel 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software 4 | # Foundation, Inc. 5 | # Written by Gary V. Vaughan, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # serial 6 ltsugar.m4 12 | 13 | # This is to help aclocal find these macros, as it can't see m4_define. 14 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 15 | 16 | 17 | # lt_join(SEP, ARG1, [ARG2...]) 18 | # ----------------------------- 19 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 20 | # associated separator. 21 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 22 | # versions in m4sugar had bugs. 23 | m4_define([lt_join], 24 | [m4_if([$#], [1], [], 25 | [$#], [2], [[$2]], 26 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 27 | m4_define([_lt_join], 28 | [m4_if([$#$2], [2], [], 29 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 30 | 31 | 32 | # lt_car(LIST) 33 | # lt_cdr(LIST) 34 | # ------------ 35 | # Manipulate m4 lists. 36 | # These macros are necessary as long as will still need to support 37 | # Autoconf-2.59, which quotes differently. 38 | m4_define([lt_car], [[$1]]) 39 | m4_define([lt_cdr], 40 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 41 | [$#], 1, [], 42 | [m4_dquote(m4_shift($@))])]) 43 | m4_define([lt_unquote], $1) 44 | 45 | 46 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 47 | # ------------------------------------------ 48 | # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. 49 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 50 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 51 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 52 | # than defined and empty). 53 | # 54 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 55 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 56 | m4_define([lt_append], 57 | [m4_define([$1], 58 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 59 | 60 | 61 | 62 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 63 | # ---------------------------------------------------------- 64 | # Produce a SEP delimited list of all paired combinations of elements of 65 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 66 | # has the form PREFIXmINFIXSUFFIXn. 67 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 68 | m4_define([lt_combine], 69 | [m4_if(m4_eval([$# > 3]), [1], 70 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 71 | [[m4_foreach([_Lt_prefix], [$2], 72 | [m4_foreach([_Lt_suffix], 73 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 74 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 75 | 76 | 77 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 78 | # ----------------------------------------------------------------------- 79 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 80 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 81 | m4_define([lt_if_append_uniq], 82 | [m4_ifdef([$1], 83 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 84 | [lt_append([$1], [$2], [$3])$4], 85 | [$5])], 86 | [lt_append([$1], [$2], [$3])$4])]) 87 | 88 | 89 | # lt_dict_add(DICT, KEY, VALUE) 90 | # ----------------------------- 91 | m4_define([lt_dict_add], 92 | [m4_define([$1($2)], [$3])]) 93 | 94 | 95 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 96 | # -------------------------------------------- 97 | m4_define([lt_dict_add_subkey], 98 | [m4_define([$1($2:$3)], [$4])]) 99 | 100 | 101 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 102 | # ---------------------------------- 103 | m4_define([lt_dict_fetch], 104 | [m4_ifval([$3], 105 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 106 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 107 | 108 | 109 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 110 | # ----------------------------------------------------------------- 111 | m4_define([lt_if_dict_fetch], 112 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 113 | [$5], 114 | [$6])]) 115 | 116 | 117 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 118 | # -------------------------------------------------------------- 119 | m4_define([lt_dict_filter], 120 | [m4_if([$5], [], [], 121 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 122 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 123 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 124 | ]) 125 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 4179 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) 16 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.6' 20 | macro_revision='2.4.6' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "libsixel", 3 | "version": "1.8.6", 4 | "repo": "saitoha/libsixel", 5 | "description": "A lightweight, fast implementation of DEC SIXEL graphics codec", 6 | "keywords": ["terminal", "graphics", "image", "sixel"], 7 | "license": "MIT", 8 | "install": "./configure && make install" 9 | } 10 | -------------------------------------------------------------------------------- /package.json.in.in: -------------------------------------------------------------------------------- 1 | { 2 | "name": "libsixel", 3 | "version": "@PACKAGE_VERSION@", 4 | "repo": "saitoha/libsixel", 5 | "description": "@PACKAGE_DESCRIPTION@", 6 | "keywords": ["terminal", "graphics", "image", "sixel"], 7 | "license": "MIT", 8 | "install": "./configure && make install" 9 | } 10 | -------------------------------------------------------------------------------- /perl/Build.PL: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA. 3 | # DO NOT EDIT DIRECTLY. 4 | # ========================================================================= 5 | 6 | use 5.008_001; 7 | use strict; 8 | 9 | use Module::Build; 10 | 11 | my $builder = Module::Build->new ( 12 | module_name => 'Image::LibSIXEL', 13 | license => 'mit', 14 | dist_abstract => 'libsixel binding for Perl', 15 | 16 | requires => { 17 | }, 18 | 19 | build_requires => { 20 | 'Test::More' => 0, 21 | }, 22 | 23 | script_files => [ 24 | ], 25 | 26 | extra_compiler_flags => scalar `libsixel-config --cflags` . ' -Wall -Wextra', 27 | extra_linker_flags => scalar `libsixel-config --libs`, 28 | create_makefile_pl => 'passthrough', 29 | ); 30 | 31 | $builder->create_build_script(); 32 | -------------------------------------------------------------------------------- /perl/Changes: -------------------------------------------------------------------------------- 1 | Revision history for Perl extension Image::LibSIXEL 2 | 3 | {{$NEXT}} 4 | 5 | - initial version 6 | 7 | -------------------------------------------------------------------------------- /perl/MANIFEST: -------------------------------------------------------------------------------- 1 | Build.PL 2 | lib/Image/LibSIXEL.xs 3 | lib/Image/LibSIXEL.pm 4 | lib/Image/LibSIXEL/Encoder.pm 5 | lib/Image/LibSIXEL/Decoder.pm 6 | t/libsixel.t 7 | LICENSE 8 | Makefile.PL 9 | MANIFEST This list of files 10 | MANIFEST.SKIP 11 | META.yml 12 | README.md 13 | -------------------------------------------------------------------------------- /perl/MANIFEST.SKIP: -------------------------------------------------------------------------------- 1 | ^Makefile$ 2 | ppport.h$ 3 | egret.*$ 4 | egret1.*$ 5 | -------------------------------------------------------------------------------- /perl/META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "The Perl interface for libsixel (A lightweight, fast implementation of DEC SIXEL graphics codec)", 3 | "author" : [ 4 | "Hayaki Saito " 5 | ], 6 | "dynamic_config" : 0, 7 | "generated_by" : "Minilla/v2.4.1, CPAN::Meta::Converter version 2.150001", 8 | "license" : [ 9 | "unknown" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : "2" 14 | }, 15 | "name" : "Image-LibSIXEL", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "xt", 20 | "inc", 21 | "share", 22 | "eg", 23 | "examples", 24 | "author", 25 | "builder" 26 | ] 27 | }, 28 | "prereqs" : { 29 | "configure" : { 30 | "requires" : { 31 | "Module::Build::Tiny" : "0.035" 32 | } 33 | }, 34 | "build" : { 35 | "requires" : { 36 | "ExtUtils::CBuilder" : "0", 37 | "Test::More" : "0" 38 | } 39 | }, 40 | "develop" : { 41 | "requires" : { 42 | "Test::CPAN::Meta" : "0", 43 | "Test::MinimumVersion::Fast" : "0.04", 44 | "Test::PAUSE::Permissions" : "0.04", 45 | "Test::Pod" : "1.41", 46 | "Test::Spellunker" : "v0.2.7" 47 | } 48 | }, 49 | "runtime" : { 50 | "requires" : { 51 | "perl" : "5.012001" 52 | } 53 | }, 54 | "test" : { 55 | "requires" : { 56 | "Test::More" : "0.98" 57 | } 58 | } 59 | }, 60 | "release_status" : "unstable", 61 | "resources" : { 62 | "bugtracker" : { 63 | "web" : "https://github.com/saitoha/libsixel-perl/issues" 64 | }, 65 | "homepage" : "https://github.com/saitoha/libsixel-perl", 66 | "repository" : { 67 | "type" : "git", 68 | "url" : "git://github.com/saitoha/libsixel-perl.git", 69 | "web" : "https://github.com/saitoha/libsixel-perl" 70 | } 71 | }, 72 | "version" : "0.01", 73 | "x_contributors" : [ 74 | "Hayaki Saito " 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /perl/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'libsixel binding for Perl' 3 | author: 4 | - Hayaki Saito 5 | build_requires: 6 | ExtUtils::CBuilder: 0 7 | Test::More: 0 8 | dynamic_config: 0 9 | generated_by: 'Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921' 10 | license: mit 11 | meta-spec: 12 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 13 | version: 1.4 14 | name: Image-LibSIXEL 15 | provides: 16 | Image::LibSIXEL: 17 | file: lib/Image/LibSIXEL.pm 18 | version: 0.01 19 | Image::LibSIXEL::Encoder: 20 | file: lib/Image/LibSIXEL/Encoder.pm 21 | version: 0 22 | resources: 23 | bugtracker: https://github.com/saitoha/libsixel-perl/issues 24 | homepage: https://github.com/saitoha/libsixel-perl 25 | license: http://opensource.org/licenses/mit-license.php 26 | version: 0.01 27 | x_contributors: 28 | - 'Hayaki Saito ' 29 | -------------------------------------------------------------------------------- /perl/Makefile.PL: -------------------------------------------------------------------------------- 1 | # Note: this file was auto-generated by Module::Build::Compat version 0.4003 2 | 3 | unless (eval "use Module::Build::Compat 0.02; 1" ) { 4 | print "This module requires Module::Build to install itself.\n"; 5 | 6 | require ExtUtils::MakeMaker; 7 | my $yn = ExtUtils::MakeMaker::prompt 8 | (' Install Module::Build now from CPAN?', 'y'); 9 | 10 | unless ($yn =~ /^y/i) { 11 | die " *** Cannot install without Module::Build. Exiting ...\n"; 12 | } 13 | 14 | require Cwd; 15 | require File::Spec; 16 | require CPAN; 17 | 18 | # Save this 'cause CPAN will chdir all over the place. 19 | my $cwd = Cwd::cwd(); 20 | 21 | CPAN::Shell->install('Module::Build::Compat'); 22 | CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate 23 | or die "Couldn't install Module::Build, giving up.\n"; 24 | 25 | chdir $cwd or die "Cannot chdir() back to $cwd: $!"; 26 | } 27 | eval "use Module::Build::Compat 0.02; 1" or die $@; 28 | 29 | Module::Build::Compat->run_build_pl(args => \@ARGV); 30 | my $build_script = 'Build'; 31 | $build_script .= '.com' if $^O eq 'VMS'; 32 | exit(0) unless(-e $build_script); # cpantesters convention 33 | require Module::Build; 34 | Module::Build::Compat->write_makefile(build_class => 'Module::Build'); 35 | -------------------------------------------------------------------------------- /perl/README.md: -------------------------------------------------------------------------------- 1 | # NAME 2 | 3 | Image::LibSIXEL - The Perl interface for libsixel (A lightweight, fast implementation of DEC SIXEL graphics codec) 4 | 5 | # SYNOPSIS 6 | 7 | use Image::LibSIXEL; 8 | 9 | $encoder = Image::LibSIXEL::Encoder->new(); 10 | $encoder->setopt("w", 400); 11 | $encoder->setopt("p", 16); 12 | $encoder->encode("images/egret.jpg"); 13 | 14 | $decoder = Image::LibSIXEL::Decoder->new(); 15 | $decoder->setopt("i", "images/egret.six"); 16 | $decoder->setopt("o", "egret.png"); 17 | $decoder->decode(); 18 | 19 | # DESCRIPTION 20 | 21 | This perl module provides wrapper objects for part of libsixel interface. 22 | http://saitoha.github.io/libsixel/ 23 | 24 | # LICENSE 25 | 26 | Copyright (c) 2014,2015 Hayaki Saito 27 | 28 | Permission is hereby granted, free of charge, to any person obtaining a copy of 29 | this software and associated documentation files (the "Software"), to deal in 30 | the Software without restriction, including without limitation the rights to 31 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 32 | the Software, and to permit persons to whom the Software is furnished to do so, 33 | subject to the following conditions: 34 | 35 | The above copyright notice and this permission notice shall be included in all 36 | copies or substantial portions of the Software. 37 | 38 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 39 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 40 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 41 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 42 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 43 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 44 | 45 | # DESCRIPTION 46 | 47 | 48 | ## Class Methods 49 | 50 | =Image::LibSIXEL::Encoder->new 51 | 52 | Create Encoder object 53 | 54 | =Image::LibSIXEL::Decoder->new 55 | 56 | Create Decoder object 57 | 58 | ## Object Methods 59 | 60 | =Image::LibSIXEL::Encoder->setopt 61 | 62 | =Image::LibSIXEL::Encoder->encode 63 | 64 | =Image::LibSIXEL::Decoder->setopt 65 | 66 | =Image::LibSIXEL::Decoder->decode 67 | 68 | # AUTHOR 69 | 70 | Hayaki Saito 71 | 72 | # SEE ALSO 73 | -------------------------------------------------------------------------------- /perl/builder/MyBuilder.pm: -------------------------------------------------------------------------------- 1 | package MyBuilder; 2 | 3 | use strict; 4 | use warnings; 5 | use parent qw(Module::Build); 6 | use File::Copy; 7 | 8 | sub new { 9 | my ($self, %args) = @_; 10 | $self->SUPER::new( 11 | %args, 12 | extra_compiler_flags => [scalar `libsixel-config --cflags`], 13 | extra_linker_flags => [scalar `libsixel-config --libs`], 14 | ); 15 | } 16 | 17 | 1; 18 | -------------------------------------------------------------------------------- /perl/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'perl', '5.012001'; 2 | 3 | on 'test' => sub { 4 | requires 'Test::More', '0.98'; 5 | }; 6 | 7 | -------------------------------------------------------------------------------- /perl/images/egret.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/perl/images/egret.jpg -------------------------------------------------------------------------------- /perl/lib/Image/LibSIXEL.pm: -------------------------------------------------------------------------------- 1 | package Image::LibSIXEL; 2 | use 5.012001; 3 | our $VERSION = '0.01'; 4 | 5 | require XSLoader; 6 | XSLoader::load('Image::LibSIXEL', $VERSION); 7 | 8 | 1; 9 | 10 | __END__ 11 | 12 | =head1 NAME 13 | 14 | Image::LibSIXEL - The Perl interface for libsixel (A lightweight, fast implementation of DEC SIXEL graphics codec) 15 | 16 | =head1 SYNOPSIS 17 | 18 | use Image::LibSIXEL; 19 | 20 | $encoder = Image::LibSIXEL::Encoder->new(); 21 | $encoder->setopt("w", 400); 22 | $encoder->setopt("p", 16); 23 | $encoder->encode("images/egret.jpg"); 24 | 25 | $decoder = Image::LibSIXEL::Decoder->new(); 26 | $decoder->setopt("i", "images/egret.six"); 27 | $decoder->setopt("o", "egret.png"); 28 | $decoder->decode(); 29 | 30 | =head1 DESCRIPTION 31 | 32 | This perl module provides wrapper objects for part of libsixel interface. 33 | http://saitoha.github.io/libsixel/ 34 | 35 | =head2 Class Methods 36 | 37 | =Image::LibSIXEL::Encoder->new 38 | 39 | Create Encoder object 40 | 41 | =Image::LibSIXEL::Decoder->new 42 | 43 | Create Decoder object 44 | 45 | =head2 Object Methods 46 | 47 | =Image::LibSIXEL::Encoder->setopt 48 | 49 | =Image::LibSIXEL::Encoder->encode 50 | 51 | =Image::LibSIXEL::Decoder->setopt 52 | 53 | =Image::LibSIXEL::Decoder->decode 54 | 55 | =head1 AUTHOR 56 | 57 | Hayaki Saito 58 | 59 | =head1 SEE ALSO 60 | 61 | =cut 62 | -------------------------------------------------------------------------------- /perl/lib/Image/LibSIXEL.xs: -------------------------------------------------------------------------------- 1 | #define PERL_NO_GET_CONTEXT 2 | #include "EXTERN.h" 3 | #include "perl.h" 4 | #include "XSUB.h" 5 | 6 | #include 7 | 8 | MODULE = Image::LibSIXEL PACKAGE = Image::LibSIXEL::Encoder PREFIX = encoder_ 9 | 10 | SV * 11 | encoder_new(void) 12 | INIT: 13 | SIXELSTATUS status; 14 | sixel_encoder_t *encoder; 15 | SV *sv; 16 | const char *klass; 17 | CODE: 18 | status = sixel_encoder_new(&encoder, NULL); 19 | if (SIXEL_FAILED(status)) { 20 | croak("libsixel error: %s", sixel_helper_format_error(status)); 21 | XSRETURN_UNDEF; 22 | } 23 | klass = SvPV_nolen(ST(0)); 24 | sv = newSViv(PTR2IV(encoder)); 25 | if (!sv) { 26 | XSRETURN_UNDEF; 27 | } 28 | sv = newRV_noinc(sv); 29 | sv_bless(sv, gv_stashpv(klass, 1)); 30 | SvREADONLY_on(sv); 31 | RETVAL = sv; 32 | OUTPUT: 33 | RETVAL 34 | 35 | 36 | void 37 | encoder_setopt(...) 38 | INIT: 39 | SIXELSTATUS status; 40 | IV iv; 41 | sixel_encoder_t *encoder; 42 | char const *arg; 43 | char const *optarg = NULL; 44 | PPCODE: 45 | if (items != 2 && items != 3) { 46 | croak("Bad argument count: %d", items); 47 | } 48 | iv = SvROK(ST(0)) ? SvIV(SvRV(ST(0))) : SvIV(ST(0)); 49 | encoder = INT2PTR(sixel_encoder_t *, iv); 50 | arg = SvPV_nolen(ST(1)); 51 | if (sv_len(ST(1)) != 1) { 52 | croak("Bad argument: %s", arg); 53 | } 54 | if (items == 3) { 55 | optarg = SvPV_nolen(ST(2)); 56 | } 57 | status = sixel_encoder_setopt(encoder, *arg, optarg); 58 | if (SIXEL_FAILED(status)) { 59 | croak("libsixel error: %s", sixel_helper_format_error(status)); 60 | } 61 | 62 | 63 | void 64 | encoder_encode(...) 65 | INIT: 66 | SIXELSTATUS status; 67 | IV iv; 68 | sixel_encoder_t *encoder; 69 | char const *infile; 70 | PPCODE: 71 | if (items != 2) { 72 | croak("Bad argument count: %d", items); 73 | } 74 | iv = SvROK(ST(0)) ? SvIV(SvRV(ST(0))) : SvIV(ST(0)); 75 | encoder = INT2PTR(sixel_encoder_t *, iv); 76 | infile = SvPV_nolen(ST(1)); 77 | status = sixel_encoder_encode(encoder, infile); 78 | if (SIXEL_FAILED(status)) { 79 | croak("libsixel error: %s", sixel_helper_format_error(status)); 80 | } 81 | 82 | 83 | void 84 | encoder_DESTROY(...) 85 | INIT: 86 | IV iv; 87 | sixel_encoder_t *encoder; 88 | PPCODE: 89 | iv = SvROK(ST(0)) ? SvIV(SvRV(ST(0))) : SvIV(ST(0)); 90 | encoder = INT2PTR(sixel_encoder_t *, iv); 91 | sixel_encoder_unref(encoder); 92 | 93 | 94 | 95 | MODULE = Image::LibSIXEL PACKAGE = Image::LibSIXEL::Decoder PREFIX = decoder_ 96 | 97 | SV * 98 | decoder_new(void) 99 | INIT: 100 | SIXELSTATUS status; 101 | sixel_decoder_t *decoder; 102 | SV *sv; 103 | const char *klass; 104 | CODE: 105 | status = sixel_decoder_new(&decoder, NULL); 106 | if (SIXEL_FAILED(status)) { 107 | croak("libsixel error: %s", sixel_helper_format_error(status)); 108 | XSRETURN_UNDEF; 109 | } 110 | klass = SvPV_nolen(ST(0)); 111 | sv = newSViv(PTR2IV(decoder)); 112 | if (!sv) { 113 | XSRETURN_UNDEF; 114 | } 115 | sv = newRV_noinc(sv); 116 | sv_bless(sv, gv_stashpv(klass, 1)); 117 | SvREADONLY_on(sv); 118 | RETVAL = sv; 119 | OUTPUT: 120 | RETVAL 121 | 122 | 123 | void 124 | decoder_setopt(...) 125 | INIT: 126 | SIXELSTATUS status; 127 | IV iv; 128 | sixel_decoder_t *decoder; 129 | char const *arg; 130 | char const *optarg = NULL; 131 | PPCODE: 132 | if (items != 2 && items != 3) { 133 | croak("Bad argument count: %d", items); 134 | } 135 | iv = SvROK(ST(0)) ? SvIV(SvRV(ST(0))) : SvIV(ST(0)); 136 | decoder = INT2PTR(sixel_decoder_t *, iv); 137 | arg = SvPV_nolen(ST(1)); 138 | if (sv_len(ST(1)) != 1) { 139 | croak("Bad argument: %s", arg); 140 | } 141 | if (items == 3) { 142 | optarg = SvPV_nolen(ST(2)); 143 | } 144 | status = sixel_decoder_setopt(decoder, *arg, optarg); 145 | if (SIXEL_FAILED(status)) { 146 | croak("libsixel error: %s", sixel_helper_format_error(status)); 147 | } 148 | 149 | 150 | void 151 | decoder_decode(...) 152 | INIT: 153 | SIXELSTATUS status; 154 | IV iv; 155 | sixel_decoder_t *decoder; 156 | PPCODE: 157 | if (items != 1) { 158 | croak("Bad argument count: %d", items); 159 | } 160 | iv = SvROK(ST(0)) ? SvIV(SvRV(ST(0))) : SvIV(ST(0)); 161 | decoder = INT2PTR(sixel_decoder_t *, iv); 162 | status = sixel_decoder_decode(decoder); 163 | if (SIXEL_FAILED(status)) { 164 | croak("libsixel error: %s", sixel_helper_format_error(status)); 165 | } 166 | 167 | 168 | void 169 | decoder_DESTROY(...) 170 | INIT: 171 | IV iv; 172 | sixel_decoder_t *decoder; 173 | PPCODE: 174 | iv = SvROK(ST(0)) ? SvIV(SvRV(ST(0))) : SvIV(ST(0)); 175 | decoder = INT2PTR(sixel_decoder_t *, iv); 176 | sixel_decoder_unref(decoder); 177 | -------------------------------------------------------------------------------- /perl/lib/Image/LibSIXEL/Decoder.pm: -------------------------------------------------------------------------------- 1 | package Image::LibSIXEL::Decoder; 2 | use Image::LibSIXEL; 3 | 4 | 1; 5 | -------------------------------------------------------------------------------- /perl/lib/Image/LibSIXEL/Encoder.pm: -------------------------------------------------------------------------------- 1 | package Image::LibSIXEL::Encoder; 2 | use Image::LibSIXEL; 3 | 4 | 1; 5 | -------------------------------------------------------------------------------- /perl/minil.toml: -------------------------------------------------------------------------------- 1 | name = "Image-LibSIXEL" 2 | # badges = ["travis"] 3 | module_maker="ModuleBuildTiny" 4 | 5 | [build] 6 | build_class = "builder::MyBuilder" 7 | 8 | 9 | -------------------------------------------------------------------------------- /perl/t/libsixel.t: -------------------------------------------------------------------------------- 1 | # Before 'make install' is performed this script should be runnable with 2 | # 'make test'. After 'make install' it should work as 'perl Hello.t' 3 | 4 | ######################### 5 | 6 | # change 'tests => 1' to 'tests => last_test_to_print'; 7 | 8 | use strict; 9 | use warnings; 10 | use Test::More; 11 | 12 | #use Test::More; 13 | BEGIN { use_ok('Image::LibSIXEL') }; 14 | BEGIN { 15 | unlink "egret.six", "egret.png"; 16 | }; 17 | 18 | ######################### 19 | 20 | # Insert your test code below, the Test::More module is use()ed here so read 21 | # its man page ( perldoc Test::More ) for help writing this test script. 22 | 23 | subtest 'encoder' => sub { 24 | use Image::LibSIXEL; 25 | my $encoder = Image::LibSIXEL::Encoder->new(); 26 | isa_ok $encoder, 'Image::LibSIXEL::Encoder'; 27 | can_ok $encoder, 'setopt', 'encode'; 28 | $encoder->setopt("o", "egret.six"); 29 | $encoder->setopt("w", "200"); 30 | $encoder->encode("images/egret.jpg"); 31 | ok -f "egret.six", 'output file exists'; 32 | }; 33 | 34 | subtest 'decoder' => sub { 35 | use Image::LibSIXEL; 36 | my $decoder = Image::LibSIXEL::Decoder->new; 37 | isa_ok $decoder, 'Image::LibSIXEL::Decoder'; 38 | can_ok $decoder, 'setopt', 'decode'; 39 | $decoder->setopt("i", "images/egret.six"); 40 | $decoder->setopt("o", "egret.png"); 41 | $decoder->decode(); 42 | ok -f "egret.png", 'output file exists'; 43 | }; 44 | 45 | done_testing; 46 | -------------------------------------------------------------------------------- /php/.gitignore: -------------------------------------------------------------------------------- 1 | *.lo 2 | *.la 3 | .deps 4 | .libs 5 | Makefile 6 | Makefile.fragments 7 | Makefile.global 8 | Makefile.objects 9 | acinclude.m4 10 | aclocal.m4 11 | autom4te.cache 12 | build 13 | config.cache 14 | config.guess 15 | config.h 16 | config.h.in 17 | config.log 18 | config.nice 19 | config.status 20 | config.sub 21 | configure 22 | configure.in 23 | conftest 24 | conftest.c 25 | include 26 | install-sh 27 | libtool 28 | ltmain.sh 29 | missing 30 | mkinstalldirs 31 | modules 32 | scan_makefile_in.awk 33 | *.dsw 34 | *.plg 35 | *.opt 36 | *.ncb 37 | Release 38 | Release_inline 39 | Debug 40 | Release_TS 41 | Release_TSDbg 42 | Release_TS_inline 43 | Debug_TS 44 | sixel*.tgz 45 | -------------------------------------------------------------------------------- /php/CREDITS: -------------------------------------------------------------------------------- 1 | sixel 2 | Hayaki Saito 3 | -------------------------------------------------------------------------------- /php/EXPERIMENTAL: -------------------------------------------------------------------------------- 1 | this extension is experimental, 2 | its functions may change their names 3 | or move to extension all together 4 | so do not rely to much on them 5 | you have been warned! 6 | -------------------------------------------------------------------------------- /php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Hayaki Saito 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /php/README: -------------------------------------------------------------------------------- 1 | This is a standalone PHP extension created using CodeGen_PECL 1.1.3 2 | 3 | HACKING 4 | ======= 5 | 6 | There are two ways to modify an extension created using CodeGen_PECL: 7 | 8 | 1) you can modify the generated code as with any other PHP extension 9 | 10 | 2) you can add custom code to the CodeGen_PECL XML source and re-run pecl-gen 11 | 12 | The 2nd approach may look a bit complicated but you have be aware that any 13 | manual changes to the generated code will be lost if you ever change the 14 | XML specs and re-run PECL-Gen. All changes done before have to be applied 15 | to the newly generated code again. 16 | Adding code snippets to the XML source itself on the other hand may be a 17 | bit more complicated but this way your custom code will always be in the 18 | generated code no matter how often you rerun CodeGen_PECL. 19 | 20 | 21 | BUILDING ON UNIX etc. 22 | ===================== 23 | 24 | To compile your new extension, you will have to execute the following steps: 25 | 26 | 1. $ ./phpize 27 | 2. $ ./configure [--with-libsixel=...] 28 | 3. $ make 29 | 4. $ make test 30 | 5. $ [sudo] make install 31 | 32 | 33 | 34 | BUILDING ON WINDOWS 35 | =================== 36 | 37 | The extension provides the VisualStudio V6 project file 38 | 39 | sixel.dsp 40 | To compile the extension you open this file using VisualStudio, 41 | select the apropriate configuration for your installation 42 | (either "Release_TS" or "Debug_TS") and create "php_sixel.dll" 43 | 44 | After successfull compilation you have to copy the newly 45 | created "sixel.dll" to the PHP 46 | extension directory (default: C:\PHP\extensions). 47 | 48 | 49 | TESTING 50 | ======= 51 | 52 | You can now load the extension using a php.ini directive 53 | 54 | extension="sixel.[so|dll]" 55 | 56 | or load it at runtime using the dl() function 57 | 58 | dl("sixel.[so|dll]"); 59 | 60 | The extension should now be available, you can test this 61 | using the extension_loaded() function: 62 | 63 | if (extension_loaded("sixel")) 64 | echo "sixel loaded :)"; 65 | else 66 | echo "something is wrong :("; 67 | 68 | The extension will also add its own block to the output 69 | of phpinfo(); 70 | 71 | -------------------------------------------------------------------------------- /php/config.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl $ Id: $ 3 | dnl 4 | 5 | PHP_ARG_ENABLE(sixel, whether to enable sixel functions, 6 | [ --enable-sixel Enable sixel support]) 7 | 8 | if test "$PHP_SIXEL" != "no"; then 9 | 10 | PHP_ARG_WITH(libsixel, whether libsixel is available,[ --with-libsixel[=DIR] With libsixel support]) 11 | 12 | 13 | 14 | if test -z "$PKG_CONFIG" 15 | then 16 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) 17 | fi 18 | if test "$PKG_CONFIG" = "no" 19 | then 20 | AC_MSG_ERROR([required utility 'pkg-config' not found]) 21 | fi 22 | 23 | if ! $PKG_CONFIG --exists libsixel 24 | then 25 | AC_MSG_ERROR(['libsixel' not known to pkg-config]) 26 | fi 27 | 28 | if ! $PKG_CONFIG --atleast-version 1.5 libsixel 29 | then 30 | PKG_VERSION=`$PKG_CONFIG --modversion libsixel` 31 | AC_MSG_ERROR(['libsixel'\ is version $PKG_VERSION, 1.5 required]) 32 | fi 33 | 34 | PHP_EVAL_INCLINE(`$PKG_CONFIG --cflags-only-I libsixel`) 35 | PHP_EVAL_LIBLINE(`$PKG_CONFIG --libs libsixel`, SIXEL_SHARED_LIBADD) 36 | 37 | export OLD_CPPFLAGS="$CPPFLAGS" 38 | export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_LIBSIXEL" 39 | AC_CHECK_HEADER([sixel.h], [], AC_MSG_ERROR('sixel.h' header not found)) 40 | export CPPFLAGS="$OLD_CPPFLAGS" 41 | 42 | export OLD_CPPFLAGS="$CPPFLAGS" 43 | export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_SIXEL" 44 | 45 | AC_MSG_CHECKING(PHP version) 46 | AC_TRY_COMPILE([#include ], [ 47 | #if PHP_VERSION_ID < 50000 48 | #error this extension requires at least PHP version 5.0.0 49 | #endif 50 | ], 51 | [AC_MSG_RESULT(ok)], 52 | [AC_MSG_ERROR([need at least PHP 5.0.0])]) 53 | 54 | export CPPFLAGS="$OLD_CPPFLAGS" 55 | 56 | 57 | PHP_SUBST(SIXEL_SHARED_LIBADD) 58 | AC_DEFINE(HAVE_SIXEL, 1, [ ]) 59 | 60 | PHP_NEW_EXTENSION(sixel, sixel.c , $ext_shared) 61 | 62 | fi 63 | 64 | -------------------------------------------------------------------------------- /php/config.w32: -------------------------------------------------------------------------------- 1 | // $ Id: $ 2 | // vim:ft=javascript 3 | 4 | ARG_ENABLE('sixel' , 'PHP interface to libsixel', 'no'); 5 | if (PHP_SIXEL == "yes") { 6 | EXTENSION("sixel", "sixel.c"); 7 | AC_DEFINE("HAVE_SIXEL", 1, "sixel support"); 8 | } 9 | -------------------------------------------------------------------------------- /php/manual/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | all: html 3 | 4 | confcheck: 5 | @if test "x$(PHPDOC)" = "x"; then echo PHPDOC not set; exit 3; fi 6 | 7 | manual.xml: manual.xml.in 8 | sed -e's:@PHPDOC@:$(PHPDOC):g' < manual.xml.in > manual.xml 9 | 10 | html: confcheck manual.xml 11 | rm -rf html; mkdir html 12 | SP_ENCODING=XML SP_CHARSET_FIXED=YES openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/docbook/docbook-dsssl/catalog -c $(PHPDOC)/phpbook/phpbook-dsssl/defaults/catalog -d $(PHPDOC)/phpbook/phpbook-dsssl/html.dsl -V use-output-dir -t sgml $(PHPDOC)/phpbook/phpbook-xml/phpdocxml.dcl manual.xml 13 | 14 | bightml: confcheck manual.xml 15 | rm -rf html; mkdir html 16 | SP_ENCODING=XML SP_CHARSET_FIXED=YES openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/docbook/docbook-dsssl/catalog -c $(PHPDOC)/phpbook/phpbook-dsssl/defaults/catalog -d $(PHPDOC)/phpbook/phpbook-dsssl/html.dsl -V nochunks -t sgml $(PHPDOC)/phpbook/phpbook-xml/phpdocxml.dcl manual.xml > manual.html 17 | 18 | tex: manual.tex 19 | 20 | manual.tex: confcheck manual.xml 21 | SP_ENCODING=XML SP_CHARSET_FIXED=YES openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/docbook/docbook-dsssl/catalog -c $(PHPDOC)/phpbook/phpbook-dsssl/defaults/catalog -d $(PHPDOC)/phpbook/phpbook-dsssl/print.dsl -t tex $(PHPDOC)/phpbook/phpbook-xml/phpdocxml.dcl manual.xml 22 | 23 | pdf: manual.tex 24 | pdfjadetex manual.tex && pdfjadetex manual.tex && pdfjadetex manual.tex 25 | -------------------------------------------------------------------------------- /php/manual/file-entities.ent: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /php/manual/functions.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/php/manual/functions.xml -------------------------------------------------------------------------------- /php/manual/manual.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | %language-defs; 10 | %language-snippets; 11 | 12 | 13 | 14 | 15 | 16 | 17 | %language-defs.default; 18 | %language-snippets.default; 19 | %extensions.default; 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | %global.entities; 28 | %file.entities; 29 | 30 | 31 | 32 | %missing-entities; 33 | ]> 34 | 35 | 36 | &reference.sixel.reference; 37 | 38 | -------------------------------------------------------------------------------- /php/manual/sixel/configure.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | &reftitle.required; 6 | &no.requirement; 7 | 8 |
9 | 10 | 11 |
12 | &reftitle.install; 13 | Requires libsixel 14 | 15 |
16 | 17 | 18 | 38 | -------------------------------------------------------------------------------- /php/manual/sixel/constants.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | &reftitle.constants; 5 | &extension.constants; 6 | 7 | &no.constants; 8 | 9 |
10 | 11 | 31 | -------------------------------------------------------------------------------- /php/manual/sixel/ini.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | &reftitle.runtime; 5 | &extension.runtime; 6 | 7 | &no.config; 8 | 9 |
10 | 11 | 31 | -------------------------------------------------------------------------------- /php/manual/sixel/reference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | PHP interface to libsixel 9 | sixel 10 | 11 | 12 |
13 | &reftitle.intro; 14 | 15 | A PHP interface to libsixel. 16 | libsixel is a lightweight, fast implementation of DEC SIXEL graphics codec. 17 | 18 | 19 |
20 | 21 |
22 | &reftitle.required; 23 | 24 | 25 | 26 |
27 | 28 | &reference.sixel.configure; 29 | &reference.extname.ini; 30 | 31 |
32 | &reftitle.resources; 33 | &no.resource; 34 |
35 | 36 | &reference.extname.constants; 37 |
38 | 39 | &reference.sixel.functions; 40 | 41 |
42 | 43 | 63 | -------------------------------------------------------------------------------- /php/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sixel 6 | PHP interface to libsixel 7 | 8 | A PHP interface to libsixel. 9 | libsixel is a lightweight, fast implementation of DEC SIXEL graphics codec. 10 | 11 | 12 | MIT 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | saitoha 21 | Hayaki Saito 22 | saitoha@me.com 23 | developer 24 | 25 | 26 | 27 | 28 | 0.0.2 29 | alpha 30 | Alpha version. 31 | 32 | 2015-08-30 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /php/package2.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | sixel 11 | pecl.php.net 12 | 13 | PHP interface to libsixel 14 | 15 | 16 | A PHP interface to libsixel. 17 | libsixel is a lightweight, fast implementation of DEC SIXEL graphics codec. 18 | 19 | 20 | 21 | Hayaki Saito 22 | saitoha 23 | saitoha@me.com 24 | yes 25 | 26 | 27 | 2015-08-30 28 | 29 | 0.0.2 30 | 0.0.1 31 | 32 | 33 | alpha 34 | alpha 35 | 36 | 37 | MIT 38 | 39 | 40 | Alpha version. 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 5.0.0 66 | 67 | 68 | 1.4.0a1 69 | 70 | 71 | 72 | 73 | sixel 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /php/php_sixel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | /* $ Id: $ */ 23 | 24 | #ifndef PHP_SIXEL_H 25 | #define PHP_SIXEL_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #ifdef HAVE_CONFIG_H 32 | #include "config.h" 33 | #endif 34 | 35 | #include 36 | 37 | #ifdef HAVE_SIXEL 38 | #define PHP_SIXEL_VERSION "0.0.2" 39 | 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #ifdef __cplusplus 46 | } // extern "C" 47 | #endif 48 | #include 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | extern zend_module_entry sixel_module_entry; 54 | #define phpext_sixel_ptr &sixel_module_entry 55 | 56 | #ifdef PHP_WIN32 57 | #define PHP_SIXEL_API __declspec(dllexport) 58 | #else 59 | #define PHP_SIXEL_API 60 | #endif 61 | 62 | PHP_MINIT_FUNCTION(sixel); 63 | PHP_MSHUTDOWN_FUNCTION(sixel); 64 | PHP_RINIT_FUNCTION(sixel); 65 | PHP_RSHUTDOWN_FUNCTION(sixel); 66 | PHP_MINFO_FUNCTION(sixel); 67 | 68 | #ifdef ZTS 69 | #include "TSRM.h" 70 | #endif 71 | 72 | #define FREE_RESOURCE(resource) zend_list_delete(Z_LVAL_P(resource)) 73 | 74 | #define PROP_GET_LONG(name) Z_LVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 75 | #define PROP_SET_LONG(name, l) zend_update_property_long(_this_ce, _this_zval, #name, strlen(#name), l TSRMLS_CC) 76 | 77 | #define PROP_GET_DOUBLE(name) Z_DVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 78 | #define PROP_SET_DOUBLE(name, d) zend_update_property_double(_this_ce, _this_zval, #name, strlen(#name), d TSRMLS_CC) 79 | 80 | #define PROP_GET_STRING(name) Z_STRVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 81 | #define PROP_GET_STRLEN(name) Z_STRLEN_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 82 | #define PROP_SET_STRING(name, s) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s TSRMLS_CC) 83 | #define PROP_SET_STRINGL(name, s, l) zend_update_property_stringl(_this_ce, _this_zval, #name, strlen(#name), s, l TSRMLS_CC) 84 | 85 | 86 | PHP_METHOD(SixelEncoder, __construct); 87 | #if (PHP_MAJOR_VERSION >= 5) 88 | ZEND_BEGIN_ARG_INFO_EX(SixelEncoder____construct_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) 89 | ZEND_END_ARG_INFO() 90 | #else /* PHP 4.x */ 91 | #define SixelEncoder____construct_args NULL 92 | #endif 93 | 94 | PHP_METHOD(SixelEncoder, __destruct); 95 | #if (PHP_MAJOR_VERSION >= 5) 96 | ZEND_BEGIN_ARG_INFO_EX(SixelEncoder____destruct_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) 97 | ZEND_END_ARG_INFO() 98 | #else /* PHP 4.x */ 99 | #define SixelEncoder____destruct_args NULL 100 | #endif 101 | 102 | PHP_METHOD(SixelEncoder, setopt); 103 | #if (PHP_MAJOR_VERSION >= 5) 104 | ZEND_BEGIN_ARG_INFO_EX(SixelEncoder__setopt_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 105 | ZEND_ARG_INFO(0, opt) 106 | ZEND_ARG_INFO(0, arg) 107 | ZEND_END_ARG_INFO() 108 | #else /* PHP 4.x */ 109 | #define SixelEncoder__setopt_args NULL 110 | #endif 111 | 112 | PHP_METHOD(SixelEncoder, encode); 113 | #if (PHP_MAJOR_VERSION >= 5) 114 | ZEND_BEGIN_ARG_INFO_EX(SixelEncoder__encode_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 115 | ZEND_ARG_INFO(0, filename) 116 | ZEND_END_ARG_INFO() 117 | #else /* PHP 4.x */ 118 | #define SixelEncoder__encode_args NULL 119 | #endif 120 | 121 | #ifdef __cplusplus 122 | } // extern "C" 123 | #endif 124 | 125 | #endif /* PHP_HAVE_SIXEL */ 126 | 127 | #endif /* PHP_SIXEL_H */ 128 | 129 | 130 | /* 131 | * Local variables: 132 | * tab-width: 4 133 | * c-basic-offset: 4 134 | * End: 135 | * vim600: noet sw=4 ts=4 fdm=marker 136 | * vim<600: noet sw=4 ts=4 137 | */ 138 | -------------------------------------------------------------------------------- /php/sixel.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="sixel" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 6 | 7 | CFG=sixel - Win32 Debug_TS 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "sixel.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "sixel.mak" CFG="sixel - Win32 Debug_TS" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "sixel - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") 21 | !MESSAGE "sixel - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | MTL=midl.exe 30 | RSC=rc.exe 31 | 32 | !IF "$(CFG)" == "sixel - Win32 Release_TS" 33 | 34 | # PROP BASE Use_MFC 0 35 | # PROP BASE Use_Debug_Libraries 0 36 | # PROP BASE Output_Dir "Release_TS" 37 | # PROP BASE Intermediate_Dir "Release_TS" 38 | # PROP BASE Target_Dir "" 39 | # PROP Use_MFC 0 40 | # PROP Use_Debug_Libraries 0 41 | # PROP Output_Dir "Release_TS" 42 | # PROP Intermediate_Dir "Release_TS" 43 | # PROP Ignore_Export_Lib 0 44 | # PROP Target_Dir "" 45 | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIXEL_EXPORTS" /YX /FD /c 46 | # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_SIXEL" /D ZTS=1 /D HAVE_SIXEL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c 47 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 48 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 49 | # ADD BASE RSC /l 0x407 /d "NDEBUG" 50 | # ADD RSC /l 0x407 /d "NDEBUG" 51 | BSC32=bscmake.exe 52 | # ADD BASE BSC32 /nologo 53 | # ADD BSC32 /nologo 54 | LINK32=link.exe 55 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 56 | # ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_sixel.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" 57 | 58 | !ELSEIF "$(CFG)" == "sixel - Win32 Debug_TS" 59 | 60 | # PROP BASE Use_MFC 0 61 | # PROP BASE Use_Debug_Libraries 1 62 | # PROP BASE Output_Dir "Debug_TS" 63 | # PROP BASE Intermediate_Dir "Debug_TS" 64 | # PROP BASE Target_Dir "" 65 | # PROP Use_MFC 0 66 | # PROP Use_Debug_Libraries 1 67 | # PROP Output_Dir "Debug_TS" 68 | # PROP Intermediate_Dir "Debug_TS" 69 | # PROP Ignore_Export_Lib 0 70 | # PROP Target_Dir "" 71 | # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIXEL_EXPORTS" /YX /FD /GZ /c 72 | # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_SIXEL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SIXEL=1 /YX /FD /GZ /c 73 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 74 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 75 | # ADD BASE RSC /l 0x407 /d "_DEBUG" 76 | # ADD RSC /l 0x407 /d "_DEBUG" 77 | BSC32=bscmake.exe 78 | # ADD BASE BSC32 /nologo 79 | # ADD BSC32 /nologo 80 | LINK32=link.exe 81 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept 82 | # ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_sixel.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" 83 | 84 | !ENDIF 85 | 86 | # Begin Target 87 | 88 | # Name "sixel - Win32 Release_TS" 89 | # Name "sixel - Win32 Debug_TS" 90 | 91 | # Begin Group "Source Files" 92 | 93 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 94 | 95 | # Begin Source File 96 | 97 | SOURCE=./sixel.c 98 | # End Source File 99 | 100 | # End Group 101 | 102 | # Begin Group "Header Files" 103 | 104 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 105 | 106 | # Begin Source File 107 | 108 | SOURCE=.\php_sixel.h 109 | # End Source File 110 | # End Group 111 | # End Target 112 | # End Project 113 | -------------------------------------------------------------------------------- /php/sixel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PHP interface to libsixel 5 | 6 | A PHP interface to libsixel. 7 | libsixel is a lightweight, fast implementation of DEC SIXEL graphics codec. 8 | 9 | 10 | 11 | 12 | saitoha 13 | Hayaki Saito 14 | saitoha@me.com 15 | developer 16 | 17 | 18 | 19 | MIT 20 | 21 | 22 | 0.0.2 23 | alpha 24 | 2015-08-30 25 | 26 | Alpha version. 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | object __construct() 43 | 62 | 63 | 64 | 65 | object __destruct() 66 | 73 | 74 | 75 | 76 | void setopt(string opt[, string arg]) 77 | 92 | 93 | 94 | 95 | void encode(string filename) 96 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /php/tests/SixelEncoder____construct.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | SixelEncoder::__construct() member function 3 | --SKIPIF-- 4 | 9 | --FILE-- 10 | 13 | --EXPECT-- 14 | OK -------------------------------------------------------------------------------- /php/tests/SixelEncoder____destruct.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | SixelEncoder::__destruct() member function 3 | --SKIPIF-- 4 | 9 | --FILE-- 10 | 13 | --EXPECT-- 14 | OK -------------------------------------------------------------------------------- /php/tests/SixelEncoder__encode.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | SixelEncoder::encode() member function 3 | --SKIPIF-- 4 | 9 | --FILE-- 10 | 13 | --EXPECT-- 14 | OK -------------------------------------------------------------------------------- /php/tests/SixelEncoder__setopt.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | SixelEncoder::setopt() member function 3 | --SKIPIF-- 4 | 9 | --FILE-- 10 | 13 | --EXPECT-- 14 | OK -------------------------------------------------------------------------------- /python/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2018 Hayaki Saito 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /python/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | CLEANFILES=libsixel/*.pyc 3 | 4 | clean-local: 5 | rm -rf libsixel_python.egg-info build dist 6 | 7 | if HAVE_PYTHON 8 | libsixeldir = $(pythondir)/libsixel 9 | libsixel_PYTHON = \ 10 | libsixel/__init__.py \ 11 | libsixel/encoder.py \ 12 | libsixel/decoder.py 13 | endif 14 | 15 | EXTRA_DIST = \ 16 | setup.py 17 | 18 | check: check-am 19 | -------------------------------------------------------------------------------- /python/README.rst: -------------------------------------------------------------------------------- 1 | libsixel-python 2 | =============== 3 | 4 | What is this? 5 | ------------- 6 | 7 | This module is a python wrapper of libsixel. 8 | 9 | libsixel: https://github.com/saitoha/libsixel 10 | 11 | Install 12 | ------- 13 | 14 | Example 1. Install into the python prefixed with '/usr/local' :: 15 | 16 | $ git clone https://github.com/saitoha/libsixel.git 17 | $ cd libsixel 18 | $ ./configure --enable-python --prefix=/usr/local 19 | $ make install 20 | 21 | Example 2. Install into only current active python :: 22 | 23 | $ git clone https://github.com/saitoha/libsixel.git 24 | $ cd libsixel 25 | $ ./configure --disable-python 26 | $ make install # install libsixel 27 | $ cd python 28 | $ python setup.py install # install python module 29 | 30 | 31 | Code Example 32 | ------------ 33 | 34 | encoder :: 35 | 36 | from libsixel.encoder import Encoder, SIXEL_OPTFLAG_WIDTH, SIXEL_OPTFLAG_COLORS 37 | 38 | encoder = Encoder() 39 | encoder.setopt(SIXEL_OPTFLAG_WIDTH, "300") 40 | encoder.setopt(SIXEL_OPTFLAG_COLORS, "16") 41 | encoder.encode("test.png") 42 | 43 | 44 | decoder :: 45 | 46 | from libsixel.decoder import Decoder, SIXEL_OPTFLAG_INPUT, SIXEL_OPTFLAG_OUTPUT 47 | 48 | decoder = Decoder() 49 | decoder.setopt(SIXEL_OPTFLAG_INPUT, "test.six") 50 | decoder.setopt(SIXEL_OPTFLAG_OUTPUT, "test.png") 51 | decoder.decode() 52 | 53 | 54 | License 55 | ------- 56 | 57 | The MIT lisence :: 58 | 59 | Copyright (c) 2014-2020 Hayaki Saito 60 | 61 | Permission is hereby granted, free of charge, to any person obtaining a copy of 62 | this software and associated documentation files (the "Software"), to deal in 63 | the Software without restriction, including without limitation the rights to 64 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 65 | the Software, and to permit persons to whom the Software is furnished to do so, 66 | subject to the following conditions: 67 | 68 | The above copyright notice and this permission notice shall be included in all 69 | copies or substantial portions of the Software. 70 | 71 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 72 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 73 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 74 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 75 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 76 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 77 | -------------------------------------------------------------------------------- /python/libsixel/decoder.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c) 2014-2016 Hayaki Saito 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | # this software and associated documentation files (the "Software"), to deal in 7 | # the Software without restriction, including without limitation the rights to 8 | # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | # the Software, and to permit persons to whom the Software is furnished to do so, 10 | # subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | # 22 | 23 | from . import _sixel 24 | from libsixel import * 25 | 26 | class Decoder(object): 27 | 28 | def __init__(self): 29 | self._decoder = sixel_decoder_new() 30 | 31 | def __del__(self): 32 | sixel_decoder_unref(self._decoder) 33 | 34 | def setopt(self, flag, arg=None): 35 | sixel_decoder_setopt(self._decoder, flag, arg) 36 | 37 | def decode(self, infile=None): 38 | sixel_decoder_decode(self._decoder, infile) 39 | 40 | def test(self, infile=None, outfile=None): 41 | import threading 42 | 43 | if infile: 44 | self.setopt(SIXEL_OPTFLAG_INPUT, infile) 45 | if outfile: 46 | self.setopt(SIXEL_OPTFLAG_OUTPUT, outfile) 47 | t = threading.Thread(target=self.decode) 48 | t.daemon = True 49 | t.start() 50 | try: 51 | while t.is_alive(): 52 | t.join(1) 53 | except KeyboardInterrupt: 54 | print("\033\\\033[Jcanceled.") 55 | 56 | 57 | if __name__ == '__main__': 58 | import sys 59 | arg2 = "-" if len(sys.argv) < 3 else sys.argv[2] 60 | Decoder().test(arg1, arg2) 61 | -------------------------------------------------------------------------------- /python/libsixel/encoder.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c) 2014-2016 Hayaki Saito 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | # this software and associated documentation files (the "Software"), to deal in 7 | # the Software without restriction, including without limitation the rights to 8 | # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | # the Software, and to permit persons to whom the Software is furnished to do so, 10 | # subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | # 22 | 23 | from . import _sixel 24 | from libsixel import * 25 | 26 | class Encoder(object): 27 | 28 | def __init__(self): 29 | self._encoder = sixel_encoder_new() 30 | 31 | def __del__(self): 32 | sixel_encoder_unref(self._encoder) 33 | 34 | def setopt(self, flag, arg=None): 35 | sixel_encoder_setopt(self._encoder, flag, arg) 36 | 37 | def encode(self, filename="-"): 38 | sixel_encoder_encode(self._encoder, filename) 39 | 40 | def encode_bytes(self, buf, width, height, pixelformat, palette): 41 | sixel_encoder_encode_bytes(self._encoder, buf, width, height, pixelformat, palette) 42 | 43 | def test(self, filename): 44 | import threading 45 | 46 | self.setopt(SIXEL_OPTFLAG_COLORS, 16) 47 | self.setopt(SIXEL_OPTFLAG_DIFFUSION, "atkinson") 48 | self.setopt(SIXEL_OPTFLAG_WIDTH, 200) 49 | t = threading.Thread(target=self.encode, args=[filename]) 50 | t.daemon = True 51 | t.start() 52 | try: 53 | while t.is_alive(): 54 | t.join(1) 55 | except KeyboardInterrupt: 56 | print("\033\\\033[Jcanceled.") 57 | 58 | 59 | if __name__ == '__main__': 60 | import sys 61 | arg1 = "-" if len(sys.argv) < 2 else sys.argv[1] 62 | Encoder().test(arg1) 63 | -------------------------------------------------------------------------------- /python/setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from setuptools import setup, find_packages 4 | __version__ = '0.5.1' 5 | __license__ = 'MIT' 6 | __author__ = 'Hayaki Saito' 7 | 8 | import inspect 9 | import os 10 | 11 | filename = inspect.getfile(inspect.currentframe()) 12 | dirpath = os.path.abspath(os.path.dirname(filename)) 13 | long_description = open(os.path.join(dirpath, "README.rst")).read() 14 | 15 | setup(name = 'libsixel-python', 16 | version = __version__, 17 | description = 'libsixel binding for Python', 18 | long_description = long_description, 19 | py_modules = ['libsixel'], 20 | classifiers = ['Development Status :: 4 - Production/Stable', 21 | 'Topic :: Terminals', 22 | 'Environment :: Console', 23 | 'Intended Audience :: End Users/Desktop', 24 | 'License :: OSI Approved :: MIT License', 25 | 'Programming Language :: Python' 26 | ], 27 | keywords = 'sixel libsixel terminal codec', 28 | author = __author__, 29 | author_email = 'saitoha@me.com', 30 | url = 'https://github.com/saitoha/libsixel', 31 | license = __license__, 32 | packages = find_packages(exclude=[]), 33 | zip_safe = False, 34 | include_package_data = False, 35 | install_requires = [] 36 | ) 37 | -------------------------------------------------------------------------------- /ruby/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /Gemfile.lock 4 | /_yardoc/ 5 | /coverage/ 6 | /doc/ 7 | /pkg/ 8 | /spec/reports/ 9 | /tmp/ 10 | *.bundle 11 | *.so 12 | *.o 13 | *.a 14 | mkmf.log 15 | -------------------------------------------------------------------------------- /ruby/.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.1.2 4 | -------------------------------------------------------------------------------- /ruby/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in libsixel.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /ruby/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2018 Hayaki Saito 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ruby/README.md: -------------------------------------------------------------------------------- 1 | # Libsixel 2 | 3 | The libsixel gem provides Ruby language bindings for libsixel(https://github.com/saitoha/libsixel). 4 | 5 | ## Requirements 6 | 7 | - libsixel(>=1.5.0) 8 | 9 | ## Installation 10 | 11 | ```ruby 12 | gem 'libsixel-ruby' 13 | ``` 14 | 15 | And then execute: 16 | 17 | $ bundle 18 | 19 | Or install it yourself as: 20 | 21 | $ gem install libsixel-ruby 22 | 23 | ## Usage 24 | 25 | ```ruby 26 | require 'libsixel' 27 | encoder = Encoder.new 28 | encoder.setopt 'p', 16 29 | encoder.setopt 'w', '200' 30 | encoder.encode 'images/egret.jpg' 31 | ``` 32 | 33 | ## Contributing 34 | 35 | 1. Fork it ( https://github.com/[my-github-username]/libsixel-ruby/fork ) 36 | 2. Create your feature branch (`git checkout -b my-new-feature`) 37 | 3. Commit your changes (`git commit -am 'Add some feature'`) 38 | 4. Push to the branch (`git push origin my-new-feature`) 39 | 5. Create a new Pull Request 40 | -------------------------------------------------------------------------------- /ruby/Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | require "rake/testtask" 3 | 4 | Rake::TestTask.new(:test) do |t| 5 | t.libs << "test" 6 | end 7 | 8 | task :default => :test 9 | 10 | require "rake/extensiontask" 11 | 12 | Rake::ExtensionTask.new("libsixel") do |ext| 13 | ext.lib_dir = "lib/libsixel" 14 | end 15 | -------------------------------------------------------------------------------- /ruby/ext/libsixel/extconf.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "mkmf" 4 | if have_header('sixel.h') and have_library('sixel') 5 | create_makefile("libsixel/libsixel") 6 | end 7 | -------------------------------------------------------------------------------- /ruby/ext/libsixel/libsixel.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBSIXEL_H 2 | #define LIBSIXEL_H 1 3 | 4 | #include "ruby.h" 5 | 6 | #endif /* LIBSIXEL_H */ 7 | -------------------------------------------------------------------------------- /ruby/images/egret.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/ruby/images/egret.jpg -------------------------------------------------------------------------------- /ruby/lib/libsixel.rb: -------------------------------------------------------------------------------- 1 | require "libsixel/version" 2 | require "libsixel/libsixel" 3 | 4 | module Libsixel 5 | # Your code goes here... 6 | end 7 | -------------------------------------------------------------------------------- /ruby/lib/libsixel/version.rb: -------------------------------------------------------------------------------- 1 | module Libsixel 2 | VERSION = "0.0.2" 3 | end 4 | -------------------------------------------------------------------------------- /ruby/libsixel-ruby.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'libsixel/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = "libsixel-ruby" 8 | spec.version = Libsixel::VERSION 9 | spec.authors = ["Hayaki Saito"] 10 | spec.email = ["saitoha@me.com"] 11 | spec.extensions = ["ext/libsixel/extconf.rb"] 12 | spec.summary = %q{A ruby interface to libsixel} 13 | spec.description = %q{libsixel is a lightweight, fast implementation of DEC SIXEL graphics codec} 14 | spec.homepage = "http://saitoha.github.com/libsixel" 15 | spec.license = "MIT" 16 | 17 | spec.files = `git ls-files -z`.split("\x0") 18 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 19 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 20 | spec.require_paths = ["lib"] 21 | 22 | spec.add_development_dependency "bundler", "~> 1.7" 23 | spec.add_development_dependency "rake", "~> 10.0" 24 | spec.add_development_dependency "rake-compiler" 25 | spec.add_development_dependency "minitest" 26 | end 27 | -------------------------------------------------------------------------------- /ruby/test/minitest_helper.rb: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) 2 | require 'libsixel' 3 | 4 | require 'minitest/autorun' 5 | -------------------------------------------------------------------------------- /ruby/test/test_libsixel.rb: -------------------------------------------------------------------------------- 1 | require 'minitest_helper' 2 | 3 | class TestLibsixel < MiniTest::Unit::TestCase 4 | 5 | def setup 6 | @encoder = Encoder.new 7 | end 8 | 9 | def test_that_it_has_a_version_number 10 | refute_nil ::Libsixel::VERSION 11 | end 12 | 13 | def test_throws_runtime_error_when_invalid_option_detected 14 | begin 15 | @encoder.setopt('X', '16') 16 | assert false 17 | rescue RuntimeError 18 | assert true 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | srcdir = @srcdir@ 3 | top_srcdir = @top_srcdir@ 4 | VPATH = @srcdir@ 5 | prefix = @prefix@ 6 | exec_prefix = @exec_prefix@ 7 | top_builddir = @top_builddir@ 8 | builddir = @builddir@ 9 | 10 | if COND_GCOV 11 | MAYBE_COVERAGE = --coverage 12 | endif 13 | 14 | CLEANFILES = *.gcno *.gcda *.gcov *.log test-output.* tests 15 | 16 | lib_LTLIBRARIES = libsixel.la 17 | libsixel_la_SOURCES = \ 18 | $(srcdir)/output.c \ 19 | $(srcdir)/output.h \ 20 | $(srcdir)/fromsixel.c \ 21 | $(srcdir)/tosixel.c \ 22 | $(srcdir)/quant.c \ 23 | $(srcdir)/quant.h \ 24 | $(srcdir)/dither.c \ 25 | $(srcdir)/dither.h \ 26 | $(srcdir)/frame.c \ 27 | $(srcdir)/frame.h \ 28 | $(srcdir)/pixelformat.c \ 29 | $(srcdir)/pixelformat.h \ 30 | $(srcdir)/scale.c \ 31 | $(srcdir)/chunk.c \ 32 | $(srcdir)/chunk.h \ 33 | $(srcdir)/loader.c \ 34 | $(srcdir)/loader.h \ 35 | $(srcdir)/frompnm.c \ 36 | $(srcdir)/frompnm.h \ 37 | $(srcdir)/fromgif.c \ 38 | $(srcdir)/fromgif.h \ 39 | $(srcdir)/encoder.c \ 40 | $(srcdir)/encoder.h \ 41 | $(srcdir)/decoder.c \ 42 | $(srcdir)/decoder.h \ 43 | $(srcdir)/stb_image.h \ 44 | $(srcdir)/writer.c \ 45 | $(srcdir)/writer.h \ 46 | $(srcdir)/stb_image_write.c \ 47 | $(srcdir)/stb_image_write.h \ 48 | $(srcdir)/status.c \ 49 | $(srcdir)/status.h \ 50 | $(srcdir)/malloc_stub.c \ 51 | $(srcdir)/malloc_stub.h \ 52 | $(srcdir)/allocator.c \ 53 | $(srcdir)/allocator.h \ 54 | $(srcdir)/tty.c \ 55 | $(srcdir)/tty.h \ 56 | $(srcdir)/rgblookup.h 57 | libsixel_la_CPPFLAGS = -I$(top_builddir)/include/ 58 | libsixel_la_CFLAGS = $(CFLAGS) $(AM_CFLAGS) $(MAYBE_COVERAGE) \ 59 | $(LIBCURL_CFLAGS) \ 60 | $(LIBPNG_CFLAGS) \ 61 | $(LIBJPEG_CFLAGS) \ 62 | $(GDK_PIXBUF_CFLAGS) \ 63 | $(GD_CFLAGS) 64 | libsixel_la_LDFLAGS = -no-undefined -version-info $(LS_LTVERSION) 65 | libsixel_la_LIBADD = -lm \ 66 | $(LIBCURL_LIBS) \ 67 | $(LIBPNG_LIBS) \ 68 | $(LIBJPEG_LIBS) \ 69 | $(GDK_PIXBUF_LIBS) \ 70 | $(GD_LIBS) 71 | 72 | if COND_TESTS 73 | noinst_PROGRAMS = tests 74 | tests_SOURCES = $(srcdir)/tests.c 75 | tests_CPPFLAGS = -I$(top_builddir)/include/ \ 76 | -I$(top_builddir)/src/ $(AM_CPPFLAGS) 77 | tests_CFLAGS = $(CFLAGS) $(AM_CFLAGS) $(MAYBE_COVERAGE) 78 | tests_LDADD = $(srcdir)/libsixel.la 79 | endif 80 | 81 | dist_man_MANS = $(srcdir)/sixel.5 82 | EXTRA_DIST = $(srcdir)/rgblookup.gperf 83 | 84 | unittest: all 85 | if COND_TESTS 86 | $(srcdir)/tests 87 | endif 88 | 89 | gen-rgblookup: $(srcdir)/rgblookup.gperf 90 | gperf -C -N lookup_rgb --ignore-case $< |\ 91 | sed 's/{""}/\{"", 0, 0, 0\}/g' |\ 92 | astyle > $(srcdir)/rgblookup.h 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_ALLOCATOR_H 23 | #define LIBSIXEL_ALLOCATOR_H 24 | 25 | #include 26 | 27 | struct sixel_allocator { 28 | unsigned int ref; /* reference counter */ 29 | sixel_malloc_t fn_malloc; 30 | sixel_calloc_t fn_calloc; 31 | sixel_realloc_t fn_realloc; 32 | sixel_free_t fn_free; 33 | }; 34 | 35 | #if HAVE_TESTS 36 | int 37 | sixel_allocator_tests_main(void); 38 | #endif 39 | 40 | #endif /* LIBSIXEL_ALLOCATOR_H */ 41 | 42 | /* emacs Local Variables: */ 43 | /* emacs mode: c */ 44 | /* emacs tab-width: 4 */ 45 | /* emacs indent-tabs-mode: nil */ 46 | /* emacs c-basic-offset: 4 */ 47 | /* emacs End: */ 48 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 49 | /* EOF */ 50 | -------------------------------------------------------------------------------- /src/chunk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_CHUNK_H 23 | #define LIBSIXEL_CHUNK_H 24 | 25 | #include 26 | 27 | /* chunk object */ 28 | typedef struct sixel_chunk 29 | { 30 | unsigned char *buffer; 31 | size_t size; 32 | size_t max_size; 33 | sixel_allocator_t *allocator; 34 | } sixel_chunk_t; 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | SIXELSTATUS 41 | sixel_chunk_new( 42 | sixel_chunk_t /* out */ **ppchunk, 43 | char const /* in */ *filename, 44 | int /* in */ finsecure, 45 | int const /* in */ *cancel_flag, 46 | sixel_allocator_t /* in */ *allocator); 47 | 48 | 49 | void 50 | sixel_chunk_destroy( 51 | sixel_chunk_t * const /* in */ pchunk); 52 | 53 | 54 | #if HAVE_TESTS 55 | int 56 | sixel_chunk_tests_main(void); 57 | #endif 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* LIBSIXEL_CHUNK_H */ 64 | 65 | /* emacs Local Variables: */ 66 | /* emacs mode: c */ 67 | /* emacs tab-width: 4 */ 68 | /* emacs indent-tabs-mode: nil */ 69 | /* emacs c-basic-offset: 4 */ 70 | /* emacs End: */ 71 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 72 | /* EOF */ 73 | -------------------------------------------------------------------------------- /src/decoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_DECODER_H 23 | #define LIBSIXEL_DECODER_H 24 | 25 | #include 26 | 27 | /* encode settings object */ 28 | struct sixel_decoder { 29 | unsigned int ref; 30 | char *input; 31 | char *output; 32 | sixel_allocator_t *allocator; 33 | }; 34 | 35 | #if HAVE_TESTS 36 | int 37 | sixel_decoder_tests_main(void); 38 | #endif 39 | 40 | #endif /* LIBSIXEL_DECODER_H */ 41 | 42 | /* emacs Local Variables: */ 43 | /* emacs mode: c */ 44 | /* emacs tab-width: 4 */ 45 | /* emacs indent-tabs-mode: nil */ 46 | /* emacs c-basic-offset: 4 */ 47 | /* emacs End: */ 48 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 49 | /* EOF */ 50 | -------------------------------------------------------------------------------- /src/dither.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_DITHER_H 23 | #define LIBSIXEL_DITHER_H 24 | 25 | #include 26 | 27 | /* dither context object */ 28 | struct sixel_dither { 29 | unsigned int ref; /* reference counter */ 30 | unsigned char *palette; /* palette definition */ 31 | unsigned short *cachetable; /* cache table */ 32 | int reqcolors; /* requested colors */ 33 | int ncolors; /* active colors */ 34 | int origcolors; /* original colors */ 35 | int optimized; /* pixel is 15bpp compressable */ 36 | int optimize_palette; /* minimize palette size */ 37 | int complexion; /* for complexion correction */ 38 | int bodyonly; /* do not output palette section if true */ 39 | int method_for_largest; /* method for finding the largest dimention 40 | for splitting */ 41 | int method_for_rep; /* method for choosing a color from the box */ 42 | int method_for_diffuse; /* method for diffusing */ 43 | int quality_mode; /* quality of histogram */ 44 | int keycolor; /* background color */ 45 | int pixelformat; /* pixelformat for internal processing */ 46 | sixel_allocator_t *allocator; /* allocator */ 47 | }; 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* apply palette */ 54 | sixel_index_t * 55 | sixel_dither_apply_palette(struct sixel_dither /* in */ *dither, 56 | unsigned char /* in */ *pixels, 57 | int /* in */ width, 58 | int /* in */ height); 59 | 60 | #if HAVE_TESTS 61 | int 62 | sixel_frame_tests_main(void); 63 | #endif 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* LIBSIXEL_DITHER_H */ 70 | 71 | /* emacs Local Variables: */ 72 | /* emacs mode: c */ 73 | /* emacs tab-width: 4 */ 74 | /* emacs indent-tabs-mode: nil */ 75 | /* emacs c-basic-offset: 4 */ 76 | /* emacs End: */ 77 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 78 | /* EOF */ 79 | -------------------------------------------------------------------------------- /src/encoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_ENCODER_H 23 | #define LIBSIXEL_ENCODER_H 24 | 25 | /* palette type */ 26 | #define SIXEL_COLOR_OPTION_DEFAULT 0 /* use default settings */ 27 | #define SIXEL_COLOR_OPTION_MONOCHROME 1 /* use monochrome palette */ 28 | #define SIXEL_COLOR_OPTION_BUILTIN 2 /* use builtin palette */ 29 | #define SIXEL_COLOR_OPTION_MAPFILE 3 /* use mapfile option */ 30 | #define SIXEL_COLOR_OPTION_HIGHCOLOR 4 /* use highcolor option */ 31 | 32 | /* encoder object */ 33 | struct sixel_encoder { 34 | unsigned int ref; /* reference counter */ 35 | sixel_allocator_t *allocator; /* allocator object */ 36 | int reqcolors; 37 | int color_option; 38 | char *mapfile; 39 | int builtin_palette; 40 | int method_for_diffuse; 41 | int method_for_largest; 42 | int method_for_rep; 43 | int quality_mode; 44 | int method_for_resampling; 45 | int loop_mode; 46 | int palette_type; 47 | int f8bit; 48 | int finvert; 49 | int fuse_macro; 50 | int fignore_delay; 51 | int complexion; 52 | int fstatic; 53 | int pixelwidth; 54 | int pixelheight; 55 | int percentwidth; 56 | int percentheight; 57 | int clipx; 58 | int clipy; 59 | int clipwidth; 60 | int clipheight; 61 | int clipfirst; 62 | int macro_number; 63 | int penetrate_multiplexer; 64 | int encode_policy; 65 | int pipe_mode; 66 | int verbose; 67 | int has_gri_arg_limit; 68 | unsigned char *bgcolor; 69 | int outfd; 70 | int finsecure; 71 | int *cancel_flag; 72 | void *dither_cache; 73 | }; 74 | 75 | #if HAVE_TESTS 76 | int 77 | sixel_encoder_tests_main(void); 78 | #endif 79 | 80 | #endif /* LIBSIXEL_ENCODER_H */ 81 | 82 | /* emacs Local Variables: */ 83 | /* emacs mode: c */ 84 | /* emacs tab-width: 4 */ 85 | /* emacs indent-tabs-mode: nil */ 86 | /* emacs c-basic-offset: 4 */ 87 | /* emacs End: */ 88 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 89 | /* EOF */ 90 | -------------------------------------------------------------------------------- /src/frame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_FRAME_H 23 | #define LIBSIXEL_FRAME_H 24 | 25 | #include 26 | 27 | /* frame object */ 28 | struct sixel_frame { 29 | unsigned int ref; /* reference counter */ 30 | unsigned char *pixels; /* loaded pixel data */ 31 | unsigned char *palette; /* loaded palette data */ 32 | int width; /* frame width */ 33 | int height; /* frame height */ 34 | int ncolors; /* palette colors */ 35 | int pixelformat; /* one of enum pixelFormat */ 36 | int delay; /* delay in msec */ 37 | int frame_no; /* frame number */ 38 | int loop_count; /* loop count */ 39 | int multiframe; /* whether the image has multiple frames */ 40 | int transparent; /* -1(no transparent) or >= 0(index of transparent color) */ 41 | sixel_allocator_t *allocator; /* allocator object */ 42 | }; 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | #if HAVE_TESTS 49 | int 50 | sixel_dither_tests_main(void); 51 | #endif 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* LIBSIXEL_FRAME_H */ 58 | 59 | /* emacs Local Variables: */ 60 | /* emacs mode: c */ 61 | /* emacs tab-width: 4 */ 62 | /* emacs indent-tabs-mode: nil */ 63 | /* emacs c-basic-offset: 4 */ 64 | /* emacs End: */ 65 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 66 | /* EOF */ 67 | -------------------------------------------------------------------------------- /src/fromgif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_FROMGIF_H 23 | #define LIBSIXEL_FROMGIF_H 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* load gif */ 32 | int 33 | load_gif( 34 | unsigned char /* in */ *buffer, 35 | int /* in */ size, 36 | unsigned char /* in */ *bgcolor, 37 | int /* in */ reqcolors, 38 | int /* in */ fuse_palette, 39 | int /* in */ fstatic, 40 | int /* in */ loop_control, 41 | void /* in */ *fn_load, /* callback */ 42 | void /* in */ *context, /* private data for callback */ 43 | sixel_allocator_t /* in */ *allocator /* allocator object */ 44 | ); 45 | 46 | #if HAVE_TESTS 47 | int 48 | sixel_fromgif_tests_main(void); 49 | #endif 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* LIBSIXEL_FROMGIF_H */ 56 | 57 | /* emacs Local Variables: */ 58 | /* emacs mode: c */ 59 | /* emacs tab-width: 4 */ 60 | /* emacs indent-tabs-mode: nil */ 61 | /* emacs c-basic-offset: 4 */ 62 | /* emacs End: */ 63 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 64 | /* EOF */ 65 | -------------------------------------------------------------------------------- /src/frompnm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_FROMPNM_H 23 | #define LIBSIXEL_FROMPNM_H 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* exported functions */ 32 | SIXELSTATUS 33 | load_pnm(unsigned char /* in */ *p, 34 | int /* in */ len, 35 | sixel_allocator_t /* in */ *allocator, 36 | unsigned char /* out */ **result, 37 | int /* out */ *psx, 38 | int /* out */ *psy, 39 | unsigned char /* out */ **ppalette, 40 | int /* out */ *pncolors, 41 | int /* out */ *ppixelformat); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* LIBSIXEL_FROMPNM_H */ 48 | 49 | /* emacs Local Variables: */ 50 | /* emacs mode: c */ 51 | /* emacs tab-width: 4 */ 52 | /* emacs indent-tabs-mode: nil */ 53 | /* emacs c-basic-offset: 4 */ 54 | /* emacs End: */ 55 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 56 | /* EOF */ 57 | -------------------------------------------------------------------------------- /src/loader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_LOADER_H 23 | #define LIBSIXEL_LOADER_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #if HAVE_TESTS 30 | int 31 | sixel_loader_tests_main(void); 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* LIBSIXEL_LOADER_H */ 39 | 40 | /* emacs Local Variables: */ 41 | /* emacs mode: c */ 42 | /* emacs tab-width: 4 */ 43 | /* emacs indent-tabs-mode: nil */ 44 | /* emacs c-basic-offset: 4 */ 45 | /* emacs End: */ 46 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 47 | /* EOF */ 48 | -------------------------------------------------------------------------------- /src/malloc_stub.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #if STDC_HEADERS 25 | # include 26 | #endif /* STDC_HEADERS */ 27 | #if HAVE_SYS_TYPES_H 28 | # include 29 | #endif /* HAVE_SYS_TYPES_H */ 30 | #if HAVE_ERRNO_H 31 | # include 32 | #endif /* HAVE_ERRNO_H */ 33 | #if HAVE_MEMORY_H 34 | # include 35 | #endif /* HAVE_MEMORY_H */ 36 | 37 | #if !HAVE_MALLOC 38 | #undef malloc 39 | void * 40 | rpl_malloc(size_t n) 41 | { 42 | if(n == 0) { 43 | n = 1; 44 | } 45 | return (void *)malloc(n); 46 | } 47 | #endif /* !HAVE_MALLOC */ 48 | 49 | #if !HAVE_REALLOC 50 | #undef realloc 51 | void * 52 | rpl_realloc(void *p, size_t n) 53 | { 54 | if (n == 0) { 55 | n = 1; 56 | } 57 | if (p == 0) { 58 | return malloc(n); 59 | } 60 | return (void *)realloc(p, n); 61 | } 62 | #endif /* !HAVE_REALLOC */ 63 | 64 | #if 0 65 | int 66 | rpl_posix_memalign(void **memptr, size_t alignment, size_t size) 67 | { 68 | #if HAVE_POSIX_MEMALIGN 69 | return posix_memalign(memptr, alignment, size); 70 | #elif HAVE_ALIGNED_ALLOC 71 | *memptr = aligned_alloc(alignment, size); 72 | return *memptr ? 0: ENOMEM; 73 | #elif HAVE_MEMALIGN 74 | *memptr = memalign(alignment, size); 75 | return *memptr ? 0: ENOMEM; 76 | #elif HAVE__ALIGNED_MALLOC 77 | return _aligned_malloc(size, alignment); 78 | #else 79 | # error 80 | #endif /* _MSC_VER */ 81 | } 82 | #endif 83 | 84 | /* emacs Local Variables: */ 85 | /* emacs mode: c */ 86 | /* emacs tab-width: 4 */ 87 | /* emacs indent-tabs-mode: nil */ 88 | /* emacs c-basic-offset: 4 */ 89 | /* emacs End: */ 90 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 91 | /* EOF */ 92 | -------------------------------------------------------------------------------- /src/malloc_stub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef MALLOC_STUB_H 23 | #define MALLOC_STUB_H 24 | 25 | #if HAVE_SYS_TYPES_H 26 | #include 27 | #endif /* HAVE_SYS_TYPES_H */ 28 | 29 | #if !HAVE_MALLOC 30 | void * rpl_malloc(size_t n); 31 | #endif /* !HAVE_MALLOC */ 32 | 33 | #if !HAVE_REALLOC 34 | void * rpl_realloc(void *p, size_t n); 35 | #endif /* !HAVE_REALLOC */ 36 | 37 | #if 0 38 | int rpl_posix_memalign(void **memptr, size_t alignment, size_t size); 39 | #endif 40 | 41 | #endif /* MALLOC_STUB_H */ 42 | 43 | /* emacs Local Variables: */ 44 | /* emacs mode: c */ 45 | /* emacs tab-width: 4 */ 46 | /* emacs indent-tabs-mode: nil */ 47 | /* emacs c-basic-offset: 4 */ 48 | /* emacs End: */ 49 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 50 | /* EOF */ 51 | -------------------------------------------------------------------------------- /src/output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_OUTPUT_H 23 | #define LIBSIXEL_OUTPUT_H 24 | 25 | typedef struct sixel_node { 26 | struct sixel_node *next; 27 | int pal; 28 | int sx; 29 | int mx; 30 | char *map; 31 | } sixel_node_t; 32 | 33 | struct sixel_output { 34 | 35 | int ref; 36 | sixel_allocator_t *allocator; 37 | 38 | /* compatiblity flags */ 39 | 40 | /* 0: 7bit terminal, 41 | * 1: 8bit terminal */ 42 | unsigned char has_8bit_control; 43 | 44 | /* 0: the terminal has sixel scrolling 45 | * 1: the terminal does not have sixel scrolling */ 46 | unsigned char has_sixel_scrolling; 47 | 48 | /* 1: the argument of repeat introducer(DECGRI) is not limitted 49 | 0: the argument of repeat introducer(DECGRI) is limitted 255 */ 50 | unsigned char has_gri_arg_limit; 51 | 52 | /* 0: DECSDM set (CSI ? 80 h) enables sixel scrolling 53 | 1: DECSDM set (CSI ? 80 h) disables sixel scrolling */ 54 | unsigned char has_sdm_glitch; 55 | 56 | /* 0: do not skip DCS envelope 57 | * 1: skip DCS envelope */ 58 | unsigned char skip_dcs_envelope; 59 | 60 | /* PALETTETYPE_AUTO: select palette type automatically 61 | * PALETTETYPE_HLS : HLS color space 62 | * PALETTETYPE_RGB : RGB color space */ 63 | unsigned char palette_type; 64 | 65 | sixel_write_function fn_write; 66 | 67 | int save_pixel; 68 | int save_count; 69 | int active_palette; 70 | 71 | sixel_node_t *node_top; 72 | sixel_node_t *node_free; 73 | 74 | int penetrate_multiplexer; 75 | int encode_policy; 76 | 77 | void *priv; 78 | int pos; 79 | unsigned char buffer[1]; 80 | }; 81 | 82 | #endif /* LIBSIXEL_OUTPUT_H */ 83 | 84 | /* emacs Local Variables: */ 85 | /* emacs mode: c */ 86 | /* emacs tab-width: 4 */ 87 | /* emacs indent-tabs-mode: nil */ 88 | /* emacs c-basic-offset: 4 */ 89 | /* emacs End: */ 90 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 91 | /* EOF */ 92 | -------------------------------------------------------------------------------- /src/pixelformat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_PIXELFORMAT_H 23 | #define LIBSIXEL_PIXELFORMAT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #if HAVE_TESTS 30 | int 31 | sixel_pixelformat_tests_main(void); 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* LIBSIXEL_PIXELFORMAT_H */ 39 | 40 | /* emacs Local Variables: */ 41 | /* emacs mode: c */ 42 | /* emacs tab-width: 4 */ 43 | /* emacs indent-tabs-mode: nil */ 44 | /* emacs c-basic-offset: 4 */ 45 | /* emacs End: */ 46 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 47 | /* EOF */ 48 | -------------------------------------------------------------------------------- /src/quant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_QUANT_H 23 | #define LIBSIXEL_QUANT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | 31 | /* choose colors using median-cut method */ 32 | SIXELSTATUS 33 | sixel_quant_make_palette( 34 | unsigned char /* out */ **result, 35 | unsigned const char /* in */ *data, /* data for sampling */ 36 | unsigned int /* in */ length, /* data size */ 37 | int /* in */ pixelformat, 38 | unsigned int /* in */ reqcolors, 39 | unsigned int /* in */ *ncolors, 40 | unsigned int /* in */ *origcolors, 41 | int /* in */ methodForLargest, 42 | int /* in */ methodForRep, 43 | int /* in */ qualityMode, 44 | sixel_allocator_t /* in */ *allocator); 45 | 46 | 47 | /* apply color palette into specified pixel buffers */ 48 | SIXELSTATUS 49 | sixel_quant_apply_palette( 50 | sixel_index_t /* out */ *result, 51 | unsigned char /* in */ *data, 52 | int /* in */ width, 53 | int /* in */ height, 54 | int /* in */ pixelformat, 55 | unsigned char /* in */ *palette, 56 | int /* in */ reqcolor, 57 | int const /* in */ methodForDiffuse, 58 | int /* in */ foptimize, 59 | int /* in */ foptimize_palette, 60 | int /* in */ complexion, 61 | unsigned short /* in */ *cachetable, 62 | int /* in */ *ncolor, 63 | sixel_allocator_t /* in */ *allocator); 64 | 65 | 66 | /* deallocate specified palette */ 67 | void 68 | sixel_quant_free_palette( 69 | unsigned char /* in */ *data, 70 | sixel_allocator_t /* in */ *allocator); 71 | 72 | #if HAVE_TESTS 73 | int 74 | sixel_quant_tests_main(void); 75 | #endif 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* LIBSIXEL_QUANT_H */ 82 | 83 | /* emacs Local Variables: */ 84 | /* emacs mode: c */ 85 | /* emacs tab-width: 4 */ 86 | /* emacs indent-tabs-mode: nil */ 87 | /* emacs c-basic-offset: 4 */ 88 | /* emacs End: */ 89 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 90 | /* EOF */ 91 | -------------------------------------------------------------------------------- /src/sixel.5: -------------------------------------------------------------------------------- 1 | .TH SIXEL 5 "May 21, 2014" 2 | .SH NAME 3 | sixel \- SIXEL format 4 | .SH DESCRIPTION 5 | SIXEL is a bitmap graphics format for terminals and printers introduced 6 | by Digital Equipment Corp. (DEC). 7 | Its data scheme is represented as a terminal-friendly escape sequence. 8 | So if you want to show a SIXEL image file, all you have to do is "cat" 9 | it to your terminal. 10 | .br 11 | 12 | .TP 5 13 | Terminal requirements: 14 | Several of DEC VT series, VT240/VT241/VT330/VT340/VT282/VT284/VT286/VT382 15 | .br 16 | RLogin (Japanese terminal emulator) 17 | .br 18 | tanasinn (Works with firefox) 19 | .br 20 | mlterm (Works on each of X, win32/cygwin and framebuffer version) 21 | .br 22 | XTerm (configured with --enable-sixel-graphics and launched with "-ti 340" option) 23 | .br 24 | yaft / yaftx (Works on framebuffer / X11 environment) 25 | .br 26 | DECterm 27 | .br 28 | Kermit for DOS 29 | .br 30 | WRQ Reflection 31 | .br 32 | ZSTEM 33 | 34 | .SH "SEE ALSO" 35 | .BR "img2sixel"(1), " sixel2png"(1), " 36 | .LP 37 | All About SIXELs, Sep 29, 1990: 38 | .IP 39 | .br 40 | ftp://ftp.cs.utk.edu/pub/shuford/terminal/all_about_sixels.txt 41 | .LP 42 | Displaying Sixel Image Files, 2014: 43 | .IP 44 | .br 45 | http://rullf2.xs4all.nl/sg/doc.html 46 | .LP 47 | 48 | .\" end of man page 49 | 50 | -------------------------------------------------------------------------------- /src/status.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_STATUS_H 23 | #define LIBSIXEL_STATUS_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #if HAVE_TESTS 30 | int 31 | sixel_status_tests_main(void); 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* LIBSIXEL_STATUS_H */ 39 | 40 | /* emacs Local Variables: */ 41 | /* emacs mode: c */ 42 | /* emacs tab-width: 4 */ 43 | /* emacs indent-tabs-mode: nil */ 44 | /* emacs c-basic-offset: 4 */ 45 | /* emacs End: */ 46 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 47 | /* EOF */ 48 | -------------------------------------------------------------------------------- /src/stb_image_write.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #if !defined(HAVE_MEMCPY) 25 | # define memcpy(d, s, n) (bcopy ((s), (d), (n))) 26 | #endif 27 | 28 | #if !defined(HAVE_MEMMOVE) 29 | # define memmove(d, s, n) (bcopy ((s), (d), (n))) 30 | #endif 31 | 32 | #define STB_IMAGE_WRITE_IMPLEMENTATION 33 | 34 | #if HAVE_DIAGNOSTIC_SIGN_CONVERSION 35 | # pragma GCC diagnostic push 36 | # pragma GCC diagnostic ignored "-Wsign-conversion" 37 | #endif 38 | #if HAVE_DIAGNOSTIC_STRICT_OVERFLOW 39 | # pragma GCC diagnostic push 40 | # pragma GCC diagnostic ignored "-Wstrict-overflow" 41 | #endif 42 | #if HAVE_DIAGNOSTIC_SWITCH_DEFAULT 43 | # pragma GCC diagnostic push 44 | # pragma GCC diagnostic ignored "-Wswitch-default" 45 | #endif 46 | #if HAVE_DIAGNOSTIC_DOUBLE_PROMOTION 47 | # pragma GCC diagnostic push 48 | # pragma GCC diagnostic ignored "-Wdouble-promotion" 49 | #endif 50 | #include "stb_image_write.h" 51 | #if HAVE_DIAGNOSTIC_DOUBLE_PROMOTION 52 | # pragma GCC diagnostic pop 53 | #endif 54 | #if HAVE_DIAGNOSTIC_STRICT_OVERFLOW 55 | # pragma GCC diagnostic pop 56 | #endif 57 | #if HAVE_DIAGNOSTIC_STRICT_OVERFLOW 58 | # pragma GCC diagnostic pop 59 | #endif 60 | #if HAVE_DIAGNOSTIC_SIGN_CONVERSION 61 | # pragma GCC diagnostic pop 62 | #endif 63 | 64 | /* emacs Local Variables: */ 65 | /* emacs mode: c */ 66 | /* emacs tab-width: 4 */ 67 | /* emacs indent-tabs-mode: nil */ 68 | /* emacs c-basic-offset: 4 */ 69 | /* emacs End: */ 70 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 71 | /* EOF */ 72 | -------------------------------------------------------------------------------- /src/tests.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #if STDC_HEADERS 25 | # include 26 | # include 27 | #endif /* STDC_HEADERS */ 28 | #if HAVE_STDRING_H 29 | # include 30 | #endif /* HAVE_STRING_H */ 31 | #if HAVE_MATH_H 32 | # include 33 | #endif /* HAVE_MATH_H */ 34 | #if HAVE_LIMITS_H 35 | # include 36 | #endif /* HAVE_LIMITS_H */ 37 | #if HAVE_INTTYPES_H 38 | # include 39 | #endif /* HAVE_INTTYPES_H */ 40 | 41 | #include 42 | #include "dither.h" 43 | #include "quant.h" 44 | #include "frame.h" 45 | #include "pixelformat.h" 46 | #include "writer.h" 47 | #include "encoder.h" 48 | #include "decoder.h" 49 | #include "status.h" 50 | #include "loader.h" 51 | #include "fromgif.h" 52 | #include "chunk.h" 53 | #include "allocator.h" 54 | 55 | #if HAVE_TESTS 56 | 57 | int 58 | main(int argc, char *argv[]) 59 | { 60 | int nret = EXIT_FAILURE; 61 | 62 | (void) argc; 63 | (void) argv; 64 | 65 | nret = sixel_fromgif_tests_main(); 66 | if (nret != EXIT_SUCCESS) { 67 | goto error; 68 | } 69 | 70 | puts("fromgif ok."); 71 | fflush(stdout); 72 | 73 | nret = sixel_loader_tests_main(); 74 | if (nret != EXIT_SUCCESS) { 75 | goto error; 76 | } 77 | 78 | puts("loader ok."); 79 | fflush(stdout); 80 | 81 | nret = sixel_dither_tests_main(); 82 | if (nret != EXIT_SUCCESS) { 83 | goto error; 84 | } 85 | 86 | puts("dither ok."); 87 | fflush(stdout); 88 | 89 | nret = sixel_pixelformat_tests_main(); 90 | if (nret != EXIT_SUCCESS) { 91 | goto error; 92 | } 93 | 94 | puts("pixelformat ok."); 95 | fflush(stdout); 96 | 97 | nret = sixel_frame_tests_main(); 98 | if (nret != EXIT_SUCCESS) { 99 | goto error; 100 | } 101 | 102 | puts("frame ok."); 103 | fflush(stdout); 104 | 105 | nret = sixel_writer_tests_main(); 106 | if (nret != EXIT_SUCCESS) { 107 | goto error; 108 | } 109 | 110 | puts("writer ok."); 111 | fflush(stdout); 112 | 113 | nret = sixel_quant_tests_main(); 114 | if (nret != EXIT_SUCCESS) { 115 | goto error; 116 | } 117 | 118 | puts("quant ok."); 119 | fflush(stdout); 120 | 121 | nret = sixel_encoder_tests_main(); 122 | if (nret != EXIT_SUCCESS) { 123 | goto error; 124 | } 125 | 126 | puts("encoder ok."); 127 | fflush(stdout); 128 | 129 | nret = sixel_decoder_tests_main(); 130 | if (nret != EXIT_SUCCESS) { 131 | goto error; 132 | } 133 | 134 | puts("decoder ok."); 135 | fflush(stdout); 136 | 137 | nret = sixel_status_tests_main(); 138 | if (nret != EXIT_SUCCESS) { 139 | goto error; 140 | } 141 | 142 | puts("status ok."); 143 | fflush(stdout); 144 | 145 | nret = sixel_chunk_tests_main(); 146 | if (nret != EXIT_SUCCESS) { 147 | goto error; 148 | } 149 | 150 | puts("chunk ok."); 151 | fflush(stdout); 152 | 153 | nret = sixel_allocator_tests_main(); 154 | if (nret != EXIT_SUCCESS) { 155 | goto error; 156 | } 157 | 158 | puts("allocator ok."); 159 | fflush(stdout); 160 | 161 | error: 162 | return nret; 163 | } 164 | 165 | #endif 166 | 167 | /* emacs Local Variables: */ 168 | /* emacs mode: c */ 169 | /* emacs tab-width: 4 */ 170 | /* emacs indent-tabs-mode: nil */ 171 | /* emacs c-basic-offset: 4 */ 172 | /* emacs End: */ 173 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 174 | /* EOF */ 175 | -------------------------------------------------------------------------------- /src/tty.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_TTY_H 23 | #define LIBSIXEL_TTY_H 24 | 25 | SIXELSTATUS 26 | sixel_tty_wait_stdin(int usec); 27 | 28 | SIXELSTATUS 29 | sixel_tty_scroll( 30 | sixel_write_function f_write, 31 | int outfd, 32 | int height, 33 | int is_animation); 34 | 35 | #endif /* LIBSIXEL_TTY_H */ 36 | 37 | /* emacs Local Variables: */ 38 | /* emacs mode: c */ 39 | /* emacs tab-width: 4 */ 40 | /* emacs indent-tabs-mode: nil */ 41 | /* emacs c-basic-offset: 4 */ 42 | /* emacs End: */ 43 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 44 | /* EOF */ 45 | -------------------------------------------------------------------------------- /src/writer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Hayaki Saito 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef LIBSIXEL_WRITER_H 23 | #define LIBSIXEL_WRITER_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #if HAVE_TESTS 30 | int 31 | sixel_writer_tests_main(void); 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* LIBSIXEL_WRITER_H */ 39 | 40 | /* emacs Local Variables: */ 41 | /* emacs mode: c */ 42 | /* emacs tab-width: 4 */ 43 | /* emacs indent-tabs-mode: nil */ 44 | /* emacs c-basic-offset: 4 */ 45 | /* emacs End: */ 46 | /* vim: set expandtab ts=4 sts=4 sw=4 : */ 47 | /* EOF */ 48 | -------------------------------------------------------------------------------- /tools/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | CLEANFILES = 3 | 4 | clean-local: 5 | 6 | bin_SCRIPTS = libsixel-config 7 | 8 | EXTRA_DIST = libsixel-config.in 9 | -------------------------------------------------------------------------------- /tools/libsixel-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Author: Hayaki Saito, 2015 4 | # 5 | 6 | prefix=@prefix@ 7 | exec_prefix=@exec_prefix@ 8 | libdir=@libdir@ 9 | include_dir=@includedir@ 10 | bindir=@bindir@ 11 | datadir=@datadir@ 12 | datarootdir=@datarootdir@ 13 | mandir=@mandir@ 14 | 15 | LANG=C; export LANG 16 | LANGUAGE=C; export LANGUAGE 17 | LC_ALL=C; export LC_ALL 18 | LC_CTYPE=C; export LC_CTYPE 19 | 20 | test $# = 0 && exec /bin/sh $0 --error 21 | 22 | while test $# -gt 0; do 23 | case "$1" in 24 | # basic configuration 25 | --prefix) 26 | echo "$prefix" 27 | ;; 28 | --exec-prefix) 29 | echo "${exec_prefix}" 30 | ;; 31 | # compile/link 32 | --cflags) 33 | echo "-I${include_dir}" 34 | ;; 35 | --libs) 36 | echo "-L${libdir} -lsixel" 37 | ;; 38 | # identification 39 | --version) 40 | echo @PACKAGE_VERSION@ 41 | ;; 42 | --abi-version) 43 | echo @LS_LTVERSION@ | tr : . 44 | ;; 45 | # locations 46 | --bindir) 47 | echo "${bindir}" 48 | ;; 49 | --datadir) 50 | echo "${datadir}" 51 | ;; 52 | --datarootdir) 53 | echo "${datarootdir}" 54 | ;; 55 | --libdir) 56 | echo "${libdir}" 57 | ;; 58 | --mandir) 59 | echo "${mandir}" 60 | ;; 61 | # general info 62 | --help) 63 | cat <&2 86 | exit 1 87 | ;; 88 | esac 89 | shift 90 | done 91 | -------------------------------------------------------------------------------- /wic/wic_install.reg.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/wic/wic_install.reg.in -------------------------------------------------------------------------------- /wic/wic_uninstall.reg.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saitoha/libsixel/6a5be8b72d84037b83a5ea838e17bcf372ab1d5f/wic/wic_uninstall.reg.in --------------------------------------------------------------------------------