#pragma once
#include <stdint.h>
#include <stdio.h>

#include "data_types.h"
// Pure C implementation to read a cluster file

size_t read_clusters(FILE *fp, size_t n_clusters, Cluster *buf,
                     uint32_t *n_left);

size_t read_clusters_with_cut(FILE *fp, size_t n_clusters, Cluster *buf,
                              uint32_t *n_left, double *noise_map, int nx,
                              int ny);

int analyze_clusters(int64_t n_clusters, int32_t *cin, ClusterAnalysis *cout,
                     int csize);

int analyze_data(int32_t *data, int32_t *t2, int32_t *t3, char *quad,
                 double *eta2x, double *eta2y, double *eta3x, double *eta3y);

int analyze_cluster(Cluster data, int32_t *t2, int32_t *t3, char *quad,
                    double *eta2x, double *eta2y, double *eta3x, double *eta3y);
