Support for filters with larger support. Initial support for edge behavior.

This commit is contained in:
Jorge Rodriguez
2014-07-26 11:51:02 -07:00
parent 62ff271c7a
commit 7abd4ccf34
3 changed files with 154 additions and 114 deletions

View File

@ -48,7 +48,7 @@ int main(int argc, char** argv)
int in_w = 512;
int in_h = 512;
size_t memory_required = stbr_calculate_memory(in_w, in_h, w*n, out_w, out_h, out_stride, n, STBR_FILTER_NEAREST);
size_t memory_required = stbr_calculate_memory(in_w, in_h, w*n, out_w, out_h, out_stride, n, STBR_FILTER_LINEAR);
void* extra_memory = malloc(memory_required);
// Cut out the outside 64 pixels all around to test the stride.
@ -56,7 +56,7 @@ int main(int argc, char** argv)
STBR_ASSERT(in_w + border <= w);
STBR_ASSERT(in_h + border <= h);
stbr_resize_arbitrary(input_data + w * border * n + border * n, in_w, in_h, w*n, output_data, out_w, out_h, out_stride, n, STBR_TYPE_UINT8, STBR_FILTER_NEAREST, extra_memory, memory_required);
stbr_resize_arbitrary(input_data + w * border * n + border * n, in_w, in_h, w*n, output_data, out_w, out_h, out_stride, n, STBR_TYPE_UINT8, STBR_FILTER_LINEAR, STBR_EDGE_CLAMP, extra_memory, memory_required);
free(extra_memory);