Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move stb resize function to Cesium namespace #871

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CesiumGltfContent/src/ImageManipulation.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#include <CesiumGltf/ImageCesium.h>
#include <CesiumGltfContent/ImageManipulation.h>

#include <stb_image_resize.h>

#include <cassert>
#include <cstring>

namespace Cesium {
// Use STB resize in our own namespace to avoid conflicts from other libs
#define STBIRDEF
#include <stb_image_resize.h>
#undef STBIRDEF
}; // namespace Cesium

using namespace Cesium;

#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <stb_image_write.h>

Expand Down
14 changes: 11 additions & 3 deletions CesiumGltfReader/src/GltfReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,26 @@
#include <sstream>
#include <string>

#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#define STBI_FAILURE_USERMSG
#include <stb_image.h>

namespace Cesium {
// Use STB resize in our own namespace to avoid conflicts from other libs
#define STBIRDEF
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#include <stb_image_resize.h>
#undef STBIRDEF
}; // namespace Cesium

#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
#include <turbojpeg.h>

using namespace CesiumAsync;
using namespace CesiumGltf;
using namespace CesiumGltfReader;
using namespace CesiumJsonReader;
using namespace CesiumUtility;
using namespace Cesium;

namespace {
#pragma pack(push, 1)
Expand Down
Loading