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

Remove the lib/jxl directory. #11

Merged
merged 15 commits into from
Jul 12, 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
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,11 @@ if(JPEGXL_ENABLE_DOXYGEN)
if(DOXYGEN_FOUND)
set(DOXYGEN_GENERATE_HTML "YES")
set(DOXYGEN_GENERATE_XML "YES")
set(DOXYGEN_STRIP_FROM_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib/include")
if(JPEGXL_WARNINGS_AS_ERRORS)
set(DOXYGEN_WARN_AS_ERROR "YES")
endif()
set(DOXYGEN_QUIET "YES")
doxygen_add_docs(doc
"${CMAKE_CURRENT_SOURCE_DIR}/lib/include"
"${CMAKE_CURRENT_SOURCE_DIR}/doc/api.txt"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Generating C API documentation")
Expand Down
3 changes: 1 addition & 2 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ def ConfigProject(app, config):
GENERATE_HTML = NO
GENERATE_LATEX = NO
GENERATE_XML = YES
INPUT = lib/include doc/api.txt
INPUT = doc/api.txt
OUTPUT_DIRECTORY = {build_dir}
PROJECT_NAME = LIBJXL
QUIET = YES
RECURSIVE = YES
STRIP_FROM_PATH = lib/include
WARN_AS_ERROR = YES
""")
subprocess.check_call(['doxygen', doxyfile], cwd=root_dir)
Expand Down
23 changes: 1 addition & 22 deletions lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,6 @@ EXPORT_TEMPLATE = """
#endif
"""

JXL_EXPORT_H = INCLUDES_DIR + "/jxl/jxl_export.h"

genrule(
name = "create_jxl_export",
outs = [JXL_EXPORT_H],
cmd = "echo '" + EXPORT_TEMPLATE.replace("@", "JXL") + "' > $@",
compatible_with = DEFAULT_COMPATIBILITY,
)

JXL_CMS_EXPORT_H = INCLUDES_DIR + "/jxl/jxl_cms_export.h"

genrule(
name = "create_jxl_cms_export",
outs = [JXL_CMS_EXPORT_H],
cmd = "echo '" + EXPORT_TEMPLATE.replace("@", "JXL_CMS") + "' > $@",
compatible_with = DEFAULT_COMPATIBILITY,
)

JXL_THREADS_EXPORT_H = INCLUDES_DIR + "/jxl/jxl_threads_export.h"

genrule(
Expand Down Expand Up @@ -166,10 +148,7 @@ copy_file(

cc_library(
name = "includes",
hdrs = libjxl_public_headers + [
JXL_EXPORT_H,
JXL_CMS_EXPORT_H,
],
hdrs = libjxl_public_headers
compatible_with = DEFAULT_COMPATIBILITY,
strip_include_prefix = INCLUDES_DIR,
deps = [":jxl_version"],
Expand Down
20 changes: 18 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,26 @@ elseif(LIBCXX)
set(PKGCONFIG_CXX_LIB "-lc++")
endif()

add_library(jxl_base INTERFACE)
target_include_directories(jxl_base SYSTEM BEFORE INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
)
target_include_directories(jxl_base BEFORE INTERFACE
${PROJECT_SOURCE_DIR}
${JXL_HWY_INCLUDE_DIRS}
)

# On android, link with log to use android-related log functions.
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
find_library(log-lib log)
if(log-lib)
target_link_libraries(jxl_base INTERFACE ${log-lib})
target_compile_definitions(jxl_base INTERFACE USE_ANDROID_LOGGER)
endif()
endif()

# The jxl_cms library definition.
include(jxl_cms.cmake)
# The jxl library definition.
include(jxl.cmake)

# Other libraries outside the core jxl library.
if(JPEGXL_ENABLE_TOOLS OR BUILD_TESTING)
Expand Down
4 changes: 2 additions & 2 deletions lib/jxl/base/bits.h → lib/base/bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

// Specialized instructions for processing register-sized bit arrays.

#include "lib/jxl/base/compiler_specific.h"
#include "lib/jxl/base/status.h"
#include "lib/base/compiler_specific.h"
#include "lib/base/status.h"

#if JXL_COMPILER_MSVC
#include <intrin.h>
Expand Down
4 changes: 2 additions & 2 deletions lib/jxl/base/byte_order.h → lib/base/byte_order.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#ifndef LIB_JXL_BASE_BYTE_ORDER_H_
#define LIB_JXL_BASE_BYTE_ORDER_H_

#include <jxl/types.h>
#include <stdint.h>
#include <string.h> // memcpy

#include "lib/jxl/base/compiler_specific.h"
#include "lib/base/compiler_specific.h"
#include "lib/base/types.h"

#if JXL_COMPILER_MSVC
#include <intrin.h> // _byteswap_*
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/jxl/base/common.h → lib/base/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <string>
#include <type_traits>

#include "lib/jxl/base/compiler_specific.h"
#include "lib/base/compiler_specific.h"

namespace jxl {
// Some enums and typedefs used by more than one header file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <sys/types.h>

#include "lib/jxl/base/sanitizer_definitions.h"
#include "lib/base/sanitizer_definitions.h"

// #if is shorter and safer than #ifdef. *_VERSION are zero if not detected,
// otherwise 100 * major + minor version. Note that other packages check for
Expand Down
6 changes: 3 additions & 3 deletions lib/jxl/base/data_parallel.h → lib/base/data_parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
// Portable, low-overhead C++11 ThreadPool alternative to OpenMP for
// data-parallel computations.

#include <jxl/parallel_runner.h>
#include <stddef.h>
#include <stdint.h>

#include "lib/jxl/base/compiler_specific.h"
#include "lib/jxl/base/status.h"
#include "lib/base/compiler_specific.h"
#include "lib/base/parallel_runner.h"
#include "lib/base/status.h"
#if JXL_COMPILER_MSVC
// suppress warnings about the const & applied to function types
#pragma warning(disable : 4180)
Expand Down
4 changes: 2 additions & 2 deletions lib/jxl/base/fast_math-inl.h → lib/base/fast_math-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

#include <hwy/highway.h>

#include "lib/jxl/base/common.h"
#include "lib/jxl/base/rational_polynomial-inl.h"
#include "lib/base/common.h"
#include "lib/base/rational_polynomial-inl.h"
HWY_BEFORE_NAMESPACE();
namespace jxl {
namespace HWY_NAMESPACE {
Expand Down
8 changes: 4 additions & 4 deletions lib/jxl/base/float.h → lib/base/float.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#ifndef LIB_JXL_BASE_FLOAT_H_
#define LIB_JXL_BASE_FLOAT_H_

#include <jxl/types.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include "lib/jxl/base/byte_order.h"
#include "lib/jxl/base/compiler_specific.h"
#include "lib/jxl/base/status.h"
#include "lib/base/byte_order.h"
#include "lib/base/compiler_specific.h"
#include "lib/base/status.h"
#include "lib/base/types.h"

namespace jxl {

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/jxl/base/matrix_ops.h → lib/base/matrix_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <cmath> // abs
#include <cstddef>

#include "lib/jxl/base/status.h"
#include "lib/base/status.h"

namespace jxl {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/jxl/base/random.h → lib/base/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <algorithm>
#include <cmath>

#include "lib/jxl/base/status.h"
#include "lib/base/status.h"

namespace jxl {
struct Rng {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#define LIB_JXL_BASE_RATIONAL_POLYNOMIAL_INL_H_
#endif

#include <jxl/types.h>
#include <stddef.h>

#include <hwy/highway.h>

#include "lib/base/types.h"
HWY_BEFORE_NAMESPACE();
namespace jxl {
namespace HWY_NAMESPACE {
Expand Down
4 changes: 2 additions & 2 deletions lib/jxl/base/rect.h → lib/base/rect.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <string>
#include <utility> // std::move

#include "lib/jxl/base/compiler_specific.h"
#include "lib/jxl/base/status.h"
#include "lib/base/compiler_specific.h"
#include "lib/base/status.h"

namespace jxl {

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/jxl/base/sanitizers.h → lib/base/sanitizers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include <cstddef>

#include "lib/jxl/base/compiler_specific.h"
#include "lib/jxl/base/sanitizer_definitions.h"
#include "lib/base/compiler_specific.h"
#include "lib/base/sanitizer_definitions.h"

#if JXL_MEMORY_SANITIZER
#include "sanitizer/msan_interface.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/jxl/base/span.h → lib/base/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <type_traits>
#include <vector>

#include "lib/jxl/base/status.h"
#include "lib/base/status.h"

namespace jxl {

Expand Down
6 changes: 3 additions & 3 deletions lib/jxl/base/status.h → lib/base/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <type_traits>
#include <utility>

#include "lib/jxl/base/common.h"
#include "lib/jxl/base/compiler_specific.h"
#include "lib/jxl/base/sanitizer_definitions.h"
#include "lib/base/common.h"
#include "lib/base/compiler_specific.h"
#include "lib/base/sanitizer_definitions.h"

#if JXL_ADDRESS_SANITIZER || JXL_MEMORY_SANITIZER || JXL_THREAD_SANITIZER
#include "sanitizer/common_interface_defs.h" // __sanitizer_print_stack_trace
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion lib/include/jxl/cms.h → lib/cms/cms.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

// ICC profiles and color space conversions.

#include <jxl/cms_interface.h>
#include <jxl/jxl_cms_export.h>

#include "lib/cms/cms_interface.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
18 changes: 3 additions & 15 deletions lib/include/jxl/cms_interface.h → lib/cms/cms_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@
* https://developers.google.com/open-source/licenses/bsd
*/

/** @addtogroup libjxl_color
* @{
* @file cms_interface.h
* @brief Interface to allow the injection of different color management systems
* (CMSes, also called color management modules, or CMMs) in JPEG XL.
*
* A CMS is needed by the JPEG XL encoder and decoder to perform colorspace
* conversions. This defines an interface that can be implemented for different
* CMSes and then passed to the library.
*/

#ifndef JXL_CMS_INTERFACE_H_
#define JXL_CMS_INTERFACE_H_

#include <jxl/color_encoding.h>
#include <jxl/types.h>
#include <stddef.h>
#include <stdint.h>

#include "lib/base/types.h"
#include "lib/cms/color_encoding.h"

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
Expand Down Expand Up @@ -252,5 +242,3 @@ typedef struct {
#endif

#endif /* JXL_CMS_INTERFACE_H_ */

/** @} */
24 changes: 7 additions & 17 deletions lib/include/jxl/color_encoding.h → lib/cms/color_encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
* https://developers.google.com/open-source/licenses/bsd
*/

/** @addtogroup libjxl_color
* @{
* @file color_encoding.h
* @brief Color Encoding definitions used by JPEG XL.
* All CIE units are for the standard 1931 2 degree observer.
*/

#ifndef JXL_COLOR_ENCODING_H_
#define JXL_COLOR_ENCODING_H_

Expand All @@ -24,7 +17,7 @@ typedef enum {
/** Tristimulus RGB */
JXL_COLOR_SPACE_RGB,
/** Luminance based, the primaries in @ref JxlColorEncoding must be ignored.
* This value implies that num_color_channels in @ref JxlBasicInfo is 1, any
* This value implies that num_color_channels in JxlBasicInfo is 1, any
* other value implies num_color_channels is 3. */
JXL_COLOR_SPACE_GRAY,
/** XYB (opsin) color space */
Expand All @@ -36,7 +29,7 @@ typedef enum {
/** Built-in whitepoints for color encoding. When decoding, the numerical xy
* whitepoint value can be read from the @ref JxlColorEncoding white_point field
* regardless of the enum value. When encoding, enum values except
* ::JXL_WHITE_POINT_CUSTOM override the numerical fields. Some enum values
* JXL_WHITE_POINT_CUSTOM override the numerical fields. Some enum values
* match a subset of CICP (Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E)), however
* the white point and RGB primaries are separate enums here.
*/
Expand All @@ -56,7 +49,7 @@ typedef enum {
/** Built-in primaries for color encoding. When decoding, the primaries can be
* read from the @ref JxlColorEncoding primaries_red_xy, primaries_green_xy and
* primaries_blue_xy fields regardless of the enum value. When encoding, the
* enum values except ::JXL_PRIMARIES_CUSTOM override the numerical fields.
* enum values except JXL_PRIMARIES_CUSTOM override the numerical fields.
* Some enum values match a subset of CICP (Rec. ITU-T H.273 | ISO/IEC
* 23091-2:2019(E)), however the white point and RGB primaries are separate
* enums here.
Expand Down Expand Up @@ -117,18 +110,18 @@ typedef struct {
*/
JxlColorSpace color_space;

/** Built-in white point. If this value is ::JXL_WHITE_POINT_CUSTOM, must
/** Built-in white point. If this value is JXL_WHITE_POINT_CUSTOM, must
* use the numerical whitepoint values from white_point_xy.
*/
JxlWhitePoint white_point;

/** Numerical whitepoint values in CIE xy space. */
double white_point_xy[2];

/** Built-in RGB primaries. If this value is ::JXL_PRIMARIES_CUSTOM, must
/** Built-in RGB primaries. If this value is JXL_PRIMARIES_CUSTOM, must
* use the numerical primaries values below. This field and the custom values
* below are unused and must be ignored if the color space is
* ::JXL_COLOR_SPACE_GRAY or ::JXL_COLOR_SPACE_XYB.
* JXL_COLOR_SPACE_GRAY or JXL_COLOR_SPACE_XYB.
*/
JxlPrimaries primaries;

Expand All @@ -144,8 +137,7 @@ typedef struct {
/** Transfer function if have_gamma is 0 */
JxlTransferFunction transfer_function;

/** Gamma value used when transfer_function is @ref
* JXL_TRANSFER_FUNCTION_GAMMA
/** Gamma value used when transfer_function is JXL_TRANSFER_FUNCTION_GAMMA
*/
double gamma;

Expand All @@ -158,5 +150,3 @@ typedef struct {
#endif

#endif /* JXL_COLOR_ENCODING_H_ */

/** @}*/
Loading
Loading