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,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ChunkyPNG::Canvas do
|
4
|
+
|
5
|
+
describe '#to_rgba_stream' do
|
6
|
+
it "should export a sample canvas to an RGBA stream correctly" do
|
7
|
+
canvas = ChunkyPNG::Canvas.new(2, 2, [ChunkyPNG::Color.rgba(1,2,3,4), ChunkyPNG::Color.rgba(5,6,7,8),
|
8
|
+
ChunkyPNG::Color.rgba(4,3,2,1), ChunkyPNG::Color.rgba(8,7,6,5)])
|
9
|
+
|
10
|
+
canvas.to_rgba_stream.should == [1,2,3,4,5,6,7,8,4,3,2,1,8,7,6,5].pack('C16')
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should export an image to an RGBA datastream correctly" do
|
14
|
+
reference_canvas('pixelstream_reference').to_rgba_stream.should == resource_data('pixelstream.rgba')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#to_rgb_stream' do
|
19
|
+
it "should export a sample canvas to an RGBA stream correctly" do
|
20
|
+
canvas = ChunkyPNG::Canvas.new(2, 2, [ChunkyPNG::Color.rgba(1,2,3,4), ChunkyPNG::Color.rgba(5,6,7,8),
|
21
|
+
ChunkyPNG::Color.rgba(4,3,2,1), ChunkyPNG::Color.rgba(8,7,6,5)])
|
22
|
+
|
23
|
+
canvas.to_rgb_stream.should == [1,2,3,5,6,7,4,3,2,8,7,6].pack('C12')
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should export an image to an RGB datastream correctly" do
|
27
|
+
reference_canvas('pixelstream_reference').to_rgb_stream.should == resource_data('pixelstream.rgb')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#to_grayscale_stream' do
|
32
|
+
|
33
|
+
it "should export a grayscale image to a grayscale datastream correctly" do
|
34
|
+
canvas = ChunkyPNG::Canvas.new(2, 2, [ChunkyPNG::Color.grayscale(1), ChunkyPNG::Color.grayscale(2),
|
35
|
+
ChunkyPNG::Color.grayscale(3), ChunkyPNG::Color.grayscale(4)])
|
36
|
+
canvas.to_grayscale_stream.should == [1,2,3,4].pack('C4')
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
it "should export a color image to a grayscale datastream, using B values" do
|
41
|
+
canvas = ChunkyPNG::Canvas.new(2, 2, [ChunkyPNG::Color.rgba(1,2,3,4), ChunkyPNG::Color.rgba(5,6,7,8),
|
42
|
+
ChunkyPNG::Color.rgba(4,3,2,1), ChunkyPNG::Color.rgba(8,7,6,5)])
|
43
|
+
canvas.to_grayscale_stream.should == [3,7,2,6].pack('C4')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '#to_alpha_channel_stream' do
|
48
|
+
it "should export an opaque image to an alpha channel datastream correctly" do
|
49
|
+
grayscale_array = Array.new(reference_canvas('pixelstream_reference').pixels.length, 255)
|
50
|
+
reference_canvas('pixelstream_reference').to_alpha_channel_stream.should == grayscale_array.pack('C*')
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should export a transparent image to an alpha channel datastream correctly" do
|
54
|
+
canvas = ChunkyPNG::Canvas.new(2, 2, [ChunkyPNG::Color.rgba(1,2,3,4), ChunkyPNG::Color.rgba(5,6,7,8),
|
55
|
+
ChunkyPNG::Color.rgba(4,3,2,1), ChunkyPNG::Color.rgba(8,7,6,5)])
|
56
|
+
canvas.to_alpha_channel_stream.should == [4,8,1,5].pack('C4')
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ChunkyPNG::Canvas do
|
4
|
+
|
5
|
+
describe '.from_rgb_stream' do
|
6
|
+
it "should load an image correctly from a datastream" do
|
7
|
+
File.open(resource_file('pixelstream.rgb')) do |stream|
|
8
|
+
matrix = ChunkyPNG::Canvas.from_rgb_stream(240, 180, stream)
|
9
|
+
matrix.should == reference_canvas('pixelstream_reference')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '.from_bgr_stream' do
|
15
|
+
it "should load an image correctly from a datastream" do
|
16
|
+
File.open(resource_file('pixelstream.bgr')) do |stream|
|
17
|
+
matrix = ChunkyPNG::Canvas.from_bgr_stream(240, 180, stream)
|
18
|
+
matrix.should == reference_canvas('pixelstream_reference')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '.from_rgba_stream' do
|
24
|
+
it "should load an image correctly from a datastream" do
|
25
|
+
File.open(resource_file('pixelstream.rgba')) do |stream|
|
26
|
+
matrix = ChunkyPNG::Canvas.from_rgba_stream(240, 180, stream)
|
27
|
+
matrix.should == reference_canvas('pixelstream_reference')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ChunkyPNG::Canvas do
|
4
|
+
|
5
|
+
subject { ChunkyPNG::Canvas.new(1, 1, ChunkyPNG::Color::WHITE) }
|
6
|
+
|
7
|
+
it { should respond_to(:width) }
|
8
|
+
it { should respond_to(:height) }
|
9
|
+
it { should respond_to(:pixels) }
|
10
|
+
|
11
|
+
describe '#initialize' do
|
12
|
+
it "should accept a single color value as background color" do
|
13
|
+
canvas = ChunkyPNG::Canvas.new(2, 2, 'red @ 0.8')
|
14
|
+
canvas[1, 0].should == ChunkyPNG::Color.parse('red @ 0.8')
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should raise an error if the color value is not understood" do
|
18
|
+
lambda { ChunkyPNG::Canvas.new(2, 2, :nonsense) }.should raise_error(ArgumentError)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should accept an array as initial pixel values" do
|
22
|
+
canvas = ChunkyPNG::Canvas.new(2, 2, [1,2,3,4])
|
23
|
+
canvas[0, 0].should == 1
|
24
|
+
canvas[1, 0].should == 2
|
25
|
+
canvas[0, 1].should == 3
|
26
|
+
canvas[1, 1].should == 4
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should raise an ArgumentError if the initial array does not have the correct number of elements" do
|
30
|
+
lambda { ChunkyPNG::Canvas.new(2, 2, [1,2,3]) }.should raise_error(ArgumentError)
|
31
|
+
lambda { ChunkyPNG::Canvas.new(2, 2, [1,2,3,4,5]) }.should raise_error(ArgumentError)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should use a transparent background by default" do
|
35
|
+
canvas = ChunkyPNG::Canvas.new(1, 1)
|
36
|
+
canvas[0,0].should == ChunkyPNG::Color::TRANSPARENT
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#dimension' do
|
41
|
+
it "should return the dimensions as a Dimension instance" do
|
42
|
+
subject.dimension.should == ChunkyPNG::Dimension('1x1')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#area' do
|
47
|
+
it "should return the dimensions as two-item array" do
|
48
|
+
subject.area.should == ChunkyPNG::Dimension('1x1').area
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe '#include?' do
|
53
|
+
it "should return true if the coordinates are within bounds, false otherwise" do
|
54
|
+
subject.include_xy?( 0, 0).should be_true
|
55
|
+
|
56
|
+
subject.include_xy?(-1, 0).should be_false
|
57
|
+
subject.include_xy?( 1, 0).should be_false
|
58
|
+
subject.include_xy?( 0, -1).should be_false
|
59
|
+
subject.include_xy?( 0, 1).should be_false
|
60
|
+
subject.include_xy?(-1, -1).should be_false
|
61
|
+
subject.include_xy?(-1, 1).should be_false
|
62
|
+
subject.include_xy?( 1, -1).should be_false
|
63
|
+
subject.include_xy?( 1, 1).should be_false
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should accept strings, arrays, hashes and points as well" do
|
67
|
+
subject.should include('0, 0')
|
68
|
+
subject.should_not include('0, 1')
|
69
|
+
subject.should include([0, 0])
|
70
|
+
subject.should_not include([0, 1])
|
71
|
+
subject.should include(:y => 0, :x => 0)
|
72
|
+
subject.should_not include(:y => 1, :x => 0)
|
73
|
+
subject.should include(ChunkyPNG::Point.new(0, 0))
|
74
|
+
subject.should_not include(ChunkyPNG::Point.new(0, 1))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#include_x?' do
|
79
|
+
it "should return true if the x-coordinate is within bounds, false otherwise" do
|
80
|
+
subject.include_x?( 0).should be_true
|
81
|
+
subject.include_x?(-1).should be_false
|
82
|
+
subject.include_x?( 1).should be_false
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe '#include_y?' do
|
87
|
+
it "should return true if the y-coordinate is within bounds, false otherwise" do
|
88
|
+
subject.include_y?( 0).should be_true
|
89
|
+
subject.include_y?(-1).should be_false
|
90
|
+
subject.include_y?( 1).should be_false
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#assert_xy!' do
|
95
|
+
it "should not raise an exception if the coordinates are within bounds" do
|
96
|
+
subject.should_receive(:include_xy?).with(0, 0).and_return(true)
|
97
|
+
lambda { subject.send(:assert_xy!, 0, 0) }.should_not raise_error
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should raise an exception if the coordinates are out of bounds bounds" do
|
101
|
+
subject.should_receive(:include_xy?).with(0, -1).and_return(false)
|
102
|
+
lambda { subject.send(:assert_xy!, 0, -1) }.should raise_error(ChunkyPNG::OutOfBounds)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe '#assert_x!' do
|
107
|
+
it "should not raise an exception if the x-coordinate is within bounds" do
|
108
|
+
subject.should_receive(:include_x?).with(0).and_return(true)
|
109
|
+
lambda { subject.send(:assert_x!, 0) }.should_not raise_error
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should raise an exception if the x-coordinate is out of bounds bounds" do
|
113
|
+
subject.should_receive(:include_y?).with(-1).and_return(false)
|
114
|
+
lambda { subject.send(:assert_y!, -1) }.should raise_error(ChunkyPNG::OutOfBounds)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe '#[]' do
|
119
|
+
it "should return the pixel value if the coordinates are within bounds" do
|
120
|
+
subject[0, 0].should == ChunkyPNG::Color::WHITE
|
121
|
+
end
|
122
|
+
|
123
|
+
it "should assert the coordinates to be within bounds" do
|
124
|
+
subject.should_receive(:assert_xy!).with(0, 0)
|
125
|
+
subject[0, 0]
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe '#get_pixel' do
|
130
|
+
it "should return the pixel value if the coordinates are within bounds" do
|
131
|
+
subject.get_pixel(0, 0).should == ChunkyPNG::Color::WHITE
|
132
|
+
end
|
133
|
+
|
134
|
+
it "should not assert nor check the coordinates" do
|
135
|
+
subject.should_not_receive(:assert_xy!)
|
136
|
+
subject.should_not_receive(:include_xy?)
|
137
|
+
subject.get_pixel(0, 0)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe '#[]=' do
|
142
|
+
it "should change the pixel's color value" do
|
143
|
+
lambda { subject[0, 0] = ChunkyPNG::Color::BLACK }.should change { subject[0, 0] }.from(ChunkyPNG::Color::WHITE).to(ChunkyPNG::Color::BLACK)
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should assert the bounds of the image" do
|
147
|
+
subject.should_receive(:assert_xy!).with(0, 0)
|
148
|
+
subject[0, 0] = ChunkyPNG::Color::BLACK
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
describe 'set_pixel' do
|
153
|
+
it "should change the pixel's color value" do
|
154
|
+
lambda { subject.set_pixel(0, 0, ChunkyPNG::Color::BLACK) }.should change { subject[0, 0] }.from(ChunkyPNG::Color::WHITE).to(ChunkyPNG::Color::BLACK)
|
155
|
+
end
|
156
|
+
|
157
|
+
it "should not assert or check the bounds of the image" do
|
158
|
+
subject.should_not_receive(:assert_xy!)
|
159
|
+
subject.should_not_receive(:include_xy?)
|
160
|
+
subject.set_pixel(0, 0, ChunkyPNG::Color::BLACK)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
describe '#set_pixel_if_within_bounds' do
|
165
|
+
it "should change the pixel's color value" do
|
166
|
+
lambda { subject.set_pixel_if_within_bounds(0, 0, ChunkyPNG::Color::BLACK) }.should change { subject[0, 0] }.from(ChunkyPNG::Color::WHITE).to(ChunkyPNG::Color::BLACK)
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should not assert, but only check the coordinates" do
|
170
|
+
subject.should_not_receive(:assert_xy!)
|
171
|
+
subject.should_receive(:include_xy?).with(0, 0)
|
172
|
+
subject.set_pixel_if_within_bounds(0, 0, ChunkyPNG::Color::BLACK)
|
173
|
+
end
|
174
|
+
|
175
|
+
it "should do nothing if the coordinates are out of bounds" do
|
176
|
+
subject.set_pixel_if_within_bounds(-1, 1, ChunkyPNG::Color::BLACK).should be_nil
|
177
|
+
subject[0, 0].should == ChunkyPNG::Color::WHITE
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
describe '#row' do
|
182
|
+
before { @canvas = reference_canvas('operations') }
|
183
|
+
|
184
|
+
it "should give an out of bounds exception when y-coordinate is out of bounds" do
|
185
|
+
lambda { @canvas.row(-1) }.should raise_error(ChunkyPNG::OutOfBounds)
|
186
|
+
lambda { @canvas.row(16) }.should raise_error(ChunkyPNG::OutOfBounds)
|
187
|
+
end
|
188
|
+
|
189
|
+
it "should return the correct pixels" do
|
190
|
+
data = @canvas.row(0)
|
191
|
+
data.should have(@canvas.width).items
|
192
|
+
data.should == [65535, 268500991, 536936447, 805371903, 1073807359, 1342242815, 1610678271, 1879113727, 2147549183, 2415984639, 2684420095, 2952855551, 3221291007, 3489726463, 3758161919, 4026597375]
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
describe '#column' do
|
197
|
+
before { @canvas = reference_canvas('operations') }
|
198
|
+
|
199
|
+
it "should give an out of bounds exception when x-coordinate is out of bounds" do
|
200
|
+
lambda { @canvas.column(-1) }.should raise_error(ChunkyPNG::OutOfBounds)
|
201
|
+
lambda { @canvas.column(16) }.should raise_error(ChunkyPNG::OutOfBounds)
|
202
|
+
end
|
203
|
+
|
204
|
+
it "should return the correct pixels" do
|
205
|
+
data = @canvas.column(0)
|
206
|
+
data.should have(@canvas.height).items
|
207
|
+
data.should == [65535, 1114111, 2162687, 3211263, 4259839, 5308415, 6356991, 7405567, 8454143, 9502719, 10551295, 11599871, 12648447, 13697023, 14745599, 15794175]
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
describe '#replace_canvas' do
|
212
|
+
it "should change the dimension of the canvas" do
|
213
|
+
lambda { subject.send(:replace_canvas!, 2, 2, [1,2,3,4]) }.should change(subject, :dimension).
|
214
|
+
from(ChunkyPNG::Dimension('1x1')).to(ChunkyPNG::Dimension('2x2'))
|
215
|
+
end
|
216
|
+
|
217
|
+
it "should change the pixel array" do
|
218
|
+
lambda { subject.send(:replace_canvas!, 2, 2, [1,2,3,4]) }.should change(subject, :pixels).
|
219
|
+
from([ChunkyPNG::Color('white')]).to([1,2,3,4])
|
220
|
+
end
|
221
|
+
|
222
|
+
it "should return itself" do
|
223
|
+
subject.send(:replace_canvas!, 2, 2, [1,2,3,4]).should equal(subject)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
@@ -0,0 +1,251 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'ChunyPNG.Color' do
|
4
|
+
it "should interpret 4 arguments as RGBA values" do
|
5
|
+
ChunkyPNG::Color(1, 2, 3, 4).should == ChunkyPNG::Color.rgba(1, 2, 3, 4)
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should interpret 3 arguments as RGBA values" do
|
9
|
+
ChunkyPNG::Color(1, 2, 3).should == ChunkyPNG::Color.rgb(1, 2, 3)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should interpret 2 arguments as a color to parse and an opacity value" do
|
13
|
+
ChunkyPNG::Color('0x0a649664', 0xaa).should == 0x0a6496aa
|
14
|
+
ChunkyPNG::Color('spring green @ 0.6666', 0xff).should == 0x00ff7fff
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should interpret 1 argument as a color to parse" do
|
18
|
+
ChunkyPNG::Color.should_receive(:parse).with('0x0a649664')
|
19
|
+
ChunkyPNG::Color('0x0a649664')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe ChunkyPNG::Color do
|
24
|
+
include ChunkyPNG::Color
|
25
|
+
|
26
|
+
before(:each) do
|
27
|
+
@white = 0xffffffff
|
28
|
+
@black = 0x000000ff
|
29
|
+
@opaque = 0x0a6496ff
|
30
|
+
@non_opaque = 0x0a649664
|
31
|
+
@fully_transparent = 0x0a649600
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#parse' do
|
35
|
+
it "should interpret a hex string correctly" do
|
36
|
+
parse('0x0a649664').should == ChunkyPNG::Color.from_hex('#0a649664')
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should interpret a color name correctly" do
|
40
|
+
parse(:spring_green).should == 0x00ff7fff
|
41
|
+
parse('spring green').should == 0x00ff7fff
|
42
|
+
parse('spring green @ 0.6666').should == 0x00ff7faa
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should return numbers as is" do
|
46
|
+
parse('12345').should == 12345
|
47
|
+
parse(12345).should == 12345
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#pixel_bytesize' do
|
52
|
+
it "should return the normal amount of bytes with a bit depth of 8" do
|
53
|
+
pixel_bytesize(ChunkyPNG::COLOR_TRUECOLOR, 8).should == 3
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should return a multiple of the normal amount of bytes with a bit depth greater than 8" do
|
57
|
+
pixel_bytesize(ChunkyPNG::COLOR_TRUECOLOR, 16).should == 6
|
58
|
+
pixel_bytesize(ChunkyPNG::COLOR_TRUECOLOR_ALPHA, 16).should == 8
|
59
|
+
pixel_bytesize(ChunkyPNG::COLOR_GRAYSCALE_ALPHA, 16).should == 4
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should return 1 with a bit depth lower than 0" do
|
63
|
+
pixel_bytesize(ChunkyPNG::COLOR_TRUECOLOR, 4).should == 1
|
64
|
+
pixel_bytesize(ChunkyPNG::COLOR_INDEXED, 2).should == 1
|
65
|
+
pixel_bytesize(ChunkyPNG::COLOR_GRAYSCALE_ALPHA, 1).should == 1
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
describe '#pass_bytesize' do
|
70
|
+
it "should calculate a pass size correctly" do
|
71
|
+
pass_bytesize(ChunkyPNG::COLOR_TRUECOLOR, 8, 10, 10).should == 310
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should return 0 if one of the dimensions is zero" do
|
75
|
+
pass_bytesize(ChunkyPNG::COLOR_TRUECOLOR, 8, 0, 10).should == 0
|
76
|
+
pass_bytesize(ChunkyPNG::COLOR_TRUECOLOR, 8, 10, 0).should == 0
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe '#rgba' do
|
81
|
+
it "should represent pixels as the correct number" do
|
82
|
+
rgba(255, 255, 255, 255).should == @white
|
83
|
+
rgba( 0, 0, 0, 255).should == @black
|
84
|
+
rgba( 10, 100, 150, 255).should == @opaque
|
85
|
+
rgba( 10, 100, 150, 100).should == @non_opaque
|
86
|
+
rgba( 10, 100, 150, 0).should == @fully_transparent
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '#from_hex' do
|
91
|
+
it "should load colors correctly from hex notation" do
|
92
|
+
from_hex('0a649664').should == @non_opaque
|
93
|
+
from_hex('#0a649664').should == @non_opaque
|
94
|
+
from_hex('0x0a649664').should == @non_opaque
|
95
|
+
from_hex('0a6496').should == @opaque
|
96
|
+
from_hex('#0a6496').should == @opaque
|
97
|
+
from_hex('0x0a6496').should == @opaque
|
98
|
+
from_hex('abc').should == 0xaabbccff
|
99
|
+
from_hex('#abc').should == 0xaabbccff
|
100
|
+
from_hex('0xabc').should == 0xaabbccff
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should allow setting opacity explicitly" do
|
104
|
+
from_hex('0x0a6496', 0x64).should == @non_opaque
|
105
|
+
from_hex('#0a6496', 0x64).should == @non_opaque
|
106
|
+
from_hex('0xabc', 0xdd).should == 0xaabbccdd
|
107
|
+
from_hex('#abc', 0xdd).should == 0xaabbccdd
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe '#html_color' do
|
112
|
+
it "should find the correct color value" do
|
113
|
+
html_color(:springgreen).should == 0x00ff7fff
|
114
|
+
html_color(:spring_green).should == 0x00ff7fff
|
115
|
+
html_color('springgreen').should == 0x00ff7fff
|
116
|
+
html_color('spring green').should == 0x00ff7fff
|
117
|
+
html_color('SpringGreen').should == 0x00ff7fff
|
118
|
+
html_color('SPRING_GREEN').should == 0x00ff7fff
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should set the opacity level explicitly" do
|
122
|
+
html_color(:springgreen, 0xff).should == 0x00ff7fff
|
123
|
+
html_color(:springgreen, 0xaa).should == 0x00ff7faa
|
124
|
+
html_color(:springgreen, 0x00).should == 0x00ff7f00
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should set opacity levels from the color name" do
|
128
|
+
html_color('Spring green @ 1.0').should == 0x00ff7fff
|
129
|
+
html_color('Spring green @ 0.666').should == 0x00ff7faa
|
130
|
+
html_color('Spring green @ 0.0').should == 0x00ff7f00
|
131
|
+
end
|
132
|
+
|
133
|
+
it "should raise for an unkown color name" do
|
134
|
+
lambda { html_color(:nonsense) }.should raise_error(ArgumentError)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
describe '#opaque?' do
|
139
|
+
it "should correctly check for opaqueness" do
|
140
|
+
opaque?(@white).should be_true
|
141
|
+
opaque?(@black).should be_true
|
142
|
+
opaque?(@opaque).should be_true
|
143
|
+
opaque?(@non_opaque).should be_false
|
144
|
+
opaque?(@fully_transparent).should be_false
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe 'extractiion of separate color channels' do
|
149
|
+
it "should extract components from a color correctly" do
|
150
|
+
r(@opaque).should == 10
|
151
|
+
g(@opaque).should == 100
|
152
|
+
b(@opaque).should == 150
|
153
|
+
a(@opaque).should == 255
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
describe '#grayscale_teint' do
|
158
|
+
it "should calculate the correct grayscale teint" do
|
159
|
+
grayscale_teint(@opaque).should == 79
|
160
|
+
grayscale_teint(@non_opaque).should == 79
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
describe '#to_grayscale' do
|
165
|
+
it "should use the grayscale teint for r, g and b" do
|
166
|
+
gs = to_grayscale(@non_opaque)
|
167
|
+
r(gs).should == grayscale_teint(@non_opaque)
|
168
|
+
g(gs).should == grayscale_teint(@non_opaque)
|
169
|
+
b(gs).should == grayscale_teint(@non_opaque)
|
170
|
+
end
|
171
|
+
|
172
|
+
it "should preserve the alpha channel" do
|
173
|
+
a(to_grayscale(@non_opaque)).should == a(@non_opaque)
|
174
|
+
a(to_grayscale(@opaque)).should == ChunkyPNG::Color::MAX
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
describe '#to_hex' do
|
179
|
+
it "should represent colors correcly using hex notation" do
|
180
|
+
to_hex(@white).should == '#ffffffff'
|
181
|
+
to_hex(@black).should == '#000000ff'
|
182
|
+
to_hex(@opaque).should == '#0a6496ff'
|
183
|
+
to_hex(@non_opaque).should == '#0a649664'
|
184
|
+
to_hex(@fully_transparent).should == '#0a649600'
|
185
|
+
end
|
186
|
+
|
187
|
+
it "should represent colors correcly using hex notation without alpha channel" do
|
188
|
+
to_hex(@white, false).should == '#ffffff'
|
189
|
+
to_hex(@black, false).should == '#000000'
|
190
|
+
to_hex(@opaque, false).should == '#0a6496'
|
191
|
+
to_hex(@non_opaque, false).should == '#0a6496'
|
192
|
+
to_hex(@fully_transparent, false).should == '#0a6496'
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
describe 'conversion to other formats' do
|
197
|
+
it "should convert the individual color values back correctly" do
|
198
|
+
to_truecolor_bytes(@opaque).should == [10, 100, 150]
|
199
|
+
to_truecolor_alpha_bytes(@non_opaque).should == [10, 100, 150, 100]
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
describe '#compose' do
|
204
|
+
|
205
|
+
it "should use the foregorund color as is when the background color is fully transparent" do
|
206
|
+
compose(@non_opaque, @fully_transparent).should == @non_opaque
|
207
|
+
end
|
208
|
+
|
209
|
+
it "should use the foregorund color as is when an opaque color is given as foreground color" do
|
210
|
+
compose(@opaque, @white).should == @opaque
|
211
|
+
end
|
212
|
+
|
213
|
+
it "should use the background color as is when a fully transparent pixel is given as foreground color" do
|
214
|
+
compose(@fully_transparent, @white).should == @white
|
215
|
+
end
|
216
|
+
|
217
|
+
it "should compose pixels correctly with both algorithms" do
|
218
|
+
compose_quick(@non_opaque, @white).should == 0x9fc2d6ff
|
219
|
+
compose_precise(@non_opaque, @white).should == 0x9fc2d6ff
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
describe '#decompose_alpha' do
|
224
|
+
it "should decompose the alpha channel correctly" do
|
225
|
+
decompose_alpha(0x9fc2d6ff, @opaque, @white).should == 0x00000064
|
226
|
+
end
|
227
|
+
|
228
|
+
it "should return fully transparent if the background channel matches the resulting color" do
|
229
|
+
decompose_alpha(0xabcdefff, 0xff000000, 0xabcdefff).should == 0x00
|
230
|
+
end
|
231
|
+
|
232
|
+
it "should return fully opaque if the background channel matches the mask color" do
|
233
|
+
decompose_alpha(0xff000000, 0xabcdefff, 0xabcdefff).should == 0xff
|
234
|
+
end
|
235
|
+
|
236
|
+
it "should return fully opaque if the resulting color matches the mask color" do
|
237
|
+
decompose_alpha(0xabcdefff, 0xabcdefff, 0xffffffff).should == 255
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
describe '#blend' do
|
242
|
+
it "should blend colors correctly" do
|
243
|
+
blend(@opaque, @black).should == 0x05324bff
|
244
|
+
end
|
245
|
+
|
246
|
+
it "should not matter what color is used as foreground, and what as background" do
|
247
|
+
blend(@opaque, @black).should == blend(@black, @opaque)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|