mirror of
https://github.com/bkaradzic/bimg.git
synced 2026-02-17 20:52:38 +01:00
Added image resize.
This commit is contained in:
@@ -57,6 +57,12 @@ namespace bimg
|
||||
, uint16_t _height
|
||||
);
|
||||
|
||||
///
|
||||
bool imageResizeRgba32fLinear(
|
||||
ImageContainer* _dst
|
||||
, const ImageContainer* _src
|
||||
);
|
||||
|
||||
} // namespace bimg
|
||||
|
||||
#endif // BIMG_ENCODE_H_HEADER_GUARD
|
||||
|
||||
@@ -12,6 +12,7 @@ project "bimg"
|
||||
}
|
||||
|
||||
files {
|
||||
path.join(BIMG_DIR, "include/**"),
|
||||
path.join(BIMG_DIR, "src/image.*"),
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ project "bimg_decode"
|
||||
}
|
||||
|
||||
files {
|
||||
path.join(BIMG_DIR, "include/**"),
|
||||
path.join(BIMG_DIR, "src/image_decode.*"),
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ project "bimg_encode"
|
||||
}
|
||||
|
||||
files {
|
||||
path.join(BIMG_DIR, "include/**"),
|
||||
path.join(BIMG_DIR, "src/image_encode.*"),
|
||||
path.join(BIMG_DIR, "3rdparty/libsquish/**.cpp"),
|
||||
path.join(BIMG_DIR, "3rdparty/libsquish/**.h"),
|
||||
|
||||
@@ -12,6 +12,13 @@
|
||||
#include <pvrtc/PvrTcEncoder.h>
|
||||
#include <edtaa3/edtaa3func.h>
|
||||
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH();
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4100) // warning C4100: 'alloc_context': unreferenced formal parameter
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4702) // warning C4702: unreachable code
|
||||
#define STB_IMAGE_RESIZE_IMPLEMENTATION
|
||||
#include <stb/stb_image_resize.h>
|
||||
BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
|
||||
extern "C" {
|
||||
#include <iqa.h>
|
||||
}
|
||||
@@ -301,4 +308,19 @@ namespace bimg
|
||||
return result;
|
||||
}
|
||||
|
||||
bool imageResizeRgba32fLinear(ImageContainer* _dst, const ImageContainer* _src)
|
||||
{
|
||||
int result = stbir_resize_float_generic(
|
||||
(const float*)_src->m_data, _src->m_width, _src->m_height, _src->m_width*16
|
||||
, ( float*)_dst->m_data, _dst->m_width, _dst->m_height, _dst->m_width*16
|
||||
, 4, 1
|
||||
, 0
|
||||
, STBIR_EDGE_CLAMP
|
||||
, STBIR_FILTER_DEFAULT
|
||||
, STBIR_COLORSPACE_LINEAR
|
||||
, NULL
|
||||
);
|
||||
return 1 == result;
|
||||
}
|
||||
|
||||
} // namespace bimg
|
||||
|
||||
Reference in New Issue
Block a user