Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gegl
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
106
Issues
106
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gegl
Commits
08debafb
Commit
08debafb
authored
Jan 18, 2018
by
Øyvind "pippin" Kolås
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buffer: cache downscale 2x2 dispatch functions in zoom handler
parent
a718c59f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
20 deletions
+29
-20
gegl/buffer/gegl-tile-handler-zoom.c
gegl/buffer/gegl-tile-handler-zoom.c
+7
-3
gegl/buffer/gegl-tile-handler-zoom.h
gegl/buffer/gegl-tile-handler-zoom.h
+9
-7
gegl/gegl-algorithms.c
gegl/gegl-algorithms.c
+3
-10
gegl/gegl-algorithms.h
gegl/gegl-algorithms.h
+10
-0
No files found.
gegl/buffer/gegl-tile-handler-zoom.c
View file @
08debafb
...
...
@@ -60,7 +60,8 @@ static inline void set_blank (GeglTile *dst_tile,
}
}
static
inline
void
set_half
(
GeglTile
*
dst_tile
,
static
inline
void
set_half
(
GeglTileHandlerZoom
*
zoom
,
GeglTile
*
dst_tile
,
GeglTile
*
src_tile
,
gint
width
,
gint
height
,
...
...
@@ -75,7 +76,10 @@ static inline void set_half (GeglTile * dst_tile,
if
(
i
)
dst_data
+=
bpp
*
width
/
2
;
if
(
j
)
dst_data
+=
bpp
*
width
*
height
/
2
;
gegl_downscale_2x2
(
format
,
width
,
height
,
src_data
,
width
*
bpp
,
dst_data
,
width
*
bpp
);
if
(
!
zoom
->
downscale_2x2
)
zoom
->
downscale_2x2
=
gegl_downscale_2x2_get_fun
(
format
);
zoom
->
downscale_2x2
(
format
,
width
,
height
,
src_data
,
width
*
bpp
,
dst_data
,
width
*
bpp
);
}
static
GeglTile
*
...
...
@@ -139,7 +143,7 @@ get_tile (GeglTileSource *gegl_tile_source,
{
if
(
source_tile
[
i
][
j
])
{
set_half
(
tile
,
source_tile
[
i
][
j
],
tile_width
,
tile_height
,
format
,
i
,
j
);
set_half
(
zoom
,
tile
,
source_tile
[
i
][
j
],
tile_width
,
tile_height
,
format
,
i
,
j
);
gegl_tile_unref
(
source_tile
[
i
][
j
]);
}
else
...
...
gegl/buffer/gegl-tile-handler-zoom.h
View file @
08debafb
...
...
@@ -39,18 +39,20 @@ G_BEGIN_DECLS
typedef
struct
_GeglTileHandlerZoom
GeglTileHandlerZoom
;
typedef
struct
_GeglTileHandlerZoomClass
GeglTileHandlerZoomClass
;
struct
_GeglTileHandlerZoom
{
GeglTileHandler
parent_instance
;
GeglTileBackend
*
backend
;
GeglTileStorage
*
tile_storage
;
void
(
*
downscale_2x2
)
(
gint
bpp
,
typedef
void
(
*
GeglDownscale2x2Fun
)
(
const
Babl
*
format
,
gint
src_width
,
gint
dst_dst_width
,
gint
src_height
,
guchar
*
src_data
,
gint
src_rowstride
,
guchar
*
dst_data
,
gint
dst_rowstride
);
struct
_GeglTileHandlerZoom
{
GeglTileHandler
parent_instance
;
GeglTileBackend
*
backend
;
GeglTileStorage
*
tile_storage
;
GeglDownscale2x2Fun
downscale_2x2
;
};
struct
_GeglTileHandlerZoomClass
...
...
gegl/gegl-algorithms.c
View file @
08debafb
...
...
@@ -41,15 +41,8 @@ gegl_downscale_2x2_generic (const Babl *format,
guchar
*
dst_data
,
gint
dst_rowstride
);
typedef
void
(
*
GeglDownscale2x2Fun
)
(
const
Babl
*
format
,
gint
src_width
,
gint
src_height
,
guchar
*
src_data
,
gint
src_rowstride
,
guchar
*
dst_data
,
gint
dst_rowstride
);
static
GeglDownscale2x2Fun
gegl_downscale_2x2_get_fun
(
const
Babl
*
format
)
GeglDownscale2x2Fun
gegl_downscale_2x2_get_fun
(
const
Babl
*
format
)
{
const
Babl
*
comp_type
=
babl_format_get_type
(
format
,
0
);
const
Babl
*
model
=
babl_format_get_model
(
format
);
...
...
@@ -90,7 +83,7 @@ void gegl_downscale_2x2 (const Babl *format,
{
gegl_downscale_2x2_get_fun
(
format
)(
format
,
src_width
,
src_height
,
src_data
,
src_rowstride
,
src
_data
,
dst_rowstride
);;
dst
_data
,
dst_rowstride
);;
}
#include <stdio.h>
...
...
gegl/gegl-algorithms.h
View file @
08debafb
...
...
@@ -31,6 +31,7 @@ void gegl_downscale_2x2 (const Babl *format,
guchar
*
dst_data
,
gint
dst_rowstride
);
void
gegl_downscale_2x2_double
(
const
Babl
*
format
,
gint
src_width
,
gint
src_height
,
...
...
@@ -47,6 +48,14 @@ void gegl_downscale_2x2_float (const Babl *format,
guchar
*
dst_data
,
gint
dst_rowstride
);
typedef
void
(
*
GeglDownscale2x2Fun
)
(
const
Babl
*
format
,
gint
src_width
,
gint
src_height
,
guchar
*
src_data
,
gint
src_rowstride
,
guchar
*
dst_data
,
gint
dst_rowstride
);
void
gegl_downscale_2x2_u32
(
const
Babl
*
format
,
gint
src_width
,
gint
src_height
,
...
...
@@ -203,6 +212,7 @@ void gegl_resample_nearest (guchar *dst,
gint
bpp
,
gint
dst_stride
);
GeglDownscale2x2Fun
gegl_downscale_2x2_get_fun
(
const
Babl
*
format
);
G_END_DECLS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment