#include <cxfnbmp.h>
Static Public Member Functions | |
static BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter, NodeBitmap *pNodeBitmap) |
Implementation of an abstract class, holding code for exporting NodeBitmaps.Saves a NodeBitmap record to the filter. | |
static BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter, NodeBitmap *pNodeBitmap) |
Static Protected Member Functions | |
static BOOL | WriteNodeBitmap (BaseCamelotFilter *pFilter, NodeBitmap *pNodeBitmap) |
saves a NodeBitmap record to the filter |
Definition at line 122 of file cxfnbmp.h.
|
saves a NodeBitmap record to the filter
Definition at line 162 of file cxfnbmp.cpp. 00163 { 00164 ERROR2IF(pFilter==NULL, FALSE, "parameter pFilter==NULL"); 00165 ERROR2IF(pNodeBitmap==NULL, FALSE, "parameter pNodeBitmap==NULL"); 00166 00167 BOOL ok = TRUE; 00168 00169 // save out the actual bitmap, and remember its record number 00170 INT32 BitmapRecordRef = 0; 00171 INT32 StartColourRecordRef = 0; 00172 INT32 EndColourRecordRef = 0; 00173 00174 // Get the bitmap that the node references and hence we need to save. 00175 // Then get a reference to it. In the process this may save out the 00176 // bitmap definition, if it has not already been saved 00177 KernelBitmap *pBmp = pNodeBitmap->GetBitmap(); 00178 // Complain if no bitmap was found 00179 ERROR2IF(pBmp == NULL,FALSE,"CXaraFileNodeBitmap::WriteNodeBitmap pBmp is NULL"); 00180 BitmapRecordRef = pFilter->WriteRecord(pBmp); 00181 ERROR2IF(BitmapRecordRef == 0,FALSE,"CXaraFileNodeBitmap::WriteNodeBitmap BitmapRecordRef is 0"); 00182 00183 // Do the same for the start and end colours (Contoning) 00184 // Only get a colour reference if they are present 00185 DocColour *pStartCol = pNodeBitmap->GetStartColour(); 00186 if (pStartCol) 00187 StartColourRecordRef = pFilter->WriteRecord(pStartCol); 00188 DocColour *pEndCol = pNodeBitmap->GetEndColour(); 00189 if (pEndCol) 00190 EndColourRecordRef = pFilter->WriteRecord(pEndCol); 00191 00192 // BOOL Contoned = pNodeBitmap->GetApplyContoneColour(); 00193 // The above flag may lie. If you have a 24bpp bitmap and have tried to apply a contone colour 00194 // and cancelled the operation, then this flag is set but there are no colours. 00195 // Check for the prescence of the colours and that they have been converted to colour references 00196 // ok. Only then, do we save a contoned bitmap. 00197 if (pStartCol != NULL && pEndCol != NULL && 00198 StartColourRecordRef != 0 && EndColourRecordRef != 0 ) 00199 { 00200 // Write out a contoned node bitmap record 00201 CamelotFileRecord Rec(pFilter,TAG_NODE_CONTONEDBITMAP, TAG_NODE_CONTONEDBITMAP_SIZE); 00202 TRACEUSER( "Neville", _T("Write contoned node bitmap, bitmap reference %d, Start colour %d, EndColour %d\n"),BitmapRecordRef,StartColourRecordRef,EndColourRecordRef); 00203 if (ok) ok = Rec.Init(); 00204 // Write out the encompassing rectangle 00205 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[0]); 00206 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[1]); 00207 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[2]); 00208 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[3]); 00209 // Write out the bitmap reference 00210 if (ok) ok = Rec.WriteReference(BitmapRecordRef); 00211 if (ok) ok = Rec.WriteReference(StartColourRecordRef); 00212 if (ok) ok = Rec.WriteReference(EndColourRecordRef); 00213 if (ok) ok = pFilter->Write(&Rec); 00214 } 00215 else 00216 { 00217 // Write out a normal node bitmap record 00218 CamelotFileRecord Rec(pFilter,TAG_NODE_BITMAP, TAG_NODE_BITMAP_SIZE); 00219 TRACEUSER( "Neville", _T("Write node bitmap, bitmap reference %d\n"),BitmapRecordRef); 00220 if (ok) ok = Rec.Init(); 00221 // Write out the encompassing rectangle 00222 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[0]); 00223 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[1]); 00224 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[2]); 00225 if (ok) ok = Rec.WriteCoord(pNodeBitmap->Parallel[3]); 00226 // Write out the bitmap reference 00227 if (ok) ok = Rec.WriteReference(BitmapRecordRef); 00228 if (ok) ok = pFilter->Write(&Rec); 00229 } 00230 00231 return ok; 00232 }
|
|
Definition at line 141 of file cxfnbmp.cpp. 00142 { 00143 ERROR2IF(pFilter==NULL, FALSE, "parameter pFilter==NULL"); 00144 ERROR2IF(pNodeBitmap==NULL, FALSE, "parameter pNodeBitmap==NULL"); 00145 00146 return WriteNodeBitmap(pFilter, pNodeBitmap); 00147 }
|
|
Implementation of an abstract class, holding code for exporting NodeBitmaps.Saves a NodeBitmap record to the filter.
Definition at line 133 of file cxfnbmp.cpp. 00134 { 00135 ERROR2IF(pFilter==NULL, FALSE, "parameter pFilter==NULL"); 00136 ERROR2IF(pNodeBitmap==NULL, FALSE, "parameter pNodeBitmap==NULL"); 00137 00138 return WriteNodeBitmap(pFilter, pNodeBitmap); 00139 }
|