Skip to content

Commit

Permalink
fixed scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Jan 12, 2024
1 parent aae5ee2 commit b5ecb09
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
2 changes: 1 addition & 1 deletion JxlCoder.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'JxlCoder'
s.version = '1.5.1'
s.version = '1.5.2'
s.summary = 'JXL coder for iOS and MacOS'
s.description = 'Provides support for JXL files in iOS and MacOS'
s.homepage = 'https://github.com/awxkee/jxl-coder-swift'
Expand Down
33 changes: 0 additions & 33 deletions Sources/jxlc/algo/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
#ifndef LIB_JXL_BASE_COMMON_H_
#define LIB_JXL_BASE_COMMON_H_

// Shared constants and helper functions.

#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <memory>
#include <string>

namespace coder {
// Some enums and typedefs used by more than one header file.
Expand Down Expand Up @@ -56,38 +50,11 @@ namespace coder {
return static_cast<T>(multiplier * kPi);
}

// Prior to C++14 (i.e. C++11): provide our own make_unique
#if __cplusplus < 201402L
template <typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#else
using std::make_unique;
#endif

template<typename T>
inline T Clamp1(T val, T low, T hi) {
return val < low ? low : val > hi ? hi : val;
}

// conversion from integer to string.
template<typename T>
std::string ToString(T n) {
char data[32] = {};
if (T(0.1) != T(0)) {
// float
snprintf(data, sizeof(data), "%g", static_cast<double>(n));
} else if (T(-1) > T(0)) {
// unsigned
snprintf(data, sizeof(data), "%llu", static_cast<unsigned long long>(n));
} else {
// signed
snprintf(data, sizeof(data), "%lld", static_cast<long long>(n));
}
return data;
}

} // namespace jxl

#endif // LIB_JXL_BASE_COMMON_H_

0 comments on commit b5ecb09

Please sign in to comment.