summaryrefslogtreecommitdiff
path: root/demos
AgeCommit message (Collapse)AuthorFilesLines
2013-11-11demos/Makefile.am: Move EXTRA_DIST outside "if HAVE_GTK"Søren Sandmann1-2/+2
Without this, if tarballs are generated on a system that doesn't have GTK+ 2 development headers available, the files in EXTRA_DIST will not be included, which then causes builds from the tarball to fail on systems that do have GTK+ 2 headers available. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=71465
2013-10-12scale.c: Use int instead of kernel_t for values in named_int_tSøren Sandmann Pedersen1-3/+3
The 'value' field in the 'named_int_t' struct is used for both pixman_repeat_t and pixman_kernel_t values, so the type should be int, not pixman_kernel_t. Fixes some warnings like this scale.c:124:33: warning: implicit conversion from enumeration type 'pixman_repeat_t' to different enumeration type 'pixman_kernel_t' [-Wconversion] { "None", PIXMAN_REPEAT_NONE }, ~ ^~~~~~~~~~~~~~~~~~ when compiled with clang.
2013-09-16demos/scale.ui: Allow subsample_bits to be 0Søren Sandmann Pedersen1-1/+1
The separable convolution filter supports a subsample_bits of 0 which corresponds to no subsampling at all, so allow this value to be used in the scale demo.
2013-03-11demos: Add linear-gradient demo programSøren Sandmann Pedersen2-0/+52
This program displays a linear gradient from blue to yellow. Due to limited precision in pixman-gradient-walker.c, it currently has some ugly artefacts that gives it a 'brushed metal' appearance. V2: Update .gitignore
2013-02-15gtk-utils.c: Use cairo in show_image() rather than GdkPixbufSøren Sandmann Pedersen1-24/+29
GdkPixbufs are not premultiplied, so when using them to display pixman images, there is some unecessary conversions going on: First the image is converted to non-premultiplied, and then GdkPixbuf premultiplies before sending the result to the X server. These conversions may cause the displayed image to not be exactly identical to the original. This patch just uses a cairo image surface instead, which avoids these conversions. Also make the comment about sRGB a little more concise.
2013-01-27demo/scale: Add a spin button to set the number of subsample bitsSøren Sandmann Pedersen2-1/+36
For large upscalings the level of subsampling for the filter has a quite visible effect, so make it settable in the UI so that people can experiment with various values.
2013-01-22Convert INCLUDES to AM_CPPFLAGSMatt Turner1-1/+1
INCLUDES has been deprecated starting with automake 1.13. Convert all occurrences with the recommended AM_CPPFLAGS replacement.
2012-12-11demos/radial-test: Add checkerboard to display the alpha channelSøren Sandmann Pedersen1-0/+2
2012-12-11demos/conical-test: Use the draw_checkerboard() utility functionSøren Sandmann Pedersen1-36/+2
Instead of having its own copy.
2012-12-11demos/radial-test: Add zero-radius circles to demonstrate rendering bugsSøren Sandmann Pedersen1-1/+9
Add two new gradient columns, one where the start circle is has radius 0 and one where the end circle has radius 0. All the new gradients except for one are rendered with a bright dot in the middle. In most but not all cases this is incorrect. Cc: ranma42@gmail.com
2012-12-08Add demo program for conical gradientsSøren Sandmann Pedersen2-0/+136
This new test is derived from radial-test.c and displays conical gradients at various angles. It also demonstrates how PIXMAN_REPEAT_NORMAL is supposed to work when used with a gradient specification where the first stop is not a 0.0: In this case the gradient is supposed to have a smooth transition from the last stop back to the first stop with no sharp transitions. It also shows that the repeat mode is not ignored for conical gradients as one might be tempted to think.
2012-12-08Add demos/zone_plate.pngSøren Sandmann Pedersen1-0/+0
The zone plate image is a useful test case for image scalers because it contains all representable frequencies, so any imperfection in resampling filters will show up as Moire patterns. This version is symmetric around the midpoint of the image, so since rotating it is supposed to be a noop, it can also be used to verify that the resampling filters don't shift the image. V2: Run the file through OptiPNG to cut the size in half, as suggested by Siarhei.
2012-12-08demos: Add new demo program, "scale"Søren Sandmann Pedersen3-2/+737
This program allows interactively scaling and rotating images with using various filters and repeat modes. It uses pixman_filter_create_separate_convolution() to generate the filters.
2012-12-08demos/gtk-utils.[ch]: Add pixman_image_from_file()Søren Sandmann Pedersen2-0/+69
This function uses GdkPixbuf to load various common formats such as .png and .jpg into a pixman image.
2012-12-06test: Switch to the new PRNG instead of old LCGSiarhei Siamashka1-1/+2
Wallclock time for running pixman "make check" (compile time not included): ----------------------------+----------------+-----------------------------+ | old PRNG (LCG) | new PRNG (Bob Jenkins) | Processor type +----------------+------------+----------------+ | gcc 4.5 | gcc 4.5 | gcc 4.7 (simd) | ----------------------------+----------------+------------+----------------+ quad Intel Core i7 @2.8GHz | 0m49.494s | 0m43.722s | 0m37.560s | dual ARM Cortex-A15 @1.7GHz | 5m8.465s | 4m37.375s | 3m45.819s | IBM Cell PPU @3.2GHz | 23m0.821s | 20m38.316s | 16m37.513s | ----------------------------+----------------+------------+----------------+ But some tests got a particularly large boost. For example benchmarking and profiling blitters-test on Core i7: === before === $ time ./blitters-test real 0m10.907s user 0m55.650s sys 0m0.000s 70.45% blitters-test blitters-test [.] create_random_image 15.81% blitters-test blitters-test [.] compute_crc32_for_image_internal 2.26% blitters-test blitters-test [.] _pixman_implementation_lookup_composite 1.07% blitters-test libc-2.15.so [.] _int_free 0.89% blitters-test libc-2.15.so [.] malloc_consolidate 0.87% blitters-test libc-2.15.so [.] _int_malloc 0.75% blitters-test blitters-test [.] combine_conjoint_general_u 0.61% blitters-test blitters-test [.] combine_disjoint_general_u 0.40% blitters-test blitters-test [.] test_composite 0.31% blitters-test libc-2.15.so [.] _int_memalign 0.31% blitters-test blitters-test [.] _pixman_bits_image_setup_accessors 0.28% blitters-test libc-2.15.so [.] malloc === after === $ time ./blitters-test real 0m3.655s user 0m20.550s sys 0m0.000s 41.77% blitters-test.n blitters-test.new [.] compute_crc32_for_image_internal 15.77% blitters-test.n blitters-test.new [.] prng_randmemset_r 6.15% blitters-test.n blitters-test.new [.] _pixman_implementation_lookup_composite 3.09% blitters-test.n libc-2.15.so [.] _int_free 2.68% blitters-test.n libc-2.15.so [.] malloc_consolidate 2.39% blitters-test.n libc-2.15.so [.] _int_malloc 2.27% blitters-test.n blitters-test.new [.] create_random_image 2.22% blitters-test.n blitters-test.new [.] combine_conjoint_general_u 1.52% blitters-test.n blitters-test.new [.] combine_disjoint_general_u 1.40% blitters-test.n blitters-test.new [.] test_composite 1.02% blitters-test.n blitters-test.new [.] prng_srand_r 1.00% blitters-test.n blitters-test.new [.] _pixman_image_validate 0.96% blitters-test.n blitters-test.new [.] _pixman_bits_image_setup_accessors 0.90% blitters-test.n libc-2.15.so [.] malloc
2012-10-01Add combiner testSøren Sandmann Pedersen1-1/+1
This test runs the new floating point combiners on random input with divide-by-zero exceptions turned on. With the floating point combiners the only thing we guarantee is that divide-by-zero exceptions are not generated, so change enable_fp_exceptions() to only enable those, and rename accordingly.
2012-08-09demos: Add srgb_trap_test.cSøren Sandmann Pedersen2-0/+121
This demo program composites a bunch of trapezoids side by side with and without gamma aware compositing.
2012-08-09Make show_image() cope with more formatsSøren Sandmann Pedersen4-26/+37
This makes show_image() deal with more formats than just a8r8g8b8, in particular, a8r8g8b8_sRGB can now be handled. Images that are passed to show_image with a format of a8r8g8b8_sRGB are displayed without modification under the assumption that the monitor is approximately sRGB. Images with a format of a8r8g8b8 are also displayed without modification since many other users of show_image() have been generating essentially sRGB data with this format. Other formats are also assumed to be gamma compressed; these are converted to a8r8g8b8 before being displayed. With these changes, srgb-test.c doesn't need to do its own conversion anymore.
2012-07-30Add sRGB blending demo programAntti S. Lankila2-1/+99
Simple sRGB color blender test can be used to determine if the sRGB processing works as expected. It blends alpha ramps of purple and green together such that at midpoint of image, 50 % blend of both is realized. At that point, sRGB-aware processing yields a result close to #bbb rather than #888, which is the linear light blending result. The demo also contains the sample computation for sRGB premultiplied alpha.
2012-05-20demos: Add parrot.jpg to EXTRA_DISTSøren Sandmann Pedersen1-1/+1
Pointed out by Cyril Brulebois.
2012-05-15demos/Makefile.am: Add parrot.c to EXTRA_DISTSøren Sandmann Pedersen1-0/+2
To get 'make distcheck' to pass.
2012-04-02gtk-utils.c: In pixbuf_from_argb32() use a8r8g8b8_to_rgba_np()Søren Sandmann Pedersen2-36/+11
Instead of inlining a copy of that functionality.
2012-04-02gtk-utils.c: Don't include pixman-private.hSøren Sandmann Pedersen1-4/+1
Use pixman_image_get_format() instead of image->bits.format.
2012-03-27Add the original parrot image.Søren Sandmann Pedersen1-0/+0
This is the Parrot image that was downscaled and cropped before being used in the composite-test.c demo.
2012-03-27composite-test.c: Add a parrot imageSøren Sandmann Pedersen2-20/+1094
Instead of the yellow square, use a parrot as the source image. This demonstrates the various blend modes much better. The parrot is a cropped version of finger painting by Rubens LP: http://www.flickr.com/photos/dorubens/4030604504/in/set-72157622586088192/ where the background has been removed. Used here under Creative Commons Attribution. The artist's web site: http://www.rubenslp.com.br/
2012-03-24composite-test.c: Use similar gradient to the one in the PDF spec.Søren Sandmann Pedersen1-10/+10
2012-03-24demos: Add checkerboard demoSøren Sandmann Pedersen2-1/+75
This is a simple demo that displays a checkboard with a projective transformation.
2012-03-24demos: Add quad2quad programSøren Sandmann Pedersen1-0/+2183
This program can compute the projective transformation that transforms one quadrilateral into another. The code is basically maxima[1] output translated into C. [1] http://maxima.sourceforge.net/
2012-01-03Modify gradient-test to show a bug in NONE processingSøren Sandmann Pedersen1-7/+6
This patch modifies demos/gradient-test to display a bug in gradients with a repeat mode of NONE. With the current gradient code, the left side will be a solid red (actually an extremely long fade from solid red to transparent) instead of a sharp transition from red to green.
2011-11-09demos: Consistently use G_N_ELEMENTS()Andrea Canciani1-1/+1
Instead of open-coding G_N_ELEMENTS(), just use it.
2011-09-28build: replace @VAR@ with $(VAR) in makefilesBenjamin Otte1-2/+2
2011-09-28tests: Add PNG_CFLAGS/LIBS to testsBenjamin Otte1-2/+2
PNG flags were accidentally included by gdk-pixbuf. This has been fixed recently, so we need to make sure to include it ourselves.
2011-05-31demos: Comment out some unused variablesSøren Sandmann2-1/+7
2011-04-18Offset rendering in pixman_composite_trapezoids() by (x_dst, y_dst)Søren Sandmann Pedersen1-1/+1
Previously, this function would do coordinate calculations in such a way that (x_dst, y_dst) would only affect the alignment of the source image, but not of the traps, which would always be considered to be in absolute destination coordinates. This is unlike the pixman_image_composite() function which also registers the mask to the destination. This patch makes it so that traps are also offset by (x_dst, y_dst). Also add a comment explaining how this function is supposed to operate, and update tri-test.c and composite-trap-test.c to deal with the new semantics.
2011-02-18Add a test program, tri-testSøren Sandmann Pedersen2-2/+52
This program tests whether the new triangle support works.
2011-02-15Move all the GTK+ based test programs to a new subdir, "demos"Søren Sandmann Pedersen12-0/+1044
This separates the test suite from the random gtk+ using test programs. "demos" is somewhat misleading because the programs there are not particularly exciting (with the possible exception of composite-test which shows off all the compositing operators).