Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GIMP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2,644
Issues
2,644
List
Boards
Labels
Service Desk
Milestones
Merge Requests
36
Merge Requests
36
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
GIMP
Commits
2056042e
Commit
2056042e
authored
Oct 25, 2010
by
Martin Nordholts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app/tests: Add gimp_test_utils_create_image()
parent
9e6f5000
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
4 deletions
+61
-4
app/tests/gimp-app-test-utils.c
app/tests/gimp-app-test-utils.c
+55
-1
app/tests/gimp-app-test-utils.h
app/tests/gimp-app-test-utils.h
+6
-3
No files found.
app/tests/gimp-app-test-utils.c
View file @
2056042e
...
...
@@ -15,7 +15,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h>
#include "config.h"
#include <gegl.h>
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "gimp-app-test-utils.h"
...
...
@@ -77,3 +85,49 @@ gimp_test_utils_setup_menus_dir (void)
"menus"
/*subdir*/
,
"GIMP_TESTING_MENUS_DIR"
/*target_env_var*/
);
}
/**
* gimp_test_utils_create_image:
* @gimp: A #Gimp instance.
* @width: Width of image (and layer)
* @height: Height of image (and layer)
*
* Creates a new image of a given size with one layer of same size and
* a display.
*
* Returns: The new #GimpImage.
**/
GimpImage
*
gimp_test_utils_create_image
(
Gimp
*
gimp
,
gint
width
,
gint
height
)
{
GimpImage
*
image
;
GimpLayer
*
layer
;
image
=
gimp_image_new
(
gimp
,
width
,
height
,
GIMP_RGB
);
layer
=
gimp_layer_new
(
image
,
width
,
height
,
GIMP_RGBA_IMAGE
,
"layer1"
,
1
.
0
,
GIMP_NORMAL_MODE
);
gimp_image_add_layer
(
image
,
layer
,
NULL
/*parent*/
,
0
/*position*/
,
FALSE
/*push_undo*/
);
gimp_create_display
(
gimp
,
image
,
GIMP_UNIT_PIXEL
,
1
.
0
/*scale*/
);
return
image
;
}
app/tests/gimp-app-test-utils.h
View file @
2056042e
...
...
@@ -19,9 +19,12 @@
#define __GIMP_RECTANGLE_SELECT_TOOL_H__
void
gimp_test_utils_set_gimp2_directory
(
const
gchar
*
root_env_var
,
const
gchar
*
subdir
);
void
gimp_test_utils_setup_menus_dir
(
void
);
void
gimp_test_utils_set_gimp2_directory
(
const
gchar
*
root_env_var
,
const
gchar
*
subdir
);
void
gimp_test_utils_setup_menus_dir
(
void
);
GimpImage
*
gimp_test_utils_create_image
(
Gimp
*
gimp
,
gint
width
,
gint
height
);
#endif
/* __GIMP_RECTANGLE_SELECT_TOOL_H__ */
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