chromium/third_party/qcms/src/qcmsint.h

/* vim: set ts=8 sw=8 noexpandtab: */
//  qcms
//  Copyright (C) 2009 Mozilla Foundation
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the Software
// is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "qcms.h"
#include "qcmstypes.h"

/* used as a lookup table for the output transformation.
 * we refcount them so we only need to have one around per output
 * profile, instead of duplicating them per transform */
struct precache_output
{};

#ifdef _MSC_VER
#define ALIGN
#else
#define ALIGN
#endif

qcms_format_type;

struct _qcms_transform {};

struct matrix {};

struct qcms_modular_transform;

transform_module_fn_t;

struct qcms_modular_transform {};

s15Fixed16Number;
uInt16Number;
uInt8Number;

struct XYZNumber {};

struct curveType {};

struct lutmABType {};

/* should lut8Type and lut16Type be different types? */
struct lutType {};

struct vcgtType {};

#if 0
/* this is from an intial idea of having the struct correspond to the data in
 * the file. I decided that it wasn't a good idea.
 */
struct tag_value {
	uint32_t type;
	union {
		struct {
			uint32_t reserved;
			struct {
				s15Fixed16Number X;
				s15Fixed16Number Y;
				s15Fixed16Number Z;
			} XYZNumber;
		} XYZType;
	};
}; // I guess we need to pack this?
#endif

#define RGB_SIGNATURE
#define GRAY_SIGNATURE
#define XYZ_SIGNATURE
#define LAB_SIGNATURE

struct _qcms_profile {};

#ifdef _MSC_VER
#define inline _inline
#endif

/* produces the nearest float to 'a' with a maximum error
 * of 1/1024 which happens for large values like 0x40000040 */
static inline float s15Fixed16Number_to_float(s15Fixed16Number a)
{}

static inline s15Fixed16Number double_to_s15Fixed16Number(double v)
{}

static inline float uInt8Number_to_float(uInt8Number a)
{}

static inline float uInt16Number_to_float(uInt16Number a)
{}


void precache_release(struct precache_output *p);
qcms_bool set_rgb_colorants(qcms_profile *profile, qcms_CIE_xyY white_point, qcms_CIE_xyYTRIPLE primaries);

void qcms_transform_data_rgb_out_lut_sse2(qcms_transform *transform,
                                          unsigned char *src,
                                          unsigned char *dest,
                                          size_t length,
                                          qcms_format_type output_format);
void qcms_transform_data_rgba_out_lut_sse2(qcms_transform *transform,
                                          unsigned char *src,
                                          unsigned char *dest,
                                          size_t length,
                                          qcms_format_type output_format);
void qcms_transform_data_tetra_clut_rgba_sse2(qcms_transform* transform,
                                              unsigned char* src,
                                              unsigned char* dest,
                                              size_t length,
                                              qcms_format_type output_format);

void qcms_transform_build_clut_cache(qcms_transform* transform);

extern qcms_bool qcms_supports_iccv4;


#ifdef _MSC_VER

long __cdecl _InterlockedIncrement(long volatile *);
long __cdecl _InterlockedDecrement(long volatile *);
#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement)

#define qcms_atomic_increment
#define qcms_atomic_decrement

#else

#define qcms_atomic_increment(x)
#define qcms_atomic_decrement(x)

#endif