bench9000 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +7 -0
- data/benchmarks/chunky_png/chunky-canvas-resampling-bilinear.rb +69 -0
- data/benchmarks/chunky_png/chunky-canvas-resampling-nearest-neighbor.rb +68 -0
- data/benchmarks/chunky_png/chunky-canvas-resampling-steps-residues.rb +37 -0
- data/benchmarks/chunky_png/chunky-canvas-resampling-steps.rb +37 -0
- data/benchmarks/chunky_png/chunky-color-a.rb +39 -0
- data/benchmarks/chunky_png/chunky-color-b.rb +39 -0
- data/benchmarks/chunky_png/chunky-color-compose-quick.rb +39 -0
- data/benchmarks/chunky_png/chunky-color-g.rb +39 -0
- data/benchmarks/chunky_png/chunky-color-r.rb +39 -0
- data/benchmarks/chunky_png/chunky-decode-png-image-pass.rb +74 -0
- data/benchmarks/chunky_png/chunky-encode-png-image-pass-to-stream.rb +84 -0
- data/benchmarks/chunky_png/chunky-operations-compose.rb +70 -0
- data/benchmarks/chunky_png/chunky-operations-replace.rb +69 -0
- data/benchmarks/chunky_png/chunky_png.patch +22 -0
- data/benchmarks/chunky_png/version.txt +2 -0
- data/benchmarks/classic/binary-trees.rb +100 -0
- data/benchmarks/classic/deltablue.rb +732 -0
- data/benchmarks/classic/fannkuch-redux.rb +111 -0
- data/benchmarks/classic/fasta-string.rb +71 -0
- data/benchmarks/classic/mandelbrot.rb +112 -0
- data/benchmarks/classic/matrix-multiply.rb +78 -0
- data/benchmarks/classic/n-body.rb +188 -0
- data/benchmarks/classic/pidigits.rb +88 -0
- data/benchmarks/classic/red-black.rb +363 -0
- data/benchmarks/classic/richards-kwargs.rb +403 -0
- data/benchmarks/classic/richards.rb +403 -0
- data/benchmarks/classic/spectral-norm.rb +95 -0
- data/benchmarks/default.config.rb +206 -0
- data/benchmarks/graph/connected.rb +62 -0
- data/benchmarks/literature/acid.rb +46 -0
- data/benchmarks/micro/pack-big-U-loop.rb +24 -0
- data/benchmarks/micro/pack-big-xLX-repeat.rb +22 -0
- data/benchmarks/micro/pack-small-mixture.rb +17 -0
- data/benchmarks/micro/string-equal.rb +28 -0
- data/benchmarks/octane/deltablue.rb +981 -0
- data/benchmarks/psd.rb/mock-logger.rb +23 -0
- data/benchmarks/psd.rb/psd-color-cmyk-to-rgb.rb +46 -0
- data/benchmarks/psd.rb/psd-compose-color-burn.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-color-dodge.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-darken.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-difference.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-exclusion.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-hard-light.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-hard-mix.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-lighten.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-linear-burn.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-linear-dodge.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-linear-light.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-multiply.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-normal.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-overlay.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-pin-light.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-screen.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-soft-light.rb +43 -0
- data/benchmarks/psd.rb/psd-compose-vivid-light.rb +43 -0
- data/benchmarks/psd.rb/psd-imageformat-layerraw-parse-raw.rb +70 -0
- data/benchmarks/psd.rb/psd-imageformat-rle-decode-rle-channel.rb +87 -0
- data/benchmarks/psd.rb/psd-imagemode-cmyk-combine-cmyk-channel.rb +65 -0
- data/benchmarks/psd.rb/psd-imagemode-greyscale-combine-greyscale-channel.rb +68 -0
- data/benchmarks/psd.rb/psd-imagemode-rgb-combine-rgb-channel.rb +65 -0
- data/benchmarks/psd.rb/psd-renderer-blender-compose.rb +113 -0
- data/benchmarks/psd.rb/psd-renderer-clippingmask-apply.rb +129 -0
- data/benchmarks/psd.rb/psd-renderer-mask-apply.rb +137 -0
- data/benchmarks/psd.rb/psd-util-clamp.rb +42 -0
- data/benchmarks/psd.rb/psd-util-pad2.rb +42 -0
- data/benchmarks/psd.rb/psd-util-pad4.rb +42 -0
- data/benchmarks/psd.rb/psd_native.patch +99 -0
- data/benchmarks/psd.rb/version.txt +2 -0
- data/benchmarks/topaz/neural-net.rb +208 -0
- data/benchmarks/vm/codeload.rb +35 -0
- data/benchmarks/vm/fixtures/codeload/LICENSE.txt +25 -0
- data/benchmarks/vm/fixtures/codeload/lexer.rb +21493 -0
- data/bin/bench9000 +13 -0
- data/example/report.data +945 -0
- data/example/report.html +59178 -0
- data/lib/bench9000.rb +27 -0
- data/lib/bench9000/benchmark.rb +29 -0
- data/lib/bench9000/commands/command.rb +30 -0
- data/lib/bench9000/commands/compare-reference.rb +70 -0
- data/lib/bench9000/commands/compare.rb +43 -0
- data/lib/bench9000/commands/detail.rb +51 -0
- data/lib/bench9000/commands/list-benchmarks.rb +29 -0
- data/lib/bench9000/commands/list-implementations.rb +29 -0
- data/lib/bench9000/commands/reference.rb +46 -0
- data/lib/bench9000/commands/remove.rb +41 -0
- data/lib/bench9000/commands/report.rb +71 -0
- data/lib/bench9000/commands/score.rb +27 -0
- data/lib/bench9000/config.rb +88 -0
- data/lib/bench9000/group.rb +23 -0
- data/lib/bench9000/harness.rb +68 -0
- data/lib/bench9000/implementation.rb +134 -0
- data/lib/bench9000/json-formatter.rb +50 -0
- data/lib/bench9000/main.rb +268 -0
- data/lib/bench9000/measurement.rb +75 -0
- data/lib/bench9000/micro-harness.rb +39 -0
- data/lib/bench9000/options.rb +31 -0
- data/lib/bench9000/report/bootstrap-theme.css +5 -0
- data/lib/bench9000/report/bootstrap.css +5 -0
- data/lib/bench9000/report/bootstrap.js +6 -0
- data/lib/bench9000/report/chart.js +3432 -0
- data/lib/bench9000/report/chartjs.patch +91 -0
- data/lib/bench9000/report/jquery.js +4 -0
- data/lib/bench9000/report/report.html +177 -0
- data/lib/bench9000/report/report.js +547 -0
- data/lib/bench9000/stats.rb +41 -0
- data/readme.md +205 -0
- data/vendor/chunky_png/BENCHMARKS.rdoc +31 -0
- data/vendor/chunky_png/Gemfile +10 -0
- data/vendor/chunky_png/LICENSE +20 -0
- data/vendor/chunky_png/README.rdoc +84 -0
- data/vendor/chunky_png/Rakefile +11 -0
- data/vendor/chunky_png/benchmarks/decoding_benchmark.rb +36 -0
- data/vendor/chunky_png/benchmarks/encoding_benchmark.rb +40 -0
- data/vendor/chunky_png/benchmarks/filesize_benchmark.rb +28 -0
- data/vendor/chunky_png/chunky_png.gemspec +47 -0
- data/vendor/chunky_png/lib/chunky_png.rb +160 -0
- data/vendor/chunky_png/lib/chunky_png/canvas.rb +372 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/adam7_interlacing.rb +72 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/data_url_exporting.rb +15 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/data_url_importing.rb +21 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/drawing.rb +338 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/masking.rb +91 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/operations.rb +395 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/png_decoding.rb +492 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/png_encoding.rb +442 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/resampling.rb +147 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/stream_exporting.rb +58 -0
- data/vendor/chunky_png/lib/chunky_png/canvas/stream_importing.rb +77 -0
- data/vendor/chunky_png/lib/chunky_png/chunk.rb +328 -0
- data/vendor/chunky_png/lib/chunky_png/color.rb +780 -0
- data/vendor/chunky_png/lib/chunky_png/compatibility.rb +15 -0
- data/vendor/chunky_png/lib/chunky_png/datastream.rb +185 -0
- data/vendor/chunky_png/lib/chunky_png/dimension.rb +113 -0
- data/vendor/chunky_png/lib/chunky_png/image.rb +79 -0
- data/vendor/chunky_png/lib/chunky_png/palette.rb +209 -0
- data/vendor/chunky_png/lib/chunky_png/point.rb +115 -0
- data/vendor/chunky_png/lib/chunky_png/rmagick.rb +43 -0
- data/vendor/chunky_png/lib/chunky_png/vector.rb +186 -0
- data/vendor/chunky_png/lib/chunky_png/version.rb +5 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/adam7_interlacing_spec.rb +106 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/data_url_exporting_spec.rb +13 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/data_url_importing_spec.rb +15 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/drawing_spec.rb +170 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/masking_spec.rb +51 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/operations_spec.rb +388 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/png_decoding_spec.rb +97 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/png_encoding_spec.rb +235 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/resampling_spec.rb +121 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/stream_exporting_spec.rb +59 -0
- data/vendor/chunky_png/spec/chunky_png/canvas/stream_importing_spec.rb +31 -0
- data/vendor/chunky_png/spec/chunky_png/canvas_spec.rb +226 -0
- data/vendor/chunky_png/spec/chunky_png/color_spec.rb +251 -0
- data/vendor/chunky_png/spec/chunky_png/datastream_spec.rb +32 -0
- data/vendor/chunky_png/spec/chunky_png/dimension_spec.rb +48 -0
- data/vendor/chunky_png/spec/chunky_png/image_spec.rb +25 -0
- data/vendor/chunky_png/spec/chunky_png/point_spec.rb +76 -0
- data/vendor/chunky_png/spec/chunky_png/rmagick_spec.rb +23 -0
- data/vendor/chunky_png/spec/chunky_png/vector_spec.rb +104 -0
- data/vendor/chunky_png/spec/chunky_png_spec.rb +8 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bgai4a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bgai4a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bgan6a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bgan6a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bgbn4a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bggn4a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bgwn6a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/background_chunks/bgyn6a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g01.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g02.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g04.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi0g16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi2c08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi2c16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p01.rgba +1 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p02.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p04.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi3p08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi4a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi4a08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi4a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi4a16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi6a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi6a08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi6a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basi6a16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g01.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g02.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g04.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn0g16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn2c08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn2c16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p01.rgba +1 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p02.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p04.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn3p08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn4a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn4a08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn4a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn4a16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn6a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn6a08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn6a16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/basic/basn6a16.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/broken/x00n0g01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/broken/xcrn0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/broken/xlfn0g04.png +13 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi1n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi1n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi2n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi2n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi4n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi4n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi9n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/chunk_ordering/oi9n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/compression_levels/z00n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/compression_levels/z03n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/compression_levels/z06n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/compression_levels/z09n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n0g08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n0g08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n0g08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n2c08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n2c08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f00n2c08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n0g08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n0g08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n0g08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n2c08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n2c08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f01n2c08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n0g08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n0g08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n0g08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n2c08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n2c08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f02n2c08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n0g08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n0g08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n0g08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n2c08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n2c08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f03n2c08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n0g08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n0g08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n0g08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n2c08.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n2c08_reference.png +0 -0
- data/vendor/chunky_png/spec/png_suite/filtering/f04n2c08_reference.rgba +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g03n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g03n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g03n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g04n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g04n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g04n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g05n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g05n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g05n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g07n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g07n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g07n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g10n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g10n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g10n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g25n0g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g25n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/gamma/g25n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/metadata/cm0n0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/metadata/cm7n0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/metadata/cm9n0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ccwn2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ccwn3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cdfn2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cdhn2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cdsn2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cdun2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ch1n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ch2n3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cs3n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cs3n3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cs5n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cs5n3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cs8n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/cs8n3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ct0n0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ct1n0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ctzn0g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/pp0n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/pp0n6a08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ps1n0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ps1n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ps2n0g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/other/ps2n2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s01i3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s01n3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s02i3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s02n3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s03i3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s03n3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s04i3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s04n3p01.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s05i3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s05n3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s06i3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s06n3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s07i3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s07n3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s08i3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s08n3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s09i3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s09n3p02.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s32i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s32n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s33i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s33n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s34i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s34n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s35i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s35n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s36i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s36n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s37i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s37n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s38i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s38n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s39i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s39n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s40i3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/sizes/s40n3p04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbbn1g04.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbbn2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbbn3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbgn2c16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbgn3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbrn2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbwn1g16.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbwn3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tbyn3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tp0n1g08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tp0n2c08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tp0n3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite/transparency/tp1n3p08.png +0 -0
- data/vendor/chunky_png/spec/png_suite_spec.rb +121 -0
- data/vendor/chunky_png/spec/resources/adam7.png +0 -0
- data/vendor/chunky_png/spec/resources/bezier_five_point.png +0 -0
- data/vendor/chunky_png/spec/resources/bezier_four_point.png +0 -0
- data/vendor/chunky_png/spec/resources/bezier_four_point_flipped.png +0 -0
- data/vendor/chunky_png/spec/resources/bezier_four_point_s.png +0 -0
- data/vendor/chunky_png/spec/resources/bezier_six_point.png +0 -0
- data/vendor/chunky_png/spec/resources/bezier_three_point.png +0 -0
- data/vendor/chunky_png/spec/resources/bezier_three_point_flipped.png +0 -0
- data/vendor/chunky_png/spec/resources/circles.png +0 -0
- data/vendor/chunky_png/spec/resources/clock.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_base.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_bl_xdown_ydown.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_bl_xdown_yup.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_bl_xup_yup.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_mask.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_mask_updated.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_nn_xdown_ydown.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_nn_xdown_yup.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_nn_xup_yup.png +0 -0
- data/vendor/chunky_png/spec/resources/clock_updated.png +0 -0
- data/vendor/chunky_png/spec/resources/composited.png +0 -0
- data/vendor/chunky_png/spec/resources/cropped.png +0 -0
- data/vendor/chunky_png/spec/resources/damaged_chunk.png +0 -0
- data/vendor/chunky_png/spec/resources/damaged_signature.png +13 -0
- data/vendor/chunky_png/spec/resources/lines.png +0 -0
- data/vendor/chunky_png/spec/resources/operations.png +0 -0
- data/vendor/chunky_png/spec/resources/operations_border.png +0 -0
- data/vendor/chunky_png/spec/resources/operations_grayscale.png +0 -0
- data/vendor/chunky_png/spec/resources/partial_circles.png +0 -0
- data/vendor/chunky_png/spec/resources/pixelstream.bgr +67 -0
- data/vendor/chunky_png/spec/resources/pixelstream.rgb +67 -1
- data/vendor/chunky_png/spec/resources/pixelstream.rgba +67 -0
- data/vendor/chunky_png/spec/resources/pixelstream_best_compression.png +0 -0
- data/vendor/chunky_png/spec/resources/pixelstream_fast_rgba.png +0 -0
- data/vendor/chunky_png/spec/resources/pixelstream_reference.png +0 -0
- data/vendor/chunky_png/spec/resources/polygon_filled_horizontal.png +0 -0
- data/vendor/chunky_png/spec/resources/polygon_filled_vertical.png +0 -0
- data/vendor/chunky_png/spec/resources/polygon_triangle_filled.png +0 -0
- data/vendor/chunky_png/spec/resources/polygon_unfilled.png +0 -0
- data/vendor/chunky_png/spec/resources/rect.png +0 -0
- data/vendor/chunky_png/spec/resources/replaced.png +0 -0
- data/vendor/chunky_png/spec/resources/text_chunk.png +0 -0
- data/vendor/chunky_png/spec/resources/ztxt_chunk.png +0 -0
- data/vendor/chunky_png/spec/spec_helper.rb +52 -0
- data/vendor/chunky_png/tasks/benchmarks.rake +26 -0
- data/vendor/oily_png/Gemfile +4 -0
- data/vendor/oily_png/LICENSE +20 -0
- data/vendor/oily_png/README.rdoc +26 -0
- data/vendor/oily_png/Rakefile +19 -0
- data/vendor/oily_png/ext/oily_png/color.c +58 -0
- data/vendor/oily_png/ext/oily_png/color.h +29 -0
- data/vendor/oily_png/ext/oily_png/extconf.rb +3 -0
- data/vendor/oily_png/ext/oily_png/oily_png_ext.c +59 -0
- data/vendor/oily_png/ext/oily_png/oily_png_ext.h +72 -0
- data/vendor/oily_png/ext/oily_png/operations.c +122 -0
- data/vendor/oily_png/ext/oily_png/operations.h +36 -0
- data/vendor/oily_png/ext/oily_png/png_decoding.c +374 -0
- data/vendor/oily_png/ext/oily_png/png_decoding.h +27 -0
- data/vendor/oily_png/ext/oily_png/png_encoding.c +302 -0
- data/vendor/oily_png/ext/oily_png/png_encoding.h +19 -0
- data/vendor/oily_png/ext/oily_png/resampling.c +213 -0
- data/vendor/oily_png/ext/oily_png/resampling.h +25 -0
- data/vendor/oily_png/lib/oily_png.rb +21 -0
- data/vendor/oily_png/lib/oily_png/canvas.rb +15 -0
- data/vendor/oily_png/lib/oily_png/version.rb +3 -0
- data/vendor/oily_png/oily_png.gemspec +39 -0
- data/vendor/oily_png/spec/color_spec.rb +38 -0
- data/vendor/oily_png/spec/decoding_spec.rb +51 -0
- data/vendor/oily_png/spec/encoding_spec.rb +135 -0
- data/vendor/oily_png/spec/operations_spec.rb +52 -0
- data/vendor/oily_png/spec/resampling_spec.rb +51 -0
- data/vendor/oily_png/spec/resources/basi0g01.png +0 -0
- data/vendor/oily_png/spec/resources/basi0g02.png +0 -0
- data/vendor/oily_png/spec/resources/basi0g04.png +0 -0
- data/vendor/oily_png/spec/resources/basi0g08.png +0 -0
- data/vendor/oily_png/spec/resources/basi0g16.png +0 -0
- data/vendor/oily_png/spec/resources/basi2c08.png +0 -0
- data/vendor/oily_png/spec/resources/basi2c16.png +0 -0
- data/vendor/oily_png/spec/resources/basi3p01.png +0 -0
- data/vendor/oily_png/spec/resources/basi3p02.png +0 -0
- data/vendor/oily_png/spec/resources/basi3p04.png +0 -0
- data/vendor/oily_png/spec/resources/basi3p08.png +0 -0
- data/vendor/oily_png/spec/resources/basi4a08.png +0 -0
- data/vendor/oily_png/spec/resources/basi4a16.png +0 -0
- data/vendor/oily_png/spec/resources/basi6a08.png +0 -0
- data/vendor/oily_png/spec/resources/basi6a16.png +0 -0
- data/vendor/oily_png/spec/resources/basn0g01.png +0 -0
- data/vendor/oily_png/spec/resources/basn0g02.png +0 -0
- data/vendor/oily_png/spec/resources/basn0g04.png +0 -0
- data/vendor/oily_png/spec/resources/basn0g08.png +0 -0
- data/vendor/oily_png/spec/resources/basn0g16.png +0 -0
- data/vendor/oily_png/spec/resources/basn2c08.png +0 -0
- data/vendor/oily_png/spec/resources/basn2c16.png +0 -0
- data/vendor/oily_png/spec/resources/basn3p01.png +0 -0
- data/vendor/oily_png/spec/resources/basn3p02.png +0 -0
- data/vendor/oily_png/spec/resources/basn3p04.png +0 -0
- data/vendor/oily_png/spec/resources/basn3p08.png +0 -0
- data/vendor/oily_png/spec/resources/basn4a08.png +0 -0
- data/vendor/oily_png/spec/resources/basn4a16.png +0 -0
- data/vendor/oily_png/spec/resources/basn6a08.png +0 -0
- data/vendor/oily_png/spec/resources/basn6a16.png +0 -0
- data/vendor/oily_png/spec/resources/composited.png +0 -0
- data/vendor/oily_png/spec/resources/gray.png +0 -0
- data/vendor/oily_png/spec/resources/interlaced.png +0 -0
- data/vendor/oily_png/spec/resources/nonsquare.png +0 -0
- data/vendor/oily_png/spec/resources/operations.png +0 -0
- data/vendor/oily_png/spec/resources/replaced.png +0 -0
- data/vendor/oily_png/spec/resources/s01i3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s01n3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s02i3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s02n3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s03i3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s03n3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s04i3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s04n3p01.png +0 -0
- data/vendor/oily_png/spec/resources/s05i3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s05n3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s06i3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s06n3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s07i3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s07n3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s08i3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s08n3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s09i3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s09n3p02.png +0 -0
- data/vendor/oily_png/spec/resources/s32i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s32n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s33i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s33n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s34i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s34n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s35i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s35n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s36i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s36n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s37i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s37n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s38i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s38n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s39i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s39n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s40i3p04.png +0 -0
- data/vendor/oily_png/spec/resources/s40n3p04.png +0 -0
- data/vendor/oily_png/spec/resources/square.png +0 -0
- data/vendor/oily_png/spec/resources/tbbn1g04.png +0 -0
- data/vendor/oily_png/spec/resources/tbbn2c16.png +0 -0
- data/vendor/oily_png/spec/resources/tbbn3p08.png +0 -0
- data/vendor/oily_png/spec/resources/tbgn2c16.png +0 -0
- data/vendor/oily_png/spec/resources/tbgn3p08.png +0 -0
- data/vendor/oily_png/spec/resources/tbrn2c08.png +0 -0
- data/vendor/oily_png/spec/resources/tbwn1g16.png +0 -0
- data/vendor/oily_png/spec/resources/tbwn3p08.png +0 -0
- data/vendor/oily_png/spec/resources/tbyn3p08.png +0 -0
- data/vendor/oily_png/spec/resources/tp0n1g08.png +0 -0
- data/vendor/oily_png/spec/resources/tp0n2c08.png +0 -0
- data/vendor/oily_png/spec/resources/tp0n3p08.png +0 -0
- data/vendor/oily_png/spec/resources/tp1n3p08.png +0 -0
- data/vendor/oily_png/spec/spec_helper.rb +40 -0
- data/vendor/oily_png/tasks/testing.rake +49 -0
- data/vendor/psd.rb/CONTRIBUTING.md +7 -0
- data/vendor/psd.rb/Gemfile +2 -0
- data/vendor/psd.rb/Guardfile +8 -0
- data/vendor/psd.rb/LICENSE.txt +22 -0
- data/vendor/psd.rb/README.md +235 -0
- data/vendor/psd.rb/Rakefile +6 -0
- data/vendor/psd.rb/circle.yml +6 -0
- data/vendor/psd.rb/examples/build_image.rb +16 -0
- data/vendor/psd.rb/examples/export_image.rb +12 -0
- data/vendor/psd.rb/examples/export_layer_images.rb +19 -0
- data/vendor/psd.rb/examples/export_node.rb +7 -0
- data/vendor/psd.rb/examples/export_text_data.rb +13 -0
- data/vendor/psd.rb/examples/guides.rb +17 -0
- data/vendor/psd.rb/examples/images/comp-example.psd +0 -0
- data/vendor/psd.rb/examples/images/example-cmyk.psd +0 -0
- data/vendor/psd.rb/examples/images/example-greyscale.psd +0 -0
- data/vendor/psd.rb/examples/images/example-nocompat.psd +0 -0
- data/vendor/psd.rb/examples/images/example.psd +0 -0
- data/vendor/psd.rb/examples/images/example16.psd +0 -0
- data/vendor/psd.rb/examples/images/guides.psd +0 -0
- data/vendor/psd.rb/examples/layer_comps.rb +20 -0
- data/vendor/psd.rb/examples/parse.rb +36 -0
- data/vendor/psd.rb/examples/path.rb +7 -0
- data/vendor/psd.rb/examples/profile.rb +15 -0
- data/vendor/psd.rb/examples/slices.rb +17 -0
- data/vendor/psd.rb/examples/tree.rb +8 -0
- data/vendor/psd.rb/examples/unimplemented_info.rb +9 -0
- data/vendor/psd.rb/lib/psd.rb +173 -0
- data/vendor/psd.rb/lib/psd/blend_mode.rb +80 -0
- data/vendor/psd.rb/lib/psd/channel_image.rb +115 -0
- data/vendor/psd.rb/lib/psd/color.rb +125 -0
- data/vendor/psd.rb/lib/psd/descriptor.rb +200 -0
- data/vendor/psd.rb/lib/psd/file.rb +104 -0
- data/vendor/psd.rb/lib/psd/header.rb +69 -0
- data/vendor/psd.rb/lib/psd/helpers.rb +51 -0
- data/vendor/psd.rb/lib/psd/image.rb +123 -0
- data/vendor/psd.rb/lib/psd/image_exports/png.rb +31 -0
- data/vendor/psd.rb/lib/psd/image_formats/layer_raw.rb +21 -0
- data/vendor/psd.rb/lib/psd/image_formats/layer_rle.rb +24 -0
- data/vendor/psd.rb/lib/psd/image_formats/raw.rb +12 -0
- data/vendor/psd.rb/lib/psd/image_formats/rle.rb +63 -0
- data/vendor/psd.rb/lib/psd/image_modes/cmyk.rb +31 -0
- data/vendor/psd.rb/lib/psd/image_modes/greyscale.rb +22 -0
- data/vendor/psd.rb/lib/psd/image_modes/rgb.rb +32 -0
- data/vendor/psd.rb/lib/psd/layer.rb +77 -0
- data/vendor/psd.rb/lib/psd/layer/blend_modes.rb +30 -0
- data/vendor/psd.rb/lib/psd/layer/blending_ranges.rb +62 -0
- data/vendor/psd.rb/lib/psd/layer/channel_image.rb +15 -0
- data/vendor/psd.rb/lib/psd/layer/exporting.rb +28 -0
- data/vendor/psd.rb/lib/psd/layer/helpers.rb +77 -0
- data/vendor/psd.rb/lib/psd/layer/info.rb +74 -0
- data/vendor/psd.rb/lib/psd/layer/mask.rb +19 -0
- data/vendor/psd.rb/lib/psd/layer/name.rb +33 -0
- data/vendor/psd.rb/lib/psd/layer/path_components.rb +22 -0
- data/vendor/psd.rb/lib/psd/layer/position_and_channels.rb +47 -0
- data/vendor/psd.rb/lib/psd/layer_info.rb +27 -0
- data/vendor/psd.rb/lib/psd/layer_info/blend_clipping_elements.rb +13 -0
- data/vendor/psd.rb/lib/psd/layer_info/blend_interior_elements.rb +13 -0
- data/vendor/psd.rb/lib/psd/layer_info/fill_opacity.rb +13 -0
- data/vendor/psd.rb/lib/psd/layer_info/layer_group.rb +30 -0
- data/vendor/psd.rb/lib/psd/layer_info/layer_id.rb +13 -0
- data/vendor/psd.rb/lib/psd/layer_info/layer_name_source.rb +14 -0
- data/vendor/psd.rb/lib/psd/layer_info/layer_section_divider.rb +48 -0
- data/vendor/psd.rb/lib/psd/layer_info/legacy_typetool.rb +88 -0
- data/vendor/psd.rb/lib/psd/layer_info/locked.rb +19 -0
- data/vendor/psd.rb/lib/psd/layer_info/metadata_setting.rb +35 -0
- data/vendor/psd.rb/lib/psd/layer_info/object_effects.rb +16 -0
- data/vendor/psd.rb/lib/psd/layer_info/placed_layer.rb +13 -0
- data/vendor/psd.rb/lib/psd/layer_info/reference_point.rb +16 -0
- data/vendor/psd.rb/lib/psd/layer_info/typetool.rb +165 -0
- data/vendor/psd.rb/lib/psd/layer_info/unicode_name.rb +17 -0
- data/vendor/psd.rb/lib/psd/layer_info/vector_mask.rb +25 -0
- data/vendor/psd.rb/lib/psd/layer_info/vector_mask_2.rb +10 -0
- data/vendor/psd.rb/lib/psd/layer_info/vector_stroke.rb +12 -0
- data/vendor/psd.rb/lib/psd/layer_info/vector_stroke_content.rb +15 -0
- data/vendor/psd.rb/lib/psd/layer_mask.rb +129 -0
- data/vendor/psd.rb/lib/psd/lazy_execute.rb +60 -0
- data/vendor/psd.rb/lib/psd/logger.rb +40 -0
- data/vendor/psd.rb/lib/psd/mask.rb +74 -0
- data/vendor/psd.rb/lib/psd/node.rb +70 -0
- data/vendor/psd.rb/lib/psd/node_exporting.rb +20 -0
- data/vendor/psd.rb/lib/psd/node_group.rb +86 -0
- data/vendor/psd.rb/lib/psd/node_layer.rb +81 -0
- data/vendor/psd.rb/lib/psd/node_root.rb +93 -0
- data/vendor/psd.rb/lib/psd/nodes/ancestry.rb +98 -0
- data/vendor/psd.rb/lib/psd/nodes/build_preview.rb +17 -0
- data/vendor/psd.rb/lib/psd/nodes/has_children.rb +13 -0
- data/vendor/psd.rb/lib/psd/nodes/lock_to_origin.rb +7 -0
- data/vendor/psd.rb/lib/psd/nodes/parse_layers.rb +18 -0
- data/vendor/psd.rb/lib/psd/nodes/search.rb +91 -0
- data/vendor/psd.rb/lib/psd/path_record.rb +180 -0
- data/vendor/psd.rb/lib/psd/renderer.rb +91 -0
- data/vendor/psd.rb/lib/psd/renderer/blender.rb +53 -0
- data/vendor/psd.rb/lib/psd/renderer/canvas.rb +95 -0
- data/vendor/psd.rb/lib/psd/renderer/canvas_management.rb +26 -0
- data/vendor/psd.rb/lib/psd/renderer/clipping_mask.rb +41 -0
- data/vendor/psd.rb/lib/psd/renderer/compose.rb +361 -0
- data/vendor/psd.rb/lib/psd/renderer/layer_styles.rb +56 -0
- data/vendor/psd.rb/lib/psd/renderer/layer_styles/color_overlay.rb +65 -0
- data/vendor/psd.rb/lib/psd/renderer/layer_styles/drop_shadow.rb +75 -0
- data/vendor/psd.rb/lib/psd/renderer/mask.rb +46 -0
- data/vendor/psd.rb/lib/psd/resource.rb +26 -0
- data/vendor/psd.rb/lib/psd/resource_section.rb +22 -0
- data/vendor/psd.rb/lib/psd/resources.rb +69 -0
- data/vendor/psd.rb/lib/psd/resources/guides.rb +35 -0
- data/vendor/psd.rb/lib/psd/resources/layer_comps.rb +42 -0
- data/vendor/psd.rb/lib/psd/resources/slices.rb +132 -0
- data/vendor/psd.rb/lib/psd/section.rb +26 -0
- data/vendor/psd.rb/lib/psd/util.rb +18 -0
- data/vendor/psd.rb/lib/psd/version.rb +3 -0
- data/vendor/psd.rb/psd.gemspec +32 -0
- data/vendor/psd.rb/spec/files/blendmodes.psd +0 -0
- data/vendor/psd.rb/spec/files/empty-layer-subgroups.psd +0 -0
- data/vendor/psd.rb/spec/files/empty-layer.psd +0 -0
- data/vendor/psd.rb/spec/files/example.psd +0 -0
- data/vendor/psd.rb/spec/files/guides.psd +0 -0
- data/vendor/psd.rb/spec/files/locked.psd +0 -0
- data/vendor/psd.rb/spec/files/one_layer.psd +0 -0
- data/vendor/psd.rb/spec/files/path.psd +0 -0
- data/vendor/psd.rb/spec/files/pixel.psd +0 -0
- data/vendor/psd.rb/spec/files/simplest.psd +0 -0
- data/vendor/psd.rb/spec/files/slices.psd +0 -0
- data/vendor/psd.rb/spec/files/text.psd +0 -0
- data/vendor/psd.rb/spec/guides_spec.rb +34 -0
- data/vendor/psd.rb/spec/hierarchy_spec.rb +152 -0
- data/vendor/psd.rb/spec/image_spec.rb +86 -0
- data/vendor/psd.rb/spec/lazy_execute_spec.rb +20 -0
- data/vendor/psd.rb/spec/locked_spec.rb +78 -0
- data/vendor/psd.rb/spec/parsing_spec.rb +163 -0
- data/vendor/psd.rb/spec/psd_spec.rb +37 -0
- data/vendor/psd.rb/spec/slices_spec.rb +57 -0
- data/vendor/psd.rb/spec/spec_helper.rb +13 -0
- data/vendor/psd.rb/spec/text_spec.rb +27 -0
- data/vendor/psd_native/Gemfile +4 -0
- data/vendor/psd_native/Guardfile +6 -0
- data/vendor/psd_native/LICENSE.txt +22 -0
- data/vendor/psd_native/README.md +48 -0
- data/vendor/psd_native/Rakefile +13 -0
- data/vendor/psd_native/ext/psd_native/blender.c +57 -0
- data/vendor/psd_native/ext/psd_native/blender.h +6 -0
- data/vendor/psd_native/ext/psd_native/canvas.c +9 -0
- data/vendor/psd_native/ext/psd_native/canvas.h +6 -0
- data/vendor/psd_native/ext/psd_native/clipping_mask.c +57 -0
- data/vendor/psd_native/ext/psd_native/clipping_mask.h +6 -0
- data/vendor/psd_native/ext/psd_native/color.c +20 -0
- data/vendor/psd_native/ext/psd_native/color.h +18 -0
- data/vendor/psd_native/ext/psd_native/compose.c +394 -0
- data/vendor/psd_native/ext/psd_native/compose.h +43 -0
- data/vendor/psd_native/ext/psd_native/extconf.rb +3 -0
- data/vendor/psd_native/ext/psd_native/file.c +20 -0
- data/vendor/psd_native/ext/psd_native/file.h +9 -0
- data/vendor/psd_native/ext/psd_native/image_mode_cmyk.c +64 -0
- data/vendor/psd_native/ext/psd_native/image_mode_cmyk.h +6 -0
- data/vendor/psd_native/ext/psd_native/image_mode_greyscale.c +27 -0
- data/vendor/psd_native/ext/psd_native/image_mode_greyscale.h +6 -0
- data/vendor/psd_native/ext/psd_native/image_mode_rgb.c +49 -0
- data/vendor/psd_native/ext/psd_native/image_mode_rgb.h +6 -0
- data/vendor/psd_native/ext/psd_native/layer_raw.c +20 -0
- data/vendor/psd_native/ext/psd_native/layer_raw.h +6 -0
- data/vendor/psd_native/ext/psd_native/mask.c +52 -0
- data/vendor/psd_native/ext/psd_native/mask.h +6 -0
- data/vendor/psd_native/ext/psd_native/psd_native_ext.c +87 -0
- data/vendor/psd_native/ext/psd_native/psd_native_ext.h +31 -0
- data/vendor/psd_native/ext/psd_native/rle_decoding.c +53 -0
- data/vendor/psd_native/ext/psd_native/rle_decoding.h +6 -0
- data/vendor/psd_native/ext/psd_native/util.c +17 -0
- data/vendor/psd_native/ext/psd_native/util.h +8 -0
- data/vendor/psd_native/lib/psd_native.rb +35 -0
- data/vendor/psd_native/lib/psd_native/compose.rb +19 -0
- data/vendor/psd_native/lib/psd_native/version.rb +3 -0
- data/vendor/psd_native/psd_native.gemspec +35 -0
- data/vendor/psd_native/spec/files/example.psd +0 -0
- data/vendor/psd_native/spec/files/one_layer.psd +0 -0
- data/vendor/psd_native/spec/files/path.psd +0 -0
- data/vendor/psd_native/spec/files/pixel.psd +0 -0
- data/vendor/psd_native/spec/files/simplest.psd +0 -0
- data/vendor/psd_native/spec/files/text.psd +0 -0
- data/vendor/psd_native/spec/image_spec.rb +86 -0
- data/vendor/psd_native/spec/psd_spec.rb +37 -0
- data/vendor/psd_native/spec/spec_helper.rb +13 -0
- data/vendor/psd_native/spec/util_spec.rb +15 -0
- metadata +767 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
#ifndef OILY_PNG_PNG_DECODING_H
|
2
|
+
#define OILY_PNG_PNG_DECODING_H
|
3
|
+
|
4
|
+
#define UNFILTER_BYTE(byte, adjustment) byte = (BYTE) (((byte) + (adjustment)) & 0x000000ff)
|
5
|
+
|
6
|
+
#define ADD_PIXEL_FROM_PALLETE(pixels, decoding_palette, palette_entry) \
|
7
|
+
if (RARRAY_LEN(decoding_palette) > (palette_entry)) { \
|
8
|
+
rb_ary_push(pixels, rb_ary_entry(decoding_palette, (palette_entry))); \
|
9
|
+
} else { \
|
10
|
+
rb_raise(rb_eRuntimeError, "The decoding palette does not have %d entries!", (palette_entry)); \
|
11
|
+
}
|
12
|
+
|
13
|
+
#define ADD_PIXEL_FROM_RGBA(pixels, r, g, b, a) rb_ary_push(pixels, UINT2NUM(BUILD_PIXEL(r,g,b,a)));
|
14
|
+
|
15
|
+
|
16
|
+
typedef void(*scanline_decoder_func)(VALUE, BYTE*, long, long, VALUE);
|
17
|
+
|
18
|
+
/*
|
19
|
+
Decodes an image pass from the given byte stream at the given position.
|
20
|
+
A normal PNG will only have one pass that consumes the entire stream, while an
|
21
|
+
interlaced image requires 7 passes which are loaded from different starting positions.
|
22
|
+
|
23
|
+
This function shouild replace ChunkyPNG::Canvas::PNGDecoding.decode_png_image_pass
|
24
|
+
*/
|
25
|
+
VALUE oily_png_decode_png_image_pass(VALUE self, VALUE stream, VALUE width, VALUE height, VALUE color_mode, VALUE depth, VALUE start_pos);
|
26
|
+
|
27
|
+
#endif
|
@@ -0,0 +1,302 @@
|
|
1
|
+
#include "oily_png_ext.h"
|
2
|
+
|
3
|
+
///// Scanline filtering functions //////////////////////////////////////////
|
4
|
+
|
5
|
+
void oily_png_encode_filter_sub(BYTE* bytes, long pos, long line_size, char pixel_size) {
|
6
|
+
long x;
|
7
|
+
for (x = line_size - 1; x > pixel_size; x--) {
|
8
|
+
FILTER_BYTE(bytes[pos + x], bytes[pos + x - pixel_size]);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
void oily_png_encode_filter_up(BYTE* bytes, long pos, long line_size, char pixel_size) {
|
13
|
+
UNUSED_PARAMETER(pixel_size);
|
14
|
+
|
15
|
+
long x;
|
16
|
+
if (pos >= line_size) {
|
17
|
+
for (x = line_size - 1; x > 0; x--) {
|
18
|
+
FILTER_BYTE(bytes[pos + x], bytes[pos + x - line_size]);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
void oily_png_encode_filter_average(BYTE* bytes, long pos, long line_size, char pixel_size) {
|
24
|
+
long x; BYTE a, b;
|
25
|
+
for (x = line_size - 1; x > 0; x--) {
|
26
|
+
a = (x > pixel_size) ? bytes[pos + x - pixel_size] : 0;
|
27
|
+
b = (pos >= line_size) ? bytes[pos + x - line_size] : 0;
|
28
|
+
FILTER_BYTE(bytes[pos + x], (a + b) >> 1);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
void oily_png_encode_filter_paeth(BYTE* bytes, long pos, long line_size, char pixel_size) {
|
33
|
+
long x; int p, pa, pb, pc; BYTE a, b, c, pr;
|
34
|
+
for (x = line_size - 1; x > 0; x--) {
|
35
|
+
a = (x > pixel_size) ? bytes[pos + x - pixel_size] : 0;
|
36
|
+
b = (pos >= line_size) ? bytes[pos + x - line_size] : 0;
|
37
|
+
c = (pos >= line_size && x > pixel_size) ? bytes[pos + x - line_size - pixel_size] : 0;
|
38
|
+
p = a + b - c;
|
39
|
+
pa = abs(p - a);
|
40
|
+
pb = abs(p - b);
|
41
|
+
pc = abs(p - c);
|
42
|
+
pr = (pa <= pb && pa <= pc) ? a : (pb <= pc ? b : c);
|
43
|
+
FILTER_BYTE(bytes[pos + x], pr);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
///// Scanline encoding functions //////////////////////////////////////////
|
48
|
+
|
49
|
+
// Assume R == G == B. ChunkyPNG uses the B byte fot performance reasons.
|
50
|
+
// We'll uses the same to remain compatible with ChunkyPNG.
|
51
|
+
void oily_png_encode_scanline_grayscale_1bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
52
|
+
UNUSED_PARAMETER(encoding_palette);
|
53
|
+
long x; BYTE p1, p2, p3, p4, p5, p6, p7, p8;
|
54
|
+
for (x = 0; x < width; x += 8) {
|
55
|
+
p1 = (x + 0 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 0))) >> 7);
|
56
|
+
p2 = (x + 1 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 1))) >> 7);
|
57
|
+
p3 = (x + 2 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 2))) >> 7);
|
58
|
+
p4 = (x + 3 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 3))) >> 7);
|
59
|
+
p5 = (x + 4 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 4))) >> 7);
|
60
|
+
p6 = (x + 5 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 5))) >> 7);
|
61
|
+
p7 = (x + 6 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 6))) >> 7);
|
62
|
+
p8 = (x + 7 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 7))) >> 7);
|
63
|
+
bytes[x >> 3] = (BYTE) ((p1 << 7) | (p2 << 6) | (p3 << 5) | (p4 << 4) | (p5 << 3) | (p6 << 2) | (p7 << 1) | (p8));
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
// Assume R == G == B. ChunkyPNG uses the B byte fot performance reasons.
|
69
|
+
// We'll uses the same to remain compatible with ChunkyPNG.
|
70
|
+
void oily_png_encode_scanline_grayscale_2bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
71
|
+
UNUSED_PARAMETER(encoding_palette);
|
72
|
+
long x; BYTE p1, p2, p3, p4;
|
73
|
+
for (x = 0; x < width; x += 4) {
|
74
|
+
p1 = (x + 0 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 0))) >> 6);
|
75
|
+
p2 = (x + 1 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 1))) >> 6);
|
76
|
+
p3 = (x + 2 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 2))) >> 6);
|
77
|
+
p4 = (x + 3 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 3))) >> 6);
|
78
|
+
bytes[x >> 2] = (BYTE) ((p1 << 6) | (p2 << 4) | (p3 << 2) | (p4));
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
// Assume R == G == B. ChunkyPNG uses the B byte fot performance reasons.
|
83
|
+
// We'll uses the same to remain compatible with ChunkyPNG.
|
84
|
+
void oily_png_encode_scanline_grayscale_4bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
85
|
+
UNUSED_PARAMETER(encoding_palette);
|
86
|
+
long x; BYTE p1, p2;
|
87
|
+
for (x = 0; x < width; x += 2) {
|
88
|
+
p1 = (x + 0 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 0))) >> 4);
|
89
|
+
p2 = (x + 1 >= width) ? 0 : (B_BYTE(NUM2UINT(rb_ary_entry(pixels, y * width + x + 1))) >> 4);
|
90
|
+
bytes[x >> 1] = (BYTE) ((p1 << 4) | (p2));
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
// Assume R == G == B. ChunkyPNG uses the B byte fot performance reasons.
|
95
|
+
// We'll uses the same to remain compatible with ChunkyPNG.
|
96
|
+
void oily_png_encode_scanline_grayscale_8bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
97
|
+
UNUSED_PARAMETER(encoding_palette);
|
98
|
+
long x; PIXEL pixel;
|
99
|
+
for (x = 0; x < width; x++) {
|
100
|
+
pixel = NUM2UINT(rb_ary_entry(pixels, y * width + x));
|
101
|
+
bytes[x] = B_BYTE(pixel);
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
// Assume R == G == B. ChunkyPNG uses the B byte fot performance reasons.
|
106
|
+
// We'll uses the same to remain compatible with ChunkyPNG.
|
107
|
+
void oily_png_encode_scanline_grayscale_alpha_8bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
108
|
+
UNUSED_PARAMETER(encoding_palette);
|
109
|
+
long x; PIXEL pixel;
|
110
|
+
for (x = 0; x < width; x++) {
|
111
|
+
pixel = NUM2UINT(rb_ary_entry(pixels, y * width + x));
|
112
|
+
bytes[x * 2 + 0] = B_BYTE(pixel);
|
113
|
+
bytes[x * 2 + 1] = A_BYTE(pixel);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
void oily_png_encode_scanline_indexed_8bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
118
|
+
long x;
|
119
|
+
for (x = 0; x < width; x++) {
|
120
|
+
bytes[x] = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
void oily_png_encode_scanline_indexed_4bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
125
|
+
long x; BYTE p1, p2;
|
126
|
+
for (x = 0; x < width; x += 2) {
|
127
|
+
p1 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 0);
|
128
|
+
p2 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 1);
|
129
|
+
bytes[x >> 1] = (BYTE) ((p1 << 4) | (p2));
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
void oily_png_encode_scanline_indexed_2bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
134
|
+
long x; BYTE p1, p2, p3, p4;
|
135
|
+
for (x = 0; x < width; x += 4) {
|
136
|
+
p1 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 0);
|
137
|
+
p2 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 1);
|
138
|
+
p3 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 2);
|
139
|
+
p4 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 3);
|
140
|
+
bytes[x >> 2] = (BYTE) ((p1 << 6) | (p2 << 4) | (p3 << 2) | (p4));
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
void oily_png_encode_scanline_indexed_1bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
145
|
+
long x; BYTE p1, p2, p3, p4, p5, p6, p7, p8;
|
146
|
+
for (x = 0; x < width; x += 8) {
|
147
|
+
p1 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 0);
|
148
|
+
p2 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 1);
|
149
|
+
p3 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 2);
|
150
|
+
p4 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 3);
|
151
|
+
p5 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 4);
|
152
|
+
p6 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 5);
|
153
|
+
p7 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 6);
|
154
|
+
p8 = ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x + 7);
|
155
|
+
bytes[x >> 3] = (BYTE) ((p1 << 7) | (p2 << 6) | (p3 << 5) | (p4 << 4) | (p5 << 3) | (p6 << 2) | (p7 << 1) | (p8));
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
void oily_png_encode_scanline_truecolor_8bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
160
|
+
UNUSED_PARAMETER(encoding_palette);
|
161
|
+
long x; PIXEL pixel;
|
162
|
+
for (x = 0; x < width; x++) {
|
163
|
+
pixel = NUM2UINT(rb_ary_entry(pixels, y * width + x));
|
164
|
+
bytes[x * 3 + 0] = R_BYTE(pixel);
|
165
|
+
bytes[x * 3 + 1] = G_BYTE(pixel);
|
166
|
+
bytes[x * 3 + 2] = B_BYTE(pixel);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
void oily_png_encode_scanline_truecolor_alpha_8bit(BYTE* bytes, VALUE pixels, long y, long width, VALUE encoding_palette) {
|
171
|
+
UNUSED_PARAMETER(encoding_palette);
|
172
|
+
long x; PIXEL pixel;
|
173
|
+
for (x = 0; x < width; x++) {
|
174
|
+
pixel = NUM2UINT(rb_ary_entry(pixels, y * width + x));
|
175
|
+
bytes[x * 4 + 0] = R_BYTE(pixel);
|
176
|
+
bytes[x * 4 + 1] = G_BYTE(pixel);
|
177
|
+
bytes[x * 4 + 2] = B_BYTE(pixel);
|
178
|
+
bytes[x * 4 + 3] = A_BYTE(pixel);
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
|
183
|
+
scanline_encoder_func oily_png_encode_scanline_func(char color_mode, char bit_depth) {
|
184
|
+
switch (color_mode) {
|
185
|
+
|
186
|
+
case OILY_PNG_COLOR_GRAYSCALE:
|
187
|
+
switch (bit_depth) {
|
188
|
+
case 8: return &oily_png_encode_scanline_grayscale_8bit;
|
189
|
+
case 4: return &oily_png_encode_scanline_grayscale_4bit;
|
190
|
+
case 2: return &oily_png_encode_scanline_grayscale_2bit;
|
191
|
+
case 1: return &oily_png_encode_scanline_grayscale_1bit;
|
192
|
+
default: return NULL;
|
193
|
+
}
|
194
|
+
|
195
|
+
case OILY_PNG_COLOR_GRAYSCALE_ALPHA:
|
196
|
+
switch (bit_depth) {
|
197
|
+
case 8: return &oily_png_encode_scanline_grayscale_alpha_8bit;
|
198
|
+
default: return NULL;
|
199
|
+
}
|
200
|
+
|
201
|
+
case OILY_PNG_COLOR_INDEXED:
|
202
|
+
switch (bit_depth) {
|
203
|
+
case 8: return &oily_png_encode_scanline_indexed_8bit;
|
204
|
+
case 4: return &oily_png_encode_scanline_indexed_4bit;
|
205
|
+
case 2: return &oily_png_encode_scanline_indexed_2bit;
|
206
|
+
case 1: return &oily_png_encode_scanline_indexed_1bit;
|
207
|
+
default: return NULL;
|
208
|
+
}
|
209
|
+
|
210
|
+
case OILY_PNG_COLOR_TRUECOLOR:
|
211
|
+
switch (bit_depth) {
|
212
|
+
case 8: return &oily_png_encode_scanline_truecolor_8bit;
|
213
|
+
default: return NULL;
|
214
|
+
}
|
215
|
+
|
216
|
+
case OILY_PNG_COLOR_TRUECOLOR_ALPHA:
|
217
|
+
switch (bit_depth) {
|
218
|
+
case 8: return &oily_png_encode_scanline_truecolor_alpha_8bit;
|
219
|
+
default: return NULL;
|
220
|
+
}
|
221
|
+
|
222
|
+
default: return NULL;
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
/////////////////////////////////////////////////////////////////////
|
227
|
+
// ENCODING AN IMAGE PASS
|
228
|
+
/////////////////////////////////////////////////////////////////////
|
229
|
+
|
230
|
+
VALUE oily_png_encode_palette(VALUE self) {
|
231
|
+
VALUE palette_instance = rb_funcall(self, rb_intern("encoding_palette"), 0);
|
232
|
+
if (palette_instance != Qnil) {
|
233
|
+
VALUE encoding_map = rb_iv_get(palette_instance, "@encoding_map");
|
234
|
+
if (rb_funcall(encoding_map, rb_intern("kind_of?"), 1, rb_cHash) == Qtrue) {
|
235
|
+
return encoding_map;
|
236
|
+
}
|
237
|
+
}
|
238
|
+
rb_raise(rb_eRuntimeError, "Could not retrieve a decoding palette for this image!");
|
239
|
+
}
|
240
|
+
|
241
|
+
VALUE oily_png_encode_png_image_pass_to_stream(VALUE self, VALUE stream, VALUE color_mode, VALUE bit_depth, VALUE filtering) {
|
242
|
+
|
243
|
+
UNUSED_PARAMETER(bit_depth);
|
244
|
+
|
245
|
+
// Get the data
|
246
|
+
char depth = (char) FIX2INT(bit_depth);
|
247
|
+
long width = FIX2LONG(rb_funcall(self, rb_intern("width"), 0));
|
248
|
+
long height = FIX2LONG(rb_funcall(self, rb_intern("height"), 0));
|
249
|
+
VALUE pixels = rb_funcall(self, rb_intern("pixels"), 0);
|
250
|
+
|
251
|
+
if (RARRAY_LEN(pixels) != width * height) {
|
252
|
+
rb_raise(rb_eRuntimeError, "The number of pixels does not match the canvas dimensions.");
|
253
|
+
}
|
254
|
+
|
255
|
+
// Get the encoding palette if we're encoding to an indexed bytestream.
|
256
|
+
VALUE encoding_palette = Qnil;
|
257
|
+
if (FIX2INT(color_mode) == OILY_PNG_COLOR_INDEXED) {
|
258
|
+
encoding_palette = oily_png_encode_palette(self);
|
259
|
+
}
|
260
|
+
|
261
|
+
char pixel_size = oily_png_pixel_bytesize(FIX2INT(color_mode), depth);
|
262
|
+
long line_size = oily_png_scanline_bytesize(FIX2INT(color_mode), depth, width);
|
263
|
+
long pass_size = oily_png_pass_bytesize(FIX2INT(color_mode), depth, width, height);
|
264
|
+
|
265
|
+
// Allocate memory for the byte array.
|
266
|
+
BYTE* bytes = ALLOC_N(BYTE, pass_size);
|
267
|
+
|
268
|
+
// Get the scanline encoder function.
|
269
|
+
scanline_encoder_func scanline_encoder = oily_png_encode_scanline_func(FIX2INT(color_mode), depth);
|
270
|
+
if (scanline_encoder == NULL) {
|
271
|
+
rb_raise(rb_eRuntimeError, "No encoder for color mode %d and bit depth %d", FIX2INT(color_mode), depth);
|
272
|
+
}
|
273
|
+
|
274
|
+
long y, pos;
|
275
|
+
for (y = height - 1; y >= 0; y--) {
|
276
|
+
pos = line_size * y;
|
277
|
+
bytes[pos] = (BYTE) FIX2INT(filtering);
|
278
|
+
scanline_encoder(bytes + pos + 1, pixels, y, width, encoding_palette);
|
279
|
+
}
|
280
|
+
|
281
|
+
if (FIX2INT(filtering) != OILY_PNG_FILTER_NONE) {
|
282
|
+
|
283
|
+
// Get the scanline filter function
|
284
|
+
void (*scanline_filter)(BYTE*, long, long, char) = NULL;
|
285
|
+
switch (FIX2INT(filtering)) {
|
286
|
+
case OILY_PNG_FILTER_SUB: scanline_filter = &oily_png_encode_filter_sub; break;
|
287
|
+
case OILY_PNG_FILTER_UP: scanline_filter = &oily_png_encode_filter_up; break;
|
288
|
+
case OILY_PNG_FILTER_AVERAGE: scanline_filter = &oily_png_encode_filter_average; break;
|
289
|
+
case OILY_PNG_FILTER_PAETH: scanline_filter = &oily_png_encode_filter_paeth; break;
|
290
|
+
default: rb_raise(rb_eRuntimeError, "Unsupported filter type: %d", FIX2INT(filtering));
|
291
|
+
}
|
292
|
+
|
293
|
+
for (y = height - 1; y >= 0; y--) {
|
294
|
+
scanline_filter(bytes, line_size * y, line_size, pixel_size);
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
// Append to encoded image pass to the output stream.
|
299
|
+
rb_str_cat(stream, (char*) bytes, pass_size);
|
300
|
+
xfree(bytes);
|
301
|
+
return Qnil;
|
302
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#ifndef OILY_PNG_PNG_ENCODING_H
|
2
|
+
#define OILY_PNG_PNG_ENCODING_H
|
3
|
+
|
4
|
+
#define FILTER_BYTE(byte, adjustment) byte = (BYTE) (((byte) - (adjustment)) & 0x000000ff)
|
5
|
+
#define ENCODING_PALETTE_INDEX(encoding_palette, pixels, width, y, x) (((x) < (width)) ? ((BYTE) NUM2UINT(rb_hash_aref(encoding_palette, rb_ary_entry(pixels, (y) * (width) + (x))))) : 0)
|
6
|
+
|
7
|
+
typedef void(*scanline_encoder_func)(BYTE*, VALUE, long, long, VALUE);
|
8
|
+
|
9
|
+
/*
|
10
|
+
Encodes an image and append it to the stream.
|
11
|
+
A normal PNG will only have one pass and call this method once, while interlaced
|
12
|
+
images are split up in 7 distinct images. This method will be called for every one
|
13
|
+
of these images, reusing the stream.
|
14
|
+
|
15
|
+
This function should replace ChunkyPNG::Canvas::PNGEncoding.encode_png_image_pass_to_stream
|
16
|
+
*/
|
17
|
+
VALUE oily_png_encode_png_image_pass_to_stream(VALUE self, VALUE stream, VALUE color_mode, VALUE bit_depth, VALUE filtering);
|
18
|
+
|
19
|
+
#endif
|
@@ -0,0 +1,213 @@
|
|
1
|
+
#include "oily_png_ext.h"
|
2
|
+
#include <math.h>
|
3
|
+
|
4
|
+
void oily_png_generate_steps_residues(long width, long new_width, long *steps, long *residues) {
|
5
|
+
long base_step = width / new_width;
|
6
|
+
long err_step = (width % new_width) << 1;
|
7
|
+
long denominator = new_width << 1;
|
8
|
+
|
9
|
+
long index;
|
10
|
+
long err;
|
11
|
+
/* We require an arithmetic modolus and rounding to the left of zero
|
12
|
+
* This is standard Ruby behaviour (I hope!) but differs with how C/Java
|
13
|
+
* typically handle integer division and modulo. But since we are workig
|
14
|
+
* in mixed numbers, Ruby's convention is especially convienent */
|
15
|
+
if (width >= new_width) {
|
16
|
+
index = (width - new_width) / denominator;
|
17
|
+
err = (width - new_width) % denominator;
|
18
|
+
} else {
|
19
|
+
index = (width - new_width) / denominator - 1;
|
20
|
+
err = denominator - ((new_width - width) % denominator);
|
21
|
+
}
|
22
|
+
|
23
|
+
long i;
|
24
|
+
for (i=0; i < new_width; i++){
|
25
|
+
if (residues != NULL) {
|
26
|
+
steps[i] = index;
|
27
|
+
residues[i] = (long) round(255.0 * (float) err / (float) denominator);
|
28
|
+
} else {
|
29
|
+
/* If residues aren't requested, we round to the nearest pixel */
|
30
|
+
if (err < new_width) {
|
31
|
+
steps[i] = index;
|
32
|
+
} else {
|
33
|
+
steps[i] = index + 1;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
index += base_step;
|
38
|
+
err += err_step;
|
39
|
+
if (err >= denominator) {
|
40
|
+
index += 1;
|
41
|
+
err -= denominator;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
VALUE oily_png_canvas_steps(VALUE self, VALUE v_width, VALUE v_new_width) {
|
47
|
+
UNUSED_PARAMETER(self);
|
48
|
+
long width = NUM2LONG(v_width);
|
49
|
+
long new_width = NUM2LONG(v_new_width);
|
50
|
+
|
51
|
+
long *steps = ALLOC_N(long, new_width);
|
52
|
+
|
53
|
+
VALUE ret = rb_ary_new2(new_width);
|
54
|
+
|
55
|
+
oily_png_generate_steps_residues(width, new_width, steps, NULL);
|
56
|
+
|
57
|
+
long i;
|
58
|
+
for (i=0; i < new_width; i++) {
|
59
|
+
rb_ary_store(ret, i, LONG2FIX(steps[i]));
|
60
|
+
}
|
61
|
+
|
62
|
+
/* This is an unprotected allocation; it will leak on exception.
|
63
|
+
* However, rb_ary_store should not generate one as we have
|
64
|
+
* pre-allocated the array.
|
65
|
+
*/
|
66
|
+
xfree(steps);
|
67
|
+
steps = NULL;
|
68
|
+
|
69
|
+
return ret;
|
70
|
+
}
|
71
|
+
|
72
|
+
|
73
|
+
VALUE oily_png_canvas_steps_residues(VALUE self, VALUE v_width, VALUE v_new_width) {
|
74
|
+
UNUSED_PARAMETER(self);
|
75
|
+
long width = NUM2LONG(v_width);
|
76
|
+
long new_width = NUM2LONG(v_new_width);
|
77
|
+
|
78
|
+
|
79
|
+
VALUE ret_steps = rb_ary_new2(new_width);
|
80
|
+
VALUE ret_residues = rb_ary_new2(new_width);
|
81
|
+
|
82
|
+
|
83
|
+
long *steps = ALLOC_N(long, new_width);
|
84
|
+
long *residues = ALLOC_N(long, new_width);
|
85
|
+
|
86
|
+
oily_png_generate_steps_residues(width, new_width, steps, residues);
|
87
|
+
|
88
|
+
|
89
|
+
long i;
|
90
|
+
for (i=0; i < new_width; i++) {
|
91
|
+
rb_ary_store(ret_steps, i, LONG2FIX(steps[i]));
|
92
|
+
rb_ary_store(ret_residues, i, LONG2FIX(residues[i]));
|
93
|
+
}
|
94
|
+
|
95
|
+
/* This is an unprotected allocation; it will leak on exception.
|
96
|
+
* However, rb_ary_store should not generate one as we have
|
97
|
+
* pre-allocated the array.
|
98
|
+
*/
|
99
|
+
xfree(steps);
|
100
|
+
steps = NULL;
|
101
|
+
|
102
|
+
xfree(residues);
|
103
|
+
residues = NULL;
|
104
|
+
|
105
|
+
|
106
|
+
/* We return multiple values */
|
107
|
+
VALUE ret = rb_ary_new2(2);
|
108
|
+
rb_ary_store(ret, 0, ret_steps);
|
109
|
+
rb_ary_store(ret, 1, ret_residues);
|
110
|
+
|
111
|
+
return ret;
|
112
|
+
}
|
113
|
+
|
114
|
+
VALUE oily_png_canvas_resample_nearest_neighbor_bang(VALUE self, VALUE v_new_width, VALUE v_new_height) {
|
115
|
+
long new_width = NUM2LONG(v_new_width);
|
116
|
+
long new_height = NUM2LONG(v_new_height);
|
117
|
+
|
118
|
+
long self_width = NUM2LONG(rb_funcall(self, rb_intern("width"), 0));
|
119
|
+
long self_height = NUM2LONG(rb_funcall(self, rb_intern("height"), 0));
|
120
|
+
|
121
|
+
VALUE pixels = rb_ary_new2(new_width*new_height);
|
122
|
+
VALUE source = rb_iv_get(self, "@pixels");
|
123
|
+
|
124
|
+
long *steps_x = ALLOC_N(long, new_width);
|
125
|
+
long *steps_y = ALLOC_N(long, new_height);
|
126
|
+
|
127
|
+
oily_png_generate_steps_residues(self_width, new_width, steps_x, NULL);
|
128
|
+
oily_png_generate_steps_residues(self_height, new_height, steps_y, NULL);
|
129
|
+
|
130
|
+
long index = 0;
|
131
|
+
long x, y;
|
132
|
+
long src_index;
|
133
|
+
for (y=0; y < new_height; y++) {
|
134
|
+
for (x = 0; x < new_width; x++) {
|
135
|
+
src_index = steps_y[y] * self_width + steps_x[x];
|
136
|
+
VALUE pixel = rb_ary_entry(source, src_index);
|
137
|
+
rb_ary_store(pixels, index, pixel);
|
138
|
+
index++;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
xfree(steps_x);
|
143
|
+
steps_x = NULL;
|
144
|
+
|
145
|
+
xfree(steps_y);
|
146
|
+
steps_y = NULL;
|
147
|
+
|
148
|
+
rb_iv_set(self, "@pixels", pixels);
|
149
|
+
rb_iv_set(self, "@width", LONG2NUM(new_width));
|
150
|
+
rb_iv_set(self, "@height", LONG2NUM(new_height));
|
151
|
+
|
152
|
+
return self;
|
153
|
+
}
|
154
|
+
|
155
|
+
VALUE oily_png_canvas_resample_bilinear_bang(VALUE self, VALUE v_new_width, VALUE v_new_height) {
|
156
|
+
long new_width = NUM2LONG(v_new_width);
|
157
|
+
long new_height = NUM2LONG(v_new_height);
|
158
|
+
|
159
|
+
long self_width = NUM2LONG(rb_funcall(self, rb_intern("width"), 0));
|
160
|
+
long self_height = NUM2LONG(rb_funcall(self, rb_intern("height"), 0));
|
161
|
+
|
162
|
+
VALUE pixels = rb_ary_new2(new_width*new_height);
|
163
|
+
VALUE source = rb_iv_get(self, "@pixels");
|
164
|
+
|
165
|
+
long *index_x = ALLOC_N(long, new_width);
|
166
|
+
long *index_y = ALLOC_N(long, new_height);
|
167
|
+
long *interp_x = ALLOC_N(long, new_width);
|
168
|
+
long *interp_y = ALLOC_N(long, new_height);
|
169
|
+
|
170
|
+
oily_png_generate_steps_residues(self_width, new_width, index_x, interp_x);
|
171
|
+
oily_png_generate_steps_residues(self_height, new_height, index_y, interp_y);
|
172
|
+
|
173
|
+
long index = 0;
|
174
|
+
long x, y;
|
175
|
+
long y1, y2, x1, x2;
|
176
|
+
PIXEL y_residue, x_residue;
|
177
|
+
PIXEL pixel_11, pixel_21, pixel_12, pixel_22;
|
178
|
+
PIXEL pixel_top, pixel_bot;
|
179
|
+
for (y = 0; y < new_height; y++) {
|
180
|
+
y1 = index_y[y] < 0 ? 0 : index_y[y];
|
181
|
+
y2 = y1+1 >= self_height ? self_height-1 : y1+1;
|
182
|
+
y_residue = interp_y[y];
|
183
|
+
|
184
|
+
for (x = 0; x < new_width; x++) {
|
185
|
+
x1 = index_x[x] < 0 ? 0 : index_x[x];
|
186
|
+
x2 = x1+1 >= self_width ? self_height-1 : x1+1;
|
187
|
+
x_residue = interp_x[x];
|
188
|
+
|
189
|
+
pixel_11 = NUM2UINT(rb_ary_entry(source, y1*self_width + x1));
|
190
|
+
pixel_21 = NUM2UINT(rb_ary_entry(source, y1*self_width + x2));
|
191
|
+
pixel_12 = NUM2UINT(rb_ary_entry(source, y2*self_width + x1));
|
192
|
+
pixel_22 = NUM2UINT(rb_ary_entry(source, y2*self_width + x2));
|
193
|
+
|
194
|
+
pixel_top = oily_png_color_interpolate_quick(pixel_21, pixel_11, x_residue);
|
195
|
+
pixel_bot = oily_png_color_interpolate_quick(pixel_22, pixel_12, x_residue);
|
196
|
+
|
197
|
+
rb_ary_store(pixels, index++, UINT2NUM(oily_png_color_interpolate_quick(pixel_bot, pixel_top, y_residue)));
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
xfree(index_x);
|
202
|
+
xfree(index_y);
|
203
|
+
xfree(interp_x);
|
204
|
+
xfree(interp_y);
|
205
|
+
interp_x = NULL;
|
206
|
+
interp_y = NULL;
|
207
|
+
|
208
|
+
rb_iv_set(self, "@pixels", pixels);
|
209
|
+
rb_iv_set(self, "@width", LONG2NUM(new_width));
|
210
|
+
rb_iv_set(self, "@height", LONG2NUM(new_height));
|
211
|
+
|
212
|
+
return self;
|
213
|
+
}
|