Back to index

tetex-bin  3.0
Public Member Functions | Static Public Member Functions
GfxDeviceCMYKColorSpace Class Reference

#include <GfxState.h>

Inheritance diagram for GfxDeviceCMYKColorSpace:
Inheritance graph
[legend]
Collaboration diagram for GfxDeviceCMYKColorSpace:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GfxDeviceCMYKColorSpace ()
virtual ~GfxDeviceCMYKColorSpace ()
virtual GfxColorSpacecopy ()
virtual GfxColorSpaceMode getMode ()
virtual void getGray (GfxColor *color, double *gray)
virtual void getRGB (GfxColor *color, GfxRGB *rgb)
virtual void getCMYK (GfxColor *color, GfxCMYK *cmyk)
virtual int getNComps ()
virtual void getDefaultRanges (double *decodeLow, double *decodeRange, int maxImgPixel)

Static Public Member Functions

static GfxColorSpaceparse (Object *csObj)
static int getNumColorSpaceModes ()
static char * getColorSpaceModeName (int idx)

Detailed Description

Definition at line 230 of file GfxState.h.


Constructor & Destructor Documentation

Definition at line 420 of file GfxState.cc.

                                                 {
}

Here is the caller graph for this function:

Definition at line 423 of file GfxState.cc.

                                                  {
}

Member Function Documentation

Implements GfxColorSpace.

Definition at line 426 of file GfxState.cc.

                                             {
  return new GfxDeviceCMYKColorSpace();
}

Here is the call graph for this function:

void GfxDeviceCMYKColorSpace::getCMYK ( GfxColor color,
GfxCMYK cmyk 
) [virtual]

Implements GfxColorSpace.

Definition at line 456 of file GfxState.cc.

                                                                    {
  cmyk->c = clip01(color->c[0]);
  cmyk->m = clip01(color->c[1]);
  cmyk->y = clip01(color->c[2]);
  cmyk->k = clip01(color->c[3]);
}

Here is the call graph for this function:

char * GfxColorSpace::getColorSpaceModeName ( int  idx) [static, inherited]

Definition at line 124 of file GfxState.cc.

                                                  {
  return gfxColorSpaceModeNames[idx];
}
void GfxColorSpace::getDefaultRanges ( double *  decodeLow,
double *  decodeRange,
int  maxImgPixel 
) [virtual, inherited]

Reimplemented in GfxIndexedColorSpace, GfxICCBasedColorSpace, and GfxLabColorSpace.

Definition at line 110 of file GfxState.cc.

                                                  {
  int i;

  for (i = 0; i < getNComps(); ++i) {
    decodeLow[i] = 0;
    decodeRange[i] = 1;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GfxDeviceCMYKColorSpace::getGray ( GfxColor color,
double *  gray 
) [virtual]

Implements GfxColorSpace.

Definition at line 430 of file GfxState.cc.

                                                                   {
  *gray = clip01(1 - color->c[3]
               - 0.299 * color->c[0]
               - 0.587 * color->c[1]
               - 0.114 * color->c[2]);
}

Here is the call graph for this function:

virtual GfxColorSpaceMode GfxDeviceCMYKColorSpace::getMode ( ) [inline, virtual]

Implements GfxColorSpace.

Definition at line 236 of file GfxState.h.

{ return csDeviceCMYK; }
virtual int GfxDeviceCMYKColorSpace::getNComps ( ) [inline, virtual]

Implements GfxColorSpace.

Definition at line 242 of file GfxState.h.

{ return 4; }
int GfxColorSpace::getNumColorSpaceModes ( ) [static, inherited]

Definition at line 120 of file GfxState.cc.

                                         {
  return nGfxColorSpaceModes;
}
void GfxDeviceCMYKColorSpace::getRGB ( GfxColor color,
GfxRGB rgb 
) [virtual]

Implements GfxColorSpace.

Definition at line 437 of file GfxState.cc.

                                                                 {
  double c, m, y, aw, ac, am, ay, ar, ag, ab;

  c = clip01(color->c[0] + color->c[3]);
  m = clip01(color->c[1] + color->c[3]);
  y = clip01(color->c[2] + color->c[3]);
  aw = (1-c) * (1-m) * (1-y);
  ac = c * (1-m) * (1-y);
  am = (1-c) * m * (1-y);
  ay = (1-c) * (1-m) * y;
  ar = (1-c) * m * y;
  ag = c * (1-m) * y;
  ab = c * m * (1-y);
  rgb->r = clip01(aw + 0.9137*am + 0.9961*ay + 0.9882*ar);
  rgb->g = clip01(aw + 0.6196*ac + ay + 0.5176*ag);
  rgb->b = clip01(aw + 0.7804*ac + 0.5412*am + 0.0667*ar + 0.2118*ag +
                0.4863*ab);
}

Here is the call graph for this function:

GfxColorSpace * GfxColorSpace::parse ( Object csObj) [static, inherited]

Definition at line 59 of file GfxState.cc.

                                                 {
  GfxColorSpace *cs;
  Object obj1;

  cs = NULL;
  if (csObj->isName()) {
    if (csObj->isName("DeviceGray") || csObj->isName("G")) {
      cs = new GfxDeviceGrayColorSpace();
    } else if (csObj->isName("DeviceRGB") || csObj->isName("RGB")) {
      cs = new GfxDeviceRGBColorSpace();
    } else if (csObj->isName("DeviceCMYK") || csObj->isName("CMYK")) {
      cs = new GfxDeviceCMYKColorSpace();
    } else if (csObj->isName("Pattern")) {
      cs = new GfxPatternColorSpace(NULL);
    } else {
      error(-1, "Bad color space '%s'", csObj->getName());
    }
  } else if (csObj->isArray()) {
    csObj->arrayGet(0, &obj1);
    if (obj1.isName("DeviceGray") || obj1.isName("G")) {
      cs = new GfxDeviceGrayColorSpace();
    } else if (obj1.isName("DeviceRGB") || obj1.isName("RGB")) {
      cs = new GfxDeviceRGBColorSpace();
    } else if (obj1.isName("DeviceCMYK") || obj1.isName("CMYK")) {
      cs = new GfxDeviceCMYKColorSpace();
    } else if (obj1.isName("CalGray")) {
      cs = GfxCalGrayColorSpace::parse(csObj->getArray());
    } else if (obj1.isName("CalRGB")) {
      cs = GfxCalRGBColorSpace::parse(csObj->getArray());
    } else if (obj1.isName("Lab")) {
      cs = GfxLabColorSpace::parse(csObj->getArray());
    } else if (obj1.isName("ICCBased")) {
      cs = GfxICCBasedColorSpace::parse(csObj->getArray());
    } else if (obj1.isName("Indexed") || obj1.isName("I")) {
      cs = GfxIndexedColorSpace::parse(csObj->getArray());
    } else if (obj1.isName("Separation")) {
      cs = GfxSeparationColorSpace::parse(csObj->getArray());
    } else if (obj1.isName("DeviceN")) {
      cs = GfxDeviceNColorSpace::parse(csObj->getArray());
    } else if (obj1.isName("Pattern")) {
      cs = GfxPatternColorSpace::parse(csObj->getArray());
    } else {
      error(-1, "Bad color space");
    }
    obj1.free();
  } else {
    error(-1, "Bad color space - expected name or array");
  }
  return cs;
}

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: