TurboJPEG: Numerous documentation improvements

- Wordsmithing, formatting, and grammar tweaks

- Various clarifications and corrections, including specifying whether
  a particular buffer or image is used as a source or destination

- Accommodate/mention features that were introduced since the API
  documentation was created.

- For clarity, use "packed-pixel" to describe uncompressed
  source/destination images that are not planar YUV.

- Use "row" rather than "line" to refer to a single horizontal group of
  pixels or component values, for consistency with the libjpeg API
  documentation.  (libjpeg also uses "scanline", which is a more archaic
  term.)

- Use "alignment" rather than "padding" to refer to the number of bytes
  by which a row's width is evenly divisible.  This consistifies the
  documention of the YUV functions and tjLoadImage().  ("Padding"
  typically refers to the number of bytes added to each row, which is
  not the same thing.)

- Remove all references to "the underlying codec."  Although the
  TurboJPEG API originated as a cross-platform wrapper for the Intel
  Integrated Performance Primitives, Sun mediaLib, QuickTime, and
  libjpeg, none of those TurboJPEG implementations has been maintained
  since 2009.  Nothing would prevent someone from implementing the
  TurboJPEG API without libjpeg-turbo, but such an implementation would
  not necessarily have an "underlying codec."  (It could be fully
  self-contained.)

- Use "destination image" rather than "output image", for consistency,
  or describe the type of image that will be output.

- Avoid the term "image buffer" and instead use "byte buffer" to
  refer to buffers that will hold JPEG images, or describe the type of
  image that will be contained in the buffer.  (The Java documentation
  doesn't use "byte buffer", because the buffer arrays literally have
  "byte" in front of them, and since Java doesn't have pointers, it is
  not possible for mere mortals to store any other type of data in those
  arrays.)

- C: Use "unified" to describe YUV images stored in a single buffer, for
  consistency with the Java documentation.

- Use "planar YUV" rather than "YUV planar".  Is is our convention to
  describe images using {component layout} {colorspace/pixel format}
  {image function}, e.g. "packed-pixel RGB source image" or "planar YUV
  destination image."

- C: Document the TurboJPEG API version in which a particular function
  or macro was introduced, and reorder the backward compatibility
  function stubs in turbojpeg.h alphabetically by API version.

- C: Use Markdown rather than HTML tags, where possible, in the Doxygen
  comments.
This commit is contained in:
DRC
2023-01-06 10:29:10 -06:00
parent b03ee8b835
commit 9a146f0f23
31 changed files with 1845 additions and 1716 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011, 2013, 2018 D. R. Commander. All Rights Reserved.
* Copyright (C)2011, 2013, 2018, 2023 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -97,7 +97,7 @@ public class TJTransform extends Rectangle {
* the level of chrominance subsampling used. If the image's width or height
* is not evenly divisible by the MCU block size (see {@link TJ#getMCUWidth}
* and {@link TJ#getMCUHeight}), then there will be partial MCU blocks on the
* right and/or bottom edges. It is not possible to move these partial MCU
* right and/or bottom edges. It is not possible to move these partial MCU
* blocks to the top or left of the image, so any transform that would
* require that is "imperfect." If this option is not specified, then any
* partial MCU blocks that cannot be transformed will be left in place, which
@@ -114,8 +114,8 @@ public class TJTransform extends Rectangle {
*/
public static final int OPT_CROP = 4;
/**
* This option will discard the color data in the input image and produce
* a grayscale output image.
* This option will discard the color data in the source image and produce a
* grayscale destination image.
*/
public static final int OPT_GRAY = 8;
/**
@@ -127,7 +127,7 @@ public class TJTransform extends Rectangle {
*/
public static final int OPT_NOOUTPUT = 16;
/**
* This option will enable progressive entropy coding in the output image
* This option will enable progressive entropy coding in the JPEG image
* generated by this particular transform. Progressive entropy coding will
* generally improve compression relative to baseline entropy coding (the
* default), but it will reduce compression and decompression performance
@@ -137,7 +137,7 @@ public class TJTransform extends Rectangle {
/**
* This option will prevent {@link TJTransformer#transform
* TJTransformer.transform()} from copying any extra markers (including EXIF
* and ICC profile data) from the source image to the output image.
* and ICC profile data) from the source image to the destination image.
*/
public static final int OPT_COPYNONE = 64;
@@ -165,10 +165,10 @@ public class TJTransform extends Rectangle {
* equivalent of setting it to (height of the source JPEG image -
* <code>y</code>).
*
* @param op one of the transform operations (<code>OP_*</code>)
* @param op one of the transform operations ({@link #OP_NONE OP_*})
*
* @param options the bitwise OR of one or more of the transform options
* (<code>OPT_*</code>)
* ({@link #OPT_PERFECT OPT_*})
*
* @param cf an instance of an object that implements the {@link
* TJCustomFilter} interface, or null if no custom filter is needed
@@ -190,10 +190,10 @@ public class TJTransform extends Rectangle {
* #TJTransform(int, int, int, int, int, int, TJCustomFilter)} for more
* detail.
*
* @param op one of the transform operations (<code>OP_*</code>)
* @param op one of the transform operations ({@link #OP_NONE OP_*})
*
* @param options the bitwise OR of one or more of the transform options
* (<code>OPT_*</code>)
* ({@link #OPT_PERFECT OPT_*})
*
* @param cf an instance of an object that implements the {@link
* TJCustomFilter} interface, or null if no custom filter is needed
@@ -208,13 +208,14 @@ public class TJTransform extends Rectangle {
}
/**
* Transform operation (one of <code>OP_*</code>)
* Transform operation (one of {@link #OP_NONE OP_*})
*/
@SuppressWarnings("checkstyle:VisibilityModifier")
public int op = 0;
/**
* Transform options (bitwise OR of one or more of <code>OPT_*</code>)
* Transform options (bitwise OR of one or more of
* {@link #OPT_PERFECT OPT_*})
*/
@SuppressWarnings("checkstyle:VisibilityModifier")
public int options = 0;