/*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "sun_java2d_cmm_lcms_LCMS.h"
#include "jni_util.h"
#include "Trace.h"
#include "Disposer.h"
#include "lcms2.h"
#ifdef USE_BIG_ENDIAN
#define AdjustEndianess32(a)
#else
static
{
}
#endif
// Transports to properly encoded values - note that icc profiles does use
// big endian notation.
static
{
return Temp;
}
#define SigMake(a,b,c,d) \
( ( ((int) ((unsigned char) (a))) << 24) | \
( ((int) ((unsigned char) (b))) << 16) | \
( ((int) ((unsigned char) (c))) << 8) | \
(int) ((unsigned char) (d)))
#define TagIdConst(a, b, c, d) \
((int) SigMake ((a), (b), (c), (d)))
#define DT_BYTE 0
/* Default temp profile list size */
#ifdef _MSC_VER
# ifndef snprintf
# endif
#endif
jlong j;
typedef union {
jint j;
const char *errorText) {
}
}
return JNI_VERSION_1_6;
}
{
/* Passed ID is always valid native ref so there is no check for zero */
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: createNativeTransform
* Signature: ([JI)J
*/
{
int i, j, size;
return 0L;
}
}
j = 0;
for (i = 0; i < size; i++) {
/* Middle non-abstract profiles should be doubled before passing to
* the cmsCreateMultiprofileTransform function
*/
{
}
}
"sTrans.xf == NULL");
"Cannot get color transform");
} else {
}
}
return sTrans.j;
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: loadProfile
* Signature: ([B)J
*/
{
return 0L;
}
return 0L;
}
}
return sProf.j;
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: freeProfile
* Signature: (J)V
*/
{
"== 0", id);
"Cannot close profile");
}
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: getProfileSize
* Signature: (J)I
*/
{
} else {
"Can not access specified profile.");
return -1;
}
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: getProfileData
* Signature: (J[B)V
*/
{
// determine actual profile size
"Can not access specified profile.");
return;
}
// verify java buffer capacity
"Insufficient buffer capacity.");
return;
}
if (!status) {
"Can not access specified profile.");
return;
}
}
/* Get profile header info */
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: getTagSize
* Signature: (JI)I
*/
{
result = sizeof(cmsICCHeader);
} else {
} else {
"ICC profile tag not found");
}
}
return result;
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: getTagData
* Signature: (JI[B)V
*/
{
if (bufSize < sizeof(cmsICCHeader)) {
"Insufficient buffer capacity");
return;
}
"Unable to get buffer");
return;
}
if (!status) {
"ICC Profile header not found");
}
return;
}
} else {
"ICC profile tag not found");
return;
}
// verify data buffer capacity
"Insufficient buffer capacity.");
return;
}
"Unable to get buffer");
return;
}
"Can not get tag data.");
}
return;
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: setTagData
* Signature: (JI[B)V
*/
{
int tagSize;
return;
}
return;
}
} else {
}
if (!status) {
}
}
jobject* pDataObject) {
switch (*pDataType) {
case DT_BYTE:
break;
case DT_SHORT:
break;
case DT_INT:
break;
case DT_DOUBLE:
break;
}
return result;
}
switch (dataType) {
case DT_BYTE:
break;
case DT_SHORT:
break;
case DT_INT:
break;
case DT_DOUBLE:
0);
break;
}
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: colorConvert
* Signature: (Lsun/java2d/cmm/lcms/LCMSTransform;Lsun/java2d/cmm/lcms/LCMSImageLayout;Lsun/java2d/cmm/lcms/LCMSImageLayout;)V
*/
{
void* inputBuffer;
void* outputBuffer;
char* inputRow;
char* outputRow;
#ifdef _LITTLE_ENDIAN
/* Reversing data packed into int for LE archs */
}
}
#endif
"Cannot get color transform");
return;
}
if (inputBuffer == NULL) {
"Cannot get input data");
return;
}
if (outputBuffer == NULL) {
"Cannot get output data");
return;
}
for (i = 0; i < height; i++) {
}
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: getProfileID
* Signature: (Ljava/awt/color/ICC_Profile;)J
*/
{
}
/*
* Class: sun_java2d_cmm_lcms_LCMS
* Method: initLCMS
*/
{
/* TODO: move initialization of the IDs to the static blocks of
* corresponding classes to avoid problems with invalidating ids by class
* unloading
*/
}
{
pfSize < sizeof(cmsICCHeader) ||
bufferSize < sizeof(cmsICCHeader))
{
return FALSE;
}
return FALSE;
}
// load raw profile data into the buffer
}
return status;
}
{
return FALSE;
}
// now set header fields, which we can access using the lcms2 public API
return TRUE;
}
{
if (NULL != p) {
/* Populate the placeholder's header according to target profile */
/* load raw profile data into the buffer */
}
}
}
}
cmsCloseProfile(p);
}
return FALSE;
}
/* re-open the placeholder profile */
if (p != NULL) {
/* Note that pCookedTag points to internal structures of the placeholder,
* so this data is valid only while the placeholder is open.
*/
if (pCookedTag != NULL) {
}
pCookedTag = NULL;
cmsCloseProfile(p);
}
return status;
}