< prev index next >

src/java.desktop/windows/native/libawt/windows/img_util_md.h

Print this page


   1 /*
   2  * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include "windows.h"
  27 
  28 #ifdef __cplusplus
  29 extern "C" {
  30 #include "colordata.h"
  31 }
  32 #else
  33 #include "colordata.h"
  34 #endif

  35 
  36 #ifdef __cplusplus
  37 extern "C" {
  38 #endif
  39 
  40 
  41 typedef unsigned char MaskBits;
  42 
  43 extern uns_ordered_dither_array img_oda_alpha;
  44 
  45 #define BufComplete(cvdata, dstX1, dstY1, dstX2, dstY2)         \
  46     (((AwtImage *)cvdata)->BufDone(dstX1, dstY1, dstX2, dstY2))
  47 
  48 #define SendRow(cvdata, dstY, dstX1, dstX2)
  49 
  50 #define ImgInitMask(cvdata, x1, y1, x2, y2)                     \
  51     (((AwtImage *) cvdata)->GetMaskBuf(TRUE, x1, y1, x2, y2))
  52 
  53 #define ScanBytes(cvdata)       (((AwtImage *) cvdata)->GetBufScan())
  54 


  77 #ifdef DEBUG
  78 #undef img_check
  79 #define img_check(condition)                                    \
  80     do {                                                        \
  81         if (!(condition)) {                                     \
  82             SignalError(0, JAVAPKG "InternalError",             \
  83                         "assertion failed:  " #condition);      \
  84             return SCALEFAILURE;                                \
  85         }                                                       \
  86     } while (0)
  87 #else /* DEBUG */
  88 #define img_check(condition)    do {} while (0)
  89 #endif /* DEBUG */
  90 
  91 void color_init();
  92 extern const char *cubemapArray;
  93 #define CUBEMAP(r,g,b) \
  94     ((dstLockInfo.inv_cmap)[(((r)>>3)<<10) | (((g)>>3)<<5) | ((b)>>3)])
  95 
  96 extern void freeICMColorData(ColorData *pData);
  97 extern void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);



  98 extern unsigned char* initCubemap(int* cmap, int cmap_len, int cube_dim);
  99 extern void initDitherTables(ColorData* cData);
 100 
 101 #define SET_CUBEMAPARRAY \
 102     if (lockInfo->lockedLut) { \
 103         lockInfo->inv_cmap = (const char *)cubemapArray; \
 104     } else { \
 105         lockInfo->inv_cmap = (const char*)lockInfo->colorData->img_clr_tbl; \
 106     }
 107 
 108 
 109 #ifdef __cplusplus
 110 }; /* end of extern "C" */
 111 #endif
   1 /*
   2  * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include "windows.h"
  27 
  28 #ifdef __cplusplus
  29 extern "C" {
  30 #include "colordata.h"
  31 }
  32 #else
  33 #include "colordata.h"
  34 #endif
  35 #include "jni.h"
  36 
  37 #ifdef __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 
  42 typedef unsigned char MaskBits;
  43 
  44 extern uns_ordered_dither_array img_oda_alpha;
  45 
  46 #define BufComplete(cvdata, dstX1, dstY1, dstX2, dstY2)         \
  47     (((AwtImage *)cvdata)->BufDone(dstX1, dstY1, dstX2, dstY2))
  48 
  49 #define SendRow(cvdata, dstY, dstX1, dstX2)
  50 
  51 #define ImgInitMask(cvdata, x1, y1, x2, y2)                     \
  52     (((AwtImage *) cvdata)->GetMaskBuf(TRUE, x1, y1, x2, y2))
  53 
  54 #define ScanBytes(cvdata)       (((AwtImage *) cvdata)->GetBufScan())
  55 


  78 #ifdef DEBUG
  79 #undef img_check
  80 #define img_check(condition)                                    \
  81     do {                                                        \
  82         if (!(condition)) {                                     \
  83             SignalError(0, JAVAPKG "InternalError",             \
  84                         "assertion failed:  " #condition);      \
  85             return SCALEFAILURE;                                \
  86         }                                                       \
  87     } while (0)
  88 #else /* DEBUG */
  89 #define img_check(condition)    do {} while (0)
  90 #endif /* DEBUG */
  91 
  92 void color_init();
  93 extern const char *cubemapArray;
  94 #define CUBEMAP(r,g,b) \
  95     ((dstLockInfo.inv_cmap)[(((r)>>3)<<10) | (((g)>>3)<<5) | ((b)>>3)])
  96 
  97 extern void freeICMColorData(ColorData *pData);
  98 
  99 JNIEXPORT void JNICALL
 100 initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
 101 
 102 extern unsigned char* initCubemap(int* cmap, int cmap_len, int cube_dim);
 103 extern void initDitherTables(ColorData* cData);
 104 
 105 #define SET_CUBEMAPARRAY \
 106     if (lockInfo->lockedLut) { \
 107         lockInfo->inv_cmap = (const char *)cubemapArray; \
 108     } else { \
 109         lockInfo->inv_cmap = (const char*)lockInfo->colorData->img_clr_tbl; \
 110     }
 111 
 112 
 113 #ifdef __cplusplus
 114 }; /* end of extern "C" */
 115 #endif
< prev index next >