Some files 'astylized' + slight cleanup
This commit is contained in:
@@ -72,4 +72,25 @@ int Alpha::getHeight()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Cairo::RefPtr<Cairo::ImageSurface> Alpha::getSurface ()
|
||||||
|
{
|
||||||
|
return surface; // to be used in bitmap edition
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char Alpha::operator () (unsigned row, unsigned col) const
|
||||||
|
{
|
||||||
|
return * (surface->get_data () + row * surface->get_width () + col);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char& Alpha::operator () (unsigned row, unsigned col)
|
||||||
|
{
|
||||||
|
return * (surface->get_data () + row * surface->get_width () + col);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char* Alpha::operator () (unsigned row) const
|
||||||
|
{
|
||||||
|
return surface->get_data () + row * surface->get_width ();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,7 @@ public:
|
|||||||
int getWidth();
|
int getWidth();
|
||||||
int getHeight();
|
int getHeight();
|
||||||
|
|
||||||
const Cairo::RefPtr<Cairo::ImageSurface> getSurface ();
|
Cairo::RefPtr<Cairo::ImageSurface> getSurface ();
|
||||||
|
|
||||||
// TODO: to make the editing faster, we should add an iterator class
|
// TODO: to make the editing faster, we should add an iterator class
|
||||||
|
|
||||||
@@ -50,28 +50,9 @@ public:
|
|||||||
unsigned char* operator () (unsigned row) const;
|
unsigned char* operator () (unsigned row) const;
|
||||||
// Will send back a value at a given row, col position
|
// Will send back a value at a given row, col position
|
||||||
unsigned char& operator () (unsigned row, unsigned col);
|
unsigned char& operator () (unsigned row, unsigned col);
|
||||||
const unsigned char operator () (unsigned row, unsigned col) const;
|
unsigned char operator () (unsigned row, unsigned col) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline const Cairo::RefPtr<Cairo::ImageSurface> Alpha::getSurface () {
|
|
||||||
return surface; // to be used in bitmap edition
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const unsigned char Alpha::operator () (unsigned row,
|
|
||||||
unsigned col) const {
|
|
||||||
return *(surface->get_data () + row * surface->get_width () + col);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline unsigned char& Alpha::operator () (unsigned row, unsigned col) {
|
|
||||||
return *(surface->get_data () + row * surface->get_width () + col);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline unsigned char* Alpha::operator () (unsigned row) const {
|
|
||||||
return surface->get_data () + row * surface->get_width ();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -79,9 +79,11 @@ void ImProcFunctions::removeSpots (Imagefloat* img, const std::vector<SpotEntry>
|
|||||||
// scaled spot is too small, we do not preview it
|
// scaled spot is too small, we do not preview it
|
||||||
if (scaledFeatherRadius < 2 && pp.getSkip() != 1) {
|
if (scaledFeatherRadius < 2 && pp.getSkip() != 1) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
||||||
if (options.rtSettings.verbose) {
|
if (options.rtSettings.verbose) {
|
||||||
printf ("Skipping spot located at %d x %d, too small for the preview zoom rate\n", entry.sourcePos.x, entry.sourcePos.y);
|
printf ("Skipping spot located at %d x %d, too small for the preview zoom rate\n", entry.sourcePos.x, entry.sourcePos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -89,9 +91,11 @@ void ImProcFunctions::removeSpots (Imagefloat* img, const std::vector<SpotEntry>
|
|||||||
// skipping entries totally transparent
|
// skipping entries totally transparent
|
||||||
if (entry.opacity == 0.) {
|
if (entry.opacity == 0.) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
||||||
if (options.rtSettings.verbose) {
|
if (options.rtSettings.verbose) {
|
||||||
printf ("Skipping spot located at %d x %d: opacity=%.3f\n", entry.sourcePos.x, entry.sourcePos.y, entry.opacity);
|
printf ("Skipping spot located at %d x %d: opacity=%.3f\n", entry.sourcePos.x, entry.sourcePos.y, entry.opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -99,11 +103,13 @@ void ImProcFunctions::removeSpots (Imagefloat* img, const std::vector<SpotEntry>
|
|||||||
// skipping entries where the source circle isn't completely inside the image bounds
|
// skipping entries where the source circle isn't completely inside the image bounds
|
||||||
if (src_XMin < 0 || src_XMax >= img->getWidth() || src_YMin < 0 || src_YMax >= img->getHeight()) {
|
if (src_XMin < 0 || src_XMax >= img->getWidth() || src_YMin < 0 || src_YMax >= img->getHeight()) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
||||||
if (options.rtSettings.verbose) {
|
if (options.rtSettings.verbose) {
|
||||||
printf ("Skipping spot located at %d x %d, from the data at %d x %d, radius=%d, feather=%.3f, opacity=%.3f: source out of bounds\n", entry.sourcePos.x, entry.sourcePos.y, entry.targetPos.x, entry.targetPos.y, entry.radius, entry.feather, entry.opacity);
|
printf ("Skipping spot located at %d x %d, from the data at %d x %d, radius=%d, feather=%.3f, opacity=%.3f: source out of bounds\n", entry.sourcePos.x, entry.sourcePos.y, entry.targetPos.x, entry.targetPos.y, entry.radius, entry.feather, entry.opacity);
|
||||||
printf ("%d < 0 || %d >= %d || %d < 0 || %d >= %d\n",
|
printf ("%d < 0 || %d >= %d || %d < 0 || %d >= %d\n",
|
||||||
src_XMin, src_XMax, img->getWidth(), src_YMin, src_YMax, img->getHeight());
|
src_XMin, src_XMax, img->getWidth(), src_YMin, src_YMax, img->getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -111,11 +117,13 @@ void ImProcFunctions::removeSpots (Imagefloat* img, const std::vector<SpotEntry>
|
|||||||
// skipping entries where the dest circle is completely outside the image bounds
|
// skipping entries where the dest circle is completely outside the image bounds
|
||||||
if (dst_XMin >= img->getWidth() || dst_XMax <= 0 || dst_YMin >= img->getHeight() || dst_YMax <= 0) {
|
if (dst_XMin >= img->getWidth() || dst_XMax <= 0 || dst_YMin >= img->getHeight() || dst_YMax <= 0) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
||||||
if (options.rtSettings.verbose) {
|
if (options.rtSettings.verbose) {
|
||||||
printf ("Skipping spot located at %d x %d, from the data at %d x %d, radius=%d, feather=%.3f, opacity=%.3f: source out of bounds\n", entry.sourcePos.x, entry.sourcePos.y, entry.targetPos.x, entry.targetPos.y, entry.radius, entry.feather, entry.opacity);
|
printf ("Skipping spot located at %d x %d, from the data at %d x %d, radius=%d, feather=%.3f, opacity=%.3f: source out of bounds\n", entry.sourcePos.x, entry.sourcePos.y, entry.targetPos.x, entry.targetPos.y, entry.radius, entry.feather, entry.opacity);
|
||||||
printf ("%d >= %d || %d <= 0 || %d >= %d || %d <= 0\n",
|
printf ("%d >= %d || %d <= 0 || %d >= %d || %d <= 0\n",
|
||||||
dst_XMin, img->getWidth(), dst_XMax, dst_YMin, img->getHeight(), dst_YMax);
|
dst_XMin, img->getWidth(), dst_XMax, dst_YMin, img->getHeight(), dst_YMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -343,10 +351,12 @@ void ImProcFunctions::removeSpots (Imagefloat* img, const std::vector<SpotEntry>
|
|||||||
if (i2 < 0 || i2 >= img->getHeight()) {
|
if (i2 < 0 || i2 >= img->getHeight()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0, j2 = dst_XMin; j2 < dst_XMax - 1; ++j, ++j2) {
|
for (int j = 0, j2 = dst_XMin; j2 < dst_XMax - 1; ++j, ++j2) {
|
||||||
if (j2 < 0 || j2 >= img->getWidth()) {
|
if (j2 < 0 || j2 >= img->getWidth()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//float c2 = float (mask (i, j)) / 255.f;
|
//float c2 = float (mask (i, j)) / 255.f;
|
||||||
//float c1 = 1.f - c2;
|
//float c1 = 1.f - c2;
|
||||||
//resultPR->r(i,j) = (unsigned char) CLAMP0255 ( ROUND( double(first->r(i,j)) + double(secondPR->r(i,j)) ) );
|
//resultPR->r(i,j) = (unsigned char) CLAMP0255 ( ROUND( double(first->r(i,j)) + double(secondPR->r(i,j)) ) );
|
||||||
|
@@ -74,6 +74,7 @@ Spot::~Spot()
|
|||||||
delete EditSubscriber::visibleGeometry.at (i);
|
delete EditSubscriber::visibleGeometry.at (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We do not delete the mouseOverGeometry, because the referenced objects are either
|
// We do not delete the mouseOverGeometry, because the referenced objects are either
|
||||||
// shared with visibleGeometry or instantiated by the class's ctor
|
// shared with visibleGeometry or instantiated by the class's ctor
|
||||||
}
|
}
|
||||||
@@ -379,9 +380,11 @@ void Spot::deleteSelectedEntry()
|
|||||||
// delete the activeSpot
|
// delete the activeSpot
|
||||||
if (activeSpot > -1) {
|
if (activeSpot > -1) {
|
||||||
std::vector<rtengine::SpotEntry>::iterator i = spots.begin();
|
std::vector<rtengine::SpotEntry>::iterator i = spots.begin();
|
||||||
|
|
||||||
for (int j = 0; j < activeSpot; ++j) {
|
for (int j = 0; j < activeSpot; ++j) {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
spots.erase (i);
|
spots.erase (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user