Граф коммитов

40 Коммитов

Автор SHA1 Сообщение Дата
DRC b5a1472781 Build: Fix permissions 2020-10-15 10:22:51 -05:00
DRC c0ca354eb4 Label this release 2.0 instead of 1.6
This also pulls the formatting changes from
19c791cdac into the TurboJPEG C API docs.
2018-03-22 16:05:58 -05:00
DRC 19c791cdac Improve code formatting consistency
With rare exceptions ...
- Always separate line continuation characters by one space from
  preceding code.
- Always use two-space indentation.  Never use tabs.
- Always use K&R-style conditional blocks.
- Always surround operators with spaces, except in raw assembly code.
- Always put a space after, but not before, a comma.
- Never put a space between type casts and variables/function calls.
- Never put a space between the function name and the argument list in
  function declarations and prototypes.
- Always surround braces ('{' and '}') with spaces.
- Always surround statements (if, for, else, catch, while, do, switch)
  with spaces.
- Always attach pointer symbols ('*' and '**') to the variable or
  function name.
- Always precede pointer symbols ('*' and '**') by a space in type
  casts.
- Use the MIN() macro from jpegint.h within the libjpeg and TurboJPEG
  API libraries (using min() from tjutil.h is still necessary for
  TJBench.)
- Where it makes sense (particularly in the TurboJPEG code), put a blank
  line after variable declaration blocks.
- Always separate statements in one-liners by two spaces.

The purpose of this was to ease maintenance on my part and also to make
it easier for contributors to figure out how to format patch
submissions.  This was admittedly confusing (even to me sometimes) when
we had 3 or 4 different style conventions in the same source tree.  The
new convention is more consistent with the formatting of other OSS code
bases.

This commit corrects deviations from the chosen formatting style in the
libjpeg API code and reformats the TurboJPEG API code such that it
conforms to the same standard.

NOTES:
- Although it is no longer necessary for the function name in function
  declarations to begin in Column 1 (this was historically necessary
  because of the ansi2knr utility, which allowed libjpeg to be built
  with non-ANSI compilers), we retain that formatting for the libjpeg
  code because it improves readability when using libjpeg's function
  attribute macros (GLOBAL(), etc.)
- This reformatting project was accomplished with the help of AStyle and
  Uncrustify, although neither was completely up to the task, and thus
  a great deal of manual tweaking was required.  Note to developers of
  code formatting utilities:  the libjpeg-turbo code base is an
  excellent test bed, because AFAICT, it breaks every single one of the
  utilities that are currently available.
- The legacy (MMX, SSE, 3DNow!) assembly code for i386 has been
  formatted to match the SSE2 code (refer to
  ff5685d5344273df321eb63a005eaae19d2496e3.)  I hadn't intended to
  bother with this, but the Loongson MMI implementation demonstrated
  that there is still academic value to the MMX implementation, as an
  algorithmic model for other 64-bit vector implementations.  Thus, it
  is desirable to improve its readability in the same manner as that of
  the SSE2 implementation.
2018-03-16 02:14:34 -05:00
DRC aa7459050d TurboJPEG C API: Add BMP/PPM load/save functions
The main justification for this is to provide new libjpeg-turbo users
with a quick & easy way of developing a complete JPEG
compression/decompression program without requiring them to build
libjpeg-turbo from source (which was necessary in order to use the
project-private bmp API) or to use external libraries.  These new
functions build upon significant enhancements to rdbmp.c, wrbmp.c,
rdppm.c, and wrppm.c which allow those engines to convert directly
between the native pixel format of the file and a pixel format
("colorspace" in libjpeg parlance) specified by the calling program.
rdbmp.c and wrbmp.c have also been modified such that the calling
program can choose to read or write image rows in the native (bottom-up)
order of the file format, thus eliminating the need to use an inversion
array.  tjLoadImage() and tjSaveImage() leverage these new underlying
features in order to significantly improve upon the performance of the
old bmp API.

Because these new functions cannot work without the libjpeg-turbo
colorspace extensions, the libjpeg-compatible code in turbojpeg.c has
been removed.  That code was only there to serve as an example of how
to use the TurboJPEG API on top of libjpeg, but more specific, buildable
examples now exist in the https://github.com/libjpeg-turbo/ijg
repository.
2017-11-17 19:32:52 -06:00
DRC d4092f6b4d TurboJPEG: Improve error handling
- Provide a new C API function and TJException method that allows
  calling programs to query the severity of a compression/decompression/
  transform error.
- Provide a new flag that instructs the library to immediately stop
  compressing/decompressing/transforming if a warning is encountered.

Fixes #151
2017-06-27 11:03:26 -05:00
DRC b9ab64d8db TurboJPEG: Thread-safe error message retrieval
Introduce a new C API function (tjGetErrorStr2()) that can be used to
retrieve compression/decompression/transform error messages in a
thread-safe (i.e. instance-specific) manner.  Retrieving error messages
from global functions is still thread-unsafe.

Addresses a concern expressed in #151.
2017-06-27 10:58:36 -05:00
DRC 0f4469c52f Oops. Include the tjPlane*() functions in the mapfile so that they are exposed in the shared library on ELF systems.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1429 632fc199-4ca6-4c93-a231-07263d6284db
2014-11-22 23:56:26 +00:00
DRC 40dd3146cd Refactored YUVImage Java class so that it supports both unified YUV image buffers as well as separate YUV image planes; modified the JNI functions accordingly and added new helper functions to the TurboJPEG C API (tjPlaneWidth(), tjPlaneHeight(), tjPlaneSizeYUV()) to facilitate those modifications; changed potentially confusing "component width" and "component height" terms to "plane width" and "plane height" and modified variable names in turbojpeg.c to reflect this; numerous other documentation tweaks
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1360 632fc199-4ca6-4c93-a231-07263d6284db
2014-08-17 12:23:49 +00:00
DRC aecea388c7 Extend the TurboJPEG C API to support handling YUV images stored in separate image planes instead of a unified buffer
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1343 632fc199-4ca6-4c93-a231-07263d6284db
2014-08-11 18:05:41 +00:00
DRC 1a45b81fa2 Remove trailing spaces (+ one additional tab in TJUnitTest.java that was missed in the previous commit)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1279 632fc199-4ca6-4c93-a231-07263d6284db
2014-05-09 18:06:58 +00:00
DRC fc26b6577a Extend the YUV decode functionality to the TurboJPEG Java API, and port the TJUnitTest modifications that treat YUV encoding/decoding as an intermediate step of the JPEG compression/decompression pipeline rather than a separate test case; Add the ability to encode YUV images from an arbitrary position in a large image buffer; Significantly refactor the handling of YUV images; numerous doc tweaks; other Java API cleanup and usability improvements
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1176 632fc199-4ca6-4c93-a231-07263d6284db
2014-03-16 22:56:26 +00:00
DRC 34dca05227 Implement a YUV decode function in the TurboJPEG API, to be symmetric with tjEncodeYUV().
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1132 632fc199-4ca6-4c93-a231-07263d6284db
2014-02-28 09:17:14 +00:00
DRC 1e67274bd7 Extend the TurboJPEG Java API to support compressing JPEG images from YUV planar images
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1071 632fc199-4ca6-4c93-a231-07263d6284db
2013-10-31 05:04:51 +00:00
DRC 910a35725c Extend the TurboJPEG C API to support compressing JPEG images from YUV planar images
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1067 632fc199-4ca6-4c93-a231-07263d6284db
2013-10-30 23:02:57 +00:00
DRC cd7c3e6672 Add CMYK support to the TurboJPEG C API
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1019 632fc199-4ca6-4c93-a231-07263d6284db
2013-08-23 02:49:25 +00:00
DRC fef9852da3 Extend the TurboJPEG Java API to support generating YUV images with arbitrary padding and to support image scaling when decompressing to YUV
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@975 632fc199-4ca6-4c93-a231-07263d6284db
2013-04-28 01:32:52 +00:00
DRC fc5c0c645a Not that it matters, because JNI uses dlopen()/dlsym() to load symbols, but for bookkeeping purposes, move the JNI symbols introduced in libjpeg-turbo 1.3 into a new section.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@965 632fc199-4ca6-4c93-a231-07263d6284db
2013-04-26 23:43:15 +00:00
DRC f610d61fcc Extend the TurboJPEG C API to support generating YUV images with arbitrary padding and to support image scaling when decompressing to YUV
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@962 632fc199-4ca6-4c93-a231-07263d6284db
2013-04-26 10:33:29 +00:00
DRC fac3bea8da Add a Java version of TJBench and extend the TurboJPEG Java API to support it (this involved adding a polymorphic method in TJCompressor that accepts x and y offsets into a larger buffer, similar to the previous modification that had been done to TJDecompressor.)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@862 632fc199-4ca6-4c93-a231-07263d6284db
2012-09-24 02:27:55 +00:00
DRC b2fc846e44 Add new JNI functions to mapfile so they will be visible on Linux
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@834 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-08 08:25:17 +00:00
DRC 9b49f0e4c7 Re-work TJBUFSIZE() to take into account the level of chrominance subsampling
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@668 632fc199-4ca6-4c93-a231-07263d6284db
2011-07-12 03:17:23 +00:00
DRC 6b76f75d2c Add new API functions, tjAlloc() and tjFree(), which allow memory to be allocated and freed using a method of the library's choosing. At the moment, the primary purpose for this is to avoid allocating/freeing memory across the DLL boundary on Windows.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@634 632fc199-4ca6-4c93-a231-07263d6284db
2011-05-24 16:52:47 +00:00
DRC cb6205a774 Add new API functions to JNI mapfile as well
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@628 632fc199-4ca6-4c93-a231-07263d6284db
2011-05-24 13:37:37 +00:00
DRC bb0e0b57dd Add TJTransformer JNI functions to mapfile
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@504 632fc199-4ca6-4c93-a231-07263d6284db
2011-03-04 13:39:46 +00:00
DRC 20ec358b3c Add getScalingFactors() method to libturbojpeg version script
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@478 632fc199-4ca6-4c93-a231-07263d6284db
2011-03-01 10:20:23 +00:00
DRC 109a578e89 tjGetScaledSize() would never be able to accommodate scaling factors > 1, so replace it with a function that returns a list of fractional scaling factors that TurboJPEG supports.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@477 632fc199-4ca6-4c93-a231-07263d6284db
2011-03-01 09:53:07 +00:00
DRC 890f1e0413 Expose libjpeg lossless transform feature in TurboJPEG/OSS
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@464 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-26 22:02:37 +00:00
DRC 98a7bdec4e Remove entry for tjScaledSize()
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@458 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-26 20:04:23 +00:00
DRC 89d11649a1 Include tjGetScaledSize() in version scripts
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@457 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-26 19:59:01 +00:00
DRC 4f1580cc0e Implement YUV encode/decode methods at the Java level; Remove some of the arguments from the Java API and replace with get/set methods; General API cleanup; Fix BufferedImage grayscale tests in TJUnitTest
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@451 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-25 06:11:03 +00:00
DRC 8424160345 Replace the TJ_YUV flag with two new API functions
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@448 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-25 02:08:23 +00:00
DRC 9fa95594c2 Use a proper version script for libturbojpeg
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@442 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-25 00:23:44 +00:00
DRC 84a1bcca6f Support for compressing from/decompressing to a BufferedImage in the Java wrapper
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@432 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-23 12:09:56 +00:00
DRC 36336fcddc Streamline Java wrapper
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@424 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-22 10:27:31 +00:00
DRC 4e8ae08b00 Add new functions to anonymous version script
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@423 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-22 06:44:50 +00:00
DRC b28fc5710a Make the scaling API a bit more friendly
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@422 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-22 06:41:29 +00:00
DRC e1303ef099 Expose TurboJPEG scaling features in Java wrapper
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@375 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-16 03:26:48 +00:00
DRC c5a419970e Restructure Java classes into their own package
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@358 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-08 06:54:36 +00:00
DRC 2413cb8673 Use Java capitalization conventions
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@357 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-08 02:11:37 +00:00
DRC f8e0055a6a Add JNI wrapper for TurboJPEG/OSS
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@337 632fc199-4ca6-4c93-a231-07263d6284db
2011-02-04 11:06:36 +00:00