1
0
mirror of https://github.com/libjpeg-turbo/libjpeg-turbo.git synced 2026-10-23 11:48:53 +03:00
Files
libjpeg-turbo/cmakescripts/GenerateWrappers.cmake
DRC 54bd58cc30 PNG image I/O support
Note that this changes the behavior of tj3GetICCProfile() in the
following ways:

- It can now be called with a compression instance, thus allowing the
  caller to retrieve an ICC profile (or the size thereof) extracted from
  a PNG image by tj3LoadImage*().
- The ICC profile extracted from a JPEG image can now be retrieved
  multiple times.  If I recall, I didn't allow this in TurboJPEG 3.1
  because there were already two buffer copies, one in
  jpeg_read_icc_profile() and another in the JNI wrapper.  That is no
  longer relevant, since the TurboJPEG Java API is now a separate
  project.

These changes should be backward-compatible.  Applications that treat
tj3GetICCProfile() as a mailbox rather than a newsstand will still work.
The changes were necessary in order to:

- allow decompression programs to both extract the ICC profile from a
  JPEG image and embed it into a PNG output image, and
- allow compression programs to retrieve the ICC profile size from a PNG
  input image (which is important when computing the worst-case JPEG
  destination buffer size.)

Closes #645
2026-03-12 17:45:51 -04:00

38 lines
1.0 KiB
CMake

if(NOT DEFINED SOURCE_DIR)
message(FATAL_ERROR "SOURCE_DIR must be specified")
endif()
foreach(FILE jcapistd.c jccolor.c jcdiffct.c jclossls.c jcmainct.c jcprepct.c
jcsample.c jdapistd.c jdcolor.c jddiffct.c jdlossls.c jdmainct.c jdpostct.c
jdsample.c jutils.c rdpng.c rdppm.c wrpng.c wrppm.c)
foreach(BITS 8 12 16)
string(REGEX REPLACE "\\.c" "-${BITS}.c" WRAPPER_FILE ${FILE})
if(BITS EQUAL 8)
set(BITS_RANGE "2 to 8")
elseif(BITS EQUAL 12)
set(BITS_RANGE "9 to 12")
else()
set(BITS_RANGE "13 to 16")
endif()
configure_file(${SOURCE_DIR}/template.c ${SOURCE_DIR}/${WRAPPER_FILE})
endforeach()
endforeach()
foreach(FILE jccoefct.c jcdctmgr.c jdcoefct.c jddctmgr.c jdmerge.c jfdctfst.c
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c jquant2.c
rdcolmap.c wrgif.c)
foreach(BITS 8 12)
string(REGEX REPLACE "\\.c" "-${BITS}.c" WRAPPER_FILE ${FILE})
set(BITS_RANGE ${BITS})
configure_file(${SOURCE_DIR}/template.c ${SOURCE_DIR}/${WRAPPER_FILE})
endforeach()
endforeach()