/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* This file contains macro definitions for the Decoding category of
* the macros used by the generic scaleloop function.
*
* This implementation can decode the pixel information associated
* with any Java DirectColorModel object. This implemenation will
* scale the decoded color components to 8-bit quantities if needed.
* Another file is provided to optimize DCM parsing when the masks
* are guaranteed to be at least 8-bits wide. This implementation
* examines some of the private fields of the DirectColorModel
* object and decodes the red, green, blue, and possibly alpha values
* directly rather than calling the getRGB method on the Java object.
*/
/*
* These definitions vector the standard macro names to the "DCM"
* versions of those macros only if the "DecodeDeclared" keyword has
* not yet been defined elsewhere. The "DecodeDeclared" keyword is
* also defined here to claim ownership of the primary implementation
* even though this file does not rely on the definitions in any other
* files.
*/
#ifndef DecodeDeclared
#define DecodeDeclared
#endif
#include "java_awt_image_DirectColorModel.h"
#define DeclareDCMVars \
IfAlpha(int alpha_mask; \
int alpha_scale; \
unsigned int alpha_off;) \
int scale;
do { \
IfAlpha(| alpha_scale)); \
} while (0)
do { \
? 255 \
if (scale) { \
if (red_scale) { \
} \
if (green_scale) { \
} \
if (blue_scale) { \
} \
IfAlpha(if (alpha_scale) { \
}) \
} \
} while (0)