Skip to content

Commit fbd5d13

Browse files
committed
Wrappers for resize
1 parent 26fe2af commit fbd5d13

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

include/af/image.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ AFAPI void saveImage(const char* filename, const array& in);
2222

2323
AFAPI array resize(const array& in, const dim_type odim0, const dim_type odim1, const af_interp_type method=AF_INTERP_NEAREST);
2424

25-
AFAPI array transform(const array& in, const array& transform, const dim_type odim0, const dim_type odim1, const af_interp_type method=AF_INTERP_NEAREST, const bool inverse=true);
25+
AFAPI array resize(const array& in, const float scale0, const float scale1, const af_interp_type method=AF_INTERP_NEAREST);
26+
27+
AFAPI array resize(const array& in, const float scale, const af_interp_type method=AF_INTERP_NEAREST);
2628

2729
AFAPI array rotate(const array& in, const float theta, const af_interp_type method=AF_INTERP_NEAREST, const bool crop=true);
2830

31+
AFAPI array transform(const array& in, const array& transform, const dim_type odim0, const dim_type odim1, const af_interp_type method=AF_INTERP_NEAREST, const bool inverse=true);
32+
2933
AFAPI array translate(const array& in, const float trans0, const float trans1, const dim_type odim0, const dim_type odim1, const af_interp_type method=AF_INTERP_NEAREST);
3034

3135
AFAPI array scale(const array& in, const float scale0, const float scale1, const dim_type odim0, const dim_type odim1, const af_interp_type method=AF_INTERP_NEAREST);

src/api/cpp/resize.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,18 @@ array resize(const array &in, const dim_type odim0, const dim_type odim1, const
2020
return array(out);
2121
}
2222

23+
array resize(const array &in, const float scale0, const float scale1, const af_interp_type method)
24+
{
25+
af_array out = 0;
26+
AF_THROW(af_resize(&out, in.get(), in.dims(0) * scale0, in.dims(1) * scale1, method));
27+
return array(out);
28+
}
29+
30+
array resize(const array &in, const float scale, const af_interp_type method)
31+
{
32+
af_array out = 0;
33+
AF_THROW(af_resize(&out, in.get(), in.dims(0) * scale, in.dims(1) * scale, method));
34+
return array(out);
35+
}
36+
2337
}

0 commit comments

Comments
 (0)