imageprocessing/debugFunctions.c
void writeFeatureWithNormals(FEATURE_T* pFeature,int featureId,FILE* pOut)
{
    POINT_T * pHead = pFeature->first;
    POINT_T * pCurrent = pHead;
    ARC_T* pArc = pFeature->firstArc;
    int color = (featureId*20)%255;
    /* final item is color - want each feature to contrast with previous */
    fprintf(pOut,"-FIGURE %d L %d %d\n",featureId,
	    listSize(pHead),color);
    fflush(pOut);
    while (pCurrent != NULL)
      {
      fprintf(pOut,"-COORDS %.2lf %.2lf 0\n", 
	      (double) pCurrent->x,(double) pCurrent->y);
      fflush(pOut);
      pCurrent = pCurrent->next;
      }
    /* now write a single feature for each normal vector on each arc */
    while (pArc != NULL)
      {
      fprintf(pOut,"-FIGURE %d L 2 %d\n",featureId,color);
      fprintf(pOut,"-COORDS %.2lf %.2lf 0\n", 
	      pArc->midX,pArc->midY);
      fprintf(pOut,"-COORDS %.2lf %.2lf 0\n", 
	      pArc->normalX,pArc->normalY);
      pArc = pArc->next;
      }
}
/* Write a feature to the output file.
 * Create additional features of the same color for
 * each arc's normal vector. 
 * This is a debugging function so we can see if the normals
 * are being calculated as we expect.
 * @param pFeature     Feature to write
 * @param featureId    Numeric Id of the feature
 * @param pOut         File pointer for open text file.
 */
Write a feature to the output file.
Create additional features of the same color for
each arc's normal vector.
This is a debugging function so we can see if the normals
are being calculated as we expect.
@param pFeature     Feature to write
@param featureId    Numeric Id of the feature
@param pOut         File pointer for open text file.
Write a feature to the output file . Create additional features of the same color for each arc ' s normal vector . This is a debugging function so we can see if the normals are being calculated as we expect . @param pFeature Feature to write @param featureId Numeric Id of the feature @param pOut File pointer for open text file .
void writeFeatureWithNormals(FEATURE_T* pFeature,int featureId,FILE* pOut)
{
    POINT_T * pHead = pFeature->first;
    POINT_T * pCurrent = pHead;
    ARC_T* pArc = pFeature->firstArc;
    int color = (featureId*20)%255;
    fprintf(pOut,"-FIGURE %d L %d %d\n",featureId,
	    listSize(pHead),color);
    fflush(pOut);
    while (pCurrent != NULL)
      {
      fprintf(pOut,"-COORDS %.2lf %.2lf 0\n", 
	      (double) pCurrent->x,(double) pCurrent->y);
      fflush(pOut);
      pCurrent = pCurrent->next;
      }
    while (pArc != NULL)
      {
      fprintf(pOut,"-FIGURE %d L 2 %d\n",featureId,color);
      fprintf(pOut,"-COORDS %.2lf %.2lf 0\n", 
	      pArc->midX,pArc->midY);
      fprintf(pOut,"-COORDS %.2lf %.2lf 0\n", 
	      pArc->normalX,pArc->normalY);
      pArc = pArc->next;
      }
}
void writeFeatureWithNormals ( FEATURE_T * pFeature , int featureId , FILE * pOut ) { POINT_T * pHead = pFeature -> first ; POINT_T * pCurrent = pHead ; ARC_T * pArc = pFeature -> firstArc ; int color = ( featureId * 20 ) % 255 ; fprintf ( pOut , " \n " , featureId , listSize ( pHead ) , color ) ; fflush ( pOut ) ; while ( pCurrent != NULL ) { fprintf ( pOut , " \n " , ( double ) pCurrent -> x , ( double ) pCurrent -> y ) ; fflush ( pOut ) ; pCurrent = pCurrent -> next ; } while ( pArc != NULL ) { fprintf ( pOut , " \n " , featureId , color ) ; fprintf ( pOut , " \n " , pArc -> midX , pArc -> midY ) ; fprintf ( pOut , " \n " , pArc -> normalX , pArc -> normalY ) ; pArc = pArc -> next ; } }
Write a feature to the output file.
Write a feature to the output file .
/* final item is color - want each feature to contrast with previous */ /* now write a single feature for each normal vector on each arc */