The convention used by libjpeg:
type * variable;
is not very common anymore, because it looks too much like
multiplication. Some (particularly C++ programmers) prefer to tuck the
pointer symbol against the type:
type* variable;
to emphasize that a pointer to a type is effectively a new type.
However, this can also be confusing, since defining multiple variables
on the same line would not work properly:
type* variable1, variable2; /* Only variable1 is actually a
pointer. */
This commit reformats the entirety of the libjpeg-turbo code base so
that it uses the same code formatting convention for pointers that the
TurboJPEG API code uses:
type *variable1, *variable2;
This seems to be the most common convention among C programmers, and
it is the convention used by other codec libraries, such as libpng and
libtiff.
51 lines
1.7 KiB
C
51 lines
1.7 KiB
C
/*
|
|
* jdsample.h
|
|
*
|
|
* This file was part of the Independent JPEG Group's software:
|
|
* Copyright (C) 1991-1996, Thomas G. Lane.
|
|
* For conditions of distribution and use, see the accompanying README.ijg
|
|
* file.
|
|
*/
|
|
|
|
#define JPEG_INTERNALS
|
|
#include "jpeglib.h"
|
|
|
|
|
|
/* Pointer to routine to upsample a single component */
|
|
typedef void (*upsample1_ptr) (j_decompress_ptr cinfo,
|
|
jpeg_component_info *compptr,
|
|
JSAMPARRAY input_data,
|
|
JSAMPARRAY *output_data_ptr);
|
|
|
|
/* Private subobject */
|
|
|
|
typedef struct {
|
|
struct jpeg_upsampler pub; /* public fields */
|
|
|
|
/* Color conversion buffer. When using separate upsampling and color
|
|
* conversion steps, this buffer holds one upsampled row group until it
|
|
* has been color converted and output.
|
|
* Note: we do not allocate any storage for component(s) which are full-size,
|
|
* ie do not need rescaling. The corresponding entry of color_buf[] is
|
|
* simply set to point to the input data array, thereby avoiding copying.
|
|
*/
|
|
JSAMPARRAY color_buf[MAX_COMPONENTS];
|
|
|
|
/* Per-component upsampling method pointers */
|
|
upsample1_ptr methods[MAX_COMPONENTS];
|
|
|
|
int next_row_out; /* counts rows emitted from color_buf */
|
|
JDIMENSION rows_to_go; /* counts rows remaining in image */
|
|
|
|
/* Height of an input row group for each component. */
|
|
int rowgroup_height[MAX_COMPONENTS];
|
|
|
|
/* These arrays save pixel expansion factors so that int_expand need not
|
|
* recompute them each time. They are unused for other upsampling methods.
|
|
*/
|
|
UINT8 h_expand[MAX_COMPONENTS];
|
|
UINT8 v_expand[MAX_COMPONENTS];
|
|
} my_upsampler;
|
|
|
|
typedef my_upsampler *my_upsample_ptr;
|