def is_cuda_capable(): if 'win32' not in sys.platform: return False try: cudart = find_dll('cudart', omit_lib_in_windows=True, windows_uses_stdcall=True) except Exception: return False version = c_int() cudart.cudaDriverGetVersion(byref(version)) return bool(version)
import sys from ctypes import * from fr0stlib.pyflam3.find_dll import find_dll libflam4 = find_dll('Flam4CUDA_LIB', omit_lib_in_windows=True) LastRenderSize = 0, 0 cudaRunning = False class rgba(Structure): _fields_ = [('r', c_float), ('g', c_float), ('b', c_float), ('a', c_float)] class xForm(Structure): _fields_ = [ ('a', c_float), ('b', c_float), ('c', c_float), ('d', c_float), ('e', c_float), ('f', c_float), ('linear', c_float), ('sinusoidal', c_float), ('spherical', c_float), ('swirl', c_float), ('horseshoe', c_float), ('polar', c_float), ('handkerchief', c_float), ('heart', c_float), ('disc', c_float), ('spiral', c_float), ('hyperbolic', c_float), ('diamond', c_float), ('ex', c_float), ('julia', c_float), ('bent', c_float), ('waves', c_float), ('fisheye', c_float), ('popcorn', c_float), ('exponential', c_float), ('power', c_float), ('cosine', c_float), ('rings', c_float), ('fan', c_float), ('blob', c_float), ('pdj', c_float), ('fan2', c_float), ('rings2', c_float), ('eyefish', c_float), ('bubble', c_float), ('cylinder', c_float), ('perspective', c_float), ('noise', c_float), ('julian', c_float), ('juliascope', c_float), ('blur', c_float), ('gaussian_blur', c_float), ('radial_blur', c_float), ('pie', c_float), ('ngon', c_float),
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this library; see the file COPYING.LIB. If not, write to # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. ############################################################################## import itertools, sys, os from ctypes import * from fr0stlib.pyflam3.constants import * from fr0stlib.pyflam3.variations import * from fr0stlib.pyflam3.find_dll import find_dll libflam3 = find_dll('libflam3') IteratorFunction = CFUNCTYPE(None, c_void_p, c_double) SpatialFilterFunction = CFUNCTYPE(c_double, c_double) ProgressFunction = CFUNCTYPE(c_int, POINTER(py_object), c_double, c_int, c_double) def copy_to(src, dest): for (src_val, dest_val) in itertools.izip(src, dest): dest_val = src_val class RandomContext(Structure): _fields_ = [('randcnt', c_ulong), ('randrsl', c_ulong * flam3_RANDSIZ), ('randmem', c_ulong * flam3_RANDSIZ), ('randa', c_ulong),
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this library; see the file COPYING.LIB. If not, write to # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. ############################################################################## import itertools, sys, os from ctypes import * from fr0stlib.pyflam3.constants import * from fr0stlib.pyflam3.variations import * from fr0stlib.pyflam3.find_dll import find_dll libflam3 = find_dll('libflam3') IteratorFunction = CFUNCTYPE(None, c_void_p, c_double) SpatialFilterFunction = CFUNCTYPE(c_double, c_double) ProgressFunction = CFUNCTYPE(c_int, POINTER(py_object), c_double, c_int, c_double) def copy_to(src, dest): for (src_val, dest_val) in itertools.izip(src, dest): dest_val = src_val class RandomContext(Structure): _fields_ = [ ('randcnt', c_ulong) , ('randrsl', c_ulong * flam3_RANDSIZ)
import sys from ctypes import * from fr0stlib.pyflam3.find_dll import find_dll libflam4 = find_dll('Flam4CUDA_LIB', omit_lib_in_windows=True) LastRenderSize = 0, 0 cudaRunning = False class rgba(Structure): _fields_ = [ ('r', c_float) , ('g', c_float) , ('b', c_float) , ('a', c_float) ] class xForm(Structure): _fields_ = [ ('a', c_float) , ('b', c_float) , ('c', c_float) , ('d', c_float) , ('e', c_float) , ('f', c_float) , ('linear', c_float) , ('sinusoidal', c_float) , ('spherical', c_float) , ('swirl', c_float) , ('horseshoe', c_float) , ('polar', c_float)