Spot Removal tool
It is not working yet, but the GUI is (almost) done. See issue #2239.
This commit is contained in:
@@ -325,6 +325,23 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/** Copy the a sub-region of the data to another PlanarRGBData */
|
||||
void copyData(PlanarWhateverData<T> *dest, int x, int y, int width, int height)
|
||||
{
|
||||
assert (dest != NULL);
|
||||
// Make sure that the size is the same, reallocate if necessary
|
||||
dest->allocate(width, height);
|
||||
|
||||
if (dest->width == -1) {
|
||||
printf("ERROR: PlanarRGBData::copyData >>> allocation failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = y, j = 0; i < y + height; ++i, ++j) {
|
||||
memcpy (dest->v(i) + x, v(j), width * sizeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
void rotate (int deg)
|
||||
{
|
||||
|
||||
@@ -727,6 +744,25 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/** Copy the a sub-region of the data to another PlanarRGBData */
|
||||
void copyData(PlanarRGBData<T> *dest, int x, int y, int width, int height)
|
||||
{
|
||||
assert (dest != NULL);
|
||||
// Make sure that the size is the same, reallocate if necessary
|
||||
dest->allocate(width, height);
|
||||
|
||||
if (dest->width == -1) {
|
||||
printf("ERROR: PlanarRGBData::copyData >>> allocation failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = y, j = 0; i < y + height; ++i, ++j) {
|
||||
memcpy (dest->r(i) + x, r(j), width * sizeof(T));
|
||||
memcpy (dest->g(i) + x, g(j), width * sizeof(T));
|
||||
memcpy (dest->b(i) + x, b(j), width * sizeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
void rotate (int deg)
|
||||
{
|
||||
|
||||
@@ -1342,6 +1378,23 @@ public:
|
||||
memcpy (dest->data, data, 3 * width * height * sizeof(T));
|
||||
}
|
||||
|
||||
/** Copy the a sub-region of the data to another PlanarRGBData */
|
||||
void copyData(ChunkyRGBData<T> *dest, int x, int y, int width, int height)
|
||||
{
|
||||
assert (dest != NULL);
|
||||
// Make sure that the size is the same, reallocate if necessary
|
||||
dest->allocate(width, height);
|
||||
|
||||
if (dest->width == -1) {
|
||||
printf("ERROR: PlanarRGBData::copyData >>> allocation failed!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = y, j = 0; i < y + height; ++i, ++j) {
|
||||
memcpy (dest->r(i) + x, r(j), 3 * width * sizeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
void rotate (int deg)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user