colourix.cpp File Reference

(r1785/r1333)

#include "camtypes.h"
#include "colcontx.h"
#include "colourix.h"
#include "colormgr.h"

Go to the source code of this file.

Defines

#define new   CAM_DEBUG_NEW
#define OUTSIDE_LIMIT(a, b)   ((ABS((a) - (b))) > (ErrorLimit))
 To determine if two indexed colours share a common definition.
#define JASONSWAP(X, Y, VARTYPE)
 This swaps the definitions of the two IndexedColours.


Define Documentation

#define JASONSWAP X,
Y,
VARTYPE   ) 
 

Value:

{                                           \
        VARTYPE T;                              \
        memcpy(&(T), &(X), sizeof(VARTYPE));    \
        memcpy(&(X), &(Y), sizeof(VARTYPE));    \
        memcpy(&(Y), &(T), sizeof(VARTYPE));    \
    }
This swaps the definitions of the two IndexedColours.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/6/94
Parameters:
Other - The colour to swap with [INPUTS]
- [OUTPUTS]
Returns:
-
Notes: This is used to provide undo/redo via the OpColourChange defined in colormgr.cpp/.h, as when we undo a change to an IndexedColour, the definition must remain at the same memory address so that all references to it in the document do not need to be fixed.

The implementation swaps the Info, SourceColour, & Name fields (i.e. the colour definition) ONLY. That is, the usage count for each object and the caches are not swapped. The caches for both colours are in fact flushed, to guarantee their integrity.

Definition at line 1798 of file colourix.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 116 of file colourix.cpp.

#define OUTSIDE_LIMIT a,
 )     ((ABS((a) - (b))) > (ErrorLimit))
 

To determine if two indexed colours share a common definition.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/8/94
Parameters:
Other - the other indexed colour to which 'this' will be compared [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the two colours are considered different FALSE if they are considered the same
This is defined as: Same Colour model, and source colour definitions and both are linked to/tint of the same colour (or none), and the 'no colour' (and if linked: inheritance bits; if tint: tinting values) and colour type match within the limits specified by ErrorLimit.

This version of the function takes an accuracy parameter, to allow 'rough' comparisons to be made. This is used when importing colours so that we don't have to store 32bit colour values in EPS files and so on in order for them to be recognised as an existing colour when re-importing.

NOTE especially that this does NOT compare the names of the colours

Definition at line 802 of file colourix.cpp.


Generated on Sat Nov 10 03:49:06 2007 for Camelot by  doxygen 1.4.4