Back to index

tetex-bin  3.0
Public Member Functions | Static Public Member Functions | Private Attributes
GfxPatternColorSpace Class Reference

#include <GfxState.h>

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

List of all members.

Public Member Functions

 GfxPatternColorSpace (GfxColorSpace *underA)
virtual ~GfxPatternColorSpace ()
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 ()
GfxColorSpacegetUnder ()
virtual void getDefaultRanges (double *decodeLow, double *decodeRange, int maxImgPixel)

Static Public Member Functions

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

Private Attributes

GfxColorSpaceunder

Detailed Description

Definition at line 438 of file GfxState.h.


Constructor & Destructor Documentation

Definition at line 1130 of file GfxState.cc.

                                                                {
  under = underA;
}

Here is the caller graph for this function:

Definition at line 1134 of file GfxState.cc.

                                            {
  if (under) {
    delete under;
  }
}

Member Function Documentation

Implements GfxColorSpace.

Definition at line 1140 of file GfxState.cc.

                                          {
  return new GfxPatternColorSpace(under ? under->copy() :
                                      (GfxColorSpace *)NULL);
}

Here is the call graph for this function:

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

Implements GfxColorSpace.

Definition at line 1176 of file GfxState.cc.

                                                                 {
  cmyk->c = cmyk->m = cmyk->y = 0;
  cmyk->k = 1;
}
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 GfxPatternColorSpace::getGray ( GfxColor color,
double *  gray 
) [virtual]

Implements GfxColorSpace.

Definition at line 1168 of file GfxState.cc.

                                                                {
  *gray = 0;
}
virtual GfxColorSpaceMode GfxPatternColorSpace::getMode ( ) [inline, virtual]

Implements GfxColorSpace.

Definition at line 444 of file GfxState.h.

{ return csPattern; }
virtual int GfxPatternColorSpace::getNComps ( ) [inline, virtual]

Implements GfxColorSpace.

Definition at line 453 of file GfxState.h.

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

Definition at line 120 of file GfxState.cc.

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

Implements GfxColorSpace.

Definition at line 1172 of file GfxState.cc.

                                                              {
  rgb->r = rgb->g = rgb->b = 0;
}

Definition at line 456 of file GfxState.h.

{ return under; }

Here is the caller 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:

Definition at line 1145 of file GfxState.cc.

                                                     {
  GfxPatternColorSpace *cs;
  GfxColorSpace *underA;
  Object obj1;

  if (arr->getLength() != 1 && arr->getLength() != 2) {
    error(-1, "Bad Pattern color space");
    return NULL;
  }
  underA = NULL;
  if (arr->getLength() == 2) {
    arr->get(1, &obj1);
    if (!(underA = GfxColorSpace::parse(&obj1))) {
      error(-1, "Bad Pattern color space (underlying color space)");
      obj1.free();
      return NULL;
    }
    obj1.free();
  }
  cs = new GfxPatternColorSpace(underA);
  return cs;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 460 of file GfxState.h.


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