| 1 | package SPVM::Resource::Libpng; | ||
| 2 | |||
| 3 | 1 | our $VERSION = "0.015"; | |
| 4 | |||
| 5 | 1 | 1; | |
| 6 | |||
| 7 | =head1 Name | ||
| 8 | |||
| 9 | SPVM::Resource::Libpng - Resource of libpng Library | ||
| 10 | |||
| 11 | =head1 Description | ||
| 12 | |||
| 13 | SPVM::Resource::Libpng class in L<SPVM> is a L<resource|SPVM::Document::Resource> class for the L<libpng|https://github.com/glennrp/libpng> library. | ||
| 14 | |||
| 15 | =head1 Usage | ||
| 16 | |||
| 17 | MyClass.config: | ||
| 18 | |||
| 19 | my $config = SPVM::Builder::Config->new_c99; | ||
| 20 | |||
| 21 | $config->use_resource('Resource::Zlib'); | ||
| 22 | $config->use_resource('Resource::Libpng'); | ||
| 23 | |||
| 24 | $config; | ||
| 25 | |||
| 26 | MyClass.c: | ||
| 27 | |||
| 28 | #include <png.h> | ||
| 29 | |||
| 30 | int32_t SPVM__MyClass__test(SPVM_ENV* env, SPVM_VALUE* stack) { | ||
| 31 | |||
| 32 | png_colorp palette; | ||
| 33 | |||
| 34 | return 0; | ||
| 35 | } | ||
| 36 | |||
| 37 | =head1 Original Product | ||
| 38 | |||
| 39 | L<libpng|https://github.com/glennrp/libpng> | ||
| 40 | |||
| 41 | =head1 Original Product Version | ||
| 42 | |||
| 43 | L<libpng v1.6.45|https://github.com/glennrp/libpng/releases/tag/v1.6.45> | ||
| 44 | |||
| 45 | =head1 Language | ||
| 46 | |||
| 47 | The C language | ||
| 48 | |||
| 49 | =head1 Language Standard | ||
| 50 | |||
| 51 | C99 | ||
| 52 | |||
| 53 | =head1 Required Resources | ||
| 54 | |||
| 55 | =over 2 | ||
| 56 | |||
| 57 | =item * L<SPVM::Resource::Zlib> | ||
| 58 | |||
| 59 | =back | ||
| 60 | |||
| 61 | =head1 Header Files | ||
| 62 | |||
| 63 | =over 2 | ||
| 64 | |||
| 65 | =item * C<pngconf.h> | ||
| 66 | |||
| 67 | =item * C<pngdebug.h> | ||
| 68 | |||
| 69 | =item * C<png.h> | ||
| 70 | |||
| 71 | =item * C<pnginfo.h> | ||
| 72 | |||
| 73 | =item * C<pnglibconf.h> | ||
| 74 | |||
| 75 | =item * C<pngpriv.h> | ||
| 76 | |||
| 77 | =item * C<pngstruct.h> | ||
| 78 | |||
| 79 | =back | ||
| 80 | |||
| 81 | =head1 Source Files | ||
| 82 | |||
| 83 | =over 2 | ||
| 84 | |||
| 85 | =item * C<png.c> | ||
| 86 | |||
| 87 | =item * C<pngerror.c> | ||
| 88 | |||
| 89 | =item * C<pngget.c> | ||
| 90 | |||
| 91 | =item * C<pngmem.c> | ||
| 92 | |||
| 93 | =item * C<pngpread.c> | ||
| 94 | |||
| 95 | =item * C<pngread.c> | ||
| 96 | |||
| 97 | =item * C<pngrio.c> | ||
| 98 | |||
| 99 | =item * C<pngrtran.c> | ||
| 100 | |||
| 101 | =item * C<pngrutil.c> | ||
| 102 | |||
| 103 | =item * C<pngset.c> | ||
| 104 | |||
| 105 | =item * C<pngtest.c> | ||
| 106 | |||
| 107 | =item * C<pngtrans.c> | ||
| 108 | |||
| 109 | =item * C<pngwio.c> | ||
| 110 | |||
| 111 | =item * C<pngwrite.c> | ||
| 112 | |||
| 113 | =item * C<pngwtran.c> | ||
| 114 | |||
| 115 | =item * C<pngwutil.c> | ||
| 116 | |||
| 117 | =item * C<arm/arm_init.c> | ||
| 118 | |||
| 119 | =item * C<arm/filter_neon_intrinsics.c> | ||
| 120 | |||
| 121 | =item * C<arm/filter_neon.S> | ||
| 122 | |||
| 123 | =item * C<arm/palette_neon_intrinsics.c> | ||
| 124 | |||
| 125 | =back | ||
| 126 | |||
| 127 | =head1 How to Create Resource | ||
| 128 | |||
| 129 | =head2 Donwload | ||
| 130 | |||
| 131 | mkdir -p .tmp | ||
| 132 | git clone https://github.com/glennrp/libpng.git .tmp/libpng | ||
| 133 | git -C .tmp/libpng checkout tags/v1.6.45 -b branch_vv1.6.45 | ||
| 134 | git -C .tmp/libpng branch | ||
| 135 | |||
| 136 | =head1 Extracting Header Files | ||
| 137 | |||
| 138 | The header files of C<libpng> is copied into the C<include> directory by the following command. | ||
| 139 | |||
| 140 | rsync -av --include='*.h' --exclude='*' .tmp/libpng/ lib/SPVM/Resource/Libpng.native/include/ | ||
| 141 | |||
| 142 | cp lib/SPVM/Resource/Libpng.native/src/scripts/pnglibconf.h.prebuilt lib/SPVM/Resource/Libpng.native/include/pnglibconf.h | ||
| 143 | |||
| 144 | =head2 Extracting Source Files | ||
| 145 | |||
| 146 | The source files of C<libpng> are copied into the C<src> directory by the following command. | ||
| 147 | |||
| 148 | rsync -av --exclude='.git' .tmp/libpng/ lib/SPVM/Resource/Libpng.native/src/ | ||
| 149 | |||
| 150 | The used L<source files|/"Source Files"> are extracted by the following command. | ||
| 151 | |||
| 152 | find lib/SPVM/Resource/Libpng.native/src/* | perl -p -e 's|^\Qlib/SPVM/Resource/Libpng.native/src/||' | grep -P '^\w+\.c$' | grep -v -P '^example\.c' | ||
| 153 | |||
| 154 | =head1 Repository | ||
| 155 | |||
| 156 | L<SPVM::Resource::Libpng - Github|https://github.com/yuki-kimoto/SPVM-Resource-Libpng> | ||
| 157 | |||
| 158 | =head1 Copyright & License | ||
| 159 | |||
| 160 | Copyright (c) 2023 Yuki Kimoto | ||
| 161 | |||
| 162 | MIT License |