/* Copyright (C) 2002 Sony Computer Entertainment America */
/*        All Rights Reserved.  SCEA Confidential         */

#ifndef SCEIMAGE_FIGURE_H
#define SCEIMAGE_FIGURE_H

// The following routines compute statistical properties of
// nonzero pixels in an image.  This includes count, centroid,
// horizontal and vertical second moments, principal second moments,
// and orientation of the principal moment.

// The centroid is faster than stats.  It returns the count of
// nonzero pixels.
int centroid(const sceImage& src, float *x, float *y);
int centroid(const sceImage& _src, float *x, float *y, const RECT& win);

int stats(const sceImage& _src, float *xc, float *yc, float*theta, float*Ixx, float*Iyy, float*p1, float*p2);
int stats(const sceImage& _src, float *xc, float *yc, float*theta, float*Ixx, float*Iyy, float*p1, float*p2, const RECT&win);

void extent(const sceImage& _src, const RECT& r, RECT*ex);

// legacy, do not use
void extent(const sceImage& _src, int *xmin, int *ymin, int *xmax, int *ymax,int *xbot=NULL);

void moment(const sceImage&src, float xc, float yc, float*w, float *h);


#endif
