[gegl] remove dead code
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] remove dead code
- Date: Fri, 28 Jun 2019 13:55:34 +0000 (UTC)
commit e75de671e64d0b2f30618f198cfba5a5323dbe85
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Jun 26 20:05:51 2019 +0200
remove dead code
operations/workshop/enlarge.c | 4 ++--
operations/workshop/pixel-duster.h | 41 ++++----------------------------------
2 files changed, 6 insertions(+), 39 deletions(-)
---
diff --git a/operations/workshop/enlarge.c b/operations/workshop/enlarge.c
index d6ba55544..1176af4e3 100644
--- a/operations/workshop/enlarge.c
+++ b/operations/workshop/enlarge.c
@@ -333,9 +333,9 @@ gegl_op_class_init (GeglOpClass *klass)
gegl_operation_class_set_keys (operation_class,
"name", "gegl:enlarge",
- "title", "Smart enlarge",
+ "title", "Smart resize",
"categories", "heal",
- "description", "Enlarges an images based on pixel contents",
+ "description", "scales an image with cubic, remove half in a checker board, guesses blank pixels,
removes other checkerboard half and guesses blank pixels again.",
NULL);
}
diff --git a/operations/workshop/pixel-duster.h b/operations/workshop/pixel-duster.h
index dd78d7dfe..b63aec9c5 100644
--- a/operations/workshop/pixel-duster.h
+++ b/operations/workshop/pixel-duster.h
@@ -81,6 +81,10 @@ typedef struct
#define PIXDUST_ORDERED 1
#define MAX_DIR 4
+// safe to leave always on since only really used when epplies
+#define PIXDUST_DIR_INVARIANT 1
+
+
//#define ONLY_DIR 1
typedef struct Probe {
@@ -305,7 +309,6 @@ static void extract_site (PixelDuster *duster, GeglBuffer *input, double x, doub
format = babl_format ("R'G'B'A u8");
}
-#define PIXDUST_DIR_INVARIANT 1
#if PIXDUST_DIR_INVARIANT==1
/* figure out which of the up/down/left/right pixels are brightest,
using premultiplied alpha - do punish blank spots */
@@ -542,41 +545,6 @@ spread_relative (PixelDuster *duster, Probe *probe, int dx, int dy)
}
#endif
-static int site_subset (guchar *site)
-{
- int a = (site[4 + 1]/16) +
- (site[8 + 1]/16) * 16 +
- (site[12 + 1]/16) * 16 * 16;
- return a;
-}
-
-static void site_subset2 (guchar *site, gint *min, gint *max)
-{
- int v[3] = {(site[4 + 1]/4), (site[8 + 1]/4), (site[12 + 1]/4)};
- for (int i = 0; i < 3; i ++)
- {
- if (site[(4 + 4 *i)+3] == 0)
- {
- min[i] = 0;
- max[i] = 15;
- }
- else
- {
- switch (v[i] % 4)
- {
- case 0: min[i] = v[i]/4-1; max[i] = v[i]/4;
- if (min[i] < 0) min[i] = 0;
- break;
- case 1: min[i] = v[i]/4; max[i] = v[i]/4; break;
- case 2: min[i] = v[i]/4; max[i] = v[i]/4; break;
- case 3: min[i] = v[i]/4; max[i] = v[i]/4+1;
- if (max[i] > 15) max[i] = 15;
- break;
- }
- }
- }
-}
-
static void inline compare_needle_exact (gpointer key, gpointer value, gpointer data)
{
void **ptr = data;
@@ -612,7 +580,6 @@ static guchar *ensure_hay (PixelDuster *duster, int x, int y, int subset)
extract_site (duster, duster->input, x, y, 1.0, hay);
if (subset < 0)
{
- subset = site_subset (hay);
if (hay[3] == 0)
{
g_free (hay);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]