Skip to content

Commit

Permalink
fix bbbbbr#8: GIMP 3 / GTK3 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed May 10, 2020
1 parent 7211ba0 commit 7de716b
Show file tree
Hide file tree
Showing 25 changed files with 73 additions and 25 deletions.
Empty file modified LICENSE
100755 → 100644
Empty file.
31 changes: 21 additions & 10 deletions Makefile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
# Predefined constants
CC = gcc
TARGET = plugin-pixel-art-scalers
TARGETLIB = libpas.a
SRC_DIR = src
OBJ_DIR = obj
CFLAGS = $(shell pkg-config --cflags gtk+-2.0) \
$(shell pkg-config --cflags gimp-2.0)
LFLAGS = $(shell pkg-config --libs glib-2.0) \
GTKCFLAGS = $(shell pkg-config --cflags gtk+-2.0) \
$(shell pkg-config --cflags gimp-2.0)
GTKLFLAGS = $(shell pkg-config --libs glib-2.0) \
$(shell pkg-config --libs gtk+-2.0) \
$(shell pkg-config --libs gimp-2.0) \
$(shell pkg-config --libs gimpui-2.0)

# File definitions
SRC_FILES=$(wildcard $(SRC_DIR)/*.c)
OBJ_FILES=$(SRC_FILES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
LIB_SRC_FILES=$(wildcard $(SRC_DIR)/lib/*.c)
GTK_SRC_FILES=$(wildcard $(SRC_DIR)/gtk2/*.c)
LIB_OBJ_FILES=$(LIB_SRC_FILES:$(SRC_DIR)/lib/%.c=$(OBJ_DIR)/lib/%.o)
GTK_OBJ_FILES=$(GTK_SRC_FILES:$(SRC_DIR)/gtk2/%.c=$(OBJ_DIR)/gtk2/%.o)

$(TARGET): $(OBJ_DIR) $(OBJ_FILES)
$(CC) $(OBJ_FILES) -o $(TARGET) $(LFLAGS)
$(TARGET): $(OBJ_DIR) $(TARGETLIB) $(GTK_OBJ_FILES)
$(CC) $(GTK_OBJ_FILES) $(TARGETLIB) -o $(TARGET) $(GTKLFLAGS)

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) -c $< -o $@ $(CFLAGS)
$(TARGETLIB): $(OBJ_DIR) $(LIB_OBJ_FILES)
$(AR) rcs $@ $(LIB_OBJ_FILES)

$(OBJ_DIR)/lib/%.o: $(SRC_DIR)/lib/%.c
$(CC) -c $^ -o $@ $(CFLAGS)

$(OBJ_DIR)/gtk2/%.o: $(SRC_DIR)/gtk2/%.c
$(CC) -c $^ -o $@ $(GTKCFLAGS)

$(OBJ_DIR):
test -d $(OBJ_DIR) || mkdir -p $(OBJ_DIR)
test -d $(OBJ_DIR)/lib || mkdir -p $(OBJ_DIR)/lib
test -d $(OBJ_DIR)/gtk2 || mkdir -p $(OBJ_DIR)/gtk2

clean:
rm -rf $(OBJ_DIR)
rm $(TARGET)
rm $(TARGET) $(TARGETLIB)

install:
mkdir -p $(DESTDIR)$(exec_prefix)/lib/gimp/2.0/plug-ins
Expand Down
Empty file modified README.md
100755 → 100644
Empty file.
22 changes: 11 additions & 11 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ libexecdir = $(gimpplugindir)/plug-ins
libexec_PROGRAMS = plugin_pixel_art_scalers

plugin_pixel_art_scalers_SOURCES = \
filter_pixel_art_scalers.c \
filter_dialog.c \
filter_scalers.c \
filter_utils.c \
hq3x.c \
hqx_init.c \
hq2x.c \
hq4x.c \
xbr.c \
scaler_scalex.c \
scaler_nearestneighbor.c
gtk2/filter_pixel_art_scalers.c \
gtk2/filter_dialog.c \
gtk2/filter_scalers.c \
gtk2/filter_utils.c \
lib/hq3x.c \
lib/hqx_init.c \
lib/hq2x.c \
lib/hq4x.c \
lib/xbr.c \
lib/scaler_scalex.c \
lib/scaler_nearestneighbor.c



Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 1 addition & 4 deletions src/filter_scalers.c → src/gtk2/filter_scalers.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
#include "filter_scalers.h"

// Filter includes
#include "hqx.h"
#include "xbr_filters.h"
#include "scaler_scalex.h"
#include "scaler_nearestneighbor.h"
#include "../libpas.h"

static scaler_info scalers[SCALER_ENUM_LAST];
static border_info border_types[BORDER_ENUM_LAST] =
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions src/libpas.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// libpas.h
//

// ========================
//
// Pixel art scaler
//
// ========================


#ifndef __LIBPAS_H_
#define __LIBPAS_H_

#include <stdint.h>

void hqxInit(void);
void hq2x_32( uint32_t * src, uint32_t * dest, int width, int height );
void hq3x_32( uint32_t * src, uint32_t * dest, int width, int height );
void hq4x_32( uint32_t * src, uint32_t * dest, int width, int height );

void hq2x_32_rb( uint32_t * src, uint32_t src_rowBytes, uint32_t * dest, uint32_t dest_rowBytes, int width, int height );
void hq3x_32_rb( uint32_t * src, uint32_t src_rowBytes, uint32_t * dest, uint32_t dest_rowBytes, int width, int height );
void hq4x_32_rb( uint32_t * src, uint32_t src_rowBytes, uint32_t * dest, uint32_t dest_rowBytes, int width, int height );

void scaler_nearest_2x(uint32_t *, uint32_t *, int, int);
void scaler_nearest_3x(uint32_t *, uint32_t *, int, int);
void scaler_nearest_4x(uint32_t *, uint32_t *, int, int);

void scaler_scalex_2x(uint32_t *, uint32_t *, int, int);
void scaler_scalex_3x(uint32_t *, uint32_t *, int, int);
void scaler_scalex_4x(uint32_t *, uint32_t *, int, int);

void xbr_filter_xbr2x(uint32_t*, uint32_t*, int, int);
void xbr_filter_xbr3x(uint32_t*, uint32_t*, int, int);
void xbr_filter_xbr4x(uint32_t*, uint32_t*, int, int);

void xbr_init_data(void);

#endif //END __LIBPAS_H_ //

0 comments on commit 7de716b

Please sign in to comment.