Pavel Krajcevski
088481afe4
Meant resize instead of reserve.
2013-09-25 16:37:17 -04:00
Pavel Krajcevski
a587899048
Fix some compiler errors with MSVC (and honestly, other compilers should catch them, too.)
2013-09-25 15:06:45 -04:00
Pavel Krajcevski
ed12d53cd4
Merge in a few changes from master
2013-09-25 15:05:56 -04:00
Pavel Krajcevski
f19b324d28
Make sure to use the proper directory when running RUN_TESTS from MSVC. Note, this doesn't work in Release.
2013-09-25 14:42:35 -04:00
Pavel Krajcevski
79d2ad79ac
Fix some snafus on windows
2013-09-25 14:30:48 -04:00
Pavel Krajcevski
c6d7bdc670
Very preliminary compressor
2013-09-24 20:35:36 -04:00
Pavel Krajcevski
8f4dcca4d7
Add some utility functions for manipulating the block data, including packing colors back into the 64-bit word.
2013-09-24 20:33:48 -04:00
Pavel Krajcevski
3de9abc908
Make PVRTC block size a constant accessible from the global header
2013-09-24 19:30:31 -04:00
Pavel Krajcevski
340f4f3141
Add pixel packing routines
2013-09-24 19:29:03 -04:00
Pavel Krajcevski
75e570ed16
Fix some compiler snafus
2013-09-24 17:46:09 -04:00
Pavel Krajcevski
1636232717
Make sure that when changing from higher to lower bit depth (i.e. perform a division) that we round to the nearest value
2013-09-24 17:45:19 -04:00
Pavel Krajcevski
ea68f3a138
PVRTC image quality of life improvements.
2013-09-24 14:00:14 -04:00
Pavel Krajcevski
e9a9988a56
Fix small bug in downsampling that causes artifacts
2013-09-20 12:48:56 -04:00
Pavel Krajcevski
1093447055
Plug in the infrastructure to start passing images to be compressed.
2013-09-20 12:43:59 -04:00
Pavel Krajcevski
995c237e5e
Add downscale test and fix a few bugs and formatting.
2013-09-19 17:47:36 -04:00
Pavel Krajcevski
1d58ea2385
Add RGBA pixel constructor
2013-09-19 15:11:27 -04:00
Pavel Krajcevski
9f4fa671d9
Add a first pass at content aware downscaling.
2013-09-18 18:03:44 -04:00
Pavel Krajcevski
e609075d04
Split apart the index calculation and pixel lookup functions
2013-09-18 18:03:08 -04:00
Pavel Krajcevski
16cc7f4a93
Use GetHeight/GetWidth() where appropriate instead of m_Width/m_Height
2013-09-18 18:02:35 -04:00
Pavel Krajcevski
4135e38f22
Set the default wrap behavior to wrap for image upscale, too
2013-09-18 18:00:59 -04:00
Pavel Krajcevski
093576c9e7
Add initial code for our compressor.
2013-09-13 13:10:22 -04:00
Pavel Krajcevski
0afa1281a8
Change default wrap mode to wrap
2013-09-13 13:10:07 -04:00
Pavel Krajcevski
571bf1ebd0
Remove dead code
2013-09-12 15:01:30 -04:00
Pavel Krajcevski
f7404c44b9
Refactor debug output for modulation info.
2013-09-12 15:01:19 -04:00
Pavel Krajcevski
1b073eb4b7
Add 2BPP decompression
2013-09-12 14:45:56 -04:00
Pavel Krajcevski
b3de3f2c01
If our compile flag is set to output debug images with tests, then actually do it.
2013-09-12 14:45:42 -04:00
Pavel Krajcevski
b3f8fcd454
Decouple upscale directions so that we can non-uniformly scale images.
2013-09-12 14:44:54 -04:00
Pavel Krajcevski
7184d49ccd
Add unpack RGBA for our pixels
2013-09-12 14:41:00 -04:00
Pavel Krajcevski
9f6e6e7233
Fix bug with debug images
2013-09-12 14:32:33 -04:00
Pavel Krajcevski
1115c2f9e4
Add 2BPP helper functions for our blocks.
...
Namely, there are two things that we need to do:
1. Figure out the sub-mode based on the mode bit and the structure of the modulation data. The comments in Block.h describe how we do this.
2. For a given texel index, return 2BPP texel modulation bits.
2013-09-12 14:30:08 -04:00
Pavel Krajcevski
08cad3ba86
Add 2BPP tests
2013-09-12 14:04:20 -04:00
Pavel Krajcevski
0172df4e60
Add final opaque to transparent gradient test.
2013-09-10 13:34:13 -04:00
Pavel Krajcevski
dd625fca71
When going from 344(3/4) pixels to 4555, the alpha channel only has a zero appended to it. Hence we must clear that bit for each pixel that was transparent during decoding.
2013-09-10 13:22:53 -04:00
Pavel Krajcevski
f5e0aa4f9f
Make sure to clear the MSBs of channels that have zero depth that get converted to higher depth values
2013-09-10 13:21:48 -04:00
Pavel Krajcevski
77bb7488cc
Fix typo
2013-09-10 11:58:53 -04:00
Pavel Krajcevski
eb312ccb0a
Small refactor
2013-09-09 14:16:45 -04:00
Pavel Krajcevski
5020f81f00
Add a transparent pvr image test
2013-09-09 10:33:04 -05:00
Pavel Krajcevski
6c8eea5520
Add superfluous code from when I was trying to match the decoder to PVR library.
2013-09-09 10:31:53 -05:00
Pavel Krajcevski
09b5680245
Some small code style fixes
2013-09-06 13:37:50 -04:00
Pavel Krajcevski
5ac6872dc7
Add a test to make sure that after a bilerp the pixels that should remain unaffected do in fact remain unaffected.
2013-09-06 02:02:34 -04:00
Pavel Krajcevski
3806efe6fc
Add some more hacky includes to be able to output debug images from our tests.
2013-09-06 02:02:02 -04:00
Pavel Krajcevski
91c79cd717
Fix Bilinear upscale
...
There were a couple of fixes.
1. Add another set of pixels to an image that represent the fractional bits that get populated as a result of doing a bilerp.
2. Do not consider individual axes when doing the bilerp. Instead, assign a weight to each of the different texels that we will use for the bilerp. Then, combine them and save the fractional bits.
2013-09-06 01:58:53 -04:00
Pavel Krajcevski
92827c23fc
Add a debug function to our intermediate PVRTC images
2013-09-06 01:57:06 -04:00
Pavel Krajcevski
0d0c65f536
Actually index into our pixels properly...
2013-09-06 01:55:25 -04:00
Pavel Krajcevski
2263080faa
Fix the interleaving by doing it when we're actually reading in the blocks
2013-09-06 01:55:06 -04:00
Pavel Krajcevski
db914018f1
Two enhancements:
...
1. Make sure to use the same lerping code for both modulation modes when decompressing.
2. Accept a flag during decompression that outputs the debug images that were computed during decompression.
2013-09-06 01:53:10 -04:00
Pavel Krajcevski
7403e77d4d
Add some hacky includes and libraries to support writing out debug images
2013-09-06 01:50:46 -04:00
Pavel Krajcevski
a6e6138084
Change the lerp function to be more explicit.
2013-09-05 14:49:56 -04:00
Pavel Krajcevski
b8e155e11c
Switch red and blue channels in our decompressor test.
2013-09-05 14:49:08 -04:00
Pavel Krajcevski
7b72a84d87
Add a working directory for PVR lib tests
...
Unfortunately, the WORKING_DIRECTORY directive for ADD_TEST seems to be broken as of CMake 2.8.10, fortunately there was a mail thread about this issue in 2.6 so I was able to implement the workaround.
2013-09-04 20:43:49 -04:00