Commit graph

48 commits

Author SHA1 Message Date
Fabien Freling da4bdf7702 Decompose complex lines.
Create a bunch of const variables to better profile.
2014-07-27 22:41:09 +02:00
Fabien Freling c704c14526 Add 'runall' target.
The ‘runall’ target runs the rotation on different sizes:
- 512x512
- 1024x1024
- 3000x3000
2014-07-24 22:17:55 +02:00
Fabien Freling 760d6244d0 Have different quantifications.
I now have a precise quantification for point position and a more
approximate one for pixel interpolation.
2014-07-24 22:13:47 +02:00
Fabien Freling e804d9b5ca Add TPoint operators +=, -=, *=, /= 2014-07-24 00:40:27 +02:00
Fabien Freling e7802e30fd Compute src position in quantified coordinates.
Instead of relying on floating values for the position in the
source image, we quantify all positions with a power of 2.

We lose some precision and the delta step is less accurate, leading in
some offset at the end.

For now the rotation is not correct.
2014-07-23 23:44:14 +02:00
Fabien Freling 7e152c29fc Add support for PGM format.
The code has been split into different source files.

This breaks for now rotation for tiled images and PPM format. The focus
is now on the PGM format.
2014-07-21 06:57:08 +02:00
Fabien Freling 20055e22c5 Clean Makefile indentation. 2014-07-16 22:07:30 +02:00
Fabien Freling c918ca5504 Remove out-of-bounds check for tiled images.
Since tiles have an overlap, if the absolute point is inside the source
image, we can interpolate.
2014-07-16 21:50:25 +02:00
Fabien Freling 5f78958584 Use PIXEL_SIZE to move to next pixel in I/O. 2014-07-16 20:52:52 +02:00
Fabien Freling afd89f5238 Remove PackedPixel.
The RGBX format takes more space but it is more efficient to handle.
2014-07-16 20:47:43 +02:00
Fabien Freling a992cba5ed Implement RGBX for tiled images.
Interpolation is now done with SIMD with -DSIMD for tiled images as
well.
2014-07-16 20:44:32 +02:00
Fabien Freling bcf16680ae Remove RGBX structure.
The pixels are still packed as RGBX in memory but
no structure is created, it’s just a contiguous buffer.

Interpolation is now done with SIMD on integer values.

- Add SIMD define.
2014-07-16 02:08:32 +02:00
Fabien Freling cce4d45ba6 Implement pixels as RGBX structure.
- Add ‘make debug’ target
- Add links in README
2014-07-12 22:42:48 +02:00
Fabien Freling 8175b8a06c Do not save output images. 2014-07-10 22:01:55 +02:00
Fabien Freling 7c6cfd9046 Create small overlap in tiles.
Tiles overlap on the bottom line and the right column.
Having an overlap allows us to get neighbor points for each point in a
tile, regardless of its position.
2014-07-10 22:01:55 +02:00
Fabien Freling fea3e90fba Remove unused code. 2014-07-09 08:19:09 +02:00
Fabien Freling 3ab9df90df Remove temp buffer for non-tiled image. 2014-07-09 08:00:58 +02:00
Fabien Freling eb5bae42c3 Allocate tiles as a unified buffer. 2014-07-09 07:50:09 +02:00
Fabien Freling edb9ef7dd8 Remove temp tile. 2014-07-08 08:48:17 +02:00
Fabien Freling 9a9db2d4fd Interpolate on quantized values for tiled images. 2014-07-08 08:04:43 +02:00
Fabien Freling 54e35ff8d0 Tweak stats display.
Add average metric.
2014-07-07 23:36:10 +02:00
Fabien Freling 68fb1b1951 Do interpolation on quantized values. 2014-07-07 23:19:57 +02:00
Fabien Freling 67b4bcc3d3 Minimize computation in rotate_pixel().
- Deactivate tests.
- Check if delta is on integer values.
2014-07-06 23:49:46 +02:00
Fabien Freling a6ef15ea62 Create PackedPixel structure. 2014-07-06 23:47:21 +02:00
Fabien Freling 049228b377 Fill a temp buffer for each line.
We don’t write into the memory right away, we first write to a temp
buffer that we blit into the rotated image.
2014-07-04 08:23:06 +02:00
Fabien Freling e3e0d3c20a Fix first rotated tile on each row.
The first tile on each row seemed to be missing values.
This was due to the ‘continue’ statement that would prevent
src_rotated_point to be incremented properly.
2014-07-04 00:34:06 +02:00
Fabien Freling 7f29bd192a Pass tile to rotate_pixel() instead of image. 2014-07-04 00:23:54 +02:00
Fabien Freling 8811d7023e Factorize rotated point computation 2014-07-03 23:56:10 +02:00
Fabien Freling a871d92723 Add image destructors. 2014-07-03 23:56:10 +02:00
Fabien Freling 9e8d79d384 Return image pointer for rotate(). 2014-07-03 23:56:10 +02:00
Fabien Freling 8d096ee2ce Add get_save_path(). 2014-07-03 23:49:10 +02:00
Fabien Freling 4f124a2896 Remove deprecated functions (draw). 2014-07-03 23:48:11 +02:00
Fabien Freling e86dbe0f36 Factorize the computation of the source point. 2014-07-02 22:38:57 +02:00
Fabien Freling 7e33e85909 Fix tiled rotation.
- Add TiledImage::access_pixel().
- Add TiledImage::print_tile().
- Compare implementations.
2014-07-02 21:54:52 +02:00
Fabien Freling 007ad2284e Add basic tiled image type. 2014-07-01 21:52:40 +02:00
Fabien Freling 3af56f6619 Interpolate using SSE instructions. 2014-06-29 17:17:19 +02:00
Fabien Freling 05777d59f8 Deduce src points needed for interpolation.
Computing the four points is too heavy.
2014-06-28 18:35:48 +02:00
Fabien Freling 0a0fbabeac Bilinear interpolation.
- Compute src delta for each rotated steps.
2014-06-28 18:23:43 +02:00
Fabien Freling 258ddce814 Use a unique buffer for pixels (scanline).
- Add rotate_pixel().
- Remove APoint, use Point instead.
2014-06-28 13:52:24 +02:00
Fabien Freling 6a94c79ac2 FIll new interpolated pixels.
- Take input image in argument.
- Allow set_pixel() out of bounds, noop.
2014-06-26 23:45:02 +02:00
Fabien Freling c0ed5f1be0 Add check_90().
- Fix border.
2014-06-26 21:28:34 +02:00
Fabien Freling b666b1b4a6 Walk through src pixel in order.
- Set background to red
2014-06-26 19:18:32 +02:00
Fabien Freling ce3592e857 Fix rotation by using atan2().
- Add more check on polar conversion.
2014-06-24 19:14:59 +02:00
Fabien Freling cc7ec6fef2 Add basic support for full (broken) rotation.
- New way to compute ratio.
- Add {set,get}_pixel()
2014-06-24 00:59:04 +02:00
Fabien Freling 22546de9db Fix draw_lines for x1 = x2 and y1 = y2.
Some lines are dotted though.
2014-06-22 16:08:40 +02:00
Fabien Freling 70a828b651 Fix trigo, use double point for position. 2014-06-22 15:50:42 +02:00
Fabien Freling 8a17f7b8d8 Draw rotated outlines.
There is a bug for rotation = pi / 2
2014-06-19 00:05:49 +02:00
Fabien Freling 4bf69e8204 Initial commit 2014-06-18 08:47:10 +02:00