binned fix

This commit is contained in:
2026-11-11 09:52:21 +03:00
parent 4192fc7f02
commit f6d2fd2e45
8 changed files with 18 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ static double expt[2] = {0.}; // min/max exposition time
static double exptime = 0.; // actual exposition time
static double tstart = 0.; // exposure start time
static char whynot[BUFSIZ]; // temporary buffer for error messages
static int imW = 0, imH = 0; // size of output image
static int imW = 0, imH = 0; // size of output image (BINNED!)
static int pid = -1, vid = -1;
static int isexposuring = 0;
@@ -224,8 +224,8 @@ static int setgeometry(cc_frameformat *f){
if(ApnGlueSetExpGeom(f->w, f->h, ow, 0, hbin, vbin,
f->xoff, f->yoff, &imW, &imH, whynot)){
WARNX("Can't set geometry: %s", whynot);
imW = f->w;
imH = f->h;
imW = f->w / hbin;
imH = f->h / vbin;
}else{
camera.geometry = *f;
}

View File

@@ -345,7 +345,8 @@ static int pollcapt(cc_capture_status *st, float *remain){
static int capture(cc_IMG *ima){
FNAME();
//double __t0 = dtime();
if(!ima || !ima->data || !imgBuf || !isopened || !cc_fiximage(bitdepth, camera.geometry.w, camera.geometry.h, ima)) return FALSE;
if(!ima || !ima->data || !imgBuf || !isopened ||
!cc_fiximage(bitdepth, camera.geometry.w / curhbin, camera.geometry.h / curvbin, ima)) return FALSE;
static int toohot = FALSE;
float_values f;
//TIMESTAMP("start capt");

View File

@@ -168,7 +168,7 @@ add_custom_command(
DEPENDS ru_file_updated
)
add_custom_command(
add_custom_target(
OUTPUT ru_file_updated
COMMAND [ -f ${RU_FILE} ] && ${GETTEXT_MSGMERGE_EXECUTABLE} -Uis ${RU_FILE} ${PO_FILE} || cp ${PO_FILE} ${RU_FILE}
COMMAND ${CMAKE_COMMAND} -E touch ru_file_updated
@@ -176,3 +176,5 @@ add_custom_command(
)
add_custom_target(MO_FILE ALL DEPENDS ${MO_FILE})
add_dependencies(${PROJ} MO_FILE)
install(FILES ${MO_FILE} DESTINATION "${LOCALEDIR}/ru/LC_MESSAGES")

View File

@@ -71,7 +71,8 @@ static int startexp(){
static int camcapt(cc_IMG *ima){
static int n = 0;
if(!ima || !ima->data || !cc_fiximage(bitpix, camera.geometry.w, camera.geometry.h, ima)) return FALSE;
if(!ima || !ima->data ||
!cc_fiximage(bitpix, camera.geometry.w / curhbin, camera.geometry.h / curvbin, ima)) return FALSE;
#ifdef EBUG
double t0 = sl_dtime();
#endif

View File

@@ -462,7 +462,8 @@ retn:
static int fli_capt(cc_IMG *ima){
int bitpix = is16bit ? 16 : 8;
if(!ima || !ima->data || !cc_fiximage(bitpix, camera.geometry.w, camera.geometry.h, ima)) return FALSE;
if(!ima || !ima->data ||
!cc_fiximage(bitpix, camera.geometry.w / curhbin, camera.geometry.h / curvbin, ima)) return FALSE;
for(int row = 0; row < ima->h; row++){
void *ptr = NULL;
if(is16bit) ptr = (void*)(((uint16_t*)ima->data) + row * ima->w);

View File

@@ -313,17 +313,18 @@ static int startexp(){
static int camcapt(cc_IMG *ima){
TCHECK();
int bitpix = toupcam.bytepix * 8;
if(!ima || !ima->data || !toupcam.data || !cc_fiximage(bitpix, camera.geometry.w, camera.geometry.h, ima)) return FALSE;
int realw = camera.geometry.w / toupcam.curbin, realh = camera.geometry.h / toupcam.curbin;
if(!ima || !ima->data || !toupcam.data || !cc_fiximage(bitpix, realw, realh, ima)) return FALSE;
//DBG("LOCK");
pthread_mutex_lock(&toupcam.mutex);
size_t fullsz = ima->w * ima->h * toupcam.bytepix;
if(toupcam.imsz != fullsz){
if(toupcam.imsz < fullsz) fullsz = toupcam.imsz;
int realw = camera.geometry.w / toupcam.curbin;
if(ima->w != realw) ima->w = realw;
ima->h = fullsz / realw / toupcam.bytepix;
WARNX("Asked image size (%zd) not equal real (%zd); set w=%d, h=%d!",
ima->w * ima->h * toupcam.bytepix, toupcam.imsz, ima->w, ima->h);
ima->bytelen = fullsz;
}
memcpy(ima->data, toupcam.data, fullsz);
toupcam.lastcapno = toupcam.imseqno;

Binary file not shown.

View File

@@ -235,7 +235,7 @@ msgstr "
#: main.c:129
msgid "Can't run in client and server modes simultaneously"
msgstr ""
msgstr "îÅ ÍÏÇÕ ÏÄÎÏ×ÒÅÍÅÎÎÏ ÚÁÐÕÓÔÉÔØ ËÌÉÅÎÔ É ÓÅÒ×ÅÒ"
#: ccdfunc.c:684
#, c-format
@@ -499,12 +499,12 @@ msgstr "
#: cmdlnopts.c:123
msgid "INET command socket port (omit if use on same host with server)"
msgstr ""
msgstr "ÐÏÒÔ ËÏÍÁÎÄÎÏÇÏ ÓÅÔÅ×ÏÇÏ ÓÏËÅÔÁ"
#: cmdlnopts.c:124
#, fuzzy
msgid "INET image socket port (default: port+1)"
msgstr "ÐÏÒÔ ÌÏËÁÌØÎÏÇÏ ÓÅÔÅ×ÏÇÏ ÓÏËÅÔÁ ÐÅÒÅÄÁÞÉ ÉÚÏÂÒÁÖÅÎÉÑ"
msgstr "ÐÏÒÔ ÓÅÔÅ×ÏÇÏ ÓÏËÅÔÁ ÐÅÒÅÄÁÞÉ ÉÚÏÂÒÁÖÅÎÉÑ"
#: ccdfunc.c:90
msgid "Image not saved: neither filename nor filename prefix pointed"