merge with dev

This commit is contained in:
Desmis
2019-07-07 07:29:10 +02:00
5 changed files with 21 additions and 11 deletions

View File

@@ -235,7 +235,7 @@ void dfInfo::updateBadPixelList( RawImage *df )
df->data[row + 2][col - 2] + df->data[row + 2][col] + df->data[row + 2][col + 2]);
if( df->data[row][col] > m * threshold ) {
badPixelsThread.push_back( badPix(col, row) );
badPixelsThread.emplace_back(col, row);
}
}
@@ -566,7 +566,7 @@ int DFManager::scanBadPixelsFile( Glib::ustring filename )
if( numparms == 1 ) { // only one number in first line means, that this is the offset.
offset = x;
} else if(numparms == 2) {
bp.push_back( badPix(x + offset, y + offset) );
bp.emplace_back(x + offset, y + offset);
}
while( fgets(line, sizeof(line), file ) ) {

View File

@@ -575,7 +575,11 @@ int ImageIO::loadJPEG (const Glib::ustring &fname)
my_jpeg_stdio_src (&cinfo, file);
#if defined( WIN32 ) && defined( __x86_64__ ) && !defined(__clang__)
if ( __builtin_setjmp((reinterpret_cast<rt_jpeg_error_mgr*>(cinfo.src))->error_jmp_buf) == 0 ) {
#else
if ( setjmp((reinterpret_cast<rt_jpeg_error_mgr*>(cinfo.src))->error_jmp_buf) == 0 ) {
#endif
if (pl) {
pl->setProgressStr ("PROGRESSBAR_LOADJPEG");
pl->setProgress (0.0);

View File

@@ -245,7 +245,11 @@ my_error_exit (j_common_ptr cinfo)
j_decompress_ptr dinfo = (j_decompress_ptr)cinfo;
// longjmp (((rt_jpeg_error_mgr*)(dinfo->src))->error_jmp_buf, 1);
#if defined( WIN32 ) && defined( __x86_64__ ) && !defined(__clang__)
__builtin_longjmp ((reinterpret_cast<rt_jpeg_error_mgr*>(dinfo->src)) ->error_jmp_buf, 1);
#else
longjmp ((reinterpret_cast<rt_jpeg_error_mgr*>(dinfo->src)) ->error_jmp_buf, 1);
#endif
}

View File

@@ -20,6 +20,7 @@
*/
#include <cstdint>
#include <cstring>
#include <vector>
#include "noncopyable.h"
@@ -75,10 +76,10 @@ public:
}
// set pixels from a list
int set(const std::vector<badPix> &bp)
int set(const std::vector<badPix>& bp)
{
for (std::vector<badPix>::const_iterator iter = bp.begin(); iter != bp.end(); ++iter) {
set(iter->x, iter->y);
for (const auto& bad_pix : bp) {
set(bad_pix.x, bad_pix.y);
}
return bp.size();
@@ -86,7 +87,7 @@ public:
void clear()
{
memset(pm, 0, h * w * base_t_size);
std::memset(pm, 0, h * w * base_t_size);
}
// return 0 if at least one pixel in the word(base_t) is set, otherwise return the number of pixels to skip to the next word base_t
int skipIfZero(int x, int y) const