#include <cdrfiltr.h>
Inheritance diagram for CDRTransformConvertor5:
Public Member Functions | |
BOOL | Init (ADDR Data, INT32 Size) |
intialises this convertor | |
UINT32 | GetNTransforms () |
CDRTransformType | GetTransformType (UINT32 n) |
gets a transform type from an trfd chunk | |
BOOL | GetMatrix (cdrMatrix *M, UINT32 n) |
converts a matrix from position N | |
BOOL | GetPerspective (cdrPerspective *P, UINT32 n) |
converts a perspective from position N | |
BOOL | GetEnvelope (Path **P, DocRect *OriginalBBox, INT32 *Corners, UINT32 n) |
converts a envelope from position N | |
BOOL | GetExtrude (cdrExtrudeInfo *Info, UINT32 n) |
converts a matrix from position N | |
Private Member Functions | |
CC_DECLARE_MEMDUMP (CDRTransformConvertor5) | |
Private Attributes | |
cdrfTransform * | Trans |
ADDR | List |
INT32 | ListSize |
Definition at line 1012 of file cdrfiltr.h.
|
|
|
converts a envelope from position N
Implements CDRTransformConvertor. Definition at line 4446 of file cdrfiltr.cpp. 04447 { 04448 if(n >= CDRDATA_WORD(Trans->NTransforms)) 04449 return FALSE; 04450 04451 cdrfTransformHeader *Hdr; 04452 04453 // run through to this entry counting the number of entries before this one 04454 INT32 EnvelopesSoFar = 0; 04455 for(UINT32 l = 0; l <= n; l++) 04456 { 04457 Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[l])); 04458 04459 // increment the number of envelopes so far... 04460 if(CDRDATA_WORD(Hdr->Type) == cdrfTRANSFORMTYPE_ENVELOPE) 04461 EnvelopesSoFar++; 04462 } 04463 04464 ERROR2IF(EnvelopesSoFar <= 0, FALSE, "No envelopes found!"); 04465 04466 // OK, convert this entry... 04467 if(!ConvertEnvelopeBBox((ADDR)Hdr, OriginalBBox, Corners)) 04468 return FALSE; 04469 04470 if(!ConvertEnvelopePath(List, ListSize, EnvelopesSoFar - 1, P)) 04471 return FALSE; 04472 04473 return TRUE; 04474 }
|
|
converts a matrix from position N
Implements CDRTransformConvertor. Definition at line 4239 of file cdrfiltr.cpp. 04240 { 04241 if(n >= CDRDATA_WORD(Trans->NTransforms)) 04242 return FALSE; 04243 04244 cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n])); 04245 04246 return ConvertExtrudeInfo((cdrfTransformExtrude *)Hdr, Info); 04247 }
|
|
converts a matrix from position N
Implements CDRTransformConvertor. Definition at line 3894 of file cdrfiltr.cpp. 03895 { 03896 if(n >= CDRDATA_WORD(Trans->NTransforms)) 03897 return FALSE; 03898 03899 cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n])); 03900 03901 ERROR3IF(CDRDATA_WORD(Hdr->Type) != cdrfTRANSFORMTYPE_MATRIX, "GetMatrix called for a non matrix trfd entry"); 03902 ERROR3IF((sizeof(FLOAT8) / 2) != sizeof(DWORD) || sizeof(DWORD) != 4, "Non valid sizeof assumptions"); 03903 03904 // OK, so apparently either PCs or Acorns store them the wrong way round. Oh well. 03905 FLOAT8 *TData = (FLOAT8 *)(Hdr + 1); 03906 FLOAT8 *Out = (FLOAT8 *)M; 03907 03908 INT32 l; 03909 for(l = 0; l < 6; l++) 03910 { 03911 Out[l] = CDRDATA_FLOAT8(TData[l]); 03912 } 03913 03914 // change the translation vector to be in millipoints 03915 M->c *= CDRCOORDS_TO_MILLIPOINTS; 03916 M->f *= CDRCOORDS_TO_MILLIPOINTS; 03917 03918 return TRUE; 03919 }
|
|
Implements CDRTransformConvertor. Definition at line 1018 of file cdrfiltr.h. 01018 {return CDRDATA_WORD(Trans->NTransforms);};
|
|
converts a perspective from position N
Implements CDRTransformConvertor. Definition at line 3987 of file cdrfiltr.cpp. 03988 { 03989 if(n >= CDRDATA_WORD(Trans->NTransforms)) 03990 return FALSE; 03991 03992 cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n])); 03993 03994 ERROR3IF(CDRDATA_WORD(Hdr->Type) != cdrfTRANSFORMTYPE_PERSPECTIVE, "GetPerspective called for a non matrix trfd entry"); 03995 03996 cdrfPerspectiveEntry *Per = (cdrfPerspectiveEntry *)Hdr; 03997 03998 return ConvertPerspective(P, &Per->Trans); 03999 }
|
|
gets a transform type from an trfd chunk
Implements CDRTransformConvertor. Definition at line 3795 of file cdrfiltr.cpp. 03796 { 03797 if(n >= CDRDATA_WORD(Trans->NTransforms)) 03798 return CDRTRANSFORMTYPE_UNKNOWN; 03799 03800 cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n])); 03801 03802 switch(CDRDATA_WORD(Hdr->Type)) 03803 { 03804 case cdrfTRANSFORMTYPE_MATRIX: 03805 return CDRTRANSFORMTYPE_MATRIX; 03806 break; 03807 03808 case cdrfTRANSFORMTYPE_PERSPECTIVE: 03809 return CDRTRANSFORMTYPE_PERSPECTIVE; 03810 break; 03811 03812 #ifdef CDR_DOEXTRUDE 03813 case cdrfTRANSFORMTYPE_EXTRUDE: 03814 return CDRTRANSFORMTYPE_EXTRUDE; 03815 break; 03816 #endif 03817 03818 case cdrfTRANSFORMTYPE_ENVELOPE: 03819 return CDRTRANSFORMTYPE_ENVELOPE; 03820 break; 03821 03822 default: 03823 TRACEUSER( "Ben", _T("[] Unknown v5 transform type\n")); 03824 break; 03825 } 03826 03827 return CDRTRANSFORMTYPE_UNKNOWN; 03828 }
|
|
intialises this convertor
Implements CDRTransformConvertor. Definition at line 3737 of file cdrfiltr.cpp. 03738 { 03739 List = Data; 03740 ListSize = Size; 03741 03742 ADDR TransformData; 03743 03744 if(!RIFFFile::FindChunkWithinListContents(List, ListSize, cdrT_trfd, 0, &TransformData, 0)) 03745 return 0; 03746 03747 Trans = (cdrfTransform *)TransformData; 03748 03749 return TRUE; 03750 }
|
|
Definition at line 1026 of file cdrfiltr.h. |
|
Definition at line 1027 of file cdrfiltr.h. |
|
Definition at line 1025 of file cdrfiltr.h. |