f.pixmap.cc (fotoxx-22.41) | : | f.pixmap.cc (fotoxx-22.50) | ||
---|---|---|---|---|
skipping to change at line 489 | skipping to change at line 489 | |||
{ | { | |||
memcpy(pix2,pix1,pcc); | memcpy(pix2,pix1,pcc); | |||
pix1 += nc; | pix1 += nc; | |||
pix2 += nc; | pix2 += nc; | |||
} | } | |||
} | } | |||
return pxm2; | return pxm2; | |||
} | } | |||
// copy a rectangular area from one PXM image into another | // copy a rectangular area from one PXM image into another - same origin | |||
void PXM_copy_area(PXM *pxm1, PXM *pxm2, int orgx, int orgy, int ww, int hh) | void PXM_copy_area(PXM *pxm1, PXM *pxm2, int orgx, int orgy, int ww, int hh) | |||
{ | { | |||
float *pix1, *pix2; | float *pix1, *pix2; | |||
int py, nc, cc; | int py, nc, cc; | |||
nc = pxm1->nc; | nc = pxm1->nc; | |||
cc = nc * ww * sizeof(float); | cc = nc * ww * sizeof(float); | |||
for (py = orgy; py < orgy + hh; py++) | for (py = orgy; py < orgy + hh; py++) | |||
{ | { | |||
pix1 = PXMpix(pxm1,orgx,py); | pix1 = PXMpix(pxm1,orgx,py); | |||
pix2 = PXMpix(pxm2,orgx,py); | pix2 = PXMpix(pxm2,orgx,py); | |||
memcpy(pix2,pix1,cc); | memcpy(pix2,pix1,cc); | |||
} | } | |||
return; | return; | |||
} | } | |||
// copy a rectangular area from one PXM image into another - different origin | ||||
// 22.50 | ||||
void PXM_copy_area(PXM *pxm1, PXM *pxm2, int orgx1, int orgy1, int orgx2, int or | ||||
gy2, int ww, int hh) | ||||
{ | ||||
float *pix1, *pix2; | ||||
int py, nc, cc; | ||||
nc = pxm1->nc; | ||||
cc = nc * ww * sizeof(float); | ||||
for (py = 0; py < hh; py++) | ||||
{ | ||||
pix1 = PXMpix(pxm1,orgx1,orgy1+py); | ||||
pix2 = PXMpix(pxm2,orgx2,orgy2+py); | ||||
memcpy(pix2,pix1,cc); | ||||
} | ||||
return; | ||||
} | ||||
/******************************************************************************* * | /******************************************************************************* * | |||
Rescale PXM pixmap to new width and height. | Rescale PXM pixmap to new width and height. | |||
The scale ratios may be different for width and height. | The scale ratios may be different for width and height. | |||
Method is better than bilinear: | Method is better than bilinear: | |||
For all input pixels [p] having some overlap area with an output pixel: | For all input pixels [p] having some overlap area with an output pixel: | |||
output pixel = sum ( overlap[p] * input[p] ) / sum ( overlap[p] ) | output pixel = sum ( overlap[p] * input[p] ) / sum ( overlap[p] ) | |||
NOT THREAD SAFE | NOT THREAD SAFE | |||
skipping to change at line 2104 | skipping to change at line 2124 | |||
{ | { | |||
if (! Ffmpeg) { | if (! Ffmpeg) { | |||
if (Vftf) { Vftf = 0; zmessageACK(Mwin,ffmpegmess); } | if (Vftf) { Vftf = 0; zmessageACK(Mwin,ffmpegmess); } | |||
goto errret; | goto errret; | |||
} | } | |||
tid = pthread_self(); | tid = pthread_self(); | |||
snprintf(framefile,200,"%s/framefile-%ld.jpg",temp_folder,tid); // unique frame file per thread | snprintf(framefile,200,"%s/framefile-%ld.jpg",temp_folder,tid); // unique frame file per thread | |||
// (index function, thumbnail creation) | // (index function, thumbnail creation) | |||
file2 = zescape_quotes(file); // escape embedded quotes | file2 = zescape_quotes(file); // escape embedded quotes | |||
err = zshell("log","ffmpeg -ss 1 -i \"%s\" -v 8 -frames 1 -y %s", // ffmpeg command to get frame file | err = zshell(0,"ffmpeg -ss 1 -i \"%s\" -v 8 -frames 1 -y %s", // ffmpeg command to get frame file | |||
file2, framefile); | file2, framefile); | |||
zfree(file2); | zfree(file2); | |||
if (err && err != 69) { // srmount error, ignore | if (err && err != 69) { // srmount error, ignore | |||
Plog(0,"cannot get video frame 1: %s %s \n",file,strerror(err)); | Plog(0,"ffmpeg cannot get video frame: %s %s \n",file,strerror(err)); | |||
goto errret; | goto errret; | |||
} | } | |||
pxb = ANY_PXB_load(framefile); | pxb = ANY_PXB_load(framefile); | |||
if (! pxb) goto errret; | if (! pxb) goto errret; | |||
remove(framefile); | remove(framefile); | |||
strcpy(f_load_type,"video"); | strcpy(f_load_type,"video"); | |||
f_load_bpc_raw = 0; | f_load_bpc_raw = 0; | |||
} | } | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 25 lines changed or added |