~ubuntu-branches/debian/squeeze/gmsh/squeeze

« back to all changes in this revision

Viewing changes to Post/ColorTable.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme
  • Date: 2009-07-13 15:49:21 UTC
  • mfrom: (7.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090713154921-zer07j8wixwa07ig
Tags: 2.3.1.dfsg-4
[Christophe Prud'homme]
* Bug fix: "gmsh with cgns write support", thanks to Oliver Borm
  (Closes: #529972).
* debian/rules: make sure that Gmsh is built with occ support on all
  platforms thanks to Denis Barbier (#536435).

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include "Context.h"
19
19
#include "Numeric.h"
20
20
 
21
 
extern Context_T CTX;
22
 
 
23
21
void ColorTable_InitParam(int number, GmshColorTable *ct)
24
22
{
25
23
  ct->size = 255;
336
334
    b = b < 0 ? 0 : (b > 255 ? 255 : b);
337
335
    a = a < 0 ? 0 : (a > 255 ? 255 : a);
338
336
    
339
 
    ct->table[i] = CTX.PACK_COLOR(r, g, b, a);
 
337
    ct->table[i] = CTX::instance()->packColor(r, g, b, a);
340
338
  }
341
339
 
342
340
}
374
372
 
375
373
  strcpy(tmp1, "");
376
374
  for(i = 0; i < ct->size; i++) {
377
 
    r = CTX.UNPACK_RED(ct->table[i]);
378
 
    g = CTX.UNPACK_GREEN(ct->table[i]);
379
 
    b = CTX.UNPACK_BLUE(ct->table[i]);
380
 
    a = CTX.UNPACK_ALPHA(ct->table[i]);
 
375
    r = CTX::instance()->unpackRed(ct->table[i]);
 
376
    g = CTX::instance()->unpackGreen(ct->table[i]);
 
377
    b = CTX::instance()->unpackBlue(ct->table[i]);
 
378
    a = CTX::instance()->unpackAlpha(ct->table[i]);
381
379
    if(i && !(i % 4)) {
382
380
      if(fp)
383
381
        fprintf(fp, "%s\n", tmp1);
400
398
{
401
399
  int i, a;
402
400
  for(i = 0; i < ct->size; i++) {
403
 
    a = CTX.UNPACK_ALPHA(ct->table[i]);
 
401
    a = CTX::instance()->unpackAlpha(ct->table[i]);
404
402
    if(a < 255)
405
403
      return 1;
406
404
  }