bfxalu.cpp File Reference

(r1785/r1282)

#include "camtypes.h"
#include "bfxalu.h"
#include "GDrawIntf.h"
#include "gdrawcon.h"
#include "bitmpinf.h"
#include "oilbitmap.h"
#include "tracectl.h"
#include "bfxpixop.h"
#include "progress.h"

Go to the source code of this file.

Defines

#define ACCUSOFT_HAS_BROKEN_NON_FULL_PALETTES
#define new   CAM_DEBUG_NEW
#define ALUC_PART   0
#define ALUC_PARTMUL   1
#define ALUC_PARTREVMUL   2
#define ALUC_ADD   6
#define ALUC_SUB   7
#define FixMono(i, s)   { /* empty macro*/ }
#define BODGE_ACCUSOFT_RESIZE
#define LUTBYTE(x, y)   Data[x+(y<<8)]
 Initialises LUT as below.
#define MLATestPixel(q)
 Arithemtic operation to do the above.
#define __scanthresh(p)
#define __scanthresh8(p)   (pB[p]!=pT[p])
#define __scanthresh1(p)   (((pB[p>>3]^pT[p>>3]) & (0x80>>(p&7))) !=0)
#define QUANT_SHIFT   4
#define QUANT_SIZE   ((1<<(8-QUANT_SHIFT))+1)
#define QUANT_ROUND   (1<<(QUANT_SHIFT-1))
#define QMEMBER(x, y, z)   [((x)+QUANT_SIZE*((y)+QUANT_SIZE*(z)))]
#define QUANT_NUMBER   (QUANT_SIZE*QUANT_SIZE*QUANT_SIZE)

Functions

 DECLARE_SOURCE ("$Revision: 1282 $")
 CC_IMPLEMENT_DYNCREATE (BfxErrorRegionList, CCObject)
INT32 BfxALUQuantisationRoutine (const void *arg1, const void *arg2)
 A new bitmap is created as per function name.


Define Documentation

#define __scanthresh p   ) 
 

Value:

(( IntegerSquare( ((INT32)(pB[p].R)) - ((INT32)(pT[p].R))) \
                          + IntegerSquare( ((INT32)(pB[p].G)) - ((INT32)(pT[p].G))) \
                          + IntegerSquare( ((INT32)(pB[p].B)) - ((INT32)(pT[p].B)))) >= Value )

#define __scanthresh1 p   )     (((pB[p>>3]^pT[p>>3]) & (0x80>>(p&7))) !=0)
 

#define __scanthresh8 p   )     (pB[p]!=pT[p])
 

#define ACCUSOFT_HAS_BROKEN_NON_FULL_PALETTES
 

Definition at line 132 of file bfxalu.cpp.

#define ALUC_ADD   6
 

Definition at line 180 of file bfxalu.cpp.

#define ALUC_PART   0
 

Definition at line 177 of file bfxalu.cpp.

#define ALUC_PARTMUL   1
 

Definition at line 178 of file bfxalu.cpp.

#define ALUC_PARTREVMUL   2
 

Definition at line 179 of file bfxalu.cpp.

#define ALUC_SUB   7
 

Definition at line 181 of file bfxalu.cpp.

#define BODGE_ACCUSOFT_RESIZE
 

Definition at line 195 of file bfxalu.cpp.

#define FixMono i,
 )     { /* empty macro*/ }
 

Definition at line 185 of file bfxalu.cpp.

#define LUTBYTE x,
 )     Data[x+(y<<8)]
 

Initialises LUT as below.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/11/94
Parameters:
None [INPUTS]
Initialises LUT [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-
This call initialises the LUT so out = A*PropA + B*PropB + Offset Note everything in the above formula works 0..1 whereas the LUT works 0..255

Definition at line 216 of file bfxalu.cpp.

#define MLATestPixel  ) 
 

Value:

{ \
    OtherPixel = q; \
    while (pA[OtherPixel] < 0x80000000) OtherPixel = pA[OtherPixel]; /* get top of pixel chain */ \
    /* only count marked pixels (we can do this by eliminating clear pixels as we've processed all the pixels */ \
    /*  this routine considers). Don't count pixels which are attached to the same chain as us already */ \
    if ((pA[OtherPixel] != ClearValue) && (OtherPixel !=TopChain)) \
    { \
        /* OtherPixel points to the top of the other pixel's pixel chain */ \
        /* Always use lowest numbered chain */ \
        if (TopChain<OtherPixel) {SwapTemp=TopChain;TopChain=OtherPixel;OtherPixel=SwapTemp;} \
        pA[OtherPixel]+=pA[TopChain]-0x80000000; /* Add chain values together */ \
        pA[TopChain]= OtherPixel; /* attach top of current chain to pixel */ \
        TopChain=OtherPixel; /* Move the current chain top. */ \
    } \
}
Arithemtic operation to do the above.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/94
Parameters:
MarkValue = the value marked pixel have [INPUTS] ClearValue = the value cleared pixels have
A = RegionValue if pixel is in largest region, otherwise a different number [OUTPUTS] ClearValue if pixel is not marked otherwise a different value from the above two. pAError = the total error in A (or NULL not to fill in) pBError = the total error in B (or NULL not to fill in) TotalPixels = the total number of pixels (or NULL not to fill in) pSize = Size of image if not NULL pHighestChain = chain ID of highest chain if not NULL pWidth=Width if not NULL ppA=pointer to bitmap if not null
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: Error 2 & 3 from called routines Scope: Public

See also:
TraceControl::FindInitialPoint, BfxALU::MarkLargestArea, BfxALU::BuildErrorRegionList
The areas are chain coded.

Definition at line 1744 of file bfxalu.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 175 of file bfxalu.cpp.

#define QMEMBER x,
y,
 )     [((x)+QUANT_SIZE*((y)+QUANT_SIZE*(z)))]
 

Definition at line 4418 of file bfxalu.cpp.

#define QUANT_NUMBER   (QUANT_SIZE*QUANT_SIZE*QUANT_SIZE)
 

Definition at line 4423 of file bfxalu.cpp.

#define QUANT_ROUND   (1<<(QUANT_SHIFT-1))
 

Definition at line 4415 of file bfxalu.cpp.

#define QUANT_SHIFT   4
 

Definition at line 4413 of file bfxalu.cpp.

#define QUANT_SIZE   ((1<<(8-QUANT_SHIFT))+1)
 

Definition at line 4414 of file bfxalu.cpp.


Function Documentation

INT32 BfxALUQuantisationRoutine const void *  arg1,
const void *  arg2
 

A new bitmap is created as per function name.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/01/95
Parameters:
Thresh = Threshold for a sharp edge (0-255). No dither removal at 0, highest at 255 [INPUTS] QuantCols = number of quantisation colours to use (17-255 colour, 2-255 GS)
*ppOutput = a pointer to the output bitmap [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: Error 2 if init hasn't been called or GDraw fails Error 3 if windows and some other Oil layer are stangely mixed... Scope: Public

See also:
-
The bitmap becomes 32 bits so use this for tracing only!

Definition at line 4404 of file bfxalu.cpp.

04405 {
04406     QuantisationCell * qc1 = *((QuantisationCell * *)(arg1));
04407     QuantisationCell * qc2 = *((QuantisationCell * *)(arg2));
04408     return ( ((qc1->pixels)>(qc2->pixels))?-1:( ((qc1->pixels)<(qc2->pixels))?1:0 ) );
04409 }

CC_IMPLEMENT_DYNCREATE BfxErrorRegionList  ,
CCObject 
 

DECLARE_SOURCE "$Revision: 1282 $"   ) 
 


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