yoloserv/modules/atlantean/include/pgmutes.h
2023-06-01 17:02:01 -03:00

87 lines
3.0 KiB
C

#ifndef _pgmutes_
#define _pgmutes_
typedef struct _typImg {
char * filename;
unsigned char * imgc;
float * imgf;
int * imgi;
int w;
int h;
int mx;
int my;
} typImg;
/* src/pgmutes.c */
typImg *create(int w, int h);
typImg * copy(typImg *pImg1);
typImg *clone(typImg *pImg);
typImg * init(unsigned char * gab, int w, int h);
unsigned char *getptr(typImg *pImg, int x, int y);
unsigned char getval(typImg *pImg, int x, int y);
void setval(typImg *pImg, int x, int y, int val);
void floatify(typImg *pImg);
void intify(typImg *pImg);
int place(typImg *pImg1, typImg *pImg2, int x, int y);
typImg *pgmload(char *filename);
typImg *load(char *filename, int w, int h);
void arrload(typImg *pImg, int arr[]);
int save(typImg *pImg, char *filename);
int pgmsave(typImg *pImg, char *filename);
void pgmascii(typImg *pImg, int s);
int seektop(typImg *pImg, int val);
int seekbottom(typImg *pImg, int val);
int seekleft(typImg *pImg, int val);
int seekright(typImg *pImg, int val);
void line(typImg * pImg, int x1, int x2, int y1, int y2);
typImg *rotate(typImg *pImg);
typImg *threshold(typImg *pImg, int lo, int hi, int new1, int new2);
typImg *normalise(typImg *pImg, int _lo, int _hi);
int countnonzero(typImg * pImg);
int suberode(typImg *pImg, int x, int y, typImg *pFilt);
typImg * erode(typImg *pImg, typImg *pFilt);
typImg * dilate(typImg *pImg, typImg *pFilt);
typImg * mix(typImg *pIm1, typImg * pIm2, int op);
typImg * linear10(typImg * pImg, int window);
typImg * linear20(typImg * pImg, int window);
typImg * logical(typImg * p1, typImg * p2, int mode);
unsigned long sum(typImg *pImg, int x1, int y1, int x2, int y2);
int avg(typImg *pImg, int x1, int y1, int x2, int y2);
void dump(typImg *pImg);
int min(typImg *pImg);
int max(typImg *pImg);
typImg * cross(typImg *pImg, int x, int y, int threshold);
int grid(typImg * pImg, int x, int y, int w, int h, int step);
typImg * fliph(typImg *pImg);
int subconvolve(typImg *pImg, int x, int y, typImg *pFilt);
typImg * convolve(typImg * pImg, typImg * pFilt, int thresh);
int findmid(typImg * pImg, int thresh);
typImg * smooth(typImg *pImg, int w, int h);
int isclear(typImg *pImg, int x1, int y1, int x2, int y2, int tolerance, int val);
typImg * square(typImg *pImg, int x, int y, int tolerance, int val);
typImg * cut(typImg *pImg1, int x, int y, int w, int h);
typImg *resize(typImg *pImg1, int x, int y);
#endif
/**
Copyright (c) Atlantean Technical Solutions Limited (ATSL) 2022
This software has been produced by ATSL and is the copyright of ATSL. The
use of source code for the software is strictly governed by the terms and
conditions of the source code licence. Any unauthorised use of the source
source code for the software in any manner shall invalidate the licence,
any existing warranty and software support agreements by ATSL.
@proj usbutes
@subsys CCL
@file ccl.c
@brief <B> *** Useful general purpose common C functions *** </B>
@author GoodwinC
@date 2022-10-27
@spec N.A
*/