Bug 381774 - r16 heightmap import does not support non-square dimensions
Summary: r16 heightmap import does not support non-square dimensions
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Victor Wåhlström
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-28 22:33 UTC by Victor Wåhlström
Modified: 2017-07-14 19:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Wåhlström 2017-06-28 22:33:45 UTC
The heightmap importer for .r16 files has a "size" input field. This appears to be width * height, but because they cannot be specified separately the code effectively only supports square heightmaps.
Comment 1 Victor Wåhlström 2017-06-28 22:38:07 UTC
I tried replacing the heightmap importer with a generic raw data importer two years ago. Conceptually it worked, but because Krita requires importer/exporter code to associate with a given file extension I ended up shelving it.

I'll see if I can adapt the code to work with the current r16 import/export code.
Comment 2 Victor Wåhlström 2017-07-14 19:45:56 UTC
Git commit b4b9021616edcfb1e6bfd084c5567f69da7668fa by Victor Wåhlström.
Committed on 14/07/2017 at 19:27.
Pushed by victorw into branch 'master'.

Add support for non-square heightmap import/export and various related improvements/bugfixes

* Support for non-square heightmap files (.r8, .r16)
* New heightmap import/export dialog
* Fixed issue where imported heightmap is "transposed"
* Fixed issue where saving an r16 heightmap file as r8 or vice versa only changes the extension
Related: bug 381830, bug 381866

Differential Revision: https://phabricator.kde.org/D6460

M  +10   -0    libs/ui/kis_config.cc
M  +3    -0    libs/ui/kis_config.h
M  +4    -0    plugins/impex/heightmap/CMakeLists.txt
M  +39   -44   plugins/impex/heightmap/kis_heightmap_export.cpp
M  +1    -17   plugins/impex/heightmap/kis_heightmap_export.h
M  +50   -35   plugins/impex/heightmap/kis_heightmap_import.cpp
M  +1    -1    plugins/impex/heightmap/kis_heightmap_import.h
A  +230  -0    plugins/impex/heightmap/kis_wdg_options_heightmap.cpp     [License: LGPL (v2.1+)]
A  +52   -0    plugins/impex/heightmap/kis_wdg_options_heightmap.h     [License: LGPL (v2.1+)]
M  +170  -59   plugins/impex/heightmap/kis_wdg_options_heightmap.ui
A  +10   -0    plugins/impex/heightmap/tests/CMakeLists.txt
A  +-    --    plugins/impex/heightmap/tests/data/results/test_512x256.r16.png
A  +-    --    plugins/impex/heightmap/tests/data/results/test_512x256.r8.png
A  +-    --    plugins/impex/heightmap/tests/data/results/test_512x512.r16.png
A  +-    --    plugins/impex/heightmap/tests/data/results/test_512x512.r8.png
A  +-    --    plugins/impex/heightmap/tests/data/sources/test_512x256.r16
A  +1    -0    plugins/impex/heightmap/tests/data/sources/test_512x256.r8
A  +-    --    plugins/impex/heightmap/tests/data/sources/test_512x512.r16
A  +1    -0    plugins/impex/heightmap/tests/data/sources/test_512x512.r8
A  +36   -0    plugins/impex/heightmap/tests/kis_heightmap_test.cpp     [License: GPL (v2+)]
A  +31   -0    plugins/impex/heightmap/tests/kis_heightmap_test.h     [License: GPL (v2+)]

https://commits.kde.org/krita/b4b9021616edcfb1e6bfd084c5567f69da7668fa