Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
Bumped version to 0.1.3
  • Loading branch information
aferrero2707 committed Jun 18, 2015
2 parents 7c84864 + 3d539f8 commit 4b98566
Show file tree
Hide file tree
Showing 34 changed files with 291 additions and 126 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
=========================================
Version 0.1.3

- Fixed opacity blending of "Color" mode in RGB and Lab colorspaces
- Fixed opacity blending of "Luminosity" mode in Lab colorspace
- Fixed filling of layer list of clone tool: for clone layers inserted
in layer masks, the parent layer was incorrectly included in the list,
leading to a possible unresolvable circular dependency between
the clone layer and its source. Now the parent layer is not included
anymore in the list of possible clone sources.
- original "visible" flag of layers renamed to "enabled", and added a new "visible"
flag to indicate if a given layer is either directly hidden or indirectly hidden
because some of its parents are hidden.
The "enabled" flag now indicates if the layer is directly hidden.
- Removed fatal assertion on the validity of the output image from layer extra inputs.
Now if the image is invalid a NULL pointer is simply added to the list of extra inputs,
without causing a program crash. Nevertheless, a notification mechanism should be
introduced to inform the user of the abnormal situation.
- Fixed corruption of RAW image metadata at zoom levels below 100%
- Fixed bug in the image preview at program startup
- Fixed several clang compilation warnings


=========================================
Version 0.1.2

Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ endif()
MESSAGE( STATUS "GTKMM3_FOUND: " ${GTKMM3_FOUND} )


IF(NOT MINGW)
#need to put here do setting LOCALE_DIR variable
if(USE_NLS)
find_package(Gettext)
Expand All @@ -91,6 +92,8 @@ if(Gettext_FOUND)
endif(NOT LOCALE_DIR)
endif(Gettext_FOUND)
endif(USE_NLS)
ENDIF(NOT MINGW)
MESSAGE( STATUS "Msgfmt_FOUND: " ${Msgfmt_FOUND} )


add_subdirectory(src)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.2
0.1.3
19 changes: 10 additions & 9 deletions src/base/blend_color.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ class BlendColor<T, PF_COLORSPACE_RGB, CHMIN, CHMAX, false>:
{
int pos, ch;
double temp_top;
double rgb[3];
double irgb[3], rgb[3];
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
// RGB values of the bottom layer
double ired = (double(bottom[x]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
double igreen = (double(bottom[x+1]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
double iblue = (double(bottom[x+2]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
// RGB values of the bottom layer
irgb[0] = (double(bottom[x]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
irgb[1] = (double(bottom[x+1]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
irgb[2] = (double(bottom[x+2]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
// Luminance value of the bottom layer
double lumi = PF::luminance( ired, igreen, iblue );
double lumi = PF::luminance( irgb[0], irgb[1], irgb[2] );

// RGB values of the top layer
double ored = (double(top[x]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
Expand All @@ -78,7 +79,7 @@ public:

pos = x;
for( ch=CHMIN; ch<=CHMAX; ch++, pos++ ) {
out[pos] = (T)(( (rgb[ch]*opacity)+(rgb[ch]*(1.0f-opacity)) )*FormatInfo<T>::RANGE - FormatInfo<T>::MIN);
out[pos] = (T)(( (rgb[ch]*opacity)+(irgb[ch]*(1.0f-opacity)) )*FormatInfo<T>::RANGE - FormatInfo<T>::MIN);
}
}
};
Expand Down Expand Up @@ -112,13 +113,13 @@ class BlendColor<T, PF_COLORSPACE_LAB, CHMIN, CHMAX, false>:
double temp_top;
double rgb[3];
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
for( ch=CHMIN; ch<=0; ch++, pos++ )
out[pos] = bottom[pos];
for( ; ch<=CHMAX; ch++, pos++ )
out[pos] = top[pos];
out[pos] = static_cast<T>( opacity*top[pos]+(1.0f-opacity)*bottom[pos] );
}
};

Expand Down
9 changes: 4 additions & 5 deletions src/base/blend_grain_extract.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendGrainExtract: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
{
}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -47,7 +46,7 @@ class BlendGrainExtract<T, CS, CHMIN, CHMAX, false>:
int ch, pos;
typename FormatInfo<T>::PROMOTED ptop;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
for( ch=CHMIN; ch<=CHMAX; ch++, pos++ ) {
Expand All @@ -68,7 +67,7 @@ class BlendGrainExtract<T, CS, CHMIN, CHMAX, true>:
typename FormatInfo<T>::PROMOTED ptop;
float opacity_real;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
{
opacity_real = opacity*(this->pmap[xomap]+FormatInfo<T>::MIN)/(FormatInfo<T>::RANGE);
xomap += 1;
Expand Down
7 changes: 3 additions & 4 deletions src/base/blend_grain_merge.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendGrainMerge: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
{
}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -47,7 +46,7 @@ class BlendGrainMerge<T, CS, CHMIN, CHMAX, false>:
int ch, pos;
typename FormatInfo<T>::SIGNED ptop;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
for( ch=CHMIN; ch<=CHMAX; ch++, pos++ ) {
Expand Down
3 changes: 2 additions & 1 deletion src/base/blend_hard_light.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendHardLight: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap) {}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand Down
9 changes: 4 additions & 5 deletions src/base/blend_lighten.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendLighten: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
{
}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -47,7 +46,7 @@ class BlendLighten<T, CS, CHMIN, CHMAX, false>:
int ch, pos;
T temp_top;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
for( ch=CHMIN; ch<=CHMAX; ch++, pos++ ) {
Expand Down Expand Up @@ -94,7 +93,7 @@ class BlendLighten<T, PF_COLORSPACE_GRAYSCALE, CHMIN, CHMAX, false>:
{
T temp_top;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
if( bottom[x]>top[x] ) temp_top = bottom[x];
else temp_top = top[x];
Expand Down
6 changes: 3 additions & 3 deletions src/base/blend_luminosity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class BlendLuminosity<T, PF_COLORSPACE_RGB, CHMIN, CHMAX, false>:
double irgb[3];
double rgb[3];
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
// RGB values of the bottom layer
irgb[0] = (double(bottom[x]) + FormatInfo<T>::MIN)/FormatInfo<T>::RANGE;
Expand Down Expand Up @@ -113,11 +113,11 @@ class BlendLuminosity<T, PF_COLORSPACE_LAB, CHMIN, CHMAX, false>:
double temp_top;
double rgb[3];
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
for( ch=CHMIN; ch<=0; ch++, pos++ )
out[pos] = top[pos];
out[pos] = static_cast<T>( opacity*top[pos]+(1.0f-opacity)*bottom[pos] );
for( ; ch<=CHMAX; ch++, pos++ )
out[pos] = bottom[pos];
}
Expand Down
9 changes: 4 additions & 5 deletions src/base/blend_multiply.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendMultiply: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
{
}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -47,7 +46,7 @@ class BlendMultiply<T, CS, CHMIN, CHMAX, false>:
int ch, pos;
typename FormatInfo<T>::PROMOTED ptop;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
for( ch=CHMIN; ch<=CHMAX; ch++, pos++ ) {
Expand Down Expand Up @@ -95,7 +94,7 @@ class BlendMultiply<T, PF_COLORSPACE_GRAYSCALE, CHMIN, CHMAX, false>:
{
typename FormatInfo<T>::PROMOTED ptop;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
ptop = top[x];
ptop *= bottom[x];
Expand Down
11 changes: 6 additions & 5 deletions src/base/blend_normal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendNormal: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap) {}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -45,7 +46,7 @@ class BlendNormal<T, PF_COLORSPACE_GRAYSCALE, CHMIN, CHMAX, false>:
public BlendBase<T, PF_COLORSPACE_GRAYSCALE, CHMIN, CHMAX, false>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
out[x] = (T)(opacity*top[x] + (1.0f-opacity)*bottom[x]);
}
Expand Down Expand Up @@ -74,7 +75,7 @@ class BlendNormal<T, PF_COLORSPACE_RGB, CHMIN, CHMAX, false>:
{
int ch, pos;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
// The target channel(s) get blended
Expand Down Expand Up @@ -135,7 +136,7 @@ class BlendNormal<T, PF_COLORSPACE_LAB, CHMIN, CHMAX, false>:
{
int ch, pos;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
// The target channel(s) get blended
Expand Down Expand Up @@ -190,7 +191,7 @@ class BlendNormal<T, PF_COLORSPACE_CMYK, CHMIN, CHMAX, false>:
{
int ch, pos;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
// The target channel(s) get blended
Expand Down
5 changes: 3 additions & 2 deletions src/base/blend_overlay.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendOverlay: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap) {}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -50,7 +51,7 @@ class BlendOverlay<T, CS, CHMIN, CHMAX, false>:
typename FormatInfo<T>::PROMOTED psum;
public:
BlendOverlay(): BlendBase<T, CS, CHMIN, CHMAX, false>(), psum(FormatInfo<T>::MAX + FormatInfo<T>::MIN) {}
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
//psum = FormatInfo<T>::MAX + FormatInfo<T>::MIN;
Expand Down
5 changes: 2 additions & 3 deletions src/base/blend_passthrough.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class BlendPassthrough: public BlendBase<T, CS, CHMIN, CHMAX, has_omap>
{
int ch;
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
{
}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};
5 changes: 3 additions & 2 deletions src/base/blend_screen.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendScreen: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap) {}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -50,7 +51,7 @@ class BlendScreen<T, CS, CHMIN, CHMAX, false>:
typename FormatInfo<T>::PROMOTED psum;
public:
BlendScreen(): BlendBase<T, CS, CHMIN, CHMAX, false>(), psum(FormatInfo<T>::MAX + FormatInfo<T>::MIN) {}
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
//psum = FormatInfo<T>::MAX + FormatInfo<T>::MIN;
Expand Down
5 changes: 3 additions & 2 deletions src/base/blend_soft_light.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_oma
class BlendSoftLight: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap) {}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -55,7 +56,7 @@ public:
psum((typename FormatInfo<T>::PROMOTED)(FormatInfo<T>::MAX) + FormatInfo<T>::MIN),
MAX2((typename FormatInfo<T>::PROMOTED)(FormatInfo<T>::MAX)*FormatInfo<T>::MAX),
sqrtMAX( sqrt(FormatInfo<T>::MAX) ) {}
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
pos = x;
//psum = FormatInfo<T>::MAX + FormatInfo<T>::MIN;
Expand Down
7 changes: 5 additions & 2 deletions src/base/blend_vivid_light.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
//#include "vivid_light.hh"


/*
static float color_burn(float top, float bottom)
{
if( top == 1 ) return 0;
Expand All @@ -46,13 +47,15 @@ static float color_dodge(float top, float bottom)
float result = bottom / (1.0f-top);
return( (result>1) ? 1 : result );
}
*/


template<typename T, colorspace_t colorspace, int CHMIN, int CHMAX, bool has_omap>
class BlendVividLight: public BlendBase<T, colorspace, CHMIN, CHMAX, has_omap>
{
public:
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap) {}
void blend(const float& /*opacity*/, T* /*bottom*/, T* /*top*/,
T* /*out*/, const int& /*x*/, int& /*xomap*/) {}
};


Expand All @@ -70,7 +73,7 @@ class BlendVividLight<T, CS, CHMIN, CHMAX, false>:
typename FormatInfo<T>::PROMOTED psum;
public:
BlendVividLight(): BlendBase<T, CS, CHMIN, CHMAX, false>(), psum(FormatInfo<T>::MAX + FormatInfo<T>::MIN) {}
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& xomap)
void blend(const float& opacity, T* bottom, T* top, T* out, const int& x, int& /*xomap*/)
{
#ifdef DO_WARNINGS
#warning "TODO: optimize vivid light blend"
Expand Down
2 changes: 1 addition & 1 deletion src/base/cachebuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void PF::CacheBuffer::step()
lseek( fd, offset, SEEK_SET );
p = VIPS_REGION_ADDR( reg, tile_area.left, tile_area.top+y );
ssize_t n = ::write( fd, p, VIPS_REGION_SIZEOF_LINE(reg) );
if( n != VIPS_REGION_SIZEOF_LINE(reg) )
if( n != (ssize_t)VIPS_REGION_SIZEOF_LINE(reg) )
break;
offset += VIPS_IMAGE_SIZEOF_LINE(image);
}
Expand Down

0 comments on commit 4b98566

Please sign in to comment.