/********************************************************************
 * Project: CS664 Project 1            Justin Miller
 * File: cannyEdge.h              CANNYEDGE.h
 *
 * Purpose: Implements the canny edge detector with NMS and one level
 *   thresholding in a callable procedure cannyEdge().
 * This File: 
 *   -implements the Quad data structure
 *   -contains prototypes for the Quad data structure general usage
 *    procedures
 *
 * Copyright (c) 1995 Cornell University.  All Rights Reserved.
 ********************************************************************/

#ifndef CANNY_EDGE
#define CANNY_EDGE

/* _Quad structure
 * 
 * Contains pointers for 4 images, the partial derivates of an image 
 *   with respect to x and y, the sqared gradient magnitude of the image
 *   and the edge pixels (peaks in gradient).
 * NOTE: initialize with createQuad() and free with destroyQuad()
 */
typedef struct {
  FloatImage dxPartial;
  FloatImage dyPartial;
  FloatImage sgMagnitude;
  BinaryImage peaks;
} _Quad;

/* Quad - is a pointer to a _Quad structure
 */
typedef _Quad *Quad;

/* PROTOTYPES FOR EXTERNAL PROCEDURES*/
Quad createQuad(int x, int y);
void destroyQuad(Quad q);
void killQuad(Quad q);
void thresholdQuad(Quad q, int t);
BinaryImage thresholdQuadNew(Quad q, int t);
Quad cannyEdge(FloatImage inimage, float threshold);



#endif
