Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Typedefs | Functions
tif_luv.c File Reference
#include "tiffiop.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "uvcode.h"

Go to the source code of this file.

Macros

#define DecoderState(tif)   ((LogLuvState*) (tif)->tif_data)
 
#define EncoderState(tif)   ((LogLuvState*) (tif)->tif_data)
 
#define SGILOGDATAFMT_UNKNOWN   -1
 
#define MINRUN   4 /* minimum run length */
 
#define M_LN2   0.69314718055994530942
 
#define M_PI   3.14159265358979323846
 
#define log2(x)   ((1./M_LN2)*log(x))
 
#define exp2(x)   exp(M_LN2*(x))
 
#define itrunc(x, m)
 
#define NANGLES   100
 
#define uv2ang(u, v)
 
#define PACK(s, b, f)   (((b)<<6)|((s)<<3)|(f))
 
#define PACK(a, b)   (((a)<<3)|(b))
 

Typedefs

typedef struct logLuvState LogLuvState
 

Functions

double LogL16toY (int p16)
 
int LogL16fromY (double Y, int em)
 
void XYZtoRGB24 (float xyz[3], uint8 rgb[3])
 
double LogL10toY (int p10)
 
int LogL10fromY (double Y, int em)
 
int uv_encode (double u, double v, int em)
 
int uv_decode (double *up, double *vp, int c)
 
void LogLuv24toXYZ (uint32 p, float XYZ[3])
 
uint32 LogLuv24fromXYZ (float XYZ[3], int em)
 
void LogLuv32toXYZ (uint32 p, float XYZ[3])
 
uint32 LogLuv32fromXYZ (float XYZ[3], int em)
 
int TIFFInitSGILog (TIFF *tif, int scheme)
 

Macro Definition Documentation

◆ DecoderState

#define DecoderState (   tif)    ((LogLuvState*) (tif)->tif_data)

Definition at line 173 of file tif_luv.c.

◆ EncoderState

#define EncoderState (   tif)    ((LogLuvState*) (tif)->tif_data)

Definition at line 174 of file tif_luv.c.

◆ exp2

#define exp2 (   x)    exp(M_LN2*(x))

Definition at line 640 of file tif_luv.c.

◆ itrunc

#define itrunc (   x,
  m 
)
Value:
(int)(x) : \
(int)((x) + rand()*(1./RAND_MAX) - .5))
GLint GLint GLint GLint GLint x
const GLfloat * m
#define SGILOGENCODE_NODITHER
Definition: tiff.h:577

Definition at line 642 of file tif_luv.c.

Referenced by LogL10fromY(), LogL16fromY(), and LogLuv32fromXYZ().

◆ log2

#define log2 (   x)    ((1./M_LN2)*log(x))

Definition at line 639 of file tif_luv.c.

Referenced by LogL10fromY(), and LogL16fromY().

◆ M_LN2

#define M_LN2   0.69314718055994530942

Definition at line 634 of file tif_luv.c.

Referenced by LogL10toY(), and LogL16toY().

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 637 of file tif_luv.c.

◆ MINRUN

#define MINRUN   4 /* minimum run length */

Definition at line 178 of file tif_luv.c.

◆ NANGLES

#define NANGLES   100

Definition at line 753 of file tif_luv.c.

◆ PACK [1/2]

#define PACK (   s,
  b,
  f 
)    (((b)<<6)|((s)<<3)|(f))

◆ PACK [2/2]

#define PACK (   a,
  b 
)    (((a)<<3)|(b))

◆ SGILOGDATAFMT_UNKNOWN

#define SGILOGDATAFMT_UNKNOWN   -1

Definition at line 176 of file tif_luv.c.

Referenced by TIFFInitSGILog().

◆ uv2ang

#define uv2ang (   u,
  v 
)
Value:
( (NANGLES*.499999999/M_PI) \
* atan2((v)-V_NEU,(u)-U_NEU) + .5*NANGLES )
#define M_PI
Definition: tif_luv.c:637
#define V_NEU
Definition: tiffio.h:476
const GLdouble * v
#define U_NEU
Definition: tiffio.h:475
#define NANGLES
Definition: tif_luv.c:753

Definition at line 754 of file tif_luv.c.

Typedef Documentation

◆ LogLuvState

typedef struct logLuvState LogLuvState

Definition at line 158 of file tif_luv.c.

Function Documentation

◆ LogL10fromY()

int LogL10fromY ( double  Y,
int  em 
)

Definition at line 743 of file tif_luv.c.

References itrunc, and log2.

Referenced by LogLuv24fromXYZ().

◆ LogL10toY()

double LogL10toY ( int  p10)

Definition at line 732 of file tif_luv.c.

References vl::exp(), and M_LN2.

Referenced by LogLuv24toXYZ().

◆ LogL16fromY()

int LogL16fromY ( double  Y,
int  em 
)

Definition at line 665 of file tif_luv.c.

References itrunc, and log2.

Referenced by LogLuv32fromXYZ().

◆ LogL16toY()

double LogL16toY ( int  p16)

Definition at line 650 of file tif_luv.c.

References vl::exp(), and M_LN2.

Referenced by LogLuv32toXYZ().

◆ LogLuv24fromXYZ()

uint32 LogLuv24fromXYZ ( float  XYZ[3],
int  em 
)

Definition at line 896 of file tif_luv.c.

References LogL10fromY(), SGILOGENCODE_NODITHER, U_NEU, uv_encode(), and V_NEU.

◆ LogLuv24toXYZ()

void LogLuv24toXYZ ( uint32  p,
float  XYZ[3] 
)

Definition at line 868 of file tif_luv.c.

References LogL10toY(), U_NEU, uv_decode(), and V_NEU.

◆ LogLuv32fromXYZ()

uint32 LogLuv32fromXYZ ( float  XYZ[3],
int  em 
)

Definition at line 1034 of file tif_luv.c.

References int, itrunc, LogL16fromY(), U_NEU, UVSCALE, and V_NEU.

◆ LogLuv32toXYZ()

void LogLuv32toXYZ ( uint32  p,
float  XYZ[3] 
)

Definition at line 1009 of file tif_luv.c.

References LogL16toY(), and UVSCALE.

◆ TIFFInitSGILog()

int TIFFInitSGILog ( TIFF tif,
int  scheme 
)

◆ uv_decode()

int uv_decode ( double *  up,
double *  vp,
int  c 
)

Definition at line 836 of file tif_luv.c.

References UV_NDIVS, and UV_NVS.

Referenced by LogLuv24toXYZ().

◆ uv_encode()

int uv_encode ( double  u,
double  v,
int  em 
)

Definition at line 814 of file tif_luv.c.

References UV_VSTART.

Referenced by LogLuv24fromXYZ().

◆ XYZtoRGB24()

void XYZtoRGB24 ( float  xyz[3],
uint8  rgb[3] 
)

Definition at line 714 of file tif_luv.c.