This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 5a637f76e46988a072403ed95db859f61e12193c (commit) via 4be253c7c450ff945dc6a032161d85a49c985989 (commit) via db44ff814ac02e9d8eff0e6069e75e3a49b86922 (commit) from 2da60240b7ffcf3d81eb0c303a1f363fc6ea2732 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/5a637f76e46988a072403ed95db859f61e121...
commit 5a637f76e46988a072403ed95db859f61e12193c Author: Cyril Hrubis metan@ucw.cz Date: Tue Oct 1 22:08:39 2013 +0200
filters: Add missing header for edge detection filters.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/v4l2_show.c b/demos/c_simple/v4l2_show.c index c564f95..f11fb83 100644 --- a/demos/c_simple/v4l2_show.c +++ b/demos/c_simple/v4l2_show.c @@ -103,8 +103,8 @@ int main(int argc, char *argv[]) res = img; break; case 1: - GP_FilterEdgePrewitt(img, &res, NULL, NULL); - // GP_FilterEdgeSobel(img, &res, NULL, NULL); + // GP_FilterEdgePrewitt(img, &res, NULL, NULL); + GP_FilterEdgeSobel(img, &res, NULL, NULL); break; case 2: GP_FilterGaussianBlur(img, img, 1, 1, NULL); diff --git a/include/filters/GP_Filters.h b/include/filters/GP_EdgeDetection.h similarity index 51% copy from include/filters/GP_Filters.h copy to include/filters/GP_EdgeDetection.h index 621d232..94adc6e 100644 --- a/include/filters/GP_Filters.h +++ b/include/filters/GP_EdgeDetection.h @@ -16,68 +16,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-/* - - GP_Context filters. - - */ - -#ifndef FILTERS_GP_FILTERS_H -#define FILTERS_GP_FILTERS_H - -/* Filter per channel parameter passing interface */ -#include "filters/GP_FilterParam.h" - -/* Point filters, brightness, contrast ... */ -#include "filters/GP_Point.h" - -/* Addition, difference, min, max ... */ -#include "filters/GP_Arithmetic.h" - -/* Histograms, ... */ -#include "filters/GP_Stats.h" - -/* Image rotations (90 180 270 grads) and mirroring */ -#include "filters/GP_Rotate.h" - -/* Linear convolution Raw API */ -#include "filters/GP_Linear.h" - -/* Convolution filters */ -#include "filters/GP_Convolution.h" - -/* Blur filters */ -#include "filters/GP_Blur.h" - -/* Image scaling (resampling) */ -#include "filters/GP_Resize.h" -#include "filters/GP_ResizeNN.h" -#include "filters/GP_ResizeLinear.h" -#include "filters/GP_ResizeCubic.h" - -/* Bitmap dithering */ -#include "filters/GP_Dither.h" - -/* Laplace based filters */ -#include "filters/GP_Laplace.h" +#ifndef FILTERS_GP_EDGE_DETECTION_H +#define FILTERS_GP_EDGE_DETECTION_H
-/* Median filter */ -#include "filters/GP_Median.h" +#include "GP_Filter.h"
-/* Weighted Median filter */ -#include "filters/GP_WeightedMedian.h" +int GP_FilterEdgeSobel(const GP_Context *src, + GP_Context **E, GP_Context **Phi, + GP_ProgressCallback *callback);
-/* Sigma Mean filter */ -#include "filters/GP_Sigma.h" +int GP_FilterEdgePrewitt(const GP_Context *src, + GP_Context **E, GP_Context **Phi, + GP_ProgressCallback *callback);
-/* Gaussian noise filter */ -#include "filters/GP_GaussianNoise.h"
-#endif /* FILTERS_GP_FILTERS_H */ +#endif /* FILTERS_GP_EDGE_DETECTION_H */ diff --git a/include/filters/GP_Filters.h b/include/filters/GP_Filters.h index 621d232..0a6b4d9 100644 --- a/include/filters/GP_Filters.h +++ b/include/filters/GP_Filters.h @@ -56,6 +56,9 @@ /* Blur filters */ #include "filters/GP_Blur.h"
+/* Edge detection filters */ +#include "filters/GP_EdgeDetection.h" + /* Image scaling (resampling) */ #include "filters/GP_Resize.h" #include "filters/GP_ResizeNN.h" diff --git a/libs/filters/GP_Edge.c b/libs/filters/GP_Edge.c index 7d55077..01cc811 100644 --- a/libs/filters/GP_Edge.c +++ b/libs/filters/GP_Edge.c @@ -25,7 +25,8 @@ #include "core/GP_Debug.h" #include "core/GP_GetPutPixel.h"
-#include "GP_Linear.h" +#include "filters/GP_Linear.h" +#include "filters/GP_EdgeDetection.h"
/* * Apply prewitt operator.
http://repo.or.cz/w/gfxprim.git/commit/4be253c7c450ff945dc6a032161d85a49c985...
commit 4be253c7c450ff945dc6a032161d85a49c985989 Author: Cyril Hrubis metan@ucw.cz Date: Mon Sep 30 00:41:04 2013 +0200
filters; Blur: Fix 'assigment discards 'const' warning'.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/filters/GP_Blur.c b/libs/filters/GP_Blur.c index 51155cf..147d675 100644 --- a/libs/filters/GP_Blur.c +++ b/libs/filters/GP_Blur.c @@ -79,7 +79,7 @@ int GP_FilterGaussianBlur_Raw(const GP_Context *src, { unsigned int size_x = gaussian_kernel_size(x_sigma); unsigned int size_y = gaussian_kernel_size(y_sigma); - GP_Context *tmp = dst; + const GP_Context *tmp = dst;
GP_DEBUG(1, "Gaussian blur x_sigma=%2.3f y_sigma=%2.3f kernel %ix%i image %ux%u", x_sigma, y_sigma, size_x, size_y, w_src, h_src);
http://repo.or.cz/w/gfxprim.git/commit/db44ff814ac02e9d8eff0e6069e75e3a49b86...
commit db44ff814ac02e9d8eff0e6069e75e3a49b86922 Author: Cyril Hrubis metan@ucw.cz Date: Mon Sep 30 00:33:17 2013 +0200
core: include: Whitespace fixes.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/gfxprim_config.py b/gfxprim_config.py index ae32019..4dcba55 100644 --- a/gfxprim_config.py +++ b/gfxprim_config.py @@ -1,7 +1,7 @@ # # gfxprim_config.py - module configuring GfxPrim code generation and # known PixelTypes -# +#
# # 2011 Tomas Gavenciak gavento@ucw.cz @@ -9,7 +9,7 @@ # # This file is sourced by all the generating scripts. # Moreover, the generated files are sourced by almost all Gfxprim sources, -# so a complete recompilation is required after any change. +# so a complete recompilation is required after any change. #
# Declared pixel sizes: @@ -38,7 +38,7 @@ config = GfxPrimConfig( PS_18BPP_LE, ],
- # List of PixelTypes, order defines the numbering. + # List of PixelTypes, order defines the numbering. # The "Undefined" type is added automatically. pixeltypes = [
@@ -60,17 +60,17 @@ config = GfxPrimConfig( ('R', 16, 8), ('G', 8, 8), ('B', 0, 8)]), - + PixelType(name='BGR888', pixelsize=PS_24BPP, chanslist=[ ('B', 16, 8), ('G', 8, 8), ('R', 0, 8)]), - + PixelType(name='RGB555', pixelsize=PS_16BPP, chanslist=[ ('R', 10, 5), ('G', 5, 5), ('B', 0, 5)]), - + PixelType(name='RGB565', pixelsize=PS_16BPP, chanslist=[ ('R', 11, 5), ('G', 5, 6), @@ -116,7 +116,7 @@ config = GfxPrimConfig(
PixelType(name='G8', pixelsize=PS_8BPP, chanslist=[ ('V', 0, 8)]), - + PixelType(name='G16', pixelsize=PS_16BPP, chanslist=[ ('V', 0, 16)]), ] diff --git a/include/core/GP_Convert.gen.h.t b/include/core/GP_Convert.gen.h.t index 22a3795..b59990a 100644 --- a/include/core/GP_Convert.gen.h.t +++ b/include/core/GP_Convert.gen.h.t @@ -56,46 +56,46 @@ %% if pt1.is_rgb() and pt2.is_cmyk() {{ rgb_to_cmyk(pt1, pt2) -}} %% else -%% for c2 in pt2.chanslist +%% for c2 in pt2.chanslist {# case 1: just copy a channel -#} -%% if c2[0] in pt1.chans.keys() -%% set c1 = pt1.chans[c2[0]] +%% if c2[0] in pt1.chans.keys() +%% set c1 = pt1.chans[c2[0]] /* {{ c2[0] }}:={{ c1[0] }} */ GP_SET_BITS({{ c2.off }}+o2, {{ c2.size }}, p2, GP_SCALE_VAL_{{ c1.size }}_{{ c2.size }}(GP_GET_BITS({{ c1.off }}+o1, {{ c1.size }}, p1))); {# case 2: set A to full opacity (not present in source) -#} -%% elif c2[0]=='A' +%% elif c2[0]=='A' /* A:={{ c2.C_max }} */GP_SET_BITS({{ c2.off }}+o2, {{ c2.size }}, p2, {{ c2.C_max }}); {# case 3: calculate V as average of RGB -#} -%% elif c2[0]=='V' and pt1.is_rgb() +%% elif c2[0]=='V' and pt1.is_rgb() /* V:=RGB_avg */ GP_SET_BITS({{ c2.off }}+o2, {{ c2.size }}, p2, ( -%% for c1 in [pt1.chans['R'], pt1.chans['G'], pt1.chans['B']] +%% for c1 in [pt1.chans['R'], pt1.chans['G'], pt1.chans['B']] /* {{ c1.name }} */ GP_SCALE_VAL_{{ c1.size }}_{{ c2.size }}(GP_GET_BITS({{ c1.off }}+o1, {{ c1.size }}, p1)) + -%% endfor +%% endfor 0)/3); {# case 4: set each RGB to V -#} -%% elif c2[0] in 'RGB' and pt1.is_gray() -%% set c1 = pt1.chans['V'] +%% elif c2[0] in 'RGB' and pt1.is_gray() +%% set c1 = pt1.chans['V'] /* {{ c2[0] }}:=V */ GP_SET_BITS({{ c2.off }}+o2, {{ c2.size }}, p2, GP_SCALE_VAL_{{ c1.size }}_{{ c2.size }}(GP_GET_BITS({{ c1.off }}+o1, {{ c1.size }}, p1))); {# case 5: CMYK to RGB -#} -%% elif c2[0] in 'RGB' and pt1.is_cmyk() -%% set K = pt1.chans['K'] +%% elif c2[0] in 'RGB' and pt1.is_cmyk() +%% set K = pt1.chans['K'] {# Get the right channel -#} -%% if c2[0] == 'R' -%% set V = pt1.chans['C'] -%% elif c2[0] == 'G' -%% set V = pt1.chans['M'] -%% else -%% set V = pt1.chans['Y'] -%% endif +%% if c2[0] == 'R' +%% set V = pt1.chans['C'] +%% elif c2[0] == 'G' +%% set V = pt1.chans['M'] +%% else +%% set V = pt1.chans['Y'] +%% endif GP_SET_BITS({{ c2.off }}+o2, {{ c2.size }}, p2, (({{ c2.C_max }} * ({{ K.C_max }} - GP_GET_BITS({{ K.off }}+o1, {{ K.size }}, p1)) * ({{ V.C_max }} - GP_GET_BITS({{ V.off }}+o1, {{ V.size }}, p1)))) / ({{ K.C_max }} * {{ V.C_max }})); {# case 7: invalid mapping -#} -%% else +%% else {{ error('Channel conversion ' + pt1.name + ' to ' + pt2.name + ' not supported.') }} -%% endif -%% endfor +%% endif +%% endfor %% endif } while (0)
@@ -115,24 +115,22 @@ # Loop around "central" pixel types -#} %% for pt in [pixeltypes_dict['RGB888'], pixeltypes_dict['RGBA8888']] -%% for i in pixeltypes -%% if not i.is_unknown() -%% if not i.is_palette() +%% for i in pixeltypes +%% if not i.is_unknown() and not i.is_palette() {{ GP_Pixel_TYPE_TO_TYPE(pt, i) }} -%% if i.name not in ['RGB888', 'RGBA8888'] +%% if i.name not in ['RGB888', 'RGBA8888'] {{ GP_Pixel_TYPE_TO_TYPE(i, pt) }} -%% endif -%% endif -%% endif -%% endfor +%% endif +%% endif +%% endfor
-/* +/* * Convert {{ pt.name }} to any other PixelType * Does not work on palette types at all (yet) */ GP_Pixel GP_{{ pt.name }}ToPixel(GP_Pixel pixel, GP_PixelType type);
-/* +/* * Function converting to {{ pt.name }} from any other PixelType * Does not work on palette types at all (yet) */ diff --git a/include/core/GP_Convert_Scale.gen.h.t b/include/core/GP_Convert_Scale.gen.h.t index 497fea7..b0156ad 100644 --- a/include/core/GP_Convert_Scale.gen.h.t +++ b/include/core/GP_Convert_Scale.gen.h.t @@ -30,7 +30,7 @@ {%- endmacro %}
%% block body -/* +/* * Helper macros to transfer s1-bit value to s2-bit value. * Efficient and accurate for both up- and downscaling. * WARNING: GP_SCALE_VAL requires constants numbers as first two parameters diff --git a/include/core/GP_FnPerBpp.gen.h.t b/include/core/GP_FnPerBpp.gen.h.t index 11d5002..9b1cdcd 100644 --- a/include/core/GP_FnPerBpp.gen.h.t +++ b/include/core/GP_FnPerBpp.gen.h.t @@ -37,7 +37,7 @@ {% macro bpp_suffix(suffix) %}{% if suffix == "LE" or suffix == "BE" %}_{{ suffix }}{% endif %}{% endmacro %}
/* - * Branch on bpp and bit_endian. + * Branch on bpp and bit_endian. */ #define GP_FN_PER_BPP(FN_NAME, bpp, bit_endian, ...) switch (bpp) { @@ -56,7 +56,7 @@ }
/* - * Branch on bpp and bit_endian. + * Branch on bpp and bit_endian. */ #define GP_FN_RET_PER_BPP(FN_NAME, bpp, bit_endian, ...) switch (bpp) { diff --git a/include/core/GP_GetPutPixel.gen.h.t b/include/core/GP_GetPutPixel.gen.h.t index 46325db..28ee82d 100644 --- a/include/core/GP_GetPutPixel.gen.h.t +++ b/include/core/GP_GetPutPixel.gen.h.t @@ -64,7 +64,7 @@ Do not include directly, use GP_Pixel.h If pixel_size is coprime to 8, the offsets generates whole group and so the max + pixel_size = 7 + pixel_size. The 17 BPP fits into 24 bits and so 3 bytes are needed. The 19 BPP fits into 26 bits and because of that 4 bytes - are needed. + are needed.
Once we figure maximal number of bytes and the offset all that is to be done is to fetch first and last byte to combine it together with given pixel value @@ -76,7 +76,7 @@ Do not include directly, use GP_Pixel.h #include "GP_Context.h"
%% for ps in pixelsizes -/* +/* * macro to get address of pixel in a {{ ps.suffix }} context */ #define GP_PIXEL_ADDR_{{ ps.suffix }}(context, x, y) @@ -105,7 +105,7 @@ Do not include directly, use GP_Pixel.h %% endif
/* - * GP_GetPixel for {{ ps.suffix }} + * GP_GetPixel for {{ ps.suffix }} */ static inline GP_Pixel GP_GetPixel_Raw_{{ ps.suffix }}(const GP_Context *c, int x, int y) { @@ -180,7 +180,7 @@ static inline GP_Pixel GP_GetPixel_Raw_{{ ps.suffix }}(const GP_Context *c, int }
/* - * GP_PutPixel for {{ ps.suffix }} + * GP_PutPixel for {{ ps.suffix }} */ static inline void GP_PutPixel_Raw_{{ ps.suffix }}(GP_Context *c, int x, int y, GP_Pixel p) { diff --git a/include/core/GP_GetSetBits.h b/include/core/GP_GetSetBits.h index 1cd1e36..1a18d8a 100644 --- a/include/core/GP_GetSetBits.h +++ b/include/core/GP_GetSetBits.h @@ -49,7 +49,7 @@ */ #define GP_GET_BITS(offset, len, val) (sizeof(val) * 8 <= len ? - (val)>>(offset) : + (val)>>(offset) : ((val)>>(offset)) & (((((typeof(val))1)<<(len)) - 1)))
/* diff --git a/include/core/GP_MixPixels.gen.h.t b/include/core/GP_MixPixels.gen.h.t index 41e9c3a..8067f4b 100644 --- a/include/core/GP_MixPixels.gen.h.t +++ b/include/core/GP_MixPixels.gen.h.t @@ -34,7 +34,7 @@ Macros to mix two pixels accordingly to percentage. #include "core/GP_GammaCorrection.h"
%% for pt in pixeltypes -%% if not pt.is_unknown() +%% if not pt.is_unknown()
/* * Mixes two {{ pt.name }} pixels. @@ -42,14 +42,14 @@ Macros to mix two pixels accordingly to percentage. * The percentage is expected as 8 bit unsigned integer [0 .. 255] */ #define GP_MIX_PIXELS_LINEAR_{{ pt.name }}(pix1, pix2, perc) ({ -%% for c in pt.chanslist +%% for c in pt.chanslist GP_Pixel {{ c[0] }}; {{ c[0] }} = GP_Pixel_GET_{{ c[0] }}_{{ pt.name }}(pix1) * (perc); {{ c[0] }} += GP_Pixel_GET_{{ c[0] }}_{{ pt.name }}(pix2) * (255 - (perc)); {{ c[0] }} = ({{ c[0] }} + 128) / 255; -%% endfor +%% endfor GP_Pixel_CREATE_{{ pt.name }}({{ pt.chanslist[0][0] }}{% for c in pt.chanslist[1:] %}, {{ c[0] }}{% endfor %}); }) @@ -60,7 +60,7 @@ Macros to mix two pixels accordingly to percentage. * The percentage is expected as 8 bit unsigned integer [0 .. 255] */ #define GP_MIX_PIXELS_GAMMA_{{ pt.name }}(pix1, pix2, perc) ({ -%% for c in pt.chanslist +%% for c in pt.chanslist GP_Pixel {{ c[0] }}; {{ c[0] }} = GP_Gamma{{ c[2] }}ToLinear10(GP_Pixel_GET_{{ c[0] }}_{{ pt.name }}(pix1)) * (perc); @@ -68,19 +68,19 @@ Macros to mix two pixels accordingly to percentage. {{ c[0] }} = ({{ c[0] }} + 128) / 255; {{ c[0] }} = GP_Linear10ToGamma{{ c[2] }}({{ c[0] }}); -%% endfor +%% endfor GP_Pixel_CREATE_{{ pt.name }}({{ pt.chanslist[0][0] }}{% for c in pt.chanslist[1:] %}, {{ c[0] }}{% endfor %}); })
#define GP_MIX_PIXELS_{{ pt.name }}(pix1, pix2, perc) -%% if pt.is_rgb() +%% if pt.is_rgb() GP_MIX_PIXELS_GAMMA_{{ pt.name }}(pix1, pix2, perc) -%% else +%% else GP_MIX_PIXELS_LINEAR_{{ pt.name }}(pix1, pix2, perc) -%% endif +%% endif
-%% endif +%% endif %% endfor
static inline GP_Pixel GP_MixPixels(GP_Pixel pix1, GP_Pixel pix2, @@ -88,10 +88,10 @@ static inline GP_Pixel GP_MixPixels(GP_Pixel pix1, GP_Pixel pix2, { switch (pixel_type) { %% for pt in pixeltypes -%% if not pt.is_unknown() +%% if not pt.is_unknown() case GP_PIXEL_{{ pt.name }}: return GP_MIX_PIXELS_LINEAR_{{ pt.name }}(pix1, pix2, perc); -%% endif +%% endif %% endfor default: GP_ABORT("Unknown pixeltype"); @@ -100,7 +100,7 @@ static inline GP_Pixel GP_MixPixels(GP_Pixel pix1, GP_Pixel pix2,
%% for pt in pixeltypes -%% if not pt.is_unknown() +%% if not pt.is_unknown() static inline void GP_MixPixel_Raw_{{ pt.name }}(GP_Context *context, GP_Coord x, GP_Coord y, GP_Pixel pixel, uint8_t perc) { @@ -109,11 +109,11 @@ static inline void GP_MixPixel_Raw_{{ pt.name }}(GP_Context *context, GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(context, x, y, pix); }
-%% endif +%% endif %% endfor
%% for pt in pixeltypes -%% if not pt.is_unknown() +%% if not pt.is_unknown() static inline void GP_MixPixel_Raw_Clipped_{{ pt.name }}(GP_Context *context, GP_Coord x, GP_Coord y, GP_Pixel pixel, uint8_t perc) { @@ -123,7 +123,7 @@ static inline void GP_MixPixel_Raw_Clipped_{{ pt.name }}(GP_Context *context, GP_MixPixel_Raw_{{ pt.name }}(context, x, y, pixel, perc); }
-%% endif +%% endif %% endfor
static inline void GP_MixPixel_Raw(GP_Context *context, GP_Coord x, GP_Coord y, @@ -131,11 +131,11 @@ static inline void GP_MixPixel_Raw(GP_Context *context, GP_Coord x, GP_Coord y, { switch (context->pixel_type) { %% for pt in pixeltypes -%% if not pt.is_unknown() +%% if not pt.is_unknown() case GP_PIXEL_{{ pt.name }}: - GP_MixPixel_Raw_{{ pt.name }}(context, x, y, pixel, perc); + GP_MixPixel_Raw_{{ pt.name }}(context, x, y, pixel, perc); break; -%% endif +%% endif %% endfor default: GP_ABORT("Unknown pixeltype"); @@ -148,11 +148,11 @@ static inline void GP_MixPixel_Raw_Clipped(GP_Context *context, { switch (context->pixel_type) { %% for pt in pixeltypes -%% if not pt.is_unknown() +%% if not pt.is_unknown() case GP_PIXEL_{{ pt.name }}: GP_MixPixel_Raw_Clipped_{{ pt.name }}(context, x, y, pixel, perc); break; -%% endif +%% endif %% endfor default: GP_ABORT("Unknown pixeltype"); diff --git a/include/core/GP_MixPixels2.gen.h.t b/include/core/GP_MixPixels2.gen.h.t index 5810a66..084ae55 100644 --- a/include/core/GP_MixPixels2.gen.h.t +++ b/include/core/GP_MixPixels2.gen.h.t @@ -56,7 +56,7 @@ static inline GP_Pixel GP_MixPixels_{{ src.name }}_{{ dst.name }}(GP_Pixel src, sr = GP_Pixel_GET_R_RGB888(src_rgb); sg = GP_Pixel_GET_G_RGB888(src_rgb); sb = GP_Pixel_GET_B_RGB888(src_rgb); - + dr = GP_Pixel_GET_R_RGB888(dst_rgb); dg = GP_Pixel_GET_G_RGB888(dst_rgb); db = GP_Pixel_GET_B_RGB888(dst_rgb); diff --git a/include/core/GP_Pixel.gen.h.t b/include/core/GP_Pixel.gen.h.t index e0c0a61..2bc5469 100644 --- a/include/core/GP_Pixel.gen.h.t +++ b/include/core/GP_Pixel.gen.h.t @@ -30,8 +30,8 @@ Do not include directly, use GP_Pixel.h
%% block body
-/* - * List of all known pixel types +/* + * List of all known pixel types */ typedef enum GP_PixelType { %% for pt in pixeltypes @@ -45,24 +45,24 @@ typedef enum GP_PixelType { %% endfor
%% for pt in pixeltypes -%% if not pt.is_unknown() +%% if not pt.is_unknown() /* Automatically generated code for pixel type {{ pt.name }} * * Size (bpp): {{ pt.pixelsize.size }} ({{ pt.pixelsize.suffix }}) * Bit endian: {{ pt.pixelsize.bit_endian_const }} * Pixel structure: {{ pt.bits|join("") }} - * Channels: -%% for c in pt.chanslist + * Channels: +%% for c in pt.chanslist * {{ c[0] }} offset:{{ c[1] }} size:{{ c[2] }} -%% endfor +%% endfor */
/* * macros to get channels of pixel type {{ pt.name }} */ -%% for c in pt.chanslist +%% for c in pt.chanslist #define GP_Pixel_GET_{{ c[0] }}_{{ pt.name }}(p) (GP_GET_BITS({{ c[1] }}, {{ c[2] }}, (p))) -%% endfor +%% endfor
/* * macros to get address and bit-offset of a pixel {{ pt.name }} in a context @@ -70,33 +70,33 @@ typedef enum GP_PixelType { #define GP_PIXEL_ADDR_{{ pt.name }}(context, x, y) GP_PIXEL_ADDR_{{ pt.pixelsize.suffix }}(context, x, y) #define GP_PIXEL_ADDR_OFFSET_{{ pt.name }}(x) GP_PIXEL_ADDR_OFFSET_{{ pt.pixelsize.suffix }}(x)
-/* +/* * macros to create GP_Pixel of pixel type {{ pt.name }} directly from given values. * The values MUST be already clipped/converted to relevant value ranges. */ #define GP_Pixel_CREATE_{{ pt.name }}({{ pt.chanslist[0][0] }}{% for c in pt.chanslist[1:] %}, {{ c[0] }}{% endfor %}) (0-%% for c in pt.chanslist +%% for c in pt.chanslist + (({{ c[0] }}) << {{ c[1] }}) -%% endfor +%% endfor )
-%% endif +%% endif %% endfor
-/* +/* * macros for branching on PixelType (similar to GP_FnPerBpp macros) */
%% for r in ['', 'return '] #define GP_FN_{% if r %}RET_{% endif %}PER_PIXELTYPE(FN_NAME, type, ...) switch (type) { -%% for pt in pixeltypes -%% if not pt.is_unknown() +%% for pt in pixeltypes +%% if not pt.is_unknown() case GP_PIXEL_{{ pt.name }}: {{ r }}FN_NAME{{'##'}}_{{ pt.name }}(__VA_ARGS__); break;-%% endif -%% endfor +%% endif +%% endfor default: GP_ABORT("Invalid PixelType %d", type); }
diff --git a/include/core/GP_WritePixel.gen.h.t b/include/core/GP_WritePixel.gen.h.t index b4ce29e..015dc7c 100644 --- a/include/core/GP_WritePixel.gen.h.t +++ b/include/core/GP_WritePixel.gen.h.t @@ -33,14 +33,14 @@ */
%% for ps in pixelsizes -%% if ps.needs_bit_endian() +%% if ps.needs_bit_endian() void GP_WritePixels_{{ ps.suffix }}(void *start, uint8_t off, size_t cnt, unsigned int val);
-%% else +%% else void GP_WritePixels_{{ ps.suffix }}(void *start, size_t cnt, unsigned int val);
-%% endif +%% endif %% endfor
{% endblock body %}
-----------------------------------------------------------------------
Summary of changes: demos/c_simple/v4l2_show.c | 4 +- gfxprim_config.py | 14 ++-- include/core/GP_Convert.gen.h.t | 60 ++++++++++---------- include/core/GP_Convert_Scale.gen.h.t | 2 +- include/core/GP_FnPerBpp.gen.h.t | 4 +- include/core/GP_GetPutPixel.gen.h.t | 8 +- include/core/GP_GetSetBits.h | 2 +- include/core/GP_MixPixels.gen.h.t | 40 +++++++------- include/core/GP_MixPixels2.gen.h.t | 2 +- include/core/GP_Pixel.gen.h.t | 34 ++++++------ include/core/GP_WritePixel.gen.h.t | 6 +- .../filters/GP_EdgeDetection.h | 26 +++----- include/filters/GP_Filters.h | 3 + libs/filters/GP_Blur.c | 2 +- libs/filters/GP_Edge.c | 3 +- 15 files changed, 103 insertions(+), 107 deletions(-) copy demos/c_simple/pretty_print.c => include/filters/GP_EdgeDetection.h (78%)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.