mirror of
https://github.com/eddyem/astrovideoguide_v3.git
synced 2026-03-22 01:31:25 +03:00
forgotten fixes
This commit is contained in:
@@ -204,14 +204,24 @@ Image *Image_read(const char *name){
|
||||
* @return data allocated here
|
||||
*/
|
||||
Image *Image_new(int w, int h){
|
||||
static uint64_t cnt = 0;
|
||||
if(w < 1 || h < 1) return NULL;
|
||||
DBGLOG("Image_new(%d, #%u)", w*h, cnt);
|
||||
Image *outp = MALLOC(Image, 1);
|
||||
outp->width = w;
|
||||
outp->height = h;
|
||||
outp->counter = cnt++;
|
||||
outp->data = MALLOC(Imtype, w*h);
|
||||
return outp;
|
||||
}
|
||||
|
||||
void Image_free(Image **I){
|
||||
if(!I || !*I) return;
|
||||
DBGLOG("Image_free(%d, #%d)", (*I)->height * (*I)->width, (*I)->counter);
|
||||
FREE((*I)->data);
|
||||
FREE(*I);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Image_sim - allocate memory for new empty Image with similar size & data type
|
||||
* @param i - sample image
|
||||
@@ -267,7 +277,7 @@ int calc_background(Image *img){
|
||||
WARNX("Image values too small");
|
||||
return FALSE;
|
||||
}
|
||||
img->background = theconf.fixedbkgval;
|
||||
img->background = theconf.background;
|
||||
return TRUE;
|
||||
}
|
||||
size_t histogram[HISTOSZ];
|
||||
|
||||
Reference in New Issue
Block a user