Octopus
gdlib.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch, M. Oliveira
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21module gdlib_oct_m
22 use iso_c_binding
23 use string_oct_m
24 implicit none
25
26 private
27#if defined(HAVE_GDLIB)
28 public :: &
34
35 interface
36 integer(c_int) function gdlib_image_sx(im) bind(c)
37 use iso_c_binding
38 implicit none
39 type(c_ptr), intent(in) :: im
40 end function gdlib_image_sx
41
42 integer(c_int) function gdlib_image_sy(im) bind(c)
43 use iso_c_binding
44 implicit none
45 type(c_ptr), intent(in) :: im
46 end function gdlib_image_sy
47
48 subroutine gdlib_image_get_pixel_rgb(im, x, y, r, g, b) bind(c)
49 use iso_c_binding
50 implicit none
51 type(c_ptr), intent(in) :: im
52 integer(c_int), intent(in) :: x, y
53 integer(c_int), intent(out) :: r, g, b
54 end subroutine gdlib_image_get_pixel_rgb
55
56 subroutine gdlib_imagedestroy(im) bind(c, name="gdImageDestroy")
57 use iso_c_binding
58 implicit none
59 type(c_ptr), value :: im
60 end subroutine gdlib_imagedestroy
61 end interface
62#endif
63
64contains
65
66#if defined(HAVE_GDLIB)
67 type(c_ptr) function gdlib_image_create_from(filename)
68 character(len=*), intent(in) :: filename
69 interface
70 type(c_ptr) function cgdlib_image_create_from(filename) bind(c, name="gdlib_image_create_from")
71 use iso_c_binding
72 implicit none
73 character(kind=c_char), intent(in) :: filename(*)
74 end function cgdlib_image_create_from
75 end interface
76
77 gdlib_image_create_from = cgdlib_image_create_from(string_f_to_c(filename))
78
79 end function gdlib_image_create_from
80#endif
81
82end module gdlib_oct_m
83
84!! Local Variables:
85!! mode: f90
86!! coding: utf-8
87!! End:
type(c_ptr) function, public gdlib_image_create_from(filename)
Definition: gdlib.F90:161