From 042d612df219c8f6a29afa235537380f227b5684 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 23 Jan 2006 22:05:47 +0000 Subject: Giant commit! A full detailed description of this will be done later... is several days of work. Here's a summary: Render: - Full cleanup of render code, removing *all* globals and bad level calls all over blender. Render module is now not called abusive anymore - API-fied calls to rendering - Full recode of internal render pipeline. Is now rendering tiles by default, prepared for much smarter 'bucket' render later. - Each thread now can render a full part - Renders were tested with 4 threads, goes fine, apart from some lookup tables in softshadow and AO still - Rendering is prepared to do multiple layers and passes - No single 32 bits trick in render code anymore, all 100% floats now. Writing images/movies - moved writing images to blender kernel (bye bye 'schrijfplaatje'!) - made a new Movie handle system, also in kernel. This will enable much easier use of movies in Blender PreviewRender: - Using new render API, previewrender (in buttons) now uses regular render code to generate images. - new datafile 'preview.blend.c' has the preview scenes in it - previews get rendered in exact displayed size (1 pixel = 1 pixel) 3D Preview render - new; press Pkey in 3d window, for a panel that continuously renders (pkey is for games, i know... but we dont do that in orange now!) - this render works nearly identical to buttons-preview render, so it stops rendering on any event (mouse, keyboard, etc) - on moving/scaling the panel, the render code doesn't recreate all geometry - same for shifting/panning view - all other operations (now) regenerate the full render database still. - this is WIP... but big fun, especially for simple scenes! Compositor - Using same node system as now in use for shaders, you can composit images - works pretty straightforward... needs much more options/tools and integration with rendering still - is not threaded yet, nor is so smart to only recalculate changes... will be done soon! - the "Render Result" node will get all layers/passes as output sockets - The "Output" node renders to a builtin image, which you can view in the Image window. (yes, output nodes to render-result, and to files, is on the list!) The Bad News - "Unified Render" is removed. It might come back in some stage, but this system should be built from scratch. I can't really understand this code... I expect it is not much needed, especially with advanced layer/passes control - Panorama render, Field render, Motion blur, is not coded yet... (I had to recode every single feature in render, so...!) - Lens Flare is also not back... needs total revision, might become composit effect though (using zbuffer for visibility) - Part render is gone! (well, thats obvious, its default now). - The render window is only restored with limited functionality... I am going to check first the option to render to a Image window, so Blender can become a true single-window application. :) For example, the 'Spare render buffer' (jkey) doesnt work. - Render with border, now default creates a smaller image - No zbuffers are written yet... on the todo! - Scons files and MSVC will need work to get compiling again OK... thats what I can quickly recall. Now go compiling! --- source/Makefile | 1 - source/blender/Makefile | 2 +- source/blender/SConscript | 1 - source/blender/blenkernel/BKE_bad_level_calls.h | 47 +- source/blender/blenkernel/BKE_colortools.h | 2 + source/blender/blenkernel/BKE_global.h | 2 +- source/blender/blenkernel/BKE_image.h | 6 +- source/blender/blenkernel/BKE_material.h | 8 +- source/blender/blenkernel/BKE_node.h | 45 +- source/blender/blenkernel/BKE_object.h | 2 +- source/blender/blenkernel/BKE_scene.h | 1 + source/blender/blenkernel/BKE_texture.h | 8 + source/blender/blenkernel/BKE_world.h | 1 - source/blender/blenkernel/BKE_writeavi.h | 22 +- source/blender/blenkernel/SConscript | 2 + .../blenkernel/bad_level_call_stubs/stubs.c | 40 - source/blender/blenkernel/intern/Makefile | 4 + source/blender/blenkernel/intern/action.c | 7 +- source/blender/blenkernel/intern/blender.c | 12 +- source/blender/blenkernel/intern/colortools.c | 4 +- source/blender/blenkernel/intern/depsgraph.c | 2 + source/blender/blenkernel/intern/displist.c | 685 +-- source/blender/blenkernel/intern/effect.c | 15 +- source/blender/blenkernel/intern/image.c | 164 +- source/blender/blenkernel/intern/ipo.c | 7 +- source/blender/blenkernel/intern/key.c | 1 + source/blender/blenkernel/intern/material.c | 159 +- source/blender/blenkernel/intern/mball.c | 7 +- source/blender/blenkernel/intern/node.c | 127 +- source/blender/blenkernel/intern/node_composit.c | 1372 ++++++ source/blender/blenkernel/intern/node_shaders.c | 10 +- source/blender/blenkernel/intern/object.c | 12 +- source/blender/blenkernel/intern/packedFile.c | 11 +- source/blender/blenkernel/intern/scene.c | 10 +- source/blender/blenkernel/intern/text.c | 1 + source/blender/blenkernel/intern/texture.c | 75 +- source/blender/blenkernel/intern/world.c | 35 - source/blender/blenkernel/intern/writeavi.c | 101 +- source/blender/blenlib/BLI_blenlib.h | 10 +- source/blender/blenlib/BLI_jitter.h | 40 + source/blender/blenlib/intern/jitter.c | 178 + source/blender/blenlib/intern/rct.c | 52 + source/blender/blenlib/intern/util.c | 33 + source/blender/blenloader/intern/readfile.c | 36 +- source/blender/blenloader/intern/writefile.c | 12 +- source/blender/imbuf/intern/radiance_hdr.c | 21 +- source/blender/imbuf/intern/scaling.c | 45 +- source/blender/imbuf/intern/writeimage.c | 14 + source/blender/include/BIF_glutil.h | 2 +- source/blender/include/BIF_interface.h | 3 +- source/blender/include/BIF_previewrender.h | 31 +- source/blender/include/BIF_renderwin.h | 2 +- source/blender/include/BIF_screen.h | 2 +- source/blender/include/BIF_space.h | 3 +- source/blender/include/BIF_toets.h | 3 - source/blender/include/BIF_writeimage.h | 4 +- source/blender/include/BSE_drawview.h | 3 +- source/blender/include/BSE_node.h | 5 +- source/blender/include/BSE_sequence.h | 7 +- source/blender/include/BSE_view.h | 5 +- source/blender/include/blendef.h | 1 + source/blender/include/butspace.h | 3 +- source/blender/include/interface.h | 6 + source/blender/makesdna/DNA_image_types.h | 2 +- source/blender/makesdna/DNA_material_types.h | 27 +- source/blender/makesdna/DNA_node_types.h | 8 +- source/blender/makesdna/DNA_object_types.h | 2 +- source/blender/makesdna/DNA_scene_types.h | 15 +- source/blender/makesdna/DNA_view3d_types.h | 2 + source/blender/python/api2_2x/Texture.c | 8 +- source/blender/python/api2_2x/sceneRender.c | 43 +- source/blender/quicktime/apple/quicktime_export.c | 50 +- source/blender/quicktime/quicktime_export.h | 5 +- source/blender/radiosity/SConscript | 3 +- source/blender/radiosity/extern/include/radio.h | 3 +- .../blender/radiosity/extern/include/radio_types.h | 3 + source/blender/radiosity/intern/source/Makefile | 1 + .../blender/radiosity/intern/source/radfactors.c | 8 +- source/blender/radiosity/intern/source/radio.c | 2 + source/blender/radiosity/intern/source/radrender.c | 100 +- source/blender/render/extern/include/RE_pipeline.h | 161 + .../blender/render/extern/include/RE_render_ext.h | 49 + .../blender/render/extern/include/RE_shader_ext.h | 107 + source/blender/render/extern/include/render.h | 304 -- .../blender/render/extern/include/render_types.h | 356 -- .../blender/render/intern/include/RE_callbacks.h | 85 - source/blender/render/intern/include/envmap.h | 5 +- .../blender/render/intern/include/errorHandler.h | 69 - .../render/intern/include/gammaCorrectionTables.h | 19 - source/blender/render/intern/include/initrender.h | 22 +- source/blender/render/intern/include/jitter.h | 52 - .../render/intern/include/outerRenderLoop.h | 44 - .../blender/render/intern/include/pixelblending.h | 107 +- .../blender/render/intern/include/pixelshading.h | 42 +- source/blender/render/intern/include/renderHelp.h | 64 - .../render/intern/include/renderPreAndPost.h | 43 - .../blender/render/intern/include/render_types.h | 347 ++ source/blender/render/intern/include/rendercore.h | 47 +- .../blender/render/intern/include/renderdatabase.h | 69 + .../blender/render/intern/include/renderpipeline.h | 41 + source/blender/render/intern/include/shadbuf.h | 2 +- source/blender/render/intern/include/texture.h | 5 + .../render/intern/include/vanillaRenderPipe.h | 59 - .../intern/include/vanillaRenderPipe_types.h | 87 - source/blender/render/intern/include/zblur.h | 48 - source/blender/render/intern/include/zbuf.h | 196 +- source/blender/render/intern/include/zbuf_types.h | 75 - .../render/intern/include/zbufferdatastruct.h | 98 - .../intern/include/zbufferdatastruct_types.h | 80 - source/blender/render/intern/source/RE_callbacks.c | 168 - .../blender/render/intern/source/convertblender.c | 3108 +++++++++++++ source/blender/render/intern/source/edgeRender.c | 150 +- source/blender/render/intern/source/envmap.c | 358 +- source/blender/render/intern/source/errorHandler.c | 102 - .../render/intern/source/gammaCorrectionTables.c | 14 +- source/blender/render/intern/source/imagetexture.c | 19 +- source/blender/render/intern/source/initrender.c | 1742 ++------ source/blender/render/intern/source/jitter.c | 198 - source/blender/render/intern/source/pipeline.c | 954 ++++ .../blender/render/intern/source/pixelblending.c | 581 +-- source/blender/render/intern/source/pixelshading.c | 295 +- source/blender/render/intern/source/ray.c | 405 +- source/blender/render/intern/source/renderHelp.c | 306 -- .../render/intern/source/renderPreAndPost.c | 103 - source/blender/render/intern/source/rendercore.c | 1419 +++--- .../blender/render/intern/source/renderdatabase.c | 446 +- source/blender/render/intern/source/shadbuf.c | 180 +- source/blender/render/intern/source/texture.c | 69 +- .../render/intern/source/vanillaRenderPipe.c | 1641 ------- source/blender/render/intern/source/zblur.c | 818 ---- source/blender/render/intern/source/zbuf.c | 1988 +++------ .../render/intern/source/zbufferdatastruct.c | 310 -- source/blender/src/Makefile | 1 - source/blender/src/SConscript | 1 - source/blender/src/butspace.c | 18 + source/blender/src/buttons_editing.c | 2 +- source/blender/src/buttons_scene.c | 63 +- source/blender/src/buttons_shading.c | 69 +- source/blender/src/drawimage.c | 22 +- source/blender/src/drawnode.c | 363 +- source/blender/src/drawseq.c | 11 +- source/blender/src/drawview.c | 105 +- source/blender/src/editmesh_mods.c | 3 +- source/blender/src/editnode.c | 224 +- source/blender/src/editobject.c | 19 +- source/blender/src/editscreen.c | 10 +- source/blender/src/fluidsim.c | 5 +- source/blender/src/glutil.c | 12 +- source/blender/src/header_buttonswin.c | 15 +- source/blender/src/header_image.c | 20 +- source/blender/src/header_info.c | 6 +- source/blender/src/header_node.c | 34 +- source/blender/src/headerbuttons.c | 8 +- source/blender/src/interface.c | 46 +- source/blender/src/interface_icons.c | 10 +- source/blender/src/interface_panel.c | 95 +- source/blender/src/preview.blend.c | 4634 ++++++++++++++++++++ source/blender/src/previewrender.c | 1658 ++----- source/blender/src/renderwin.c | 673 ++- source/blender/src/screendump.c | 1 + source/blender/src/seqaudio.c | 3 +- source/blender/src/sequence.c | 120 +- source/blender/src/space.c | 28 +- source/blender/src/toets.c | 245 +- source/blender/src/toolbox.c | 3 +- source/blender/src/transform_conversions.c | 3 + source/blender/src/transform_manipulator.c | 4 +- source/blender/src/usiblender.c | 12 +- source/blender/src/view.c | 126 +- source/blender/src/writeavicodec.c | 11 +- source/blender/src/writeimage.c | 180 +- source/blender/src/writemovie.c | 2 +- source/blender/yafray/intern/export_File.cpp | 11 +- source/blender/yafray/intern/export_Plugin.cpp | 60 +- source/blender/yafray/intern/yafray_Render.h | 5 +- source/creator/SConscript | 1 - source/creator/creator.c | 26 +- source/nan_compile.mk | 4 +- 178 files changed, 16547 insertions(+), 14296 deletions(-) create mode 100644 source/blender/blenkernel/intern/node_composit.c create mode 100644 source/blender/blenlib/BLI_jitter.h create mode 100644 source/blender/blenlib/intern/jitter.c create mode 100644 source/blender/render/extern/include/RE_pipeline.h create mode 100644 source/blender/render/extern/include/RE_render_ext.h create mode 100644 source/blender/render/extern/include/RE_shader_ext.h delete mode 100644 source/blender/render/extern/include/render.h delete mode 100644 source/blender/render/extern/include/render_types.h delete mode 100644 source/blender/render/intern/include/RE_callbacks.h delete mode 100644 source/blender/render/intern/include/errorHandler.h delete mode 100644 source/blender/render/intern/include/jitter.h delete mode 100644 source/blender/render/intern/include/outerRenderLoop.h delete mode 100644 source/blender/render/intern/include/renderHelp.h delete mode 100644 source/blender/render/intern/include/renderPreAndPost.h create mode 100644 source/blender/render/intern/include/render_types.h create mode 100644 source/blender/render/intern/include/renderdatabase.h create mode 100644 source/blender/render/intern/include/renderpipeline.h delete mode 100644 source/blender/render/intern/include/vanillaRenderPipe.h delete mode 100644 source/blender/render/intern/include/vanillaRenderPipe_types.h delete mode 100644 source/blender/render/intern/include/zblur.h delete mode 100644 source/blender/render/intern/include/zbuf_types.h delete mode 100644 source/blender/render/intern/include/zbufferdatastruct.h delete mode 100644 source/blender/render/intern/include/zbufferdatastruct_types.h delete mode 100644 source/blender/render/intern/source/RE_callbacks.c create mode 100644 source/blender/render/intern/source/convertblender.c delete mode 100644 source/blender/render/intern/source/errorHandler.c delete mode 100644 source/blender/render/intern/source/jitter.c create mode 100644 source/blender/render/intern/source/pipeline.c delete mode 100644 source/blender/render/intern/source/renderHelp.c delete mode 100644 source/blender/render/intern/source/renderPreAndPost.c delete mode 100644 source/blender/render/intern/source/vanillaRenderPipe.c delete mode 100644 source/blender/render/intern/source/zblur.c delete mode 100644 source/blender/render/intern/source/zbufferdatastruct.c create mode 100644 source/blender/src/preview.blend.c (limited to 'source') diff --git a/source/Makefile b/source/Makefile index 87849f29f89..22ca6b68652 100644 --- a/source/Makefile +++ b/source/Makefile @@ -84,7 +84,6 @@ PYPLAYERLIB ?= $(PYLIB) GRPLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a GRPLIB += $(OCGDIR)/blender/img/$(DEBUG_DIR)libimg.a - GRPLIB += $(OCGDIR)/blender/renderconverter/$(DEBUG_DIR)librenderconverter.a GRPLIB += $(OCGDIR)/blender/render/$(DEBUG_DIR)librender.a GRPLIB += $(OCGDIR)/blender/radiosity/$(DEBUG_DIR)libradiosity.a GRPLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a diff --git a/source/blender/Makefile b/source/blender/Makefile index e4862f0d845..ebae59ef0de 100644 --- a/source/blender/Makefile +++ b/source/blender/Makefile @@ -35,7 +35,7 @@ include nan_definitions.mk DIRS = blenloader readblenfile DIRS += avi imbuf img render radiosity blenlib blenkernel blenpluginapi -DIRS += makesdna src renderconverter yafray +DIRS += makesdna src yafray DIRS += python ifeq ($(INTERNATIONAL), true) diff --git a/source/blender/SConscript b/source/blender/SConscript index 1c21399b838..926dc75e7ea 100644 --- a/source/blender/SConscript +++ b/source/blender/SConscript @@ -13,7 +13,6 @@ SConscript(['avi/SConscript', 'radiosity/SConscript', 'readblenfile/SConscript', 'render/SConscript', - 'renderconverter/SConscript', 'src/SConscript', 'yafray/SConscript']) diff --git a/source/blender/blenkernel/BKE_bad_level_calls.h b/source/blender/blenkernel/BKE_bad_level_calls.h index 8a86e88406f..1bc02a02ea6 100644 --- a/source/blender/blenkernel/BKE_bad_level_calls.h +++ b/source/blender/blenkernel/BKE_bad_level_calls.h @@ -75,26 +75,6 @@ void error(char *str, ...); /* anim.c */ extern struct ListBase editNurb; -/* displist.c */ -#include "DNA_world_types.h" /* for render_types */ -#include "render_types.h" -extern struct RE_Render R; -float Blinn_Spec(float *n, float *l, float *v, float a, float b, int); -float Phong_Spec(float *, float *, float *, int, int); -float CookTorr_Spec(float *n, float *l, float *v, int hard, int); -float Toon_Spec(float *n, float *l, float *v, float a, float b, int); -float WardIso_Spec(float *n, float *l, float *v, float a, int); - -float Toon_Diff(float *n, float *l, float *v, float a, float b); -float OrenNayar_Diff(float *n, float *l, float *v, float rough); -float Minnaert_Diff(float nl, float *n, float *v, float a); -float Fresnel_Diff(float *vn, float *lv, float *view, float ior, float fac); - -void add_to_diffuse(float *, ShadeInput *, float, float, float, float); -void ramp_diffuse_result(float *diff, ShadeInput *shi); -void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec); -void ramp_spec_result(float *, float *, float *, ShadeInput *); - void mainqenter (unsigned short event, short val); void waitcursor(int); void allqueue(unsigned short event, short val); @@ -103,9 +83,6 @@ void allqueue(unsigned short event, short val); struct Material; extern struct Material defmaterial; -/* effect.c */ -void RE_jitterate1(float *jit1, float *jit2, int num, float rad1); -void RE_jitterate2(float *jit1, float *jit2, int num, float rad2); /* exotic.c */ void load_editMesh(void); @@ -119,7 +96,6 @@ int saveover(char *str); /* image.c */ #include "DNA_image_types.h" void free_realtime_image(Image *ima); // has to become a callback, opengl stuff -void RE_make_existing_file(char *name); // from render, but these funcs should be moved anyway /* ipo.c */ void copy_view3d_lock(short val); // was a hack, to make scene layer ipo's possible @@ -129,11 +105,12 @@ void allspace(unsigned short event, short val) ; #define OOPS_TEST 2 /* mball.c */ -extern ListBase editelems; +extern struct ListBase editelems; /* object.c */ -void BPY_free_scriptlink(ScriptLink *slink); -void BPY_copy_scriptlink(ScriptLink *scriptlink); +struct ScriptLink; +void BPY_free_scriptlink(struct ScriptLink *slink); +void BPY_copy_scriptlink(struct ScriptLink *scriptlink); float *give_cursor(void); // become a callback or argument void exit_posemode(int freedata); @@ -149,21 +126,7 @@ void free_editing(struct Editing *ed); // scenes and sequences problem... void BPY_do_all_scripts (short int event); int BPY_call_importloader(char *name); -/* texture.c */ -#define FLO 128 -#define INT 96 -struct EnvMap; -struct Tex; - -void do_material_tex(ShadeInput *shi); -void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, - float *tg, float *tb, float *ta); -void init_render_textures(void); - -void RE_free_envmap(struct EnvMap *env); -void RE_free_envmapdata(struct EnvMap *env); -struct EnvMap *RE_copy_envmap(struct EnvMap *env); -int RE_envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt); + extern char texstr[20][12]; /* buttons.c */ diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h index 3dc42dcc823..dd739628fc5 100644 --- a/source/blender/blenkernel/BKE_colortools.h +++ b/source/blender/blenkernel/BKE_colortools.h @@ -52,7 +52,9 @@ float curvemap_evaluateF(struct CurveMap *cuma, float value); float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value); void curvemapping_evaluate3F(struct CurveMapping *cumap, float *vecout, const float *vecin); void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float *vecout, const float *vecin); +void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float *vecout, const float *vecin); void curvemapping_do_image(struct CurveMapping *cumap, struct Image *ima); +void curvemapping_premultiply(struct CurveMapping *cumap, int restore); #endif diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 490c8dfc01e..f078fd14753 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -96,7 +96,7 @@ typedef struct Global { short afbreek, moving; short qual, background; short winpos, displaymode; /* used to be in Render */ - + short rendering; /* to indicate render is busy, prevent renderwindow events etc */ /** * The current version of Blender. */ diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 1ae5552104c..250b6dc762f 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -49,8 +49,10 @@ struct Image *add_image(char *name); void free_unused_animimages(void); struct Image *new_image(int width, int height, char *name, short uvtestgrid); -void makepicstring(char *string, int frame); -void addImageExtension(char *string); +int BKE_write_ibuf(struct ImBuf *ibuf, char *name, int imtype, int subimtype, int quality); +void BKE_makepicstring(char *string, int frame); +void BKE_add_image_extension(char *string, int imtype); +int BKE_imtype_is_movie(int imtype); struct anim *openanim(char * name, int flags); void ima_ibuf_is_nul(struct Tex *tex, struct Image *ima); diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 423a6a0cbf9..a9609f88c98 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -42,6 +42,7 @@ struct Material; struct ID; struct Object; +void init_def_material(void); void free_material(struct Material *sc); void test_object_materials(struct ID *id); void init_material(struct Material *ma); @@ -56,14 +57,17 @@ ID *material_from(struct Object *ob, int act); void assign_material(struct Object *ob, struct Material *ma, int act); void new_material_to_objectdata(struct Object *ob); -void init_render_material(struct Material *); -void init_render_materials(void); +void init_render_material(struct Material *, int, float *); +void init_render_materials(int, float *); void end_render_material(struct Material *); void end_render_materials(void); void automatname(struct Material *); void delete_material_index(void); +void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col); + + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 7c887e2db63..88012978cd2 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -103,7 +103,6 @@ void ntreeExecTree(struct bNodeTree *ntree, void *callerdata, int thread); void ntreeEndExecTree(struct bNodeTree *ntree); void ntreeInitPreview(struct bNodeTree *, int xsize, int ysize); -void ntreeClearPixelTree(struct bNodeTree *, int, int); /* ************** GENERIC API, NODES *************** */ @@ -171,15 +170,53 @@ struct ShadeResult; extern bNodeType *node_all_shaders[]; /* API */ -struct bNode *nodeShaderAdd(struct bNodeTree *ntree, int type); -void nodeShaderSetExecfunc(struct bNode *node); void ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr); -int ntreeShaderGetTexco(struct bNodeTree *ntree); +int ntreeShaderGetTexco(struct bNodeTree *ntree, int osa); void nodeShaderSynchronizeID(struct bNode *node, int copyto); /* switch material render loop */ void set_node_shader_lamp_loop(void (*lamp_loop_func)(struct ShadeInput *, struct ShadeResult *)); +/* ************** COMPOSIT NODES *************** */ + +/* note: types are needed to restore callbacks, don't change values */ +#define CMP_NODE_OUTPUT 201 + +#define CMP_NODE_RGB 202 +#define CMP_NODE_VALUE 203 +#define CMP_NODE_MIX_RGB 204 +#define CMP_NODE_VALTORGB 205 +#define CMP_NODE_RGBTOBW 206 +#define CMP_NODE_NORMAL 207 +#define CMP_NODE_CURVE_VEC 208 +#define CMP_NODE_CURVE_RGB 209 +#define CMP_NODE_ALPHAOVER 210 +#define CMP_NODE_BLUR 211 +#define CMP_NODE_FILTER 212 + +#define CMP_NODE_IMAGE 220 +#define CMP_NODE_R_RESULT 221 + + +/* filter types */ +#define CMP_FILT_SOFT 0 +#define CMP_FILT_SHARP 1 +#define CMP_FILT_LAPLACE 2 +#define CMP_FILT_SOBEL 3 +#define CMP_FILT_PREWITT 4 +#define CMP_FILT_KIRSCH 5 +#define CMP_FILT_SHADOW 6 + + +/* the type definitions array */ +extern bNodeType *node_all_composit[]; + +/* API */ +struct CompBuf; +void ntreeCompositExecTree(struct bNodeTree *ntree); +void free_compbuf(struct CompBuf *cbuf); /* internal...*/ + + #endif diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 2e4e4917de2..d0f70907e5c 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -73,7 +73,7 @@ void base_init_from_view3d(struct Base *base, struct View3D *v3d); struct Object *copy_object(struct Object *ob); void expand_local_object(struct Object *ob); void make_local_object(struct Object *ob); -void set_mblur_offs(int blur); +void set_mblur_offs(float blur); void disable_speed_curve(int val); float bsystem_time(struct Object *ob, struct Object *par, float cfra, float ofs); void object_to_mat3(struct Object *ob, float mat[][3]); diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index a7eea6f6393..4aa4c09dccc 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -53,6 +53,7 @@ struct QuicktimeCodecData; } +#define SETLOOPER(s, b) sce= s, b= s->base.first; b; b= (b->next?b->next:s->set?(s=s->set)->base.first:NULL) void free_avicodecdata(struct AviCodecData *acd); diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index 033de758c7b..a34ef43cab7 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -41,6 +41,7 @@ struct LampRen; struct ColorBand; struct HaloRen; struct TexMapping; +struct EnvMap; /* in ColorBand struct */ #define MAXCOLORBAND 16 @@ -65,5 +66,12 @@ struct Tex *give_current_texture(struct Object *ob, int act); struct TexMapping *add_mapping(void); void init_mapping(struct TexMapping *texmap); + +void BKE_free_envmapdata(struct EnvMap *env); +void BKE_free_envmap(struct EnvMap *env); +struct EnvMap *BKE_add_envmap(void); +struct EnvMap *BKE_copy_envmap(struct EnvMap *env); + + #endif diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h index cedff61f2dd..b51eaff420c 100644 --- a/source/blender/blenkernel/BKE_world.h +++ b/source/blender/blenkernel/BKE_world.h @@ -40,7 +40,6 @@ void free_world(struct World *sc); struct World *add_world(char *name); struct World *copy_world(struct World *wrld); void make_local_world(struct World *wrld); -void init_render_world(void); #endif diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h index f63342ea047..af442600c6b 100644 --- a/source/blender/blenkernel/BKE_writeavi.h +++ b/source/blender/blenkernel/BKE_writeavi.h @@ -37,10 +37,26 @@ extern "C" { #endif -void start_avi(void); +/* generic blender movie support, could move to own module */ + +typedef struct bMovieHandle { + void (*start_movie)(RenderData *rd, int rectx, int recty); + void (*append_movie)(int frame, int *pixels, int rectx, int recty); + void (*end_movie)(void); +} bMovieHandle; + +bMovieHandle *BKE_get_movie_handle(int imtype); + + +/* ************** */ + +struct RenderData; +void start_avi(struct RenderData *rd, int rectx, int recty); void end_avi(void); -void append_avi(int frame); -void makeavistring(char *string); +void append_avi(int frame, int *pixels, int rectx, int recty); +void makeavistring (struct RenderData *rd, char *string); + + #ifdef __cplusplus } diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index acbb15a4ecd..8a5fd47388f 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -46,6 +46,7 @@ source_files = ['intern/constraint.c', 'intern/softbody.c', 'intern/node.c', 'intern/node_shaders.c', + 'intern/node_composit.c', 'intern/colortools.c', 'intern/texture.c'] @@ -60,6 +61,7 @@ blenkernel_env.Append (CPPPATH = ['.', '../../../intern/decimation/extern', '../imbuf', '../avi', + '../quicktime', '#/intern/elbeem/extern', '#/intern/iksolver/extern', '../blenloader']) diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index 44997480779..f8c44730bdf 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -102,37 +102,11 @@ void error(char *str, ...){} /* anim.c */ ListBase editNurb; -/* displist.c */ -#include "DNA_world_types.h" /* for render_types */ -#include "render_types.h" -struct RE_Render R; - -float Phong_Spec(float *n, float *l, float *v, int hard, int tangent){return 0;} -float Blinn_Spec(float *n, float *l, float *v, float a, float b, int tangent){return 0;} -float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent){return 0;} -float Toon_Spec(float *n, float *l, float *v, float a, float b, int tangent){return 0;} -float WardIso_Spec(float *n, float *l, float *v, float a, int tangent){return 0;} - -float Toon_Diff(float *n, float *l, float *v, float a, float b){return 0;} -float OrenNayar_Diff(float *n, float *l, float *v, float rough){return 0;} -float Minnaert_Diff(float nl, float *n, float *v, float a){return 0;} -float Fresnel_Diff(float *vn, float *lv, float *view, float ior, float fac){return 0;} - -void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b){} -void ramp_diffuse_result(float *diff, ShadeInput *shi){} -void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec){} -void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi){} - - void waitcursor(int val){} void allqueue(unsigned short event, short val){} #define REDRAWVIEW3D 0x4010 Material defmaterial; -/* effect.c */ -void RE_jitterate1(float *jit1, float *jit2, int num, float rad1){} -void RE_jitterate2(float *jit1, float *jit2, int num, float rad2){} - /* exotic.c */ void load_editMesh(void){} void make_editMesh(void){} @@ -143,7 +117,6 @@ int saveover(char *str){ return 0;} /* image.c */ #include "DNA_image_types.h" void free_realtime_image(Image *ima){} // has to become a callback, opengl stuff -void RE_make_existing_file(char *name){} // from render, but these funcs should be moved anyway /* ipo.c */ void copy_view3d_lock(short val){} // was a hack, to make scene layer ipo's possible @@ -202,20 +175,7 @@ int BPY_call_importloader(char *name) /* texture.c */ #define FLO 128 #define INT 96 - /* struct EnvMap; */ - /* struct Tex; */ - -void do_material_tex(ShadeInput *shi){} -void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta){} -void RE_free_envmap(struct EnvMap *env){} -struct EnvMap *RE_copy_envmap(struct EnvMap *env){ return env;} -void RE_free_envmapdata(struct EnvMap *env){} -void init_render_textures(void){} - -int RE_envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt){ - return 0; -} char texstr[20][12]; /* buttons.c */ diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile index 1bdeda1841f..c173051e862 100644 --- a/source/blender/blenkernel/intern/Makefile +++ b/source/blender/blenkernel/intern/Makefile @@ -87,3 +87,7 @@ ifeq ($(WITH_OPENEXR), true) CPPFLAGS += -DWITH_OPENEXR endif +ifeq ($(WITH_QUICKTIME), true) + CPPFLAGS += -I../../quicktime + CPPFLAGS += -DWITH_QUICKTIME +endif diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index b160dd41522..642ce855383 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -66,7 +66,6 @@ #include "BLI_blenlib.h" #include "nla.h" -#include "render.h" /* *********************** NOTE ON POSE AND ACTION ********************** @@ -755,9 +754,9 @@ static float nla_time(float cfra, float unit) extern float bluroffs; // bad construct, borrowed from object.c for now /* 2nd field */ - if(R.flag & R_SEC_FIELD) { - if(R.r.mode & R_FIELDSTILL); else cfra+= 0.5f*unit; - } +// if(R.flag & R_SEC_FIELD) { +// if(R.r.mode & R_FIELDSTILL); else cfra+= 0.5f*unit; +// } /* motion blur */ cfra+= unit*bluroffs; diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 43b37740455..992139a5120 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -1,4 +1,3 @@ - /* blender.c jan 94 MIXED MODEL * * common help functions and data @@ -34,10 +33,6 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ -#ifdef HAVE_CONFIG_H -#include -#endif - #ifndef WIN32 #include // for read close #include // for MAXPATHLEN @@ -51,11 +46,13 @@ #include // for open #include "MEM_guardedalloc.h" + #include "DNA_listBase.h" #include "DNA_sdna_types.h" #include "DNA_userdef_types.h" #include "DNA_object_types.h" #include "DNA_curve_types.h" +#include "DNA_scene_types.h" #include "BLI_blenlib.h" #include "BLI_dynstr.h" @@ -233,10 +230,6 @@ static void clear_global(void) free_main(G.main); /* free all lib data */ freefastshade(); /* othwerwise old lamp settings stay active */ - - /* prevent hanging vars */ - R.backbuf= 0; - /* force all queues to be left */ winqueue_break= 1; @@ -275,7 +268,6 @@ static void clean_paths(Main *main) Sequence *seq; Strip *strip; - while(image) { BLI_clean(image->name); image= image->id.next; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 30c74fd65cb..5b4c4ca107f 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -402,7 +402,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr) } /* call when you do images etc, needs restore too. also verifies tables */ -static void curvemapping_premultiply(CurveMapping *cumap, int restore) +void curvemapping_premultiply(CurveMapping *cumap, int restore) { static CurveMapPoint *table[3]= {NULL, NULL, NULL}; int a; @@ -545,7 +545,7 @@ void curvemapping_evaluateRGBF(CurveMapping *cumap, float *vecout, const float * /* RGB with black/white points and premult. tables are checked */ -static void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const float *vecin) +void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const float *vecin) { float fac; diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index ae187c0e0f7..9a4a8f62600 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1385,6 +1385,8 @@ void DAG_scene_sort(struct Scene *sce) printf(" %s\n", base->object->id.name); } } + /* temporal...? */ + G.scene->recalc |= SCE_PRV_CHANGED; /* test for 3d preview */ } /* node was checked to have lasttime != curtime and is if type ID_OB */ diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 668e8d6e71c..2e7f821abd7 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1,4 +1,3 @@ - /* displist.c * * @@ -33,10 +32,6 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include @@ -93,28 +88,10 @@ #include "BKE_modifier.h" #include "nla.h" /* For __NLA: Please do not remove yet */ -#include "render.h" -/***/ - -typedef struct _FastLamp FastLamp; -struct _FastLamp { - FastLamp *next; - - short type, mode, lay, rt; - float co[3]; - float vec[3]; - float dist, distkw, att1, att2, spotsi, spotbl, r, g, b; -}; - -/***/ - static void boundbox_displist(Object *ob); -static FastLamp *fastlamplist= NULL; -static float fviewmat[4][4]; - void displistmesh_free(DispListMesh *dlm) { // also check on mvert and mface, can be NULL after decimator (ton) @@ -288,358 +265,18 @@ void copy_displist(ListBase *lbn, ListBase *lb) } } -static void initfastshade(void) +void initfastshade(void) { - Base *base; - Scene *setscene; - Object *ob; - Lamp *la; - FastLamp *fl; - float mat[4][4]; - - init_render_world(); - - if(fastlamplist) return; - if(G.scene->camera==0) G.scene->camera= scene_find_camera(G.scene); - if(G.scene->camera==0) return; - - /* copied from 'roteerscene' (does that function still exist? (ton) */ - where_is_object(G.scene->camera); - Mat4CpyMat4(R.viewinv, G.scene->camera->obmat); - Mat4Ortho(R.viewinv); - Mat4Invert(fviewmat, R.viewinv); - - /* initrendertexture(); */ - setscene = G.scene->set; - base= G.scene->base.first; - while(base) { - ob= base->object; - if( ob->type==OB_LAMP && (base->lay & G.scene->lay)) { - - Mat4MulMat4(mat, ob->obmat, fviewmat); - - la= ob->data; - fl= MEM_mallocN(sizeof(FastLamp), "initfastshade2"); - - fl->next= fastlamplist; - fastlamplist= fl; - - fl->type= la->type; - fl->mode= la->mode; - fl->lay= base->lay; - - fl->vec[0]= mat[2][0]; - fl->vec[1]= mat[2][1]; - fl->vec[2]= mat[2][2]; - Normalise(fl->vec); - - fl->co[0]= mat[3][0]; - fl->co[1]= mat[3][1]; - fl->co[2]= mat[3][2]; - - fl->dist= la->dist; - fl->distkw= fl->dist*fl->dist; - fl->att1= la->att1; - fl->att2= la->att2; - - fl->spotsi= (float)cos( M_PI*la->spotsize/360.0 ); - fl->spotbl= (1.0f-fl->spotsi)*la->spotblend; - - fl->r= la->energy*la->r; - fl->g= la->energy*la->g; - fl->b= la->energy*la->b; - } - - if(base->next==0 && setscene && setscene->set) {/*if(base->next==0 && G.scene->set && base==G.scene->base.last) {*/ - setscene = setscene->set; - base= setscene->base.first; /* base= G.scene->set->base.first;*/ - } else { - base= base->next; - } - } } void freefastshade() { - while (fastlamplist) { - FastLamp *fl= fastlamplist; - fastlamplist= fl->next; - - MEM_freeN(fl); - } } static void fastshade(float *co, float *nor, float *orco, Material *ma, char *col1, char *col2, char *vertcol) { - ShadeInput shi; - FastLamp *fl; - float i, t, inp, is, soft, lv[3], lampdist, ld; - float diff1[3], diff2[3]; - float isr1=0, isg1=0, isb1=0, isr=0, isg=0, isb=0; - int a, back; - - if(ma==0) return; - - shi.mat= ma; - shi.vlr= NULL; // have to do this! - - // copy all relevant material vars, note, keep this synced with render_types.h - memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); - // set special cases: - shi.har= shi.mat->har; - - shi.osatex= 0; // also prevents reading vlr - - VECCOPY(shi.vn, nor); - - if(ma->mode & MA_VERTEXCOLP) { - if(vertcol) { - shi.r= vertcol[3]/255.0; - shi.g= vertcol[2]/255.0; - shi.b= vertcol[1]/255.0; - } - } - - if(ma->texco) { - VECCOPY(shi.lo, orco); - - if(ma->texco & TEXCO_GLOB) { - VECCOPY(shi.gl, shi.lo); - } - if(ma->texco & TEXCO_WINDOW) { - VECCOPY(shi.winco, shi.lo); - } - if(ma->texco & TEXCO_STICKY) { - VECCOPY(shi.sticky, shi.lo); - } - if(ma->texco & TEXCO_UV) { - VECCOPY(shi.uv, shi.lo); - } - if(ma->texco & TEXCO_OBJECT) { - VECCOPY(shi.co, shi.lo); - } - if(ma->texco & TEXCO_NORM) { - VECCOPY(shi.orn, shi.vn); - } - if(ma->texco & TEXCO_REFL) { - - inp= 2.0*(shi.vn[2]); - shi.ref[0]= (inp*shi.vn[0]); - shi.ref[1]= (inp*shi.vn[1]); - shi.ref[2]= (-1.0+inp*shi.vn[2]); - } - - do_material_tex(&shi); - } - - if(ma->mode & MA_SHLESS) { - if(vertcol && (ma->mode & (MA_VERTEXCOL+MA_VERTEXCOLP))== MA_VERTEXCOL ) { - float fac; - fac= vertcol[3]*shi.r; - col1[3]= fac>=1.0?255:(char)fac; - fac= vertcol[2]*shi.g; - col1[2]= fac>=1.0?255:(char)fac; - fac= vertcol[1]*shi.b; - col1[1]= fac>=1.0?255:(char)fac; - } - else { - int fac; - fac= (int) (255.0*shi.r); - col1[3]= fac>255?255:(char)fac; - fac= (int) (255.0*shi.g); - col1[2]= fac>255?255:(char)fac; - fac= (int) (255.0*shi.b); - col1[1]= fac>255?255:(char)fac; - } - if(col2) { - col2[3]= col1[3]; - col2[2]= col1[2]; - col2[1]= col1[1]; - } - return; - } - - if( vertcol && (ma->mode & (MA_VERTEXCOL+MA_VERTEXCOLP))== MA_VERTEXCOL ) { - diff1[0]= diff2[0]= shi.r*(shi.emit+vertcol[3]/255.0); - diff1[1]= diff2[1]= shi.g*(shi.emit+vertcol[2]/255.0); - diff1[2]= diff2[2]= shi.b*(shi.emit+vertcol[1]/255.0); - } - else { - diff1[0]= diff2[0]= shi.r*shi.emit; - diff1[1]= diff2[1]= shi.g*shi.emit; - diff1[2]= diff2[2]= shi.b*shi.emit; - } - - shi.view[0]= 0.0; - shi.view[1]= 0.0; - shi.view[2]= 1.0; - - Normalise(shi.view); - - for (fl= fastlamplist; fl; fl= fl->next) { - /* if(fl->mode & LA_LAYER) if((fl->lay & ma->lay)==0) continue; */ - - if(fl->type==LA_SUN || fl->type==LA_HEMI) { - VECCOPY(lv, fl->vec); - lampdist= 1.0; - } - else { - lv[0]= fl->co[0] - co[0]; - lv[1]= fl->co[1] - co[1]; - lv[2]= fl->co[2] - co[2]; - ld= sqrt(lv[0]*lv[0]+lv[1]*lv[1]+lv[2]*lv[2]); - lv[0]/=ld; - lv[1]/=ld; - lv[2]/=ld; - - if(fl->mode & LA_QUAD) { - t= 1.0; - if(fl->att1>0.0) - t= fl->dist/(fl->dist+fl->att1*ld); - if(fl->att2>0.0) - t*= fl->distkw/(fl->distkw+fl->att2*ld*ld); - - lampdist= t; - } - else { - lampdist= (fl->dist/(fl->dist+ld)); - } - - if(fl->mode & LA_SPHERE) { - t= fl->dist - ld; - if(t<0.0) continue; - - t/= fl->dist; - lampdist*= (t); - } - } - - if(fl->type==LA_SPOT) { - inp= lv[0]*fl->vec[0]+lv[1]*fl->vec[1]+lv[2]*fl->vec[2]; - if(inpspotsi) continue; - else { - t= inp-fl->spotsi; - i= 1.0; - soft= 1.0; - if(tspotbl && fl->spotbl!=0.0) { - /* soft area */ - i= t/fl->spotbl; - t= i*i; - soft= (3.0*t-2.0*t*i); - inp*= soft; - } - - lampdist*=inp; - } - } - - if(fl->mode & LA_NO_DIFF) is= 0.0; - else { - is= nor[0]*lv[0]+ nor[1]*lv[1]+ nor[2]*lv[2]; - - if(ma->diff_shader==MA_DIFF_ORENNAYAR) is= OrenNayar_Diff(nor, lv, shi.view, ma->roughness); - else if(ma->diff_shader==MA_DIFF_TOON) is= Toon_Diff(nor, lv, shi.view, ma->param[0], ma->param[1]); - else if(ma->diff_shader==MA_DIFF_MINNAERT) is= Minnaert_Diff(is, nor, shi.view, ma->darkness); - else if(ma->diff_shader==MA_DIFF_FRESNEL) is= Fresnel_Diff(nor, lv, shi.view, ma->param[0], ma->param[1]); - } - - back= 0; - if(is<0.0) { - back= 1; - is= -is; - } - inp= is*lampdist*shi.refl; - - if(back==0) { - add_to_diffuse(diff1, &shi, is, inp*fl->r, inp*fl->g, inp*fl->b); - //diff1[0]+= inp*fl->r; - //diff1[1]+= inp*fl->g; - //diff1[2]+= inp*fl->b; - } else if(col2) { - add_to_diffuse(diff2, &shi, is, inp*fl->r, inp*fl->g, inp*fl->b); - //diff2[0]+= inp*fl->r; - //diff2[1]+= inp*fl->g; - //diff2[2]+= inp*fl->b; - } - if(shi.spec!=0.0 && (fl->mode & LA_NO_SPEC)==0) { - float specfac; - - if(ma->spec_shader==MA_SPEC_PHONG) - specfac= Phong_Spec(nor, lv, shi.view, shi.har, 0); - else if(ma->spec_shader==MA_SPEC_COOKTORR) - specfac= CookTorr_Spec(nor, lv, shi.view, shi.har, 0); - else if(ma->spec_shader==MA_SPEC_BLINN) - specfac= Blinn_Spec(nor, lv, shi.view, ma->refrac, (float)shi.har, 0); - else if(ma->spec_shader==MA_SPEC_WARDISO) - specfac= WardIso_Spec(nor, lv, shi.view, ma->rms, 0); - else - specfac= Toon_Spec(nor, lv, shi.view, ma->param[2], ma->param[3], 0); - - if(specfac>0) { - t= specfac*shi.spec*lampdist; - if(back==0) { - if(ma->mode & MA_RAMP_SPEC) { - float spec[3]; - do_specular_ramp(&shi, specfac, t, spec); - isr+= t*(fl->r * spec[0]); - isg+= t*(fl->g * spec[1]); - isb+= t*(fl->b * spec[2]); - } - else { - isr+= t*(fl->r * shi.specr); - isg+= t*(fl->g * shi.specg); - isb+= t*(fl->b * shi.specb); - } - } - else if(col2) { - if(ma->mode & MA_RAMP_SPEC) { - float spec[3]; - do_specular_ramp(&shi, specfac, t, spec); - isr1+= t*(fl->r * spec[0]); - isg1+= t*(fl->g * spec[1]); - isb1+= t*(fl->b * spec[2]); - } - else { - isr1+= t*(fl->r * shi.specr); - isg1+= t*(fl->g * shi.specg); - isb1+= t*(fl->b * shi.specb); - } - } - } - } - - } - - if(ma->mode & MA_RAMP_COL) ramp_diffuse_result(diff1, &shi); - if(ma->mode & MA_RAMP_SPEC) ramp_spec_result(&isr, &isg, &isb, &shi); - - a= 256*(diff1[0] + shi.ambr +isr); - if(a>255) col1[3]= 255; - else col1[3]= a; - a= 256*(diff1[1] + shi.ambg +isg); - if(a>255) col1[2]= 255; - else col1[2]= a; - a= 256*(diff1[2] + shi.ambb +isb); - if(a>255) col1[1]= 255; - else col1[1]= a; - - if(col2) { - if(ma->mode & MA_RAMP_COL) ramp_diffuse_result(diff2, &shi); - if(ma->mode & MA_RAMP_SPEC) ramp_spec_result(&isr1, &isg1, &isb1, &shi); - - a= 256*(diff2[0] + shi.ambr +isr1); - if(a>255) col2[3]= 255; - else col2[3]= a; - a= 256*(diff2[1] + shi.ambg +isg1); - if(a>255) col2[2]= 255; - else col2[2]= a; - a= 256*(diff2[2] + shi.ambb +isb1); - if(a>255) col2[1]= 255; - else col2[1]= a; - } - } void addnormalsDispList(Object *ob, ListBase *lb) @@ -710,27 +347,6 @@ void addnormalsDispList(Object *ob, ListBase *lb) static void init_fastshade_for_ob(Object *ob, int *need_orco_r, float mat[4][4], float imat[3][3]) { - float tmat[4][4]; - int a; - - initfastshade(); - - Mat4MulMat4(mat, ob->obmat, fviewmat); - - Mat4Invert(tmat, mat); - Mat3CpyMat4(imat, tmat); - if(ob->transflag & OB_NEG_SCALE) Mat3MulFloat((float *)imat, -1.0); - - if (need_orco_r) *need_orco_r= 0; - for(a=0; atotcol; a++) { - Material *ma= give_current_material(ob, a+1); - if(ma) { - init_render_material(ma); - if(ma->texco & TEXCO_ORCO) { - if (need_orco_r) *need_orco_r= 1; - } - } - } } void mesh_create_shadedColors(Object *ob, int onlyForMesh, unsigned int **col1_r, unsigned int **col2_r) @@ -833,7 +449,7 @@ void mesh_create_shadedColors(Object *ob, int onlyForMesh, unsigned int **col1_r Mat4MulVecfl(mat, vec); fastshade(vec, vn, orco?&orco[vidx[j]*3]:mv->co, ma, col1, col2, mcol); } - } + } MEM_freeN(vnors); displistmesh_free(dlm); @@ -1693,304 +1309,9 @@ void makeDispListCurveTypes(Object *ob, int forOrco) boundbox_displist(ob); } -/*******************************/ -/***** OUTLINE *****/ -/*******************************/ - -typedef struct Sample{ - short x, y; -} Sample; - -typedef struct Segment{ - /* coordinates */ - struct Segment * next, * prev; - float co[2]; -} Segment; - - - -static int dflt_in_out(struct ImBuf * ibuf, int x, int y) -{ - unsigned char * rect; - - if (ibuf == 0) return (0); - if (x < 0 || y < 0 || x >= ibuf->x || y >= ibuf->y || ibuf->rect == 0) return (-1); - - rect = (unsigned char *) (ibuf->rect + (y * ibuf->x) + x); - if (rect[0] > 0x81) return (1); - return(0); -} - - -static Sample * outline(struct ImBuf * ibuf, - int (*in_or_out)(struct ImBuf *, int, int)) -{ - static int dirs[8][2] = { - {-1, 0}, {-1, 1}, {0, 1}, {1, 1}, - {1, 0}, {1, -1}, {0, -1}, {-1, -1} - }; - - int dir, x, y, in, i; - int count, sampcount; - int startx = 0, starty = 0; - Sample * samp, * oldsamp; - - /* input: - * 1 - image - * 2 - pointer to function that defines which pixel 'in' or 'out' is - */ - - if (ibuf == 0) return (0); - if (ibuf->rect == 0) return (0); - - if (in_or_out == 0) in_or_out = dflt_in_out; - in = in_or_out(ibuf, 0, 0); - - /* search for first transition, and continue from there */ - for (y = 0; y < ibuf->y; y++) { - for (x = 0; x < ibuf->x; x++) { - if (in_or_out(ibuf, x, y) != in) { - /* found first 'other' point !! */ - - if (x != startx) dir = 0; - else dir = 6; - - startx = x; starty = y; - count = 1; - sampcount = 2000; - samp = MEM_mallocN(sampcount * sizeof(Sample), "wire_samples"); - - do{ - samp[count].x = x; samp[count].y = y; - count++; - - if (count >= sampcount) { - oldsamp = samp; - samp = MEM_mallocN(2 * sampcount * sizeof(Sample), "wire_samples"); - memcpy(samp, oldsamp, sampcount * sizeof(Sample)); - sampcount *= 2; - MEM_freeN(oldsamp); - } - - i = 0; - while(in_or_out(ibuf, x + dirs[dir][0], y + dirs[dir][1]) == in) { - dir = (dir + 1) & 0x7; - if (i++ == 9) break; - } - - if (i >= 8) { - /* this has to be a loose point */ - break; - } - - x += dirs[dir][0]; - y += dirs[dir][1]; - dir = (dir - 3) & 0x7; - } while(x != startx || y != starty); - - if (i >= 8) { - /* patch for loose points */ - MEM_freeN(samp); - } else { - count = count - 1; - samp[0].x = count >> 16; - samp[0].y = count; - return(samp); - } - } - } - } - /* printf("no transition \n"); */ - return(0); -} - - - -/*******************************/ -/***** WIREFRAME *****/ -/*******************************/ - - -static float DistToLine2D(short *v1, short *v2, short *v3) /* using Hesse formula :NO LINE PIECE! */ -{ - float a[2],deler; - - a[0] = v2[1]-v3[1]; - a[1] = v3[0]-v2[0]; - deler = sqrt(a[0]*a[0]+a[1]*a[1]); - if(deler == 0.0) return 0; - - return fabs((v1[0]-v2[0])*a[0]+(v1[1]-v2[1])*a[1])/deler; - -} - -static float ComputeMaxShpError(Sample *samp, int first, int last, int *splitPoint) - /* samp: Array of digitized points */ - /* first, last: Indices defining region */ - /* splitpoint: Point of maximum error */ -{ - int i; - float maxDist; /* Maximum error */ - float dist; /* Current error */ - - *splitPoint = (last - first + 1) / 2; - maxDist = 0.0; - - for (i = first + 1; i < last; i++) { - dist = DistToLine2D((short *)(samp+i), (short *)(samp+first), (short *)(samp+last)); - - if (dist >= maxDist) { - maxDist = dist; - *splitPoint = i; - } - } - - return (maxDist); -} - - -static void FitPoly(Sample *samp, int first, int last, float shperr, ListBase *seglist) - /* Samp: Array of digitized points */ - /* first,last: Indices of first and last pts in region */ - /* spherr: User-defined error squared */ -{ - Segment * seg; /* Control points segment*/ - float maxError; /* Maximum fitting error */ - int splitPoint; /* Point to split point set at */ - int nPts; /* Number of points in subset */ - - nPts = last - first + 1; - - /* Use heuristic if region only has two points in it */ - - seg = MEM_mallocN(sizeof(Segment), "wure_segment"); - - seg->co[0] = samp[first].x; - seg->co[1] = samp[first].y; - - if (nPts == 2) { - BLI_addtail(seglist, seg); - return; - } - - maxError = ComputeMaxShpError(samp, first, last, &splitPoint); - if (maxError < shperr) { - BLI_addtail(seglist, seg); - return; - } - - /* Fitting failed -- split at max error point and fit recursively */ - - FitPoly(samp, first, splitPoint, shperr, seglist); - FitPoly(samp, splitPoint, last, shperr, seglist); - - MEM_freeN(seg); -} - - -static void ibuf2wire(ListBase * wireframe, struct ImBuf * ibuf) -{ - int count; - Sample * samp; - - /* first make a list of samples */ - - samp = outline(ibuf, 0); - if (samp == 0) return; - - count = (samp[0].x << 16) + samp[0].y; - if (count) FitPoly(samp, 1, count, 1.0, wireframe); /* was 3.0. Frank */ - - MEM_freeN(samp); -} - - - void imagestodisplist(void) { - Base *base; - Object *ob; - Material *ma; - Tex *tex; - Mesh *me; - ListBase _wireframe, *wireframe; - DispList *dl; - Segment *seg; - float *data, xfac, yfac, xsi, ysi, vec[3], dum; - int tot; - - _wireframe.first= 0; - _wireframe.last= 0; - wireframe = &_wireframe; - - init_render_textures(); - - base= G.scene->base.first; - while(base) { - if(( (base->flag & SELECT) && (base->lay & G.scene->lay) ) ) { - if( base->object->type==OB_MESH) { - ob= base->object; - me= ob->data; - - ma= give_current_material(ob, 1); - - if(ma && ma->mtex[0] && ma->mtex[0]->tex) { - tex= ma->mtex[0]->tex; - - /* this takes care of correct loading of new imbufs */ - externtex(ma->mtex[0], vec, &dum, &dum, &dum, &dum, &dum); - - if(tex->type==TEX_IMAGE && tex->ima && tex->ima->ibuf) { - - ob->dtx |= OB_DRAWIMAGE; - - ibuf2wire(wireframe, tex->ima->ibuf); - - tot= 0; - seg = wireframe->first; - while (seg) { - tot++; - seg = seg->next; - } - - if(tot) { - float size[3]; - - freedisplist(&(ob->disp)); - - dl= MEM_callocN(sizeof(DispList), "makeDispListimage"); - dl->verts= MEM_callocN(3*sizeof(float)*tot, "dlverts"); - - BLI_addtail(&(ob->disp), dl); - dl->type= DL_POLY; - dl->parts= 1; - dl->nr= tot; - - xsi= 0.5*(tex->ima->ibuf->x); - ysi= 0.5*(tex->ima->ibuf->y); - - mesh_get_texspace(me, NULL, NULL, size); - xfac= size[0]/xsi; - yfac= size[1]/ysi; - - data= dl->verts; - seg = wireframe->first; - while (seg) { - data[0]= xfac*(seg->co[0]-xsi); - data[1]= yfac*(seg->co[1]-ysi); - data+= 3; - seg = seg->next; - } - BLI_freelistN(wireframe); - } - } - } - } - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); + /* removed */ } static void boundbox_displist(Object *ob) diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index fc27de989dc..663fe02aaf0 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -52,8 +52,9 @@ #include "DNA_texture_types.h" #include "DNA_scene_types.h" -#include "BLI_blenlib.h" #include "BLI_arithb.h" +#include "BLI_blenlib.h" +#include "BLI_jitter.h" #include "BLI_rand.h" #include "BKE_action.h" @@ -77,9 +78,10 @@ #include "BKE_screen.h" #include "BKE_utildefines.h" -#include "render.h" // externtex, bad level call (ton) #include "PIL_time.h" +#include "RE_render_ext.h" + /* temporal struct, used for reading return of mesh_get_mapped_verts_nors() */ typedef struct VeNoCo { float co[3], no[3]; @@ -1217,9 +1219,9 @@ static void init_mv_jit(float *jit, int num, int seed2) jit2= MEM_mallocN(12 + 2*sizeof(float)*num, "initjit"); for (i=0 ; i<4 ; i++) { - RE_jitterate1(jit, jit2, num, rad1); - RE_jitterate1(jit, jit2, num, rad1); - RE_jitterate2(jit, jit2, num, rad2); + BLI_jitterate1(jit, jit2, num, rad1); + BLI_jitterate1(jit, jit2, num, rad1); + BLI_jitterate2(jit, jit2, num, rad2); } MEM_freeN(jit2); rng_free(rng); @@ -1609,8 +1611,7 @@ void build_particle_system(Object *ob) if(me->totvert==0) return; if(ob==G.obedit) return; - - totpart= (R.flag & R_RENDERING)?paf->totpart:(paf->disp*paf->totpart)/100; + totpart= (G.rendering)?paf->totpart:(paf->disp*paf->totpart)/100; if(totpart==0) return; /* No returns after this line! */ diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 26711495252..b37e787729e 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -51,6 +51,7 @@ #include "DNA_image_types.h" #include "DNA_texture_types.h" #include "DNA_packedFile_types.h" +#include "DNA_scene_types.h" #include "DNA_userdef_types.h" #include "BLI_blenlib.h" @@ -275,86 +276,155 @@ void free_unused_animimages() /* *********** READ AND WRITE ************** */ -void makepicstring(char *string, int frame) +int BKE_imtype_is_movie(int imtype) { - short i,len; - char num[10], *extension; - - if (string==0) return; - - extension= ""; - - strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); - - len= strlen(string); - - /* can also: sprintf(num, "%04d", frame); */ - - i=4-sprintf(num,"%d",frame); - for(;i>0;i--){ - string[len]='0'; - len++; + switch(imtype) { + case R_MOVIE: + case R_AVIRAW: + case R_AVIJPEG: + case R_AVICODEC: + case R_QUICKTIME: + return 1; } - string[len]=0; - strcat(string,num); - - if(G.scene->r.scemode & R_EXTENSION) - addImageExtension(string); - + return 0; } -void addImageExtension(char *string) +void BKE_add_image_extension(char *string, int imtype) { char *extension=""; - + if(G.scene->r.imtype== R_IRIS) { if(!BLI_testextensie(string, ".rgb")) extension= ".rgb"; } - else if(G.scene->r.imtype==R_IRIZ) { + else if(imtype==R_IRIZ) { if(!BLI_testextensie(string, ".rgb")) extension= ".rgb"; } - else if(G.scene->r.imtype==R_RADHDR) { + else if(imtype==R_RADHDR) { if(!BLI_testextensie(string, ".hdr")) extension= ".hdr"; } - else if(G.scene->r.imtype==R_PNG) { + else if(imtype==R_PNG) { if(!BLI_testextensie(string, ".png")) extension= ".png"; } - else if(G.scene->r.imtype==R_TARGA) { - if(!BLI_testextensie(string, ".tga")) - extension= ".tga"; - } - else if(G.scene->r.imtype==R_RAWTGA) { + else if(imtype==R_RAWTGA) { if(!BLI_testextensie(string, ".tga")) extension= ".tga"; } - else if(G.scene->r.imtype==R_JPEG90) { + else if(ELEM5(imtype, R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90)) { if(!BLI_testextensie(string, ".jpg")) extension= ".jpg"; } - else if(G.scene->r.imtype==R_BMP) { + else if(imtype==R_BMP) { if(!BLI_testextensie(string, ".bmp")) extension= ".bmp"; } - else if(G.have_libtiff && (G.scene->r.imtype==R_TIFF)) { + else if(G.have_libtiff && (imtype==R_TIFF)) { if(!BLI_testextensie(string, ".tif")) extension= ".tif"; } #ifdef WITH_OPENEXR - else if(G.scene->r.imtype==R_OPENEXR) { + else if(imtype==R_OPENEXR) { if(!BLI_testextensie(string, ".exr")) extension= ".exr"; } #endif - + else { /* targa default */ + if(!BLI_testextensie(string, ".tga")) + extension= ".tga"; + } + strcat(string, extension); } +int BKE_write_ibuf(ImBuf *ibuf, char *name, int imtype, int subimtype, int quality) +{ + int ok; + + if(imtype==0); + else if(imtype== R_IRIS) ibuf->ftype= IMAGIC; + else if ((imtype==R_RADHDR)) { + ibuf->ftype= RADHDR; + } + else if ((imtype==R_PNG)) { + ibuf->ftype= PNG; + } + else if ((imtype==R_BMP)) { + ibuf->ftype= BMP; + } + else if ((G.have_libtiff) && (imtype==R_TIFF)) { + ibuf->ftype= TIF; + } +#ifdef WITH_OPENEXR + else if (imtype==R_OPENEXR) { + ibuf->ftype= OPENEXR; + if(subimtype & R_OPENEXR_HALF) + ibuf->ftype |= OPENEXR_HALF; + ibuf->ftype |= (quality & OPENEXR_COMPRESS); + + if(!(subimtype & R_OPENEXR_ZBUF)) + ibuf->zbuf_float = NULL; /* signal for exr saving */ + + } +#endif + else if (imtype==R_TARGA) { + ibuf->ftype= TGA; + } + else if(imtype==R_RAWTGA) { + ibuf->ftype= RAWTGA; + } + else if(imtype==R_HAMX) { + ibuf->ftype= AN_hamx; + } + else if ELEM(imtype, R_JPEG90, R_MOVIE) { + if(quality < 10) quality= 90; + ibuf->ftype= JPG|quality; + } + else ibuf->ftype= TGA; + + BLI_make_existing_file(name); + + ok = IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat); + if (ok == 0) { + perror(name); + } + + return(ok); +} + + +void BKE_makepicstring(char *string, int frame) +{ + short i,len; + char num[10], *extension; + + if (string==0) return; + + extension= ""; + + strcpy(string, G.scene->r.pic); + BLI_convertstringcode(string, G.sce, G.scene->r.cfra); + + len= strlen(string); + + /* can also: sprintf(num, "%04d", frame); */ + + i=4-sprintf(num,"%d",frame); + for(;i>0;i--){ + string[len]='0'; + len++; + } + string[len]=0; + strcat(string,num); + + if(G.scene->r.scemode & R_EXTENSION) + BKE_add_image_extension(string, G.scene->r.imtype); + +} + /* ******** IMAGE WRAPPING INIT ************* */ /* used by sequencer, texture */ @@ -519,7 +589,6 @@ void ima_ibuf_is_nul(Tex *tex, Image *ima) if (ima->anim) { dur = IMB_anim_get_duration(ima->anim); - ima->lastquality= R.osa; fra= ima->lastframe-1; if(fra<0) fra = 0; @@ -544,8 +613,6 @@ void ima_ibuf_is_nul(Tex *tex, Image *ima) load_image(ima, IB_rect, G.sce, G.scene->r.cfra); if (tex->imaflag & TEX_FIELDS) de_interlacefunc(ima->ibuf); - - ima->lastquality= R.osa; } if(ima->ibuf) { @@ -573,14 +640,11 @@ void ima_ibuf_is_nul(Tex *tex, Image *ima) converttopremul(ima->ibuf); } - if(R.osa) { - - if(tex->imaflag & TEX_ANTISCALE) { - IMB_clever_double(ima->ibuf); - IMB_antialias(ima->ibuf); - } - else if(tex->imaflag & TEX_ANTIALI) IMB_antialias(ima->ibuf); + if(tex->imaflag & TEX_ANTISCALE) { + IMB_clever_double(ima->ibuf); + IMB_antialias(ima->ibuf); } + else if(tex->imaflag & TEX_ANTIALI) IMB_antialias(ima->ibuf); } if(ima->ibuf) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 60ba7f3cfeb..b6b4f9a3bcb 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -57,6 +57,7 @@ #include "DNA_sound_types.h" #include "DNA_texture_types.h" #include "DNA_view3d_types.h" +#include "DNA_world_types.h" #include "BLI_blenlib.h" #include "BLI_arithb.h" @@ -178,9 +179,9 @@ float frame_to_float(int cfra) /* see also bsystem_time in object.c */ float ctime; ctime= (float)cfra; - if(R.flag & R_SEC_FIELD) { - if((R.r.mode & R_FIELDSTILL)==0) ctime+= 0.5; - } +// if(R.flag & R_SEC_FIELD) { +// if((R.r.mode & R_FIELDSTILL)==0) ctime+= 0.5; +// } ctime+= bluroffs; ctime*= G.scene->r.framelen; diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index a2e372f33d5..e0006c854cf 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -45,6 +45,7 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "BKE_action.h" #include "BKE_bad_level_calls.h" diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index c617541e225..b95c401808d 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -34,6 +34,8 @@ */ #include +#include + #include "MEM_guardedalloc.h" #include "DNA_curve_types.h" @@ -61,10 +63,18 @@ #include "BPY_extern.h" +/* used in UI and render */ +Material defmaterial; + +/* called on startup, creator.c */ +void init_def_material(void) +{ + init_material(&defmaterial); +} + /* not material itself */ void free_material(Material *ma) { - MaterialLayer *ml; MTex *mtex; int a; @@ -81,11 +91,6 @@ void free_material(Material *ma) BKE_icon_delete((struct ID*)ma); ma->id.icon_id = 0; - - for(ml= ma->layers.first; ml; ml= ml->next) - if(ml->mat) ml->mat->id.us--; - - BLI_freelistN(&ma->layers); /* is no lib link block, but material extension */ if(ma->nodetree) { @@ -134,7 +139,6 @@ void init_material(Material *ma) ma->rampfac_col= 1.0; ma->rampfac_spec= 1.0; ma->pr_lamp= 3; /* two lamps, is bits */ - ma->ml_flag= ML_RENDER; /* default render base material for layers */ ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; } @@ -153,7 +157,6 @@ Material *add_material(char *name) Material *copy_material(Material *ma) { Material *man; - MaterialLayer *ml; int a; man= copy_libblock(ma); @@ -173,10 +176,6 @@ Material *copy_material(Material *ma) if(ma->ramp_col) man->ramp_col= MEM_dupallocN(ma->ramp_col); if(ma->ramp_spec) man->ramp_spec= MEM_dupallocN(ma->ramp_spec); - duplicatelist(&man->layers, &ma->layers); - for(ml= man->layers.first; ml; ml= ml->next) - id_us_plus((ID *)ml->mat); - if(ma->nodetree) { man->nodetree= ntreeCopyTree(ma->nodetree, 0); /* 0 == full new tree */ } @@ -274,25 +273,10 @@ void make_local_material(Material *ma) new_id(0, (ID *)ma, 0); } else if(local && lib) { - Material *mat; - MaterialLayer *ml; man= copy_material(ma); man->id.us= 0; - /* do material layers */ - for(mat= G.main->mat.first; mat; mat= mat->id.next) { - if(mat->id.lib==NULL) { - for(ml= mat->layers.first; ml; ml= ml->next) { - if(ml->mat==ma) { - ml->mat= man; - man->id.us++; - ma->id.us--; - } - } - } - } - /* do objects */ ob= G.main->object.first; while(ob) { @@ -579,7 +563,7 @@ void new_material_to_objectdata(Object *ob) ob->actcol= ob->totcol; } -static void do_init_render_material(Material *ma) +static void do_init_render_material(Material *ma, int osa, float *amb) { MTex *mtex; int a, needuv=0; @@ -595,48 +579,41 @@ static void do_init_render_material(Material *ma) ma->texco |= mtex->texco; ma->mapto |= mtex->mapto; - if(R.osa) { + if(osa) { if ELEM3(mtex->tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP) ma->texco |= TEXCO_OSA; } if(ma->texco & (TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM|TEXCO_STRAND|TEXCO_STRESS)) needuv= 1; else if(ma->texco & (TEXCO_GLOB|TEXCO_UV|TEXCO_OBJECT)) needuv= 1; else if(ma->texco & (TEXCO_LAVECTOR|TEXCO_VIEW|TEXCO_STICKY)) needuv= 1; - - if(mtex->object) mtex->object->flag |= OB_DO_IMAT; - } } - if(ma->mode & MA_ZTRA) { - /* if(ma->alpha==0.0 || ma->alpha==1.0) */ - if(R.flag & R_RENDERING) R.flag |= R_ZTRA; - } if(ma->mode & MA_RADIO) needuv= 1; if(ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE)) { needuv= 1; - if(R.osa) ma->texco |= TEXCO_OSA; /* for texfaces */ + if(osa) ma->texco |= TEXCO_OSA; /* for texfaces */ } if(needuv) ma->texco |= NEED_UV; // since the raytracer doesnt recalc O structs for each ray, we have to preset them all if(ma->mode & (MA_RAYMIRROR|MA_RAYTRANSP|MA_SHADOW_TRA)) { ma->texco |= NEED_UV|TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM; - if(R.osa) ma->texco |= TEXCO_OSA; + if(osa) ma->texco |= TEXCO_OSA; } - ma->ambr= ma->amb*R.wrld.ambr; - ma->ambg= ma->amb*R.wrld.ambg; - ma->ambb= ma->amb*R.wrld.ambb; + ma->ambr= ma->amb*amb[0]; + ma->ambg= ma->amb*amb[1]; + ma->ambb= ma->amb*amb[2]; - /* will become or-ed result of all layer modes */ + /* will become or-ed result of all node modes */ ma->mode_l= ma->mode; } -void init_render_material(Material *mat) +void init_render_material(Material *mat, int osa, float *amb) { - do_init_render_material(mat); + do_init_render_material(mat, osa, amb); if(mat->nodetree && mat->use_nodes) { bNode *node; @@ -645,26 +622,26 @@ void init_render_material(Material *mat) if(node->id && GS(node->id->name)==ID_MA) { Material *ma= (Material *)node->id; if(ma!=mat) { - do_init_render_material(ma); + do_init_render_material(ma, osa, amb); mat->texco |= ma->texco; mat->mode_l |= ma->mode_l; } } } /* parses the geom nodes */ - mat->texco |= ntreeShaderGetTexco(mat->nodetree); + mat->texco |= ntreeShaderGetTexco(mat->nodetree, osa); ntreeBeginExecTree(mat->nodetree); /* has internal flag to detect it only does it once */ } } -void init_render_materials() +void init_render_materials(int osa, float *amb) { Material *ma; /* two steps, first initialize, then or the flags for layers */ for(ma= G.main->mat.first; ma; ma= ma->id.next) if(ma->id.us) - init_render_material(ma); + init_render_material(ma, osa, amb); } /* only needed for nodes now */ @@ -815,3 +792,89 @@ void delete_material_index() freedisplist(&ob->disp); } } + + +/* r g b = current value, col = new value, fac==0 is no change */ +/* if g==NULL, it only does r channel */ +void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) +{ + float tmp, facm= 1.0-fac; + + switch (type) { + case MA_RAMP_BLEND: + *r = facm*(*r) + fac*col[0]; + if(g) { + *g = facm*(*g) + fac*col[1]; + *b = facm*(*b) + fac*col[2]; + } + break; + case MA_RAMP_ADD: + *r += fac*col[0]; + if(g) { + *g += fac*col[1]; + *b += fac*col[2]; + } + break; + case MA_RAMP_MULT: + *r *= (facm + fac*col[0]); + if(g) { + *g *= (facm + fac*col[1]); + *b *= (facm + fac*col[2]); + } + break; + case MA_RAMP_SCREEN: + *r = 1.0 - (facm + fac*(1.0 - col[0])) * (1.0 - *r); + if(g) { + *g = 1.0 - (facm + fac*(1.0 - col[1])) * (1.0 - *g); + *b = 1.0 - (facm + fac*(1.0 - col[2])) * (1.0 - *b); + } + break; + case MA_RAMP_SUB: + *r -= fac*col[0]; + if(g) { + *g -= fac*col[1]; + *b -= fac*col[2]; + } + break; + case MA_RAMP_DIV: + if(col[0]!=0.0) + *r = facm*(*r) + fac*(*r)/col[0]; + if(g) { + if(col[1]!=0.0) + *g = facm*(*g) + fac*(*g)/col[1]; + if(col[2]!=0.0) + *b = facm*(*b) + fac*(*b)/col[2]; + } + break; + case MA_RAMP_DIFF: + *r = facm*(*r) + fac*fabs(*r-col[0]); + if(g) { + *g = facm*(*g) + fac*fabs(*g-col[1]); + *b = facm*(*b) + fac*fabs(*b-col[2]); + } + break; + case MA_RAMP_DARK: + tmp= fac*col[0]; + if(tmp < *r) *r= tmp; + if(g) { + tmp= fac*col[1]; + if(tmp < *g) *g= tmp; + tmp= fac*col[2]; + if(tmp < *b) *b= tmp; + } + break; + case MA_RAMP_LIGHT: + tmp= fac*col[0]; + if(tmp > *r) *r= tmp; + if(g) { + tmp= fac*col[1]; + if(tmp > *g) *g= tmp; + tmp= fac*col[2]; + if(tmp > *b) *b= tmp; + } + break; + } + +} + + diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 09408e4a220..9429183105b 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -30,8 +30,6 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * * Contributor(s): Jiri Hnidek . * * ***** END GPL/BL DUAL LICENSE BLOCK ***** @@ -1106,7 +1104,6 @@ void vnormal (MB_POINT *point, PROCESS *p, MB_POINT *v) } if(FALSE) { - /* if(R.flag & R_RENDERING) { */ MB_POINT temp; delta*= 2.0; @@ -2002,7 +1999,7 @@ void metaball_polygonize(Object *ob) mb= ob->data; if(totelem==0) return; - if(!(R.flag & R_RENDERING) && (mb->flag==MB_UPDATE_NEVER)) return; + if(!(G.rendering) && (mb->flag==MB_UPDATE_NEVER)) return; if(G.moving && mb->flag==MB_UPDATE_FAST) return; freedisplist(&ob->disp); @@ -2029,7 +2026,7 @@ void metaball_polygonize(Object *ob) if(totelem > 1024) init_metaball_octal_tree(5); /* width is size per polygonize cube */ - if(R.flag & R_RENDERING) width= mb->rendersize; + if(G.rendering) width= mb->rendersize; else { width= mb->wiresize; if(G.moving && mb->flag==MB_UPDATE_HALFRES) width*= 2; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index da18725c2dd..f7d0be1ac33 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -47,6 +47,7 @@ #include "BLI_blenlib.h" #include "MEM_guardedalloc.h" +#include "IMB_imbuf.h" /* not very important, but the stack solver likes to know a maximum */ #define MAX_SOCKET 64 @@ -77,6 +78,8 @@ void ntreeInitTypes(bNodeTree *ntree) if(ntree->type==NTREE_SHADER) ntree->alltypes= node_all_shaders; + else if(ntree->type==NTREE_COMPOSIT) + ntree->alltypes= node_all_composit; else { ntree->alltypes= NULL; printf("Error: no type definitions for nodes\n"); @@ -702,6 +705,14 @@ bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup) else if(type==SH_NODE_CURVE_RGB) node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); } + else if(ntree->type==NTREE_COMPOSIT) { + if(type==CMP_NODE_VALTORGB) + node->storage= add_colorband(1); + else if(type==CMP_NODE_CURVE_VEC) + node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); + else if(type==CMP_NODE_CURVE_RGB) + node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); + } return node; } @@ -735,6 +746,12 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node) else nnode->storage= MEM_dupallocN(nnode->storage); } + else if(ntree->type==NTREE_COMPOSIT) { + if(node->type==CMP_NODE_CURVE_VEC || node->type==CMP_NODE_CURVE_RGB) + nnode->storage= curvemapping_copy(node->storage); + else + nnode->storage= MEM_dupallocN(nnode->storage); + } else nnode->storage= MEM_dupallocN(nnode->storage); } @@ -832,6 +849,12 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node) else MEM_freeN(node->storage); } + else if(ntree->type==NTREE_COMPOSIT) { + if(node->type==CMP_NODE_CURVE_VEC || node->type==CMP_NODE_CURVE_RGB) + curvemapping_free(node->storage); + else + MEM_freeN(node->storage); + } else MEM_freeN(node->storage); } @@ -843,6 +866,8 @@ void ntreeFreeTree(bNodeTree *ntree) { bNode *node, *next; + if(ntree==NULL) return; + BLI_freelistN(&ntree->links); /* do first, then unlink_node goes fast */ for(node= ntree->nodes.first; node; node= next) { @@ -1070,6 +1095,9 @@ void ntreeSolveOrder(bNodeTree *ntree) bNodeLink *link; int a, totnode=0; + /* the solve-order is called on each tree change, so we should be sure no exec can be running */ + ntreeEndExecTree(ntree); + /* set links pointers the input sockets, to find dependencies */ /* first clear data */ for(node= ntree->nodes.first; node; node= node->next) { @@ -1110,8 +1138,8 @@ void ntreeSolveOrder(bNodeTree *ntree) MEM_freeN(nodesort); /* find the active outputs, tree type dependant, might become handler */ - if(ntree->type==NTREE_SHADER) { - /* shader nodes only accepts one output */ + if(ntree->type==NTREE_SHADER || ntree->type==NTREE_COMPOSIT) { + /* shader/composit nodes only accepts one output */ int output= 0; for(node= ntree->nodes.first; node; node= node->next) { @@ -1127,9 +1155,6 @@ void ntreeSolveOrder(bNodeTree *ntree) /* here we could recursively set which nodes have to be done, might be different for editor or for "real" use... */ - - - } #pragma mark /* *************** preview *********** */ @@ -1138,12 +1163,9 @@ void ntreeSolveOrder(bNodeTree *ntree) static void nodeInitPreview(bNode *node, int xsize, int ysize) { - /* signal we don't do anything, preview writing is protected */ - if(xsize==0 || ysize==0) - return; /* sanity checks & initialize */ - if(node->preview) { + if(node->preview && node->preview->rect) { if(node->preview->xsize!=xsize && node->preview->ysize!=ysize) { MEM_freeN(node->preview->rect); node->preview->rect= NULL; @@ -1154,6 +1176,11 @@ static void nodeInitPreview(bNode *node, int xsize, int ysize) node->preview= MEM_callocN(sizeof(bNodePreview), "node preview"); printf("added preview %s\n", node->name); } + + /* node previews can get added with variable size this way */ + if(xsize==0 || ysize==0) + return; + if(node->preview->rect==NULL) { node->preview->rect= MEM_callocN(4*xsize + xsize*ysize*sizeof(float)*4, "node preview rect"); node->preview->xsize= xsize; @@ -1293,17 +1320,31 @@ static int ntree_begin_exec_tree(bNodeTree *ntree) void ntreeBeginExecTree(bNodeTree *ntree) { - int index; /* goes recursive over all groups */ - index= ntree_begin_exec_tree(ntree); + ntree->stacksize= ntree_begin_exec_tree(ntree); - if(index) { + if(ntree->stacksize) { + bNode *node; bNodeStack *ns; int a; - ns=ntree->stack= MEM_callocN(index*sizeof(bNodeStack), "node stack"); - for(a=0; ahasinput= 1; + /* allocate stack */ + ns=ntree->stack= MEM_callocN(ntree->stacksize*sizeof(bNodeStack), "node stack"); + + /* tag inputs, the get_stack() gives own socket stackdata if not in use */ + for(a=0; astacksize; a++, ns++) ns->hasinput= 1; + + /* tag outputs, so we know when we can skip operations */ + for(node= ntree->nodes.first; node; node= node->next) { + bNodeSocket *sock; + for(sock= node->inputs.first; sock; sock= sock->next) { + if(sock->link) { + ns= ntree->stack + sock->link->fromsock->stack_index; + ns->hasoutput= 1; + } + } + } ntree->stack1= MEM_dupallocN(ntree->stack); } @@ -1315,7 +1356,21 @@ void ntreeEndExecTree(bNodeTree *ntree) { if(ntree->init & NTREE_EXEC_INIT) { + if(ntree->stack) { + + /* another callback candidate! */ + if(ntree->type==NTREE_COMPOSIT) { + bNodeStack *ns; + int a; + + for(ns= ntree->stack, a=0; astacksize; a++, ns++) + if(ns->data) + free_compbuf(ns->data); + for(ns= ntree->stack1, a=0; astacksize; a++, ns++) + if(ns->data) + free_compbuf(ns->data); + } MEM_freeN(ntree->stack); ntree->stack= NULL; MEM_freeN(ntree->stack1); @@ -1352,37 +1407,23 @@ void ntreeExecTree(bNodeTree *ntree, void *callerdata, int thread) bNodeStack *stack; /* only when initialized */ - if(ntree->init & NTREE_EXEC_INIT) { - - if(thread) - stack= ntree->stack1; - else - stack= ntree->stack; + if((ntree->init & NTREE_EXEC_INIT)==0) + ntreeBeginExecTree(ntree); - for(node= ntree->nodes.first; node; node= node->next) { - if(node->typeinfo->execfunc) { - node_get_stack(node, stack, nsin, nsout); - node->typeinfo->execfunc(callerdata, node, nsin, nsout); - } - else if(node->type==NODE_GROUP && node->id) { - node_get_stack(node, stack, nsin, nsout); - node_group_execute(stack, callerdata, node, nsin, nsout); - } - } - } -} - -/* clear one pixel in all the preview images */ -void ntreeClearPixelTree(bNodeTree *ntree, int x, int y) -{ - bNode *node; - float vec[4]= {0.0f, 0.0f, 0.0f, 0.0f}; + if(thread) + stack= ntree->stack1; + else + stack= ntree->stack; - /* only when initialized */ - if(ntree->init & NTREE_EXEC_INIT) { - for(node= ntree->nodes.first; node; node= node->next) { - if(node->preview) - nodeAddToPreview(node, vec, x, y); + for(node= ntree->nodes.first; node; node= node->next) { + if(node->typeinfo->execfunc) { + node_get_stack(node, stack, nsin, nsout); + node->typeinfo->execfunc(callerdata, node, nsin, nsout); + } + else if(node->type==NODE_GROUP && node->id) { + node_get_stack(node, stack, nsin, nsout); + node_group_execute(stack, callerdata, node, nsin, nsout); } } } + diff --git a/source/blender/blenkernel/intern/node_composit.c b/source/blender/blenkernel/intern/node_composit.c new file mode 100644 index 00000000000..b7d70b167ba --- /dev/null +++ b/source/blender/blenkernel/intern/node_composit.c @@ -0,0 +1,1372 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include + +#include "DNA_ID.h" +#include "DNA_image_types.h" +#include "DNA_node_types.h" +#include "DNA_material_types.h" +#include "DNA_scene_types.h" +#include "DNA_texture_types.h" +#include "DNA_vec_types.h" + +#include "BKE_blender.h" +#include "BKE_colortools.h" +#include "BKE_global.h" +#include "BKE_image.h" +#include "BKE_node.h" +#include "BKE_material.h" +#include "BKE_texture.h" +#include "BKE_utildefines.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +#include "MEM_guardedalloc.h" +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" + +#include "RE_pipeline.h" + +/* *************************** operations support *************************** */ + +/* general signal that's in output sockets, and goes over the wires */ +typedef struct CompBuf { + float *rect; + int x, y; + short type, malloc; + rcti disprect; /* cropped part of image */ + int xof, yof; /* relative to center of target image */ +} CompBuf; + +/* defines also used for pixel size */ +#define CB_RGBA 4 +#define CB_VAL 1 + +static CompBuf *alloc_compbuf(int sizex, int sizey, int type, int alloc) +{ + CompBuf *cbuf= MEM_callocN(sizeof(CompBuf), "compbuf"); + + cbuf->x= sizex; + cbuf->y= sizey; + cbuf->type= type; + if(alloc) { + if(cbuf->type==CB_RGBA) + cbuf->rect= MEM_mallocN(4*sizeof(float)*sizex*sizey, "new rect"); + else + cbuf->rect= MEM_mallocN(sizeof(float)*sizex*sizey, "new rect"); + cbuf->malloc= 1; + } + cbuf->disprect.xmin= 0; + cbuf->disprect.ymin= 0; + cbuf->disprect.xmax= sizex; + cbuf->disprect.ymax= sizey; + + return cbuf; +} + +void free_compbuf(CompBuf *cbuf) +{ + if(cbuf->malloc && cbuf->rect) + MEM_freeN(cbuf->rect); + MEM_freeN(cbuf); +} + +#if 0 +/* on first call, disprect should be initialized to 'out', then you can call this on all 'src' images */ +static void get_overlap_rct(CompBuf *out, CompBuf *src, rcti *disprect) +{ + rcti rect; + /* output center is considered (0,0) */ + + if(src==NULL) return; + + /* translate src into output space */ + rect= src->disprect; + BLI_translate_rcti(&rect, out->xof-src->xof, out->xof-src->xof); + /* intersect rect with current disprect */ + + BLI_isect_rcti(&rect, disprect, disprect); +} + +static void get_scanline_rcti(CompBuf *out, rcti *disprect, CompBuf *src, rcti *srcrect) +{ + int xof, yof; + + /* translate src into output space */ + xof= out->xof-src->xof; + yof= out->xof-src->xof; + + srcrect->xmin= disprect->xmin + xof; + srcrect->ymin= disprect->ymin + yof; + srcrect->xmax= disprect->xmax + xof; + srcrect->ymax= disprect->ymax + yof; +} +#endif + +/* Pixel-to-Pixel operation, 1 Image in, 1 out */ +static void composit1_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col, + void (*func)(bNode *, float *, float *)) +{ + float *outfp, *srcfp, *out_data, *src_data; + int outx, outy; + int srcx, srcy; + int out_pix, out_stride, src_stride, src_pix, x, y; + + outx= out->x; + outy= out->y; + out_pix= out->type; + out_stride= out->x; + out_data= out->rect; + + /* handle case when input is constant color */ + if(src_buf==NULL) { + srcx= outx; srcy= outy; + src_stride= 0; + src_pix= 0; + src_data= src_col; + } + else { + srcx= src_buf->x; + srcy= src_buf->y; + src_stride= srcx; + src_pix= src_buf->type; + src_data= src_buf->rect; + } + + outx= MIN2(outx, srcx); + outy= MIN2(outy, srcy); + + for(y=0; yx, outy= out->y; + int srcx, srcy, facx, facy; + int out_pix, src_stride, src_pix, fac_stride, fac_pix, x, y; + + out_pix= out->type; + + /* handle case when input is constant color */ + if(src_buf==NULL) { + srcx= outx; srcy= outy; + src_stride= 0; + src_pix= 0; + src_data= src_col; + } + else { + srcx= src_buf->x; + srcy= src_buf->y; + src_stride= srcx; + src_pix= src_buf->type; + src_data= src_buf->rect; + } + + /* factor buf or constant? */ + if(fac_buf==NULL) { + facx= outx; facy= outy; + fac_stride= 0; + fac_pix= 0; + fac_data= fac; + } + else { + facx= fac_buf->x; + facy= fac_buf->y; + fac_stride= facx; + fac_pix= src_buf->type; + fac_data= fac_buf->rect; + } + + if(fac_data==NULL) { + printf("fac buffer error, node %s\n", node->name); + return; + } + + facx= MIN2(facx, srcx); + facy= MIN2(facy, srcy); + +#if 0 + if(src_buf) { + rcti disprect; + + disprect= out->disprect; + get_overlap_rct(out, src_buf, &disprect); + printf("%s\n", node->name); + printf("union %d %d %d %d\n", disprect.xmin,disprect.ymin,disprect.xmax,disprect.ymax); + } + /* new approach */ + outfp= out->rect_float + src.ymin*outx + ; + for(y=src.ymin; y=disp.ymin && y=disp.xmin && xrect; + for(y=0; yx, outy= out->y; + int src1x, src1y, src2x, src2y, facx, facy; + int src1_stride, src1_pix, src2_stride, src2_pix, fac_stride, fac_pix, x, y; + + /* handle case when input has constant color */ + if(src1_buf==NULL) { + src1x= outx; src1y= outy; + src1_stride= 0; + src1_pix= 0; + src1_data= src1_col; + } + else { + src1x= src1_buf->x; + src1y= src1_buf->y; + src1_stride= src1x; + src1_pix= src1_buf->type; + src1_data= src1_buf->rect; + } + + if(src2_buf==NULL) { + src2x= outx; src2y= outy; + src2_stride= 0; + src2_pix= 0; + src2_data= src2_col; + } + else { + src2x= src2_buf->x; + src2y= src2_buf->y; + src2_stride= src2x; + src2_pix= src2_buf->type; + src2_data= src2_buf->rect; + } + + /* factor buf or constant? */ + if(fac_buf==NULL) { + facx= outx; facy= outy; + fac_stride= 0; + fac_pix= 0; + fac_data= &fac; + } + else { + facx= fac_buf->x; + facy= fac_buf->y; + fac_stride= facx; + fac_pix= 1; + fac_data= fac_buf->rect; + } + + facx= MIN3(facx, src1x, src2x); + facy= MIN3(facy, src1y, src2y); + + outfp= out->rect; + for(y=0; yx, cbuf->y, CB_VAL, 1); + float *valf, *rectf; + int tot; + + valf= valbuf->rect; + rectf= cbuf->rect + 3; + for(tot= cbuf->x*cbuf->y; tot>0; tot--, valf++, rectf+=4) + *valf= *rectf; + + return valbuf; +} + +static void generate_preview(bNode *node, CompBuf *stackbuf) +{ + bNodePreview *preview= node->preview; + + if(preview) { + ImBuf *ibuf= IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0, 0); /* empty */ + + if(stackbuf->x > stackbuf->y) { + preview->xsize= 140; + preview->ysize= (140*stackbuf->y)/stackbuf->x; + } + else { + preview->ysize= 140; + preview->xsize= (140*stackbuf->x)/stackbuf->y; + } + ibuf->rect_float= stackbuf->rect; + ibuf= IMB_scalefastImBuf(ibuf, preview->xsize, preview->ysize); + + /* this ensures free-imbuf does the right stuff */ + SWAP(float *, ibuf->rect_float, node->preview->rect); + + IMB_freeImBuf(ibuf); + } +} + +/* ******************************************************** */ +/* ********* Composit Node type definitions ***************** */ +/* ******************************************************** */ + +/* SocketType syntax: + socket type, max connections (0 is no limit), name, 4 values for default, 2 values for range */ + +/* Verification rule: If name changes, a saved socket and its links will be removed! Type changes are OK */ + +/* **************** OUTPUT ******************** */ +static bNodeSocketType cmp_node_output_in[]= { + { SOCK_RGBA, 1, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { SOCK_VALUE, 1, "Alpha", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void do_copy_rgba(bNode *node, float *out, float *in) +{ + QUATCOPY(out, in); +} +static void do_copy_a_rgba(bNode *node, float *out, float *in, float *fac) +{ + VECCOPY(out, in); + out[3]= *fac; +} + +static void node_composit_exec_output(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* image assigned to output */ + /* stack order input sockets: col, alpha */ + + if(node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */ + Image *ima= (Image *)node->id; + CompBuf *cbuf; + int rectx, recty; + + /* scene size? */ + if(1) { + /* re-create output, derive size from scene */ + rectx= (G.scene->r.size*G.scene->r.xsch)/100; + recty= (G.scene->r.size*G.scene->r.ysch)/100; + + if(ima->ibuf) IMB_freeImBuf(ima->ibuf); + ima->ibuf= IMB_allocImBuf(rectx, recty, 32, IB_rectfloat, 0); // do alloc + + cbuf= alloc_compbuf(rectx, recty, CB_RGBA, 0); // no alloc + cbuf->rect= ima->ibuf->rect_float; + + /* when no alpha, we can simply copy */ + if(in[1]->data==NULL) + composit1_pixel_processor(node, cbuf, in[0]->data, in[0]->vec, do_copy_rgba); + else + composit2_pixel_processor(node, cbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_copy_a_rgba); + + generate_preview(node, cbuf); + free_compbuf(cbuf); + } + else { /* test */ + if(ima->ibuf) IMB_freeImBuf(ima->ibuf); + ima->ibuf= IMB_allocImBuf(rectx, recty, 32, 0, 0); // do alloc + ima->ibuf->mall= IB_rectfloat; + cbuf= in[0]->data; + ima->ibuf->rect_float= cbuf->rect; + ima->ibuf->x= cbuf->x; + ima->ibuf->y= cbuf->y; + cbuf->rect= NULL; + } + + } + else if(in[0]->data) + generate_preview(node, in[0]->data); +} + +static bNodeType cmp_node_output= { + /* type code */ CMP_NODE_OUTPUT, + /* name */ "Output", + /* width+range */ 80, 60, 200, + /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW, + /* input sock */ cmp_node_output_in, + /* output sock */ NULL, + /* storage */ "", + /* execfunc */ node_composit_exec_output + +}; + +/* **************** IMAGE ******************** */ +static bNodeSocketType cmp_node_image_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { SOCK_VALUE, 0, "Alpha", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_VALUE, 0, "Z", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void node_composit_exec_image(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* image assigned to output */ + /* stack order input sockets: col, alpha */ + if(node->id) { + Image *ima= (Image *)node->id; + CompBuf *stackbuf; + + /* test if image is OK */ + if(ima->ok==0) return; + if(ima->ibuf==NULL) { + load_image(ima, IB_rect, G.sce, G.scene->r.cfra); + if(ima->ibuf==NULL) { + ima->ok= 0; + return; + } + } + if(ima->ibuf->rect_float==NULL) + IMB_float_from_rect(ima->ibuf); + + /* we put imbuf copy on stack, cbuf knows rect is from other ibuf when freed! */ + stackbuf= alloc_compbuf(ima->ibuf->x, ima->ibuf->y, CB_RGBA, 0); + stackbuf->rect= ima->ibuf->rect_float; + + /* put ibuf on stack */ + out[0]->data= stackbuf; + + if(out[1]->hasoutput) + out[1]->data= alphabuf_from_rgbabuf(stackbuf); + + generate_preview(node, stackbuf); + } +} + +static bNodeType cmp_node_image= { + /* type code */ CMP_NODE_IMAGE, + /* name */ "Image", + /* width+range */ 120, 80, 300, + /* class+opts */ NODE_CLASS_GENERATOR, NODE_PREVIEW|NODE_OPTIONS, + /* input sock */ NULL, + /* output sock */ cmp_node_image_out, + /* storage */ "", + /* execfunc */ node_composit_exec_image + +}; + +/* **************** RENDER RESULT ******************** */ +static bNodeSocketType cmp_node_rresult_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { SOCK_VALUE, 0, "Alpha", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_VALUE, 0, "Z", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void node_composit_exec_rresult(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + RenderResult *rr= RE_GetResult(RE_GetRender("Render")); + if(rr) { + RenderLayer *rl= rr->layers.first; + CompBuf *stackbuf; + + /* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */ + stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0); + stackbuf->rect= rl->rectf; + + /* put on stack */ + out[0]->data= stackbuf; + + if(out[1]->hasoutput) + out[1]->data= alphabuf_from_rgbabuf(stackbuf); + + generate_preview(node, stackbuf); + } +} + +static bNodeType cmp_node_rresult= { + /* type code */ CMP_NODE_R_RESULT, + /* name */ "Render Result", + /* width+range */ 120, 80, 300, + /* class+opts */ NODE_CLASS_GENERATOR, NODE_PREVIEW, + /* input sock */ NULL, + /* output sock */ cmp_node_rresult_out, + /* storage */ "", + /* execfunc */ node_composit_exec_rresult + +}; + +/* **************** NORMAL ******************** */ +static bNodeSocketType cmp_node_normal_in[]= { + { SOCK_VECTOR, 1, "Normal", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, + { -1, 0, "" } +}; + +static bNodeSocketType cmp_node_normal_out[]= { + { SOCK_VECTOR, 0, "Normal", 0.0f, 0.0f, 1.0f, 1.0f, -1.0f, 1.0f}, + { SOCK_VALUE, 0, "Dot", 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +/* generates normal, does dot product */ +static void node_composit_exec_normal(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + bNodeSocket *sock= node->outputs.first; + /* stack order input: normal */ + /* stack order output: normal, value */ + + VECCOPY(out[0]->vec, sock->ns.vec); + /* render normals point inside... the widget points outside */ + out[1]->vec[0]= -INPR(out[0]->vec, in[0]->vec); +} + +static bNodeType cmp_node_normal= { + /* type code */ CMP_NODE_NORMAL, + /* name */ "Normal", + /* width+range */ 100, 60, 200, + /* class+opts */ NODE_CLASS_OPERATOR, NODE_OPTIONS, + /* input sock */ cmp_node_normal_in, + /* output sock */ cmp_node_normal_out, + /* storage */ "", + /* execfunc */ node_composit_exec_normal + +}; + +/* **************** CURVE VEC ******************** */ +static bNodeSocketType cmp_node_curve_vec_in[]= { + { SOCK_VECTOR, 1, "Vector", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, + { -1, 0, "" } +}; + +static bNodeSocketType cmp_node_curve_vec_out[]= { + { SOCK_VECTOR, 0, "Vector", 0.0f, 0.0f, 1.0f, 1.0f, -1.0f, 1.0f}, + { -1, 0, "" } +}; + +static void node_composit_exec_curve_vec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* stack order input: vec */ + /* stack order output: vec */ + + curvemapping_evaluate_premulRGBF(node->storage, out[0]->vec, in[0]->vec); +} + +static bNodeType cmp_node_curve_vec= { + /* type code */ CMP_NODE_CURVE_VEC, + /* name */ "Vector Curves", + /* width+range */ 200, 140, 320, + /* class+opts */ NODE_CLASS_OPERATOR, NODE_OPTIONS, + /* input sock */ cmp_node_curve_vec_in, + /* output sock */ cmp_node_curve_vec_out, + /* storage */ "CurveMapping", + /* execfunc */ node_composit_exec_curve_vec + +}; + +/* **************** CURVE RGB ******************** */ +static bNodeSocketType cmp_node_curve_rgb_in[]= { + { SOCK_RGBA, 1, "Image", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, + { -1, 0, "" } +}; + +static bNodeSocketType cmp_node_curve_rgb_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 1.0f, 1.0f, -1.0f, 1.0f}, + { -1, 0, "" } +}; + +static void do_curves(bNode *node, float *out, float *in) +{ + curvemapping_evaluateRGBF(node->storage, out, in); + out[3]= in[3]; +} + +static void node_composit_exec_curve_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* stack order input: vec */ + /* stack order output: vec */ + + if(out[0]->hasoutput==0) + return; + + /* input no image? then only color operation */ + if(in[0]->data==NULL) { + curvemapping_evaluateRGBF(node->storage, out[0]->vec, in[0]->vec); + } + else { + /* make output size of input image */ + CompBuf *cbuf= in[0]->data; + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs + + curvemapping_premultiply(node->storage, 0); + composit1_pixel_processor(node, stackbuf, in[0]->data, NULL, do_curves); + curvemapping_premultiply(node->storage, 1); + + out[0]->data= stackbuf; + } + +} + +static bNodeType cmp_node_curve_rgb= { + /* type code */ CMP_NODE_CURVE_RGB, + /* name */ "RGB Curves", + /* width+range */ 200, 140, 320, + /* class+opts */ NODE_CLASS_OPERATOR, NODE_OPTIONS, + /* input sock */ cmp_node_curve_rgb_in, + /* output sock */ cmp_node_curve_rgb_out, + /* storage */ "CurveMapping", + /* execfunc */ node_composit_exec_curve_rgb + +}; + +/* **************** VALUE ******************** */ +static bNodeSocketType cmp_node_value_out[]= { + { SOCK_VALUE, 0, "Value", 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void node_composit_exec_value(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + bNodeSocket *sock= node->outputs.first; + + out[0]->vec[0]= sock->ns.vec[0]; +} + +static bNodeType cmp_node_value= { + /* type code */ CMP_NODE_VALUE, + /* name */ "Value", + /* width+range */ 80, 40, 120, + /* class+opts */ NODE_CLASS_GENERATOR, NODE_OPTIONS, + /* input sock */ NULL, + /* output sock */ cmp_node_value_out, + /* storage */ "", + /* execfunc */ node_composit_exec_value + +}; + +/* **************** RGB ******************** */ +static bNodeSocketType cmp_node_rgb_out[]= { + { SOCK_RGBA, 0, "RGBA", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void node_composit_exec_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + bNodeSocket *sock= node->outputs.first; + + VECCOPY(out[0]->vec, sock->ns.vec); +} + +static bNodeType cmp_node_rgb= { + /* type code */ CMP_NODE_RGB, + /* name */ "RGB", + /* width+range */ 100, 60, 140, + /* class+opts */ NODE_CLASS_GENERATOR, NODE_OPTIONS, + /* input sock */ NULL, + /* output sock */ cmp_node_rgb_out, + /* storage */ "", + /* execfunc */ node_composit_exec_rgb + +}; + +/* **************** MIX RGB ******************** */ +static bNodeSocketType cmp_node_mix_rgb_in[]= { + { SOCK_VALUE, 1, "Fac", 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; +static bNodeSocketType cmp_node_mix_rgb_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float fac) +{ + float col[3]; + + VECCOPY(col, in1); + ramp_blend(node->custom1, col, col+1, col+2, fac, in2); + VECCOPY(out, col); + out[3]= in1[3]; +} + +static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* stack order in: fac, Image, Image */ + /* stack order out: Image */ + float fac= in[0]->vec[0]; + + CLAMP(fac, 0.0f, 1.0f); + + /* input no image? then only color operation */ + if(in[1]->data==NULL && in[2]->data==NULL) { + do_mix_rgb(node, out[0]->vec, in[1]->vec, in[2]->vec, fac); + } + else { + /* make output size of first available input image */ + CompBuf *cbuf= in[1]->data?in[1]->data:in[2]->data; + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs + + composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, fac, do_mix_rgb); + + out[0]->data= stackbuf; + } +} + +static bNodeType cmp_node_mix_rgb= { + /* type code */ CMP_NODE_MIX_RGB, + /* name */ "Mix", + /* width+range */ 80, 40, 120, + /* class+opts */ NODE_CLASS_OPERATOR, NODE_OPTIONS, + /* input sock */ cmp_node_mix_rgb_in, + /* output sock */ cmp_node_mix_rgb_out, + /* storage */ "", + /* execfunc */ node_composit_exec_mix_rgb + +}; + +/* **************** FILTER ******************** */ +static bNodeSocketType cmp_node_filter_in[]= { + { SOCK_VALUE, 1, "Fac", 1.0f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; +static bNodeSocketType cmp_node_filter_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac) +{ + float *row1, *row2, *row3; + float *fp, f1, f2, mfac= 1.0f-fac; + int rowlen, x, y, c; + + rowlen= in->x; + + if(in->type==CB_RGBA) { + + for(y=2; yy; y++) { + /* setup rows */ + row1= in->rect + 4*(y-2)*rowlen; + row2= row1 + 4*rowlen; + row3= row2 + 4*rowlen; + fp= out->rect + 4*(y-1)*rowlen + 4; + + for(x=2; xx; + + if(in->type==CB_RGBA) { + + for(y=2; yy; y++) { + /* setup rows */ + row1= in->rect + 4*(y-2)*rowlen; + row2= row1 + 4*rowlen; + row3= row2 + 4*rowlen; + fp= out->rect + 4*(y-1)*rowlen + 4; + + for(x=2; xdata) { + /* make output size of first available input image */ + CompBuf *cbuf= in[1]->data; + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs + + switch(node->custom1) { + case CMP_FILT_SOFT: + do_filter3(stackbuf, cbuf, soft, in[0]->vec[0]); + break; + case CMP_FILT_SHARP: + do_filter3(stackbuf, cbuf, sharp, in[0]->vec[0]); + break; + case CMP_FILT_LAPLACE: + do_filter3(stackbuf, cbuf, laplace, in[0]->vec[0]); + break; + case CMP_FILT_SOBEL: + do_filter_edge(stackbuf, cbuf, sobel, in[0]->vec[0]); + break; + case CMP_FILT_PREWITT: + do_filter_edge(stackbuf, cbuf, prewitt, in[0]->vec[0]); + break; + case CMP_FILT_KIRSCH: + do_filter_edge(stackbuf, cbuf, kirsch, in[0]->vec[0]); + break; + case CMP_FILT_SHADOW: + do_filter3(stackbuf, cbuf, shadow, in[0]->vec[0]); + break; + } + + out[0]->data= stackbuf; + } +} + +static bNodeType cmp_node_filter= { + /* type code */ CMP_NODE_FILTER, + /* name */ "Filter", + /* width+range */ 80, 40, 120, + /* class+opts */ NODE_CLASS_OPERATOR, NODE_OPTIONS, + /* input sock */ cmp_node_filter_in, + /* output sock */ cmp_node_filter_out, + /* storage */ "", + /* execfunc */ node_composit_exec_filter + +}; + + +/* **************** VALTORGB ******************** */ +static bNodeSocketType cmp_node_valtorgb_in[]= { + { SOCK_VALUE, 1, "Fac", 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; +static bNodeSocketType cmp_node_valtorgb_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { SOCK_VALUE, 0, "Alpha", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void do_colorband_composit(bNode *node, float *out, float *in) +{ + do_colorband(node->storage, in[0], out); +} + +static void node_composit_exec_valtorgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* stack order in: fac */ + /* stack order out: col, alpha */ + + if(node->storage) { + /* input no image? then only color operation */ + if(in[0]->data==NULL) { + do_colorband(node->storage, in[0]->vec[0], out[0]->vec); + } + else { + /* make output size of input image */ + CompBuf *cbuf= in[0]->data; + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs + + composit1_pixel_processor(node, stackbuf, in[0]->data, NULL, do_colorband_composit); + + out[0]->data= stackbuf; + + if(out[1]->hasoutput) + out[1]->data= alphabuf_from_rgbabuf(stackbuf); + + } + } +} + +static bNodeType cmp_node_valtorgb= { + /* type code */ CMP_NODE_VALTORGB, + /* name */ "ColorRamp", + /* width+range */ 240, 200, 300, + /* class+opts */ NODE_CLASS_OPERATOR, NODE_OPTIONS, + /* input sock */ cmp_node_valtorgb_in, + /* output sock */ cmp_node_valtorgb_out, + /* storage */ "ColorBand", + /* execfunc */ node_composit_exec_valtorgb + +}; + + +/* **************** RGBTOBW ******************** */ +static bNodeSocketType cmp_node_rgbtobw_in[]= { + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; +static bNodeSocketType cmp_node_rgbtobw_out[]= { + { SOCK_VALUE, 0, "Val", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void do_rgbtobw(bNode *node, float *out, float *in) +{ + out[0]= in[0]*0.35f + in[1]*0.45f + in[2]*0.2f; +} + +static void node_composit_exec_rgbtobw(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* stack order out: bw */ + /* stack order in: col */ + + /* input no image? then only color operation */ + if(in[0]->data==NULL) { + out[0]->vec[0]= in[0]->vec[0]*0.35f + in[0]->vec[1]*0.45f + in[0]->vec[2]*0.2f; + } + else { + /* make output size of input image */ + CompBuf *cbuf= in[0]->data; + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); // allocs + + composit1_pixel_processor(node, stackbuf, in[0]->data, NULL, do_rgbtobw); + + out[0]->data= stackbuf; + } +} + +static bNodeType cmp_node_rgbtobw= { + /* type code */ CMP_NODE_RGBTOBW, + /* name */ "RGB to BW", + /* width+range */ 80, 40, 120, + /* class+opts */ NODE_CLASS_OPERATOR, 0, + /* input sock */ cmp_node_rgbtobw_in, + /* output sock */ cmp_node_rgbtobw_out, + /* storage */ "", + /* execfunc */ node_composit_exec_rgbtobw + +}; + +/* **************** ALPHAOVER ******************** */ +static bNodeSocketType cmp_node_alphaover_in[]= { + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; +static bNodeSocketType cmp_node_alphaover_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void do_alphaover(bNode *node, float *out, float *src, float *dest) +{ + float mul= 1.0f - dest[3]; + + if(mul<=0.0f) { + QUATCOPY(out, dest); + } + else { + out[0]= (mul*src[0]) + dest[0]; + out[1]= (mul*src[1]) + dest[1]; + out[2]= (mul*src[2]) + dest[2]; + out[3]= (mul*src[3]) + dest[3]; + } +} + +static void node_composit_exec_alphaover(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + /* stack order in: col col */ + /* stack order out: col */ + + /* input no image? then only color operation */ + if(in[0]->data==NULL) { + do_alphaover(node, out[0]->vec, in[0]->vec, in[1]->vec); + } + else { + /* make output size of input image */ + CompBuf *cbuf= in[0]->data; + CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs + + composit2_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_alphaover); + + out[0]->data= stackbuf; + } +} + +static bNodeType cmp_node_alphaover= { + /* type code */ CMP_NODE_ALPHAOVER, + /* name */ "AlphaOver", + /* width+range */ 80, 40, 120, + /* class+opts */ NODE_CLASS_OPERATOR, 0, + /* input sock */ cmp_node_alphaover_in, + /* output sock */ cmp_node_alphaover_out, + /* storage */ "", + /* execfunc */ node_composit_exec_alphaover + +}; + +/* **************** GAUSS BLUR ******************** */ +static bNodeSocketType cmp_node_blur_in[]= { + { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; +static bNodeSocketType cmp_node_blur_out[]= { + { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + + +static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + CompBuf *new, *work, *img= in[0]->data; + register float sum, val; + float rval, gval, bval, aval; + float *gausstab, *v; + int r, n, m; + int x, y; + int i; + int step, bigstep; + float *src, *dest; + + + if(img==NULL || out[0]->hasoutput==0) + return; + + /* make output size of input image */ + new= alloc_compbuf(img->x, img->y, CB_RGBA, 1); // allocs + out[0]->data= new; + + /* prepare for gauss tab */ + r = (1.5 * node->custom1 + 1.5); + n = 2 * r + 1; + + /* ugly : */ + if ((img->x <= n) || (img->y <= n)) { + printf("gauss filter too large/n"); + return; + } + + gausstab = (float *) MEM_mallocN(n * sizeof(float), "gauss"); + + sum = 0.0f; + v = gausstab; + for (x = -r; x <= r; x++) { + val = exp(-4*(float ) (x*x)/ (float) (r*r)); + sum += val; + *v++ = val; + } + + i = n; + v = gausstab; + while (i--) { + *v++ /= sum; + } + + /* helper image */ + work= alloc_compbuf(img->x, img->y, CB_RGBA, 1); // allocs + + /* horizontal */ + step = (n - 1); + + for (y = 0; y < img->y; y++) { + src = img->rect + 4*(y * img->x); + dest = work->rect + 4*(y * img->x); + + for (x = r; x > 0 ; x--) { + m = n - x; + gval = rval= bval= aval= 0.0f; + sum = 0.0; + v = gausstab + x; + for (i = 0; i < m; i++) { + val = *v++; + sum += val; + rval += val * (*src++); + gval += val * (*src++); + bval += val * (*src++); + aval += val * (*src++); + } + *dest++ = rval / sum; + *dest++ = gval / sum; + *dest++ = bval / sum; + *dest++ = aval / sum; + + src -= 4*m; + } + + for (x = 0; x <= (img->x - n); x++) { + gval = rval= bval= aval= 0.0f; + v = gausstab; + + for (i = 0; i < n; i++) { + val = *v++; + rval += val * (*src++); + gval += val * (*src++); + bval += val * (*src++); + aval += val * (*src++); + } + *dest++ = rval; + *dest++ = gval; + *dest++ = bval; + *dest++ = aval; + src -= 4*step; + } + + for (x = 1; x <= r ; x++) { + m = n - x; + gval = rval= bval= aval= 0.0f; + sum = 0.0; + v = gausstab; + for (i = 0; i < m; i++) { + val = *v++; + sum += val; + rval += val * (*src++); + gval += val * (*src++); + bval += val * (*src++); + aval += val * (*src++); + } + *dest++ = rval / sum; + *dest++ = gval / sum; + *dest++ = bval / sum; + *dest++ = aval / sum; + src -= 4*(m - 1); + } + } + + /* vertical */ + MEM_freeN(gausstab); + + /* prepare for gauss tab */ + r = (1.5 * node->custom2 + 1.5); + n = 2 * r + 1; + + /* ugly : */ + if ((img->x <= n) || (img->y <= n)) { + printf("gauss filter too large/n"); + return; + } + + gausstab = (float *) MEM_mallocN(n * sizeof(float), "gauss"); + + sum = 0.0f; + v = gausstab; + for (x = -r; x <= r; x++) { + val = exp(-4*(float ) (x*x)/ (float) (r*r)); + sum += val; + *v++ = val; + } + + i = n; + v = gausstab; + while (i--) { + *v++ /= sum; + } + + step = img->x; + bigstep = (n - 1) * step; + for (x = 0; x < step ; x++) { + dest = new->rect + 4*x; + src = work->rect + 4*x; + + for (y = r; y > 0; y--) { + m = n - y; + gval = rval= bval= aval= 0.0f; + sum = 0.0; + v = gausstab + y; + for (i = 0; i < m; i++) { + val = *v++; + sum += val; + rval += val * src[0]; + gval += val * src[1]; + bval += val * src[2]; + aval += val * src[3]; + src += 4 * step; + } + dest[0] = rval / sum; + dest[1] = gval / sum; + dest[2] = bval / sum; + dest[3] = aval / sum; + src -= 4 * m * step; + dest+= 4 * step; + } + for (y = 0; y <= (img->y - n); y++) { + gval = rval= bval= aval= 0.0f; + v = gausstab; + for (i = 0; i < n; i++) { + val = *v++; + rval += val * src[0]; + gval += val * src[1]; + bval += val * src[2]; + aval += val * src[3]; + src += 4 * step; + } + dest[0] = rval; + dest[1] = gval; + dest[2] = bval; + dest[3] = aval; + dest += 4 * step; + src -= 4 * bigstep; + } + for (y = 1; y <= r ; y++) { + m = n - y; + gval = rval= bval= aval= 0.0f; + sum = 0.0; + v = gausstab; + for (i = 0; i < m; i++) { + val = *v++; + sum += val; + rval += val * src[0]; + gval += val * src[1]; + bval += val * src[2]; + aval += val * src[3]; + src += 4 * step; + } + dest[0] = rval / sum; + dest[1] = gval / sum; + dest[2] = bval / sum; + dest[3] = aval / sum; + dest += 4* step; + src -= 4 * (m - 1) * step; + } + } + + free_compbuf(work); + MEM_freeN(gausstab); +} + +static bNodeType cmp_node_blur= { + /* type code */ CMP_NODE_BLUR, + /* name */ "Blur", + /* width+range */ 120, 80, 200, + /* class+opts */ NODE_CLASS_OPERATOR, NODE_OPTIONS, + /* input sock */ cmp_node_blur_in, + /* output sock */ cmp_node_blur_out, + /* storage */ "", + /* execfunc */ node_composit_exec_blur + +}; + + +/* ****************** types array for all shaders ****************** */ + +bNodeType *node_all_composit[]= { + &node_group_typeinfo, + &cmp_node_output, + &cmp_node_value, + &cmp_node_rgb, + &cmp_node_mix_rgb, + &cmp_node_filter, + &cmp_node_valtorgb, + &cmp_node_rgbtobw, + &cmp_node_normal, + &cmp_node_curve_vec, + &cmp_node_curve_rgb, + &cmp_node_image, + &cmp_node_rresult, + &cmp_node_alphaover, + &cmp_node_blur, + NULL +}; + +/* ******************* execute and parse ************ */ + +void ntreeCompositExecTree(bNodeTree *ntree) +{ + + ntreeInitPreview(ntree, 0, 0); + ntreeBeginExecTree(ntree); + + /* allocate composit data */ + + ntreeExecTree(ntree, NULL, 0); /* threads */ + + ntreeEndExecTree(ntree); +} + diff --git a/source/blender/blenkernel/intern/node_shaders.c b/source/blender/blenkernel/intern/node_shaders.c index 944db32ccc1..4e65b36588c 100644 --- a/source/blender/blenkernel/intern/node_shaders.c +++ b/source/blender/blenkernel/intern/node_shaders.c @@ -38,6 +38,7 @@ #include "BKE_blender.h" #include "BKE_colortools.h" #include "BKE_node.h" +#include "BKE_material.h" #include "BKE_texture.h" #include "BKE_utildefines.h" @@ -46,7 +47,7 @@ #include "MEM_guardedalloc.h" -#include "render.h" /* <- shadeinput/output */ +#include "RE_shader_ext.h" /* <- ShadeInput Shaderesult TexResult */ /* ********* exec data struct, remains internal *********** */ @@ -727,11 +728,11 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr) scd.shi= shi; scd.shr= shr; - ntreeExecTree(ntree, &scd, shi->ys & 1); /* threads */ + ntreeExecTree(ntree, &scd, shi->thread); /* threads */ } /* go over all used Geometry and Texture nodes, and return a texco flag */ -int ntreeShaderGetTexco(bNodeTree *ntree) +int ntreeShaderGetTexco(bNodeTree *ntree, int osa) { bNode *node; bNodeSocket *sock; @@ -741,8 +742,7 @@ int ntreeShaderGetTexco(bNodeTree *ntree) for(node= ntree->nodes.first; node; node= node->next) { if(node->type==SH_NODE_TEXTURE) { - /* this r.osa is sorta weak... */ - if(R.osa && node->id) { + if(osa && node->id) { Tex *tex= (Tex *)node->id; if ELEM3(tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP) texco |= TEXCO_OSA; } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index d60236d226c..0b52c92f50e 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -995,10 +995,10 @@ void make_local_object(Object *ob) float bluroffs= 0.0; int no_speed_curve= 0; -void set_mblur_offs(int blur) +/* ugly call from render */ +void set_mblur_offs(float blur) { - bluroffs= R.r.blurfac*((float)blur); - bluroffs/= (float)R.r.osa; + bluroffs= blur; } void disable_speed_curve(int val) @@ -1012,9 +1012,9 @@ float bsystem_time(Object *ob, Object *par, float cfra, float ofs) /* returns float ( see frame_to_float in ipo.c) */ /* 2nd field */ - if(R.flag & R_SEC_FIELD) { - if(R.r.mode & R_FIELDSTILL); else cfra+= .5; - } +// if(R.flag & R_SEC_FIELD) { +// if(R.r.mode & R_FIELDSTILL); else cfra+= .5; +// } cfra+= bluroffs; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index f0058ee6ad0..cb47c43da06 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -52,24 +52,19 @@ #include "DNA_sound_types.h" #include "DNA_vfont_types.h" #include "DNA_packedFile_types.h" - +#include "DNA_scene_types.h" #include "BLI_blenlib.h" #include "BKE_utildefines.h" -#include "BKE_bad_level_calls.h" - #include "BKE_global.h" #include "BKE_main.h" - #include "BKE_screen.h" - #include "BKE_sound.h" -//#include "sound.h" - #include "BKE_image.h" #include "BKE_font.h" #include "BKE_packedFile.h" +#include "BKE_bad_level_calls.h" /* <- waitcursor */ int seekPackedFile(PackedFile * pf, int offset, int whence) { @@ -309,7 +304,7 @@ int writePackedFile(char * filename, PackedFile *pf) } // make sure the path to the file exists... - RE_make_existing_file(name); + BLI_make_existing_file(name); file = open(name, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666); if (file >= 0) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index df9e626abbf..546a22c361b 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -70,6 +70,7 @@ #include "BKE_key.h" #include "BKE_library.h" #include "BKE_main.h" +#include "BKE_node.h" #include "BKE_object.h" #include "BKE_scene.h" #include "BKE_world.h" @@ -153,6 +154,11 @@ void free_scene(Scene *sce) free_forest(sce->theDag); MEM_freeN(sce->theDag); } + + if(sce->nodetree) { + ntreeFreeTree(sce->nodetree); + MEM_freeN(sce->nodetree); + } } Scene *add_scene(char *name) @@ -172,8 +178,8 @@ Scene *add_scene(char *name) sce->r.ysch= 256; sce->r.xasp= 1; sce->r.yasp= 1; - sce->r.xparts= 1; - sce->r.yparts= 1; + sce->r.xparts= 4; + sce->r.yparts= 4; sce->r.size= 100; sce->r.planes= 24; sce->r.quality= 90; diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index ea0134470f1..2633bbd2779 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -39,6 +39,7 @@ #include "BLI_blenlib.h" +#include "DNA_scene_types.h" #include "DNA_text_types.h" #include "BKE_bad_level_calls.h" diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 902b3a5edfe..aa36c0a5083 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -57,6 +57,7 @@ #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_image_types.h" +#include "DNA_world_types.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -158,6 +159,10 @@ void open_plugin_tex(PluginTex *pit) /* ------------------------------------------------------------------------- */ +/* very badlevel define to bypass linking with BIF_interface.h */ +#define INT 96 +#define FLO 128 + PluginTex *add_plugin_tex(char *str) { PluginTex *pit; @@ -381,7 +386,7 @@ void free_texture(Tex *tex) { free_plugin_tex(tex->plugin); if(tex->coba) MEM_freeN(tex->coba); - if(tex->env) RE_free_envmap(tex->env); + if(tex->env) BKE_free_envmap(tex->env); BKE_icon_delete((struct ID*)tex); tex->id.icon_id = 0; } @@ -527,7 +532,7 @@ Tex *copy_texture(Tex *tex) } if(texn->coba) texn->coba= MEM_dupallocN(texn->coba); - if(texn->env) texn->env= RE_copy_envmap(texn->env); + if(texn->env) texn->env= BKE_copy_envmap(texn->env); return texn; } @@ -714,3 +719,69 @@ Tex *give_current_texture(Object *ob, int act) return tex; } + + +/* ------------------------------------------------------------------------- */ + +EnvMap *BKE_add_envmap(void) +{ + EnvMap *env; + + env= MEM_callocN(sizeof(EnvMap), "envmap"); + env->type= ENV_CUBE; + env->stype= ENV_STATIC; + env->clipsta= 0.1; + env->clipend= 100.0; + env->cuberes= 100; + + return env; +} + +/* ------------------------------------------------------------------------- */ + +EnvMap *BKE_copy_envmap(EnvMap *env) +{ + EnvMap *envn; + int a; + + envn= MEM_dupallocN(env); + envn->ok= 0; + for(a=0; a<6; a++) envn->cube[a]= 0; + if(envn->ima) id_us_plus((ID *)envn->ima); + + return envn; +} + +/* ------------------------------------------------------------------------- */ + +void BKE_free_envmapdata(EnvMap *env) +{ + Image *ima; + unsigned int a, part; + + for(part=0; part<6; part++) { + ima= env->cube[part]; + if(ima) { + if(ima->ibuf) IMB_freeImBuf(ima->ibuf); + + for(a=0; amipmap); a++) { + if(ima->mipmap[a]) IMB_freeImBuf(ima->mipmap[a]); + } + MEM_freeN(ima); + env->cube[part]= 0; + } + } + env->ok= 0; +} + +/* ------------------------------------------------------------------------- */ + +void BKE_free_envmap(EnvMap *env) +{ + + BKE_free_envmapdata(env); + MEM_freeN(env); + +} + +/* ------------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 1f71b01d33a..3ff980110e7 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -178,38 +178,3 @@ void make_local_world(World *wrld) } } } - - -void init_render_world() -{ - int a; - char *cp; - - if(G.scene->world) { - R.wrld= *(G.scene->world); - - cp= (char *)&R.wrld.fastcol; - - cp[0]= 255.0*R.wrld.horr; - cp[1]= 255.0*R.wrld.horg; - cp[2]= 255.0*R.wrld.horb; - cp[3]= 1; - - VECCOPY(R.grvec, R.viewmat[2]); - Normalise(R.grvec); - Mat3CpyMat4(R.imat, R.viewinv); - - for(a=0; atex) R.wrld.skytype |= WO_SKYTEX; - - while(R.wrld.aosamp*R.wrld.aosamp < R.osa) R.wrld.aosamp++; - } - else { - memset(&R.wrld, 0, sizeof(World)); - R.wrld.exp= 0.0; - R.wrld.range= 1.0; - } - - R.wrld.linfac= 1.0 + pow((2.0*R.wrld.exp + 0.5), -10); - R.wrld.logfac= log( (R.wrld.linfac-1.0)/R.wrld.linfac )/R.wrld.range; -} diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 0d94215816a..d754a694d5d 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -1,5 +1,6 @@ /** * Functions for writing avi-format files. + * Added interface for generic movie support (ton) * * $Id$ * @@ -36,65 +37,103 @@ #include #include "MEM_guardedalloc.h" + +#include "DNA_scene_types.h" + #include "BLI_blenlib.h" +#include "BKE_global.h" +#include "BKE_writeavi.h" + #include "AVI_avi.h" -#include "BKE_bad_level_calls.h" -#include "BKE_global.h" -/* RPW 11-21-2002 */ -#include "DNA_scene_types.h" -/* RPW - End */ +/* ********************** general blender movie support ***************************** */ + +#ifdef WITH_QUICKTIME +#include "quicktime_export.h" +#endif + +bMovieHandle *BKE_get_movie_handle(int imtype) +{ + static bMovieHandle mh; + + /* set the default handle, as builtin */ + mh.start_movie= start_avi; + mh.append_movie= append_avi; + mh.end_movie= end_avi; + + /* do the platform specific handles */ +#ifdef __sgi + if (imtype == R_MOVIE) { + + } +#endif +#if defined(_WIN32) && !defined(FREE_WINDOWS) + if (imtype == R_AVICODEC) { + + } +#endif +#ifdef WITH_QUICKTIME + if (imtype == R_QUICKTIME) { + mh.start_movie= start_qt; + mh.append_movie= append_qt; + mh.end_movie= end_qt; + } +#endif + + return &mh; +} + +/* ****************************************************************** */ -#include "BKE_writeavi.h" static AviMovie *avi=NULL; static int sframe; -void makeavistring (char *string) +void makeavistring (RenderData *rd, char *string) { char txt[64]; if (string==0) return; - strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); + strcpy(string, rd->pic); + BLI_convertstringcode(string, G.sce, rd->cfra); - RE_make_existing_file(string); + BLI_make_existing_file(string); if (BLI_strcasecmp(string + strlen(string) - 4, ".avi")) { - sprintf(txt, "%04d_%04d.avi", (G.scene->r.sfra) , (G.scene->r.efra) ); + sprintf(txt, "%04d_%04d.avi", (rd->sfra) , (rd->efra) ); strcat(string, txt); } } -void start_avi(void) +void start_avi(RenderData *rd, int rectx, int recty) { int x, y; char name[256]; AviFormat format; int quality, framerate; - makeavistring(name); + makeavistring(rd, name); - sframe = (G.scene->r.sfra); - x = R.rectx; - y = R.recty; + sframe = (rd->sfra); + x = rectx; + y = recty; - quality= R.r.quality; - framerate= R.r.frs_sec; + quality= rd->quality; + framerate= rd->frs_sec; avi = MEM_mallocN (sizeof(AviMovie), "avimovie"); /* RPW 11-21-2002 - if (R.r.imtype != AVI_FORMAT_MJPEG) format = AVI_FORMAT_AVI_RGB; + if (rd->imtype != AVI_FORMAT_MJPEG) format = AVI_FORMAT_AVI_RGB; */ - if (R.r.imtype != R_AVIJPEG ) format = AVI_FORMAT_AVI_RGB; + if (rd->imtype != R_AVIJPEG ) format = AVI_FORMAT_AVI_RGB; else format = AVI_FORMAT_MJPEG; if (AVI_open_compress (name, avi, 1, format) != AVI_ERROR_NONE) { - error("open movie"); + printf("cannot open or start AVI movie file"); MEM_freeN (avi); avi = NULL; return; @@ -107,13 +146,13 @@ void start_avi(void) avi->interlace= 0; avi->odd_fields= 0; -/* avi->interlace= R.r.mode & R_FIELDS; */ -/* avi->odd_fields= (R.r.mode & R_ODDFIELD)?1:0; */ +/* avi->interlace= rd->mode & R_FIELDS; */ +/* avi->odd_fields= (rd->mode & R_ODDFIELD)?1:0; */ printf("Created avi: %s\n", name); } -void append_avi(int frame) +void append_avi(int frame, int *pixels, int rectx, int recty) { unsigned int *rt1, *rt2, *rectot; int x, y; @@ -125,15 +164,15 @@ void append_avi(int frame) } /* note that libavi free's the buffer... stupid interface - zr */ - rectot= MEM_mallocN(R.rectx*R.recty*sizeof(int), "rectot"); + rectot= MEM_mallocN(rectx*recty*sizeof(int), "rectot"); rt1= rectot; - rt2= R.rectot + (R.recty-1)*R.rectx; + rt2= pixels + (recty-1)*rectx; /* flip y and convert to abgr */ - for (y=0; y < R.recty; y++, rt1+= R.rectx, rt2-= R.rectx) { - memcpy (rt1, rt2, R.rectx*sizeof(int)); + for (y=0; y < recty; y++, rt1+= rectx, rt2-= rectx) { + memcpy (rt1, rt2, rectx*sizeof(int)); cp= (char *)rt1; - for(x= R.rectx; x>0; x--) { + for(x= rectx; x>0; x--) { rt= cp[0]; cp[0]= cp[3]; cp[3]= rt; @@ -144,8 +183,8 @@ void append_avi(int frame) } } - AVI_write_frame (avi, (frame-sframe), AVI_FORMAT_RGB32, rectot, R.rectx*R.recty*4); - printf ("added frame %3d (frame %3d in avi): ", frame, frame-sframe); + AVI_write_frame (avi, (frame-sframe), AVI_FORMAT_RGB32, rectot, rectx*recty*4); +// printf ("added frame %3d (frame %3d in avi): ", frame, frame-sframe); } void end_avi(void) diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 7a5e162a4b8..c920d7127ae 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -93,6 +93,7 @@ extern "C" { char *BLI_gethome(void); void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file); void BLI_make_exist(char *dir); +void BLI_make_existing_file(char *name); void BLI_split_dirfile(char *string, char *dir, char *file); int BLI_testextensie(char *str, char *ext); void addlisttolist(ListBase *list1, ListBase *list2); @@ -277,13 +278,15 @@ char *BLI_last_slash(char *string); * * @return True if @a rect is empty. */ -int BLI_rcti_is_empty(struct rcti * rect); +int BLI_rcti_is_empty(struct rcti * rect); void BLI_init_rctf(struct rctf *rect, float xmin, float xmax, float ymin, float ymax); +void BLI_init_rcti(struct rcti *rect, int xmin, int xmax, int ymin, int ymax); +void BLI_translate_rctf(struct rctf *rect, float x, float y); +void BLI_translate_rcti(struct rcti *rect, int x, int y); int BLI_in_rcti(struct rcti * rect, int x, int y); int BLI_in_rctf(struct rctf *rect, float x, float y); int BLI_isect_rctf(struct rctf *src1, struct rctf *src2, struct rctf *dest); -/* why oh why doesn't this work? */ -//void BLI_union_rctf(struct rctf *rct1, struct rctf *rct2); +int BLI_isect_rcti(struct rcti *src1, struct rcti *src2, struct rcti *dest); void BLI_union_rctf(struct rctf *rcta, struct rctf *rctb); /* scanfill.c: used in displist only... */ @@ -336,6 +339,7 @@ void BLI_setInterruptCallBack(int (*f)(void)); int BLI_strcasecmp(const char *s1, const char *s2); int BLI_strncasecmp(const char *s1, const char *s2, int n); +void BLI_timestr(double time, char *str); #define PRNTSUB(type,arg) printf(#arg ": %" #type " ", arg) diff --git a/source/blender/blenlib/BLI_jitter.h b/source/blender/blenlib/BLI_jitter.h new file mode 100644 index 00000000000..1cd4880d0b7 --- /dev/null +++ b/source/blender/blenlib/BLI_jitter.h @@ -0,0 +1,40 @@ +/* + * jitter.h + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BLI_JITTER_H +#define BLI_JITTER_H + +extern void BLI_initjit(float *jitarr, int num); +extern void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1); +extern void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2); + +#endif + diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c new file mode 100644 index 00000000000..fd658765802 --- /dev/null +++ b/source/blender/blenlib/intern/jitter.c @@ -0,0 +1,178 @@ +/** + * Jitter offset table + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_rand.h" +#include "BLI_jitter.h" + + +void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1) +{ + int i , j , k; + float vecx, vecy, dvecx, dvecy, x, y, len; + + for (i = 2*num-2; i>=0 ; i-=2) { + dvecx = dvecy = 0.0; + x = jit1[i]; + y = jit1[i+1]; + for (j = 2*num-2; j>=0 ; j-=2) { + if (i != j){ + vecx = jit1[j] - x - 1.0; + vecy = jit1[j+1] - y - 1.0; + for (k = 3; k>0 ; k--){ + if( fabs(vecx)0 && len0 && len0 && len= 0 ; i-=2){ + dvecx = dvecy = 0.0; + x = jit1[i]; + y = jit1[i+1]; + for (j =2*num -2; j>= 0 ; j-=2){ + if (i != j){ + vecx = jit1[j] - x - 1.0; + vecy = jit1[j+1] - y - 1.0; + + if( fabs(vecx)ymin= ymin; rect->ymax= ymax; } +void BLI_init_rcti(rcti *rect, int xmin, int xmax, int ymin, int ymax) +{ + rect->xmin= xmin; + rect->xmax= xmax; + rect->ymin= ymin; + rect->ymax= ymax; +} + +void BLI_translate_rcti(rcti *rect, int x, int y) +{ + rect->xmin += x; + rect->ymin += y; + rect->xmax += x; + rect->ymax += y; +} +void BLI_translate_rctf(rctf *rect, float x, float y) +{ + rect->xmin += x; + rect->ymin += y; + rect->xmax += x; + rect->ymax += y; +} int BLI_isect_rctf(rctf *src1, rctf *src2, rctf *dest) { @@ -117,3 +139,33 @@ int BLI_isect_rctf(rctf *src1, rctf *src2, rctf *dest) return 0; } } + +int BLI_isect_rcti(rcti *src1, rcti *src2, rcti *dest) +{ + int xmin, xmax; + int ymin, ymax; + + xmin = (src1->xmin) > (src2->xmin) ? (src1->xmin) : (src2->xmin); + xmax = (src1->xmax) < (src2->xmax) ? (src1->xmax) : (src2->xmax); + ymin = (src1->ymin) > (src2->ymin) ? (src1->ymin) : (src2->ymin); + ymax = (src1->ymax) < (src2->ymax) ? (src1->ymax) : (src2->ymax); + + if(xmax>=xmin && ymax>=ymin) { + if(dest) { + dest->xmin = xmin; + dest->xmax = xmax; + dest->ymin = ymin; + dest->ymax = ymax; + } + return 1; + } + else { + if(dest) { + dest->xmin = 0; + dest->xmax = 0; + dest->ymin = 0; + dest->ymax = 0; + } + return 0; + } +} diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 3e679cfc232..d6ed130c9bc 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -781,6 +781,20 @@ void BLI_make_exist(char *dir) { #endif } +void BLI_make_existing_file(char *name) +{ + char di[FILE_MAXDIR], fi[FILE_MAXFILE]; + + strcpy(di, name); + BLI_splitdirstring(di, fi); + + /* test exist */ + if (BLI_exists(di) == 0) { + BLI_recurdir_fileops(di); + } +} + + void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file) { @@ -1119,3 +1133,22 @@ int BLI_strncasecmp(const char *s1, const char *s2, int n) { return 0; } + +void BLI_timestr(double time, char *str) +{ + /* format 00:00:00.00 (hr:min:sec) string has to be 12 long */ + int hr= (int) time/(60*60); + int min= (int) fmod(time/60, 60.0); + int sec= (int) fmod(time, 60.0); + int hun= (int) fmod(time*100.0, 100.0); + + if (hr) { + sprintf(str, "%.2d:%.2d:%.2d.%.2d",hr,min,sec,hun); + } else { + sprintf(str, "%.2d:%.2d.%.2d",min,sec,hun); + } + + str[11]=0; +} + + diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index dc82abc0502..3cd31740520 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1215,6 +1215,7 @@ static void lib_link_ntree(FileData *fd, ID *id, bNodeTree *ntree) /* library linking after fileread */ static void lib_link_nodetree(FileData *fd, Main *main) { + Scene *sce; Material *ma; bNodeTree *ntree; bNode *node; @@ -1242,6 +1243,11 @@ static void lib_link_nodetree(FileData *fd, Main *main) if(ma->nodetree) ntreeVerifyTypes(ma->nodetree); } + /* and scene trees */ + for(sce= main->scene.first; sce; sce= sce->id.next) { + if(sce->nodetree) + ntreeVerifyTypes(sce->nodetree); + } } /* ntree itself has been read! */ @@ -1259,9 +1265,13 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) for(node= ntree->nodes.first; node; node= node->next) { node->storage= newdataadr(fd, node->storage); if(node->storage) { + /* could be handlerized at some point, now only 1 exception still */ if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)) direct_link_curvemapping(fd, node->storage); + else if(ntree->type==NTREE_COMPOSIT && (node->type==CMP_NODE_CURVE_VEC || node->type==CMP_NODE_CURVE_RGB)) + direct_link_curvemapping(fd, node->storage); + } link_list(fd, &node->inputs); link_list(fd, &node->outputs); @@ -2064,7 +2074,6 @@ static void direct_link_texture(FileData *fd, Tex *tex) static void lib_link_material(FileData *fd, Main *main) { Material *ma; - MaterialLayer *ml; MTex *mtex; int a; @@ -2084,9 +2093,6 @@ static void lib_link_material(FileData *fd, Main *main) } lib_link_scriptlink(fd, &ma->id, &ma->scriptlink); - for (ml=ma->layers.first; ml; ml=ml->next) - ml->mat= newlibadr_us(fd, ma->id.lib, ml->mat); - if(ma->nodetree) lib_link_ntree(fd, &ma->id, ma->nodetree); @@ -2109,8 +2115,6 @@ static void direct_link_material(FileData *fd, Material *ma) direct_link_scriptlink(fd, &ma->scriptlink); - link_list(fd, &ma->layers); - ma->nodetree= newdataadr(fd, ma->nodetree); if(ma->nodetree) direct_link_nodetree(fd, ma->nodetree); @@ -2638,6 +2642,9 @@ static void lib_link_scene(FileData *fd, Main *main) lib_link_scriptlink(fd, &sce->id, &sce->scriptlink); + if(sce->nodetree) + lib_link_ntree(fd, &sce->id, sce->nodetree); + sce->id.flag -= LIB_NEEDLINK; } @@ -2800,6 +2807,11 @@ static void direct_link_scene(FileData *fd, Scene *sce) } link_list(fd, &(sce->markers)); + + sce->nodetree= newdataadr(fd, sce->nodetree); + if(sce->nodetree) + direct_link_nodetree(fd, sce->nodetree); + } /* ************ READ SCREEN ***************** */ @@ -2840,6 +2852,7 @@ static void lib_link_screen(FileData *fd, Main *main) if(v3d->localvd) { v3d->localvd->camera= newlibadr(fd, sc->id.lib, v3d->localvd->camera); } + v3d->ri= NULL; } else if(sl->spacetype==SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)sl; @@ -5235,6 +5248,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } if(main->versionfile <= 240) { + Scene *sce; bArmature *arm; /* updating layers still */ @@ -5242,6 +5256,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) bone_version_239(&arm->bonebase); if(arm->layer==0) arm->layer= 1; } + for(sce= main->scene.first; sce; sce= sce->id.next) { + if(sce->r.xparts<2) sce->r.xparts= 4; + if(sce->r.yparts<2) sce->r.yparts= 4; + } } if(main->versionfile <= 241) { @@ -5504,7 +5522,6 @@ static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree) static void expand_material(FileData *fd, Main *mainvar, Material *ma) { - MaterialLayer *ml; int a; for(a=0; aipo); - for (ml=ma->layers.first; ml; ml=ml->next) { - if(ml->mat) - expand_doit(fd, mainvar, ml->mat); - } - if(ma->nodetree) expand_nodetree(fd, mainvar, ma->nodetree); } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index d5b3c4a29f5..2bf263aa7e4 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -143,6 +143,7 @@ Important to know is that 'streaming' has been added to files, for Blender Publi #include "DNA_view3d_types.h" #include "DNA_vfont_types.h" #include "DNA_userdef_types.h" +#include "DNA_world_types.h" #include "MEM_guardedalloc.h" // MEM_freeN #include "BLI_blenlib.h" @@ -391,6 +392,8 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) /* could be handlerized at some point, now only 1 exception still */ if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)) write_curvemapping(wd, node->storage); + else if(ntree->type==NTREE_COMPOSIT && (node->type==CMP_NODE_CURVE_VEC || node->type==CMP_NODE_CURVE_RGB)) + write_curvemapping(wd, node->storage); else writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage); } @@ -1038,7 +1041,6 @@ static void write_textures(WriteData *wd, ListBase *idbase) static void write_materials(WriteData *wd, ListBase *idbase) { Material *ma; - MaterialLayer *ml; int a; ma= idbase->first; @@ -1056,9 +1058,6 @@ static void write_materials(WriteData *wd, ListBase *idbase) write_scriptlink(wd, &ma->scriptlink); - for (ml=ma->layers.first; ml; ml=ml->next) - writestruct(wd, DATA, "MaterialLayer", 1, ml); - /* nodetree is integral part of material, no libdata */ if(ma->nodetree) { writestruct(wd, DATA, "bNodeTree", 1, ma->nodetree); @@ -1220,6 +1219,11 @@ static void write_scenes(WriteData *wd, ListBase *scebase) marker= marker->next; } + if(sce->nodetree) { + writestruct(wd, DATA, "bNodeTree", 1, sce->nodetree); + write_nodetree(wd, sce->nodetree); + } + sce= sce->id.next; } /* flush helps the compression for undo-save */ diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index a90d7d651f8..bd2d41881db 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -197,8 +197,8 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, int size, int flags) ptr = (unsigned char *)strchr((char*)&mem[x+1], '\n'); ptr++; - if (flags & IB_test) ibuf = IMB_allocImBuf(width, height, 24, 0, 0); - else ibuf = IMB_allocImBuf(width, height, 24, IB_rect|IB_rectfloat, 0); + if (flags & IB_test) ibuf = IMB_allocImBuf(width, height, 32, 0, 0); + else ibuf = IMB_allocImBuf(width, height, 32, IB_rect|IB_rectfloat, 0); if (ibuf==NULL) return NULL; ibuf->ftype = RADHDR; @@ -224,7 +224,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, int size, int flags) *rect_float++ = fcol[RED]; *rect_float++ = fcol[GRN]; *rect_float++ = fcol[BLU]; - *rect_float++ = 255; + *rect_float++ = 1.0f; /* Also old oldstyle for the rest of blender which is not using floats yet */ /* very weird mapping! (ton) */ @@ -339,19 +339,28 @@ static void writeHeader(FILE *file, int width, int height) short imb_savehdr(struct ImBuf *ibuf, char *name, int flags) { - int y, width=ibuf->x, height=ibuf->y; FILE* file = fopen(name, "wb"); - + float *fp= NULL; + int y, width=ibuf->x, height=ibuf->y; + char *cp= NULL; + if (file==NULL) return 0; writeHeader(file, width, height); + if(ibuf->rect) + cp= (char *)(ibuf->rect + (height-1)*width); + if(ibuf->rect_float) + fp= ibuf->rect_float + 4*(height-1)*width; + for (y=height-1;y>=0;y--) { - if (fwritecolrs(file, width,(unsigned char *)&ibuf->rect[y*width*4], &ibuf->rect_float[y*width*4]) < 0) { + if (fwritecolrs(file, width, cp, fp) < 0) { fclose(file); printf("HDR write error\n"); return 0; } + if(cp) cp-= 4*width; + if(fp) fp-= 4*width; } fclose(file); diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 539ea0377b3..c962f1fbde5 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -915,26 +915,33 @@ struct ImBuf *IMB_scaleImBuf(struct ImBuf * ibuf, short newx, short newy) return(ibuf); } +struct imbufRGBA { + float r, g, b, a; +}; struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, short newx, short newy) { unsigned int *rect,*_newrect,*newrect; - float *rectf,*_newrectf,*newrectf; - int x,y, do_float=0; + struct imbufRGBA *rectf, *_newrectf, *newrectf; + int x,y, do_float=0, do_rect=0; int ofsx,ofsy,stepx,stepy; + rect = NULL; _newrect = NULL; newrect = NULL; rectf = NULL; _newrectf = NULL; newrectf = NULL; if (ibuf==NULL) return(0); - if (ibuf->rect==NULL) return(ibuf); + if (ibuf->rect) do_rect = 1; if (ibuf->rect_float) do_float = 1; - + if (do_rect==0 && do_float==0) return(ibuf); + if (newx == ibuf->x && newy == ibuf->y) return(ibuf); - - _newrect = MEM_mallocN(newx * newy * sizeof(int), "scalefastimbuf"); - if (_newrect==NULL) return(ibuf); - newrect = _newrect; - + + if(do_rect) { + _newrect = MEM_mallocN(newx * newy * sizeof(int), "scalefastimbuf"); + if (_newrect==NULL) return(ibuf); + newrect = _newrect; + } + if (do_float) { _newrectf = MEM_mallocN(newx * newy * sizeof(float) * 4, "scalefastimbuf f"); if (_newrectf==NULL) return(ibuf); @@ -946,30 +953,34 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, short newx, short newy) ofsy = 32768; for (y = newy; y > 0 ; y--){ - rect = ibuf->rect; - rect += (ofsy >> 16) * ibuf->x; + if(do_rect) { + rect = ibuf->rect; + rect += (ofsy >> 16) * ibuf->x; + } if (do_float) { - rectf = ibuf->rect_float; + rectf = (struct imbufRGBA *)ibuf->rect_float; rectf += (ofsy >> 16) * ibuf->x; } ofsy += stepy; ofsx = 32768; for (x = newx ; x>0 ; x--){ - *newrect++ = rect[ofsx >> 16]; + if (do_rect) *newrect++ = rect[ofsx >> 16]; if (do_float) *newrectf++ = rectf[ofsx >> 16]; ofsx += stepx; } } - imb_freerectImBuf(ibuf); - ibuf->mall |= IB_rect; - ibuf->rect = _newrect; + if (do_rect) { + imb_freerectImBuf(ibuf); + ibuf->mall |= IB_rect; + ibuf->rect = _newrect; + } if (do_float) { imb_freerectfloatImBuf(ibuf); ibuf->mall |= IB_rectfloat; - ibuf->rect_float = _newrectf; + ibuf->rect_float = (float *)_newrectf; } scalefast_Z_ImBuf(ibuf, newx, newy); diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index 522ce78ebc0..ae75de8f54f 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -65,6 +65,8 @@ #include "IMB_bitplanes.h" #include "IMB_divers.h" +/* added facility to copy with saving non-float rects */ + short IMB_saveiff(struct ImBuf *ibuf, char *name, int flags) { short ok=TRUE,delpl=FALSE; @@ -75,24 +77,36 @@ short IMB_saveiff(struct ImBuf *ibuf, char *name, int flags) /* Put formats that take a filename here */ if (IS_jpg(ibuf)) { + if(ibuf->rect==NULL && ibuf->rect_float) + IMB_rect_from_float(ibuf); return imb_savejpeg(ibuf, name, flags); } if (IS_radhdr(ibuf)) { return imb_savehdr(ibuf, name, flags); } if (IS_png(ibuf)) { + if(ibuf->rect==NULL && ibuf->rect_float) + IMB_rect_from_float(ibuf); return imb_savepng(ibuf, name, flags); } if (IS_bmp(ibuf)) { + if(ibuf->rect==NULL && ibuf->rect_float) + IMB_rect_from_float(ibuf); return imb_savebmp(ibuf, name, flags); } if (IS_tga(ibuf)) { + if(ibuf->rect==NULL && ibuf->rect_float) + IMB_rect_from_float(ibuf); return imb_savetarga(ibuf, name, flags); } if (IS_iris(ibuf)) { + if(ibuf->rect==NULL && ibuf->rect_float) + IMB_rect_from_float(ibuf); return imb_saveiris(ibuf, name, flags); } if (G.have_libtiff && IS_tiff(ibuf)) { + if(ibuf->rect==NULL && ibuf->rect_float) + IMB_rect_from_float(ibuf); return imb_savetiff(ibuf, name, flags); } #ifdef WITH_OPENEXR diff --git a/source/blender/include/BIF_glutil.h b/source/blender/include/BIF_glutil.h index af231de66f8..0edc73eee2d 100644 --- a/source/blender/include/BIF_glutil.h +++ b/source/blender/include/BIF_glutil.h @@ -125,7 +125,7 @@ void glaRasterPosSafe2f (float x, float y, float known_good_x, float known_good * to use the glScissor functionality if images are to be drawn * with an inset view matrix. */ -void glaDrawPixelsSafe (float x, float y, int img_w, int img_h, int format, int type, void *rect); +void glaDrawPixelsSafe (float x, float y, int img_w, int img_h, int row_w, int format, int type, void *rect); /** * Functions like a limited glDrawPixels, but actually draws the diff --git a/source/blender/include/BIF_interface.h b/source/blender/include/BIF_interface.h index f2248488d81..41a5bc5e5a1 100644 --- a/source/blender/include/BIF_interface.h +++ b/source/blender/include/BIF_interface.h @@ -93,6 +93,7 @@ struct ScrArea; #define UI_PNL_STOW 64 #define UI_PNL_TO_MOUSE 128 #define UI_PNL_UNSTOW 256 +#define UI_PNL_SCALE 512 /* warning the first 4 flags are internal */ /* but->flag */ @@ -288,7 +289,7 @@ void uiButSetFunc (uiBut *but, void (*func)(void *arg1, void *arg2), void *arg void uiButSetCompleteFunc(uiBut *but, void (*func)(char *str, void *arg), void *arg); -void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)()); +void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(struct ScrArea *sa, uiBlock *block)); extern void pupmenu_set_active(int val); diff --git a/source/blender/include/BIF_previewrender.h b/source/blender/include/BIF_previewrender.h index b8ed73505f5..dec85f5f6e7 100644 --- a/source/blender/include/BIF_previewrender.h +++ b/source/blender/include/BIF_previewrender.h @@ -30,10 +30,14 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ +#include "DNA_vec_types.h" + struct SpaceButs; struct RenderInfo; struct Image; struct ScrArea; +struct uiBlock; +struct Render; #define PREVIEW_RENDERSIZE 140 @@ -42,11 +46,19 @@ typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha); /* stores rendered preview - is also used for icons */ typedef struct RenderInfo { int pr_rectx; - int pr_recty; - unsigned int* rect; - short cury; + int pr_recty; + short cury, status; + rcti disprect; /* storage for view3d preview rect */ + unsigned int* rect; + struct Render *re; /* persistant render */ } RenderInfo; +/* ri->status */ +#define PR_DBASE 1 +#define PR_DISPRECT 2 +#define PR_PROJECTED 4 +#define PR_ROTATED 8 + /* Render the preview pr_method: @@ -61,9 +73,16 @@ pr_method: #define PR_ICON_RENDER 1 #define PR_DO_RENDER 2 -void BIF_previewrender (struct ID *id, struct RenderInfo *ri, struct ScrArea *area, int pr_method); +void BIF_previewrender (struct ID *id, struct RenderInfo *ri, struct ScrArea *area, int pr_method); void BIF_previewrender_buts (struct SpaceButs *sbuts); -void BIF_previewdraw (void); -void BIF_preview_changed(short id_code); +void BIF_previewdraw (struct ScrArea *sa, struct uiBlock *block); +void BIF_preview_changed (short id_code); +void BIF_preview_init_dbase (void); +void BIF_preview_free_dbase (void); +void BIF_view3d_previewrender(struct ScrArea *sa); +void BIF_view3d_previewdraw (struct ScrArea *sa, struct uiBlock *block); +void BIF_view3d_previewrender_free(struct ScrArea *sa); +void BIF_view3d_previewrender_clear(struct ScrArea *sa); +void BIF_view3d_previewrender_signal(struct ScrArea *sa, short signal); diff --git a/source/blender/include/BIF_renderwin.h b/source/blender/include/BIF_renderwin.h index 6b607b110d6..eeb48ad8c27 100644 --- a/source/blender/include/BIF_renderwin.h +++ b/source/blender/include/BIF_renderwin.h @@ -32,7 +32,7 @@ struct ScrArea; -void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[2]); +void calc_renderwin_rectangle(int rectx, int recty, int posmask, int renderpos_r[2], int rendersize_r[2]); void BIF_close_render_display(void); diff --git a/source/blender/include/BIF_screen.h b/source/blender/include/BIF_screen.h index b47f005c2b3..c76f961014a 100644 --- a/source/blender/include/BIF_screen.h +++ b/source/blender/include/BIF_screen.h @@ -73,7 +73,7 @@ void set_g_activearea(struct ScrArea *sa); void getmouseco_sc(short *mval); void getmouseco_areawin(short *mval); void getmouseco_headwin(short *mval); -unsigned short qtest(void); +int qtest(void); int anyqtest(void); void areawinset(short win); void headerbox(struct ScrArea *sa); diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h index 2a417a385fa..3585e46c0aa 100644 --- a/source/blender/include/BIF_space.h +++ b/source/blender/include/BIF_space.h @@ -53,6 +53,7 @@ struct SpaceOops; #define VIEW3D_HANDLER_BACKGROUND 1 #define VIEW3D_HANDLER_PROPERTIES 2 #define VIEW3D_HANDLER_OBJECT 3 +#define VIEW3D_HANDLER_PREVIEW 4 /* ipo handler codes */ #define IPO_HANDLER_PROPERTIES 20 @@ -106,7 +107,7 @@ extern void extern_set_butspace(int fkey); extern void force_draw(int header); extern void force_draw_all(int header); extern void force_draw_plus(int type, int header); -extern void freespacelist(struct ListBase *lb); +extern void freespacelist(struct ScrArea *sa); extern void handle_view3d_around(void); extern void handle_view3d_lock(void); extern void init_v2d_oops(struct ScrArea *, struct SpaceOops *); diff --git a/source/blender/include/BIF_toets.h b/source/blender/include/BIF_toets.h index ef16186f15f..f5a435d3d50 100644 --- a/source/blender/include/BIF_toets.h +++ b/source/blender/include/BIF_toets.h @@ -33,9 +33,6 @@ #ifndef BIF_TOETS_H #define BIF_TOETS_H -void BIF_save_rendered_image(void); - -int save_image_filesel_str(char *str); int blenderqread(unsigned short event, short val); void persptoetsen(unsigned short event); /* dutch rules man */ int untitled(char *name); diff --git a/source/blender/include/BIF_writeimage.h b/source/blender/include/BIF_writeimage.h index 318a4294371..70978a033c2 100644 --- a/source/blender/include/BIF_writeimage.h +++ b/source/blender/include/BIF_writeimage.h @@ -36,8 +36,10 @@ struct ImBuf; struct EnvMap; -int BIF_write_ibuf(struct ImBuf *ibuf, char *name); +void BIF_save_rendered_image(char *name); +void BIF_save_rendered_image_fs(void); void BIF_save_envmap(struct EnvMap *env, char *str); +void save_image_filesel_str(char *str); #endif diff --git a/source/blender/include/BSE_drawview.h b/source/blender/include/BSE_drawview.h index 4a9876705e6..1d04062fb8d 100644 --- a/source/blender/include/BSE_drawview.h +++ b/source/blender/include/BSE_drawview.h @@ -53,12 +53,11 @@ void add_view3d_after(struct View3D *v3d, struct Base *base, int type); void backdrawview3d(int test); void drawview3dspace(struct ScrArea *sa, void *spacedata); -void drawview3d_render(struct View3D *v3d); +void drawview3d_render(struct View3D *v3d, int winx, int winy); int update_time(void); void calc_viewborder(struct View3D *v3d, struct rcti *viewborder_r); void view3d_set_1_to_1_viewborder(struct View3D *v3d); -void timestr(double time, char *str); int view3d_test_clipping(struct View3D *v3d, float *vec); void view3d_set_clipping(struct View3D *v3d); diff --git a/source/blender/include/BSE_node.h b/source/blender/include/BSE_node.h index c5393f2e69e..7ad973d4915 100644 --- a/source/blender/include/BSE_node.h +++ b/source/blender/include/BSE_node.h @@ -43,6 +43,7 @@ struct bNode; struct bNodeTree; struct Material; struct ID; +struct Scene; /* ************* API for editnode.c *********** */ @@ -58,9 +59,12 @@ void snode_set_context(struct SpaceNode *snode); void node_deselectall(struct SpaceNode *snode, int swap); void node_transform_ext(int mode, int unused); void node_shader_default(struct Material *ma); +void node_composit_default(struct Scene *scene); int node_has_hidden_sockets(struct bNode *node); +struct bNode *node_add_node(struct SpaceNode *snode, int type, float locx, float locy); + /* ************* drawnode.c *************** */ void node_draw_link(struct SpaceNode *snode, struct bNodeLink *link); @@ -68,7 +72,6 @@ void init_node_butfuncs(void); /* ************* Shader nodes ***************** */ -struct bNode *node_add_shadernode(struct SpaceNode *snode, int type, float locx, float locy); #endif diff --git a/source/blender/include/BSE_sequence.h b/source/blender/include/BSE_sequence.h index 994559e6194..df38389892a 100644 --- a/source/blender/include/BSE_sequence.h +++ b/source/blender/include/BSE_sequence.h @@ -125,11 +125,14 @@ struct StripElem *give_stripelem(struct Sequence *seq, int cfra); void set_meta_stripdata(struct Sequence *seqm); void do_seq_count_cfra(struct ListBase *seqbase, int *totseq, int cfra); void do_build_seqar_cfra(struct ListBase *seqbase, struct Sequence ***seqar, int cfra); -struct ImBuf *give_ibuf_seq(int cfra); +struct ImBuf *give_ibuf_seq(int rectx, int recty, int cfra); void free_imbuf_effect_spec(int cfra); void free_imbuf_seq_except(int cfra); void free_imbuf_seq(void); -void do_render_seq(void); + +/* still bad level call... */ +struct RenderResult; +void do_render_seq(struct RenderResult *rr); #endif diff --git a/source/blender/include/BSE_view.h b/source/blender/include/BSE_view.h index e241f92143b..2afbca2b30e 100644 --- a/source/blender/include/BSE_view.h +++ b/source/blender/include/BSE_view.h @@ -68,7 +68,10 @@ void sdrawbox(short x1, short y1, short x2, short y2); void calctrackballvecfirst(struct rcti *area, short *mval, float *vec); void calctrackballvec(struct rcti *area, short *mval, float *vec); void viewmove(int mode); -void setwinmatrixview3d(struct rctf *rect); + +int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend); +void setwinmatrixview3d(int winx, int winy, struct rctf *rect); + void obmat_to_viewmat(struct Object *ob); void setviewmatrixview3d(void); float *give_cursor(void); diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h index 67767cf6613..52638e6f988 100644 --- a/source/blender/include/blendef.h +++ b/source/blender/include/blendef.h @@ -381,6 +381,7 @@ /* NODE: 851-900 */ #define B_NODEHOME 851 #define B_NODE_USEMAT 852 +#define B_NODE_USESCENE 853 /* FREE 901 - 999 */ diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index 2ae3054a1ab..aca652d52bd 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -127,6 +127,7 @@ void test_scriptpoin_but(char *name, struct ID **idpp); void test_actionpoin_but(char *name, ID **idpp); void test_grouppoin_but(char *name, ID **idpp); void test_texpoin_but(char *name, ID **idpp); +void test_imapoin_but(char *name, ID **idpp); void test_idbutton_cb(void *namev, void *arg2_unused); @@ -195,7 +196,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la #define B_MAT_USENODES 1221 /* also handled in editnode.c */ #define B_NODE_EXEC 1222 - +#define B_NODE_LOADIMAGE 1223 /* *********************** */ #define B_TEXBUTS 1400 diff --git a/source/blender/include/interface.h b/source/blender/include/interface.h index 15f2e8ee010..f2f6aad855d 100644 --- a/source/blender/include/interface.h +++ b/source/blender/include/interface.h @@ -41,6 +41,10 @@ #define UI_MAX_NAME_STR 64 #define UI_ARRAY 29 +/* panel limits */ +#define UI_PANEL_MINX 100 +#define UI_PANEL_MINY 70 + /* uiBut->flag */ #define UI_SELECT 1 #define UI_MOUSE_OVER 2 @@ -202,6 +206,7 @@ struct uiBlock { /* interface.c */ extern void ui_graphics_to_window(int win, float *x, float *y); +extern void ui_graphics_to_window_rct(int win, rctf *graph, rcti *winr); extern void ui_window_to_graphics(int win, float *x, float *y); extern void ui_block_flush_back(uiBlock *block); @@ -216,6 +221,7 @@ extern void ui_autofill(uiBlock *block); /* interface_panel.c */ extern void ui_draw_panel(uiBlock *block); extern void ui_do_panel(uiBlock *block, uiEvent *uevent); +extern void ui_scale_panel(uiBlock *block); extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown); diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 7b26a3c2b57..a6dca412d9c 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -50,7 +50,7 @@ typedef struct Image { struct ImBuf *mipmap[10]; short ok, flag; - short lastframe, lastquality; + short lastframe, pad; /* texture page */ short tpageflag, totbind; diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 6d8527d5896..15cee1a288e 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -49,16 +49,6 @@ struct ColorBand; struct Group; struct bNodeTree; -typedef struct MaterialLayer { - struct MaterialLayer *next, *prev; - - struct Material *mat; - float blendfac; - short flag, blendmethod, menunr, pad; - int pad2; - -} MaterialLayer; - /* WATCH IT: change type? also make changes in ipo.h */ typedef struct Material { @@ -109,7 +99,6 @@ typedef struct Material { float rampfac_col, rampfac_spec; struct MTex *mtex[10]; - ListBase layers; struct bNodeTree *nodetree; struct Ipo *ipo; struct Group *group; /* light group */ @@ -247,20 +236,14 @@ typedef struct Material { #define MAP_LAYER 16384 /* pr_type */ -#define MA_FLAT 0 -#define MA_SPHERE 1 -#define MA_CUBE 2 +#define MA_SPHERE 0 +#define MA_CUBE 1 +#define MA_FLAT 2 +#define MA_MONKEY 3 +#define MA_SPHERE_A 4 /* pr_back */ #define MA_DARK 1 -/* MaterialLayer flag */ -#define ML_ACTIVE 1 -#define ML_RENDER 2 -#define ML_NEG_NORMAL 4 -#define ML_DIFFUSE 8 -#define ML_SPECULAR 16 -#define ML_ALPHA 32 - #endif diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 85db0887f51..783a7bb05a5 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -47,9 +47,10 @@ typedef struct bNodeStack { float vec[4]; float min, max; /* min/max for values (UI writes it, execute might use it) */ void *data; - short hasinput; /* hasinput is tagged before executing */ + short hasinput; /* when input has link, tagged before executing */ + short hasoutput; /* when output is linked, tagged before executing */ short datatype; /* type of data pointer */ - int pad1; + short pad1; } bNodeStack; /* ns->datatype, shadetree only */ @@ -157,7 +158,8 @@ typedef struct bNodeTree { bNodeStack *stack1; /* for other thread, easy to expand though... */ int type, init; /* set init on fileread */ - int cur_index, pad; /* sockets in groups have unique identifiers, adding new sockets always will increase this counter */ + int stacksize; /* amount of elements in stack */ + int cur_index; /* sockets in groups have unique identifiers, adding new sockets always will increase this counter */ struct bNodeType **alltypes; /* type definitions, set on fileread, no read/write */ struct bNodeType *owntype; /* for groups or dynamic trees, no read/write */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 0f1cdb8368f..c34b14f30af 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -335,7 +335,7 @@ extern Object workob; #define BA_DO_IPO 32 #define BA_FROMSET 128 -#define OB_DO_IMAT 256 + #define OB_FROMDUPLI 512 #define OB_DONE 1024 #define OB_RADIO 2048 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 12de019dd16..3f84b812cfb 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -48,6 +48,7 @@ struct World; struct Scene; struct Image; struct Group; +struct bNodeTree; typedef struct Base { struct Base *next, *prev; @@ -294,9 +295,12 @@ typedef struct Scene { unsigned int lay; /* editmode stuff */ - short selectmode, pad; - short proportional, prop_mode; float editbutsize; /* size of normals */ + short selectmode; + short proportional, prop_mode; + + short use_nodes; + struct bNodeTree *nodetree; void *ed; struct Radio *radio; @@ -318,7 +322,7 @@ typedef struct Scene { /* none of the dependancy graph vars is mean to be saved */ struct DagForest *theDag; short dagisvalid, dagflags; - int dirty; + short dirty, recalc; /* recalc = counterpart of ob->recalc */ } Scene; @@ -374,7 +378,7 @@ typedef struct Scene { #define R_PASSEPARTOUT 0x0004 #define R_EXTENSION 0x0010 -#define R_OGL 0x0020 +#define R_NODE_PREVIEW 0x0020 /* alphamode */ #define R_ADDSKY 0 @@ -428,6 +432,9 @@ typedef struct Scene { #define SCE_CLEAN 0 #define SCE_DIRTY 1 +/* sce->recalc (now in use by previewrender) */ +#define SCE_PRV_CHANGED 1 + /* sce->prop_mode (proportional falloff) */ #define PROP_SMOOTH 0 #define PROP_SPHERE 1 diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 9a5fd12dd0f..03c6aad6cf6 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -40,6 +40,7 @@ struct Tex; struct SpaceLink; struct Base; struct BoundBox; +struct RenderInfo; /* This is needed to not let VC choke on near and far... old * proprietary MS extensions... */ @@ -92,6 +93,7 @@ typedef struct View3D { struct Object *camera; struct BGpic *bgpic; struct View3D *localvd; + struct RenderInfo *ri; /** * The drawing mode for the 3d display. Set to OB_WIRE, OB_SOLID, diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c index 157f2e19cb7..30fbc22214a 100644 --- a/source/blender/python/api2_2x/Texture.c +++ b/source/blender/python/api2_2x/Texture.c @@ -37,13 +37,15 @@ #include "BLI_blenlib.h" #include "BKE_texture.h" #include "BKE_utildefines.h" +#include "DNA_object_types.h" #include "DNA_material_types.h" +#include "DNA_scene_types.h" +#include "DNA_texture_types.h" #include "MTex.h" #include "Image.h" #include "Ipo.h" #include "constant.h" #include "blendef.h" -#include "render.h" #include "gen_utils.h" /*****************************************************************************/ @@ -1863,7 +1865,7 @@ static int Texture_setType( BPy_Texture * self, PyObject * value ) if( !err && self->texture->type == TEX_ENVMAP && !self->texture->env ) { - self->texture->env = RE_add_envmap(); + self->texture->env = BKE_add_envmap(); self->texture->env->object= OBACT; } return err; @@ -2541,7 +2543,7 @@ static PyObject *Texture_oldsetType( BPy_Texture * self, PyObject * args ) if( self->texture->type == TEX_ENVMAP && !self->texture->env ) { - self->texture->env = RE_add_envmap(); + self->texture->env = BKE_add_envmap(); self->texture->env->object= OBACT; } diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index 4ad440ee476..01329dd36c4 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -33,15 +33,20 @@ struct View3D; /* keep me up here */ #include "sceneRender.h" /*This must come first*/ -#include "BIF_renderwin.h" #include "DNA_image_types.h" -#include "BIF_drawscene.h" -#include "BLI_blenlib.h" + #include "BKE_image.h" #include "BKE_global.h" + +#include "BIF_drawscene.h" +#include "BIF_renderwin.h" + +#include "BLI_blenlib.h" + +#include "RE_pipeline.h" + #include "mydevice.h" #include "butspace.h" -#include "render.h" /* RE_animrender() */ #include "blendef.h" #include "gen_utils.h" @@ -55,8 +60,6 @@ struct View3D; /* keep me up here */ #define PY_SKYDOME 1 #define PY_FULL 2 -extern RE_Render R; -extern void schrijfplaatje(char *name); extern void waitcursor(int); //---------------------------------------Render prototypes------------- @@ -872,6 +875,7 @@ PyObject *RenderData_Render( BPy_RenderData * self ) } else { /* background mode (blender -b file.blend -P script) */ + Render *re= RE_NewRender("Render"); int end_frame = G.scene->r.efra; /* is of type short currently */ @@ -881,7 +885,7 @@ PyObject *RenderData_Render( BPy_RenderData * self ) G.scene->r.efra = G.scene->r.sfra; - RE_animrender(NULL); + RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); G.scene->r.efra = (short)end_frame; } @@ -907,7 +911,7 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args ) BLI_strncpy( filepath, self->renderContext->pic, sizeof(filepath) ); strcat(filepath, name_str); - if(!R.rectot) { + if(0) {//!R.rectot) { return EXPP_ReturnPyObjError (PyExc_RuntimeError, "No image rendered"); } else { @@ -917,9 +921,9 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args ) strcpy(G.ima, dir); } - R.r.imtype= G.scene->r.imtype; - R.r.quality= G.scene->r.quality; - R.r.planes= G.scene->r.planes; +// R.r.imtype= G.scene->r.imtype; +// R.r.quality= G.scene->r.quality; +// R.r.planes= G.scene->r.planes; strcpy(strn, filepath); BLI_convertstringcode(strn, G.sce, G.scene->r.cfra); @@ -929,7 +933,7 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args ) } waitcursor(1); - schrijfplaatje(strn); +// schrijfplaatje(strn); strcpy(G.ima, filepath); waitcursor(0); } @@ -948,6 +952,8 @@ PyObject *RenderData_RenderAnim( BPy_RenderData * self ) set_scene( oldsce ); } else { /* background mode (blender -b file.blend -P script) */ + Render *re= RE_NewRender("Render"); + if (G.scene != self->scene) return EXPP_ReturnPyObjError (PyExc_RuntimeError, "scene to render in bg mode must be the active scene"); @@ -955,7 +961,8 @@ PyObject *RenderData_RenderAnim( BPy_RenderData * self ) if (G.scene->r.sfra > G.scene->r.efra) return EXPP_ReturnPyObjError (PyExc_RuntimeError, "start frame must be less or equal to end frame"); - RE_animrender(NULL); + + RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); } return EXPP_incr_ret( Py_None ); } @@ -975,7 +982,7 @@ PyObject *RenderData_Play( BPy_RenderData * self ) strcpy( file, self->renderContext->pic ); BLI_convertstringcode( file, (char *) self->scene, self->renderContext->cfra ); - RE_make_existing_file( file ); + BLI_make_existing_file( file ); if( BLI_strcasecmp( file + strlen( file ) - 4, ".mov" ) ) { sprintf( txt, "%04d_%04d.mov", ( self->renderContext->sfra ), @@ -989,7 +996,7 @@ PyObject *RenderData_Play( BPy_RenderData * self ) strcpy( file, self->renderContext->pic ); BLI_convertstringcode( file, G.sce, self->renderContext->cfra ); - RE_make_existing_file( file ); + BLI_make_existing_file( file ); if( BLI_strcasecmp( file + strlen( file ) - 4, ".avi" ) ) { sprintf( txt, "%04d_%04d.avi", ( self->renderContext->sfra ), @@ -998,14 +1005,14 @@ PyObject *RenderData_Play( BPy_RenderData * self ) } } if( BLI_exist( file ) ) { - calc_renderwin_rectangle( G.winpos, pos, size ); + calc_renderwin_rectangle(640, 480, G.winpos, pos, size); sprintf( str, "%s -a -p %d %d \"%s\"", bprogname, pos[0], pos[1], file ); system( str ); } else { - makepicstring( file, self->renderContext->sfra ); + BKE_makepicstring( file, self->renderContext->sfra ); if( BLI_exist( file ) ) { - calc_renderwin_rectangle( G.winpos, pos, size ); + calc_renderwin_rectangle(640, 480, G.winpos, pos, size); sprintf( str, "%s -a -p %d %d \"%s\"", bprogname, pos[0], pos[1], file ); system( str ); diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index 5c59f734345..462ee77cf25 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -34,15 +34,21 @@ #ifdef WITH_QUICKTIME #if defined(_WIN32) || defined(__APPLE__) +#include "DNA_scene_types.h" + #include "BKE_global.h" #include "BKE_scene.h" + #include "BLI_blenlib.h" #include "BIF_toolbox.h" /* error() */ + #include "BLO_sys_types.h" + #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" + #include "MEM_guardedalloc.h" -#include "render.h" + #include "quicktime_import.h" #include "quicktime_export.h" @@ -69,10 +75,10 @@ #define kTrackStart 0 #define kMediaStart 0 -static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame); -static void QT_DoAddVideoSamplesToMedia (int frame); +static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, int recty); +static void QT_DoAddVideoSamplesToMedia (int frame, int *pixels, int rectx, int recty); static void QT_EndAddVideoSamplesToMedia (void); -static void QT_CreateMyVideoTrack (void); +static void QT_CreateMyVideoTrack (int rectx, int recty); static void QT_EndCreateMyVideoTrack (void); static void check_renderbutton_framerate(void); @@ -249,7 +255,7 @@ static OSErr QT_AddUserDataTextToMovie (Movie theMovie, char *theText, OSType th } -static void QT_CreateMyVideoTrack(void) +static void QT_CreateMyVideoTrack(int rectx, int recty) { OSErr err = noErr; Rect trackFrame; @@ -257,8 +263,8 @@ static void QT_CreateMyVideoTrack(void) trackFrame.top = 0; trackFrame.left = 0; - trackFrame.bottom = R.recty; - trackFrame.right = R.rectx; + trackFrame.bottom = recty; + trackFrame.right = rectx; qtexport->theTrack = NewMovieTrack (qtexport->theMovie, FixRatio(trackFrame.right,1), @@ -281,7 +287,7 @@ static void QT_CreateMyVideoTrack(void) err = BeginMediaEdits (qtexport->theMedia); CheckError( err, "BeginMediaEdits error" ); - QT_StartAddVideoSamplesToMedia (&trackFrame); + QT_StartAddVideoSamplesToMedia (&trackFrame, rectx, recty); } @@ -303,19 +309,19 @@ static void QT_EndCreateMyVideoTrack(void) } -static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame) +static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, int recty) { OSErr err = noErr; - qtexport->ibuf = IMB_allocImBuf (R.rectx, R.recty, 32, IB_rect, 0); - qtexport->ibuf2 = IMB_allocImBuf (R.rectx, R.recty, 32, IB_rect, 0); + qtexport->ibuf = IMB_allocImBuf (rectx, recty, 32, IB_rect, 0); + qtexport->ibuf2 = IMB_allocImBuf (rectx, recty, 32, IB_rect, 0); err = NewGWorldFromPtr( &qtexport->theGWorld, k32ARGBPixelFormat, trackFrame, NULL, NULL, 0, (unsigned char *)qtexport->ibuf->rect, - R.rectx * 4 ); + rectx * 4 ); CheckError (err, "NewGWorldFromPtr error"); qtexport->thePixMap = GetGWorldPixMap(qtexport->theGWorld); @@ -332,7 +338,7 @@ static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame) } -static void QT_DoAddVideoSamplesToMedia (int frame) +static void QT_DoAddVideoSamplesToMedia (int frame, int *pixels, int rectx, int recty) { OSErr err = noErr; Rect imageRect; @@ -348,7 +354,7 @@ static void QT_DoAddVideoSamplesToMedia (int frame) //copy and flip renderdata - memcpy(qtexport->ibuf2->rect, R.rectot, 4*R.rectx*R.recty); + memcpy(qtexport->ibuf2->rect, pixels, 4*rectx*recty); IMB_flipy(qtexport->ibuf2); //get pointers to parse bitmapdata @@ -359,7 +365,7 @@ static void QT_DoAddVideoSamplesToMedia (int frame) to = (unsigned char *) myPtr; //parse RGBA bitmap into Quicktime's ARGB GWorld - boxsize = R.rectx * R.recty; + boxsize = rectx * recty; for( index = 0; index < boxsize; index++) { to[0] = from[3]; to[1] = from[0]; @@ -415,7 +421,7 @@ void makeqtstring (char *string) { strcpy(string, G.scene->r.pic); BLI_convertstringcode(string, G.sce, G.scene->r.cfra); - RE_make_existing_file(string); + BLI_make_existing_file(string); if (BLI_strcasecmp(string + strlen(string) - 4, ".mov")) { sprintf(txt, "%04d_%04d.mov", (G.scene->r.sfra) , (G.scene->r.efra) ); @@ -424,7 +430,7 @@ void makeqtstring (char *string) { } -void start_qt(void) { +void start_qt(struct RenderData *rd, int rectx, int recty) { OSErr err = noErr; char name[2048]; @@ -446,7 +452,7 @@ void start_qt(void) { qtdata = MEM_callocN(sizeof(QuicktimeComponentData), "QuicktimeCodecDataExt"); - if(G.scene->r.qtcodecdata == NULL && G.scene->r.qtcodecdata->cdParms == NULL) { + if(rd->qtcodecdata == NULL && rd->qtcodecdata->cdParms == NULL) { get_qtcodec_settings(); } else { qtdata->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType); @@ -456,7 +462,7 @@ void start_qt(void) { } if (G.afbreek != 1) { - sframe = (G.scene->r.sfra); + sframe = (rd->sfra); makeqtstring(name); @@ -499,14 +505,14 @@ void start_qt(void) { } else { printf("Created QuickTime movie: %s\n", name); - QT_CreateMyVideoTrack(); + QT_CreateMyVideoTrack(rectx, recty); } } } -void append_qt(int frame) { - QT_DoAddVideoSamplesToMedia(frame); +void append_qt(int frame, int *pixels, int rectx, int recty) { + QT_DoAddVideoSamplesToMedia(frame, pixels, rectx, recty); } diff --git a/source/blender/quicktime/quicktime_export.h b/source/blender/quicktime/quicktime_export.h index 3ecea889fa6..5962ae3d713 100644 --- a/source/blender/quicktime/quicktime_export.h +++ b/source/blender/quicktime/quicktime_export.h @@ -37,9 +37,10 @@ #define __AIFF__ // quicktime movie output functions +struct RenderData; -void start_qt(void); //for initrender.c -void append_qt(int frame); +void start_qt(struct RenderData *rd, int rectx, int recty); //for movie handle (BKE writeavi.c now) +void append_qt(int frame, int *pixels, int rectx, int recty); void end_qt(void); int get_qtcodec_settings(void); //for buttons.c diff --git a/source/blender/radiosity/SConscript b/source/blender/radiosity/SConscript index 6aef7396fd0..0c7205e6a83 100644 --- a/source/blender/radiosity/SConscript +++ b/source/blender/radiosity/SConscript @@ -18,7 +18,8 @@ rad_env.Append (CPPPATH = ['extern/include', '../makesdna', '../include', '#/intern/guardedalloc', - '../render/extern/include']) + '../render/extern/include', + '../render/intern/include']) rad_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE']) diff --git a/source/blender/radiosity/extern/include/radio.h b/source/blender/radiosity/extern/include/radio.h index 81fd9fdda2e..23aa30e3bda 100644 --- a/source/blender/radiosity/extern/include/radio.h +++ b/source/blender/radiosity/extern/include/radio.h @@ -166,7 +166,8 @@ extern void drawpatch_ext(RPatch *patch, unsigned int col); extern void RAD_drawall(int depth_is_on); /* radrender.c */ -extern void do_radio_render(void); +struct Render; +extern void do_radio_render(struct Render *re); void end_radio_render(void); #endif /* RADIO_H */ diff --git a/source/blender/radiosity/extern/include/radio_types.h b/source/blender/radiosity/extern/include/radio_types.h index 442e00cb8ed..ae1f1e4f7ee 100644 --- a/source/blender/radiosity/extern/include/radio_types.h +++ b/source/blender/radiosity/extern/include/radio_types.h @@ -41,6 +41,8 @@ #include "DNA_listBase.h" #include "DNA_material_types.h" +struct Render; + #define DTWIRE 0 #define DTGOUR 2 #define DTSOLID 1 @@ -162,6 +164,7 @@ typedef struct { float elemmin, elemmax; float radfactor, lostenergy, igamma; /* radfac is in button, radfactor is calculated */ int phase; + struct Render *re; /* for calling hemizbuf correctly */ /* to preserve materials as used before, max 16 */ Material *matar[MAXMAT]; int totmat; diff --git a/source/blender/radiosity/intern/source/Makefile b/source/blender/radiosity/intern/source/Makefile index fd2ff50ca41..54a3af8e098 100644 --- a/source/blender/radiosity/intern/source/Makefile +++ b/source/blender/radiosity/intern/source/Makefile @@ -57,3 +57,4 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include # third is the external interface. there should be a nicer way to say this CPPFLAGS += -I../include -I../../../include -I../../extern/include CPPFLAGS += -I../../../render/extern/include +CPPFLAGS += -I../../../render/intern/include diff --git a/source/blender/radiosity/intern/source/radfactors.c b/source/blender/radiosity/intern/source/radfactors.c index cbe861fa443..64beea24d23 100644 --- a/source/blender/radiosity/intern/source/radfactors.c +++ b/source/blender/radiosity/intern/source/radfactors.c @@ -53,11 +53,7 @@ #include "BIF_screen.h" #include "radio.h" -#include "render.h" /* for `RE_zbufferall_radio and RE_zbufferall_radio */ - -#ifdef HAVE_CONFIG_H -#include -#endif +#include "RE_render_ext.h" /* for `RE_zbufferall_radio and RE_zbufferall_radio */ /* locals */ void rad_setmatrices(RadView *vw); @@ -290,7 +286,7 @@ void hemizbuf(RadView *vw) int a, b, inda, hres; rad_setmatrices(vw); - RE_zbufferall_radio(vw, RG.elem, RG.totelem); + RE_zbufferall_radio(vw, RG.elem, RG.totelem, RG.re); /* Render for when we got renderfaces */ /* count factors */ if(vw->recty==vw->rectx) factors= RG.topfactors; diff --git a/source/blender/radiosity/intern/source/radio.c b/source/blender/radiosity/intern/source/radio.c index 923ab69db6e..21292e14df3 100644 --- a/source/blender/radiosity/intern/source/radio.c +++ b/source/blender/radiosity/intern/source/radio.c @@ -238,6 +238,8 @@ void set_radglobal() RG.gamma= rad->gamma; RG.maxiter= rad->maxiter; + RG.re= NULL; /* struct render, for when call it from render engine */ + rad_setlimits(); } diff --git a/source/blender/radiosity/intern/source/radrender.c b/source/blender/radiosity/intern/source/radrender.c index a6ff8657d0c..ffb896a8c49 100644 --- a/source/blender/radiosity/intern/source/radrender.c +++ b/source/blender/radiosity/intern/source/radrender.c @@ -69,7 +69,11 @@ #include "BIF_screen.h" #include "radio.h" -#include "render.h" + +/* the radiosity module uses internal includes from render! */ +#include "renderpipeline.h" +#include "render_types.h" +#include "renderdatabase.h" #ifdef HAVE_CONFIG_H #include @@ -80,7 +84,7 @@ static float maxenergy; /* find the face with maximum energy to become shooter */ /* nb: _rr means rad-render version of existing radio call */ -static VlakRen *findshoot_rr(void) +static VlakRen *findshoot_rr(Render *re) { RadFace *rf; VlakRen *vlr=NULL, *shoot; @@ -90,8 +94,8 @@ static VlakRen *findshoot_rr(void) shoot= NULL; maxenergy= 0.0; - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->radface) { rf= vlr->radface; rf->flag &= ~RAD_SHOOT; @@ -116,7 +120,7 @@ static VlakRen *findshoot_rr(void) return shoot; } -static void backface_test_rr(VlakRen *shoot) +static void backface_test_rr(Render *re, VlakRen *shoot) { VlakRen *vlr=NULL; RadFace *rf; @@ -124,8 +128,8 @@ static void backface_test_rr(VlakRen *shoot) int a; /* backface testing */ - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->radface) { if(vlr!=shoot) { rf= vlr->radface; @@ -139,15 +143,15 @@ static void backface_test_rr(VlakRen *shoot) } } -static void clear_backface_test_rr() +static void clear_backface_test_rr(Render *re) { VlakRen *vlr=NULL; RadFace *rf; int a; /* backface flag clear */ - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->radface) { rf= vlr->radface; @@ -159,7 +163,7 @@ static void clear_backface_test_rr() extern RadView hemitop, hemiside; // radfactors.c /* hemi-zbuffering, delivers formfactors array */ -static void makeformfactors_rr(VlakRen *shoot) +static void makeformfactors_rr(Render *re, VlakRen *shoot) { VlakRen *vlr=NULL; RadFace *rf; @@ -203,8 +207,8 @@ static void makeformfactors_rr(VlakRen *shoot) /* convert factors to real radiosity */ fp= RG.formfactors; - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->radface) { rf= vlr->radface; @@ -218,7 +222,7 @@ static void makeformfactors_rr(VlakRen *shoot) } /* based at RG.formfactors array, distribute shoot energy over other faces */ -static void applyformfactors_rr(VlakRen *shoot) +static void applyformfactors_rr(Render *re, VlakRen *shoot) { VlakRen *vlr=NULL; RadFace *rf; @@ -231,8 +235,8 @@ static void applyformfactors_rr(VlakRen *shoot) fp= RG.formfactors; - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->radface) { rf= vlr->radface; @@ -263,52 +267,51 @@ static void applyformfactors_rr(VlakRen *shoot) /* main loop for itterations */ -static void progressiverad_rr() +static void progressiverad_rr(Render *re) { - extern void RE_local_timecursor(int); // RE_callbacks.c VlakRen *shoot; float unshot[3]; int it= 0; - shoot= findshoot_rr(); + shoot= findshoot_rr(re); while( shoot ) { /* backfaces receive no energy, but are zbuffered... */ - backface_test_rr(shoot); + backface_test_rr(re, shoot); /* ...unless it's two sided */ if(shoot->radface->flag & RAD_TWOSIDED) { VECCOPY(unshot, shoot->radface->unshot); VecMulf(shoot->radface->norm, -1.0); - makeformfactors_rr(shoot); - applyformfactors_rr(shoot); + makeformfactors_rr(re, shoot); + applyformfactors_rr(re, shoot); VecMulf(shoot->radface->norm, -1.0); VECCOPY(shoot->radface->unshot, unshot); } /* hemi-zbuffers */ - makeformfactors_rr(shoot); + makeformfactors_rr(re, shoot); /* based at RG.formfactors array, distribute shoot energy over other faces */ - applyformfactors_rr(shoot); + applyformfactors_rr(re, shoot); it++; - RE_local_timecursor(it); + re->timecursor(it); - clear_backface_test_rr(); + clear_backface_test_rr(re); if(blender_test_break()) break; if(RG.maxiter && RG.maxiter<=it) break; - shoot= findshoot_rr(); + shoot= findshoot_rr(re); } printf(" Unshot energy:%f\n", 1000.0*maxenergy); - RE_local_timecursor((G.scene->r.cfra)); + re->timecursor((G.scene->r.cfra)); } static RadFace *radfaces=NULL; -static void initradfaces(void) +static void initradfaces(Render *re) { VlakRen *vlr= NULL; RadFace *rf; @@ -323,8 +326,8 @@ static void initradfaces(void) RG.max[0]= RG.max[1]= RG.max[2]= -1.0e20; /* count first for fast malloc */ - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->mat->mode & MA_RADIO) { if(vlr->mat->emit > 0.0) { @@ -339,8 +342,8 @@ printf(" Rad elems: %d emittors %d\n", RG.totelem, RG.totpatch); /* make/init radfaces */ rf=radfaces= MEM_callocN(RG.totelem*sizeof(RadFace), "radfaces"); - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->mat->mode & MA_RADIO) { @@ -403,7 +406,7 @@ static void vecaddfac(float *vec, float *v1, float *v2, float fac) /* static void filter_rad_values(void) */ -static void make_vertex_rad_values() +static void make_vertex_rad_values(Render *re) { VertRen *v1=NULL; VlakRen *vlr=NULL; @@ -415,8 +418,8 @@ static void make_vertex_rad_values() RG.radfactor= RG.radfac*pow(64*64, RG.igamma)/128.0; /* compatible with radio-tool */ /* accumulate vertexcolors */ - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->radface) { rf= vlr->radface; @@ -431,20 +434,20 @@ static void make_vertex_rad_values() if(vlr->mat->g > 0.0) rf->totrad[1]/= vlr->mat->g; if(vlr->mat->b > 0.0) rf->totrad[2]/= vlr->mat->b; - col= RE_vertren_get_rad(vlr->v1, 1); + col= RE_vertren_get_rad(re, vlr->v1, 1); vecaddfac(col, col, rf->totrad, rf->area); col[3]+= rf->area; - col= RE_vertren_get_rad(vlr->v2, 1); + col= RE_vertren_get_rad(re, vlr->v2, 1); vecaddfac(col, col, rf->totrad, rf->area); col[3]+= rf->area; - col= RE_vertren_get_rad(vlr->v3, 1); + col= RE_vertren_get_rad(re, vlr->v3, 1); vecaddfac(col, col, rf->totrad, rf->area); col[3]+= rf->area; if(vlr->v4) { - col= RE_vertren_get_rad(vlr->v4, 1); + col= RE_vertren_get_rad(re, vlr->v4, 1); vecaddfac(col, col, rf->totrad, rf->area); col[3]+= rf->area; } @@ -452,9 +455,9 @@ static void make_vertex_rad_values() } /* make vertex colors */ - for(a=0; atotvert; a++) { + if((a & 255)==0) v1= RE_findOrAddVert(re, a); else v1++; + col= RE_vertren_get_rad(re, v1, 0); if(col[3]>0.0) { col[0]/= col[3]; col[1]/= col[3]; @@ -465,22 +468,23 @@ static void make_vertex_rad_values() } /* main call, extern */ -void do_radio_render(void) +void do_radio_render(Render *re) { if(G.scene->radio==NULL) add_radio(); freeAllRad(); /* just in case radio-tool is still used */ set_radglobal(); /* init the RG struct */ - - initradfaces(); /* add radface structs to render faces */ + RG.re= re; /* only used by hemizbuf(), prevents polluting radio code all over */ + + initradfaces(re); /* add radface structs to render faces */ if(RG.totenergy>0.0) { initradiosity(); /* LUT's */ inithemiwindows(); /* views, need RG.maxsize for clipping */ - progressiverad_rr(); /* main radio loop */ + progressiverad_rr(re); /* main radio loop */ - make_vertex_rad_values(); /* convert face energy to vertex ones */ + make_vertex_rad_values(re); /* convert face energy to vertex ones */ } diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h new file mode 100644 index 00000000000..14d21b699a3 --- /dev/null +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -0,0 +1,161 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef RE_PIPELINE_H +#define RE_PIPELINE_H + +#include "DNA_listBase.h" +#include "DNA_vec_types.h" +#include "BKE_utildefines.h" + +struct Scene; +struct RenderData; + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* this include is what is exposed of render to outside world */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + +#define RE_MAXNAME 32 + +/* only used as handle */ +typedef struct Render Render; + +/* Render Result usage: + +- render engine allocates/frees and delivers raw floating point rects +- right now it's full rects, but might become tiles or file +- the display client has to allocate display rects, sort out what to display, + and how it's converted +*/ + +/* a renderlayer is a full image, but with all passes and samples */ +/* size of the rects is defined in RenderResult */ +typedef struct RenderLayer { + struct RenderLayer *next, *prev; + + char name[RE_MAXNAME]; + int flag, type; + + float *rectf; /* standard rgba buffer */ + float *rectz; /* standard camera coordinate zbuffer */ + + ListBase passes; + +} RenderLayer; + +typedef struct RenderResult { + + /* target image size */ + int rectx, recty; + short crop, pad; + + /* optional, 32 bits version of (composited?) layers */ + int *rect32; + + /* coordinates within final image (after cropping) */ + rcti tilerect; + + /* the main buffers */ + ListBase layers; + + /* optional saved endresult on disk */ + char exrfile[FILE_MAXDIR]; + int filehandle; + +} RenderResult; + +typedef struct RenderStats { + int totface, totvert, tothalo, totlamp, totpart; + short curfield, curblur, curpart, partsdone, convertdone; + double starttime, lastframetime; + +} RenderStats; + +/* *********************** API ******************** */ + +/* the name is used as identifier, so elsewhere in blender the result can retrieved */ +/* calling a new render with same name, frees automatic existing render */ +Render *RE_NewRender (const char *name); +Render *RE_GetRender(const char *name); + +/* use free render as signal to do everything over (previews) */ +void RE_FreeRender (Render *re); +/* only called on exit */ +void RE_FreeAllRender (void); + +/* get results and statistics */ +RenderResult *RE_GetResult(Render *re); +RenderStats *RE_GetStats(Render *re); +void RE_ResultGet32(Render *re, unsigned int *rect); + +/* obligatory initialize call, disprect is optional */ +void RE_InitState (struct Render *re, struct RenderData *rd, int winx, int winy, rcti *disprect); + +/* use this to change disprect of active render */ +void RE_SetDispRect (struct Render *re, rcti *disprect); + +/* set up the viewplane/perspective matrix, three choices */ +void RE_SetCamera(Render *re, struct Object *camera); +void RE_SetWindow (Render *re, rctf *viewplane, float clipsta, float clipend); +void RE_SetOrtho (Render *re, rctf *viewplane, float clipsta, float clipend); + +/* option to set viewmatrix before making dbase */ +void RE_SetView (Render *re, float mat[][4]); + +/* make or free the dbase */ +void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view); +void RE_Database_Free (Render *re); + +/* project dbase again, when viewplane/perspective changed */ +void RE_DataBase_ApplyWindow(Render *re); + +/* the main processor, assumes all was set OK! */ +void RE_TileProcessor(Render *re); + +/* only RE_NewRender() needed, main Blender render calls */ +void RE_BlenderFrame(Render *re, struct Scene *scene, int frame); +void RE_BlenderAnim(Render *re, struct Scene *scene, int sfra, int efra); + + +/* display and event callbacks */ +void RE_display_init_cb (Render *re, void (*f)(RenderResult *rr)); +void RE_display_clear_cb(Render *re, void (*f)(RenderResult *rr)); +void RE_display_draw_cb (Render *re, void (*f)(RenderResult *rr, struct rcti *rect)); +void RE_stats_draw_cb (Render *re, void (*f)(RenderStats *rs)); +void RE_timecursor_cb (Render *re, void (*f)(int)); +void RE_test_break_cb (Render *re, int (*f)(void)); +void RE_test_return_cb (Render *re, int (*f)(void)); +void RE_error_cb (Render *re, void (*f)(const char *str)); + + + + +#endif /* RE_PIPELINE_H */ + diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h new file mode 100644 index 00000000000..b8fc573a9a5 --- /dev/null +++ b/source/blender/render/extern/include/RE_render_ext.h @@ -0,0 +1,49 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 by Blender Foundation + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +#ifndef RE_RENDER_EXT_H +#define RE_RENDER_EXT_H + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* this include is for non-render pipeline exports (still old cruft here) */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* called by meshtools */ +void RE_make_sticky(void); + +/* for radiosity module */ +struct RadView; +struct RNode; +void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem, struct Render *re); + +/* effect.c and editmesh_modes. */ +void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta); + +#endif /* RE_RENDER_EXT_H */ + diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h new file mode 100644 index 00000000000..84204d88976 --- /dev/null +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -0,0 +1,107 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 by Blender Foundation + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +#ifndef RE_SHADER_EXT_H +#define RE_SHADER_EXT_H + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* this include is for shading and texture exports */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* localized texture result data */ +/* note; tr tg tb ta has to remain in this order */ +typedef struct TexResult { + float tin, tr, tg, tb, ta; + int talpha; + float *nor; +} TexResult; + +/* localized shade result data */ +typedef struct ShadeResult +{ + float diff[3]; + float spec[3]; + float alpha; + +} ShadeResult; + +/* localized renderloop data */ +typedef struct ShadeInput +{ + struct Material *mat; + struct VlakRen *vlr; + float co[3]; + + /* copy from material, keep synced so we can do memcopy */ + /* current size: 23*4 */ + float r, g, b; + float specr, specg, specb; + float mirr, mirg, mirb; + float ambr, ambb, ambg; + + float amb, emit, ang, spectra, ray_mirror; + float alpha, refl, spec, zoffs, add; + float translucency; + /* end direct copy from material */ + + /* individual copies: */ + int har; + float layerfac; + + /* texture coordinates */ + float lo[3], gl[3], uv[3], ref[3], orn[3], winco[3], sticky[3], vcol[3], rad[3]; + float vn[3], vno[3], facenor[3], view[3], refcol[4], displace[3], strand, tang[3], stress; + + /* dx/dy OSA coordinates */ + float dxco[3], dyco[3]; + float dxlo[3], dylo[3], dxgl[3], dygl[3], dxuv[3], dyuv[3]; + float dxref[3], dyref[3], dxorn[3], dyorn[3]; + float dxno[3], dyno[3], dxview, dyview; + float dxlv[3], dylv[3]; + float dxwin[3], dywin[3]; + float dxsticky[3], dysticky[3]; + float dxrefract[3], dyrefract[3]; + float dxstrand, dystrand; + + int xs, ys; /* pixel to be rendered */ + short do_preview; /* for nodes, in previewrender */ + short thread; + short osatex, puno; + int mask; + int depth; + +} ShadeInput; + + +/* node shaders... */ +int multitex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres); + + +#endif /* RE_SHADER_EXT_H */ + diff --git a/source/blender/render/extern/include/render.h b/source/blender/render/extern/include/render.h deleted file mode 100644 index 0622ae79112..00000000000 --- a/source/blender/render/extern/include/render.h +++ /dev/null @@ -1,304 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Interface to transform the Blender scene into renderable data. - */ - -#ifndef RENDER_H -#define RENDER_H - -/* ------------------------------------------------------------------------- */ -/* This little preamble might be moved to a separate include. It contains */ -/* some defines that should become functions, and some platform dependency */ -/* fixes. I think it is risky to always include it... */ -/* ------------------------------------------------------------------------- */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------------------------------------------------------------------- */ -/* Types */ -/* Both external and internal types can be placed here. Make sure there are */ -/* no dirty extras in the type files so they can be included without */ -/* problems. If possible, make a note why the include is needed. */ -/* ------------------------------------------------------------------------- */ - -#include "render_types.h" - -/* ------------------------------------------------------------------------- */ -/* Global variables */ -/* These variable are global to the render module, and also externally */ -/* visible. The file where they are defined must be added. */ -/* ------------------------------------------------------------------------- */ - -extern RE_Render R; /* rendercore.c */ -extern unsigned short *igamtab1; /* initrender.c */ -extern unsigned short *gamtab; /* initrender.c */ - -struct View3D; - -/* ------------------------------------------------------------------------- */ -/* Function definitions */ -/* */ -/* All functions that need to be externally visible must be declared here. */ -/* Currently, this interface contains 38 functions and 11 callbacks. */ -/* ------------------------------------------------------------------------- */ - - -/* ------------------------------------------------------------------------- */ -/* shadbuf.c (1) */ -/* ------------------------------------------------------------------------- */ - -/* only for renderconvertor */ -void RE_initshadowbuf(struct LampRen *lar, float mat[][4]); - - -/* ------------------------------------------------------------------------- */ -/* initrender (9) */ -/* ------------------------------------------------------------------------- */ - -struct View3D; - -/** - * Guarded call to frame renderer? Tests several limits and boundary - * conditions. - * - * @param ogl_render_area The View3D area to use for OpenGL rendering - * (can be NULL unless render R_OGL flag is set) - */ -void RE_initrender(struct View3D *ogl_render_view3d); - -/** - * only for renderconvertor - */ -void RE_setwindowclip(int mode, int jmode); - -/* - * @param ogl_render_area The View3D area to use for OpenGL rendering - * (can be NULL unless render R_OGL flag is set) - */ -void RE_animrender(struct View3D *ogl_render_view3d); -void RE_free_render_data(void); -void RE_init_render_data(void); - /* jitterate is used by blenkernel effect */ -void RE_jitterate1(float *jit1, float *jit2, int num, float rad1); -void RE_jitterate2(float *jit1, float *jit2, int num, float rad2); -void RE_make_existing_file(char *name); -void RE_floatbuffer_to_output(void); - -/* ------------------------------------------------------------------------- */ -/* zbuf (2) */ -/* ------------------------------------------------------------------------- */ - -/** - * Converts a world coordinate into a homogenous coordinate in view - * coordinates. (WCS -> HCS) - * Also called in: shadbuf.c render.c radfactors.c - * initrender.c envmap.c editmesh.c - * @param v1 [3 floats] the world coordinate - * @param adr [4 floats] the homogenous view coordinate - */ -void RE_projectverto(float *v1,float *adr); - -/** - * Something about doing radiosity z buffering? - * (called in radfactors.c), hope the RadView is defined already... - * Also called in: radfactors.c - * Note: Uses globals. - * @param radview radiosity view definition - */ - struct RadView; - struct RNode; -void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem); - - -/* ------------------------------------------------------------------------- */ -/* texture (9) */ -/* ------------------------------------------------------------------------- */ -struct MTex; -struct Tex; -struct TexResult; - -void init_render_textures(void); -void init_render_texture(struct Tex *tex); - -void do_material_tex(ShadeInput *shi); -void do_lamp_tex(struct LampRen *la, float *lavec, ShadeInput *shi, float *fcol); - -int multitex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres); -int multitex_ext(struct Tex *tex, float *texvec, float *tin, float *tr, float *tg, float *tb, float *ta); -void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta); - -/* ------------------------------------------------------------------------- */ -/* envmap (4) */ -/* ------------------------------------------------------------------------- */ -struct EnvMap; - -void RE_free_envmapdata(struct EnvMap *env); -void RE_free_envmap(struct EnvMap *env); -struct EnvMap *RE_add_envmap(void); -/* these two maybe not external? yes, they are, for texture.c */ -struct EnvMap *RE_copy_envmap(struct EnvMap *env); - -/* --------------------------------------------------------------------- */ -/* rendercore (12) */ -/* --------------------------------------------------------------------- */ -struct MaterialLayer; -struct ShadeResult; - -float Phong_Spec(float *n, float *l, float *v, int hard, int tangent); -float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent); -float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power, int tangent); -float Toon_Spec( float *n, float *l, float *v, float size, float smooth, int tangent); -float WardIso_Spec(float *n, float *l, float *v, float rms, int tangent); - -float OrenNayar_Diff(float *n, float *l, float *v, float rough); -float Toon_Diff( float *n, float *l, float *v, float size, float smooth); -float Minnaert_Diff( float nl, float *n, float *v, float darkness); -float Fresnel_Diff(float *vn, float *lv, float *view, float ior, float fac); - -void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b); -void ramp_diffuse_result(float *diff, ShadeInput *shi); -void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec); -void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi); - -void matlayer_blend(struct MaterialLayer *ml, float blendfac, struct ShadeResult *target, struct ShadeResult *src); -void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col); - -void shade_material_loop(struct ShadeInput *shi, struct ShadeResult *shr); - -/* --------------------------------------------------------------------- */ -/* ray.c (2) */ -/* --------------------------------------------------------------------- */ -void init_jitter_plane(LampRen *lar); -void init_ao_sphere(float *sphere, int tot, int iter); - - -/* --------------------------------------------------------------------- */ -/* renderdatabase () */ -/* --------------------------------------------------------------------- */ -struct VlakRen *RE_findOrAddVlak(int nr); -struct VertRen *RE_findOrAddVert(int nr); -struct HaloRen *RE_findOrAddHalo(int nr); -HaloRen *RE_inithalo(struct Material *ma, float *vec, float *vec1, float *orco, float hasize, - float vectsize, int seed); - -float *RE_vertren_get_sticky(struct VertRen *ver, int verify); -float *RE_vertren_get_stress(struct VertRen *ver, int verify); -float *RE_vertren_get_rad(struct VertRen *ver, int verify); -float *RE_vertren_get_strand(struct VertRen *ver, int verify); -float *RE_vertren_get_tangent(struct VertRen *ver, int verify); - -void RE_free_vertex_tables(void); -void RE_init_vertex_tables(void); - -/** - * callbacks (11): - * - * If the callbacks aren't set, rendering will still proceed as - * desired, but the concerning functionality will not be enabled. - * - * There need to be better uncoupling between the renderer and - * these functions still! - * */ - -void RE_set_test_break_callback(int (*f)(void)); - -void RE_set_timecursor_callback(void (*f)(int)); - -void RE_set_renderdisplay_callback(void (*f)(int, int, int, int, unsigned int *)); -void RE_set_initrenderdisplay_callback(void (*f)(void)); -void RE_set_clearrenderdisplay_callback(void (*f)(short)); - -void RE_set_printrenderinfo_callback(void (*f)(double,int)); - -void RE_set_getrenderdata_callback(void (*f)(void)); -void RE_set_freerenderdata_callback(void (*f)(void)); - - -/*from renderhelp, should disappear!!! */ -/** Recalculate all normals on renderdata. */ -void set_normalflags(void); -/** - * On loan from zbuf.h: - * Tests whether the first three coordinates should be clipped - * wrt. the fourth component. Bits 1 and 2 test on x, 3 and 4 test on - * y, 5 and 6 test on z: - * xyz > test => set first bit (01), - * xyz < -test => set second bit (10), - * xyz == test => reset both bits (00). - * Note: functionality is duplicated from an internal function - * Also called in: initrender.c, radfactors.c - * @param v [4 floats] a coordinate - * @return a vector of bitfields - */ -int RE_testclip(float *v); - -/* patch for the external if, to support the split for the ui */ -void RE_addalphaAddfac(char *doel, char *bron, char addfac); -void RE_sky_char(float *view, char *col); -void RE_renderflare(struct HaloRen *har); -/** - * Shade the pixel at xn, yn for halo har, and write the result to col. - * Also called in: previewrender.c - * @param har The halo to be rendered on this location - * @param col [char 4] The destination colour vector - * @param colf [float 4] destination colour vector (need both) - * @param zz Some kind of distance - * @param dist Square of the distance of this coordinate to the halo's center - * @param x [f] Pixel x relative to center - * @param y [f] Pixel y relative to center - * @param flarec Flare counter? Always har->flarec... - */ -void RE_shadehalo(struct HaloRen *har, - char *col, float *colf, - int zz, - float dist, - float x, - float y, - short flarec); - -/***/ - -/* haloren->type: flags */ - -#define HA_ONLYSKY 1 -#define HA_VECT 2 -#define HA_XALPHA 4 -#define HA_FLARECIRC 8 - -#ifdef __cplusplus -} -#endif - -#endif /* RENDER_H */ - diff --git a/source/blender/render/extern/include/render_types.h b/source/blender/render/extern/include/render_types.h deleted file mode 100644 index 8fad87c2707..00000000000 --- a/source/blender/render/extern/include/render_types.h +++ /dev/null @@ -1,356 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef RENDER_TYPES_H -#define RENDER_TYPES_H - -#include "DNA_scene_types.h" -#include "DNA_world_types.h" -#include "DNA_object_types.h" - -#define TABLEINITSIZE 1024 -#define LAMPINITSIZE 256 - -/* This is needed to not let VC choke on near and far... old - * proprietary MS extensions... */ -#ifdef WIN32 -#undef near -#undef far -#define near clipsta -#define far clipend -#endif - -/* ------------------------------------------------------------------------- */ - -/* localized texture result data */ -/* note; tr tg tb ta has to remain in this order */ -typedef struct TexResult { - float tin, tr, tg, tb, ta; - int talpha; - float *nor; -} TexResult; - -/* localized shade result data */ -typedef struct ShadeResult -{ - float diff[3]; - float spec[3]; - float alpha; - -} ShadeResult; - -/* localized renderloop data */ -typedef struct ShadeInput -{ - struct Material *mat; - struct VlakRen *vlr; - float co[3]; - - /* copy from material, keep synced so we can do memcopy */ - /* current size: 23*4 */ - float r, g, b; - float specr, specg, specb; - float mirr, mirg, mirb; - float ambr, ambb, ambg; - - float amb, emit, ang, spectra, ray_mirror; - float alpha, refl, spec, zoffs, add; - float translucency; - /* end direct copy from material */ - - /* individual copies: */ - int har; - float layerfac; - - /* texture coordinates */ - float lo[3], gl[3], uv[3], ref[3], orn[3], winco[3], sticky[3], vcol[3], rad[3]; - float vn[3], vno[3], facenor[3], view[3], refcol[4], displace[3], strand, tang[3], stress; - - /* dx/dy OSA coordinates */ - float dxco[3], dyco[3]; - float dxlo[3], dylo[3], dxgl[3], dygl[3], dxuv[3], dyuv[3]; - float dxref[3], dyref[3], dxorn[3], dyorn[3]; - float dxno[3], dyno[3], dxview, dyview; - float dxlv[3], dylv[3]; - float dxwin[3], dywin[3]; - float dxsticky[3], dysticky[3]; - float dxrefract[3], dyrefract[3]; - float dxstrand, dystrand; - - int xs, ys; /* pixel to be rendered */ - short do_preview, pr_type; /* for nodes, in previewrender */ - short osatex, puno; - int mask; - int depth; - -} ShadeInput; - -struct MemArena; -struct VertTableNode; - -/* here only stuff to initalize the render itself */ -typedef struct RE_Render -{ - float grvec[3]; - float imat[3][3]; - - float viewmat[4][4], viewinv[4][4]; - float persmat[4][4], persinv[4][4]; - float winmat[4][4]; - - short flag, osa, rt, pad; - /** - * Screen sizes and positions, in pixels - */ - short xstart, xend, ystart, yend, afmx, afmy; - short rectx; /* Picture width - 1, normally xend - xstart. */ - short recty; /* picture height - 1, normally yend - ystart. */ - - /** - * Distances and sizes in world coordinates nearvar, farvar were - * near and far, but VC in cpp mode chokes on it :( */ - float near; /* near clip distance */ - float far; /* far clip distance */ - float ycor, pixsize, viewfac; - - - /* These three need to be 'handlerized'. Not an easy task... */ -/* RE_RenderDataHandle r; */ - RenderData r; - World wrld; - ListBase parts; - - int totvlak, totvert, tothalo, totlamp; - - /* internal, fortunately */ - ListBase lights; - struct LampRen **la; - struct VlakRen **blovl; - struct VertTableNode *vertnodes; - struct HaloRen **bloha; - - /* arena for allocating data for use during render, for - * example dynamic TFaces to go in the VlakRen structure. - */ - struct MemArena *memArena; - - int *rectaccu; - int *rectz; /* z buffer: distance buffer */ - float *rectzf; /* z distances, camera space */ - unsigned int *rectf1, *rectf2; - unsigned int *rectot; /* z buffer: face index buffer, recycled as colour buffer! */ - unsigned int *rectspare; /* */ - /* for 8 byte systems! */ - long *rectdaps; - float *rectftot; /* original full color buffer */ - - short win, winpos, winx, winy, winxof, winyof; - short winpop, displaymode, sparex, sparey; - - /* Not sure what these do... But they're pointers, so good for handlerization */ - struct Image *backbuf, *frontbuf; - /* backbuf is an image that drawn as background */ - -} RE_Render; - -/* ------------------------------------------------------------------------- */ - - -typedef struct ShadBuf { - short samp, shadhalostep; - float persmat[4][4]; - float viewmat[4][4]; - float winmat[4][4]; - float *jit; - float d,far,pixsize,soft; - int co[3]; - int size,bias; - long *zbuf; - char *cbuf; -} ShadBuf; - -/* ------------------------------------------------------------------------- */ - -typedef struct VertRen -{ - float co[3]; - float n[3]; - float ho[4]; - float *orco; - short clip; - short flag; /* in use for clipping ztra parts, temp setting stuff in convertBlenderscene.c */ - float accum; /* accum for radio weighting, and for strand texco static particles */ - int index; /* index allows extending vertren with any property */ -} VertRen; - -/* ------------------------------------------------------------------------- */ - -struct halosort { - struct HaloRen *har; - int z; -}; - -/* ------------------------------------------------------------------------- */ -struct Material; -struct TFace; - -typedef struct RadFace { - float unshot[3], totrad[3]; - float norm[3], cent[3], area; - int flag; -} RadFace; - -typedef struct VlakRen -{ - struct VertRen *v1, *v2, *v3, *v4; - unsigned int lay; - unsigned int raycount; - float n[3]; - struct Material *mat; - struct TFace *tface; - unsigned int *vcol; - char snproj, puno; - char flag, ec; - RadFace *radface; - Object *ob; -} VlakRen; - -/* vlakren->flag is in DNA_scene_types.h */ - -typedef struct HaloRen -{ - short miny, maxy; - float alfa, xs, ys, rad, radsq, sin, cos, co[3], no[3]; - float hard, b, g, r; - int zs, zd; - int zBufDist; /* depth in the z-buffer coordinate system */ - char starpoints, type, add, tex; - char linec, ringc, seed; - short flarec; /* used to be a char. why ?*/ - float hasize; - int pixels; - unsigned int lay; - struct Material *mat; -} HaloRen; - -struct LampRen; -struct MTex; - -/** - * For each lamp in a scene, a LampRen is created. It determines the - * properties of a lightsource. - */ -typedef struct LampRen -{ - float xs, ys, dist; - float co[3]; - short type, mode; - float r, g, b, k; - float energy, haint; - int lay; - float spotsi,spotbl; - float vec[3]; - float xsp, ysp, distkw, inpr; - float halokw, halo; - float ld1,ld2; - - /* copied from Lamp, to decouple more rendering stuff */ - /** Size of the shadowbuffer */ - short bufsize; - /** Number of samples for the shadows */ - short samp; - /** Softness factor for shadow */ - float soft; - /** shadow plus halo: detail level */ - short shadhalostep; - /** Near clip of the lamp */ - float clipsta; - /** Far clip of the lamp */ - float clipend; - /** A small depth offset to prevent self-shadowing. */ - float bias; - - short ray_samp, ray_sampy, ray_sampz, ray_samp_type, area_shape, ray_totsamp; - short xold1, yold1, xold2, yold2; /* last jitter table for area lights */ - float area_size, area_sizey, area_sizez; - - struct ShadBuf *shb; - float *jitter; - - float imat[3][3]; - float spottexfac; - float sh_invcampos[3], sh_zfac; /* sh_= spothalo */ - - float mat[3][3]; /* 3x3 part from lampmat x viewmat */ - float area[8][3], areasize; - - /* yafray: photonlight params */ - int YF_numphotons, YF_numsearch; - short YF_phdepth, YF_useqmc, YF_bufsize; - float YF_causticblur, YF_ltradius; - float YF_glowint, YF_glowofs; - short YF_glowtype; - - /* ray optim */ - VlakRen *vlr_last; - - struct MTex *mtex[MAX_MTEX]; -} LampRen; - -/* **************** defines ********************* */ - -/* mode flag is same as for renderdata */ -/* flag */ -#define R_ZTRA 1 -#define R_HALO 2 -#define R_SEC_FIELD 4 -#define R_LAMPHALO 8 -#define R_RENDERING 16 -#define R_ANIMRENDER 32 -#define R_REDRAW_PRV 64 - -/* vlakren->flag (vlak = face in dutch) char!!! */ -#define R_SMOOTH 1 -#define R_VISIBLE 2 -/* strand flag, means special handling */ -#define R_STRAND 4 -#define R_NOPUNOFLIP 8 -#define R_FULL_OSA 16 -#define R_FACE_SPLIT 32 -/* Tells render to divide face other way. */ -#define R_DIVIDE_24 64 -/* vertex normals are tangent or view-corrected vector, for hair strands */ -#define R_TANGENT 128 - - - - - -#endif /* RENDER_TYPES_H */ - diff --git a/source/blender/render/intern/include/RE_callbacks.h b/source/blender/render/intern/include/RE_callbacks.h deleted file mode 100644 index 159eaa84ca4..00000000000 --- a/source/blender/render/intern/include/RE_callbacks.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Callbacks to make the renderer interact with calling modules. - */ - -#ifndef RE_CALLBACKS_H -#define RE_CALLBACKS_H - -#ifdef __cplusplus -extern "C" { -#endif - - /** - * Test whether operation should be prematurely terminated. - * - * @returns 0 to continue, any other value to break. - */ - int RE_local_test_break(void); - - /** - * Set a red square with the argument as text as cursor. - */ - void RE_local_timecursor(int i); - - /** - * Render these lines from the renderbuffer on screen (needs better spec) - */ - void RE_local_render_display(int i, int j, int k, int l, unsigned int *m); - - /** - * Initialise a render display (needs better spec) - */ - void RE_local_init_render_display(void); - - /** - * Clear/close a render display (needs better spec) - */ - void RE_local_clear_render_display(short); - - /** - * Print render statistics. - */ - void RE_local_printrenderinfo(double time, int i); - - /** Get the data for the scene to render. */ - void RE_local_get_renderdata(void); - - /** Release the data for the scene that was rendered. */ - void RE_local_free_renderdata(void); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/source/blender/render/intern/include/envmap.h b/source/blender/render/intern/include/envmap.h index 7a44a139b20..32d72555ca4 100644 --- a/source/blender/render/intern/include/envmap.h +++ b/source/blender/render/intern/include/envmap.h @@ -41,10 +41,11 @@ * (initrender.c) */ +struct Render; struct TexResult; -void make_envmaps(void); -int envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres); +void make_envmaps(struct Render *re); +int envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres); #endif /* ENVMAP_EXT_H */ diff --git a/source/blender/render/intern/include/errorHandler.h b/source/blender/render/intern/include/errorHandler.h deleted file mode 100644 index fb980fa255a..00000000000 --- a/source/blender/render/intern/include/errorHandler.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * errorHandler.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef ERRORHANDLER_H -#define ERRORHANDLER_H - -/* error codes */ -enum RE_RENDER_ERROR { - RE_NO_ERROR, - RE_DEPTH_MISMATCH, /* 1. conflict resolution detects a bad z value */ - RE_BAD_FACE_TYPE, /* 2. a face type switch fails */ - RE_BAD_FACE_INDEX, /* 3. tried to do an operation with a bad index */ - RE_BAD_DATA_POINTER, - RE_TRACE_COUNTER, - RE_TOO_MANY_FACES, /* 6. overflow on z-buffer depth */ - RE_EDGERENDER_WRITE_OUTSIDE_BUFFER, /* 7. write value outside buffer */ - RE_CANNOT_ALLOCATE_MEMORY, /* 8. no memory for malloc */ - RE_WRITE_OUTSIDE_COLOUR_BUFFER, /* 9. write outside colour target buffer */ - RE_MAX_ERROR -}; - -/** - * Reset all counters for the error trace - */ -void RE_errortrace_reset(void); - -/** - * Signals an error to screen. Counts repetitive errors - */ -void RE_error(int errType, char* fname); - -/** - * Signals an error, and prints an integer argument - */ -void RE_error_int(int errType, char* fname, int valye); - -#endif /* ERRORHANDLER_H */ - diff --git a/source/blender/render/intern/include/gammaCorrectionTables.h b/source/blender/render/intern/include/gammaCorrectionTables.h index 6197f769f6f..3d0928f84a3 100644 --- a/source/blender/render/intern/include/gammaCorrectionTables.h +++ b/source/blender/render/intern/include/gammaCorrectionTables.h @@ -35,25 +35,11 @@ #ifndef GAMMACORRECTIONTABLES_H #define GAMMACORRECTIONTABLES_H -/* Default gamma. For most CRTs, gamma ranges from 2.2 to 2.5 (Foley), so */ -/* 2.35 seems appropriate enough. Experience teaches a different number */ -/* though. Old blender: 2.0. It might be nice to make this a slider */ -#define RE_DEFAULT_GAMMA 2.0 -/* This 400 is sort of based on the number of intensity levels needed for */ -/* the typical dynamic range of a medium, in this case CRTs. (Foley) */ -/* (Actually, it says the number should be between 400 and 535.) */ -#define RE_GAMMA_TABLE_SIZE 400 - /** * Initialise the gamma lookup tables */ void makeGammaTables(float gamma); -/** - * Returns true if the table is initialised, false otherwise - */ -int gammaTableIsInitialised(void); - /** * Apply gamma correction on col */ @@ -64,10 +50,5 @@ float gammaCorrect(float col); */ float invGammaCorrect(float col); -/** - * Tell whether or not to do gamma. - */ -extern int do_gamma; - #endif diff --git a/source/blender/render/intern/include/initrender.h b/source/blender/render/intern/include/initrender.h index 15ec3eb69a3..9a94d193990 100644 --- a/source/blender/render/intern/include/initrender.h +++ b/source/blender/render/intern/include/initrender.h @@ -32,19 +32,21 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ -#ifndef INITRENDER_EXT_H -#define INITRENDER_EXT_H +#ifndef INITRENDER_H +#define INITRENDER_H -/* type includes */ - -#include "DNA_effect_types.h" /* for PartEff type */ -#include "render_types.h" +struct Object; /* Functions */ -void schrijfplaatje(char *name); -void render(void); /* Switch between the old and the unified renderer. */ -/* void write_screendump(char *name); not here !*/ +void free_sample_tables(Render *re); +void make_sample_tables(Render *re); + +void render_scene_set_window(Render *re, struct Object *camera, int blursample); + +void initparts(Render *re); +void freeparts(Render *re); + -#endif /* INITRENDER_EXT_H */ +#endif /* INITRENDER_H */ diff --git a/source/blender/render/intern/include/jitter.h b/source/blender/render/intern/include/jitter.h deleted file mode 100644 index 696ded297b1..00000000000 --- a/source/blender/render/intern/include/jitter.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * jitter.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef JITTER_H -#define JITTER_H - -#ifdef __cplusplus -extern "C" { -#endif - -extern float jit[64][2]; - -extern void initjit(float *jitarr, int num); -extern void init_render_jit(int nr); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/source/blender/render/intern/include/outerRenderLoop.h b/source/blender/render/intern/include/outerRenderLoop.h deleted file mode 100644 index 1c0faf666ae..00000000000 --- a/source/blender/render/intern/include/outerRenderLoop.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * outerRenderLoop.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef OUTERRENDERLOOP_H -#define OUTERRENDERLOOP_H - -/** - * Outer loop for rendering a single picture. - */ -void unifiedRenderingLoop(void); - -#endif - diff --git a/source/blender/render/intern/include/pixelblending.h b/source/blender/render/intern/include/pixelblending.h index b82642a34d0..bc44c916701 100644 --- a/source/blender/render/intern/include/pixelblending.h +++ b/source/blender/render/intern/include/pixelblending.h @@ -1,18 +1,12 @@ /* - * pixelblending_ext.h - * external interface for pixelblending - * * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,9 +20,7 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. + * Contributor(s): 2004-2006 Blender Foundation, full recode * * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ @@ -36,41 +28,12 @@ #ifndef PIXELBLENDING_EXT_H #define PIXELBLENDING_EXT_H -/* local includes */ -#include "vanillaRenderPipe_types.h" - -/** - * Halo-add pixel, bring your own R.osa setting, and add factor - */ -void addAddSampColF(float *s, float *d, int m, int osa, char add); - -/** - * Alpha undersamples pixel, bring your own R.osa setting - */ -int addUnderSampColF(float *sampcol, float *dest, int mask, int osaNr); - -/** - * Alpha oversample pixel, bring your own R.osa setting - */ -void addOverSampColF(float *sampcol, float *dest, int mask, int osaNr); /** * add 1 pixel to into filtered three lines * (float vecs to float vec) */ -void add_filt_fmask(unsigned int mask, float *col, float *rb1, float *rb2, float *rb3); - -/** - * Convert a series of oversampled pixels into filtered three lines - * (float vecs to float vec) - */ -void sampleFloatColV2FloatColVFilter(float *sample, float *dest1, float *dest2, float *dest3, int osaNr); - -/** - * Convert a series of oversampled pixels into a single pixel. Uses R.osa to - * count the length! (short vecs to short vec) - */ -void sampleShortColV2ShortColV(unsigned short *sample, unsigned short *dest, int osaNr); +void add_filt_fmask(unsigned int mask, float *col, float *rowbuf, int row_w); /** * Alpha-over blending for floats. @@ -82,50 +45,6 @@ void addAlphaOverFloat(float *dest, float *source); */ void addAlphaUnderFloat(float *dest, float *source); -/** - * Write a 16-bit-colour colour vector to a 8-bit-colour colour vector. - */ -void cpShortColV2CharColV(unsigned short *source, char *dest); - -/** - * Write a 8-bit-colour colour vector to a 16-bit-colour colour vector. - */ -void cpCharColV2ShortColV(char *source, unsigned short *dest); - -/** - * Write a 32-bit-colour colour vector to a 8-bit-colour colour vector. - */ -void cpIntColV2CharColV(unsigned int *source, char *dest); - -/** - * Write a floating-point-colour colour vector to a 8-bit-colour colour - * vector. Clip colours to [0, 1]. - */ -void cpFloatColV2CharColV(float *source, char *dest); - -/** - * Cpoy a 8-bit-colour vector to floating point colour vector. - */ -void cpCharColV2FloatColV(char *source, float *dest); -/** - * Cpoy a 16-bit-colour vector to floating point colour vector. - */ -void cpShortColV2FloatColV(unsigned short *source, float *dest); - -/** - * Copy a float-colour colour vector. - */ -void cpFloatColV(float *source, float *dest); - -/** - * Copy a 16-bit-colour colour vector. - */ -void cpShortColV(unsigned short *source, unsigned short *dest); - -/** - * Copy an 8-bit-colour colour vector. - */ -void cpCharColV(char *source, char *dest); /** * Same for floats @@ -137,26 +56,20 @@ void addalphaAddfacFloat(float *dest, float *source, char addfac); */ void addalphaAddFloat(float *dest, float *source); -/** ols functions: side effects? -void addalphaUnderFloat(char *doel, char *bron); think this already exists... -void addalphaUnderGammaFloat(char *doel, char *bron); -*/ /** * Blend bron under doel, while doing gamma correction */ void addalphaUnderGammaFloat(float *doel, float *bron); /** - * Transform an premul-alpha 32-bit colour into a key-alpha 32-bit colour. +* Copy the colour buffer output to R.rectot, to line y. + */ +void transferColourBufferToOutput(float *buf, int y); +/** +* using default transforms for brightness, gamma, hue, saturation etc. */ -void applyKeyAlphaCharCol(char* target); +void std_floatcol_to_charcol(float *buf, char *target); -/* Old blending functions */ -void keyalpha(char *doel); /* maakt premul 255 */ -void addalphaUnder(char *doel, char *bron); -void addalphaUnderGamma(char *doel, char *bron); -void addalphaOver(char *doel, char *bron); -void addalphaAdd(char *doel, char *bron); #endif /* PIXELBLENDING_EXT_H */ diff --git a/source/blender/render/intern/include/pixelshading.h b/source/blender/render/intern/include/pixelshading.h index a7a611ed117..67b0e5bcf3c 100644 --- a/source/blender/render/intern/include/pixelshading.h +++ b/source/blender/render/intern/include/pixelshading.h @@ -1,19 +1,12 @@ /* - * pixelshading.h - * - * These functions determine what actual colour a pixel will have. - * * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,19 +20,20 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. + * Contributor(s): 2004-2006, Blender Foundation, full recode * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ +/* pixelshading.h +* +* These functions determine what actual colour a pixel will have. +*/ + + #ifndef PIXELSHADING_H #define PIXELSHADING_H -#include "render.h" -#include "vanillaRenderPipe_types.h" - /** * Render the pixel at (x,y) for object ap. Apply the jitter mask. * Output is given in float collector[4]. The type vector: @@ -51,30 +45,18 @@ * mask is pixel coverage in bits * @return pointer to the object */ -void *renderPixel(RE_COLBUFTYPE *collector, float x, float y, int *t, int mask); - - -void setSkyBlendingMode(enum RE_SkyAlphaBlendingType mode); - void shadeHaloFloat(HaloRen *har, float *col, int zz, float dist, float xn, float yn, short flarec); -/** - * Get the sky blending mode. - */ -enum RE_SkyAlphaBlendingType getSkyBlendingMode(void); /** * Render the sky at pixel (x, y). */ -void renderSkyPixelFloat(RE_COLBUFTYPE *collector, float x, float y, float *rco); -void shadeSkyPixel(RE_COLBUFTYPE *collector, float fx, float fy, float *rco); +void renderSkyPixelFloat(float *collector, float x, float y, float *rco); +void shadeSkyPixel(float *collector, float fx, float fy, float *rco); void shadeSkyPixelFloat(float *colf, float *rco, float *view, float *dxyview); -void renderSpotHaloPixel(float x, float y, float *target); -void fillBackgroundImageChar(char *col, float x, float y); - /* ------------------------------------------------------------------------- */ #endif diff --git a/source/blender/render/intern/include/renderHelp.h b/source/blender/render/intern/include/renderHelp.h deleted file mode 100644 index 318b538d510..00000000000 --- a/source/blender/render/intern/include/renderHelp.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * renderhelp_ext.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef RENDERHELP_EXT_H -#define RENDERHELP_EXT_H - -#ifdef __cplusplus -extern "C" { -#endif - - /* Push-pop, because this sometimes is necessary... */ - void pushTempPanoPhi(float p); - void popTempPanoPhi(void); - - float getPanoPhi(void); - float getPanovCo(void); - float getPanovSi(void); - void setPanoRot(int part); - - /** Set clip flags on all data entries, using the given projection - * function */ - void setzbufvlaggen( void (*projectfunc)(float *, float *) ); - -/* external for the time being, since the converter calls it. */ -/** Recalculate all normals on renderdata. */ -/* void set_normalflags(void); */ - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/source/blender/render/intern/include/renderPreAndPost.h b/source/blender/render/intern/include/renderPreAndPost.h deleted file mode 100644 index 59315868010..00000000000 --- a/source/blender/render/intern/include/renderPreAndPost.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * renderpreandpost.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef RENDERPREANDPOST_H -#define RENDERPREANDPOST_H - -void prepareScene(void); -void finalizeScene(void); -void doClipping( void (*projectfunc)(float *, float *) ); - -#endif - diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h new file mode 100644 index 00000000000..c73deca6d22 --- /dev/null +++ b/source/blender/render/intern/include/render_types.h @@ -0,0 +1,347 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * Contributor(s): (c) 2006 Blender Foundation, full refactor + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef RENDER_TYPES_H +#define RENDER_TYPES_H + +/* ------------------------------------------------------------------------- */ +/* exposed internal in render module only! */ +/* ------------------------------------------------------------------------- */ + +#include "DNA_scene_types.h" +#include "DNA_world_types.h" +#include "DNA_object_types.h" +#include "DNA_vec_types.h" + +#include "RE_pipeline.h" +#include "RE_shader_ext.h" /* TexResult, ShadeResult, ShadeInput */ + +struct MemArena; +struct VertTableNode; +struct Octree; +struct GHash; + +#define TABLEINITSIZE 1024 +#define LAMPINITSIZE 256 + +typedef struct SampleTables +{ + float centLut[16]; + float *fmask1[9], *fmask2[9]; + char cmask[256], *centmask; + +} SampleTables; + +/* this is handed over to threaded hiding/passes/shading engine */ +typedef struct RenderPart +{ + struct RenderPart *next, *prev; + + /* result of part rendering */ + RenderResult *result; + + unsigned int *rectp; /* polygon index table */ + int *rectz; /* zbuffer */ + long *rectdaps; /* delta acum buffer for pixel structs */ + + rcti disprect; /* part coordinates within total picture */ + int rectx, recty; /* the size */ + short crop, ready; /* crop is amount of pixels we crop, for filter */ + short sample, nr; /* sample can be used by zbuffers, nr is partnr */ + short thread; /* thread id */ + +} RenderPart; + +typedef struct Octree { + struct Branch **adrbranch; + struct Node **adrnode; + float ocsize; /* ocsize: mult factor, max size octree */ + float ocfacx,ocfacy,ocfacz; + float min[3], max[3]; + int ocres; + int branchcount, nodecount; +} Octree; + + +/* controls state of render, everything that's read-only during render stage */ +struct Render +{ + struct Render *next, *prev; + char name[RE_MAXNAME]; + + /* state settings */ + short flag, osa, ok, do_gamma; + + /* result of rendering */ + RenderResult *result; + + /* window size, display rect, viewplane */ + int winx, winy; + rcti disprect; /* part within winx winy */ + rctf viewplane; /* mapped on winx winy */ + float viewdx, viewdy; /* size of 1 pixel */ + + /* final picture width and height (within disprect) */ + int rectx, recty; + + /* correction values for pixels or view */ + float ycor, viewfac; + float bluroffsx, bluroffsy; + float panosi, panoco; + + /* Matrices */ + float grvec[3]; /* for world */ + float imat[3][3]; /* copy of viewinv */ + float viewmat[4][4], viewinv[4][4]; + float winmat[4][4]; + + /* clippping */ + float clipsta; + float clipend; + + /* samples */ + SampleTables *samples; + float jit[32][2]; + + /* scene, and its full copy of renderdata and world */ + Scene *scene; + RenderData r; + World wrld; + + ListBase parts; + + /* octree tables and variables for raytrace */ + Octree oc; + + /* use this instead of R.r.cfra */ + float cfra; + + /* render database */ + int totvlak, totvert, tothalo, totlamp; + ListBase lights; + + int vertnodeslen; + struct VertTableNode *vertnodes; + int blohalen; + struct HaloRen **bloha; + int blovllen; + struct VlakRen **blovl; + + struct GHash *orco_hash; + + /* arena for allocating data for use during render, for + * example dynamic TFaces to go in the VlakRen structure. + */ + struct MemArena *memArena; + + /* callbacks */ + void (*display_init)(RenderResult *rr); + void (*display_clear)(RenderResult *rr); + void (*display_draw)(RenderResult *rr, rcti *rect); + + void (*stats_draw)(RenderStats *ri); + void (*timecursor)(int i); + + int (*test_break)(void); + int (*test_return)(void); + void (*error)(const char *str); + + RenderStats i; +}; + +/* ------------------------------------------------------------------------- */ + + +typedef struct ShadBuf { + short samp, shadhalostep; + float persmat[4][4]; + float viewmat[4][4]; + float winmat[4][4]; + float *jit; + float d,clipend,pixsize,soft; + int co[3]; + int size,bias; + long *zbuf; + char *cbuf; +} ShadBuf; + +/* ------------------------------------------------------------------------- */ + +typedef struct VertRen +{ + float co[3]; + float n[3]; + float ho[4]; + float *orco; + short clip; + unsigned short flag; /* in use for clipping zbuffer parts, temp setting stuff in convertblender.c */ + float accum; /* accum for radio weighting, and for strand texco static particles */ + int index; /* index allows extending vertren with any property */ +} VertRen; + +/* ------------------------------------------------------------------------- */ + +struct halosort { + struct HaloRen *har; + int z; +}; + +/* ------------------------------------------------------------------------- */ +struct Material; +struct TFace; + +typedef struct RadFace { + float unshot[3], totrad[3]; + float norm[3], cent[3], area; + int flag; +} RadFace; + +typedef struct VlakRen +{ + struct VertRen *v1, *v2, *v3, *v4; + unsigned int lay; + float n[3]; + struct Material *mat; + struct TFace *tface; + unsigned int *vcol; + char snproj, puno; + char flag, ec; + RadFace *radface; + Object *ob; +} VlakRen; + +typedef struct HaloRen +{ + short miny, maxy; + float alfa, xs, ys, rad, radsq, sin, cos, co[3], no[3]; + float hard, b, g, r; + int zs, zd; + int zBufDist; /* depth in the z-buffer coordinate system */ + char starpoints, type, add, tex; + char linec, ringc, seed; + short flarec; /* used to be a char. why ?*/ + float hasize; + int pixels; + unsigned int lay; + struct Material *mat; +} HaloRen; + +struct LampRen; +struct MTex; + +/** + * For each lamp in a scene, a LampRen is created. It determines the + * properties of a lightsource. + */ +typedef struct LampRen +{ + float xs, ys, dist; + float co[3]; + short type, mode; + float r, g, b, k; + float energy, haint; + int lay; + float spotsi,spotbl; + float vec[3]; + float xsp, ysp, distkw, inpr; + float halokw, halo; + float ld1,ld2; + + /* copied from Lamp, to decouple more rendering stuff */ + /** Size of the shadowbuffer */ + short bufsize; + /** Number of samples for the shadows */ + short samp; + /** Softness factor for shadow */ + float soft; + /** shadow plus halo: detail level */ + short shadhalostep; + /** Near clip of the lamp */ + float clipsta; + /** Far clip of the lamp */ + float clipend; + /** A small depth offset to prevent self-shadowing. */ + float bias; + + short ray_samp, ray_sampy, ray_sampz, ray_samp_type, area_shape, ray_totsamp; + short xold1, yold1, xold2, yold2; /* last jitter table for area lights */ + float area_size, area_sizey, area_sizez; + + struct ShadBuf *shb; + float *jitter; + + float imat[3][3]; + float spottexfac; + float sh_invcampos[3], sh_zfac; /* sh_= spothalo */ + + float mat[3][3]; /* 3x3 part from lampmat x viewmat */ + float area[8][3], areasize; + + /* yafray: photonlight params */ + int YF_numphotons, YF_numsearch; + short YF_phdepth, YF_useqmc, YF_bufsize; + float YF_causticblur, YF_ltradius; + float YF_glowint, YF_glowofs; + short YF_glowtype; + + /* ray optim */ + VlakRen *vlr_last; + + struct MTex *mtex[MAX_MTEX]; +} LampRen; + +/* **************** defines ********************* */ + +/* mode flag is same as for renderdata */ +/* flag */ +#define R_ZTRA 1 +#define R_HALO 2 +#define R_SEC_FIELD 4 +#define R_LAMPHALO 8 +#define R_RENDERING 16 +#define R_ANIMRENDER 32 +#define R_REDRAW_PRV 64 + +/* vlakren->flag (vlak = face in dutch) char!!! */ +#define R_SMOOTH 1 +#define R_VISIBLE 2 +/* strand flag, means special handling */ +#define R_STRAND 4 +#define R_NOPUNOFLIP 8 +#define R_FULL_OSA 16 +#define R_FACE_SPLIT 32 +/* Tells render to divide face other way. */ +#define R_DIVIDE_24 64 +/* vertex normals are tangent or view-corrected vector, for hair strands */ +#define R_TANGENT 128 + + + + + +#endif /* RENDER_TYPES_H */ + diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h index 8f236c502f4..cfdf34c205b 100644 --- a/source/blender/render/intern/include/rendercore.h +++ b/source/blender/render/intern/include/rendercore.h @@ -46,6 +46,8 @@ struct HaloRen; struct ShadeInput; +/* ------------------------------------------------------------------------- */ + typedef struct PixStr { struct PixStr *next; @@ -53,14 +55,15 @@ typedef struct PixStr unsigned short mask, amount; } PixStr; -/* ------------------------------------------------------------------------- */ - typedef struct PixStrMain { + struct PixStrMain *next, *prev; struct PixStr *ps; - struct PixStrMain *next; + int counter; } PixStrMain; +/* ------------------------------------------------------------------------- */ + void calc_view_vector(float *view, float x, float y); float mistfactor(float zcor, float *co); /* dist and height, return alpha */ @@ -74,34 +77,30 @@ void shade_lamp_loop(struct ShadeInput *shi, ShadeResult *shr); float fresnel_fac(float *view, float *vn, float fresnel, float fac); void calc_R_ref(struct ShadeInput *shi); -float spec(float inp, int hard); -/* -------- ray.c ------- */ +/* for nodes */ +void shade_material_loop(struct ShadeInput *shi, struct ShadeResult *shr); -extern void ray_shadow(ShadeInput *, LampRen *, float *); -extern void ray_trace(ShadeInput *, ShadeResult *); -extern void ray_ao(ShadeInput *, World *, float *); - -/** - * Do z buffer and shade - */ void zbufshade(void); - -/** - * zbuffer and shade, anti aliased - */ void zbufshadeDA(void); /* Delta Accum Pixel Struct */ -/** - * Also called in: zbuf.c - */ -void *shadepixel(float x, float y, int z, int facenr, int mask, float *col, float *rco); +void *shadepixel(RenderPart *pa, float x, float y, int z, int facenr, int mask, float *col, float *rco); -/** - * A cryptic but very efficient way of counting the number of bits that - * is set in the unsigned short. - */ int count_mask(unsigned short mask); +void zbufshade_tile(struct RenderPart *pa); +void zbufshadeDA_tile(struct RenderPart *pa); + +/* -------- ray.c ------- */ + +extern void freeoctree(Render *re); +extern void makeoctree(Render *re); + +extern void ray_shadow(ShadeInput *, LampRen *, float *); +extern void ray_trace(ShadeInput *, ShadeResult *); +extern void ray_ao(ShadeInput *, float *); +extern void init_jitter_plane(LampRen *lar); +extern void init_ao_sphere(float *sphere, int tot, int iter); + #endif /* RENDER_EXT_H */ diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h new file mode 100644 index 00000000000..6996bca7a5c --- /dev/null +++ b/source/blender/render/intern/include/renderdatabase.h @@ -0,0 +1,69 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef RENDERDATABASE_H +#define RENDERDATABASE_H + +struct VlakRen; +struct VertRen; +struct HaloRen; +struct Material; +struct Render; + +/* renderdatabase.c */ +void free_renderdata_tables(struct Render *re); +void set_normalflags(Render *re); +void project_renderdata(struct Render *re, void (*projectfunc)(float *, float mat[][4], float *), int do_pano, int part); + +/* functions are not exported... so wrong names */ + +struct VlakRen *RE_findOrAddVlak(struct Render *re, int nr); +struct VertRen *RE_findOrAddVert(struct Render *re, int nr); +struct HaloRen *RE_findOrAddHalo(struct Render *re, int nr); +struct HaloRen *RE_inithalo(struct Render *re, struct Material *ma, float *vec, float *vec1, float *orco, float hasize, + float vectsize, int seed); + +float *RE_vertren_get_sticky(struct Render *re, struct VertRen *ver, int verify); +float *RE_vertren_get_stress(struct Render *re, struct VertRen *ver, int verify); +float *RE_vertren_get_rad(struct Render *re, struct VertRen *ver, int verify); +float *RE_vertren_get_strand(struct Render *re, struct VertRen *ver, int verify); +float *RE_vertren_get_tangent(struct Render *re, struct VertRen *ver, int verify); + +/* haloren->type: flags */ +#define HA_ONLYSKY 1 +#define HA_VECT 2 +#define HA_XALPHA 4 +#define HA_FLARECIRC 8 + + +void init_render_world(Render *re); + + +#endif /* RENDERDATABASE_H */ + diff --git a/source/blender/render/intern/include/renderpipeline.h b/source/blender/render/intern/include/renderpipeline.h new file mode 100644 index 00000000000..5ccb2f318dc --- /dev/null +++ b/source/blender/render/intern/include/renderpipeline.h @@ -0,0 +1,41 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef PIPELINE_H +#define PIPELINE_H + +struct Render; + +void *RE_mallocN(int len, char *name); +void *RE_callocN(int len, char *name); +void RE_freeN(void *poin); + + +#endif /* PIPELINE_H */ + diff --git a/source/blender/render/intern/include/shadbuf.h b/source/blender/render/intern/include/shadbuf.h index 279d5319b21..16127537975 100644 --- a/source/blender/render/intern/include/shadbuf.h +++ b/source/blender/render/intern/include/shadbuf.h @@ -41,7 +41,7 @@ * Calculates shadowbuffers for a vector of shadow-giving lamps * @param lar The vector of lamps */ -void makeshadowbuf(LampRen *lar); +void makeshadowbuf(struct Render *re, LampRen *lar); /** * Determines the shadow factor for a face and lamp. There is some diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index 4b7ac102d80..9eb4f16a60d 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -56,6 +56,11 @@ struct Image; void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf); void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend); +void do_material_tex(struct ShadeInput *shi); +void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf); + +void init_render_textures(void); + void render_realtime_texture(struct ShadeInput *shi); /* imagetexture.h */ diff --git a/source/blender/render/intern/include/vanillaRenderPipe.h b/source/blender/render/intern/include/vanillaRenderPipe.h deleted file mode 100644 index f242b8522fc..00000000000 --- a/source/blender/render/intern/include/vanillaRenderPipe.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * vanillaRenderPipe_ext.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef VANILLARENDERPIPE_EXT_H -#define VANILLARENDERPIPE_EXT_H - -#include "vanillaRenderPipe_types.h" - -/** - * Render pipeline with all kinds of extras. - * status-------------------------\/ - * - integrated z buffering ok - * - integrated halo rendering ok - */ -void zBufShadeAdvanced(void); - -/** - * Copy the colour buffer output to R.rectot, to line y. - */ -void transferColourBufferToOutput(float *buf, int y); -/** - * using default transforms for brightness, gamma, hue, saturation etc. - */ -void std_floatcol_to_charcol(float *buf, char *target); - - -#endif /* VANILLARENDERPIPE_EXT_H */ - diff --git a/source/blender/render/intern/include/vanillaRenderPipe_types.h b/source/blender/render/intern/include/vanillaRenderPipe_types.h deleted file mode 100644 index df24ed01f5e..00000000000 --- a/source/blender/render/intern/include/vanillaRenderPipe_types.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * vanillaRenderPipe_types.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef VANILLARENDERPIPE_TYPES_H -#define VANILLARENDERPIPE_TYPES_H - -/* Render defines */ -#define RE_MAX_OSA_COUNT 16 /* The max. number of possible oversamples */ -#define RE_MAX_FACES_PER_PIXEL 1000 /* max. nr of faces rendered behind one */ - /* pixel */ - -enum RE_SkyAlphaBlendingType { - RE_ALPHA_NODEF = 0, - RE_ALPHA_PREMUL, - RE_ALPHA_KEY, - RE_ALPHA_SKY, - RE_ALPHA_MAX -}; - - -/* Render typedefs */ -typedef float RE_COLBUFTYPE; /* datatype for the colour buffer */ - - -/** - * Threshold for add-blending for faces - */ -#define RE_FACE_ADD_THRESHOLD 0.001 - -/** - For oversampling - - New stack: the old stack limits our freedom to do all kinds of - manipulation, so we rewrite it. - - A stacked face needs: - - a face type - - a colour - - a conflict count - - a data pointer (void*) - - a mask - - The stack starts at index 0, with the closest face, and stacks up. - -*/ - -struct RE_faceField { - int faceType; - float colour[4]; - int conflictCount; - void *data; - int mask; -}; - -#endif /* VANILLARENDERPIPE_TYPES_H */ - diff --git a/source/blender/render/intern/include/zblur.h b/source/blender/render/intern/include/zblur.h deleted file mode 100644 index a0e1c6a39ce..00000000000 --- a/source/blender/render/intern/include/zblur.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef ZBLUR_H -#define ZBLUR_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*-----------------------------------------------------------*/ -/* Includes */ -/*-----------------------------------------------------------*/ - -/*-----------------------------------------------------------*/ -/* Function */ -/*-----------------------------------------------------------*/ - -void add_zblur(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h index 394e38be47e..7a6c78d5728 100644 --- a/source/blender/render/intern/include/zbuf.h +++ b/source/blender/render/intern/include/zbuf.h @@ -1,18 +1,12 @@ /* - * zbuf_ext.h - * external interface for zbuf.h - * * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,7 +20,7 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. + * Full recode: 2004-2006 Blender Foundation * * Contributor(s): none yet. * @@ -36,158 +30,66 @@ #ifndef ZBUF_H #define ZBUF_H -#ifdef __cplusplus -extern "C" { -#endif - +struct RenderPart; struct LampRen; struct VlakRen; +struct ListBase; -/*-----------------------------------------------------------*/ -/* Includes */ -/*-----------------------------------------------------------*/ - -#include "zbuf_types.h" -#include "render_types.h" -#include "radio_types.h" /* for RadView */ - -/*-----------------------------------------------------------*/ -/* Function */ -/* (11 so far ) */ -/*-----------------------------------------------------------*/ - -/** - * Fill a 'rectangle' with a fixed value. The rectangle contains x by - * y points. The rows are assumed to be contiguous in memory, and to - * consist of uints. This function is used for initializing the z - * buffer. - * (why is x int and y uint? called in envmap, render, zbuf) - * @param rect Pointer to the data representing the rectangle. - * @param x The width of the rectangle - * @param y The height of the rectangle - * @param val The value used to fill the rectangle. - */ void fillrect(int *rect, int x, int y, int val); /** * Converts a world coordinate into a homogenous coordinate in view - * coordinates. The transformation matrix is only allowed to have a - * scaling and translation component. - * Also called in: shadbuf.c render.c radfactors.c - * initrender.c envmap.c editmesh.c - * @param v1 [3 floats] the world coordinate - * @param adr [4 floats] the homogenous view coordinate - */ -void projectvert(float *v1,float *adr); - - -/** - * Do a z buffer calculation pass for shadow calculations. - * Also called in: shadbuf.c - * Note: Uses globals. - * @param lar lamp definition data - */ -void zbuffershad(struct LampRen *lar); - - /* to the external interface, temp, I hope... */ -/** - * Tests whether the first three coordinates should be clipped - * wrt. the fourth component. Bits 1 and 2 test on x, 3 and 4 test on - * y, 5 and 6 test on z: - * xyz > test => set first bit (01), - * xyz < -test => set second bit (10), - * xyz == test => reset both bits (00). - * Note: functionality is duplicated from an internal function - * Also called in: initrender.c, radfactors.c - * @param v [4 floats] a coordinate - * @return a vector of bitfields - */ -/* int testclip(float *v); */ - - -/* The following are only used in zbuf.c and render.c ---------------*/ -/** - * Fills the entire in the alpha DA buffer. (All of it!) - * Note: Uses globals. - * Also called in: render.c - * @param y the line number to set - */ -void abufsetrow(float *acolrow, int y); - - -/** - * Calculate the z buffer for all faces (or edges when in wireframe - * mode) presently visible. - * Note: Uses globals. - * Also called in: render.c + * coordinates. */ -void zbufferall(void); - - -/** - * Initialize accumulation buffers for alpha z buffering. - * The buffers are global variables. Also resets Accu buffer - * y bounds. - *
  • - * Acolrow : colour buffer for one line - * Arectz : distance buffer for one line, depth ABUFPART - * APixbuf : pixel data buffer for one line, depth ABUFPART - *
  • - * Also called in: render.c (should migrate) - * Note: Uses globals. - */ -void bgnaccumbuf(void); - -/** - * Discard accumulation buffers for alpha z buffering. - * The buffers are global variables. The released buffers are Acolrow, - * Arectz, APixBuf. - * Also called in: render.c (should migrate) - * Note: Uses globals. - */ -void endaccumbuf(void); - -/** - * Z face intersect? - */ -int vergzvlak(const void *x1, const void *x2); - -/** - * Clip and fill vertex into the z buffer. zbuffunc needs to be set - * before entering, to assure that there is a buffer fill function - * that can be called. Zvlnr must be set to the current valid face - * index . - * Note: uses globals - * @param f1 [4 floats] vertex 1 - * @param f2 [4 floats] vertex 2 - * @param f3 [4 floats] vertex 3 - * @param c1 clip conditions? - * @param c2 - * @param c3 - */ - -/* span fill in method */ +void projectvert(float *v1, float winmat[][4], float *adr); +void projectverto(float *v1, float winmat[][4], float *adr); +int testclip(float *v); + +void set_part_zbuf_clipflag(struct RenderPart *pa); +void zbuffer_shadow(struct Render *re, struct LampRen *lar, int *rectz, int size); +void zbuffer_solid(struct RenderPart *pa); +void zbuffer_transp_shade(struct RenderPart *pa, float *pass); + +typedef struct APixstr { + unsigned short mask[4]; /* jitter mask */ + int z[4]; /* distance */ + int p[4]; /* index */ + struct APixstr *next; +} APixstr; + +typedef struct APixstrMain +{ + struct APixstrMain *next, *prev; + struct APixstr *ps; +} APixstrMain; + +/* span fill in method, is also used to localize data for zbuffering */ typedef struct ZSpan { - int yres, miny, maxy; /* range for clipping */ + int rectx, recty; /* range for clipping */ + int miny1, maxy1, miny2, maxy2; /* actual filled in range */ float *minp1, *maxp1, *minp2, *maxp2; /* vertex pointers detect min/max range in */ float *span1, *span2; + + float zmulx, zmuly, zofsx, zofsy; /* transform from hoco to zbuf co */ + + int *rectz, *arectz; /* zbuffers, arectz is for transparant */ + int *rectp; /* polygon index buffer */ + APixstr *apixbuf, *curpstr; /* apixbuf for transparent */ + struct ListBase *apsmbase; + + int polygon_offset; /* offset in Z */ + int mask, apsmcounter; /* in use by apixbuf */ + + void (*zbuffunc)(struct ZSpan *, int, float *, float *, float *, float *); + void (*zbuflinefunc)(struct ZSpan *, int, float *, float *); + } ZSpan; -void zbufclip(struct ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3); - -/* These function pointers are used for z buffer filling. */ -extern void (*zbuffunc)(struct ZSpan *zspan, int, float *, float *, float *); -extern void (*zbuflinefunc)(int, float *, float *); - -/** - * same, for edges - */ -void zbufclipwire(int zvlnr, struct VlakRen *vlr); - -#ifdef __cplusplus -} -#endif +/* exported for evil edge render... */ +void zbufclip(struct ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3); +void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty); +void zbufclipwire(ZSpan *zspan, int zvlnr, struct VlakRen *vlr); #endif diff --git a/source/blender/render/intern/include/zbuf_types.h b/source/blender/render/intern/include/zbuf_types.h deleted file mode 100644 index b5ad9c75902..00000000000 --- a/source/blender/render/intern/include/zbuf_types.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * zbuf_types.h - * type definitions used (and maybe exported) by zbuf.c. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef ZBUF_TYPES_H -#define ZBUF_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define ABUFPART 64 - -/** - * Primitive data structure for zbuffering. One struct - * stores data for 4 entries. - */ -typedef struct APixstr { - unsigned short mask[4]; /* jitter mask */ - int z[4]; /* distance */ - int p[4]; /* index */ - struct APixstr *next; -} APixstr; - - -typedef struct APixstrMain -{ - struct APixstr *ps; - struct APixstrMain *next; -} APixstrMain; - - -typedef struct { - float *vert; - float hoco[4]; - int clip; -} VertBucket; - -#ifdef __cplusplus -} -#endif - -#endif /* ZBUF_TYPES_H */ - diff --git a/source/blender/render/intern/include/zbufferdatastruct.h b/source/blender/render/intern/include/zbufferdatastruct.h deleted file mode 100644 index 2cef53dc9f6..00000000000 --- a/source/blender/render/intern/include/zbufferdatastruct.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * zbufferdatastruct_ext.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef ZBUFFERDATASTRUCT_EXT_H -#define ZBUFFERDATASTRUCT_EXT_H - -#include "zbufferdatastruct_types.h" - -/** - * Set memory and counters for a fresh z buffer - */ -void initZbuffer(int linewidth); - -/** - * Release memory for the current z buffer - */ -void freeZbuffer(void); - -/** - * Release previous buffer and initialise new buffer. - */ -void resetZbuffer(void); - -/** - * Make a root for a memory block (internal) - */ -RE_APixstrExt *addpsemainA(void); - -/** - * Release a memory chunk - */ -void freepseA(void); - -/** - * Add a structure - */ -RE_APixstrExt *addpseA(void); - -/** - * Add an object to a zbuffer entry. - */ -void insertObject(int teller, - int obindex, - int obtype, - int dist, - int mask); - -/** - * Add a flat object to a zbuffer entry. - */ -void insertFlatObject(RE_APixstrExt* ap, - int obindex, - int obtype, - int dist, - int mask); - -/** - * Add a flat object to a zbuffer entry, but don't do OSA entry testing. - */ -void insertFlatObjectNoOsa(RE_APixstrExt* ap, - int obindex, - int obtype, - int dist, - int mask); - -#endif - diff --git a/source/blender/render/intern/include/zbufferdatastruct_types.h b/source/blender/render/intern/include/zbufferdatastruct_types.h deleted file mode 100644 index 5048adfa8bc..00000000000 --- a/source/blender/render/intern/include/zbufferdatastruct_types.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * zbufferdatastruct_types.h - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifndef ZBUFFERDATASTRUCT_TYPES_H -#define ZBUFFERDATASTRUCT_TYPES_H - -#define RE_ZBUFLEN 64 /* number of lines in the accumulation buffer */ - -/** - * Primitive data structure for zbuffering. One struct - * stores data for 4 entries. This struct has been extended - * for the render pipeline overhaul. - */ -typedef struct RE_APixstrExt { - unsigned short mask[4]; /* jitter masks */ - int zmin[4]; /* min. distance of all samples */ - int zmax[4]; /* max. distance of all samples */ - int p[4]; /* index */ - int t[4]; /* entry type: ZB_POLY or ZB_HALO */ - struct RE_APixstrExt *next; -} RE_APixstrExt; - -/* For now I'll stick to the Blender convention of hand made defines */ -/* but this should definitely be done in a better way. An enum may */ -/* be some help, but masking is still a nice feature... */ -/* object types to buffer in the z buffer */ -/* RE_SOLID is flag for RE_POLY, as speedup */ -#define RE_NONE 0 -#define RE_POLY 1 -#define RE_HALO 2 -#define RE_SKY 4 -#define RE_SOLID 8 - -/* unique indices for each field */ -#define RE_ZMIN 0 -#define RE_INDEX 1 -#define RE_MASK 2 -#define RE_TYPE 3 -#define RE_ZMAX 4 -#define RE_PIXELFIELDSIZE 5 - -typedef struct RE_APixstrExtMain -{ - struct RE_APixstrExt *ps; - struct RE_APixstrExtMain *next; -} RE_APixstrExtMain; - -#endif - diff --git a/source/blender/render/intern/source/RE_callbacks.c b/source/blender/render/intern/source/RE_callbacks.c deleted file mode 100644 index acc115b2b87..00000000000 --- a/source/blender/render/intern/source/RE_callbacks.c +++ /dev/null @@ -1,168 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Callbacks to make the renderer interact with calling modules. - */ - -#include /* for NULL??? */ -#include -#include "render.h" -#include "RE_callbacks.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* - * The callbacks are done in three parts: - * - * - a local static pointer to the eventual function. NULL if not - * defined, or if the behaviour is not required. - * - * - a hook that can be called locally - * - * - a hook that can be called externally, to set an external function - * to provide said functionality. - * - * These might be generated from a spec such as: - * - * callback { - * local = - * external = - * type = (,...) - * } - * - * Should generate: - * - a static var - * - an internal loop, plus decl. - * - an external setter, plus decl. - * - */ - -/* Part 1: ------------------------------------------------------------- */ - -static int (*RE_local_test_break_function)(void) = NULL; - -static void (*RE_local_timecursor_function)(int) = NULL; - -static void (*RE_local_renderdisplay_function)(int i, - int j, - int k, - int l, - unsigned int *m) - = NULL; - -static void (*RE_local_initrenderdisplay_function)(void) = NULL; -static void (*RE_local_clearrenderdisplay_function)(short) = NULL; - -static void (*RE_local_printrenderinfo_function)(double,int) = NULL; - -static void (*RE_local_getrenderdata_function)(void) = NULL; -static void (*RE_local_freerenderdata_function)(void) = NULL; - -/* Part 2: ------------------------------------------------------------- */ - -int RE_local_test_break(void) { - if (RE_local_test_break_function) { - return RE_local_test_break_function(); - } else { - /* transparant behaviour: proceed */ - return 0; - } -} - -void RE_local_timecursor(int i) { - if (RE_local_timecursor_function) RE_local_timecursor_function(i); -} - -void RE_local_render_display(int i, int j, int k, int l, unsigned int* m) { - if (RE_local_renderdisplay_function) RE_local_renderdisplay_function(i, j, k, l, m); - else { - if(j-i >= l-1) printf("\n");// full picture - else printf("\rRender %d%% ", (100*i)/l); - fflush(stdout); - } -} -void RE_local_init_render_display(void) { - if (RE_local_initrenderdisplay_function) RE_local_initrenderdisplay_function(); -} -void RE_local_clear_render_display(short i) { - if (RE_local_clearrenderdisplay_function) RE_local_clearrenderdisplay_function(i); -} - -void RE_local_printrenderinfo(double time, int i) { - if (RE_local_printrenderinfo_function) RE_local_printrenderinfo_function(time, i); -} - -void RE_local_get_renderdata(void) { - if (RE_local_getrenderdata_function) RE_local_getrenderdata_function(); -} -void RE_local_free_renderdata(void) { - if (RE_local_freerenderdata_function) RE_local_freerenderdata_function(); -} - -/* Part 3: ------------------------------------------------------------- */ - -void RE_set_test_break_callback(int (*f)(void)) { - RE_local_test_break_function = f; -} - -void RE_set_timecursor_callback(void (*f)(int)) { - RE_local_timecursor_function = f; -} - -void RE_set_renderdisplay_callback(void (*f)(int i, - int j, - int k, - int l, - unsigned int *)) -{ - RE_local_renderdisplay_function = f; -} - -void RE_set_initrenderdisplay_callback(void (*f)(void)) { - RE_local_initrenderdisplay_function = f; -} - -void RE_set_clearrenderdisplay_callback(void (*f)(short)) { - RE_local_clearrenderdisplay_function = f; -} - -void RE_set_printrenderinfo_callback(void (*f)(double,int)) { - RE_local_printrenderinfo_function = f; -} - -void RE_set_getrenderdata_callback(void (*f)(void)) { - RE_local_getrenderdata_function = f; -} - -void RE_set_freerenderdata_callback(void (*f)(void)) { - RE_local_freerenderdata_function = f; -} diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c new file mode 100644 index 00000000000..76f4b11fe7b --- /dev/null +++ b/source/blender/render/intern/source/convertblender.c @@ -0,0 +1,3108 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * Contributors: 2004/2005/2006 Blender Foundation, full recode + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include +#include + +#include "blendef.h" +#include "MTC_matrixops.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" +#include "BLI_rand.h" +#include "BLI_memarena.h" +#include "BLI_ghash.h" + +#include "DNA_armature_types.h" +#include "DNA_camera_types.h" +#include "DNA_material_types.h" +#include "DNA_curve_types.h" +#include "DNA_effect_types.h" +#include "DNA_group_types.h" +#include "DNA_lamp_types.h" +#include "DNA_lattice_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_meta_types.h" +#include "DNA_object_types.h" +#include "DNA_object_force.h" +#include "DNA_scene_types.h" +#include "DNA_texture_types.h" +#include "DNA_view3d_types.h" + +#include "BKE_anim.h" +#include "BKE_armature.h" +#include "BKE_action.h" +#include "BKE_curve.h" +#include "BKE_constraint.h" +#include "BKE_displist.h" +#include "BKE_deform.h" +#include "BKE_DerivedMesh.h" +#include "BKE_effect.h" +#include "BKE_global.h" +#include "BKE_group.h" +#include "BKE_key.h" +#include "BKE_ipo.h" +#include "BKE_lattice.h" +#include "BKE_material.h" +#include "BKE_main.h" +#include "BKE_mball.h" +#include "BKE_mesh.h" +#include "BKE_node.h" +#include "BKE_object.h" +#include "BKE_scene.h" +#include "BKE_subsurf.h" +#include "BKE_texture.h" +#include "BKE_utildefines.h" +#include "BKE_world.h" + +#include "envmap.h" +#include "render_types.h" +#include "rendercore.h" +#include "renderdatabase.h" +#include "renderpipeline.h" +#include "radio.h" +#include "shadbuf.h" +#include "texture.h" +#include "zbuf.h" + +#include "YafRay_Api.h" + +/* yafray: Identity transform 'hack' removed, exporter now transforms vertices back to world. + * Same is true for lamp coords & vec. + * Duplicated data objects & dupliframe/duplivert objects are only stored once, + * only the matrix is stored for all others, in yafray these objects are instances of the original. + * The main changes are in RE_rotateBlenderScene(). + */ + +/* ------------------------------------------------------------------------- */ +/* Local functions */ +/* ------------------------------------------------------------------------- */ +static short test_for_displace(Render *re, Object *ob); +static void do_displacement(Render *re, Object *ob, int startface, int numface, int startvert, int numvert ); + +/* ------------------------------------------------------------------------- */ +/* tool functions/defines for ad hoc simplification and possible future + cleanup */ +/* ------------------------------------------------------------------------- */ + +#define UVTOINDEX(u,v) (startvlak + (u) * sizev + (v)) +/* + +NOTE THAT U/V COORDINATES ARE SOMETIMES SWAPPED !! + +^ ()----p4----p3----() +| | | | | +u | | F1 | F2 | + | | | | + ()----p1----p2----() + v -> +*/ + +/* ------------------------------------------------------------------------- */ + +static VertRen *duplicate_vertren(Render *re, VertRen *ver) +{ + VertRen *v1= RE_findOrAddVert(re, re->totvert++); + int index= v1->index; + *v1= *ver; + v1->index= index; + return v1; +} + +static void split_v_renderfaces(Render *re, int startvlak, int startvert, int usize, int vsize, int uIndex, int cyclu, int cyclv) +{ + int vLen = vsize-1+(!!cyclv); + int v; + + for (v=0; vv2); + + if (cyclv) { + vlr->v2 = vert; + + if (v==vLen-1) { + VlakRen *vlr = RE_findOrAddVlak(re, startvlak + vLen*uIndex + 0); + vlr->v1 = vert; + } else { + VlakRen *vlr = RE_findOrAddVlak(re, startvlak + vLen*uIndex + v+1); + vlr->v1 = vert; + } + } else { + vlr->v2 = vert; + + if (vv1 = vert; + } + + if (v==0) { + vlr->v1 = duplicate_vertren(re, vlr->v1); + } + } + } +} + +/* ------------------------------------------------------------------------- */ + +static int contrpuntnormr(float *n, float *puno) +{ + float inp; + + inp=n[0]*puno[0]+n[1]*puno[1]+n[2]*puno[2]; + if(inp<0.0) return 1; + return 0; +} + +/* ------------------------------------------------------------------------- */ + +static void calc_edge_stress_add(float *accum, VertRen *v1, VertRen *v2) +{ + float len= VecLenf(v1->co, v2->co)/VecLenf(v1->orco, v2->orco); + float *acc; + + acc= accum + 2*v1->index; + acc[0]+= len; + acc[1]+= 1.0f; + + acc= accum + 2*v2->index; + acc[0]+= len; + acc[1]+= 1.0f; +} + +static void calc_edge_stress(Render *re, Mesh *me, int startvert, int startvlak) +{ + float loc[3], size[3], *accum, *acc, *accumoffs, *stress; + int a; + + if(startvert==re->totvert) return; + + mesh_get_texspace(me, loc, NULL, size); + + accum= MEM_callocN(2*sizeof(float)*(re->totvert-startvert), "temp accum for stress"); + + /* de-normalize orco */ + for(a=startvert; atotvert; a++, acc+=2) { + VertRen *ver= RE_findOrAddVert(re, a); + if(ver->orco) { + ver->orco[0]= ver->orco[0]*size[0] +loc[0]; + ver->orco[1]= ver->orco[1]*size[1] +loc[1]; + ver->orco[2]= ver->orco[2]*size[2] +loc[2]; + } + } + + /* add stress values */ + accumoffs= accum - 2*startvert; /* so we can use vertex index */ + for(a=startvlak; atotvlak; a++) { + VlakRen *vlr= RE_findOrAddVlak(re, a); + + if(vlr->v1->orco && vlr->v4) { + calc_edge_stress_add(accumoffs, vlr->v1, vlr->v2); + calc_edge_stress_add(accumoffs, vlr->v2, vlr->v3); + calc_edge_stress_add(accumoffs, vlr->v3, vlr->v1); + if(vlr->v4) { + calc_edge_stress_add(accumoffs, vlr->v3, vlr->v4); + calc_edge_stress_add(accumoffs, vlr->v4, vlr->v1); + calc_edge_stress_add(accumoffs, vlr->v2, vlr->v4); + } + } + } + + for(a=startvert; atotvert; a++) { + VertRen *ver= RE_findOrAddVert(re, a); + if(ver->orco) { + /* find stress value */ + acc= accumoffs + 2*ver->index; + if(acc[1]!=0.0f) + acc[0]/= acc[1]; + stress= RE_vertren_get_stress(re, ver, 1); + *stress= *acc; + + /* restore orcos */ + ver->orco[0] = (ver->orco[0]-loc[0])/size[0]; + ver->orco[1] = (ver->orco[1]-loc[1])/size[1]; + ver->orco[2] = (ver->orco[2]-loc[2])/size[2]; + } + } + + MEM_freeN(accum); +} + +static void calc_tangent_vector(Render *re, VlakRen *vlr, float fac1, float fac2, float fac3, float fac4) +{ + TFace *tface= vlr->tface; + + if(tface) { + VertRen *v1=vlr->v1, *v2=vlr->v2, *v3=vlr->v3, *v4=vlr->v4; + float *uv1= tface->uv[0], *uv2= tface->uv[1], *uv3= tface->uv[2], *uv4= tface->uv[3]; + float tang[3], *tav; + float s1, s2, t1, t2, det; + + /* we calculate quads as two triangles, so weight for diagonal gets halved */ + if(v4) { + fac1*= 0.5f; + fac3*= 0.5f; + } + + /* first tria, we use the V now */ + s1= uv2[0] - uv1[0]; + s2= uv3[0] - uv1[0]; + t1= uv2[1] - uv1[1]; + t2= uv3[1] - uv1[1]; + det= 1.0f / (s1 * t2 - s2 * t1); + + /* normals in render are inversed... */ + tang[0]= (t2 * (v1->co[0]-v2->co[0]) - t1 * (v1->co[0]-v3->co[0])); + tang[1]= (t2 * (v1->co[1]-v2->co[1]) - t1 * (v1->co[1]-v3->co[1])); + tang[2]= (t2 * (v1->co[2]-v2->co[2]) - t1 * (v1->co[2]-v3->co[2])); + + tav= RE_vertren_get_tangent(re, v1, 1); + VECADDFAC(tav, tav, tang, fac1); + tav= RE_vertren_get_tangent(re, v2, 1); + VECADDFAC(tav, tav, tang, fac2); + tav= RE_vertren_get_tangent(re, v3, 1); + VECADDFAC(tav, tav, tang, fac3); + + if(v4) { + /* 2nd tria, we use the V now */ + s1= uv3[0] - uv1[0]; + s2= uv4[0] - uv1[0]; + t1= uv3[1] - uv1[1]; + t2= uv4[1] - uv1[1]; + det= 1.0f / (s1 * t2 - s2 * t1); + + /* normals in render are inversed... */ + tang[0]= (t2 * (v1->co[0]-v3->co[0]) - t1 * (v1->co[0]-v4->co[0])); + tang[1]= (t2 * (v1->co[1]-v3->co[1]) - t1 * (v1->co[1]-v4->co[1])); + tang[2]= (t2 * (v1->co[2]-v3->co[2]) - t1 * (v1->co[2]-v4->co[2])); + + Normalise(tang); + + tav= RE_vertren_get_tangent(re, v1, 1); + VECADDFAC(tav, tav, tang, fac1); + tav= RE_vertren_get_tangent(re, v3, 1); + VECADDFAC(tav, tav, tang, fac3); + tav= RE_vertren_get_tangent(re, v4, 1); + VECADDFAC(tav, tav, tang, fac4); + } + } +} + +static void calc_vertexnormals(Render *re, int startvert, int startvlak, int do_tangent) +{ + int a; + + /* clear all vertex normals */ + for(a=startvert; atotvert; a++) { + VertRen *ver= RE_findOrAddVert(re, a); + ver->n[0]=ver->n[1]=ver->n[2]= 0.0; + } + + /* calculate cos of angles and point-masses, use as weight factor to + add face normal to vertex */ + for(a=startvlak; atotvlak; a++) { + VlakRen *vlr= RE_findOrAddVlak(re, a); + if(vlr->flag & ME_SMOOTH) { + VertRen *adrve1= vlr->v1; + VertRen *adrve2= vlr->v2; + VertRen *adrve3= vlr->v3; + VertRen *adrve4= vlr->v4; + float n1[3], n2[3], n3[3], n4[3]; + float fac1, fac2, fac3, fac4=0.0f; + + VecSubf(n1, adrve2->co, adrve1->co); + Normalise(n1); + VecSubf(n2, adrve3->co, adrve2->co); + Normalise(n2); + if(adrve4==NULL) { + VecSubf(n3, adrve1->co, adrve3->co); + Normalise(n3); + + fac1= saacos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]); + fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]); + fac3= saacos(-n2[0]*n3[0]-n2[1]*n3[1]-n2[2]*n3[2]); + } + else { + VecSubf(n3, adrve4->co, adrve3->co); + Normalise(n3); + VecSubf(n4, adrve1->co, adrve4->co); + Normalise(n4); + + fac1= saacos(-n4[0]*n1[0]-n4[1]*n1[1]-n4[2]*n1[2]); + fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]); + fac3= saacos(-n2[0]*n3[0]-n2[1]*n3[1]-n2[2]*n3[2]); + fac4= saacos(-n3[0]*n4[0]-n3[1]*n4[1]-n3[2]*n4[2]); + + if(!(vlr->flag & R_NOPUNOFLIP)) { + if( contrpuntnormr(vlr->n, adrve4->n) ) fac4= -fac4; + } + + adrve4->n[0] +=fac4*vlr->n[0]; + adrve4->n[1] +=fac4*vlr->n[1]; + adrve4->n[2] +=fac4*vlr->n[2]; + } + + if(!(vlr->flag & R_NOPUNOFLIP)) { + if( contrpuntnormr(vlr->n, adrve1->n) ) fac1= -fac1; + if( contrpuntnormr(vlr->n, adrve2->n) ) fac2= -fac2; + if( contrpuntnormr(vlr->n, adrve3->n) ) fac3= -fac3; + } + + adrve1->n[0] +=fac1*vlr->n[0]; + adrve1->n[1] +=fac1*vlr->n[1]; + adrve1->n[2] +=fac1*vlr->n[2]; + + adrve2->n[0] +=fac2*vlr->n[0]; + adrve2->n[1] +=fac2*vlr->n[1]; + adrve2->n[2] +=fac2*vlr->n[2]; + + adrve3->n[0] +=fac3*vlr->n[0]; + adrve3->n[1] +=fac3*vlr->n[1]; + adrve3->n[2] +=fac3*vlr->n[2]; + + if(do_tangent) + calc_tangent_vector(re, vlr, fac1, fac2, fac3, fac4); + } + } + + /* do solid faces */ + for(a=startvlak; atotvlak; a++) { + VlakRen *vlr= RE_findOrAddVlak(re, a); + if((vlr->flag & ME_SMOOTH)==0) { + float *f1= vlr->v1->n; + if(f1[0]==0.0 && f1[1]==0.0 && f1[2]==0.0) VECCOPY(f1, vlr->n); + f1= vlr->v2->n; + if(f1[0]==0.0 && f1[1]==0.0 && f1[2]==0.0) VECCOPY(f1, vlr->n); + f1= vlr->v3->n; + if(f1[0]==0.0 && f1[1]==0.0 && f1[2]==0.0) VECCOPY(f1, vlr->n); + if(vlr->v4) { + f1= vlr->v4->n; + if(f1[0]==0.0 && f1[1]==0.0 && f1[2]==0.0) VECCOPY(f1, vlr->n); + } + } + } + + /* normalise vertex normals */ + for(a=startvert; atotvert; a++) { + VertRen *ver= RE_findOrAddVert(re, a); + Normalise(ver->n); + if(do_tangent) { + float *tav= RE_vertren_get_tangent(re, ver, 0); + if(tav) Normalise(tav); + } + } + + /* vertex normal (puno) switch flags for during render */ + for(a=startvlak; atotvlak; a++) { + VlakRen *vlr= RE_findOrAddVlak(re, a); + + if((vlr->flag & R_NOPUNOFLIP)==0) { + VertRen *adrve1= vlr->v1; + VertRen *adrve2= vlr->v2; + VertRen *adrve3= vlr->v3; + VertRen *adrve4= vlr->v4; + vlr->puno &= ~15; + if ((vlr->n[0]*adrve1->n[0]+vlr->n[1]*adrve1->n[1]+vlr->n[2]*adrve1->n[2])<0.0) vlr->puno= 1; + if ((vlr->n[0]*adrve2->n[0]+vlr->n[1]*adrve2->n[1]+vlr->n[2]*adrve2->n[2])<0.0) vlr->puno+= 2; + if ((vlr->n[0]*adrve3->n[0]+vlr->n[1]*adrve3->n[1]+vlr->n[2]*adrve3->n[2])<0.0) vlr->puno+= 4; + if(adrve4) { + if((vlr->n[0]*adrve4->n[0]+vlr->n[1]*adrve4->n[1]+vlr->n[2]*adrve4->n[2])<0.0) vlr->puno+= 8; + } + } + } +} + +/* ------------------------------------------------------------------------- */ +/* Autosmoothing: */ +/* ------------------------------------------------------------------------- */ + +typedef struct ASvert { + int totface; + ListBase faces; +} ASvert; + +typedef struct ASface { + struct ASface *next, *prev; + VlakRen *vlr[4]; + VertRen *nver[4]; +} ASface; + +static void as_addvert(ASvert *asv, VertRen *v1, VlakRen *vlr) +{ + ASface *asf; + int a; + + if(v1 == NULL) return; + + if(asv->faces.first==NULL) { + asf= MEM_callocN(sizeof(ASface), "asface"); + BLI_addtail(&asv->faces, asf); + } + + asf= asv->faces.last; + for(a=0; a<4; a++) { + if(asf->vlr[a]==NULL) { + asf->vlr[a]= vlr; + asv->totface++; + break; + } + } + + /* new face struct */ + if(a==4) { + asf= MEM_callocN(sizeof(ASface), "asface"); + BLI_addtail(&asv->faces, asf); + asf->vlr[0]= vlr; + asv->totface++; + } +} + +static int as_testvertex(VlakRen *vlr, VertRen *ver, ASvert *asv, float thresh) +{ + /* return 1: vertex needs a copy */ + ASface *asf; + float inp; + int a; + + if(vlr==0) return 0; + + asf= asv->faces.first; + while(asf) { + for(a=0; a<4; a++) { + if(asf->vlr[a] && asf->vlr[a]!=vlr) { + inp= fabs( vlr->n[0]*asf->vlr[a]->n[0] + vlr->n[1]*asf->vlr[a]->n[1] + vlr->n[2]*asf->vlr[a]->n[2] ); + if(inp < thresh) return 1; + } + } + asf= asf->next; + } + + return 0; +} + +static VertRen *as_findvertex(VlakRen *vlr, VertRen *ver, ASvert *asv, float thresh) +{ + /* return when new vertex already was made */ + ASface *asf; + float inp; + int a; + + asf= asv->faces.first; + while(asf) { + for(a=0; a<4; a++) { + if(asf->vlr[a] && asf->vlr[a]!=vlr) { + /* this face already made a copy for this vertex! */ + if(asf->nver[a]) { + inp= fabs( vlr->n[0]*asf->vlr[a]->n[0] + vlr->n[1]*asf->vlr[a]->n[1] + vlr->n[2]*asf->vlr[a]->n[2] ); + if(inp >= thresh) { + return asf->nver[a]; + } + } + } + } + asf= asf->next; + } + + return NULL; +} + +static void autosmooth(Render *re, int startvert, int startvlak, int degr) +{ + ASvert *asv, *asverts, *asvertoffs; + ASface *asf; + VertRen *ver, *v1; + VlakRen *vlr; + float thresh; + int a, b, totvert; + + if(startvert==re->totvert) return; + asverts= MEM_callocN(sizeof(ASvert)*(re->totvert-startvert), "all smooth verts"); + asvertoffs= asverts-startvert; /* se we can use indices */ + + thresh= cos( M_PI*((float)degr)/180.0 ); + + /* step one: construct listbase of all vertices and pointers to faces */ + for(a=startvlak; atotvlak; a++) { + vlr= RE_findOrAddVlak(re, a); + + as_addvert(asvertoffs+vlr->v1->index, vlr->v1, vlr); + as_addvert(asvertoffs+vlr->v2->index, vlr->v2, vlr); + as_addvert(asvertoffs+vlr->v3->index, vlr->v3, vlr); + if(vlr->v4) + as_addvert(asvertoffs+vlr->v4->index, vlr->v4, vlr); + } + + /* we now test all vertices, when faces have a normal too much different: they get a new vertex */ + totvert= re->totvert; + for(a=startvert, asv=asverts; atotface>1) { + ver= RE_findOrAddVert(re, a); + + asf= asv->faces.first; + while(asf) { + for(b=0; b<4; b++) { + + /* is there a reason to make a new vertex? */ + vlr= asf->vlr[b]; + if( as_testvertex(vlr, ver, asv, thresh) ) { + + /* already made a new vertex within threshold? */ + v1= as_findvertex(vlr, ver, asv, thresh); + if(v1==NULL) { + /* make a new vertex */ + v1= duplicate_vertren(re, ver); + } + asf->nver[b]= v1; + if(vlr->v1==ver) vlr->v1= v1; + if(vlr->v2==ver) vlr->v2= v1; + if(vlr->v3==ver) vlr->v3= v1; + if(vlr->v4==ver) vlr->v4= v1; + } + } + asf= asf->next; + } + } + } + + /* free */ + for(a=0; aorco_hash) + re->orco_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); + + orco = BLI_ghash_lookup(re->orco_hash, ob); + + if (!orco) { + if (ob->type==OB_MESH) { + orco = mesh_create_orco_render(ob); + } else if (ELEM(ob->type, OB_CURVE, OB_FONT)) { + orco = make_orco_curve(ob); + } else if (ob->type==OB_SURF) { + orco = make_orco_surf(ob); + } + + if (orco) + BLI_ghash_insert(re->orco_hash, ob, orco); + } + + return orco; +} + +static void free_mesh_orco_hash(Render *re) +{ + if (re->orco_hash) { + BLI_ghash_free(re->orco_hash, NULL, (GHashValFreeFP)MEM_freeN); + re->orco_hash = NULL; + } +} + +/* ******************** END ORCO HASH ***************** */ + + +static void make_render_halos(Render *re, Object *ob, Mesh *me, int totvert, MVert *mvert, Material *ma, float *orco) +{ + HaloRen *har; + float xn, yn, zn, nor[3], view[3]; + float vec[3], hasize, mat[4][4], imat[3][3]; + int a, ok, seed= ma->seed1; + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat3CpyMat4(imat, ob->imat); + + re->flag |= R_HALO; + + for(a=0; ahasize; + + VECCOPY(vec, mvert->co); + MTC_Mat4MulVecfl(mat, vec); + + if(ma->mode & MA_HALOPUNO) { + xn= mvert->no[0]; + yn= mvert->no[1]; + zn= mvert->no[2]; + + /* transpose ! */ + nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn; + nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn; + nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn; + Normalise(nor); + + VECCOPY(view, vec); + Normalise(view); + + zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2]; + if(zn>=0.0) hasize= 0.0; + else hasize*= zn*zn*zn*zn; + } + + if(orco) har= RE_inithalo(re, ma, vec, NULL, orco, hasize, 0.0, seed); + else har= RE_inithalo(re, ma, vec, NULL, mvert->co, hasize, 0.0, seed); + if(har) har->lay= ob->lay; + } + if(orco) orco+= 3; + seed++; + } +} + +/* ------------------------------------------------------------------------- */ +static Material *give_render_material(Render *re, Object *ob, int nr) +{ + extern Material defmaterial; /* material.c */ + Material *ma; + + ma= give_current_material(ob, nr); + if(ma==NULL) + ma= &defmaterial; + else + if(ma->mode & MA_ZTRA) + re->flag |= R_ZTRA; + + return ma; +} + + + +static void render_particle_system(Render *re, Object *ob, PartEff *paf) +{ + Particle *pa=0; + HaloRen *har=0; + Material *ma=0; + float xn, yn, zn, imat[3][3], tmat[4][4], mat[4][4], hasize, stime, ptime, ctime, vec[3], vec1[3], view[3], nor[3]; + int a, mat_nr=1, seed; + + pa= paf->keys; + if(pa==NULL || paf->disp!=100) { + build_particle_system(ob); + pa= paf->keys; + if(pa==NULL) return; + } + + ma= give_render_material(re, ob, paf->omat); + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); /* this is correct, for imat texture */ + + /* enable duplicators to work */ + Mat4MulMat4(tmat, paf->imat, ob->obmat); + MTC_Mat4MulMat4(mat, tmat, re->viewmat); + + MTC_Mat4Invert(tmat, mat); + MTC_Mat3CpyMat4(imat, tmat); + + re->flag |= R_HALO; + + if(ob->ipoflag & OB_OFFS_PARTICLE) ptime= ob->sf; + else ptime= 0.0; + ctime= bsystem_time(ob, 0, (float)re->scene->r.cfra, ptime); + seed= ma->seed1; + + for(a=0; atotpart; a++, pa+=paf->totkey, seed++) { + + /* offset time for calculating normal */ + stime= ctime; + ptime= ctime+1.0f; + if(ctime < pa->time) { + if(paf->flag & PAF_UNBORN) + ptime= pa->time+1.0f; + else + continue; + } + if(ctime > pa->time+pa->lifetime) { + if(paf->flag & PAF_DIED) + stime= pa->time+pa->lifetime-1.0f; + else + continue; + } + + /* watch it: also calculate the normal of a particle */ + if(paf->stype==PAF_VECT || ma->mode & MA_HALO_SHADE) { + where_is_particle(paf, pa, stime, vec); + MTC_Mat4MulVecfl(mat, vec); + where_is_particle(paf, pa, ptime, vec1); + MTC_Mat4MulVecfl(mat, vec1); + } + else { + where_is_particle(paf, pa, ctime, vec); + MTC_Mat4MulVecfl(mat, vec); + } + + if(pa->mat_nr != mat_nr) { + mat_nr= pa->mat_nr; + ma= give_render_material(re, ob, mat_nr); + } + + if(ma->ipo) { + /* correction for lifetime */ + ptime= 100.0*(ctime-pa->time)/pa->lifetime; + calc_ipo(ma->ipo, ptime); + execute_ipo((ID *)ma, ma->ipo); + } + + hasize= ma->hasize; + + if(ma->mode & MA_HALOPUNO) { + xn= pa->no[0]; + yn= pa->no[1]; + zn= pa->no[2]; + + /* transpose ! */ + nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn; + nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn; + nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn; + Normalise(nor); + + VECCOPY(view, vec); + Normalise(view); + + zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2]; + if(zn>=0.0) hasize= 0.0; + else hasize*= zn*zn*zn*zn; + } + + if(paf->stype==PAF_VECT) har= RE_inithalo(re, ma, vec, vec1, pa->co, hasize, paf->vectsize, seed); + else { + har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed); + if(har && ma->mode & MA_HALO_SHADE) { + VecSubf(har->no, vec, vec1); + Normalise(har->no); + } + } + if(har) har->lay= ob->lay; + } + + /* restore material */ + for(a=1; a<=ob->totcol; a++) { + ma= give_render_material(re, ob, a); + if(ma) do_mat_ipo(ma); + } + + if(paf->disp!=100) { + MEM_freeN(paf->keys); + paf->keys= NULL; + } +} + + +/* ------------------------------------------------------------------------- */ + +/* future thread problem... */ +static void static_particle_strand(Render *re, Object *ob, Material *ma, float *orco, float *vec, float *vec1, float ctime, int first) +{ + static VertRen *v1= NULL, *v2= NULL; + VlakRen *vlr; + float nor[3], cross[3], w, dx, dy; + int flag; + + VecSubf(nor, vec, vec1); + Normalise(nor); // nor needed as tangent + Crossf(cross, vec, nor); + + /* turn cross in pixelsize */ + w= vec[2]*re->winmat[2][3] + re->winmat[3][3]; + dx= re->winx*cross[0]*re->winmat[0][0]/w; + dy= re->winy*cross[1]*re->winmat[1][1]/w; + w= sqrt(dx*dx + dy*dy); + if(w!=0.0f) { + float fac; + if(ma->strand_ease!=0.0f) { + if(ma->strand_ease<0.0f) + fac= pow(ctime, 1.0+ma->strand_ease); + else + fac= pow(ctime, 1.0/(1.0f-ma->strand_ease)); + } + else fac= ctime; + + VecMulf(cross, ((1.0f-fac)*ma->strand_sta + (fac)*ma->strand_end)/w); + } + + if(ma->mode & MA_TANGENT_STR) + flag= R_SMOOTH|R_NOPUNOFLIP|R_STRAND|R_TANGENT; + else + flag= R_SMOOTH|R_STRAND; + + /* first two vertices */ + if(first) { + v1= RE_findOrAddVert(re, re->totvert++); + v2= RE_findOrAddVert(re, re->totvert++); + + VECCOPY(v1->co, vec); + VecAddf(v1->co, v1->co, cross); + VECCOPY(v1->n, nor); + v1->orco= orco; + v1->accum= -1.0f; // accum abuse for strand texco + + VECCOPY(v2->co, vec); + VecSubf(v2->co, v2->co, cross); + VECCOPY(v2->n, nor); + v2->orco= orco; + v2->accum= v1->accum; + } + else { + + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->flag= flag; + vlr->ob= ob; + vlr->v1= v1; + vlr->v2= v2; + vlr->v3= RE_findOrAddVert(re, re->totvert++); + vlr->v4= RE_findOrAddVert(re, re->totvert++); + + v1= vlr->v4; // cycle + v2= vlr->v3; // cycle + + VECCOPY(vlr->v4->co, vec); + VecAddf(vlr->v4->co, vlr->v4->co, cross); + VECCOPY(vlr->v4->n, nor); + vlr->v4->orco= orco; + vlr->v4->accum= -1.0f + 2.0f*ctime; // accum abuse for strand texco + + VECCOPY(vlr->v3->co, vec); + VecSubf(vlr->v3->co, vlr->v3->co, cross); + VECCOPY(vlr->v3->n, nor); + vlr->v3->orco= orco; + vlr->v3->accum= vlr->v4->accum; + + CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); + + vlr->mat= ma; + vlr->ec= ME_V2V3; + vlr->lay= ob->lay; + } +} + +static void render_static_particle_system(Render *re, Object *ob, PartEff *paf) +{ + Particle *pa=0; + HaloRen *har=0; + Material *ma=0; + VertRen *v1= NULL; + VlakRen *vlr; + float xn, yn, zn, imat[3][3], mat[4][4], hasize; + float mtime, ptime, ctime, vec[3], vec1[3], view[3], nor[3]; + float *orco= NULL, loc_tex[3], size_tex[3]; + int a, mat_nr=1, seed, totvlako, totverto, first; + + pa= paf->keys; + if(pa==NULL || (paf->flag & PAF_ANIMATED) || paf->disp!=100) { + build_particle_system(ob); + pa= paf->keys; + if(pa==NULL) return; + } + + totvlako= re->totvlak; + totverto= re->totvert; + + ma= give_render_material(re, ob, paf->omat); + if(ma->mode & MA_HALO) + re->flag |= R_HALO; + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); /* need to be that way, for imat texture */ + + MTC_Mat3CpyMat4(imat, ob->imat); + + /* orcos */ + if(!(ma->mode & (MA_HALO|MA_WIRE))) { + orco= MEM_mallocN(3*sizeof(float)*paf->totpart, "static particle orcos"); + if (!re->orco_hash) + re->orco_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); + BLI_ghash_insert(re->orco_hash, paf, orco); /* pointer is particles, otherwise object uses it */ + } + + mesh_get_texspace(ob->data, loc_tex, NULL, size_tex); + + if(ob->ipoflag & OB_OFFS_PARTICLE) ptime= ob->sf; + else ptime= 0.0; + ctime= bsystem_time(ob, 0, (float)re->scene->r.cfra, ptime); + seed= ma->seed1; + + for(a=0; atotpart; a++, pa+=paf->totkey) { + + where_is_particle(paf, pa, pa->time, vec1); + if(orco) { + orco[0] = (vec1[0]-loc_tex[0])/size_tex[0]; + orco[1] = (vec1[1]-loc_tex[1])/size_tex[1]; + orco[2] = (vec1[2]-loc_tex[2])/size_tex[2]; + } + MTC_Mat4MulVecfl(mat, vec1); + mtime= pa->time+pa->lifetime+paf->staticstep-1; + + first= 1; + for(ctime= pa->time; ctimestaticstep) { + + /* make sure hair grows until the end.. */ + if(ctime>pa->time+pa->lifetime) ctime= pa->time+pa->lifetime; + + /* watch it: also calc the normal of a particle */ + if(paf->stype==PAF_VECT || ma->mode & MA_HALO_SHADE) { + where_is_particle(paf, pa, ctime+1.0, vec); + MTC_Mat4MulVecfl(mat, vec); + } + else { + where_is_particle(paf, pa, ctime, vec); + MTC_Mat4MulVecfl(mat, vec); + } + + if(pa->mat_nr != mat_nr) { + mat_nr= pa->mat_nr; + ma= give_render_material(re, ob, mat_nr); + } + + /* wires */ + if(ma->mode & MA_WIRE) { + if(ctime == pa->time) { + v1= RE_findOrAddVert(re, re->totvert++); + VECCOPY(v1->co, vec); + } + else { + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->ob= ob; + vlr->v1= v1; + vlr->v2= RE_findOrAddVert(re, re->totvert++); + vlr->v3= vlr->v2; + vlr->v4= NULL; + + v1= vlr->v2; // cycle + VECCOPY(v1->co, vec); + + VecSubf(vlr->n, vec, vec1); + Normalise(vlr->n); + VECCOPY(v1->n, vlr->n); + + vlr->mat= ma; + vlr->ec= ME_V1V2; + vlr->lay= ob->lay; + } + } + else { + if(ma->ipo) { + /* correction for lifetime */ + ptime= 100.0*(ctime-pa->time)/pa->lifetime; + calc_ipo(ma->ipo, ptime); + execute_ipo((ID *)ma, ma->ipo); + } + + if(ma->mode & MA_HALO) { + hasize= ma->hasize; + + if(ma->mode & MA_HALOPUNO) { + xn= pa->no[0]; + yn= pa->no[1]; + zn= pa->no[2]; + + /* transpose ! */ + nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn; + nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn; + nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn; + Normalise(nor); + + VECCOPY(view, vec); + Normalise(view); + + zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2]; + if(zn>=0.0) hasize= 0.0; + else hasize*= zn*zn*zn*zn; + } + + if(paf->stype==PAF_VECT) har= RE_inithalo(re, ma, vec, vec1, pa->co, hasize, paf->vectsize, seed); + else { + har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed); + if(har && (ma->mode & MA_HALO_SHADE)) { + VecSubf(har->no, vec, vec1); + Normalise(har->no); + har->lay= ob->lay; + } + } + if(har) har->lay= ob->lay; + } + else { /* generate pixel sized hair strand */ + static_particle_strand(re, ob, ma, orco, vec, vec1, (ctime-pa->time)/(mtime-pa->time), first); + } + } + + VECCOPY(vec1, vec); + first= 0; + } + + seed++; + if(orco) orco+=3; + } + + if(paf->disp!=100) { + MEM_freeN(paf->keys); + paf->keys= NULL; + } + + if((ma->mode & MA_TANGENT_STR)==0) + calc_vertexnormals(re, totverto, totvlako, 0); +} + + +/* ------------------------------------------------------------------------- */ + +static int verghalo(const void *a1, const void *a2) +{ + const struct halosort *x1=a1, *x2=a2; + + if( x1->z < x2->z ) return 1; + else if( x1->z > x2->z) return -1; + return 0; +} + +/* ------------------------------------------------------------------------- */ +static void sort_halos(Render *re) +{ + struct halosort *hablock, *haso; + HaloRen *har = NULL, **bloha; + int a; + + if(re->tothalo==0) return; + + /* make datablock with halo pointers, sort */ + haso= hablock= MEM_mallocN(sizeof(struct halosort)*re->tothalo, "hablock"); + + for(a=0; atothalo; a++) { + if((a & 255)==0) har= re->bloha[a>>8]; + else har++; + haso->har= har; + haso->z= har->zs; + haso++; + } + + qsort(hablock, re->tothalo, sizeof(struct halosort), verghalo); + + /* re-assamble re->bloha */ + + bloha= re->bloha; + re->bloha= (HaloRen **)MEM_callocN(sizeof(void *)*(re->blohalen),"Bloha"); + + haso= hablock; + for(a=0; atothalo; a++) { + har= RE_findOrAddHalo(re, a); + *har= *(haso->har); + + haso++; + } + + /* free */ + a= 0; + while(bloha[a]) { + MEM_freeN(bloha[a]); + a++; + } + MEM_freeN(bloha); + MEM_freeN(hablock); + +} + +/* ------------------------------------------------------------------------- */ +static void init_render_mball(Render *re, Object *ob) +{ + DispList *dl, *dlo; + VertRen *ver; + VlakRen *vlr, *vlr1; + Material *ma; + float *data, *nors, mat[4][4], imat[3][3], xn, yn, zn; + int a, need_orco, startvert, *index; + + if (ob!=find_basis_mball(ob)) + return; + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); + MTC_Mat3CpyMat4(imat, ob->imat); + + ma= give_render_material(re, ob, 1); + + need_orco= 0; + if(ma->texco & TEXCO_ORCO) { + need_orco= 1; + } + + dlo= ob->disp.first; + if(dlo) BLI_remlink(&ob->disp, dlo); + + makeDispListMBall(ob); + dl= ob->disp.first; + if(dl==0) return; + + startvert= re->totvert; + data= dl->verts; + nors= dl->nors; + + for(a=0; anr; a++, data+=3, nors+=3) { + + ver= RE_findOrAddVert(re, re->totvert++); + VECCOPY(ver->co, data); + MTC_Mat4MulVecfl(mat, ver->co); + + xn= nors[0]; + yn= nors[1]; + zn= nors[2]; + + /* transpose ! */ + ver->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn; + ver->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn; + ver->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn; + Normalise(ver->n); + //if(ob->transflag & OB_NEG_SCALE) VecMulf(ver->n. -1.0); + + if(need_orco) ver->orco= data; + } + + index= dl->index; + for(a=0; aparts; a++, index+=4) { + + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->ob= ob; + vlr->v1= RE_findOrAddVert(re, startvert+index[0]); + vlr->v2= RE_findOrAddVert(re, startvert+index[1]); + vlr->v3= RE_findOrAddVert(re, startvert+index[2]); + vlr->v4= 0; + + if(ob->transflag & OB_NEG_SCALE) + CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->n); + else + CalcNormFloat(vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); + + vlr->mat= ma; + vlr->flag= ME_SMOOTH+R_NOPUNOFLIP; + vlr->ec= 0; + vlr->lay= ob->lay; + + /* mball -too bad- always has triangles, because quads can be non-planar */ + if(index[3]) { + vlr1= RE_findOrAddVlak(re, re->totvlak++); + *vlr1= *vlr; + vlr1->v2= vlr1->v3; + vlr1->v3= RE_findOrAddVert(re, startvert+index[3]); + if(ob->transflag & OB_NEG_SCALE) + CalcNormFloat(vlr1->v1->co, vlr1->v2->co, vlr1->v3->co, vlr1->n); + else + CalcNormFloat(vlr1->v3->co, vlr1->v2->co, vlr1->v1->co, vlr1->n); + } + } + + if(need_orco) { + /* store displist and scale */ + make_orco_mball(ob); + if(dlo) BLI_addhead(&ob->disp, dlo); + + } + else { + freedisplist(&ob->disp); + if(dlo) BLI_addtail(&ob->disp, dlo); + } +} +/* ------------------------------------------------------------------------- */ +/* convert */ + +struct edgesort { + int v1, v2; + int has_mcol; + TFace *tface; + float uv1[2], uv2[2]; + unsigned int mcol1, mcol2; +}; + +/* edges have to be added with lowest index first for sorting */ +static void to_edgesort(struct edgesort *ed, int i1, int i2, int v1, int v2, unsigned int *mcol, TFace *tface) +{ + if(v1v1= v1; ed->v2= v2; + } + else { + ed->v1= v2; ed->v2= v1; + SWAP(int, i1, i2); + } + /* copy color and tface, edges use different ordering */ + ed->tface= tface; + if(tface) { + ed->uv1[0]= tface->uv[i1][0]; + ed->uv1[1]= tface->uv[i1][1]; + ed->uv2[0]= tface->uv[i2][0]; + ed->uv2[1]= tface->uv[i2][1]; + + ed->mcol1= tface->col[i1]; + ed->mcol2= tface->col[i2]; + } + ed->has_mcol= mcol!=NULL; + if(mcol) { + ed->mcol1= mcol[i1]; + ed->mcol2= mcol[i2]; + } +} + +static int vergedgesort(const void *v1, const void *v2) +{ + const struct edgesort *x1=v1, *x2=v2; + + if( x1->v1 > x2->v1) return 1; + else if( x1->v1 < x2->v1) return -1; + else if( x1->v2 > x2->v2) return 1; + else if( x1->v2 < x2->v2) return -1; + + return 0; +} + +static struct edgesort *make_mesh_edge_lookup(Mesh *me, DispListMesh *dlm, int *totedgesort) +{ + MFace *mf, *mface; + TFace *tface=NULL; + struct edgesort *edsort, *ed; + unsigned int *mcol=NULL; + int a, totedge=0, totface; + + if (dlm) { + mface= dlm->mface; + totface= dlm->totface; + if (dlm->tface) + tface= dlm->tface; + else if (dlm->mcol) + mcol= (unsigned int *)dlm->mcol; + } else { + mface= me->mface; + totface= me->totface; + if (me->tface) + tface= me->tface; + else if (me->mcol) + mcol= (unsigned int *)me->mcol; + } + + if(mcol==NULL && tface==NULL) return NULL; + + /* make sorted table with edges and and tface/mcol pointers in it */ + for(a= totface, mf= mface; a>0; a--, mf++) { + if(mf->v4) totedge+=4; + else if(mf->v3) totedge+=3; + } + if(totedge==0) return NULL; + + ed= edsort= MEM_mallocN(totedge*sizeof(struct edgesort), "edgesort"); + + for(a= me->totface, mf= mface; a>0; a--, mf++) { + if(mface->v4 || mface->v3) { + to_edgesort(ed++, 0, 1, mf->v1, mf->v2, mcol, tface); + to_edgesort(ed++, 1, 2, mf->v2, mf->v3, mcol, tface); + if(mf->v4) { + to_edgesort(ed++, 2, 3, mf->v3, mf->v4, mcol, tface); + to_edgesort(ed++, 3, 0, mf->v4, mf->v1, mcol, tface); + } + else if(mf->v3) { + to_edgesort(ed++, 2, 3, mf->v3, mf->v1, mcol, tface); + } + } + if(mcol) mcol+=4; + if(tface) tface++; + } + + qsort(edsort, totedge, sizeof(struct edgesort), vergedgesort); + + *totedgesort= totedge; + return edsort; +} + +static void use_mesh_edge_lookup(Render *re, Mesh *me, DispListMesh *dlm, MEdge *medge, VlakRen *vlr, struct edgesort *edgetable, int totedge) +{ + struct edgesort ed, *edp; + + if(medge->v1 < medge->v2) { + ed.v1= medge->v1; ed.v2= medge->v2; + } + else { + ed.v1= medge->v2; ed.v2= medge->v1; + } + + edp= bsearch(&ed, edgetable, totedge, sizeof(struct edgesort), vergedgesort); + if(edp) { + /* since edges have different index ordering, we have to duplicate mcol and tface */ + if(edp->tface) { + vlr->tface= BLI_memarena_alloc(re->memArena, sizeof(TFace)); + vlr->vcol= vlr->tface->col; + memcpy(vlr->tface, edp->tface, sizeof(TFace)); + + if(edp->v1==medge->v1) { + vlr->vcol[0]= edp->mcol1; + vlr->vcol[1]= edp->mcol2; + } + else { + vlr->vcol[0]= edp->mcol2; + vlr->vcol[1]= edp->mcol1; + } + vlr->vcol[2]= vlr->vcol[1]; + vlr->vcol[3]= vlr->vcol[1]; + + if(edp->v1==medge->v1) { + memcpy(vlr->tface->uv[0], edp->uv1, 2*sizeof(float)); + memcpy(vlr->tface->uv[1], edp->uv2, 2*sizeof(float)); + } + else { + memcpy(vlr->tface->uv[0], edp->uv2, 2*sizeof(float)); + memcpy(vlr->tface->uv[1], edp->uv1, 2*sizeof(float)); + } + memcpy(vlr->tface->uv[2], vlr->tface->uv[1], 2*sizeof(float)); + memcpy(vlr->tface->uv[3], vlr->tface->uv[1], 2*sizeof(float)); + } + else if(edp->has_mcol) { + vlr->vcol= BLI_memarena_alloc(re->memArena, sizeof(MCol)*4); + vlr->vcol[0]= edp->mcol1; + vlr->vcol[1]= edp->mcol2; + vlr->vcol[2]= vlr->vcol[1]; + vlr->vcol[3]= vlr->vcol[1]; + } + } +} + +static void init_render_mesh(Render *re, Object *ob) +{ + Mesh *me; + MVert *mvert = NULL; + MFace *mface; + VlakRen *vlr; //, *vlr1; + VertRen *ver; + Material *ma; + MSticky *ms = NULL; + PartEff *paf; + DispListMesh *dlm = NULL; + DerivedMesh *dm; + unsigned int *vertcol; + float xn, yn, zn, imat[3][3], mat[4][4]; //nor[3], + float *orco=0; + int a, a1, ok, need_orco=0, need_stress=0, need_tangent=0, totvlako, totverto, vertofs; + int end, do_autosmooth=0, totvert = 0, dm_needsfree; + + me= ob->data; + + paf = give_parteff(ob); + if(paf) { + /* warning; build_particle_system does modifier calls itself */ + if(paf->flag & PAF_STATIC) render_static_particle_system(re, ob, paf); + else render_particle_system(re, ob, paf); + if((paf->flag & PAF_SHOWE)==0) return; + } + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); + MTC_Mat3CpyMat4(imat, ob->imat); + + if(me->totvert==0) { + return; + } + + totvlako= re->totvlak; + totverto= re->totvert; + + need_orco= 0; + for(a=1; a<=ob->totcol; a++) { + ma= give_render_material(re, ob, a); + if(ma) { + if(ma->texco & (TEXCO_ORCO|TEXCO_STRESS)) + need_orco= 1; + if(ma->texco & TEXCO_STRESS) + need_stress= 1; + if(ma->mode & MA_TANGENT_V) + need_tangent= 1; + } + } + + if(need_orco) orco = get_object_orco(re, ob); + + dm = mesh_create_derived_render(ob); + dm_needsfree= 1; + + if(dm==NULL) return; /* in case duplicated object fails? */ + + dlm = dm->convertToDispListMesh(dm, 1); + + mvert= dlm->mvert; + totvert= dlm->totvert; + + ms = (totvert==me->totvert)?me->msticky:NULL; + + ma= give_render_material(re, ob, 1); + + if(ma->mode & MA_HALO) { + make_render_halos(re, ob, me, totvert, mvert, ma, orco); + } + else { + + for(a=0; atotvert++); + VECCOPY(ver->co, mvert->co); + MTC_Mat4MulVecfl(mat, ver->co); + + if(orco) { + ver->orco= orco; + orco+=3; + } + if(ms) { + float *sticky= RE_vertren_get_sticky(re, ver, 1); + sticky[0]= ms->co[0]; + sticky[1]= ms->co[1]; + ms++; + } + } + /* still to do for keys: the correct local texture coordinate */ + + /* faces in order of color blocks */ + vertofs= re->totvert - totvert; + for(a1=0; (a1totcol || (a1==0 && ob->totcol==0)); a1++) { + + ma= give_render_material(re, ob, a1+1); + + /* test for 100% transparant */ + ok= 1; + if(ma->alpha==0.0 && ma->spectra==0.0) { + ok= 0; + /* texture on transparency? */ + for(a=0; amtex[a] && ma->mtex[a]->tex) { + if(ma->mtex[a]->mapto & MAP_ALPHA) ok= 1; + } + } + } + + /* if wire material, and we got edges, don't do the faces */ + if(ma->mode & MA_WIRE) { + end= dlm?dlm->totedge:me->totedge; + if(end) ok= 0; + } + + if(ok) { + TFace *tface= NULL; + + /* radio faces need autosmooth, to separate shared vertices in corners */ + if(re->r.mode & R_RADIO) + if(ma->mode & MA_RADIO) + do_autosmooth= 1; + + end= dlm?dlm->totface:me->totface; + if (dlm) { + mface= dlm->mface; + if (dlm->tface) { + tface= dlm->tface; + vertcol= NULL; + } else if (dlm->mcol) { + vertcol= (unsigned int *)dlm->mcol; + } else { + vertcol= NULL; + } + } else { + mface= me->mface; + if (me->tface) { + tface= me->tface; + vertcol= NULL; + } else if (me->mcol) { + vertcol= (unsigned int *)me->mcol; + } else { + vertcol= NULL; + } + } + + for(a=0; amat_nr==a1 ) { + float len; + + v1= mface->v1; + v2= mface->v2; + v3= mface->v3; + v4= mface->v4; + flag= mface->flag & ME_SMOOTH; + + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->ob= ob; + vlr->v1= RE_findOrAddVert(re, vertofs+v1); + vlr->v2= RE_findOrAddVert(re, vertofs+v2); + vlr->v3= RE_findOrAddVert(re, vertofs+v3); + if(v4) vlr->v4= RE_findOrAddVert(re, vertofs+v4); + else vlr->v4= 0; + + /* render normals are inverted in render */ + if(vlr->v4) len= CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, + vlr->v1->co, vlr->n); + else len= CalcNormFloat(vlr->v3->co, vlr->v2->co, vlr->v1->co, + vlr->n); + + vlr->mat= ma; + vlr->flag= flag; + if((me->flag & ME_NOPUNOFLIP) ) { + vlr->flag |= R_NOPUNOFLIP; + } + vlr->ec= 0; /* mesh edges rendered separately */ + vlr->lay= ob->lay; + + if(len==0) re->totvlak--; + else { + if(dlm) { + if(tface) { + vlr->tface= BLI_memarena_alloc(re->memArena, sizeof(TFace)); + vlr->vcol= vlr->tface->col; + memcpy(vlr->tface, tface, sizeof(TFace)); + } + else if (vertcol) { + vlr->vcol= BLI_memarena_alloc(re->memArena, sizeof(int)*4); + memcpy(vlr->vcol, vertcol+4*a, sizeof(int)*4); + } + } else { + if(tface) { + vlr->vcol= tface->col; + vlr->tface= tface; + } + else if (vertcol) { + vlr->vcol= vertcol+4*a; + } + } + } + } + + mface++; + if(tface) tface++; + } + } + } + + /* exception... we do edges for wire mode. potential conflict when faces exist... */ + end= dlm?dlm->totedge:me->totedge; + mvert= dlm?dlm->mvert:me->mvert; + ma= give_render_material(re, ob, 1); + if(end && (ma->mode & MA_WIRE)) { + MEdge *medge; + struct edgesort *edgetable; + int totedge; + + medge= dlm?dlm->medge:me->medge; + + /* we want edges to have UV and vcol too... */ + edgetable= make_mesh_edge_lookup(me, dlm, &totedge); + + for(a1=0; a1flag&ME_EDGERENDER) { + MVert *v0 = &mvert[medge->v1]; + MVert *v1 = &mvert[medge->v2]; + + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->ob= ob; + vlr->v1= RE_findOrAddVert(re, vertofs+medge->v1); + vlr->v2= RE_findOrAddVert(re, vertofs+medge->v2); + vlr->v3= vlr->v2; + vlr->v4= NULL; + + if(edgetable) { + use_mesh_edge_lookup(re, me, dlm, medge, vlr, edgetable, totedge); + } + + xn= (v0->no[0]+v1->no[0]); + yn= (v0->no[1]+v1->no[1]); + zn= (v0->no[2]+v1->no[2]); + /* transpose ! */ + vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn; + vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn; + vlr->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn; + Normalise(vlr->n); + + vlr->mat= ma; + vlr->flag= 0; + vlr->ec= ME_V1V2; + vlr->lay= ob->lay; + } + } + if(edgetable) + MEM_freeN(edgetable); + } + } + + if (test_for_displace(re, ob ) ) { + calc_vertexnormals(re, totverto, totvlako, 0); + do_displacement(re, ob, totvlako, re->totvlak-totvlako, totverto, re->totvert-totverto); + } + + if(do_autosmooth || (me->flag & ME_AUTOSMOOTH)) { + autosmooth(re, totverto, totvlako, me->smoothresh); + } + + calc_vertexnormals(re, totverto, totvlako, need_tangent); + + if(need_stress) + calc_edge_stress(re, me, totverto, totvlako); + + if(dlm) displistmesh_free(dlm); + if(dm_needsfree) dm->release(dm); +} + +/* ------------------------------------------------------------------------- */ + +static void initshadowbuf(Render *re, LampRen *lar, float mat[][4]) +{ + struct ShadBuf *shb; + float hoek, temp, viewinv[4][4]; + + /* if(la->spsi<16) return; */ + + /* memory reservation */ + shb= (struct ShadBuf *)MEM_callocN( sizeof(struct ShadBuf),"initshadbuf"); + lar->shb= shb; + + if(shb==NULL) return; + + VECCOPY(shb->co, lar->co); + + /* percentage render: keep track of min and max */ + shb->size= (lar->bufsize*re->r.size)/100; + if(shb->size<512) shb->size= 512; + else if(shb->size > lar->bufsize) shb->size= lar->bufsize; + + shb->size &= ~15; /* make sure its multiples of 16 */ + + shb->samp= lar->samp; + shb->soft= lar->soft; + shb->shadhalostep= lar->shadhalostep; + + shb->zbuf= (unsigned long *)MEM_mallocN( sizeof(unsigned long)*(shb->size*shb->size)/256, "initshadbuf2"); + shb->cbuf= (char *)MEM_callocN( (shb->size*shb->size)/256, "initshadbuf3"); + + if(shb->zbuf==0 || shb->cbuf==0) { + if(shb->zbuf) MEM_freeN(shb->zbuf); + MEM_freeN(lar->shb); + lar->shb= 0; + return; + } + + MTC_Mat4Ortho(mat); + MTC_Mat4Invert(shb->winmat, mat); /* winmat is temp */ + + /* matrix: combination of inverse view and lampmat */ + /* calculate again: the ortho-render has no correct viewinv */ + MTC_Mat4Invert(viewinv, re->viewmat); + MTC_Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); + + /* projection */ + hoek= saacos(lar->spotsi); + temp= 0.5*shb->size*cos(hoek)/sin(hoek); + shb->d= lar->clipsta; + + shb->pixsize= (shb->d)/temp; + + shb->clipend= lar->clipend; + /* bias is percentage, made 2x karger because of correction for angle of incidence */ + /* when a ray is closer to parallel of a face, bias value is increased during render */ + shb->bias= (0.02*lar->bias)*0x7FFFFFFF; + shb->bias= shb->bias*(100/re->r.size); + +} + + +static void area_lamp_vectors(LampRen *lar) +{ + float xsize= 0.5*lar->area_size, ysize= 0.5*lar->area_sizey; + + /* corner vectors */ + lar->area[0][0]= lar->co[0] - xsize*lar->mat[0][0] - ysize*lar->mat[1][0]; + lar->area[0][1]= lar->co[1] - xsize*lar->mat[0][1] - ysize*lar->mat[1][1]; + lar->area[0][2]= lar->co[2] - xsize*lar->mat[0][2] - ysize*lar->mat[1][2]; + + /* corner vectors */ + lar->area[1][0]= lar->co[0] - xsize*lar->mat[0][0] + ysize*lar->mat[1][0]; + lar->area[1][1]= lar->co[1] - xsize*lar->mat[0][1] + ysize*lar->mat[1][1]; + lar->area[1][2]= lar->co[2] - xsize*lar->mat[0][2] + ysize*lar->mat[1][2]; + + /* corner vectors */ + lar->area[2][0]= lar->co[0] + xsize*lar->mat[0][0] + ysize*lar->mat[1][0]; + lar->area[2][1]= lar->co[1] + xsize*lar->mat[0][1] + ysize*lar->mat[1][1]; + lar->area[2][2]= lar->co[2] + xsize*lar->mat[0][2] + ysize*lar->mat[1][2]; + + /* corner vectors */ + lar->area[3][0]= lar->co[0] + xsize*lar->mat[0][0] - ysize*lar->mat[1][0]; + lar->area[3][1]= lar->co[1] + xsize*lar->mat[0][1] - ysize*lar->mat[1][1]; + lar->area[3][2]= lar->co[2] + xsize*lar->mat[0][2] - ysize*lar->mat[1][2]; + /* only for correction button size, matrix size works on energy */ + lar->areasize= lar->dist*lar->dist/(4.0*xsize*ysize); +} + +/* If lar takes more lamp data, the decoupling will be better. */ +static void add_render_lamp(Render *re, Object *ob, int actual_render) +{ + Lamp *la= ob->data; + LampRen *lar; + GroupObject *go; + float mat[4][4], hoek, xn, yn; + int c; + + /* prevent only shadow from rendering light, but only return on render, not preview */ + if(actual_render) { + if(la->mode & LA_ONLYSHADOW) + if((re->r.mode & R_SHADOW)==0) + return; + } + + go= MEM_callocN(sizeof(GroupObject), "groupobject"); + BLI_addtail(&re->lights, go); + re->totlamp++; + lar= (LampRen *)MEM_callocN(sizeof(LampRen),"lampren"); + go->lampren= lar; + go->ob= ob; + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); + + MTC_Mat3CpyMat4(lar->mat, mat); + MTC_Mat3CpyMat4(lar->imat, ob->imat); + + lar->bufsize = la->bufsize; + lar->samp = la->samp; + lar->soft = la->soft; + lar->shadhalostep = la->shadhalostep; + lar->clipsta = la->clipsta; + lar->clipend = la->clipend; + lar->bias = la->bias; + + lar->type= la->type; + lar->mode= la->mode; + + lar->energy= la->energy; + lar->energy= la->energy; + if(la->mode & LA_NEG) lar->energy= -lar->energy; + + lar->vec[0]= -mat[2][0]; + lar->vec[1]= -mat[2][1]; + lar->vec[2]= -mat[2][2]; + Normalise(lar->vec); + lar->co[0]= mat[3][0]; + lar->co[1]= mat[3][1]; + lar->co[2]= mat[3][2]; + lar->dist= la->dist; + lar->haint= la->haint; + lar->distkw= lar->dist*lar->dist; + lar->r= lar->energy*la->r; + lar->g= lar->energy*la->g; + lar->b= lar->energy*la->b; + lar->k= la->k; + + // area + lar->ray_samp= la->ray_samp; + lar->ray_sampy= la->ray_sampy; + lar->ray_sampz= la->ray_sampz; + + lar->area_size= la->area_size; + lar->area_sizey= la->area_sizey; + lar->area_sizez= la->area_sizez; + + lar->area_shape= la->area_shape; + lar->ray_samp_type= la->ray_samp_type; + + if(lar->type==LA_AREA) { + switch(lar->area_shape) { + case LA_AREA_SQUARE: + lar->ray_totsamp= lar->ray_samp*lar->ray_samp; + lar->ray_sampy= lar->ray_samp; + lar->area_sizey= lar->area_size; + break; + case LA_AREA_RECT: + lar->ray_totsamp= lar->ray_samp*lar->ray_sampy; + break; + case LA_AREA_CUBE: + lar->ray_totsamp= lar->ray_samp*lar->ray_samp*lar->ray_samp; + lar->ray_sampy= lar->ray_samp; + lar->ray_sampz= lar->ray_samp; + lar->area_sizey= lar->area_size; + lar->area_sizez= lar->area_size; + break; + case LA_AREA_BOX: + lar->ray_totsamp= lar->ray_samp*lar->ray_sampy*lar->ray_sampz; + break; + } + + area_lamp_vectors(lar); + } + else lar->ray_totsamp= 0; + + /* yafray: photonlight and other params */ + if (re->r.renderer==R_YAFRAY) { + lar->YF_numphotons = la->YF_numphotons; + lar->YF_numsearch = la->YF_numsearch; + lar->YF_phdepth = la->YF_phdepth; + lar->YF_useqmc = la->YF_useqmc; + lar->YF_causticblur = la->YF_causticblur; + lar->YF_ltradius = la->YF_ltradius; + lar->YF_bufsize = la->YF_bufsize; + lar->YF_glowint = la->YF_glowint; + lar->YF_glowofs = la->YF_glowofs; + lar->YF_glowtype = la->YF_glowtype; + } + + lar->spotsi= la->spotsize; + if(lar->mode & LA_HALO) { + if(lar->spotsi>170.0) lar->spotsi= 170.0; + } + lar->spotsi= cos( M_PI*lar->spotsi/360.0 ); + lar->spotbl= (1.0-lar->spotsi)*la->spotblend; + + memcpy(lar->mtex, la->mtex, MAX_MTEX*sizeof(void *)); + + lar->lay= ob->lay & 0xFFFFFF; // higher 8 bits are localview layers + + lar->ld1= la->att1; + lar->ld2= la->att2; + + if(lar->type==LA_SPOT) { + + Normalise(lar->imat[0]); + Normalise(lar->imat[1]); + Normalise(lar->imat[2]); + + xn= saacos(lar->spotsi); + xn= sin(xn)/cos(xn); + lar->spottexfac= 1.0/(xn); + + if(lar->mode & LA_ONLYSHADOW) { + if((lar->mode & (LA_SHAD|LA_SHAD_RAY))==0) lar->mode -= LA_ONLYSHADOW; + } + + } + + /* set flag for spothalo en initvars */ + if(la->type==LA_SPOT && (la->mode & LA_HALO)) { + if(la->haint>0.0) { + re->flag |= R_LAMPHALO; + + /* camera position (0,0,0) rotate around lamp */ + lar->sh_invcampos[0]= -lar->co[0]; + lar->sh_invcampos[1]= -lar->co[1]; + lar->sh_invcampos[2]= -lar->co[2]; + MTC_Mat3MulVecfl(lar->imat, lar->sh_invcampos); + + /* z factor, for a normalized volume */ + hoek= saacos(lar->spotsi); + xn= lar->spotsi; + yn= sin(hoek); + lar->sh_zfac= yn/xn; + /* pre-scale */ + lar->sh_invcampos[2]*= lar->sh_zfac; + + } + } + + for(c=0; cmtex[c] && la->mtex[c]->tex) { + lar->mode |= LA_TEXTURE; + + if(G.rendering) { + if(re->osa) { + if(la->mtex[c]->tex->type==TEX_IMAGE) lar->mode |= LA_OSATEX; + } + } + } + } + + /* yafray: shadowbuffers and jitter only needed for internal render */ + if (actual_render && re->r.renderer==R_INTERN) { + if(re->r.mode & R_SHADOW) { + if (la->type==LA_SPOT && (lar->mode & LA_SHAD) ) { + /* Per lamp, one shadow buffer is made. */ + Mat4CpyMat4(mat, ob->obmat); + initshadowbuf(re, lar, mat); // mat is altered + } + else if(la->type==LA_AREA && (lar->mode & LA_SHAD_RAY) ) { + init_jitter_plane(lar); + } + } + } + + /* yafray: shadow flag should not be cleared, only used with internal renderer */ + if (re->r.renderer==R_INTERN) { + /* to make sure we can check ray shadow easily in the render code */ + if(lar->mode & LA_SHAD_RAY) { + if( (re->r.mode & R_RAYTRACE)==0) + lar->mode &= ~LA_SHAD_RAY; + } + } +} + +/* ------------------------------------------------------------------------- */ +static void init_render_surf(Render *re, Object *ob) +{ + extern Material defmaterial; // initrender.c + Nurb *nu=0; + Curve *cu; + ListBase displist; + DispList *dl; + VertRen *ver, *v1, *v2, *v3, *v4; + VlakRen *vlr; + Material *matar[32]; + float *data, *orco=NULL, *orcobase=NULL, n1[3], flen, mat[4][4]; + int a, need_orco=0, startvlak, startvert, p1, p2, p3, p4; + int u, v; + int sizeu, sizev; + VlakRen *vlr1, *vlr2, *vlr3; + float vn[3]; // n2[3], + + cu= ob->data; + nu= cu->nurb.first; + if(nu==0) return; + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); + + /* material array */ + memset(matar, 0, 4*32); + matar[0]= &defmaterial; + for(a=0; atotcol; a++) { + matar[a]= give_render_material(re, ob, a+1); + if(matar[a] && matar[a]->texco & TEXCO_ORCO) { + need_orco= 1; + } + } + + if(ob->parent && (ob->parent->type==OB_LATTICE)) need_orco= 1; + + if(need_orco) orcobase= orco= get_object_orco(re, ob); + + displist.first= displist.last= 0; + makeDispListSurf(ob, &displist, 1); + + dl= displist.first; + /* walk along displaylist and create rendervertices/-faces */ + while(dl) { + /* watch out: u ^= y, v ^= x !! */ + if(dl->type==DL_SURF) { + int nsizeu, nsizev; + + startvert= re->totvert; + nsizeu = sizeu = dl->parts; nsizev = sizev = dl->nr; + + data= dl->verts; + for (u = 0; u < sizeu; u++) { + v1 = RE_findOrAddVert(re, re->totvert++); /* save this for possible V wrapping */ + VECCOPY(v1->co, data); data += 3; + if(orco) { + v1->orco= orco; orco+= 3; + } + MTC_Mat4MulVecfl(mat, v1->co); + + for (v = 1; v < sizev; v++) { + ver= RE_findOrAddVert(re, re->totvert++); + VECCOPY(ver->co, data); data += 3; + if(orco) { + ver->orco= orco; orco+= 3; + } + MTC_Mat4MulVecfl(mat, ver->co); + } + /* if V-cyclic, add extra vertices at end of the row */ + if (dl->flag & DL_CYCL_U) { + ver= RE_findOrAddVert(re, re->totvert++); + VECCOPY(ver->co, v1->co); + if(orco) { + ver->orco= orcobase + 3*(u*sizev + 0); + } + } + } + + /* Done before next loop to get corner vert */ + if (dl->flag & DL_CYCL_U) nsizev++; + if (dl->flag & DL_CYCL_V) nsizeu++; + + /* if U cyclic, add extra row at end of column */ + if (dl->flag & DL_CYCL_V) { + for (v = 0; v < nsizev; v++) { + v1= RE_findOrAddVert(re, startvert + v); + ver= RE_findOrAddVert(re, re->totvert++); + VECCOPY(ver->co, v1->co); + if(orco) { + ver->orco= orcobase + 3*(0*sizev + v); + } + } + } + + sizeu = nsizeu; + sizev = nsizev; + + startvlak= re->totvlak; + + for(u = 0; u < sizeu - 1; u++) { + p1 = startvert + u * sizev; /* walk through face list */ + p2 = p1 + 1; + p3 = p2 + sizev; + p4 = p3 - 1; + + for(v = 0; v < sizev - 1; v++) { + v1= RE_findOrAddVert(re, p1); + v2= RE_findOrAddVert(re, p2); + v3= RE_findOrAddVert(re, p3); + v4= RE_findOrAddVert(re, p4); + + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->ob= ob; + vlr->v1= v1; vlr->v2= v2; vlr->v3= v3; vlr->v4= v4; + + flen= CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, n1); + VECCOPY(vlr->n, n1); + + vlr->lay= ob->lay; + vlr->mat= matar[ dl->col]; + vlr->ec= ME_V1V2+ME_V2V3; + vlr->flag= dl->rt; + if( (cu->flag & CU_NOPUNOFLIP) ) { + vlr->flag |= R_NOPUNOFLIP; + } + + VecAddf(v1->n, v1->n, n1); + VecAddf(v2->n, v2->n, n1); + VecAddf(v3->n, v3->n, n1); + VecAddf(v4->n, v4->n, n1); + + p1++; p2++; p3++; p4++; + } + } + /* fix normals for U resp. V cyclic faces */ + sizeu--; sizev--; /* dec size for face array */ + if (dl->flag & DL_CYCL_V) { + + for (v = 0; v < sizev; v++) + { + /* optimize! :*/ + vlr= RE_findOrAddVlak(re, UVTOINDEX(sizeu - 1, v)); + vlr1= RE_findOrAddVlak(re, UVTOINDEX(0, v)); + VecAddf(vlr1->v1->n, vlr1->v1->n, vlr->n); + VecAddf(vlr1->v2->n, vlr1->v2->n, vlr->n); + VecAddf(vlr->v3->n, vlr->v3->n, vlr1->n); + VecAddf(vlr->v4->n, vlr->v4->n, vlr1->n); + } + } + if (dl->flag & DL_CYCL_U) { + + for (u = 0; u < sizeu; u++) + { + /* optimize! :*/ + vlr= RE_findOrAddVlak(re, UVTOINDEX(u, 0)); + vlr1= RE_findOrAddVlak(re, UVTOINDEX(u, sizev-1)); + VecAddf(vlr1->v2->n, vlr1->v2->n, vlr->n); + VecAddf(vlr1->v3->n, vlr1->v3->n, vlr->n); + VecAddf(vlr->v1->n, vlr->v1->n, vlr1->n); + VecAddf(vlr->v4->n, vlr->v4->n, vlr1->n); + } + } + /* last vertex is an extra case: + + ^ ()----()----()----() + | | | || | + u | |(0,n)||(0,0)| + | | || | + ()====()====[]====() + | | || | + | |(m,n)||(m,0)| + | | || | + ()----()----()----() + v -> + + vertex [] is no longer shared, therefore distribute + normals of the surrounding faces to all of the duplicates of [] + */ + + if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U)) + { + vlr= RE_findOrAddVlak(re, UVTOINDEX(sizeu - 1, sizev - 1)); /* (m,n) */ + vlr1= RE_findOrAddVlak(re, UVTOINDEX(0,0)); /* (0,0) */ + VecAddf(vn, vlr->n, vlr1->n); + vlr2= RE_findOrAddVlak(re, UVTOINDEX(0, sizev-1)); /* (0,n) */ + VecAddf(vn, vn, vlr2->n); + vlr3= RE_findOrAddVlak(re, UVTOINDEX(sizeu-1, 0)); /* (m,0) */ + VecAddf(vn, vn, vlr3->n); + VECCOPY(vlr->v3->n, vn); + VECCOPY(vlr1->v1->n, vn); + VECCOPY(vlr2->v2->n, vn); + VECCOPY(vlr3->v4->n, vn); + } + for(a = startvert; a < re->totvert; a++) { + ver= RE_findOrAddVert(re, a); + Normalise(ver->n); + } + + + } + + dl= dl->next; + } + freedisplist(&displist); +} + +static void init_render_curve(Render *re, Object *ob) +{ + extern Material defmaterial; // initrender.c + Curve *cu; + VertRen *ver; + VlakRen *vlr; + DispList *dl; + Material *matar[32]; + float len, *data, *fp, *orco=NULL; + float n[3], mat[4][4]; + int nr, startvert, startvlak, a, b; + int frontside, need_orco=0; + + cu= ob->data; + if(cu->nurb.first==NULL) return; + + /* no modifier call here, is in makedisp */ + + /* test displist */ + if(cu->disp.first==0) makeDispListCurveTypes(ob, 0); + dl= cu->disp.first; + if(cu->disp.first==0) return; + + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); + + /* material array */ + memset(matar, 0, 4*32); + matar[0]= &defmaterial; + for(a=0; atotcol; a++) { + matar[a]= give_render_material(re, ob, a+1); + if(matar[a]->texco & TEXCO_ORCO) { + need_orco= 1; + } + } + + if(need_orco) orco= get_object_orco(re, ob); + + dl= cu->disp.first; + while(dl) { + if(dl->type==DL_INDEX3) { + int *index; + + startvert= re->totvert; + data= dl->verts; + + n[0]= ob->imat[0][2]; + n[1]= ob->imat[1][2]; + n[2]= ob->imat[2][2]; + Normalise(n); + + /* copy first, rotate later for comparision trick */ + for(a=0; anr; a++, data+=3) { + ver= RE_findOrAddVert(re, re->totvert++); + VECCOPY(ver->co, data); + MTC_Mat4MulVecfl(mat, ver->co); + + if(ver->co[2] < 0.0) { + VECCOPY(ver->n, n); + ver->flag = 1; + } + else { + ver->n[0]= -n[0]; ver->n[1]= -n[1]; ver->n[2]= -n[2]; + ver->flag = 0; + } + + if (orco) { + ver->orco = orco; + orco += 3; + } + } + + startvlak= re->totvlak; + index= dl->index; + for(a=0; aparts; a++, index+=3) { + + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->ob = ob; + vlr->v1= RE_findOrAddVert(re, startvert+index[0]); + vlr->v2= RE_findOrAddVert(re, startvert+index[1]); + vlr->v3= RE_findOrAddVert(re, startvert+index[2]); + vlr->v4= NULL; + + if(vlr->v1->flag) { + VECCOPY(vlr->n, n); + } + else { + vlr->n[0]= -n[0]; vlr->n[1]= -n[1]; vlr->n[2]= -n[2]; + } + + vlr->mat= matar[ dl->col ]; + vlr->flag= 0; + if( (cu->flag & CU_NOPUNOFLIP) ) { + vlr->flag |= R_NOPUNOFLIP; + } + vlr->ec= 0; + vlr->lay= ob->lay; + } + } + else if (dl->type==DL_SURF) { + int p1,p2,p3,p4; + + fp= dl->verts; + startvert= re->totvert; + nr= dl->nr*dl->parts; + + while(nr--) { + ver= RE_findOrAddVert(re, re->totvert++); + + VECCOPY(ver->co, fp); + MTC_Mat4MulVecfl(mat, ver->co); + fp+= 3; + + if (orco) { + ver->orco = orco; + orco += 3; + } + } + + startvlak= re->totvlak; + + for(a=0; aparts; a++) { + + frontside= (a >= dl->nr/2); + + DL_SURFINDEX(dl->flag & DL_CYCL_U, dl->flag & DL_CYCL_V, dl->nr, dl->parts); + p1+= startvert; + p2+= startvert; + p3+= startvert; + p4+= startvert; + + for(; bnr; b++) { + vlr= RE_findOrAddVlak(re, re->totvlak++); + vlr->ob= ob; + vlr->v1= RE_findOrAddVert(re, p2); + vlr->v2= RE_findOrAddVert(re, p1); + vlr->v3= RE_findOrAddVert(re, p3); + vlr->v4= RE_findOrAddVert(re, p4); + vlr->ec= ME_V2V3+ME_V3V4; + if(a==0) vlr->ec+= ME_V1V2; + + vlr->flag= dl->rt; + vlr->lay= ob->lay; + + /* this is not really scientific: the vertices + * 2, 3 en 4 seem to give better vertexnormals than 1 2 3: + * front and backside treated different!! + */ + + if(frontside) + CalcNormFloat(vlr->v2->co, vlr->v3->co, vlr->v4->co, vlr->n); + else + CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->n); + + vlr->mat= matar[ dl->col ]; + + p4= p3; + p3++; + p2= p1; + p1++; + } + } + + if (dl->bevelSplitFlag) { + for(a=0; aparts-1+!!(dl->flag&DL_CYCL_V); a++) + if(dl->bevelSplitFlag[a>>5]&(1<<(a&0x1F))) + split_v_renderfaces(re, startvlak, startvert, dl->parts, dl->nr, a, dl->flag&DL_CYCL_V, dl->flag&DL_CYCL_U); + } + + /* vertex normals */ + for(a= startvlak; atotvlak; a++) { + vlr= RE_findOrAddVlak(re, a); + + VecAddf(vlr->v1->n, vlr->v1->n, vlr->n); + VecAddf(vlr->v3->n, vlr->v3->n, vlr->n); + VecAddf(vlr->v2->n, vlr->v2->n, vlr->n); + VecAddf(vlr->v4->n, vlr->v4->n, vlr->n); + } + for(a=startvert; atotvert; a++) { + ver= RE_findOrAddVert(re, a); + len= Normalise(ver->n); + if(len==0.0) ver->flag= 1; /* flag use, its only used in zbuf now */ + else ver->flag= 0; + } + for(a= startvlak; atotvlak; a++) { + vlr= RE_findOrAddVlak(re, a); + if(vlr->v1->flag) VECCOPY(vlr->v1->n, vlr->n); + if(vlr->v2->flag) VECCOPY(vlr->v2->n, vlr->n); + if(vlr->v3->flag) VECCOPY(vlr->v3->n, vlr->n); + if(vlr->v4->flag) VECCOPY(vlr->v4->n, vlr->n); + } + } + + dl= dl->next; + } +} + +/* prevent phong interpolation for giving ray shadow errors (terminator problem) */ +static void set_phong_threshold(Render *re, Object *ob, int startface, int numface, int startvert, int numvert ) +{ +// VertRen *ver; + VlakRen *vlr; + float thresh= 0.0, dot; + int tot=0, i; + + /* Added check for 'pointy' situations, only dotproducts of 0.9 and larger + are taken into account. This threshold is meant to work on smooth geometry, not + for extreme cases (ton) */ + + for(i=startface; iflag & R_SMOOTH) { + dot= INPR(vlr->n, vlr->v1->n); + dot= ABS(dot); + if(dot>0.9) { + thresh+= dot; tot++; + } + dot= INPR(vlr->n, vlr->v2->n); + dot= ABS(dot); + if(dot>0.9) { + thresh+= dot; tot++; + } + + dot= INPR(vlr->n, vlr->v3->n); + dot= ABS(dot); + if(dot>0.9) { + thresh+= dot; tot++; + } + + if(vlr->v4) { + dot= INPR(vlr->n, vlr->v4->n); + dot= ABS(dot); + if(dot>0.9) { + thresh+= dot; tot++; + } + } + } + } + + if(tot) { + thresh/= (float)tot; + ob->smoothresh= cos(0.5*M_PI-acos(thresh)); + } +} + +static void init_render_object(Render *re, Object *ob) +{ + float mat[4][4]; + int startface, startvert; + + startface=re->totvlak; + startvert=re->totvert; + + ob->flag |= OB_DONE; + + if(ob->type==OB_LAMP) + add_render_lamp(re, ob, 1); + else if ELEM(ob->type, OB_FONT, OB_CURVE) + init_render_curve(re, ob); + else if(ob->type==OB_SURF) + init_render_surf(re, ob); + else if(ob->type==OB_MESH) + init_render_mesh(re, ob); + else if(ob->type==OB_MBALL) + init_render_mball(re, ob); + else { + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); + } + + /* generic post process here */ + if(startvert!=re->totvert) { + + /* the exception below is because displace code now is in init_render_mesh call, + I will look at means to have autosmooth enabled for all object types + and have it as general postprocess, like displace */ + if (ob->type!=OB_MESH && test_for_displace(re, ob ) ) + do_displacement(re, ob, startface, re->totvlak-startface, startvert, re->totvert-startvert); + + /* phong normal interpolation can cause error in tracing (terminator prob) */ + ob->smoothresh= 0.0; + if( (re->r.mode & R_RAYTRACE) && (re->r.mode & R_SHADOW) ) + set_phong_threshold(re, ob, startface, re->totvlak-startface, startvert, re->totvert-startvert); + } +} + +void RE_Database_Free(Render *re) +{ + ShadBuf *shb; + Object *ob = NULL; + GroupObject *go; + unsigned long *ztile; + int b, v; + char *ctile; + + /* FREE */ + + if(re->memArena) { + BLI_memarena_free(re->memArena); + re->memArena = NULL; + } + + for(go= re->lights.first; go; go= go->next) { + struct LampRen *lar= go->lampren; + if(lar->shb) { + shb= lar->shb; + v= (shb->size*shb->size)/256; + ztile= shb->zbuf; + ctile= shb->cbuf; + for(b=0; bzbuf); + MEM_freeN(shb->cbuf); + MEM_freeN(lar->shb); + } + if(lar->jitter) MEM_freeN(lar->jitter); + MEM_freeN(lar); + } + + BLI_freelistN(&re->lights); + + free_renderdata_tables(re); + + /* free orco. check all objects because of duplis and sets */ + ob= G.main->object.first; + while(ob) { + if(ob->type==OB_MBALL) { + if(ob->disp.first && ob->disp.first!=ob->disp.last) { + DispList *dl= ob->disp.first; + BLI_remlink(&ob->disp, dl); + freedisplist(&ob->disp); + BLI_addtail(&ob->disp, dl); + } + } + ob= ob->id.next; + } + + free_mesh_orco_hash(re); + + end_radio_render(); + end_render_materials(); + + if(re->wrld.aosphere) { + MEM_freeN(re->wrld.aosphere); + re->wrld.aosphere= NULL; + re->scene->world->aosphere= NULL; + } + + if(re->r.mode & R_RAYTRACE) freeoctree(re); + + re->totvlak=re->totvert=re->totlamp=re->tothalo= 0; + re->i.convertdone= 0; + +} + +/* per face check if all samples should be taken. + if raytrace, do always for raytraced material, or when material full_osa set */ +static void set_fullsample_flag(Render *re) +{ + VlakRen *vlr; + int a, trace; + + trace= re->r.mode & R_RAYTRACE; + + for(a=re->totvlak-1; a>=0; a--) { + vlr= RE_findOrAddVlak(re, a); + + if(vlr->mat->mode & MA_FULL_OSA) vlr->flag |= R_FULL_OSA; + else if(trace) { + if(vlr->mat->mode & MA_SHLESS); + else if(vlr->mat->mode & (MA_RAYTRANSP|MA_RAYMIRROR|MA_SHADOW)) + vlr->flag |= R_FULL_OSA; + } + } +} + +/* 10 times larger than normal epsilon, test it on default nurbs sphere with ray_transp */ +#ifdef FLT_EPSILON +#undef FLT_EPSILON +#endif +#define FLT_EPSILON 1.19209290e-06F + + +static void check_non_flat_quads(Render *re) +{ + VlakRen *vlr, *vlr1; + VertRen *v1, *v2, *v3, *v4; + float nor[3], xn, flen; + int a; + + for(a=re->totvlak-1; a>=0; a--) { + vlr= RE_findOrAddVlak(re, a); + + /* test if rendering as a quad or triangle, skip wire */ + if(vlr->v4 && (vlr->flag & R_STRAND)==0 && (vlr->mat->mode & MA_WIRE)==0) { + + /* check if quad is actually triangle */ + v1= vlr->v1; + v2= vlr->v2; + v3= vlr->v3; + v4= vlr->v4; + VECSUB(nor, v1->co, v2->co); + if( ABS(nor[0])v1= v2; + vlr->v2= v3; + vlr->v3= v4; + vlr->v4= NULL; + } + else { + VECSUB(nor, v2->co, v3->co); + if( ABS(nor[0])v2= v3; + vlr->v3= v4; + vlr->v4= NULL; + } + else { + VECSUB(nor, v3->co, v4->co); + if( ABS(nor[0])v4= NULL; + } + else { + VECSUB(nor, v4->co, v1->co); + if( ABS(nor[0])v4= NULL; + } + } + } + } + + if(vlr->v4) { + + /* Face is divided along edge with the least gradient */ + /* Flagged with R_DIVIDE_24 if divide is from vert 2 to 4 */ + /* 4---3 4---3 */ + /* |\ 1| or |1 /| */ + /* |0\ | |/ 0| */ + /* 1---2 1---2 0 = orig face, 1 = new face */ + + /* render normals are inverted in render! we calculate normal of single tria here */ + flen= CalcNormFloat(vlr->v4->co, vlr->v3->co, vlr->v1->co, nor); + if(flen==0.0) CalcNormFloat(vlr->v4->co, vlr->v2->co, vlr->v1->co, nor); + + xn= nor[0]*vlr->n[0] + nor[1]*vlr->n[1] + nor[2]*vlr->n[2]; + if(ABS(xn) < 0.99995 ) { // checked on noisy fractal grid + float d1, d2; + + vlr1= RE_findOrAddVlak(re, re->totvlak++); + *vlr1= *vlr; + vlr1->flag |= R_FACE_SPLIT; + + /* split direction based on vnorms */ + CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, nor); + d1= nor[0]*vlr->v1->n[0] + nor[1]*vlr->v1->n[1] + nor[2]*vlr->v1->n[2]; + + CalcNormFloat(vlr->v2->co, vlr->v3->co, vlr->v4->co, nor); + d2= nor[0]*vlr->v2->n[0] + nor[1]*vlr->v2->n[1] + nor[2]*vlr->v2->n[2]; + + if( fabs(d1) < fabs(d2) ) vlr->flag |= R_DIVIDE_24; + else vlr->flag &= ~R_DIVIDE_24; + + /* new vertex pointers */ + if (vlr->flag & R_DIVIDE_24) { + vlr1->v1= vlr->v2; + vlr1->v2= vlr->v3; + vlr1->v3= vlr->v4; + + vlr->v3 = vlr->v4; + + vlr1->flag |= R_DIVIDE_24; + } + else { + vlr1->v1= vlr->v1; + vlr1->v2= vlr->v3; + vlr1->v3= vlr->v4; + + vlr1->flag &= ~R_DIVIDE_24; + } + vlr->v4 = vlr1->v4 = NULL; + + /* new normals */ + CalcNormFloat(vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); + CalcNormFloat(vlr1->v3->co, vlr1->v2->co, vlr1->v1->co, vlr1->n); + + /* so later UV can be pulled from original tface, look for R_DIVIDE_24 for direction */ + vlr1->tface=vlr->tface; + + } + /* clear the flag when not divided */ + else vlr->flag &= ~R_DIVIDE_24; + } + } + } +} + +static void set_material_lightgroups(Render *re) +{ + GroupObject *go, *gol; + Material *ma; + + /* it's a bit too many loops in loops... but will survive */ + for(ma= G.main->mat.first; ma; ma=ma->id.next) { + if(ma->group) { + for(go= ma->group->gobject.first; go; go= go->next) { + for(gol= re->lights.first; gol; gol= gol->next) { + if(gol->ob==go->ob) { + go->lampren= gol->lampren; + break; + } + } + } + } + } +} + +void init_render_world(Render *re) +{ + int a; + char *cp; + + if(re->scene && re->scene->world) { + re->wrld= *(re->scene->world); + + cp= (char *)&re->wrld.fastcol; + + cp[0]= 255.0*re->wrld.horr; + cp[1]= 255.0*re->wrld.horg; + cp[2]= 255.0*re->wrld.horb; + cp[3]= 1; + + VECCOPY(re->grvec, re->viewmat[2]); + Normalise(re->grvec); + Mat3CpyMat4(re->imat, re->viewinv); + + for(a=0; awrld.mtex[a] && re->wrld.mtex[a]->tex) re->wrld.skytype |= WO_SKYTEX; + + while(re->wrld.aosamp*re->wrld.aosamp < re->osa) re->wrld.aosamp++; + } + else { + memset(&re->wrld, 0, sizeof(World)); + re->wrld.exp= 0.0; + re->wrld.range= 1.0; + } + + re->wrld.linfac= 1.0 + pow((2.0*re->wrld.exp + 0.5), -10); + re->wrld.logfac= log( (re->wrld.linfac-1.0)/re->wrld.linfac )/re->wrld.range; +} + +/* used to be 'rotate scene' */ +void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) +{ + extern int slurph_opt; /* key.c */ + GroupObject *go; + Base *base; + Object *ob; + Scene *sce; + unsigned int lay; + float mat[4][4]; + + re->scene= scene; + + /* XXX add test if dbase was filled already? */ + + re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + re->totvlak=re->totvert=re->totlamp=re->tothalo= 0; + re->lights.first= re->lights.last= NULL; + + slurph_opt= 0; + + /* in localview, lamps are using normal layers, objects only local bits */ + if(re->scene->lay & 0xFF000000) lay= re->scene->lay & 0xFF000000; + else lay= re->scene->lay; + + /* applies changes fully */ + scene_update_for_newframe(re->scene, lay); + + /* if no camera, viewmat should have been set! */ + if(use_camera_view && re->scene->camera) { + Mat4Ortho(re->scene->camera->obmat); + Mat4Invert(mat, re->scene->camera->obmat); + RE_SetView(re, mat); + } + + init_render_world(re); /* do first, because of ambient. also requires re->osa set correct */ + if( (re->wrld.mode & WO_AMB_OCC) && (re->r.mode & R_RAYTRACE) ) { + re->wrld.aosphere= MEM_mallocN(2*3*re->wrld.aosamp*re->wrld.aosamp*sizeof(float), "AO sphere"); + /* we make twice the amount of samples, because only a hemisphere is used */ + init_ao_sphere(re->wrld.aosphere, 2*re->wrld.aosamp*re->wrld.aosamp, 16); + } + + /* still bad... doing all */ + init_render_textures(); + init_render_materials(re->osa, &re->wrld.ambr); + set_node_shader_lamp_loop(shade_material_loop); + + for(SETLOOPER(re->scene, base)) { + ob= base->object; + /* imat objects has to be done here, since displace can have texture using Object map-input */ + MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); + MTC_Mat4Invert(ob->imat, mat); + /* each object should only be rendered once */ + ob->flag &= ~OB_DONE; + } + + /* MAKE RENDER DATA */ + + for(SETLOOPER(re->scene, base)) { + ob= base->object; + + if( (base->lay & lay) || (ob->type==OB_LAMP && (base->lay & re->scene->lay)) ) { + if(ob->transflag & OB_DUPLI) { + + /* exception: mballs! */ + /* yafray: Include at least one copy of a dupliframe object for yafray in the renderlist. + mballs comment above true as well for yafray, they are not included, only all other object types */ + if (re->r.renderer==R_YAFRAY) { + if ((ob->type!=OB_MBALL) && ((ob->transflag & OB_DUPLIFRAMES)!=0)) { + printf("Object %s has OB_DUPLIFRAMES set, adding to renderlist\n", ob->id.name); + init_render_object(re, ob); + } + } + /* before make duplis, update particle for current frame */ + if(ob->transflag & OB_DUPLIVERTS) { + PartEff *paf= give_parteff(ob); + if(paf) { + if(paf->flag & PAF_ANIMATED) build_particle_system(ob); + } + } + + if(ob->type==OB_MBALL) { + init_render_object(re, ob); + } + else { + DupliObject *dob; + ListBase *lb= object_duplilist(sce, ob); + + for(dob= lb->first; dob; dob= dob->next) { + Object *obd= dob->ob; + Mat4CpyMat4(obd->obmat, dob->mat); + + if(obd->type!=OB_MBALL) { + /* yafray: special handling of duplivert objects for yafray: + only the matrix is stored, together with the source object name. + Since the original object is needed as well, it is included in the renderlist (see above) + NOT done for lamps, these need to be included as normal lamps separately + correction: also ignore lattices, armatures and cameras (....) */ + if ((obd->type!=OB_LATTICE) && (obd->type!=OB_ARMATURE) && + (obd->type!=OB_LAMP) && (obd->type!=OB_CAMERA) && (re->r.renderer==R_YAFRAY)) + { + printf("Adding dupli matrix for object %s\n", obd->id.name); + YAF_addDupliMtx(obd); + } + else init_render_object(re, obd); + } + Mat4CpyMat4(obd->obmat, dob->omat); + } + BLI_freelistN(lb); + } + } + else { + /* yafray: if there are linked data objects (except lamps, empties or armatures), + yafray only needs to know about one, the rest can be instanciated. + The dupliMtx list is used for this purpose. + Exception: objects which have object linked materials, these cannot be instanciated. */ + if ((re->r.renderer==R_YAFRAY) && (ob->colbits==0)) + { + /* Special case, parent object dupli's: ignore if object itself is lamp or parent is lattice or empty */ + if (ob->parent) { + if ((ob->type!=OB_LAMP) && (ob->parent->type!=OB_EMPTY) && + (ob->parent->type!=OB_LATTICE) && YAF_objectKnownData(ob)) + printf("From parent: Added dupli matrix for linked data object %s\n", ob->id.name); + else + init_render_object(re, ob); + } + else if ((ob->type!=OB_EMPTY) && (ob->type!=OB_LAMP) && (ob->type!=OB_ARMATURE) && YAF_objectKnownData(ob)) + printf("Added dupli matrix for linked data object %s\n", ob->id.name); + else + init_render_object(re, ob); + } + else init_render_object(re, ob); + } + + } + + if(re->test_break()) break; + } + + + if(!re->test_break()) { + sort_halos(re); + + set_material_lightgroups(re); + + slurph_opt= 1; + + /* for now some clumsy copying still */ + re->i.totvert= re->totvert; + re->i.totface= re->totvlak; + re->i.tothalo= re->tothalo; + re->i.totlamp= re->totlamp; + re->stats_draw(&re->i); + + set_fullsample_flag(re); + check_non_flat_quads(re); + set_normalflags(re); + + /* SHADOW BUFFER */ + for(go=re->lights.first; go; go= go->next) { + LampRen *lar= go->lampren; + + if(re->test_break()) break; + if(lar->shb) { + makeshadowbuf(re, lar); + } + } + + /* yafray: 'direct' radiosity, environment maps and octree init not needed for yafray render */ + /* although radio mode could be useful at some point, later */ + if (re->r.renderer==R_INTERN) { + /* RADIO (uses no R anymore) */ + if(!re->test_break()) + if(re->r.mode & R_RADIO) do_radio_render(re); + + /* octree */ + if(!re->test_break()) + if(re->r.mode & R_RAYTRACE) makeoctree(re); + + /* ENVIRONMENT MAPS */ + if(!re->test_break()) + make_envmaps(re); + } + + if(!re->test_break()) + project_renderdata(re, projectverto, re->r.mode & R_PANORAMA, 0); + } + + if(re->test_break()) + RE_Database_Free(re); + else + re->i.convertdone= 1; + +} + +/* exported call to recalculate hoco for vertices, when winmat changed */ +void RE_DataBase_ApplyWindow(Render *re) +{ + project_renderdata(re, projectverto, 0, 0); +} + +/* **************************************************************** */ +/* Displacement mapping */ +/* **************************************************************** */ +static short test_for_displace(Render *re, Object *ob) +{ + /* return 1 when this object uses displacement textures. */ + Material *ma; + int i; + + for (i=1; i<=ob->totcol; i++) { + ma=give_render_material(re, ob, i); + /* ma->mapto is ORed total of all mapto channels */ + if(ma && (ma->mapto & MAP_DISPLACE)) return 1; + } + return 0; +} + +static void displace_render_vert(Render *re, ShadeInput *shi, VertRen *vr, float *scale) +{ + short texco= shi->mat->texco; + float sample=0; + /* shi->co is current render coord, just make sure at least some vector is here */ + VECCOPY(shi->co, vr->co); + /* vertex normal is used for textures type 'col' and 'var' */ + VECCOPY(shi->vn, vr->n); + + /* set all rendercoords, 'texco' is an ORed value for all textures needed */ + if ((texco & TEXCO_ORCO) && (vr->orco)) { + VECCOPY(shi->lo, vr->orco); + } + if (texco & TEXCO_STICKY) { + float *sticky= RE_vertren_get_sticky(re, vr, 0); + if(sticky) { + shi->sticky[0]= sticky[0]; + shi->sticky[1]= sticky[1]; + shi->sticky[2]= 0.0f; + } + } + if (texco & TEXCO_GLOB) { + VECCOPY(shi->gl, shi->co); + MTC_Mat4MulVecfl(re->viewinv, shi->gl); + } + if (texco & TEXCO_NORM) { + VECCOPY(shi->orn, shi->vn); + } + if(texco & TEXCO_REFL) { + /* not (yet?) */ + } + + shi->displace[0]= shi->displace[1]= shi->displace[2]= 0.0; + + do_material_tex(shi); + + //printf("no=%f, %f, %f\nbefore co=%f, %f, %f\n", vr->n[0], vr->n[1], vr->n[2], + //vr->co[0], vr->co[1], vr->co[2]); + + /* 0.5 could become button once? */ + vr->co[0] += shi->displace[0] * scale[0] ; + vr->co[1] += shi->displace[1] * scale[1] ; + vr->co[2] += shi->displace[2] * scale[2] ; + + //printf("after co=%f, %f, %f\n", vr->co[0], vr->co[1], vr->co[2]); + + /* we just don't do this vertex again, bad luck for other face using same vertex with + different material... */ + vr->flag |= 1; + + /* Pass sample back so displace_face can decide which way to split the quad */ + sample = shi->displace[0]*shi->displace[0]; + sample += shi->displace[1]*shi->displace[1]; + sample += shi->displace[2]*shi->displace[2]; + + vr->accum=sample; + /* Should be sqrt(sample), but I'm only looking for "bigger". Save the cycles. */ + return; +} + +static void displace_render_face(Render *re, VlakRen *vlr, float *scale) +{ + ShadeInput shi; + // VertRen vr; + // float samp1,samp2, samp3, samp4, xn; + short hasuv=0; + /* set up shadeinput struct for multitex() */ + + shi.osatex= 0; /* signal not to use dx[] and dy[] texture AA vectors */ + shi.vlr= vlr; /* current render face */ + shi.mat= vlr->mat; /* current input material */ + + + /* UV coords must come from face */ + hasuv = vlr->tface && (shi.mat->texco & TEXCO_UV); + if (hasuv) shi.uv[2]=0.0f; + /* I don't think this is used, but seting it just in case */ + + /* Displace the verts, flag is set when done */ + if (! (vlr->v1->flag)){ + if (hasuv) { + shi.uv[0] = 2*vlr->tface->uv[0][0]-1.0f; /* shi.uv and tface->uv are */ + shi.uv[1]= 2*vlr->tface->uv[0][1]-1.0f; /* scalled differently */ + } + displace_render_vert(re, &shi, vlr->v1, scale); + } + + if (! (vlr->v2->flag)) { + if (hasuv) { + shi.uv[0] = 2*vlr->tface->uv[1][0]-1.0f; + shi.uv[1]= 2*vlr->tface->uv[1][1]-1.0f; + } + displace_render_vert(re, &shi, vlr->v2, scale); + } + + if (! (vlr->v3->flag)) { + if (hasuv) { + shi.uv[0] = 2*vlr->tface->uv[2][0]-1.0f; + shi.uv[1]= 2*vlr->tface->uv[2][1]-1.0f; + } + displace_render_vert(re, &shi, vlr->v3, scale); + } + + if (vlr->v4) { + if (! (vlr->v4->flag)) { + if (hasuv) { + shi.uv[0] = 2*vlr->tface->uv[3][0]-1.0f; + shi.uv[1]= 2*vlr->tface->uv[3][1]-1.0f; + } + displace_render_vert(re, &shi, vlr->v4, scale); + } + /* We want to split the quad along the opposite verts that are */ + /* closest in displace value. This will help smooth edges. */ + if ( fabs(vlr->v1->accum - vlr->v3->accum) > fabs(vlr->v2->accum - vlr->v4->accum)) + vlr->flag |= R_DIVIDE_24; + else vlr->flag &= ~R_DIVIDE_24; // E: typo?, was missing '=' + } + + /* Recalculate the face normal - if flipped before, flip now */ + if(vlr->v4) { + CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); + } + else { + CalcNormFloat(vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); + } + +} + + +static void do_displacement(Render *re, Object *ob, int startface, int numface, int startvert, int numvert ) +{ + VertRen *vr; + VlakRen *vlr; +// float min[3]={1e30, 1e30, 1e30}, max[3]={-1e30, -1e30, -1e30}; + float scale[3]={1.0f, 1.0f, 1.0f}, temp[3];//, xn + int i; //, texflag=0; + Object *obt; + + /* Object Size with parenting */ + obt=ob; + while(obt){ + VecAddf(temp, obt->size, obt->dsize); + scale[0]*=temp[0]; scale[1]*=temp[1]; scale[2]*=temp[2]; + obt=obt->parent; + } + + /* Clear all flags */ + for(i=startvert; iflag= 0; + } + + for(i=startface; i /* INT_MIN,MAX are used here */ #include +#include "DNA_material_types.h" + #include "MEM_guardedalloc.h" #include "MTC_vectorops.h" #include "BKE_utildefines.h" +#include "BLI_jitter.h" -#include "RE_callbacks.h" +#include "render_types.h" +#include "renderpipeline.h" #include "edgeRender.h" -#include "render.h" #include "zbuf.h" /* for zbufclipwire and zbufclip */ -#include "jitter.h" - -#ifdef RE_EDGERENDERSAFE -char edgeRender_h[] = EDGERENDER_H; -char edgeRender_c[] = "$Id$"; -#include "errorHandler.h" -#endif -/* ------------------------------------------------------------------------- */ - /* These function pointers are used for z buffer filling. */ -extern float Zmulx, Zmuly; /* Some kind of scale? */ -extern float Zjitx,Zjity; /* The x,y values for jitter offset */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* ------------------------------------------------------------------------- */ /* exp: */ static Material** matBuffer; /* buffer with material indices */ @@ -111,64 +104,59 @@ static char edgeB; /** * Initialise the edge render buffer memory. */ -void initEdgeRenderBuffer(void); +static void initEdgeRenderBuffer(void); /** * Release buffer memory. */ -void freeEdgeRenderBuffer(void); +static void freeEdgeRenderBuffer(void); /** * Set all distances in the distance buffer to the maximum distance. */ -void resetDistanceBuffer(void); +static void resetDistanceBuffer(void); /** * Insert this distance at these pixel coordinates. */ -void insertInEdgeBuffer(int x, int y, int dist); +static void insertInEdgeBuffer(int x, int y, int dist); /** * Renders enhanced edges. Distances from distRect are used to * determine a correction on colourRect */ -void renderEdges(char * colourRect); +static void renderEdges(char * colourRect); /** * Buffer an edge between these two vertices in the e.r. distance buffer. */ -static void fillEdgeRenderEdge(int, float *vec1, float *vec2); +static void fillEdgeRenderEdge(ZSpan *zspan, int, float *vec1, float *vec2); /** * Buffer a face between these two vertices in the e.r. distance buffer. */ -static void fillEdgeRenderFace(struct ZSpan *zspan, int, float *v1, float *v2, float *v3); +static void fillEdgeRenderFace(struct ZSpan *zspan, int, float *v1, float *v2, float *v3, float *v4); /** * Compose the edge render colour buffer. */ -void calcEdgeRenderColBuf(char * tarbuf); +static void calcEdgeRenderColBuf(char * tarbuf); /** * Loop over all objects that need to be edge rendered. This loop determines * which objects get to be elected for edge rendering. */ -int zBufferEdgeRenderObjects(void); +static int zBufferEdgeRenderObjects(void); /** * Add edge pixels to the original image. It blends over . */ -void addEdgeOver(unsigned char *dst, unsigned char *src); +static void addEdgeOver(unsigned char *dst, unsigned char *src); /* ------------------------------------------------------------------------- */ -void addEdges( - char * targetbuf, - int iw, int ih, - int osanr, - short int intens, short int intens_redux, - int compat, int mode, - float r, float g, float b - ) +/* this is main call! */ +void addEdges(char * targetbuf, int iw, int ih, int osanr, + short int intens, short int intens_redux, int compat, int mode, float r, float g, float b) { float rf, gf ,bf; /* render parameters */ @@ -178,6 +166,10 @@ void addEdges( compatible_mode = compat; osaCount = osanr; intensity = intens; + + printf("Unsuported code!\n"); + return; + /* Reduction doesn't exceed intensity. */ same_mat_redux = ((intens_redux < intensity)? intens_redux : intensity); @@ -197,7 +189,7 @@ void addEdges( /* ------------------------------------------------------------------------- */ -void initEdgeRenderBuffer() +static void initEdgeRenderBuffer() { char *ptr; int i; @@ -230,16 +222,10 @@ void initEdgeRenderBuffer() } } -#ifdef RE_EDGERENDERSAFE - if (!edgeBuffer || !colBuffer) { - char *fname = "initEdgeRenderBuffer"; - RE_error(RE_CANNOT_ALLOCATE_MEMORY, fname); - } -#endif } /* end of void initEdgeRenderBuffer(void) */ /* ------------------------------------------------------------------------- */ -void freeEdgeRenderBuffer(void) +static void freeEdgeRenderBuffer(void) { if(edgeBuffer) MEM_freeN(edgeBuffer); edgeBuffer= NULL; @@ -251,7 +237,7 @@ void freeEdgeRenderBuffer(void) /* ------------------------------------------------------------------------- */ -void resetDistanceBuffer(void) +static void resetDistanceBuffer(void) { int i; for(i = 0; i < bufWidth * bufHeight; i++) edgeBuffer[i] = 0x7FFFFFFF; @@ -259,17 +245,9 @@ void resetDistanceBuffer(void) /* ------------------------------------------------------------------------- */ -void insertInEdgeBuffer(int x, int y, int dist) +static void insertInEdgeBuffer(int x, int y, int dist) { int index; -#ifdef RE_EDGERENDERSAFE - char *fname = "insertInEdgeBuffer"; - if ((x < 0) || (x > imWidth ) || - (y < 0) || (y > (imHeight-1) ) ) { - RE_error(RE_EDGERENDER_WRITE_OUTSIDE_BUFFER, fname); - return; - } -#endif /* +1? */ index = (y * bufWidth) + x + maskBorder; @@ -286,7 +264,7 @@ void insertInEdgeBuffer(int x, int y, int dist) /* ------------------------------------------------------------------------- */ /* Modelled after rendercore.c/edge_enhance() */ -void renderEdges(char *colourRect) +static void renderEdges(char *colourRect) { /* use zbuffer to define edges, add it to the image */ int val, y, x, col, *rz, *rz1, *rz2, *rz3; @@ -496,7 +474,7 @@ void renderEdges(char *colourRect) /* ------------------------------------------------------------------------- */ /* adds src to dst */ -void addEdgeOver(unsigned char *dst, unsigned char *src) +static void addEdgeOver(unsigned char *dst, unsigned char *src) { unsigned char inverse; unsigned char alpha; @@ -534,20 +512,15 @@ void addEdgeOver(unsigned char *dst, unsigned char *src) dst[2] = c; } -void calcEdgeRenderColBuf(char* colTargetBuffer) +static void calcEdgeRenderColBuf(char* colTargetBuffer) { - int keepLooping = 1; int sample; /* zbuffer fix: here? */ - Zmulx= ((float) imWidth)/2.0; - Zmuly= ((float) imHeight)/2.0; +// Zmulx= ((float) imWidth)/2.0; +// Zmuly= ((float) imHeight)/2.0; - /* use these buffer fill functions */ - zbuffunc = fillEdgeRenderFace; - zbuflinefunc = fillEdgeRenderEdge; - /* always buffer the max. extent */ Aminy = 0; Amaxy = imHeight; @@ -555,8 +528,8 @@ void calcEdgeRenderColBuf(char* colTargetBuffer) sample = 0; /* Zsample is used internally ! */ while ( (sample < osaCount) && keepLooping ) { /* jitter */ - Zjitx= -jit[sample][0]; - Zjity= -jit[sample][1]; +// Zjitx= -R.jit[sample][0]; +// Zjity= -R.jit[sample][1]; /* should reset dis buffer here */ resetDistanceBuffer(); @@ -567,7 +540,7 @@ void calcEdgeRenderColBuf(char* colTargetBuffer) /* do filtering */ renderEdges(colTargetBuffer); - if(RE_local_test_break()) keepLooping = 0; + if(R.test_break()) keepLooping = 0; sample++; } @@ -589,13 +562,28 @@ void calcEdgeRenderColBuf(char* colTargetBuffer) /* ------------------------------------------------------------------------- */ /* Clip flags etc. should still be set. When called in the span of 'normal' */ /* rendering, this should be ok. */ -int zBufferEdgeRenderObjects(void) +static int zBufferEdgeRenderObjects(void) { + ZSpan zspan; VlakRen *vlr= NULL; + Material *ma; unsigned int zvlnr; int keepLooping; int faceCounter; /* counter for face number */ - Material *ma; + + zbuf_alloc_span(&zspan, imWidth, imHeight); + + /* needed for transform from hoco to zbuffer co */ + zspan.zmulx= ((float)imWidth)/2.0; + zspan.zmuly= ((float)imHeight)/2.0; + zspan.zofsx= -0.5f; + zspan.zofsy= -0.5f; + + /* the buffers ??? */ + + /* filling methods */ + zspan.zbuffunc = fillEdgeRenderFace; + zspan.zbuflinefunc = fillEdgeRenderEdge; keepLooping = 1; ma = NULL; @@ -618,19 +606,19 @@ int zBufferEdgeRenderObjects(void) /* here we cull all transparent faces if mode == 0 */ if (selectmode || !(ma->mode & MA_ZTRA)) { /* here we can add all kinds of extra selection criteria */ - if(ma->mode & (MA_WIRE)) zbufclipwire(zvlnr, vlr); + if(ma->mode & (MA_WIRE)) zbufclipwire(&zspan, zvlnr, vlr); else { - zbufclip(NULL, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, + zbufclip(&zspan, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip); if(vlr->v4) { zvlnr+= 0x800000; /* in a sense, the 'adjoint' face */ - zbufclip(NULL, zvlnr, vlr->v1->ho, vlr->v3->ho, vlr->v4->ho, + zbufclip(&zspan, zvlnr, vlr->v1->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v3->clip, vlr->v4->clip); } } } }; - if(RE_local_test_break()) keepLooping = 0; + if(R.test_break()) keepLooping = 0; faceCounter++; } return keepLooping; @@ -638,7 +626,7 @@ int zBufferEdgeRenderObjects(void) /* ------------------------------------------------------------------------- */ -static void fillEdgeRenderFace(struct ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3) +static void fillEdgeRenderFace(struct ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3, float *v4) { /* Coordinates of the vertices are specified in ZCS */ double z0; /* used as temp var*/ @@ -846,7 +834,7 @@ static void fillEdgeRenderFace(struct ZSpan *zspan, int zvlnr, float *v1, float /* ------------------------------------------------------------------------- */ -static void fillEdgeRenderEdge(int zvlnr, float *vec1, float *vec2) +static void fillEdgeRenderEdge(ZSpan *zspan, int zvlnr, float *vec1, float *vec2) { int start, end, x, y, oldx, oldy, ofs; int dz, vergz/* , mask */; diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 7c962ff1328..d38ff7d2d38 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -1,15 +1,12 @@ - -/* envmap.c RENDER +/* + * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,15 +20,9 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. + * Contributors: 2004/2005/2006 Blender Foundation, full recode * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - * may 1999 - * - * $Id$ + * ***** END GPL LICENSE BLOCK ***** */ #include @@ -55,8 +46,8 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_global.h" -#include "BKE_world.h" // init_render_world #include "BKE_image.h" // BKE_write_ibuf +#include "BKE_texture.h" #include "MTC_matrixops.h" @@ -65,79 +56,16 @@ #define main main /* stupid SDL_main redefines main as SDL_main */ /* this module */ -#include "RE_callbacks.h" -#include "render.h" +#include "render_types.h" +#include "renderpipeline.h" #include "envmap.h" -#include "mydevice.h" #include "rendercore.h" -#include "renderHelp.h" +#include "renderdatabase.h" #include "texture.h" #include "zbuf.h" +#include "initrender.h" -/* ------------------------------------------------------------------------- */ - -EnvMap *RE_add_envmap(void) -{ - EnvMap *env; - - env= MEM_callocN(sizeof(EnvMap), "envmap"); - env->type= ENV_CUBE; - env->stype= ENV_STATIC; - env->clipsta= 0.1; - env->clipend= 100.0; - env->cuberes= 100; - - return env; -} /* end of EnvMap *RE_add_envmap() */ - -/* ------------------------------------------------------------------------- */ - -EnvMap *RE_copy_envmap(EnvMap *env) -{ - EnvMap *envn; - int a; - - envn= MEM_dupallocN(env); - envn->ok= 0; - for(a=0; a<6; a++) envn->cube[a]= 0; - if(envn->ima) id_us_plus((ID *)envn->ima); - - return envn; -} - -/* ------------------------------------------------------------------------- */ - -void RE_free_envmapdata(EnvMap *env) -{ - Image *ima; - unsigned int a, part; - - for(part=0; part<6; part++) { - ima= env->cube[part]; - if(ima) { - if(ima->ibuf) IMB_freeImBuf(ima->ibuf); - - for(a=0; amipmap); a++) { - if(ima->mipmap[a]) IMB_freeImBuf(ima->mipmap[a]); - } - MEM_freeN(ima); - env->cube[part]= 0; - } - } - env->ok= 0; -} - -/* ------------------------------------------------------------------------- */ - -void RE_free_envmap(EnvMap *env) -{ - - RE_free_envmapdata(env); - MEM_freeN(env); - -} - /* ------------------------------------------------------------------------- */ static void envmap_split_ima(EnvMap *env) @@ -147,7 +75,7 @@ static void envmap_split_ima(EnvMap *env) /* extern rectcpy(); */ int dx, part; - RE_free_envmapdata(env); + BKE_free_envmapdata(env); dx= env->ima->ibuf->y; dx/= 2; @@ -183,52 +111,76 @@ static void envmap_split_ima(EnvMap *env) /* ------------------------------------------------------------------------- */ /* ****************** RENDER ********************** */ -static void envmap_renderdata(EnvMap *env) +/* copy current render */ +static Render *envmap_render_copy(Render *re, EnvMap *env) { - extern void init_filt_mask(void); - static RE_Render envR; - static Object *camera; + Render *envre; int cuberes; - if(env) { - envR= R; - camera= G.scene->camera; - - cuberes = (env->cuberes * R.r.size) / 100; - cuberes &= 0xFFFC; - env->lastsize= R.r.size; - R.rectx= R.r.xsch= R.recty= R.r.ysch= cuberes; - R.afmx= R.afmy= R.r.xsch/2; - R.xstart= R.ystart= -R.afmx; - R.xend= R.yend= R.xstart+R.rectx-1; - - R.r.mode &= ~(R_BORDER | R_PANORAMA | R_ORTHO | R_MBLUR); - R.r.filtertype= 0; - R.r.xparts= R.r.yparts= 1; - R.r.bufflag= 0; - R.r.size= 100; - R.ycor= 1.0; - R.r.yasp= R.r.xasp= 1; - - R.near= env->clipsta; - R.far= env->clipend; - - G.scene->camera= env->object; - - } - else { - /* this to make sure init_renderdisplay works */ - envR.winx= R.winx; - envR.winy= R.winy; - envR.winxof= R.winxof; - envR.winyof= R.winyof; - - R= envR; - G.scene->camera= camera; - } - - /* gauss, gamma, etc */ - init_filt_mask(); + envre= RE_NewRender("Envmap"); + + env->lastsize= re->r.size; + cuberes = (env->cuberes * re->r.size) / 100; + cuberes &= 0xFFFC; + + /* set up renderdata */ + envre->r= re->r; + envre->r.mode &= ~(R_BORDER | R_PANORAMA | R_ORTHO | R_MBLUR); + envre->r.filtertype= 0; + envre->r.xparts= envre->r.yparts= 1; + envre->r.bufflag= 0; + envre->r.size= 100; + envre->r.yasp= envre->r.xasp= 1; + + RE_InitState(envre, &re->r, cuberes, cuberes, NULL); + envre->scene= re->scene; /* unsure about this... */ + + /* view stuff in env render */ + envre->ycor= 1.0; + envre->clipsta= env->clipsta; /* render_scene_set_window() respects this for now */ + envre->clipend= env->clipend; + + RE_SetCamera(envre, env->object); + + /* callbacks */ + envre->display_draw= re->display_draw; + envre->test_break= re->test_break; + + /* and for the evil stuff; copy the database... */ + envre->totvlak= re->totvlak; + envre->totvert= re->totvert; + envre->tothalo= re->tothalo; + envre->totlamp= re->totlamp; + envre->lights= re->lights; + envre->vertnodeslen= re->vertnodeslen; + envre->vertnodes= re->vertnodes; + envre->blohalen= re->blohalen; + envre->bloha= re->bloha; + envre->blovllen= re->blovllen; + envre->blovl= re->blovl; + envre->oc= re->oc; + + return envre; +} + +static void envmap_free_render_copy(Render *envre) +{ + + envre->totvlak= 0; + envre->totvert= 0; + envre->tothalo= 0; + envre->totlamp= 0; + envre->lights.first= envre->lights.last= NULL; + envre->vertnodeslen= 0; + envre->vertnodes= NULL; + envre->blohalen= 0; + envre->bloha= NULL; + envre->blovllen= 0; + envre->blovl= NULL; + envre->oc.adrbranch= NULL; + envre->oc.adrnode= NULL; + + RE_FreeRender(envre); } /* ------------------------------------------------------------------------- */ @@ -265,7 +217,7 @@ static void envmap_transmatrix(float mat[][4], int part) /* ------------------------------------------------------------------------- */ -static void env_rotate_scene(float mat[][4], int mode) +static void env_rotate_scene(Render *re, float mat[][4], int mode) { GroupObject *go; VlakRen *vlr = NULL; @@ -284,8 +236,8 @@ static void env_rotate_scene(float mat[][4], int mode) MTC_Mat3CpyMat4(imat, mat); } - for(a=0; atotvert; a++) { + if((a & 255)==0) ver= RE_findOrAddVert(re, a); else ver++; MTC_Mat4MulVecfl(tmat, ver->co); @@ -300,15 +252,15 @@ static void env_rotate_scene(float mat[][4], int mode) Normalise(ver->n); } - for(a=0; a>8]; + for(a=0; atothalo; a++) { + if((a & 255)==0) har= re->bloha[a>>8]; else har++; MTC_Mat4MulVecfl(tmat, har->co); } - for(a=0; a>8]; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; xn= vlr->n[0]; @@ -321,9 +273,9 @@ static void env_rotate_scene(float mat[][4], int mode) Normalise(vlr->n); } - set_normalflags(); + set_normalflags(re); - for(go=R.lights.first; go; go= go->next) { + for(go=re->lights.first; go; go= go->next) { lar= go->lampren; /* removed here some horrible code of someone in NaN who tried to fix @@ -355,25 +307,25 @@ static void env_rotate_scene(float mat[][4], int mode) /* ------------------------------------------------------------------------- */ -static void env_layerflags(unsigned int notlay) +static void env_layerflags(Render *re, unsigned int notlay) { VlakRen *vlr = NULL; int a; - for(a=0; a>8]; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->lay & notlay) vlr->flag &= ~R_VISIBLE; } } -static void env_hideobject(Object *ob) +static void env_hideobject(Render *re, Object *ob) { VlakRen *vlr = NULL; int a; - for(a=0; a>8]; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->ob == ob) vlr->flag &= ~R_VISIBLE; } @@ -381,14 +333,14 @@ static void env_hideobject(Object *ob) /* ------------------------------------------------------------------------- */ -static void env_set_imats() +static void env_set_imats(Render *re) { Base *base; float mat[4][4]; base= G.scene->base.first; while(base) { - MTC_Mat4MulMat4(mat, base->object->obmat, R.viewmat); + MTC_Mat4MulMat4(mat, base->object->obmat, re->viewmat); MTC_Mat4Invert(base->object->imat, mat); base= base->next; @@ -398,118 +350,97 @@ static void env_set_imats() /* ------------------------------------------------------------------------- */ -static void render_envmap(EnvMap *env) +static void render_envmap(Render *re, EnvMap *env) { /* only the cubemap is implemented */ + Render *envre; ImBuf *ibuf; Image *ima; float oldviewinv[4][4], mat[4][4], tmat[4][4]; short part; /* need a recalc: ortho-render has no correct viewinv */ - MTC_Mat4Invert(oldviewinv, R.viewmat); + MTC_Mat4Invert(oldviewinv, re->viewmat); - /* do first, envmap_renderdata copies entire R struct */ - if(R.rectz) MEM_freeN(R.rectz); - if(R.rectot) MEM_freeN(R.rectot); - if(R.rectftot) MEM_freeN(R.rectftot); - R.rectftot= NULL; - R.rectz= NULL; - R.rectot= NULL; - - /* setup necessary globals */ - envmap_renderdata(env); + envre= envmap_render_copy(re, env); - RE_local_init_render_display(); - - R.rectot= MEM_mallocN(sizeof(int)*R.rectx*R.recty, "rectot"); - R.rectz= MEM_mallocN(sizeof(int)*R.rectx*R.recty, "rectz"); +// re->display_init(envre->result); for(part=0; part<6; part++) { - RE_local_clear_render_display(R.win); - fillrect(R.rectot, R.rectx, R.recty, 0); - - RE_setwindowclip(1,-1); /* no jit:(-1) */ + re->display_clear(envre->result); - MTC_Mat4CpyMat4(tmat, G.scene->camera->obmat); + MTC_Mat4CpyMat4(tmat, env->object->obmat); MTC_Mat4Ortho(tmat); envmap_transmatrix(tmat, part); MTC_Mat4Invert(mat, tmat); /* mat now is the camera 'viewmat' */ - MTC_Mat4CpyMat4(R.viewmat, mat); - MTC_Mat4CpyMat4(R.viewinv, tmat); + MTC_Mat4CpyMat4(envre->viewmat, mat); + MTC_Mat4CpyMat4(envre->viewinv, tmat); /* we have to correct for the already rotated vertexcoords */ - MTC_Mat4MulMat4(tmat, oldviewinv, R.viewmat); + MTC_Mat4MulMat4(tmat, oldviewinv, envre->viewmat); MTC_Mat4Invert(env->imat, tmat); - env_rotate_scene(tmat, 1); - init_render_world(); - setzbufvlaggen(RE_projectverto); - env_layerflags(env->notlay); - env_hideobject(env->object); - env_set_imats(); + env_rotate_scene(envre, tmat, 1); + init_render_world(envre); + project_renderdata(envre, projectverto, 0, 0); + env_layerflags(envre, env->notlay); + env_hideobject(envre, env->object); + env_set_imats(envre); - if(RE_local_test_break()==0) { - - RE_local_printrenderinfo(0.0, part); - - if(R.r.mode & R_OSA) zbufshadeDA(); - else zbufshade(); - + if(re->test_break()==0) { + RE_TileProcessor(envre); } /* rotate back */ - env_rotate_scene(tmat, 0); + env_rotate_scene(envre, tmat, 0); - if(RE_local_test_break()==0) { - ibuf= IMB_allocImBuf(R.rectx, R.recty, 24, IB_rect, 0); + if(re->test_break()==0) { + RenderLayer *rl= envre->result->layers.first; + + ibuf= IMB_allocImBuf(envre->rectx, envre->recty, 24, IB_rect, 0); + ibuf->rect_float= rl->rectf; + IMB_rect_from_float(ibuf); + ibuf->rect_float= NULL; + ima= MEM_callocN(sizeof(Image), "image"); - memcpy(ibuf->rect, R.rectot, 4*ibuf->x*ibuf->y); + ima->ibuf= ibuf; ima->ok= 1; env->cube[part]= ima; } - if(RE_local_test_break()) break; + if(re->test_break()) break; } - if(R.rectz) MEM_freeN(R.rectz); - if(R.rectot) MEM_freeN(R.rectot); - if(R.rectftot) MEM_freeN(R.rectftot); - R.rectz= NULL; - R.rectot= NULL; - R.rectftot= NULL; - - if(RE_local_test_break()) RE_free_envmapdata(env); + if(re->test_break()) BKE_free_envmapdata(env); else { - if(R.r.mode & R_OSA) env->ok= ENV_OSA; + if(envre->r.mode & R_OSA) env->ok= ENV_OSA; else env->ok= ENV_NORMAL; - env->lastframe= G.scene->r.cfra; + env->lastframe= G.scene->r.cfra; /* hurmf */ } /* restore */ - envmap_renderdata(0); - env_set_imats(); - init_render_world(); + envmap_free_render_copy(envre); + env_set_imats(re); } /* ------------------------------------------------------------------------- */ -void make_envmaps() +void make_envmaps(Render *re) { Tex *tex; int do_init= 0, depth= 0, trace; - if (!(R.r.mode & R_ENVMAP)) return; + if (!(re->r.mode & R_ENVMAP)) return; /* we dont raytrace, disabling the flag will cause ray_transp render solid */ - trace= (R.r.mode & R_RAYTRACE); - R.r.mode &= ~R_RAYTRACE; + trace= (re->r.mode & R_RAYTRACE); + re->r.mode &= ~R_RAYTRACE; /* 5 = hardcoded max recursion level */ while(depth<5) { @@ -527,21 +458,21 @@ void make_envmaps() if(tex->env->ok) { /* free when OSA, and old one isn't OSA */ - if((R.r.mode & R_OSA) && tex->env->ok==ENV_NORMAL) - RE_free_envmapdata(tex->env); + if((re->r.mode & R_OSA) && tex->env->ok==ENV_NORMAL) + BKE_free_envmapdata(tex->env); /* free when size larger */ - else if(tex->env->lastsize < R.r.size) - RE_free_envmapdata(tex->env); + else if(tex->env->lastsize < re->r.size) + BKE_free_envmapdata(tex->env); /* free when env is in recalcmode */ else if(tex->env->recalc) - RE_free_envmapdata(tex->env); + BKE_free_envmapdata(tex->env); } if(tex->env->ok==0 && depth==0) tex->env->recalc= 1; if(tex->env->ok==0) { do_init= 1; - render_envmap(tex->env); + render_envmap(re, tex->env); if(depth==tex->env->depth) tex->env->recalc= 0; } @@ -556,12 +487,12 @@ void make_envmaps() } if(do_init) { - RE_local_init_render_display(); - RE_local_clear_render_display(R.win); - R.flag |= R_REDRAW_PRV; + re->display_init(re->result); + re->display_clear(re->result); + re->flag |= R_REDRAW_PRV; } // restore - R.r.mode |= trace; + re->r.mode |= trace; } @@ -643,6 +574,7 @@ static void set_dxtdyt(float *dxts, float *dyts, float *dxt, float *dyt, int fac int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres) { extern SDL_mutex *load_ibuf_lock; // initrender.c + extern Render R; /* only in this call */ /* texvec should be the already reflected normal */ EnvMap *env; Image *ima; diff --git a/source/blender/render/intern/source/errorHandler.c b/source/blender/render/intern/source/errorHandler.c deleted file mode 100644 index 0ab927a9cd9..00000000000 --- a/source/blender/render/intern/source/errorHandler.c +++ /dev/null @@ -1,102 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Error handler for the rendering code. Maybe also useful elsewhere? - */ - -#include "GEN_messaging.h" -#include "stdio.h" - -#include "errorHandler.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* ------------------------------------------------------------------------- */ - -/* counters for error handling */ -static int lastError; /* code of last encountered error */ -static int errorCount; /* count how many time it occured */ -/* ------------------------------------------------------------------------- */ - -char errorStrings[RE_MAX_ERROR][100] = { - "0: No error", - "1: recalculated depth falls outside original range", - "2: invalid face/halo type", - "3: invalid face index", - "4: invalid data pointer", - "5: generic trace counter", - "6: overflow on z buffer depth", - "7: write outside edgerender buffer", - "8: cannot allocate memory", - "9: write outside colour target buffer", -}; - -/* ------------------------------------------------------------------------- */ - -void RE_errortrace_reset(void) -{ - lastError = RE_NO_ERROR; - errorCount = 0; -} - -void RE_error(int errType, char* fname) -{ - /* - * This memory behaviour should move to the generic stream... - */ - - if (lastError == errType) { - int teller; - errorCount++; - for (teller = 0; teller < 12; teller++) - fprintf(GEN_errorstream, "%c", 0x08); /* backspaces */ - fprintf(GEN_errorstream, "( %8u )", errorCount); - } else { - fprintf(GEN_errorstream, "\n*** %s: %s ", - fname, errorStrings[errType]); - lastError = errType; - errorCount = 1; - } -} /* end of void RE_error(int errType, char* errText) */ - -/* ------------------------------------------------------------------------- */ -/* note: non-repeating */ -void RE_error_int(int errType, char* fname, int value) -{ - fprintf(GEN_errorstream, "\n*** %s: %s : %d", - fname, errorStrings[errType], value); - lastError = RE_NO_ERROR; -} /* end of void RE_error_int(int errType, char* errText, int value) */ - -/* ------------------------------------------------------------------------- */ - -/* eof */ diff --git a/source/blender/render/intern/source/gammaCorrectionTables.c b/source/blender/render/intern/source/gammaCorrectionTables.c index 9273aa899ee..812feabede7 100644 --- a/source/blender/render/intern/source/gammaCorrectionTables.c +++ b/source/blender/render/intern/source/gammaCorrectionTables.c @@ -43,10 +43,9 @@ /* WARNING; optimized, cannot be used to do gamma(invgamma()) and expect */ /* result remain identical (ton) */ -/* Default gamma. For most CRTs, gamma ranges from 2.2 to 2.5 (Foley), so */ -/* 2.35 seems appropriate enough. Experience teaches a different number */ -/* though. Old blender: 2.0. It might be nice to make this a slider */ +/* gamma is only used here for correcting adding colors or alpha */ #define RE_DEFAULT_GAMMA 2.0 + /* This 400 is sort of based on the number of intensity levels needed for */ /* the typical dynamic range of a medium, in this case CRTs. (Foley) */ /* (Actually, it says the number should be between 400 and 535.) */ @@ -63,8 +62,7 @@ static float colour_step; static float inv_colour_step; static float valid_gamma; static float valid_inv_gamma; -static int gamma_table_initialised = 0; -int do_gamma=0; + /* ------------------------------------------------------------------------- */ float gammaCorrect(float c) @@ -141,15 +139,9 @@ void makeGammaTables(float gamma) * (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ; } - gamma_table_initialised = 1; } /* end of void makeGammaTables(float gamma) */ -/* ------------------------------------------------------------------------- */ -int gammaTableIsInitialised(void) -{ - return gamma_table_initialised; -} /* ------------------------------------------------------------------------- */ diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 479bf7190f7..6a59250b448 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -2,15 +2,12 @@ * * $Id: * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,9 +21,7 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. + * Contributors: 2004/2005/2006 Blender Foundation, full recode * * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ @@ -63,9 +58,15 @@ #include "SDL_thread.h" -#include "render.h" +#include "renderpipeline.h" +#include "render_types.h" #include "texture.h" +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ int imaprepeat, imapextend; diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index baa908cc9b2..c37b30a9bcb 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -1,15 +1,12 @@ /** * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,11 +20,9 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. + * Contributors: 2004/2005/2006 Blender Foundation, full recode * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ @@ -38,22 +33,23 @@ #include #include -#include "blendef.h" #include "MEM_guardedalloc.h" #include "PIL_time.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" +#include "BLI_jitter.h" #include "BLI_rand.h" #include "MTC_matrixops.h" -#include "DNA_image_types.h" #include "DNA_camera_types.h" +#include "DNA_group_types.h" +#include "DNA_image_types.h" #include "DNA_lamp_types.h" -#include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "BKE_utildefines.h" #include "BKE_global.h" @@ -66,13 +62,6 @@ #include "BKE_writeavi.h" #include "BKE_scene.h" -#include "BIF_toolbox.h" -#include "BIF_writeavicodec.h" -#include "BIF_writemovie.h" /* start_movie(), append_movie(), end_movie() */ - -#include "BSE_drawview.h" -#include "BSE_sequence.h" - #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -83,34 +72,33 @@ #include "SDL_thread.h" /* this module */ -#include "render.h" +#include "renderpipeline.h" +#include "render_types.h" -#include "RE_callbacks.h" -#include "zbuf.h" -#include "rendercore.h" /* part handler for the old renderer, shading functions */ +#include "rendercore.h" #include "pixelshading.h" -#include "renderPreAndPost.h" -#include "vanillaRenderPipe.h" -#include "renderHelp.h" -#include "jitter.h" #include "gammaCorrectionTables.h" -#include "zblur.h" +#include "zbuf.h" /* Own includes */ #include "initrender.h" -/* yafray: include for yafray export/render */ -#include "YafRay_Api.h" - -float centLut[16], *fmask1[9], *fmask2[9]; -unsigned short *gamtab, *igamtab2, *igamtab1; -char cmask[256], *centmask; +/* ********************** */ -Material defmaterial; - -/* ------- prototypes ----------- */ -void init_filt_mask(void); +static void init_render_jit(Render *re) +{ + static float jit[32][2]; /* simple caching */ + static int lastjit= 0; + + if(lastjit!=re->osa) { + memset(jit, 0, sizeof(jit)); + BLI_initjit(jit[0], re->osa); + } + + lastjit= re->osa; + memcpy(re->jit, jit, sizeof(jit)); +} /* ****************** GAMMA, MASKS and LUTS **************** */ @@ -165,48 +153,48 @@ static float filt_mitchell(float x) /* Mitchell & Netravali's two-param cubic */ return 0.0; } -static float calc_weight(float *weight, int i, int j) +static float calc_weight(Render *re, float *weight, int i, int j) { float x, y, dist, totw= 0.0; int a; - for(a=0; aosa; a++) { + x= re->jit[a][0] + i; + y= re->jit[a][1] + j; dist= sqrt(x*x+y*y); weight[a]= 0.0; /* Weighting choices */ - switch(R.r.filtertype) { + switch(re->r.filtertype) { case R_FILTER_BOX: if(i==0 && j==0) weight[a]= 1.0; break; case R_FILTER_TENT: - if(dist < R.r.gauss) - weight[a]= R.r.gauss - dist; + if(dist < re->r.gauss) + weight[a]= re->r.gauss - dist; break; case R_FILTER_GAUSS: - x = dist*R.r.gauss; - weight[a]= (1.0/exp(x*x) - 1.0/exp(R.r.gauss*R.r.gauss*2.25)); + x = dist*re->r.gauss; + weight[a]= (1.0/exp(x*x) - 1.0/exp(re->r.gauss*re->r.gauss*2.25)); break; case R_FILTER_MITCH: - weight[a]= filt_mitchell(dist*R.r.gauss); + weight[a]= filt_mitchell(dist*re->r.gauss); break; case R_FILTER_QUAD: - weight[a]= filt_quadratic(dist*R.r.gauss); + weight[a]= filt_quadratic(dist*re->r.gauss); break; case R_FILTER_CUBIC: - weight[a]= filt_cubic(dist*R.r.gauss); + weight[a]= filt_cubic(dist*re->r.gauss); break; case R_FILTER_CATROM: - weight[a]= filt_catrom(dist*R.r.gauss); + weight[a]= filt_catrom(dist*re->r.gauss); break; } @@ -217,1416 +205,440 @@ static float calc_weight(float *weight, int i, int j) return totw; } -// extern called in render_envmap, to disable gauss... -// extern called in sequence.c, it needs the gamtab -void init_filt_mask(void) +void free_sample_tables(Render *re) { - static int firsttime=1; - static int lastosa=0; - static int lastfilter= -1; - static float lastgamma= 0.0f, lastgaussdist=0.0f; - float gamma, igamma, flweight[32], fmask[256]; + int a; + + if(re->samples) { + for(a=0; a<9; a++) { + MEM_freeN(re->samples->fmask1[a]); + MEM_freeN(re->samples->fmask2[a]); + } + + MEM_freeN(re->samples->centmask); + MEM_freeN(re->samples); + re->samples= NULL; + } +} + +/* based on settings in render, it makes the lookup tables */ +void make_sample_tables(Render *re) +{ + static int firsttime= 1; + SampleTables *st; + float flweight[32], fmask[256]; float weight[32], totw, val, *fpx1, *fpx2, *fpy1, *fpy2, *m3, *m4; int i, j, a; + /* optimization tables, only once */ if(firsttime) { + makeGammaTables(2.0); /* tables only used for adding colors */ firsttime= 0; - - for(a=0; a<9;a++) { - fmask1[a]= MEM_mallocN(256*sizeof(float), "initfilt"); - fmask2[a]= MEM_mallocN(256*sizeof(float), "initfilt"); - } - for(a=0; a<256; a++) { - cmask[a]= 0; - if(a & 1) cmask[a]++; - if(a & 2) cmask[a]++; - if(a & 4) cmask[a]++; - if(a & 8) cmask[a]++; - if(a & 16) cmask[a]++; - if(a & 32) cmask[a]++; - if(a & 64) cmask[a]++; - if(a & 128) cmask[a]++; - } - centmask= MEM_mallocN(65536, "Initfilt3"); - for(a=0; a<16; a++) { - centLut[a]= -0.45+((float)a)/16.0; - } - - gamtab= MEM_mallocN(65536*sizeof(short), "initGaus2"); - igamtab1= MEM_mallocN(256*sizeof(short), "initGaus2"); - igamtab2= MEM_mallocN(65536*sizeof(short), "initGaus2"); - - return; // this case is called on startup } - - if(R.r.alphamode==R_ALPHAKEY) gamma= 1.0; /* gamma correction of alpha is nasty */ - else if(R.r.mode & R_GAMMA) gamma= 2.0; - else gamma= 1.0; - igamma= 1.0/gamma; - - if(gamma!= lastgamma) { - lastgamma= gamma; - - /* gamtab: in short, out short */ - for(a=0; a<65536; a++) { - val= a; - val/= 65535.0; - - if(gamma==2.0) val= sqrt(val); - else if(gamma!=1.0) val= pow(val, igamma); + free_sample_tables(re); + + if(re->osa==0) { + /* just prevents cpu cycles for larger render and copying */ + re->r.filtertype= 0; + return; + } + + re->do_gamma= 0; + if(re->r.mode & R_GAMMA) { + if(re->r.alphamode!=R_ALPHAKEY) /* alpha corrected gamma doesnt work for key alpha */ + re->do_gamma= 1; + } + + init_render_jit(re); - gamtab[a]= (65535.99*val); - } - /* inverse gamtab1 : in byte, out short */ - for(a=1; a<=256; a++) { - if(gamma==2.0) igamtab1[a-1]= a*a-1; - else if(gamma==1.0) igamtab1[a-1]= 256*a-1; - else { - val= a/256.0; - igamtab1[a-1]= (65535.0*pow(val, gamma)) -1 ; - } - } + st= re->samples= MEM_callocN(sizeof(SampleTables), "sample tables"); + + for(a=0; a<9;a++) { + st->fmask1[a]= MEM_callocN(256*sizeof(float), "initfilt"); + st->fmask2[a]= MEM_callocN(256*sizeof(float), "initfilt"); + } + for(a=0; a<256; a++) { + st->cmask[a]= 0; + if(a & 1) st->cmask[a]++; + if(a & 2) st->cmask[a]++; + if(a & 4) st->cmask[a]++; + if(a & 8) st->cmask[a]++; + if(a & 16) st->cmask[a]++; + if(a & 32) st->cmask[a]++; + if(a & 64) st->cmask[a]++; + if(a & 128) st->cmask[a]++; + } + + st->centmask= MEM_mallocN((1<osa), "Initfilt3"); + + for(a=0; a<16; a++) { + st->centLut[a]= -0.45+((float)a)/16.0; + } - /* inverse gamtab2 : in short, out short */ - for(a=0; a<65536; a++) { - val= a; - val/= 65535.0; - if(gamma==2.0) val= val*val; - else val= pow(val, gamma); + val= 1.0/((float)re->osa); + for(a=0; a<256; a++) { + fmask[a]= ((float)st->cmask[a])*val; + } - igamtab2[a]= 65535.0*val; + /* calculate totw */ + totw= 0.0; + for(j= -1; j<2; j++) { + for(i= -1; i<2; i++) { + totw+= calc_weight(re, weight, i, j); } } - if(R.osa && (lastosa!=R.osa || lastfilter != (R.r.filtertype) || lastgaussdist!=R.r.gauss)) { - lastosa= R.osa; - lastfilter= R.r.filtertype; - lastgaussdist= R.r.gauss; - - val= 1.0/((float)R.osa); - for(a=0; a<256; a++) { - fmask[a]= ((float)cmask[a])*val; - } + for(j= -1; j<2; j++) { + for(i= -1; i<2; i++) { + /* calculate using jit, with offset the weights */ - for(a=0; a<9;a++) { - memset(fmask1[a], 0, 256*sizeof(float)); - memset(fmask2[a], 0, 256*sizeof(float)); - } + memset(weight, 0, sizeof(weight)); + calc_weight(re, weight, i, j); - /* calculate totw */ - totw= 0.0; - for(j= -1; j<2; j++) { - for(i= -1; i<2; i++) { - totw+= calc_weight(weight, i, j); - } - } + for(a=0; a<16; a++) flweight[a]= weight[a]*(1.0/totw); - for(j= -1; j<2; j++) { - for(i= -1; i<2; i++) { - /* calculate using jit, with offset the weights */ - - memset(weight, 0, sizeof(weight)); - calc_weight(weight, i, j); - - for(a=0; a<16; a++) flweight[a]= weight[a]*(1.0/totw); - - m3= fmask1[ 3*(j+1)+i+1 ]; - m4= fmask2[ 3*(j+1)+i+1 ]; - - for(a=0; a<256; a++) { - if(a & 1) { - m3[a]+= flweight[0]; - m4[a]+= flweight[8]; - } - if(a & 2) { - m3[a]+= flweight[1]; - m4[a]+= flweight[9]; - } - if(a & 4) { - m3[a]+= flweight[2]; - m4[a]+= flweight[10]; - } - if(a & 8) { - m3[a]+= flweight[3]; - m4[a]+= flweight[11]; - } - if(a & 16) { - m3[a]+= flweight[4]; - m4[a]+= flweight[12]; - } - if(a & 32) { - m3[a]+= flweight[5]; - m4[a]+= flweight[13]; - } - if(a & 64) { - m3[a]+= flweight[6]; - m4[a]+= flweight[14]; - } - if(a & 128) { - m3[a]+= flweight[7]; - m4[a]+= flweight[15]; - } - } - } - } + m3= st->fmask1[ 3*(j+1)+i+1 ]; + m4= st->fmask2[ 3*(j+1)+i+1 ]; - /* centmask: the correct subpixel offset per mask */ - - fpx1= MEM_mallocN(256*sizeof(float), "initgauss4"); - fpx2= MEM_mallocN(256*sizeof(float), "initgauss4"); - fpy1= MEM_mallocN(256*sizeof(float), "initgauss4"); - fpy2= MEM_mallocN(256*sizeof(float), "initgauss4"); - for(a=0; a<256; a++) { - fpx1[a]= fpx2[a]= 0.0; - fpy1[a]= fpy2[a]= 0.0; - if(a & 1) { - fpx1[a]+= jit[0][0]; - fpy1[a]+= jit[0][1]; - fpx2[a]+= jit[8][0]; - fpy2[a]+= jit[8][1]; - } - if(a & 2) { - fpx1[a]+= jit[1][0]; - fpy1[a]+= jit[1][1]; - fpx2[a]+= jit[9][0]; - fpy2[a]+= jit[9][1]; - } - if(a & 4) { - fpx1[a]+= jit[2][0]; - fpy1[a]+= jit[2][1]; - fpx2[a]+= jit[10][0]; - fpy2[a]+= jit[10][1]; - } - if(a & 8) { - fpx1[a]+= jit[3][0]; - fpy1[a]+= jit[3][1]; - fpx2[a]+= jit[11][0]; - fpy2[a]+= jit[11][1]; - } - if(a & 16) { - fpx1[a]+= jit[4][0]; - fpy1[a]+= jit[4][1]; - fpx2[a]+= jit[12][0]; - fpy2[a]+= jit[12][1]; - } - if(a & 32) { - fpx1[a]+= jit[5][0]; - fpy1[a]+= jit[5][1]; - fpx2[a]+= jit[13][0]; - fpy2[a]+= jit[13][1]; - } - if(a & 64) { - fpx1[a]+= jit[6][0]; - fpy1[a]+= jit[6][1]; - fpx2[a]+= jit[14][0]; - fpy2[a]+= jit[14][1]; - } - if(a & 128) { - fpx1[a]+= jit[7][0]; - fpy1[a]+= jit[7][1]; - fpx2[a]+= jit[15][0]; - fpy2[a]+= jit[15][1]; + for(a=0; a<256; a++) { + if(a & 1) { + m3[a]+= flweight[0]; + m4[a]+= flweight[8]; + } + if(a & 2) { + m3[a]+= flweight[1]; + m4[a]+= flweight[9]; + } + if(a & 4) { + m3[a]+= flweight[2]; + m4[a]+= flweight[10]; + } + if(a & 8) { + m3[a]+= flweight[3]; + m4[a]+= flweight[11]; + } + if(a & 16) { + m3[a]+= flweight[4]; + m4[a]+= flweight[12]; + } + if(a & 32) { + m3[a]+= flweight[5]; + m4[a]+= flweight[13]; + } + if(a & 64) { + m3[a]+= flweight[6]; + m4[a]+= flweight[14]; + } + if(a & 128) { + m3[a]+= flweight[7]; + m4[a]+= flweight[15]; + } } } - - for(a= (1<0; a--) { - val= count_mask(a); - i= 8+(15.9*(fpy1[a & 255]+fpy2[a>>8])/val); - CLAMP(i, 0, 15); - j= 8+(15.9*(fpx1[a & 255]+fpx2[a>>8])/val); - CLAMP(j, 0, 15); - i= j + (i<<4); - centmask[a]= i; - } - - MEM_freeN(fpx1); - MEM_freeN(fpx2); - MEM_freeN(fpy1); - MEM_freeN(fpy2); } -} -static void free_filt_mask() -{ - int a; - - for(a=0; a<9; a++) { - MEM_freeN(fmask1[a]); - MEM_freeN(fmask2[a]); - } - MEM_freeN(gamtab); - MEM_freeN(igamtab1); - MEM_freeN(igamtab2); - - MEM_freeN(centmask); + /* centmask: the correct subpixel offset per mask */ + + fpx1= MEM_mallocN(256*sizeof(float), "initgauss4"); + fpx2= MEM_mallocN(256*sizeof(float), "initgauss4"); + fpy1= MEM_mallocN(256*sizeof(float), "initgauss4"); + fpy2= MEM_mallocN(256*sizeof(float), "initgauss4"); + for(a=0; a<256; a++) { + fpx1[a]= fpx2[a]= 0.0; + fpy1[a]= fpy2[a]= 0.0; + if(a & 1) { + fpx1[a]+= re->jit[0][0]; + fpy1[a]+= re->jit[0][1]; + fpx2[a]+= re->jit[8][0]; + fpy2[a]+= re->jit[8][1]; + } + if(a & 2) { + fpx1[a]+= re->jit[1][0]; + fpy1[a]+= re->jit[1][1]; + fpx2[a]+= re->jit[9][0]; + fpy2[a]+= re->jit[9][1]; + } + if(a & 4) { + fpx1[a]+= re->jit[2][0]; + fpy1[a]+= re->jit[2][1]; + fpx2[a]+= re->jit[10][0]; + fpy2[a]+= re->jit[10][1]; + } + if(a & 8) { + fpx1[a]+= re->jit[3][0]; + fpy1[a]+= re->jit[3][1]; + fpx2[a]+= re->jit[11][0]; + fpy2[a]+= re->jit[11][1]; + } + if(a & 16) { + fpx1[a]+= re->jit[4][0]; + fpy1[a]+= re->jit[4][1]; + fpx2[a]+= re->jit[12][0]; + fpy2[a]+= re->jit[12][1]; + } + if(a & 32) { + fpx1[a]+= re->jit[5][0]; + fpy1[a]+= re->jit[5][1]; + fpx2[a]+= re->jit[13][0]; + fpy2[a]+= re->jit[13][1]; + } + if(a & 64) { + fpx1[a]+= re->jit[6][0]; + fpy1[a]+= re->jit[6][1]; + fpx2[a]+= re->jit[14][0]; + fpy2[a]+= re->jit[14][1]; + } + if(a & 128) { + fpx1[a]+= re->jit[7][0]; + fpy1[a]+= re->jit[7][1]; + fpx2[a]+= re->jit[15][0]; + fpy2[a]+= re->jit[15][1]; + } + } + + for(a= (1<osa)-1; a>0; a--) { + val= st->cmask[a & 255] + st->cmask[a>>8]; + i= 8+(15.9*(fpy1[a & 255]+fpy2[a>>8])/val); + CLAMP(i, 0, 15); + j= 8+(15.9*(fpx1[a & 255]+fpx2[a>>8])/val); + CLAMP(j, 0, 15); + i= j + (i<<4); + st->centmask[a]= i; + } + + MEM_freeN(fpx1); + MEM_freeN(fpx2); + MEM_freeN(fpy1); + MEM_freeN(fpy2); } -/* ********************* init calls *********************** */ -static void init_def_material(void) -{ - Material *ma; - - ma= &defmaterial; - - init_material(&defmaterial); - - init_render_material(ma); -} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* this is called in creator.c, on startup */ -void RE_init_render_data(void) +/* call this after InitState() */ +/* per render, there's one persistant viewplane. Parts will set their own viewplanes */ +void RE_SetCamera(Render *re, Object *camera) { - memset(&R, 0, sizeof(RE_Render)); + Camera *cam=NULL; + rctf viewplane; + float pixsize, clipsta, clipend; + float lens; + float xd, yd; + int blursample= 0; /* make new call for that */ - RE_init_vertex_tables(); - R.blovl= (VlakRen **)MEM_callocN(sizeof(void *)*(TABLEINITSIZE),"Blovl"); - R.bloha= (HaloRen **)MEM_callocN(sizeof(void *)*(TABLEINITSIZE),"Bloha"); + /* question mark */ + re->ycor= ( (float)re->r.yasp)/( (float)re->r.xasp); - init_def_material(); - init_filt_mask(); -} - -/* called in usiblender.c on exit, also for blender -b render */ -void RE_free_render_data() -{ - MEM_freeN(R.vertnodes); - R.vertnodes= NULL; - MEM_freeN(R.blovl); - R.blovl= NULL; - MEM_freeN(R.bloha); - R.bloha= NULL; - - if(R.rectot) MEM_freeN(R.rectot); - if(R.rectftot) MEM_freeN(R.rectftot); - if(R.rectz) MEM_freeN(R.rectz); - if(R.rectzf) MEM_freeN(R.rectzf); - if(R.rectspare) MEM_freeN(R.rectspare); - R.rectot= NULL; - R.rectftot= NULL; - R.rectz= NULL; - R.rectzf= NULL; - R.rectspare= NULL; - - free_filt_mask(); -} - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -void RE_make_existing_file(char *name) -{ - char di[FILE_MAXDIR], fi[FILE_MAXFILE]; - - strcpy(di, name); - BLI_splitdirstring(di, fi); - - /* test exist */ - if (BLI_exists(di) == 0) { - BLI_recurdir_fileops(di); + if(camera->type==OB_CAMERA) { + cam= camera->data; + + if(cam->type==CAM_ORTHO) re->r.mode |= R_ORTHO; + + lens= cam->lens; + clipsta= cam->clipsta; + clipend= cam->clipend; } -} + else if(camera->type==OB_LAMP) { + /* fac= cos( PI*((float)(256- la->spsi))/512.0 ); */ - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -void RE_setwindowclip(int mode, int jmode) -{ - extern float bluroffsx, bluroffsy; // rendercore.c... hackish (ton) - Camera *cam=NULL; - float lens, minx, miny, maxx, maxy; - float xd, yd, afmx, afmy; - - if(G.scene->camera==NULL) return; - - afmx= R.afmx; - afmy= R.afmy; - - if(mode) { - - if(G.scene->camera->type==OB_LAMP) { - /* fac= cos( PI*((float)(256- la->spsi))/512.0 ); */ - - /* phi= acos(fac); */ - /* lens= 16.0*fac/sin(phi); */ - lens= 35.0; - R.near= 0.1; - R.far= 1000.0; + /* phi= acos(fac); */ + /* lens= 16.0*fac/sin(phi); */ + lens= 35.0; + clipsta= 0.1; + clipend= 1000.0; + } + else { /* envmap exception, can be done better... */ + lens= 16.0; + clipsta= re->clipsta; + clipend= re->clipend; + if(clipsta==0.0f || clipend==0.0f) { + clipsta= 0.1; + clipend= 1000.0; } - else if(G.scene->camera->type==OB_CAMERA) { - cam= G.scene->camera->data; + } - lens= cam->lens; - R.near= cam->clipsta; - R.far= cam->clipend; + /* ortho only with camera available */ + if(re->r.mode & R_ORTHO) { + if( (re->r.xasp*re->winx) >= (re->r.yasp*re->winy) ) { + re->viewfac= re->winx; } else { - lens= 16.0; + re->viewfac= re->ycor*re->winy; } - - if(R.r.mode & R_ORTHO) { - if( (R.r.xasp*afmx) >= (R.r.yasp*afmy) ) { - R.viewfac= 2.0*afmx; - } - else { - R.viewfac= 2.0*R.ycor*afmy; - } - /* ortho_scale == 1.0 means exact 1 to 1 mapping */ - R.pixsize= cam->ortho_scale/R.viewfac; + /* ortho_scale == 1.0 means exact 1 to 1 mapping */ + pixsize= cam->ortho_scale/re->viewfac; + } + else { + if( (re->r.xasp*re->winx) >= (re->r.yasp*re->winy) ) { + re->viewfac= (re->winx*lens)/32.0; } else { - if( (R.r.xasp*afmx) >= (R.r.yasp*afmy) ) { - R.viewfac= (afmx*lens)/16.0; - } - else { - R.viewfac= R.ycor*(afmy*lens)/16.0; - } - - R.pixsize= R.near/R.viewfac; + re->viewfac= re->ycor*(re->winy*lens)/32.0; } - /* pixsize is not a real global... get rid of it! (ton) */ + pixsize= clipsta/re->viewfac; } - + /* revision / simplification of subpixel offsets: - the matrix will go without offset from start (e.g. -100) to end (e.g. +99). - filling in with zbuffer will set offset of 0.5. to make sure clipped faces fill in too - in shadepixel() again that 0.5 offset is corrected */ - minx= R.xstart; - miny= R.ycor*(R.ystart); - maxx= R.xend; - maxy= R.ycor*(R.yend); - - if(R.flag & R_SEC_FIELD) { - if(R.r.mode & R_ODDFIELD) { - miny-= .5*R.ycor; - maxy-= .5*R.ycor; + viewplane.xmin= -0.5f*(float)re->winx; + viewplane.ymin= -0.5f*re->ycor*(float)re->winy; + viewplane.xmax= 0.5f*(float)re->winx; + viewplane.ymax= 0.5f*re->ycor*(float)re->winy; + + if(re->flag & R_SEC_FIELD) { + if(re->r.mode & R_ODDFIELD) { + viewplane.ymin-= .5*re->ycor; + viewplane.ymax-= .5*re->ycor; } else { - miny+= .5*R.ycor; - maxy+= .5*R.ycor; + viewplane.ymin+= .5*re->ycor; + viewplane.ymax+= .5*re->ycor; } } xd= yd= 0.0; - if(jmode!= -1) { - bluroffsx= xd= jit[jmode % R.osa][0]; - bluroffsy= yd= R.ycor*jit[jmode % R.osa][1]; + if(blursample!= -1) { + re->bluroffsx= xd= re->jit[blursample % re->osa][0]; + re->bluroffsy= yd= re->ycor*re->jit[blursample % re->osa][1]; } - else bluroffsx=bluroffsy= 0.0; + else re->bluroffsx=re->bluroffsy= 0.0f; - minx= R.pixsize*(minx+xd); - maxx= R.pixsize*(maxx+xd); - miny= R.pixsize*(miny+yd); - maxy= R.pixsize*(maxy+yd); - - if(R.r.mode & R_ORTHO) - i_ortho(minx, maxx, miny, maxy, R.near, R.far, R.winmat); + viewplane.xmin= pixsize*(viewplane.xmin+xd); + viewplane.xmax= pixsize*(viewplane.xmax+xd); + viewplane.ymin= pixsize*(viewplane.ymin+yd); + viewplane.ymax= pixsize*(viewplane.ymax+yd); + + re->viewdx= pixsize; + re->viewdy= re->ycor*pixsize; + + if(re->r.mode & R_ORTHO) + RE_SetOrtho(re, &viewplane, clipsta, clipend); else - i_window(minx, maxx, miny, maxy, R.near, R.far, R.winmat); + RE_SetWindow(re, &viewplane, clipsta, clipend); - //printmatrix4("win", R.winmat); + //printmatrix4("win", re->winmat); } -/* ~~~~~~~~~~~~~~~~ PARTS ~~~~~~~~~~~~~~~~~~~~~~ */ +/* ~~~~~~~~~~~~~~~~ part (tile) calculus ~~~~~~~~~~~~~~~~~~~~~~ */ -/** -* Part as in part-rendering. An image rendered in parts is rendered -* to a list of parts, with x,y size, and a pointer to the render -* output stored per part. Internal! -*/ -typedef struct Part -{ - struct Part *next, *prev; - unsigned int *rect; // color 4x8 bits - float *rectf; // color 4x32 bits - unsigned int *rectz; // zbuffer - - short minx, miny, maxx, maxy, x, y; -} Part; -static void freeparts(void) +void freeparts(Render *re) { - Part *part= R.parts.first; + RenderPart *part= re->parts.first; + while(part) { - if(part->rect) MEM_freeN(part->rect); + if(part->rectp) MEM_freeN(part->rectp); if(part->rectz) MEM_freeN(part->rectz); - if(part->rectf) MEM_freeN(part->rectf); part= part->next; } - BLI_freelistN(&R.parts); -} - -static void initparts(void) -{ - Part *pa; - short nr, xd, yd, xpart, ypart, xparts, yparts; - short a, xminb, xmaxb, yminb, ymaxb; - - freeparts(); - - if(R.r.mode & R_BORDER) { - xminb= R.r.border.xmin*R.rectx; - xmaxb= R.r.border.xmax*R.rectx; - - yminb= R.r.border.ymin*R.recty; - ymaxb= R.r.border.ymax*R.recty; - - if(xminb<0) xminb= 0; - if(xmaxb>R.rectx) xmaxb= R.rectx; - if(yminb<0) yminb= 0; - if(ymaxb>R.recty) ymaxb= R.recty; - } - else { - xminb=yminb= 0; - xmaxb= R.rectx; - ymaxb= R.recty; - } - - xparts= R.r.xparts; /* for border */ - yparts= R.r.yparts; - - xpart= R.rectx/xparts; - ypart= R.recty/yparts; - - /* if border: test if amount of parts can be fewer */ - if(R.r.mode & R_BORDER) { - a= (xmaxb-xminb-1)/xpart+1; /* amount of parts in border */ - if(aminx= pa->miny= 0; - pa->maxx= pa->x= R.rectx; - pa->maxy= pa->y= R.recty; - } - else { - xd= (nr % xparts); - yd= (nr-xd)/xparts; - - pa->minx= xminb+ xd*xpart; - pa->miny= yminb+ yd*ypart; - if(xdmaxx= pa->minx+xpart; - else pa->maxx= xmaxb; - if(ydmaxy= pa->miny+ypart; - else pa->maxy= ymaxb; - - pa->x= pa->maxx-pa->minx; - pa->y= pa->maxy-pa->miny; - } - - if(pa->x>0 && pa->y>0) { - /* Non-box filters might need 1 pixel extra to work */ - if((R.r.filtertype)) { - pa->minx-= 1; - pa->miny-= 1; - pa->maxx+= 1; - pa->maxy+= 1; - pa->x+= 2; - pa->y+= 2; - } - BLI_addtail(&R.parts, pa); - } - else MEM_freeN(pa); - } - + BLI_freelistN(&re->parts); } -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -static void setpart(Part *pa) +void initparts(Render *re) { - - R.xstart= pa->minx-R.afmx; - R.ystart= pa->miny-R.afmy; - R.xend= pa->maxx-R.afmx; - R.yend= pa->maxy-R.afmy; - R.rectx= pa->x; - R.recty= pa->y; -} - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -static void addparttorect(Part *pa) -{ - float *rf, *rfp; - unsigned int *rt, *rtp, *rz, *rzp; - int y, height, len, copylen; - - /* calc the right offset in rects, zbuffer cannot exist... */ - if(pa->rect==NULL) return; + int nr, xd, yd, xpart, ypart, xparts, yparts; + int xminb, xmaxb, yminb, ymaxb; - rtp= pa->rect; - rzp= pa->rectz; - rfp= pa->rectf; + freeparts(re); - copylen=len= pa->x; - height= pa->y; + /* this is render info for caller, is not reset when parts are freed! */ + re->i.totpart= 0; + re->i.curpart= 0; + re->i.partsdone= 0; - if(R.r.filtertype) { /* filters added 1 pixel extra */ - - rtp+= 1+len; - if(rzp) rzp+= 1+len; - if(rfp) rfp+= 4*(1+len); - - copylen= len-2; - height -= 2; - rt= R.rectot+ (pa->miny + 1)*R.rectx+ (pa->minx+1); - rz= R.rectz+ (pa->miny + 1)*R.rectx+ (pa->minx+1); - rf= R.rectftot+ 4*( (pa->miny + 1)*R.rectx + (pa->minx+1) ); - } - else { - rt= R.rectot+ pa->miny*R.rectx+ pa->minx; - rz= R.rectz+ pa->miny*R.rectx+ pa->minx; - rf= R.rectftot+ 4*(pa->miny*R.rectx+ pa->minx); - } - - for(y=0; ydisprect.xmin; + yminb= re->disprect.ymin; + xmaxb= re->disprect.xmax; + ymaxb= re->disprect.ymax; - if(R.rectz==NULL) return; - if(R.rectzf) { - printf("called convert zbuf wrong...\n"); - MEM_freeN(R.rectzf); - } + xparts= re->r.xparts; + yparts= re->r.yparts; - /* need to make sure winmat is OK */ - R.xstart= -R.afmx; - R.ystart= -R.afmy; - R.xend= R.xstart+R.rectx-1; - R.yend= R.ystart+R.recty-1; + /* mininum part size */ + if(re->rectx/xparts < 64) + xparts= 1 + re->rectx/64; + if(re->recty/yparts < 64) + yparts= 1 + re->recty/64; - RE_setwindowclip(0, -1); - - rectzf= R.rectzf= MEM_mallocN(R.rectx*R.recty*sizeof(float), "rectzf"); - rectz= R.rectz; + /* part size */ + xpart= re->rectx/xparts; + ypart= re->recty/yparts; - for(a=R.rectx*R.recty; a>0; a--, rectz++, rectzf++) { - if(*rectz==0x7FFFFFFF) - *rectzf= 10e10; - else { - /* inverse of zbuf calc: zbuf = MAXZ*hoco_z/hoco_w */ - /* or: (R.winmat[3][2] - zco*R.winmat[3][3])/(R.winmat[2][2] - R.winmat[2][3]*zco); */ - /* if ortho [2][3] is zero, else [3][3] is zero */ - - zco= ((float)*rectz)/2147483647.0f; - if(ortho) - *rectzf= (R.winmat[3][2] - zco*R.winmat[3][3])/(R.winmat[2][2]); - else - *rectzf= (R.winmat[3][2])/(R.winmat[2][2] - R.winmat[2][3]*zco); - } - } - - MEM_freeN(R.rectz); - R.rectz= NULL; -} - - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - - -static void add_to_blurbuf(int blur) -{ - static unsigned int *blurrect= 0; - int tot, gamval; - short facr, facb; - char *rtr, *rtb; - - if(blur<0) { - if(blurrect) { - if(R.rectot) MEM_freeN(R.rectot); - R.rectot= blurrect; - blurrect= 0; - } - } - else if(blur==R.osa-1) { - /* first time */ - blurrect= MEM_mallocN(R.rectx*R.recty*sizeof(int), "rectblur"); - if(R.rectot) memcpy(blurrect, R.rectot, R.rectx*R.recty*4); - } - else if(blurrect) { - /* accumulate */ - - facr= 256/(R.osa-blur); - facb= 256-facr; - - if(R.rectot) { - rtr= (char *)R.rectot; - rtb= (char *)blurrect; - tot= R.rectx*R.recty; - while(tot--) { - if( *((unsigned int *)rtb) != *((unsigned int *)rtr) ) { - - if(R.r.mode & R_GAMMA) { - gamval= (facr* igamtab2[ rtr[0]<<8 ] + facb* igamtab2[ rtb[0]<<8 ])>>8; - rtb[0]= gamtab[ gamval ]>>8; - gamval= (facr* igamtab2[ rtr[1]<<8 ] + facb* igamtab2[ rtb[1]<<8 ])>>8; - rtb[1]= gamtab[ gamval ]>>8; - gamval= (facr* igamtab2[ rtr[2]<<8 ] + facb* igamtab2[ rtb[2]<<8 ])>>8; - rtb[2]= gamtab[ gamval ]>>8; - gamval= (facr* igamtab2[ rtr[3]<<8 ] + facb* igamtab2[ rtb[3]<<8 ])>>8; - rtb[3]= gamtab[ gamval ]>>8; - } - else { - rtb[0]= (facr*rtr[0] + facb*rtb[0])>>8; - rtb[1]= (facr*rtr[1] + facb*rtb[1])>>8; - rtb[2]= (facr*rtr[2] + facb*rtb[2])>>8; - rtb[3]= (facr*rtr[3] + facb*rtb[3])>>8; - } - } - rtr+= 4; - rtb+= 4; - } - } - if(blur==0) { - /* last time */ - if(R.rectot) MEM_freeN(R.rectot); - R.rectot= blurrect; - blurrect= 0; - } - } -} - - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - - -/* yafray: main yafray render/export call */ -static void yafrayRender(void) -{ - R.flag |= R_RENDERING; /* !!! */ - - /* bug #3193: these params were not initialized, needed later for winmat calc. */ - R.xstart = -R.afmx; - R.ystart = -R.afmy; - R.xend = R.xstart + R.rectx - 1; - R.yend = R.ystart + R.recty - 1; - - /* all allocs moved here, out of export code */ - /* display rgba buf */ - if (R.rectot) MEM_freeN(R.rectot); - R.rectot = MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); - /* zbuf */ - if (R.rectz) MEM_freeN(R.rectz); - if (R.rectzf) MEM_freeN(R.rectzf); - R.rectzf= NULL; - R.rectz = (unsigned int *)MEM_mallocN(sizeof(int)*R.rectx*R.recty, "rectz"); - /* float rgba buf */ - if (R.rectftot) MEM_freeN(R.rectftot); - if (R.r.mode & R_FBUF) R.rectftot= MEM_callocN(4*sizeof(float)*R.rectx*R.recty, "rectftot"); - else R.rectftot = NULL; - - // switch must be done before prepareScene() - if (!R.r.YFexportxml) - YAF_switchFile(); - else - YAF_switchPlugin(); - - RE_local_init_render_display(); - RE_local_clear_render_display(R.win); - RE_local_timecursor((G.scene->r.cfra)); - - printf("Starting scene conversion.\n"); - prepareScene(); - printf("Scene conversion done.\n"); - - YAF_exportScene(); - finalizeScene(); - - // show postpro effects if floatbuffer used (plugin only) - if (R.r.YFexportxml) { - if ((R.r.mode & R_FBUF) && R.rectftot) - RE_floatbuffer_to_output(); - } -} - - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -// exported to other files, belongs in include... later -SDL_mutex *render_abuf_lock=NULL, *load_ibuf_lock=NULL; - - -static void renderloop_setblending(void) -{ - - /* this value should only be set here. do_gamma is for gammablended adding of subpixels */ - do_gamma= 0; - if(R.r.mode & R_GAMMA) { - if(R.r.alphamode==R_ALPHAKEY); // alpha corrected gamma doesnt work for key alpha - else if((R.r.mode & R_OSA)) do_gamma= 1; - } - - /* always call, it does gamma tables used by alphaunder, but call after R.osa and jit was set */ - init_filt_mask(); - - switch (R.r.alphamode) { - case R_ALPHAKEY: - setSkyBlendingMode(RE_ALPHA_KEY); - break; - case R_ALPHAPREMUL: - setSkyBlendingMode(RE_ALPHA_PREMUL); - break; - default: - setSkyBlendingMode(RE_ALPHA_SKY); - } - - /* SHould use slider when the gamma button is pressed. */ - if (do_gamma) { - makeGammaTables(2.0); - } else { - makeGammaTables(1.0); - } - -} - -static void mainRenderLoop(void) /* here the PART and FIELD loops */ -{ - Part *pa; - int blur, fields, fi, totparts, nr; - - /* create mutexes for threaded render */ - render_abuf_lock = SDL_CreateMutex(); - load_ibuf_lock = SDL_CreateMutex(); - - if(R.rectz) MEM_freeN(R.rectz); - R.rectz = NULL; - if(R.rectzf) MEM_freeN(R.rectzf); - R.rectzf = NULL; - if(R.rectftot) MEM_freeN(R.rectftot); - R.rectftot = NULL; - - /* FIELD LOOP */ - totparts= R.r.xparts*R.r.yparts; - fields= 1; - - if(R.r.mode & R_FIELDS) { - fields= 2; - R.rectf1= R.rectf2= NULL; /* field rects */ - R.r.ysch/= 2; - R.afmy/= 2; - R.r.yasp*= 2; - R.ycor= ( (float)R.r.yasp)/( (float)R.r.xasp); - - } - - for(fi=0; fir.cfra)+fi); - - R.flag|= R_RENDERING; - if(fi==1) R.flag |= R_SEC_FIELD; - - /* MOTIONBLUR loop */ - if(R.r.mode & R_MBLUR) blur= R.osa; - else blur= 1; - while(blur--) { - - /* WINDOW */ - R.rectx= R.r.xsch; - R.recty= R.r.ysch; - R.xstart= -R.afmx; - R.ystart= -R.afmy; - R.xend= R.xstart+R.rectx-1; - R.yend= R.ystart+R.recty-1; - - if(R.r.mode & R_MBLUR) set_mblur_offs(R.osa-blur); - - initparts(); /* always do, because of border and gauss */ - if(R.parts.first==NULL) { - G.afbreek=1; - error("Image too small"); - break; - } - - setpart(R.parts.first); - - RE_local_init_render_display(); - RE_local_clear_render_display(R.win); - RE_local_timecursor((G.scene->r.cfra)); - - prepareScene(); - - /* PARTS LOOP */ - nr= 0; - for(pa= R.parts.first; pa; pa= pa->next, nr++) { - - if(RE_local_test_break()) break; - - setpart(pa); - - if(R.r.mode & R_MBLUR) RE_setwindowclip(0, blur); - else RE_setwindowclip(0,-1); - - if(R.r.mode & R_PANORAMA) setPanoRot(nr); - - /* HOMOGENIC COORDINATES AND ZBUF AND CLIP OPTIMISATION (per part) */ - /* There may be some interference with z-coordinate */ - /* calculation here? */ - - doClipping(RE_projectverto); - if(RE_local_test_break()) break; - - /* rectot is for result and integer face indices */ - if(R.rectot) MEM_freeN(R.rectot); - R.rectot= MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); - - if(R.rectftot) MEM_freeN(R.rectftot); - if(R.r.mode & R_FBUF) R.rectftot= MEM_callocN(4*sizeof(float)*R.rectx*R.recty, "rectftot"); - else R.rectftot = NULL; - - if(R.r.mode & R_MBLUR) { - RE_local_printrenderinfo(0.0, R.osa - blur); - if(G.background && blur1 || (R.r.mode & R_BORDER) || (R.r.filtertype)) { - - pa->rect= R.rectot; - R.rectot= NULL; - pa->rectf= R.rectftot; - R.rectftot= NULL; - pa->rectz= R.rectz; - R.rectz= NULL; - } - } - - if(RE_local_test_break()) break; - } - - /* JOIN PARTS OR INSERT BORDER */ - - /* exception: crop */ - if( (R.r.mode & R_BORDER) && (R.r.mode & R_MOVIECROP)) ; - else { - R.rectx= R.r.xsch; - R.recty= R.r.ysch; - - if(R.r.mode & R_PANORAMA) R.rectx*= R.r.xparts; - - if(totparts>1 || (R.r.mode & R_BORDER) || (R.r.filtertype)) { - int a; - - if(R.rectot) MEM_freeN(R.rectot); - if(R.rectftot) MEM_freeN(R.rectftot); - if(R.rectz) MEM_freeN(R.rectz); - - R.rectot= MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); - - if(R.r.mode & R_UNIFIED) R.rectz= NULL; - else R.rectz= MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectz"); - - if(R.r.mode & R_FBUF) R.rectftot= MEM_callocN(4*sizeof(float)*R.rectx*R.recty, "rectftot"); - else R.rectftot= NULL; - - for(a=0, pa= R.parts.first; pa; pa= pa->next, a++) { - - if(R.r.mode & R_PANORAMA) { // pano is fake parts... - pa->minx += a*R.r.xsch; - pa->maxx += a*R.r.xsch; - } - addparttorect(pa); - } - } - } - - freeparts(); - - if( (R.flag & R_HALO)) { - if(RE_local_test_break()==0) add_halo_flare(); - } - - if( (R.r.mode & R_ZBLUR)) { - if(RE_local_test_break()==0) add_zblur(); - } - - if(R.r.mode & R_MBLUR) { - add_to_blurbuf(blur); - } - - /* END (blur loop) */ - finalizeScene(); - - if(RE_local_test_break()) break; - } - - /* definite free */ - add_to_blurbuf(-1); - - /* HANDLE FIELD */ - if(R.r.mode & R_FIELDS) { - if(R.flag & R_SEC_FIELD) R.rectf2= R.rectot; - else R.rectf1= R.rectot; - R.rectot= NULL; - } - - if(RE_local_test_break()) break; - } - - /* JOIN FIELDS */ - if(R.r.mode & R_FIELDS) { - R.r.ysch*= 2; - R.afmy*= 2; - R.recty*= 2; - R.r.yasp/=2; - - if(R.rectot) MEM_freeN(R.rectot); /* happens when a render has been stopped */ - R.rectot=(unsigned int *)MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); + for(nr=0; nrr; - R.r.postigamma= 1.0/R.r.postgamma; - - /* WINDOW size (sch='scherm' dutch for screen...) */ - R.r.xsch= (R.r.size*R.r.xsch)/100; - R.r.ysch= (R.r.size*R.r.ysch)/100; - - R.afmx= R.r.xsch/2; - R.afmy= R.r.ysch/2; - - /* to be sure: when a premature return (rectx can differ from xsch) */ - R.rectx= R.r.xsch; - R.recty= R.r.ysch; - - /* IS RENDERING ALLOWED? */ - - /* forbidden combination */ - if(R.r.mode & R_PANORAMA) { - if(R.r.mode & R_BORDER) { - error("No border supported for Panorama"); - G.afbreek= 1; - } - if(R.r.yparts>1) { - error("No Y-Parts supported for Panorama"); - G.afbreek= 1; + /* ensure we cover the entire picture, so last parts go to end */ + if(xd xmaxb) + disprect.xmax = xmaxb; } - if(R.r.mode & R_ORTHO) { - error("No Ortho render possible for Panorama"); - G.afbreek= 1; - } - } - - if(R.r.mode & R_BORDER) { - if(R.r.border.xmax <= R.r.border.xmin || - R.r.border.ymax <= R.r.border.ymin) { - error("No border area selected."); - G.afbreek= 1; - } - } - - if(R.r.xparts*R.r.yparts>=2 && (R.r.mode & R_MOVIECROP) && (R.r.mode & R_BORDER)) { - error("Combination of border, crop and parts not allowed"); - G.afbreek= 1; - return; - } - - if(R.r.xparts*R.r.yparts>64) { - error("No more than 64 parts supported"); - G.afbreek= 1; - return; - } - - if(R.r.yparts>1 && (R.r.mode & R_PANORAMA)) { - error("No Y-Parts supported for Panorama"); - G.afbreek= 1; - return; - } - - if(G.afbreek==1) return; - - /* TEST BACKBUF */ - /* If an image is specified for use as backdrop, that image is loaded */ - /* here. */ - if((R.r.bufflag & 1) && (G.scene->r.scemode & R_OGL)==0) { - if(R.r.alphamode == R_ADDSKY) { - strcpy(name, R.r.backbuf); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); - - if(R.backbuf) { - R.backbuf->id.us--; - bima= R.backbuf; - } - else bima= NULL; - - R.backbuf= add_image(name); - - if(bima && bima->id.us<1) { - free_image_buffers(bima); - } - - if(R.backbuf && R.backbuf->ibuf==NULL) { - R.backbuf->ibuf= IMB_loadiffname(R.backbuf->name, IB_rect); - if(R.backbuf->ibuf==NULL) R.backbuf->ok= 0; - else R.backbuf->ok= 1; - } - if(R.backbuf==NULL || R.backbuf->ok==0) { - // error() doesnt work with render window open - //error("No backbuf there!"); - printf("Error: No backbuf %s\n", name); - } - } - } - - if(R.r.mode & (R_OSA|R_MBLUR)) { - R.osa= R.r.osa; - if(R.osa>16) R.osa= 16; - - init_render_jit(R.osa); + else disprect.xmax= xmaxb; - } - else R.osa= 0; - - /* just prevents cpu cycles for larger render and copying */ - if((R.r.mode & R_OSA)==0) - R.r.filtertype= 0; - - renderloop_setblending(); // alpha, sky, gamma - - /* when rendered without camera object */ - /* it has to done here because of envmaps */ - R.near= 0.1; - R.far= 1000.0; - - - if(R.afmx<1 || R.afmy<1) { - error("Image too small"); - return; - } - R.ycor= ( (float)R.r.yasp)/( (float)R.r.xasp); - - start_time= PIL_check_seconds_timer(); - - if(R.r.scemode & R_OGL) { - R.rectx= R.r.xsch; - R.recty= R.r.ysch; - - if(R.rectot) MEM_freeN(R.rectot); - R.rectot= (unsigned int *)MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); - - if(R.rectftot) MEM_freeN(R.rectftot); - R.rectftot= NULL; - - RE_local_init_render_display(); - drawview3d_render(ogl_render_view3d); - } - else if(R.r.scemode & R_DOSEQ) { - R.rectx= R.r.xsch; - R.recty= R.r.ysch; - if(R.r.mode & R_PANORAMA) { - R.rectx*= R.r.xparts; + if(yd ymaxb) + disprect.ymax = ymaxb; } + else disprect.ymax= ymaxb; - if(R.rectot) MEM_freeN(R.rectot); - R.rectot= (unsigned int *)MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); - - if(R.rectftot) MEM_freeN(R.rectftot); - R.rectftot= NULL; - - RE_local_timecursor((G.scene->r.cfra)); - - if(RE_local_test_break()==0) do_render_seq(); - - /* display */ - if(R.rectot) RE_local_render_display(0, R.recty-1, R.rectx, R.recty,R.rectot); - } - else { - if(G.scene->camera==0) { - G.scene->camera= scene_find_camera(G.scene); - } + rectx= disprect.xmax - disprect.xmin; + recty= disprect.ymax - disprect.ymin; - if(G.scene->camera==0) { - error("No camera"); - /* needed because R.rectx and R.recty can be unmatching R.rectot */ + /* so, now can we add this part? */ + if(rectx>0 && recty>0) { + RenderPart *pa= MEM_callocN(sizeof(RenderPart), "new part"); - if(R.rectot) MEM_freeN(R.rectot); - R.rectot= NULL; - if(R.rectftot) MEM_freeN(R.rectftot); - R.rectftot= NULL; - - G.afbreek=1; - return; - } - else { - - if(G.scene->camera->type==OB_CAMERA) { - Camera *cam= G.scene->camera->data; - if(cam->type==CAM_ORTHO) R.r.mode |= R_ORTHO; + /* Non-box filters need 2 pixels extra to work */ + if((re->r.filtertype || (re->r.mode & R_EDGE))) { + pa->crop= 2; + disprect.xmin -= pa->crop; + disprect.ymin -= pa->crop; + disprect.xmax += pa->crop; + disprect.ymax += pa->crop; + rectx+= 2*pa->crop; + recty+= 2*pa->crop; } - - render(); /* returns with complete rect xsch-ysch */ - } - } - - /* display again: fields/seq/parts/pano etc */ - if(R.rectot) { - RE_local_init_render_display(); - RE_local_render_display(0, R.recty-1, R.rectx, R.recty, R.rectot); - } - else RE_local_clear_render_display(R.win); - - if ((G.scene->r.scemode & R_OGL)==0) /* header gets scrabled if renderwindow holds OGL context */ - RE_local_printrenderinfo((PIL_check_seconds_timer() - start_time), -1); - - /* grms... this is a nasty global */ - do_gamma= 0; - - /* for now, we do always */ - convert_zbuf_to_distbuf(); - - /* these flags remain on, until reset in caller to render (renderwin.c) */ - R.flag &= (R_RENDERING|R_ANIMRENDER|R_REDRAW_PRV); -} + pa->disprect= disprect; + pa->rectx= rectx; + pa->recty= recty; -void RE_animrender(struct View3D *ogl_render_view3d) -{ - int cfrao; - char name[256]; - - if(G.scene==NULL) return; - if(G.scene->r.sfra > G.scene->r.efra) { - error("Startframe larger than Endframe"); - return; - } - - /* scenedata to R: (for backbuf, R.rectx etc) */ - R.r= G.scene->r; - - /* START ANIMLOOP, everywhere NOT the cfra from R.r is gebruikt: because of rest blender */ - cfrao= (G.scene->r.cfra); - - /* disable options for ogl render */ - if(G.scene->r.scemode & R_OGL) R.r.mode &= ~(R_PANORAMA|R_MOVIECROP); - - // these calculations apply for all movie formats - R.rectx= (R.r.size*R.r.xsch)/100; - R.recty= (R.r.size*R.r.ysch)/100; - if(R.r.mode & R_PANORAMA) { - R.rectx*= R.r.xparts; - R.recty*= R.r.yparts; - } - if(R.r.mode & R_MOVIECROP) { - initparts(); - setpart(R.parts.first); // this will adjust r.rectx - } - - if (0) { -#ifdef __sgi - } else if (R.r.imtype==R_MOVIE) { - start_movie(); -#endif -#if defined(_WIN32) && !defined(FREE_WINDOWS) - } else if (R.r.imtype == R_AVICODEC) { - start_avi_codec(); -#endif -#if WITH_QUICKTIME - } else if (R.r.imtype == R_QUICKTIME) { - start_qt(); -#endif - } else if ELEM4(R.r.imtype, R_AVIRAW, R_AVIJPEG, R_MOVIE, R_AVICODEC) { - if ELEM(R.r.imtype, R_MOVIE, R_AVICODEC) { - printf("Selected movie format not supported on this platform,\nusing RAW AVI instead\n"); + BLI_addtail(&re->parts, pa); + re->i.totpart++; } - start_avi(); } -// set initial conditions for softbodies here -// ****************************************** - for((G.scene->r.cfra)=(G.scene->r.sfra); (G.scene->r.cfra)<=(G.scene->r.efra); (G.scene->r.cfra)++) { - double starttime= PIL_check_seconds_timer(); +} - R.flag |= R_ANIMRENDER; // unused now (ton) - RE_initrender(ogl_render_view3d); - - /* WRITE IMAGE */ - if(RE_local_test_break()==0) { +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - if (0) { -#ifdef __sgi - } else if (R.r.imtype == R_MOVIE) { - append_movie((G.scene->r.cfra)); -#endif -#if defined(_WIN32) && !defined(FREE_WINDOWS) - } else if (R.r.imtype == R_AVICODEC) { - append_avi_codec((G.scene->r.cfra)); -#endif -#ifdef WITH_QUICKTIME - } else if (R.r.imtype == R_QUICKTIME) { - append_qt((G.scene->r.cfra)); -#endif - } else if ELEM4(R.r.imtype, R_AVIRAW, R_AVIJPEG, R_MOVIE, R_AVICODEC) { - append_avi((G.scene->r.cfra)); - } else { - makepicstring(name, (G.scene->r.cfra)); - schrijfplaatje(name); - if(RE_local_test_break()==0) printf("Saved: %s", name); - } +// exported to other files, belongs in include... later +SDL_mutex *render_abuf_lock=NULL, *load_ibuf_lock=NULL; - timestr(PIL_check_seconds_timer()-starttime, name); - printf(" Time: %s\n", name); - fflush(stdout); /* needed for renderd !! */ - } - if(G.afbreek==1) break; - } +/* **************************************************************** */ +/* sticky texture coords */ +/* **************************************************************** */ - G.scene->r.cfra= cfrao; +void RE_make_sticky(void) +{ + /* oldfile.txt */ +} - /* restore time */ - if(R.r.mode & (R_FIELDS|R_MBLUR)) { - /* applies changes fully */ - scene_update_for_newframe(G.scene, G.scene->lay); - } - if (0) { -#ifdef __sgi - } else if (R.r.imtype==R_MOVIE) { - end_movie(); -#endif -#if defined(_WIN32) && !defined(FREE_WINDOWS) - } else if (R.r.imtype == R_AVICODEC) { - end_avi_codec(); -#endif -#ifdef WITH_QUICKTIME - } else if (R.r.imtype == R_QUICKTIME) { - end_qt(); -#endif - } else if ELEM4(R.r.imtype, R_AVIRAW, R_AVIJPEG, R_MOVIE, R_AVICODEC) { - end_avi(); - } -} -/* *************************************************** */ -/* ******************* Screendumps ******************** */ -/* moved to the windowControl thing */ diff --git a/source/blender/render/intern/source/jitter.c b/source/blender/render/intern/source/jitter.c deleted file mode 100644 index 98bb1543068..00000000000 --- a/source/blender/render/intern/source/jitter.c +++ /dev/null @@ -1,198 +0,0 @@ -/** - * Jitter offset table - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include "MEM_guardedalloc.h" - -#include "BLI_arithb.h" -#include "BLI_rand.h" -#include "render.h" -#include "jitter.h" - - -float jit[64][2]; - -void init_render_jit(int nr); - - -void RE_jitterate1(float *jit1, float *jit2, int num, float rad1) -{ - int i , j , k; - float vecx, vecy, dvecx, dvecy, x, y, len; - - for (i = 2*num-2; i>=0 ; i-=2) { - dvecx = dvecy = 0.0; - x = jit1[i]; - y = jit1[i+1]; - for (j = 2*num-2; j>=0 ; j-=2) { - if (i != j){ - vecx = jit1[j] - x - 1.0; - vecy = jit1[j+1] - y - 1.0; - for (k = 3; k>0 ; k--){ - if( fabs(vecx)0 && len0 && len0 && len= 0 ; i-=2){ - dvecx = dvecy = 0.0; - x = jit1[i]; - y = jit1[i+1]; - for (j =2*num -2; j>= 0 ; j-=2){ - if (i != j){ - vecx = jit1[j] - x - 1.0; - vecy = jit1[j+1] - y - 1.0; - - if( fabs(vecx) +#include +#include +#include + +#include "DNA_group_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "BKE_global.h" +#include "BKE_image.h" +#include "BKE_scene.h" +#include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */ + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +#include "PIL_time.h" +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" + +#include "RE_pipeline.h" +#include "radio.h" + +#include "BSE_sequence.h" /* <----------------- bad!!! */ + +/* internal */ +#include "render_types.h" +#include "renderpipeline.h" +#include "renderdatabase.h" +#include "rendercore.h" +#include "envmap.h" +#include "initrender.h" +#include "shadbuf.h" +#include "zbuf.h" + +#include "SDL_thread.h" + +/* render flow + +1) Initialize state +- state data, tables +- movie/image file init +- everything that doesn't change during animation + +2) Initialize data +- camera, world, matrices +- make render verts, faces, halos, strands +- everything can change per frame/field + +3) Render Processor +- multiple layers +- tiles, rect, baking +- layers/tiles optionally to disk or directly in Render Result + +4) Composit Render Result +- also read external files etc + +5) Image Files +- save file or append in movie + +*/ + + +/* ********* globals ******** */ + +/* here we store all renders */ +static struct ListBase RenderList= {NULL, NULL}; + +/* hardcopy of current render, used while rendering for speed */ +Render R; + +/* ********* alloc and free ******** */ + + +static SDL_mutex *malloc_lock= NULL; + +void *RE_mallocN(int len, char *name) +{ + void *mem; + if(malloc_lock) SDL_mutexP(malloc_lock); + mem= MEM_mallocN(len, name); + if(malloc_lock) SDL_mutexV(malloc_lock); + return mem; +} +void *RE_callocN(int len, char *name) +{ + void *mem; + if(malloc_lock) SDL_mutexP(malloc_lock); + mem= MEM_callocN(len, name); + if(malloc_lock) SDL_mutexV(malloc_lock); + return mem; +} +void RE_freeN(void *poin) +{ + if(malloc_lock) SDL_mutexP(malloc_lock); + MEM_freeN(poin); + if(malloc_lock) SDL_mutexV(malloc_lock); +} + +/* ********************** */ + + +/* default callbacks, set in each new render */ +static void result_nothing(RenderResult *rr) {} +static void result_rcti_nothing(RenderResult *rr, rcti *rect) {} +static void stats_nothing(RenderStats *rs) {} +static void int_nothing(int val) {} +static int void_nothing(void) {return 0;} +static void print_error(const char *str) {printf("ERROR: %s\n", str);} + +static void free_render_result(RenderResult *res) +{ + if(res==NULL) return; + + while(res->layers.first) { + RenderLayer *rl= res->layers.first; + if(rl->rectf) RE_freeN(rl->rectf); + if(rl->rectz) RE_freeN(rl->rectz); + BLI_remlink(&res->layers, rl); + RE_freeN(rl); + } + + if(res->rect32) + MEM_freeN(res->rect32); + + RE_freeN(res); +} + +/* called by main render as well for parts */ +/* will read info from Render *re to define layers */ +/* called in threads */ +/* winrct is coordinate rect of entire image, partrct the part within */ +static RenderResult *new_render_result(Render *re, rcti *partrct, int crop) +{ + RenderResult *rr; + RenderLayer *rl; + int rectx, recty; + + rectx= partrct->xmax - partrct->xmin; + recty= partrct->ymax - partrct->ymin; + + if(rectx<=0 || recty<=0) + return NULL; + + rr= RE_callocN(sizeof(RenderResult), "new render result"); + rr->rectx= rectx; + rr->recty= recty; + /* crop is one or two extra pixels rendered for filtering, is used for merging and display too */ + rr->crop= crop; + + /* tilerect is relative coordinates within render disprect. do not subtract crop yet */ + rr->tilerect.xmin= partrct->xmin - re->disprect.xmin; + rr->tilerect.xmax= partrct->xmax - re->disprect.xmax; + rr->tilerect.ymin= partrct->ymin - re->disprect.ymin; + rr->tilerect.ymax= partrct->ymax - re->disprect.ymax; + + /* check renderdata for amount of layers */ + /* for now just one */ + rl= RE_callocN(sizeof(RenderLayer), "new render layer"); + BLI_addtail(&rr->layers, rl); + + rl->rectf= RE_callocN(rectx*recty*sizeof(float)*4, "layer float rgba"); + rl->rectz= RE_callocN(rectx*recty*sizeof(float), "layer float Z"); + + return rr; +} + +#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val)) +/* caller is responsible for allocating rect in correct size! */ +void RE_ResultGet32(Render *re, unsigned int *rect) +{ + if(re->result) { + RenderLayer *rl= re->result->layers.first; + float *fp= rl->rectf; + if(fp) { + int tot= re->rectx*re->recty; + char *cp= (char *)rect; + + for(;tot>0; tot--, cp+=4, fp+=4) { + cp[0] = FTOCHAR(fp[0]); + cp[1] = FTOCHAR(fp[1]); + cp[2] = FTOCHAR(fp[2]); + cp[3] = FTOCHAR(fp[3]); + } + return; + } + } + /* else fill with black */ + memset(rect, sizeof(int)*re->rectx*re->recty, 0); +} + +/* used when rendering to a full buffer, or when reading the exr part-layer-pass file */ +/* no test happens here if it fits... */ +/* is used within threads */ +static void merge_render_result(RenderResult *rr, RenderResult *rrpart) +{ + RenderLayer *rl= rr->layers.first; + RenderLayer *rlp= rrpart->layers.first; + float *rf, *rfp; + int *rz=NULL, *rzp; + int y, height, len, copylen; + + if(rlp->rectf==NULL) return; + if(rl->rectf==NULL) return; + + rzp= NULL; //rlp->rectz; + rfp= rlp->rectf; + + copylen=len= rrpart->rectx; + height= rrpart->recty; + + if(rrpart->crop) { /* filters add pixel extra */ + + if(rzp) rzp+= rrpart->crop + rrpart->crop*len; + if(rfp) rfp+= 4*(rrpart->crop + rrpart->crop*len); + + copylen= len-2*rrpart->crop; + height -= 2*rrpart->crop; + + // rz= re->rectz+ (pa->miny + rrpart->crop)*rr->rectx+ (pa->minx+rrpart->crop); + rf= rl->rectf+ ( (rrpart->tilerect.ymin + rrpart->crop)*rr->rectx + (rrpart->tilerect.xmin+rrpart->crop) )*4; + } + else { + // rz= re->rectz + (pa->disprect.ymin*rr->rectx + pa->disprect.xmin); + rf= rl->rectf+ (rrpart->tilerect.ymin*rr->rectx + rrpart->tilerect.xmin)*4; + } + + for(y=0; yrectx; + rzp+= len; + } + if(rfp) { + memcpy(rf, rfp, 16*copylen); + rf+= 4*rr->rectx; + rfp+= 4*len; + } + } +} + + +/* *************************************************** */ + +Render *RE_GetRender(const char *name) +{ + Render *re; + + /* search for existing renders */ + for(re= RenderList.first; re; re= re->next) { + if(strncmp(re->name, name, RE_MAXNAME)==0) { + break; + } + } + return re; +} + +RenderResult *RE_GetResult(Render *re) +{ + if(re) + return re->result; + return NULL; +} + +RenderStats *RE_GetStats(Render *re) +{ + return &re->i; +} + +Render *RE_NewRender(const char *name) +{ + Render *re; + + /* only one render per name exists */ + re= RE_GetRender(name); + if(re) { + BLI_remlink(&RenderList, re); + RE_FreeRender(re); + } + + /* new render data struct */ + re= RE_callocN(sizeof(Render), "new render"); + BLI_addtail(&RenderList, re); + strncpy(re->name, name, RE_MAXNAME); + + /* set default empty callbacks */ + re->display_init= result_nothing; + re->display_clear= result_nothing; + re->display_draw= result_rcti_nothing; + re->timecursor= int_nothing; + re->test_break= void_nothing; + re->test_return= void_nothing; + re->error= print_error; + re->stats_draw= stats_nothing; + + /* init some variables */ + re->ycor= 1.0f; + + return re; +} + +/* only call this while you know it will remove the link too */ +void RE_FreeRender(Render *re) +{ + + free_renderdata_tables(re); + free_sample_tables(re); + + free_render_result(re->result); + + BLI_remlink(&RenderList, re); + RE_freeN(re); +} + +/* exit blender */ +void RE_FreeAllRender(void) +{ + while(RenderList.first) { + RE_FreeRender(RenderList.first); + } +} + +/* ********* initialize state ******** */ + + +/* what doesn't change during entire render sequence */ +/* disprect is optional, if NULL it assumes full window render */ +void RE_InitState(Render *re, RenderData *rd, int winx, int winy, rcti *disprect) +{ + re->ok= TRUE; /* maybe flag */ + + re->i.starttime= PIL_check_seconds_timer(); + re->r= *rd; /* hardcopy */ + + re->winx= winx; + re->winy= winy; + if(disprect) { + re->disprect= *disprect; + re->rectx= disprect->xmax-disprect->xmin; + re->recty= disprect->ymax-disprect->ymin; + } + else { + re->disprect.xmin= re->disprect.xmax= 0; + re->disprect.xmax= winx; + re->disprect.ymax= winy; + re->rectx= winx; + re->recty= winy; + } + + if(re->rectx < 2 || re->recty < 2) { + re->error("Image too small"); + re->ok= 0; + } + else { + /* check state variables, osa? */ + if(re->r.mode & (R_OSA|R_MBLUR)) { + re->osa= re->r.osa; + if(re->osa>16) re->osa= 16; + } + else re->osa= 0; + + /* always call, checks for gamma, gamma tables and jitter too */ + make_sample_tables(re); + + /* initialize render result */ + free_render_result(re->result); + re->result= new_render_result(re, &re->disprect, 0); + + } +} + +void RE_SetDispRect (struct Render *re, rcti *disprect) +{ + re->disprect= *disprect; + re->rectx= disprect->xmax-disprect->xmin; + re->recty= disprect->ymax-disprect->ymin; + + /* initialize render result */ + free_render_result(re->result); + re->result= new_render_result(re, &re->disprect, 0); +} + +void RE_SetWindow(Render *re, rctf *viewplane, float clipsta, float clipend) +{ + /* re->ok flag? */ + + re->viewplane= *viewplane; + re->clipsta= clipsta; + re->clipend= clipend; + + i_window(re->viewplane.xmin, re->viewplane.xmax, re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend, re->winmat); +} + +void RE_SetOrtho(Render *re, rctf *viewplane, float clipsta, float clipend) +{ + /* re->ok flag? */ + + re->viewplane= *viewplane; + re->clipsta= clipsta; + re->clipend= clipend; + re->r.mode |= R_ORTHO; + + i_ortho(re->viewplane.xmin, re->viewplane.xmax, re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend, re->winmat); +} + +void RE_SetView(Render *re, float mat[][4]) +{ + /* re->ok flag? */ + Mat4CpyMat4(re->viewmat, mat); + Mat4Invert(re->viewinv, re->viewmat); +} + +/* image and movie output has to move to either imbuf or kernel */ + +void RE_display_init_cb(Render *re, void (*f)(RenderResult *rr)) +{ + re->display_init= f; +} +void RE_display_clear_cb(Render *re, void (*f)(RenderResult *rr)) +{ + re->display_clear= f; +} +void RE_display_draw_cb(Render *re, void (*f)(RenderResult *rr, rcti *rect)) +{ + re->display_draw= f; +} + +void RE_stats_draw_cb(Render *re, void (*f)(RenderStats *rs)) +{ + re->stats_draw= f; +} +void RE_timecursor_cb(Render *re, void (*f)(int)) +{ + re->timecursor= f; +} + +void RE_test_break_cb(Render *re, int (*f)(void)) +{ + re->test_break= f; +} +void RE_test_return_cb(Render *re, int (*f)(void)) +{ + re->test_return= f; +} +void RE_error_cb(Render *re, void (*f)(const char *str)) +{ + re->error= f; +} + + +/* ********* add object data (later) ******** */ + +/* object is considered fully prepared on correct time etc */ +/* includes lights */ +void RE_AddObject(Render *re, Object *ob) +{ + +} + +/* ********** basic thread control API ************ */ + +#define RE_MAX_THREAD 4 + +typedef struct ThreadSlot { + RenderPart *part; + int avail; +} ThreadSlot; + +static ThreadSlot threadslots[RE_MAX_THREAD]; + +static void init_threadslots(int tot) +{ + int a; + + if(tot>RE_MAX_THREAD) tot= RE_MAX_THREAD; + else if(tot<1) tot= 1; + + for(a=0; a< RE_MAX_THREAD; a++) { + threadslots[a].part= NULL; + if(athread= a; + break; + } + } +} + +static void remove_threadslot(RenderPart *pa) +{ + int a; + for(a=0; a< RE_MAX_THREAD; a++) { + if(threadslots[a].part==pa) { + threadslots[a].avail= 1; + threadslots[a].part= NULL; + } + } +} + +/* ********** basic thread control API ************ */ + +static int do_part_thread(void *pa_v) +{ + RenderPart *pa= pa_v; + + /* need to return nicely all parts on esc */ + if(R.test_break()==0) { + + pa->result= new_render_result(&R, &pa->disprect, pa->crop); + + if(R.osa) + zbufshadeDA_tile(pa); + else + zbufshade_tile(pa); + + if(!R.test_break()) + merge_render_result(R.result, pa->result); + } + + pa->ready= 1; + remove_threadslot(pa); + + return 0; +} + +/* returns with render result filled, not threaded */ +static void render_tile_processor(Render *re) +{ + RenderPart *pa; + + if(re->test_break()) + return; + + re->i.lastframetime= PIL_check_seconds_timer()- re->i.starttime; + re->stats_draw(&re->i); + re->i.starttime= PIL_check_seconds_timer(); + + if(re->result==NULL) + return; + + initparts(re); + + /* assuming no new data gets added to dbase... */ + R= *re; + + for(pa= re->parts.first; pa; pa= pa->next) { + do_part_thread(pa); + + if(pa->result) { + if(!re->test_break()) { + re->display_draw(pa->result, NULL); + re->i.partsdone++; + } + free_render_result(pa->result); + pa->result= NULL; + } + if(re->test_break()) + break; + } + + re->i.lastframetime= PIL_check_seconds_timer()- re->i.starttime; + re->stats_draw(&re->i); + + freeparts(re); +} + +static RenderPart *find_nicest_part(Render *re) +{ + RenderPart *pa, *best= NULL; + int centx=re->winx/2, centy=re->winy/2, tot=1; + int mindist, distx, disty; + + /* find center of rendered parts, image center counts for 1 too */ + for(pa= re->parts.first; pa; pa= pa->next) { + if(pa->ready) { + centx+= (pa->disprect.xmin+pa->disprect.xmax)/2; + centy+= (pa->disprect.ymin+pa->disprect.ymax)/2; + tot++; + } + } + centx/=tot; + centy/=tot; + + /* closest of the non-rendering parts */ + mindist= re->winx*re->winy; + for(pa= re->parts.first; pa; pa= pa->next) { + if(pa->ready==0 && pa->nr==0) { + distx= centx - (pa->disprect.xmin+pa->disprect.xmax)/2; + disty= centy - (pa->disprect.ymin+pa->disprect.ymax)/2; + distx= (int)sqrt(distx*distx + disty*disty); + if(distxresult==NULL) + return; + if(re->test_break()) + return; + + initparts(re); + init_threadslots(maxthreads); + + /* assuming no new data gets added to dbase... */ + R= *re; + + malloc_lock = SDL_CreateMutex(); + + while(rendering) { + + /* I noted that test_break() in a thread doesn't make ghost send ESC */ + if(available_threadslots() && !re->test_break()) { + pa= find_nicest_part(re); + if(pa) { + insert_threadslot(pa); + pa->nr= counter++; /* only for stats */ + SDL_CreateThread(do_part_thread, pa); + } + } + else + PIL_sleep_ms(50); + + /* check for ready ones to display, and if we need to continue */ + rendering= 0; + for(pa= re->parts.first; pa; pa= pa->next) { + if(pa->ready) { + if(pa->result) { + re->display_draw(pa->result, NULL); + free_render_result(pa->result); + pa->result= NULL; + re->i.partsdone++; + } + } + else rendering= 1; + } + + /* on break, wait for all slots to get freed */ + if(re->test_break() && available_threadslots()==maxthreads) + rendering= 0; + + } + + if(malloc_lock) SDL_DestroyMutex(malloc_lock); malloc_lock= NULL; + + freeparts(re); +} + +void RE_TileProcessor(Render *re) +{ + if(re->r.mode & R_THREADS) + threaded_tile_processor(re); + else + render_tile_processor(re); +} + + +/* ************ This part uses API, for rendering Blender scenes ********** */ + +void render_one_frame(Render *re) +{ + +// re->cfra= cfra; /* <- unused! */ + + /* make render verts/faces/halos/lamps */ + RE_Database_FromScene(re, re->scene, 1); + + RE_TileProcessor(re); + + /* free all render verts etc */ + RE_Database_Free(re); +} + +/* accumulates osa frames */ +static void do_render_blurred(Render *re, float frame) +{ + +} + +/* interleaves 2 frames */ +static void do_render_fields(Render *re) +{ + +} + +static void do_render_final(Render *re, Scene *scene) +{ + if(re->r.scemode & R_DOSEQ) { + re->result->rect32= MEM_callocN(sizeof(int)*re->rectx*re->recty, "rectot"); + if(!re->test_break()) + do_render_seq(re->result); + } + else { + + re->scene= scene; + + /* now use renderdata and camera to set viewplane */ + RE_SetCamera(re, re->scene->camera); + + if(re->r.mode & R_FIELDS) + do_render_fields(re); + else if(re->r.mode & R_MBLUR) + do_render_blurred(re, re->scene->r.cfra); + else + render_one_frame(re); + } + + + re->i.lastframetime= PIL_check_seconds_timer()- re->i.starttime; + re->stats_draw(&re->i); + + re->display_draw(re->result, NULL); + +} + + +static int is_rendering_allowed(Render *re) +{ + + /* forbidden combinations */ + if(re->r.mode & R_PANORAMA) { + if(re->r.mode & R_BORDER) { + re->error("No border supported for Panorama"); + return 0; + } + if(re->r.yparts>1) { + re->error("No Y-Parts supported for Panorama"); + return 0; + } + if(re->r.mode & R_ORTHO) { + re->error("No Ortho render possible for Panorama"); + return 0; + } + } + + if(re->r.mode & R_BORDER) { + if(re->r.border.xmax <= re->r.border.xmin || + re->r.border.ymax <= re->r.border.ymin) { + re->error("No border area selected."); + return 0; + } + } + + if(re->r.xparts*re->r.yparts>=2 && (re->r.mode & R_MOVIECROP) && (re->r.mode & R_BORDER)) { + re->error("Combination of border, crop and parts not allowed"); + return 0; + } + + if(re->r.xparts*re->r.yparts>64) { + re->error("No more than 64 parts supported"); + return 0; + } + + if(re->r.yparts>1 && (re->r.mode & R_PANORAMA)) { + re->error("No Y-Parts supported for Panorama"); + return 0; + } + + /* check valid camera */ + if(re->scene->camera==NULL) + re->scene->camera= scene_find_camera(re->scene); + if(re->scene->camera==NULL) { + re->error("No camera"); + return 0; + } + + + return 1; +} + +/* evaluating scene options for general Blender render */ +static int render_initialize_from_scene(Render *re, Scene *scene) +{ + int winx, winy; + rcti disprect; + + /* r.xsch and r.ysch has the actual view window size + r.border is the clipping rect */ + + /* calculate actual render result and display size */ + winx= (scene->r.size*scene->r.xsch)/100; + winy= (scene->r.size*scene->r.ysch)/100; + // if(scene->r.mode & R_PANORAMA) + // winx*= scene->r.xparts; + + /* only in movie case we render smaller part */ + if(scene->r.mode & R_BORDER) { + disprect.xmin= scene->r.border.xmin*winx; + disprect.xmax= scene->r.border.xmax*winx; + + disprect.ymin= scene->r.border.ymin*winy; + disprect.ymax= scene->r.border.ymax*winy; + } + else { + disprect.xmin= disprect.ymin= 0; + disprect.xmax= winx; + disprect.ymax= winy; + } + + RE_InitState(re, &scene->r, winx, winy, &disprect); + + re->scene= scene; + if(!is_rendering_allowed(re)) + return 0; + + re->display_init(re->result); + re->display_clear(re->result); + + return 1; +} + +/* general Blender frame render call */ +/* should return 1 when all is OK, otherwise it throws up errors */ +void RE_BlenderFrame(Render *re, Scene *scene, int frame) +{ + /* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */ + /* is also set by caller renderwin.c */ + G.rendering= 1; + + if(render_initialize_from_scene(re, scene)) { + do_render_final(re, scene); + } +} + + +/* saves images to disk */ +void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra) +{ + bMovieHandle *mh= BKE_get_movie_handle(scene->r.imtype); + int cfrao= scene->r.cfra; + char name[FILE_MAXDIR+FILE_MAXFILE]; + + /* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */ + /* is also set by caller renderwin.c */ + G.rendering= 1; + + if(!render_initialize_from_scene(re, scene)) + return; + + if(BKE_imtype_is_movie(scene->r.imtype)) + mh->start_movie(&G.scene->r, re->rectx, re->recty); + + for(scene->r.cfra= sfra; scene->r.cfra<=efra; G.scene->r.cfra++) { + + do_render_final(re, scene); + + /* write image or movie */ + if(re->test_break()==0) { + RenderResult *rr= re->result; + RenderLayer *rl= rr->layers.first; + + /* write movie or image */ + if(BKE_imtype_is_movie(scene->r.imtype)) { + if(rr->rect32==NULL) { + rr->rect32= MEM_mallocN(sizeof(int)*rr->rectx*rr->recty, "temp 32 bits rect"); + } + RE_ResultGet32(re, rr->rect32); + mh->append_movie(scene->r.cfra, rr->rect32, rr->rectx, rr->recty); + printf("Append frame %d", scene->r.cfra); + } + else { + ImBuf *ibuf= IMB_allocImBuf(rr->rectx, rr->recty, scene->r.planes, 0, 0); + int ok; + + BKE_makepicstring(name, (scene->r.cfra)); + ibuf->rect= rr->rect32; /* if not exists, BKE_write_ibuf makes one */ + ibuf->rect_float= rl->rectf; + ibuf->zbuf_float= rl->rectz; + ok= BKE_write_ibuf(ibuf, name, scene->r.imtype, scene->r.subimtype, scene->r.quality); + IMB_freeImBuf(ibuf); /* imbuf knows which rects are not part of ibuf */ + + if(ok==0) { + printf("Render error: cannot save %s\n", name); + break; + } + else printf("Saved: %s", name); + } + + BLI_timestr(re->i.lastframetime, name); + printf(" Time: %s\n", name); + fflush(stdout); /* needed for renderd !! (not anymore... (ton)) */ + } + + if(G.afbreek==1) break; + } + + /* end movie */ + if(BKE_imtype_is_movie(scene->r.imtype)) + mh->end_movie(); + + scene->r.cfra= cfrao; +} + + + diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c index f774a624ba9..73a8e86bc95 100644 --- a/source/blender/render/intern/source/pixelblending.c +++ b/source/blender/render/intern/source/pixelblending.c @@ -6,15 +6,12 @@ * * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -28,29 +25,29 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. + * Contributor(s): Full recode, 2004-2006 Blender Foundation * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ #include /* global includes */ -#include "render.h" - -/* local includes */ -#include "vanillaRenderPipe_types.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" /* own includes */ +#include "render_types.h" +#include "renderpipeline.h" #include "pixelblending.h" #include "gammaCorrectionTables.h" -/* externals */ -#ifdef HAVE_CONFIG_H -#include -#endif +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + /* ------------------------------------------------------------------------- */ /* Debug/behaviour defines */ @@ -72,88 +69,6 @@ #define RE_EMPTY_COLOUR_FLOAT 0.0002 -/* functions --------------------------------------------------------------- */ - -/* - One things about key-alpha is that simply dividing by the alpha will - sometimes cause 'overflows' in that the pixel colours will be shot - way over full colour. This should be caught, and subsequently, the - operation will end up modifying the alpha as well. - - Actually, when the starting colour is premul, it shouldn't overflow - ever. Strange thing is that colours keep overflowing... - -*/ -void applyKeyAlphaCharCol(char* target) { - - if ((!(target[3] == 0)) - || (target[3] == 255)) { - /* else: nothing to do */ - /* check whether div-ing is enough */ - float cf[4]; - cf[0] = target[0]/target[3]; - cf[1] = target[1]/target[3]; - cf[2] = target[2]/target[3]; - if ((cf[0] <= 1.0) && (cf[1] <= 1.0) && (cf[2] <= 1.0)) { - /* all colours remain properly scaled? */ - /* scale to alpha */ - cf[0] = (float) target[0] * (255.0/ (float)target[3]); - cf[1] = (float) target[1] * (255.0/ (float)target[3]); - cf[2] = (float) target[2] * (255.0/ (float)target[3]); - - /* Clipping is important. */ - target[0] = (cf[0] > 255.0 ? 255 : (char) cf[0]); - target[1] = (cf[1] > 255.0 ? 255 : (char) cf[1]); - target[2] = (cf[2] > 255.0 ? 255 : (char) cf[2]); - - } else { - /* shouldn't happen! we were premul, remember? */ -/* should go to error handler: printf("Non-premul colour detected\n"); */ - } - } - -} - -/* ------------------------------------------------------------------------- */ - -void addAddSampColF(float *sampvec, float *source, int mask, int osaNr, - char addfac) -{ - int a; - - for(a=0; a < osaNr; a++) { - if(mask & (1< RE_FULL_COLOUR_FLOAT) retval--; - sampvec+= 4; - } - return retval; -} - - /* ------------------------------------------------------------------------- */ void addAlphaOverFloat(float *dest, float *source) @@ -211,106 +126,6 @@ void addAlphaUnderFloat(float *dest, float *source) } -/* ------------------------------------------------------------------------- */ - -void cpShortColV2CharColV(unsigned short *source, char *dest) -{ - dest[0] = source[0]>>8; - dest[1] = source[1]>>8; - dest[2] = source[2]>>8; - dest[3] = source[3]>>8; -} -/* ------------------------------------------------------------------------- */ - -void cpCharColV2ShortColV(char *source, unsigned short *dest) -{ - dest[0] = source[0]<<8; - dest[1] = source[1]<<8; - dest[2] = source[2]<<8; - dest[3] = source[3]<<8; -} - -/* ------------------------------------------------------------------------- */ - -void cpIntColV2CharColV(unsigned int *source, char *dest) -{ - dest[0] = source[0]>>24; - dest[1] = source[1]>>24; - dest[2] = source[2]>>24; - dest[3] = source[3]>>24; -} - -/* ------------------------------------------------------------------------- */ - -void cpCharColV2FloatColV(char *source, float *dest) -{ - dest[0] = source[0]/255.0; - dest[1] = source[1]/255.0; - dest[2] = source[2]/255.0; - dest[3] = source[3]/255.0; -} - -/* ------------------------------------------------------------------------- */ - -void cpShortColV2FloatColV(unsigned short *source, float *dest) -{ - dest[0] = source[0]/65535.0; - dest[1] = source[1]/65535.0; - dest[2] = source[2]/65535.0; - dest[3] = source[3]/65535.0; -} - -/* ------------------------------------------------------------------------- */ - -void cpFloatColV2CharColV(float* source, char *dest) -{ - /* can't this be done more efficient? hope the conversions are correct... */ - if (source[0] < 0.0) dest[0] = 0; - else if (source[0] > 1.0) dest[0] = 255; - else dest[0] = (char) (source[0] * 255.0); - - if (source[1] < 0.0) dest[1] = 0; - else if (source[1] > 1.0) dest[1] = 255; - else dest[1] = (char) (source[1] * 255.0); - - if (source[2] < 0.0) dest[2] = 0; - else if (source[2] > 1.0) dest[2] = 255; - else dest[2] = (char) (source[2] * 255.0); - - if (source[3] < 0.0) dest[3] = 0; - else if (source[3] > 1.0) dest[3] = 255; - else dest[3] = (char) (source[3] * 255.0); - -} - -/* ------------------------------------------------------------------------- */ - -void cpShortColV(unsigned short *source, unsigned short *dest) -{ - dest[0] = source[0]; - dest[1] = source[1]; - dest[2] = source[2]; - dest[3] = source[3]; -} - -/* ------------------------------------------------------------------------- */ -void cpFloatColV(float *source, float *dest) -{ - dest[0] = source[0]; - dest[1] = source[1]; - dest[2] = source[2]; - dest[3] = source[3]; -} - -/* ------------------------------------------------------------------------- */ - -void cpCharColV(char *source, char *dest) -{ - dest[0] = source[0]; - dest[1] = source[1]; - dest[2] = source[2]; - dest[3] = source[3]; -} /* ------------------------------------------------------------------------- */ void addalphaAddfacFloat(float *dest, float *source, char addfac) @@ -353,43 +168,27 @@ void addalphaAddfacFloat(float *dest, float *source, char addfac) } -/* ------------------------------------------------------------------------- */ - -void sampleShortColV2ShortColV(unsigned short *sample, unsigned short *dest, int osaNr) -{ - unsigned int intcol[4] = {0}; - unsigned short *scol = sample; - int a = 0; - - for(a=0; a < osaNr; a++, scol+=4) { - intcol[0]+= scol[0]; intcol[1]+= scol[1]; - intcol[2]+= scol[2]; intcol[3]+= scol[3]; - } - - /* Now normalise the integrated colour. It is guaranteed */ - /* to be correctly bounded. */ - dest[0]= intcol[0]/osaNr; - dest[1]= intcol[1]/osaNr; - dest[2]= intcol[2]/osaNr; - dest[3]= intcol[3]/osaNr; - -} /* ------------------------------------------------------------------------- */ /* filtered adding to scanlines */ -void add_filt_fmask(unsigned int mask, float *col, float *rb1, float *rb2, float *rb3) +void add_filt_fmask(unsigned int mask, float *col, float *rowbuf, int row_w) { /* calc the value of mask */ - extern float *fmask1[], *fmask2[]; + float **fmask1= R.samples->fmask1, **fmask2=R.samples->fmask2; + float *rb1, *rb2, *rb3; float val, r, g, b, al; unsigned int a, maskand, maskshift; int j; - al= col[3]; r= col[0]; g= col[1]; b= col[2]; + al= col[3]; + + rb2= rowbuf-4; + rb1= rb2-4*row_w; + rb3= rb2+4*row_w; maskand= (mask & 255); maskshift= (mask >>8); @@ -400,28 +199,28 @@ void add_filt_fmask(unsigned int mask, float *col, float *rb1, float *rb2, float val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift); if(val!=0.0) { - rb1[3]+= val*al; rb1[0]+= val*r; rb1[1]+= val*g; rb1[2]+= val*b; + rb1[3]+= val*al; } a+=3; val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift); if(val!=0.0) { - rb2[3]+= val*al; rb2[0]+= val*r; rb2[1]+= val*g; rb2[2]+= val*b; + rb2[3]+= val*al; } a+=3; val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift); if(val!=0.0) { - rb3[3]+= val*al; rb3[0]+= val*r; rb3[1]+= val*g; rb3[2]+= val*b; + rb3[3]+= val*al; } rb1+= 4; @@ -430,186 +229,6 @@ void add_filt_fmask(unsigned int mask, float *col, float *rb1, float *rb2, float } } - -void sampleFloatColV2FloatColVFilter(float *sample, float *dest1, float *dest2, float *dest3, int osaNr) -{ - float intcol[4] = {0}; - float *scol = sample; - int a = 0; - - if(osaNr==1) { - dest2[4]= sample[0]; - dest2[5]= sample[1]; - dest2[6]= sample[2]; - dest2[7]= sample[3]; - } - else { - if (do_gamma) { - /* use a LUT and interpolation to do the gamma correction */ - for(a=0; a < osaNr; a++, scol+=4) { - intcol[0] = gammaCorrect( (scol[0]<1.0) ? scol[0]:1.0 ); - intcol[1] = gammaCorrect( (scol[1]<1.0) ? scol[1]:1.0 ); - intcol[2] = gammaCorrect( (scol[2]<1.0) ? scol[2]:1.0 ); - intcol[3] = scol[3]; - add_filt_fmask(1<255) doel[0]=255; - else doel[0]= c; - c= (doel[1]<<8)/div; - if(c>255) doel[1]=255; - else doel[1]= c; - c= (doel[2]<<8)/div; - if(c>255) doel[2]=255; - else doel[2]= c; - } -} - -/* ------------------------------------------------------------------------- */ -/* fills in bron (source) under doel (target) with alpha of doel*/ -void addalphaUnder(char *doel, char *bron) -{ - int c; - int mul; - - if(doel[3]==255) return; - if( doel[3]==0) { /* tested */ - *((unsigned int *)doel)= *((unsigned int *)bron); - return; - } - - mul= 255-doel[3]; - - c= doel[0]+ ((mul*bron[0])/255); - if(c>255) doel[0]=255; - else doel[0]= c; - c= doel[1]+ ((mul*bron[1])/255); - if(c>255) doel[1]=255; - else doel[1]= c; - c= doel[2]+ ((mul*bron[2])/255); - if(c>255) doel[2]=255; - else doel[2]= c; - - c= doel[3]+ ((mul*bron[3])/255); - if(c>255) doel[3]=255; - else doel[3]= c; - - /* doel[0]= MAX2(doel[0], bron[0]); */ -} - -/* ------------------------------------------------------------------------- */ -/* gamma-corrected */ -void addalphaUnderGamma(char *doel, char *bron) -{ - unsigned int tot; - int c, doe, bro; - int mul; - - /* if doel[3]==0 or doel==255 has been handled in sky loop */ - mul= 256-doel[3]; - - doe= igamtab1[(int)doel[0]]; - bro= igamtab1[(int)bron[0]]; - tot= (doe+ ((mul*bro)>>8)); - if(tot>65535) tot=65535; - doel[0]= *((gamtab+tot)) >>8; - - doe= igamtab1[(int)doel[1]]; - bro= igamtab1[(int)bron[1]]; - tot= (doe+ ((mul*bro)>>8)); - if(tot>65535) tot=65535; - doel[1]= *((gamtab+tot)) >>8; - - doe= igamtab1[(int)doel[2]]; - bro= igamtab1[(int)bron[2]]; - tot= (doe+ ((mul*bro)>>8)); - if(tot>65535) tot=65535; - doel[2]= *((gamtab+tot)) >>8; - - c= doel[3]+ ((mul*bron[3])/255); - if(c>255) doel[3]=255; - else doel[3]= c; - /* doel[0]= MAX2(doel[0], bron[0]); */ -} - -/* ------------------------------------------------------------------------- */ -/* doel= bron over doel */ -void addalphaOver(char *doel, char *bron) -{ - int c; - int mul; - - if(bron[3]==0) return; - if( bron[3]==255) { /* tested */ - *((unsigned int *)doel)= *((unsigned int *)bron); - return; - } - - mul= 255-bron[3]; - - c= ((mul*doel[0])/255)+bron[0]; - if(c>255) doel[0]=255; - else doel[0]= c; - c= ((mul*doel[1])/255)+bron[1]; - if(c>255) doel[1]=255; - else doel[1]= c; - c= ((mul*doel[2])/255)+bron[2]; - if(c>255) doel[2]=255; - else doel[2]= c; - c= ((mul*doel[3])/255)+bron[3]; - if(c>255) doel[3]=255; - else doel[3]= c; -} - -/* ------------------------------------------------------------------------- */ -void addalphaAdd(char *doel, char *bron) /* adds bron (source) to doel (target) */ -{ - int c; - - if( doel[3]==0 || bron[3]==255) { /* tested */ - *((unsigned int *)doel)= *((unsigned int *)bron); - return; - } - c= doel[0]+bron[0]; - if(c>255) doel[0]=255; - else doel[0]= c; - c= doel[1]+bron[1]; - if(c>255) doel[1]=255; - else doel[1]= c; - c= doel[2]+bron[2]; - if(c>255) doel[2]=255; - else doel[2]= c; - c= doel[3]+bron[3]; - if(c>255) doel[3]=255; - else doel[3]= c; -} - /* ------------------------------------------------------------------------- */ void addalphaAddFloat(float *dest, float *source) { @@ -631,44 +250,136 @@ void addalphaAddFloat(float *dest, float *source) } -/* ALPHADDFAC: - * - * Z= X alphaover Y: - * Zrgb= (1-Xa)*Yrgb + Xrgb - * - * (1-fac)*(1-Xa) + fac <=> - * 1-Xa-fac+fac*Xa+fac <=> - * Xa*(fac-1)+1 - */ +/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -/* doel= bron over doel */ -void RE_addalphaAddfac(char *doel, char *bron, char addfac) +/* Colour buffer related: */ +/* This transforms the 4 inputvalues RE_COLBUFTYPE to a new value */ +/* It expects the values R.r.postigamma, R.r.postmul and R.r.postadd. */ +/* This is the standard transformation, more elaborate tools are for later. */ +/* ------------------------------------------------------------------------- */ +void std_floatcol_to_charcol( float *buf, char *target) { + float col[3]; + + float dither_value; + + dither_value = ((BLI_frand()-0.5)*R.r.dither_intensity)/256.0; - int c, mul; - - mul= 255 - (bron[3]*(255-addfac))/255; - - c= ((mul*doel[0])/255)+bron[0]; - if(c>255) doel[0]=255; - else doel[0]= c; - c= ((mul*doel[1])/255)+bron[1]; - if(c>255) doel[1]=255; - else doel[1]= c; - c= ((mul*doel[2])/255)+bron[2]; - if(c>255) doel[2]=255; - else doel[2]= c; + /* alpha */ + if((buf[3]+dither_value)<=0.0) target[3]= 0; + else if((buf[3]+dither_value)>1.0) target[3]= 255; + else target[3]= 255.0*(buf[3]+dither_value); + + if(R.r.postgamma==1.0) { + /* r */ + col[0]= R.r.postmul*buf[0] + R.r.postadd + dither_value; + /* g */ + col[1]= R.r.postmul*buf[1] + R.r.postadd + dither_value; + /* b */ + col[2]= R.r.postmul*buf[2] + R.r.postadd + dither_value; + } + else { + /* putting the postmul within the pow() gives an + * easier control for the user, values from 1.0-2.0 + * are relevant then + */ + + /* r */ + col[0]= pow(R.r.postmul*buf[0], R.r.postigamma) + R.r.postadd + dither_value; + /* g */ + col[1]= pow( R.r.postmul*buf[1], R.r.postigamma) + R.r.postadd + dither_value; + /* b */ + col[2]= pow(R.r.postmul*buf[2], R.r.postigamma) + R.r.postadd + dither_value; + } - /* c= ((mul*doel[3])/255)+bron[3]; */ - c= doel[3]+bron[3]; - if(c>255) doel[3]=255; - else doel[3]= c; + if(R.r.posthue!=0.0 || R.r.postsat!=1.0) { + float hsv[3]; + + rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2); + hsv[0]+= R.r.posthue; + if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; + hsv[1]*= R.r.postsat; + if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0; + hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); + } + + if(col[0]<=0.0) target[0]= 0; + else if(col[0]>1.0) target[0]= 255; + else target[0]= 255.0*col[0]; + + if(col[1]<=0.0) target[1]= 0; + else if(col[1]>1.0) target[1]= 255; + else target[1]= 255.0*col[1]; + + if(col[2]<=0.0) target[2]= 0; + else if(col[2]>1.0) target[2]= 255; + else target[2]= 255.0*col[2]; } +/* ---------------------------------------------------------------------------- + +Colour buffer related: + +The colour buffer is a buffer of a single screen line. It contains +four fields of type RE_COLBUFTYPE per pixel. + +We can do several post-process steps. I would prefer to move them outside +the render module later on, but it's ok to leave it here for now. For the +time being, we have: +- post-process function + Does some operations with the colours. +- Multiply with some factor +- Add constant offset +- Apply extra gamma correction (seems weird...) +- key-alpha correction + Key alpha means 'un-applying' the alpha. For fully covered pixels, this + operation has no effect. + +- XXX WARNING! Added the inverse render gamma here, so this cannot be used external + without setting Osa or Gamma flags off (ton) + +---------------------------------------------------------------------------- */ +/* used external! */ +void transferColourBufferToOutput( float *buf, int y) +{ + /* Copy the contents of AColourBuffer3 to R.rectot + y * R.rectx */ + int x = 0; +// char *target = (char*) (R.rectot + (y * R.rectx)); + + /* Copy the first pixels. We can do some more clipping on */ + /* the z buffer, I think. */ + while (x < R.rectx) { + + + /* invert gamma corrected additions */ + if(R.do_gamma) { + buf[0] = invGammaCorrect(buf[0]); + buf[1] = invGammaCorrect(buf[1]); + buf[2] = invGammaCorrect(buf[2]); + } + +// std_floatcol_to_charcol(buf, target); + + /* + Key-alpha mode: + Need to un-apply alpha if alpha is non-full. For full alpha, + the operation doesn't have effect. Do this after the post- + processing, so we can still use the benefits of that. + + */ + + if (R.r.alphamode == R_ALPHAKEY) { +// applyKeyAlphaCharCol(target); + } + +// target+=4; + buf+=4; + x++; + } +} -/* ------------------------------------------------------------------------- */ /* eof pixelblending.c */ diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 4878b738767..53bce2cbb84 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -1,14 +1,11 @@ /** * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -22,17 +19,9 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Shading of pixels - * - * 11-09-2000 nzc - * - * $Id$ + * Contributor(s): 2004-2006, Blender Foundation, full recode * + * ***** END GPL LICENSE BLOCK ***** */ #include @@ -57,105 +46,23 @@ #include "BKE_texture.h" #include "BKE_utildefines.h" -#include "render.h" +/* own module */ +#include "render_types.h" +#include "renderpipeline.h" +#include "renderdatabase.h" #include "texture.h" - -#include "vanillaRenderPipe_types.h" #include "pixelblending.h" -#include "rendercore.h" /* for some shading functions... */ +#include "rendercore.h" #include "shadbuf.h" -#include "zbufferdatastruct.h" - -#include "renderHelp.h" - #include "gammaCorrectionTables.h" -#include "errorHandler.h" #include "pixelshading.h" +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* ton: - - unified render now uses face render routines from rendercore.c - - todo still: shalo render and sky routines */ - - -/* ------------------------------------------------------------------------- */ -static int calcHaloZ(HaloRen *har, int zz) -{ - - if(har->type & HA_ONLYSKY) { - if(zz!=0x7FFFFFFF) zz= - 0x7FFFFF; - } - else { - zz= (zz>>8); - } - return zz; -} - -static void *renderHaloPixel(RE_COLBUFTYPE *collector, float x, float y, int haloNr) -{ - HaloRen *har = NULL; - float dist = 0.0; - int zz = 0; - - /* Find har to go with haloNr */ - har = RE_findOrAddHalo(haloNr); - - /* zz is a strange number... This call should effect that halo's are */ - /* never cut? Seems a bit strange to me now... (nzc) */ - /* it checks for sky... which is info not available in unified (ton) */ - zz = calcHaloZ(har, 0x7FFFFFFF); - if(zz> har->zs) { - - /* distance of this point wrt. the halo center. Maybe xcor is also needed? */ - dist = ((x - har->xs) * (x - har->xs)) - + ((y - har->ys) * (y - har->ys) * R.ycor * R.ycor) ; - - collector[0] = 0.0f; collector[1] = 0.0f; - collector[2] = 0.0f; collector[3] = 0.0f; - - if (dist < har->radsq) { - shadeHaloFloat(har, collector, zz, dist, - (x - har->xs), (y - har->ys) * R.ycor, har->flarec); - }; /* else: this pixel is not rendered for this halo: no colour */ - } - return (void*) har; - -} /* end of void* renderHaloPixel(float x, float y, int haloNr) */ - - - -/* ------------------------------------------------------------------------- */ - -void *renderPixel(RE_COLBUFTYPE *collector, float x, float y, int *obdata, int mask) -{ - void *data = NULL; - float rco[3]; /* not used (yet?) */ - - if (obdata[3] & RE_POLY) { - data = shadepixel(x, y, obdata[0], obdata[1], mask, collector, rco); - } - else if (obdata[3] & RE_HALO) { - data = renderHaloPixel(collector, x, y, obdata[1]); - } - else if( obdata[1] == 0 ) { - /* for lamphalo, but doesn't seem to be called? Actually it is, and */ - /* it returns NULL pointers. */ - data = shadepixel(x, y, obdata[0], obdata[1], mask, collector, rco); - } - return data; - -} /* end of void renderPixel(float x, float y, int *obdata) */ - -/* ------------------------------------------------------------------------- */ - -void renderSpotHaloPixel(float x, float y, float* fcol) -{ - float rco[3]; /* unused */ - shadepixel(x, y, 0, 0, 0, fcol, rco); -} - - -/* ------------------------------------------------------------------------- */ extern float hashvectf[]; @@ -537,29 +444,14 @@ void shadeHaloFloat(HaloRen *har, float *col, int zz, */ -/* Sky vars. */ -enum RE_SkyAlphaBlendingType keyingType = RE_ALPHA_SKY; /* The blending type */ - -void setSkyBlendingMode(enum RE_SkyAlphaBlendingType mode) { - if ((RE_ALPHA_NODEF < mode) && (mode < RE_ALPHA_MAX) ) { - keyingType = mode; - } else { - /* error: false mode received */ - keyingType = RE_ALPHA_SKY; - } -} - -enum RE_SkyAlphaBlendingType getSkyBlendingMode() { - return keyingType; -} /* This one renders into collector, as always. */ -void renderSkyPixelFloat(RE_COLBUFTYPE *collector, float x, float y, float *rco) +void renderSkyPixelFloat(float *collector, float x, float y, float *rco) { - switch (keyingType) { - case RE_ALPHA_PREMUL: - case RE_ALPHA_KEY: + switch (R.r.alphamode) { + case R_ALPHAPREMUL: + case R_ALPHAKEY: /* Premul or key: don't fill, and don't change the values! */ /* key alpha used to fill in color in 'empty' pixels, doesn't work anymore this way */ collector[0] = 0.0; @@ -567,7 +459,7 @@ void renderSkyPixelFloat(RE_COLBUFTYPE *collector, float x, float y, float *rco) collector[2] = 0.0; collector[3] = 0.0; break; - case RE_ALPHA_SKY: + case R_ADDSKY: /* Fill in the sky as if it were a normal face. */ shadeSkyPixel(collector, x, y, rco); collector[3]= 0.0; @@ -577,123 +469,10 @@ void renderSkyPixelFloat(RE_COLBUFTYPE *collector, float x, float y, float *rco) } } - - -/* - Render pixel (x,y) from the backbuffer into the collector - - backbuf is type Image, backbuf->ibuf is an ImBuf. ibuf->rect is the - rgba data (32 bit total), in ibuf->x by ibuf->y pixels. Copying - should be really easy. I hope I understand the way ImBuf works - correctly. (nzc) - */ -void fillBackgroundImageChar(char *col, float x, float y) -{ - struct ImBuf *ibuf; - int iy, ix; - unsigned int* imBufPtr; - - /* check to be sure... */ - if (R.backbuf==NULL || R.backbuf->ok==0) { - /* bail out */ - col[0] = 0; - col[1] = 0; - col[2] = 0; - col[3] = 255; - return; - } - /* load image if not already done?*/ - if(R.backbuf->ibuf==0) { - R.backbuf->ok= 0; - return; - } - - ibuf= R.backbuf->ibuf; - - /* Now for the real extraction: */ - /* Get the y-coordinate of the scanline? */ - ix= (int) (0.5f + ( ((x+R.afmx+R.xstart)/(float)R.r.xsch))*(float)ibuf->x); - iy= (int) (0.5f + ( ((y+R.afmy+R.ystart)/(float)R.r.ysch))*(float)ibuf->y); - - /* correct in case of fields rendering: */ - if(R.flag & R_SEC_FIELD) { - if((R.r.mode & R_ODDFIELD)==0) { - if( iyy) iy++; - } - else { - if( iy>0) iy--; - } - } - - /* Offset into the buffer: start of scanline y: */ - imBufPtr = ibuf->rect - + (iy * ibuf->x) - + ix; - - *( (int *)col) = *imBufPtr; - -} - -static void fillBackgroundImage(float *col, float x, float y) -{ - struct ImBuf *ibuf; - int iy, ix; - - /* check to be sure... */ - if (R.backbuf==NULL || R.backbuf->ok==0) { - /* bail out */ - col[0] = 0; - col[1] = 0; - col[2] = 0; - col[3] = 255; - return; - } - /* load image if not already done?*/ - if(R.backbuf->ibuf==NULL) { - R.backbuf->ok= 0; - return; - } - - ibuf= R.backbuf->ibuf; - - /* Now for the real extraction: */ - /* Get the y-coordinate of the scanline? */ - ix= (int) (( ((x+R.afmx+R.xstart)/(float)R.r.xsch))*(float)ibuf->x); - iy= (int) (( ((y+R.afmy+R.ystart)/(float)R.r.ysch))*(float)ibuf->y); - - /* correct in case of fields rendering: */ - if(R.flag & R_SEC_FIELD) { - if((R.r.mode & R_ODDFIELD)==0) { - if( iyy) iy++; - } - else { - if( iy>0) iy--; - } - } - - CLAMP(ix, 0, ibuf->x-1); - CLAMP(iy, 0, ibuf->y-1); - - /* Offset into the buffer: start of scanline y: */ - if(ibuf->rect_float) { - float *fp = ibuf->rect_float + 4*(iy * ibuf->x + ix); - QUATCOPY(col, fp); - } - else { - char *cp = (char *)(ibuf->rect + (iy * ibuf->x) + ix); - - col[0]= (1.0f/255.0f) * (float)cp[0]; - col[1]= (1.0f/255.0f) * (float)cp[1]; - col[2]= (1.0f/255.0f) * (float)cp[2]; - col[3]= (1.0f/255.0f) * (float)cp[3]; - } - -} - /* Stuff the sky colour into the collector. */ -void shadeSkyPixel(RE_COLBUFTYPE *collector, float fx, float fy, float *rco) +void shadeSkyPixel(float *collector, float fx, float fy, float *rco) { float view[3], dxyview[2]; @@ -707,7 +486,7 @@ void shadeSkyPixel(RE_COLBUFTYPE *collector, float fx, float fy, float *rco) /* 1. Do a backbuffer image: */ if(R.r.bufflag & 1) { - fillBackgroundImage(collector, fx, fy); +// fillBackgroundImage(collector, fx, fy); return; } else if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) { /* @@ -730,26 +509,17 @@ void shadeSkyPixel(RE_COLBUFTYPE *collector, float fx, float fy, float *rco) /* This one true because of the context of this routine */ /* if(rect[3] < 254) { */ if(R.wrld.skytype & WO_SKYPAPER) { - view[0]= (fx+(R.xstart))/(float)R.afmx; - view[1]= (fy+(R.ystart))/(float)R.afmy; + view[0]= (fx/(float)R.winx); + view[1]= (fy/(float)R.winy); view[2]= 0.0; - dxyview[0]= 1.0/(float)R.afmx; - dxyview[1]= 1.0/(float)R.afmy; + dxyview[0]= 1.0f/(float)R.winx; + dxyview[1]= 1.0f/(float)R.winy; } else { - /* Wasn't this some pano stuff? */ - view[0]= (fx+(R.xstart)+1.0); - - if(R.flag & R_SEC_FIELD) { - if(R.r.mode & R_ODDFIELD) view[1]= (fy+R.ystart+0.5)*R.ycor; - else view[1]= (fy+R.ystart+1.5)*R.ycor; - } - else view[1]= (fy+R.ystart+1.0)*R.ycor; - - view[2]= -R.viewfac; - + calc_view_vector(view, fx, fy); fac= Normalise(view); + if(R.wrld.skytype & WO_SKYTEX) { dxyview[0]= 1.0/fac; dxyview[1]= R.ycor/fac; @@ -757,15 +527,10 @@ void shadeSkyPixel(RE_COLBUFTYPE *collector, float fx, float fy, float *rco) } if(R.r.mode & R_PANORAMA) { - float panoco, panosi; - float u, v; - - panoco = getPanovCo(); - panosi = getPanovSi(); - u= view[0]; v= view[2]; + float u= view[0]; float v= view[2]; - view[0]= panoco*u + panosi*v; - view[2]= -panosi*u + panoco*v; + view[0]= R.panoco*u + R.panosi*v; + view[2]= -R.panosi*u + R.panoco*v; } /* get sky colour in the collector */ diff --git a/source/blender/render/intern/source/ray.c b/source/blender/render/intern/source/ray.c index a91219846de..19ec1dd546d 100644 --- a/source/blender/render/intern/source/ray.c +++ b/source/blender/render/intern/source/ray.c @@ -1,15 +1,12 @@ /** * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,15 +20,16 @@ * The Original Code is Copyright (C) 1990-1998 NeoGeo BV. * All rights reserved. * - * The Original Code is: all of this file. + * Contributors: 2004/2005 Blender Foundation, full recode * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ #include #include #include +#include #include "MEM_guardedalloc.h" @@ -42,17 +40,16 @@ #include "BKE_global.h" #include "BLI_arithb.h" -#include +#include "BLI_rand.h" +#include "BLI_jitter.h" -#include "render.h" +#include "render_types.h" +#include "renderpipeline.h" #include "rendercore.h" #include "pixelblending.h" #include "pixelshading.h" -#include "jitter.h" #include "texture.h" -#include "SDL_thread.h" - #define DDA_SHADOW 0 #define DDA_MIRROR 1 #define DDA_SHADOW_TRA 2 @@ -61,23 +58,17 @@ #define RAY_TRAFLIP 2 #define DEPTH_SHADOW_TRA 10 -/* from float.h */ -#define FLT_EPSILON 1.19209290e-07F +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* ********** structs *************** */ #define BRANCH_ARRAY 1024 - -typedef struct Octree { - struct Branch *adrbranch[BRANCH_ARRAY]; - struct Node *adrnode[4096]; - float ocsize; /* ocsize: mult factor, max size octree */ - float ocfacx,ocfacy,ocfacz; - float min[3], max[3]; - int ocres; - -} Octree; +#define NODE_ARRAY 4096 typedef struct Isect { float start[3], vec[3], end[3]; /* start+vec = end, in d3dda */ @@ -112,16 +103,10 @@ typedef struct Node /* ******** globals ***************** */ -static Octree g_oc; /* can be scene pointer or so later... */ - /* just for statistics */ -static int raycount, branchcount, nodecount; +static int raycount; static int accepted, rejected, coherent_ray; -/* prototypes ------------------------ */ -void freeoctree(void); -void makeoctree(void); -int ray_trace_shadow_rad(ShadeInput *ship, ShadeResult *shr); /* **************** ocval method ******************* */ /* within one octree node, a set of 3x15 bits defines a 'boundbox' to OR with */ @@ -190,36 +175,42 @@ static void calc_ocval_ray(OcVal *ov, float xo, float yo, float zo, float *vec1, /* ************* octree ************** */ -static Branch *addbranch(Branch *br, short oc) +static Branch *addbranch(Octree *oc, Branch *br, short ocb) { + int index; - if(br->b[oc]) return br->b[oc]; + if(br->b[ocb]) return br->b[ocb]; - branchcount++; - if(g_oc.adrbranch[branchcount>>12]==NULL) - g_oc.adrbranch[branchcount>>12]= MEM_callocN(4096*sizeof(Branch),"addbranch"); + oc->branchcount++; + index= oc->branchcount>>12; + + if(oc->adrbranch[index]==NULL) + oc->adrbranch[index]= MEM_callocN(4096*sizeof(Branch), "new oc branch"); - if(branchcount>= BRANCH_ARRAY*4096) { + if(oc->branchcount>= BRANCH_ARRAY*4096) { printf("error; octree branches full\n"); - branchcount=0; + oc->branchcount=0; } - return br->b[oc]=g_oc.adrbranch[branchcount>>12]+(branchcount & 4095); + return br->b[ocb]= oc->adrbranch[index]+(oc->branchcount & 4095); } -static Node *addnode(void) +static Node *addnode(Octree *oc) { + int index; + + oc->nodecount++; + index= oc->nodecount>>12; - nodecount++; - if(g_oc.adrnode[nodecount>>12]==NULL) - g_oc.adrnode[nodecount>>12]= MEM_callocN(4096*sizeof(Node),"addnode"); + if(oc->adrnode[index]==NULL) + oc->adrnode[index]= MEM_callocN(4096*sizeof(Node),"addnode"); - if(nodecount> 4096*4096) { + if(oc->nodecount> NODE_ARRAY*NODE_ARRAY) { printf("error; octree nodes full\n"); - nodecount=0; + oc->nodecount=0; } - return g_oc.adrnode[nodecount>>12]+(nodecount & 4095); + return oc->adrnode[index]+(oc->nodecount & 4095); } static int face_in_node(VlakRen *vlr, short x, short y, short z, float rtf[][3]) @@ -262,7 +253,7 @@ static int face_in_node(VlakRen *vlr, short x, short y, short z, float rtf[][3]) return 0; } -static void ocwrite(VlakRen *vlr, short x, short y, short z, float rtf[][3]) +static void ocwrite(Octree *oc, VlakRen *vlr, short x, short y, short z, float rtf[][3]) { Branch *br; Node *no; @@ -273,19 +264,19 @@ static void ocwrite(VlakRen *vlr, short x, short y, short z, float rtf[][3]) x<<=2; y<<=1; - br= g_oc.adrbranch[0]; + br= oc->adrbranch[0]; - if(g_oc.ocres==512) { + if(oc->ocres==512) { oc0= ((x & 1024)+(y & 512)+(z & 256))>>8; - br= addbranch(br, oc0); + br= addbranch(oc, br, oc0); } - if(g_oc.ocres>=256) { + if(oc->ocres>=256) { oc0= ((x & 512)+(y & 256)+(z & 128))>>7; - br= addbranch(br, oc0); + br= addbranch(oc, br, oc0); } - if(g_oc.ocres>=128) { + if(oc->ocres>=128) { oc0= ((x & 256)+(y & 128)+(z & 64))>>6; - br= addbranch(br, oc0); + br= addbranch(oc, br, oc0); } oc0= ((x & 128)+(y & 64)+(z & 32))>>5; @@ -295,19 +286,19 @@ static void ocwrite(VlakRen *vlr, short x, short y, short z, float rtf[][3]) oc4= ((x & 8)+(y & 4)+(z & 2))>>1; oc5= ((x & 4)+(y & 2)+(z & 1)); - br= addbranch(br,oc0); - br= addbranch(br,oc1); - br= addbranch(br,oc2); - br= addbranch(br,oc3); - br= addbranch(br,oc4); + br= addbranch(oc, br,oc0); + br= addbranch(oc, br,oc1); + br= addbranch(oc, br,oc2); + br= addbranch(oc, br,oc3); + br= addbranch(oc, br,oc4); no= (Node *)br->b[oc5]; - if(no==NULL) br->b[oc5]= (Branch *)(no= addnode()); + if(no==NULL) br->b[oc5]= (Branch *)(no= addnode(oc)); while(no->next) no= no->next; a= 0; if(no->v[7]) { /* node full */ - no->next= addnode(); + no->next= addnode(oc); no= no->next; } else { @@ -320,7 +311,7 @@ static void ocwrite(VlakRen *vlr, short x, short y, short z, float rtf[][3]) } -static void d2dda(short b1, short b2, short c1, short c2, char *ocvlak, short rts[][3], float rtf[][3]) +static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocface, short rts[][3], float rtf[][3]) { int ocx1,ocx2,ocy1,ocy2; int x,y,dx=0,dy=0; @@ -333,7 +324,7 @@ static void d2dda(short b1, short b2, short c1, short c2, char *ocvlak, short rt ocy2= rts[b2][c2]; if(ocx1==ocx2 && ocy1==ocy2) { - ocvlak[g_oc.ocres*ocx1+ocy1]= 1; + ocface[oc->ocres*ocx1+ocy1]= 1; return; } @@ -377,8 +368,8 @@ static void d2dda(short b1, short b2, short c1, short c2, char *ocvlak, short rt while(TRUE) { - if(x<0 || y<0 || x>=g_oc.ocres || y>=g_oc.ocres); - else ocvlak[g_oc.ocres*x+y]= 1; + if(x<0 || y<0 || x>=oc->ocres || y>=oc->ocres); + else ocface[oc->ocres*x+y]= 1; labdao=labda; if(labdax==labday) { @@ -399,10 +390,10 @@ static void d2dda(short b1, short b2, short c1, short c2, char *ocvlak, short rt if(labda==labdao) break; if(labda>=1.0) break; } - ocvlak[g_oc.ocres*ocx2+ocy2]=1; + ocface[oc->ocres*ocx2+ocy2]=1; } -static void filltriangle(short c1, short c2, char *ocvlak, short *ocmin) +static void filltriangle(Octree *oc, short c1, short c2, char *ocface, short *ocmin) { short *ocmax; int a, x, y, y1, y2; @@ -410,14 +401,14 @@ static void filltriangle(short c1, short c2, char *ocvlak, short *ocmin) ocmax=ocmin+3; for(x=ocmin[c1];x<=ocmax[c1];x++) { - a= g_oc.ocres*x; + a= oc->ocres*x; for(y=ocmin[c2];y<=ocmax[c2];y++) { - if(ocvlak[a+y]) { + if(ocface[a+y]) { y++; - while(ocvlak[a+y] && y!=ocmax[c2]) y++; + while(ocface[a+y] && y!=ocmax[c2]) y++; for(y1=ocmax[c2];y1>y;y1--) { - if(ocvlak[a+y1]) { - for(y2=y;y2<=y1;y2++) ocvlak[a+y2]=1; + if(ocface[a+y1]) { + for(y2=y;y2<=y1;y2++) ocface[a+y2]=1; y1=0; } } @@ -427,35 +418,45 @@ static void filltriangle(short c1, short c2, char *ocvlak, short *ocmin) } } -void freeoctree(void) +void freeoctree(Render *re) { - int a= 0; - - while(g_oc.adrbranch[a]) { - MEM_freeN(g_oc.adrbranch[a]); - g_oc.adrbranch[a]= NULL; - a++; - } - - a= 0; - while(g_oc.adrnode[a]) { - MEM_freeN(g_oc.adrnode[a]); - g_oc.adrnode[a]= NULL; - a++; - } + Octree *oc= &re->oc; if(G.f & G_DEBUG) { - printf("branches %d nodes %d\n", branchcount, nodecount); + printf("branches %d nodes %d\n", oc->branchcount, oc->nodecount); printf("raycount %d \n", raycount); printf("ray coherent %d \n", coherent_ray); printf("accepted %d rejected %d\n", accepted, rejected); } - branchcount= 0; - nodecount= 0; + + if(oc->adrbranch) { + int a= 0; + while(oc->adrbranch[a]) { + MEM_freeN(oc->adrbranch[a]); + oc->adrbranch[a]= NULL; + a++; + } + MEM_freeN(oc->adrbranch); + oc->adrbranch= NULL; + } + oc->branchcount= 0; + + if(oc->adrnode) { + int a= 0; + while(oc->adrnode[a]) { + MEM_freeN(oc->adrnode[a]); + oc->adrnode[a]= NULL; + a++; + } + MEM_freeN(oc->adrnode); + oc->adrnode= NULL; + } + oc->nodecount= 0; } -void makeoctree(void) +void makeoctree(Render *re) { + Octree *oc; VlakRen *vlr=NULL; VertRen *v1, *v2, *v3, *v4; float ocfac[3], t00, t01, t02; @@ -463,68 +464,68 @@ void makeoctree(void) int v; int a, b, c, oc1, oc2, oc3, oc4, x, y, z, ocres2; short rts[4][3], ocmin[6], *ocmax; - char *ocvlak; // front, top, size view of face, to fill in + char *ocface; // front, top, size view of face, to fill in - ocmax= ocmin+3; + oc= &re->oc; + oc->adrbranch= MEM_callocN(sizeof(void *)*BRANCH_ARRAY, "octree branches"); + oc->adrnode= MEM_callocN(sizeof(void *)*NODE_ARRAY, "octree nodes"); - memset(g_oc.adrnode, 0, sizeof(g_oc.adrnode)); - memset(g_oc.adrbranch, 0, sizeof(g_oc.adrbranch)); + ocmax= ocmin+3; - branchcount=0; - nodecount=0; + /* only for debug info */ raycount=0; accepted= 0; rejected= 0; coherent_ray= 0; /* fill main octree struct */ - g_oc.ocres= R.r.ocres; - ocres2= g_oc.ocres*g_oc.ocres; - INIT_MINMAX(g_oc.min, g_oc.max); + oc->ocres= re->r.ocres; + ocres2= oc->ocres*oc->ocres; + INIT_MINMAX(oc->min, oc->max); /* first min max octree space */ - for(v=0;v>8]; + for(v=0;vtotvlak;v++) { + if((v & 255)==0) vlr= re->blovl[v>>8]; else vlr++; if(vlr->mat->mode & MA_TRACEBLE) { if((vlr->mat->mode & MA_WIRE)==0) { - DO_MINMAX(vlr->v1->co, g_oc.min, g_oc.max); - DO_MINMAX(vlr->v2->co, g_oc.min, g_oc.max); - DO_MINMAX(vlr->v3->co, g_oc.min, g_oc.max); + DO_MINMAX(vlr->v1->co, oc->min, oc->max); + DO_MINMAX(vlr->v2->co, oc->min, oc->max); + DO_MINMAX(vlr->v3->co, oc->min, oc->max); if(vlr->v4) { - DO_MINMAX(vlr->v4->co, g_oc.min, g_oc.max); + DO_MINMAX(vlr->v4->co, oc->min, oc->max); } } } } - if(g_oc.min[0] > g_oc.max[0]) return; /* empty octree */ + if(oc->min[0] > oc->max[0]) return; /* empty octree */ - g_oc.adrbranch[0]=(Branch *)MEM_callocN(4096*sizeof(Branch), "makeoctree"); + oc->adrbranch[0]=(Branch *)MEM_callocN(4096*sizeof(Branch), "makeoctree"); /* the lookup table, per face, for which nodes to fill in */ - ocvlak= MEM_callocN( 3*ocres2 + 8, "ocvlak"); - memset(ocvlak, 0, 3*ocres2); + ocface= MEM_callocN( 3*ocres2 + 8, "ocface"); + memset(ocface, 0, 3*ocres2); for(c=0;c<3;c++) { /* octree enlarge, still needed? */ - g_oc.min[c]-= 0.01; - g_oc.max[c]+= 0.01; + oc->min[c]-= 0.01; + oc->max[c]+= 0.01; } - t00= g_oc.max[0]-g_oc.min[0]; - t01= g_oc.max[1]-g_oc.min[1]; - t02= g_oc.max[2]-g_oc.min[2]; + t00= oc->max[0]-oc->min[0]; + t01= oc->max[1]-oc->min[1]; + t02= oc->max[2]-oc->min[2]; /* this minus 0.1 is old safety... seems to be needed? */ - g_oc.ocfacx=ocfac[0]= (g_oc.ocres-0.1)/t00; - g_oc.ocfacy=ocfac[1]= (g_oc.ocres-0.1)/t01; - g_oc.ocfacz=ocfac[2]= (g_oc.ocres-0.1)/t02; + oc->ocfacx=ocfac[0]= (oc->ocres-0.1)/t00; + oc->ocfacy=ocfac[1]= (oc->ocres-0.1)/t01; + oc->ocfacz=ocfac[2]= (oc->ocres-0.1)/t02; - g_oc.ocsize= sqrt(t00*t00+t01*t01+t02*t02); /* global, max size octree */ + oc->ocsize= sqrt(t00*t00+t01*t01+t02*t02); /* global, max size octree */ - for(v=0; v>8]; + for(v=0; vtotvlak; v++) { + if((v & 255)==0) vlr= re->blovl[v>>8]; else vlr++; if(vlr->mat->mode & MA_TRACEBLE) { @@ -536,14 +537,14 @@ void makeoctree(void) v4= vlr->v4; for(c=0;c<3;c++) { - rtf[0][c]= (v1->co[c]-g_oc.min[c])*ocfac[c] ; + rtf[0][c]= (v1->co[c]-oc->min[c])*ocfac[c] ; rts[0][c]= (short)rtf[0][c]; - rtf[1][c]= (v2->co[c]-g_oc.min[c])*ocfac[c] ; + rtf[1][c]= (v2->co[c]-oc->min[c])*ocfac[c] ; rts[1][c]= (short)rtf[1][c]; - rtf[2][c]= (v3->co[c]-g_oc.min[c])*ocfac[c] ; + rtf[2][c]= (v3->co[c]-oc->min[c])*ocfac[c] ; rts[2][c]= (short)rtf[2][c]; if(v4) { - rtf[3][c]= (v4->co[c]-g_oc.min[c])*ocfac[c] ; + rtf[3][c]= (v4->co[c]-oc->min[c])*ocfac[c] ; rts[3][c]= (short)rtf[3][c]; } } @@ -563,44 +564,44 @@ void makeoctree(void) ocmin[c]= MIN4(oc1,oc2,oc3,oc4); ocmax[c]= MAX4(oc1,oc2,oc3,oc4); } - if(ocmax[c]>g_oc.ocres-1) ocmax[c]=g_oc.ocres-1; + if(ocmax[c]>oc->ocres-1) ocmax[c]=oc->ocres-1; if(ocmin[c]<0) ocmin[c]=0; } - d2dda(0,1,0,1,ocvlak+ocres2,rts,rtf); - d2dda(0,1,0,2,ocvlak,rts,rtf); - d2dda(0,1,1,2,ocvlak+2*ocres2,rts,rtf); - d2dda(1,2,0,1,ocvlak+ocres2,rts,rtf); - d2dda(1,2,0,2,ocvlak,rts,rtf); - d2dda(1,2,1,2,ocvlak+2*ocres2,rts,rtf); + d2dda(oc, 0,1,0,1,ocface+ocres2,rts,rtf); + d2dda(oc, 0,1,0,2,ocface,rts,rtf); + d2dda(oc, 0,1,1,2,ocface+2*ocres2,rts,rtf); + d2dda(oc, 1,2,0,1,ocface+ocres2,rts,rtf); + d2dda(oc, 1,2,0,2,ocface,rts,rtf); + d2dda(oc, 1,2,1,2,ocface+2*ocres2,rts,rtf); if(v4==NULL) { - d2dda(2,0,0,1,ocvlak+ocres2,rts,rtf); - d2dda(2,0,0,2,ocvlak,rts,rtf); - d2dda(2,0,1,2,ocvlak+2*ocres2,rts,rtf); + d2dda(oc, 2,0,0,1,ocface+ocres2,rts,rtf); + d2dda(oc, 2,0,0,2,ocface,rts,rtf); + d2dda(oc, 2,0,1,2,ocface+2*ocres2,rts,rtf); } else { - d2dda(2,3,0,1,ocvlak+ocres2,rts,rtf); - d2dda(2,3,0,2,ocvlak,rts,rtf); - d2dda(2,3,1,2,ocvlak+2*ocres2,rts,rtf); - d2dda(3,0,0,1,ocvlak+ocres2,rts,rtf); - d2dda(3,0,0,2,ocvlak,rts,rtf); - d2dda(3,0,1,2,ocvlak+2*ocres2,rts,rtf); + d2dda(oc, 2,3,0,1,ocface+ocres2,rts,rtf); + d2dda(oc, 2,3,0,2,ocface,rts,rtf); + d2dda(oc, 2,3,1,2,ocface+2*ocres2,rts,rtf); + d2dda(oc, 3,0,0,1,ocface+ocres2,rts,rtf); + d2dda(oc, 3,0,0,2,ocface,rts,rtf); + d2dda(oc, 3,0,1,2,ocface+2*ocres2,rts,rtf); } /* nothing todo with triangle..., just fills :) */ - filltriangle(0,1,ocvlak+ocres2,ocmin); - filltriangle(0,2,ocvlak,ocmin); - filltriangle(1,2,ocvlak+2*ocres2,ocmin); + filltriangle(oc, 0,1,ocface+ocres2,ocmin); + filltriangle(oc, 0,2,ocface,ocmin); + filltriangle(oc, 1,2,ocface+2*ocres2,ocmin); /* init static vars here */ face_in_node(vlr, 0,0,0, rtf); for(x=ocmin[0];x<=ocmax[0];x++) { - a= g_oc.ocres*x; + a= oc->ocres*x; for(y=ocmin[1];y<=ocmax[1];y++) { - if(ocvlak[a+y+ocres2]) { - b= g_oc.ocres*y+2*ocres2; + if(ocface[a+y+ocres2]) { + b= oc->ocres*y+2*ocres2; for(z=ocmin[2];z<=ocmax[2];z++) { - if(ocvlak[b+z] && ocvlak[a+z]) ocwrite(vlr, x,y,z, rtf); + if(ocface[b+z] && ocface[a+z]) ocwrite(oc, vlr, x,y,z, rtf); } } } @@ -608,17 +609,17 @@ void makeoctree(void) /* same loops to clear octree, doubt it can be done smarter */ for(x=ocmin[0];x<=ocmax[0];x++) { - a= g_oc.ocres*x; + a= oc->ocres*x; for(y=ocmin[1];y<=ocmax[1];y++) { /* x-y */ - ocvlak[a+y+ocres2]= 0; + ocface[a+y+ocres2]= 0; - b= g_oc.ocres*y + 2*ocres2; + b= oc->ocres*y + 2*ocres2; for(z=ocmin[2];z<=ocmax[2];z++) { /* y-z */ - ocvlak[b+z]= 0; + ocface[b+z]= 0; /* x-z */ - ocvlak[a+z]= 0; + ocface[a+z]= 0; } } } @@ -626,7 +627,7 @@ void makeoctree(void) } } - MEM_freeN(ocvlak); + MEM_freeN(ocface); } /* ************ raytracer **************** */ @@ -1007,23 +1008,23 @@ static Node *ocread(int x, int y, int z) x<<=2; y<<=1; - br= g_oc.adrbranch[0]; + br= R.oc.adrbranch[0]; - if(g_oc.ocres==512) { + if(R.oc.ocres==512) { oc1= ((x & 1024)+(y & 512)+(z & 256))>>8; br= br->b[oc1]; if(br==NULL) { return NULL; } } - if(g_oc.ocres>=256) { + if(R.oc.ocres>=256) { oc1= ((x & 512)+(y & 256)+(z & 128))>>7; br= br->b[oc1]; if(br==NULL) { return NULL; } } - if(g_oc.ocres>=128) { + if(R.oc.ocres>=128) { oc1= ((x & 256)+(y & 128)+(z & 64))>>6; br= br->b[oc1]; if(br==NULL) { @@ -1127,7 +1128,7 @@ static int d3dda(Isect *is) int ocx1,ocx2,ocy1, ocy2,ocz1,ocz2; /* clip with octree */ - if(branchcount==0) return 0; + if(R.oc.branchcount==0) return 0; /* do this before intersect calls */ is->vlrcontr= NULL; /* to check shared edge */ @@ -1150,14 +1151,14 @@ static int d3dda(Isect *is) u2= 1.0; /* clip with octree cube */ - if(cliptest(-ldx, is->start[0]-g_oc.min[0], &u1,&u2)) { - if(cliptest(ldx, g_oc.max[0]-is->start[0], &u1,&u2)) { + if(cliptest(-ldx, is->start[0]-R.oc.min[0], &u1,&u2)) { + if(cliptest(ldx, R.oc.max[0]-is->start[0], &u1,&u2)) { ldy= is->end[1] - is->start[1]; - if(cliptest(-ldy, is->start[1]-g_oc.min[1], &u1,&u2)) { - if(cliptest(ldy, g_oc.max[1]-is->start[1], &u1,&u2)) { + if(cliptest(-ldy, is->start[1]-R.oc.min[1], &u1,&u2)) { + if(cliptest(ldy, R.oc.max[1]-is->start[1], &u1,&u2)) { ldz= is->end[2] - is->start[2]; - if(cliptest(-ldz, is->start[2]-g_oc.min[2], &u1,&u2)) { - if(cliptest(ldz, g_oc.max[2]-is->start[2], &u1,&u2)) { + if(cliptest(-ldz, is->start[2]-R.oc.min[2], &u1,&u2)) { + if(cliptest(ldz, R.oc.max[2]-is->start[2], &u1,&u2)) { c1=1; if(u2<1.0) { is->end[0]= is->start[0]+u2*ldx; @@ -1179,15 +1180,15 @@ static int d3dda(Isect *is) if(c1==0) return 0; /* reset static variables in ocread */ - //ocread(g_oc.ocres, 0, 0); + //ocread(R.oc.ocres, 0, 0); /* setup 3dda to traverse octree */ - ox1= (is->start[0]-g_oc.min[0])*g_oc.ocfacx; - oy1= (is->start[1]-g_oc.min[1])*g_oc.ocfacy; - oz1= (is->start[2]-g_oc.min[2])*g_oc.ocfacz; - ox2= (is->end[0]-g_oc.min[0])*g_oc.ocfacx; - oy2= (is->end[1]-g_oc.min[1])*g_oc.ocfacy; - oz2= (is->end[2]-g_oc.min[2])*g_oc.ocfacz; + ox1= (is->start[0]-R.oc.min[0])*R.oc.ocfacx; + oy1= (is->start[1]-R.oc.min[1])*R.oc.ocfacy; + oz1= (is->start[2]-R.oc.min[2])*R.oc.ocfacz; + ox2= (is->end[0]-R.oc.min[0])*R.oc.ocfacx; + oy2= (is->end[1]-R.oc.min[1])*R.oc.ocfacy; + oz2= (is->end[2]-R.oc.min[2])*R.oc.ocfacz; ocx1= (int)ox1; ocy1= (int)oy1; @@ -1522,9 +1523,9 @@ static void traceray(short depth, float *start, float *vec, float *col, VlakRen float ref[3]; VECCOPY(isec.start, start); - isec.end[0]= start[0]+g_oc.ocsize*vec[0]; - isec.end[1]= start[1]+g_oc.ocsize*vec[1]; - isec.end[2]= start[2]+g_oc.ocsize*vec[2]; + isec.end[0]= start[0]+R.oc.ocsize*vec[0]; + isec.end[1]= start[1]+R.oc.ocsize*vec[1]; + isec.end[2]= start[2]+R.oc.ocsize*vec[2]; isec.mode= DDA_MIRROR; isec.vlrorig= vlr; @@ -1712,7 +1713,7 @@ void init_jitter_plane(LampRen *lar) } /* table around origin, -0.5*size to 0.5*size */ -static float *give_jitter_plane(LampRen *lar, int xs, int ys) +static float *give_jitter_plane(LampRen *lar, int thread, int xs, int ys) { int tot; @@ -1720,7 +1721,7 @@ static float *give_jitter_plane(LampRen *lar, int xs, int ys) if(lar->ray_samp_type & LA_SAMP_JITTER) { /* made it threadsafe */ - if(ys & 1) { + if(thread & 1) { if(lar->xold1!=xs || lar->yold1!=ys) { jitter_plane_offset(lar->jitter, lar->jitter+2*tot, tot, lar->area_size, lar->area_sizey, BLI_thread_frand(1), BLI_thread_frand(1)); lar->xold1= xs; lar->yold1= ys; @@ -1886,9 +1887,9 @@ int ray_trace_shadow_rad(ShadeInput *ship, ShadeResult *shr) vec[2]-= vec[2]; } VECCOPY(isec.start, ship->co); - isec.end[0]= isec.start[0] + g_oc.ocsize*vec[0]; - isec.end[1]= isec.start[1] + g_oc.ocsize*vec[1]; - isec.end[2]= isec.start[2] + g_oc.ocsize*vec[2]; + isec.end[0]= isec.start[0] + R.oc.ocsize*vec[0]; + isec.end[1]= isec.start[1] + R.oc.ocsize*vec[1]; + isec.end[2]= isec.start[2] + R.oc.ocsize*vec[2]; if( d3dda(&isec)) { float fac; @@ -1976,13 +1977,13 @@ void init_ao_sphere(float *sphere, int tot, int iter) } -static float *threadsafe_table_sphere(int test, int xs, int ys) +static float *threadsafe_table_sphere(int test, int thread, int xs, int ys) { static float sphere1[2*3*256]; static float sphere2[2*3*256]; static int xs1=-1, xs2=-1, ys1=-1, ys2=-1; - if(ys & 1) { + if(thread & 1) { if(xs==xs1 && ys==ys1) return sphere1; if(test) return NULL; xs1= xs; ys1= ys; @@ -1996,7 +1997,7 @@ static float *threadsafe_table_sphere(int test, int xs, int ys) } } -static float *sphere_sampler(int type, int resol, int xs, int ys) +static float *sphere_sampler(int type, int resol, int thread, int xs, int ys) { int tot; float *vec; @@ -2023,14 +2024,14 @@ static float *sphere_sampler(int type, int resol, int xs, int ys) float ang, *vec1; int a; - sphere= threadsafe_table_sphere(1, xs, ys); // returns table if xs and ys were equal to last call + sphere= threadsafe_table_sphere(1, thread, xs, ys); // returns table if xs and ys were equal to last call if(sphere==NULL) { - sphere= threadsafe_table_sphere(0, xs, ys); + sphere= threadsafe_table_sphere(0, thread, xs, ys); // random rotation - ang= BLI_thread_frand(ys & 1); + ang= BLI_thread_frand(thread); sinfi= sin(ang); cosfi= cos(ang); - ang= BLI_thread_frand(ys & 1); + ang= BLI_thread_frand(thread); sint= sin(ang); cost= cos(ang); vec= R.wrld.aosphere; @@ -2047,11 +2048,11 @@ static float *sphere_sampler(int type, int resol, int xs, int ys) /* extern call from shade_lamp_loop, ambient occlusion calculus */ -void ray_ao(ShadeInput *shi, World *wrld, float *shadfac) +void ray_ao(ShadeInput *shi, float *shadfac) { Isect isec; float *vec, *nrm, div, bias, sh=0; - float maxdist = wrld->aodist; + float maxdist = R.wrld.aodist; int j= -1, tot, actual=0, skyadded=0; isec.vlrorig= shi->vlr; @@ -2071,10 +2072,10 @@ void ray_ao(ShadeInput *shi, World *wrld, float *shadfac) nrm= shi->facenor; } - vec= sphere_sampler(wrld->aomode, wrld->aosamp, shi->xs, shi->ys); + vec= sphere_sampler(R.wrld.aomode, R.wrld.aosamp, shi->thread, shi->xs, shi->ys); // warning: since we use full sphere now, and dotproduct is below, we do twice as much - tot= 2*wrld->aosamp*wrld->aosamp; + tot= 2*R.wrld.aosamp*R.wrld.aosamp; while(tot--) { @@ -2099,10 +2100,10 @@ void ray_ao(ShadeInput *shi, World *wrld, float *shadfac) /* do the trace */ if (d3dda(&isec)) { - if (wrld->aomode & WO_AODIST) sh+= exp(-isec.labda*wrld->aodistfac); + if (R.wrld.aomode & WO_AODIST) sh+= exp(-isec.labda*R.wrld.aodistfac); else sh+= 1.0; } - else if(wrld->aocolor!=WO_AOPLAIN) { + else if(R.wrld.aocolor!=WO_AOPLAIN) { float skycol[4]; float fac, view[3]; @@ -2111,7 +2112,7 @@ void ray_ao(ShadeInput *shi, World *wrld, float *shadfac) view[2]= -vec[2]; Normalise(view); - if(wrld->aocolor==WO_AOSKYCOL) { + if(R.wrld.aocolor==WO_AOSKYCOL) { fac= 0.5*(1.0+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]); shadfac[0]+= (1.0-fac)*R.wrld.horr + fac*R.wrld.zenr; shadfac[1]+= (1.0-fac)*R.wrld.horg + fac*R.wrld.zeng; @@ -2133,7 +2134,7 @@ void ray_ao(ShadeInput *shi, World *wrld, float *shadfac) if(actual==0) shadfac[3]= 1.0; else shadfac[3] = 1.0 - sh/((float)actual); - if(wrld->aocolor!=WO_AOPLAIN && skyadded) { + if(R.wrld.aocolor!=WO_AOPLAIN && skyadded) { div= shadfac[3]/((float)skyadded); shadfac[0]*= div; // average color times distances/hits formula @@ -2162,9 +2163,9 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac) if(lar->type==LA_SUN || lar->type==LA_HEMI) { - lampco[0]= shi->co[0] - g_oc.ocsize*lar->vec[0]; - lampco[1]= shi->co[1] - g_oc.ocsize*lar->vec[1]; - lampco[2]= shi->co[2] - g_oc.ocsize*lar->vec[2]; + lampco[0]= shi->co[0] - R.oc.ocsize*lar->vec[0]; + lampco[1]= shi->co[1] - R.oc.ocsize*lar->vec[1]; + lampco[2]= shi->co[2] - R.oc.ocsize*lar->vec[2]; } else { VECCOPY(lampco, lar->co); @@ -2202,7 +2203,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac) else shadfac[3]= 1.0; // 1.0=full light fac= 0.0; - jitlamp= give_jitter_plane(lar, shi->xs, shi->ys); + jitlamp= give_jitter_plane(lar, shi->thread, shi->xs, shi->ys); a= lar->ray_totsamp; @@ -2284,9 +2285,9 @@ void ray_translucent(ShadeInput *shi, LampRen *lar, float *distfac, float *co) if(lar->mode & LA_LAYER) isec.lay= lar->lay; else isec.lay= -1; if(lar->type==LA_SUN || lar->type==LA_HEMI) { - lampco[0]= shi->co[0] - g_oc.ocsize*lar->vec[0]; - lampco[1]= shi->co[1] - g_oc.ocsize*lar->vec[1]; - lampco[2]= shi->co[2] - g_oc.ocsize*lar->vec[2]; + lampco[0]= shi->co[0] - R.oc.ocsize*lar->vec[0]; + lampco[1]= shi->co[1] - R.oc.ocsize*lar->vec[1]; + lampco[2]= shi->co[2] - R.oc.ocsize*lar->vec[2]; } else { VECCOPY(lampco, lar->co); diff --git a/source/blender/render/intern/source/renderHelp.c b/source/blender/render/intern/source/renderHelp.c deleted file mode 100644 index aba78079472..00000000000 --- a/source/blender/render/intern/source/renderHelp.c +++ /dev/null @@ -1,306 +0,0 @@ -/** - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Some helpful conversions/functions. - * - * $Id$ - */ - -#include -#include -#include - -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "BKE_utildefines.h" -#include "BLI_arithb.h" - -#include "render.h" -#include "renderHelp.h" -#include "zbuf.h" - -static float panovco, panovsi; -static float panophi=0.0; -static float tempPanoPhi; - -static int panotestclip(float *v); - -void pushTempPanoPhi(float p) { - tempPanoPhi = panophi; - panophi = p; -} - -void popTempPanoPhi() { - panophi = tempPanoPhi; -} - -float getPanoPhi(){ - return panophi; -} -float getPanovCo(){ - return panovco; -} -float getPanovSi(){ - return panovsi; -} - -void setPanoRot(int part) -{ -/* extern float panovco, panovsi; */ - static float alpha= 1.0; - - /* part==0 init all */ - - if(part==0) { - - alpha= ((float)R.r.xsch)/R.viewfac; - alpha= 2.0*atan(alpha/2.0); - } - - - /* rotate it all around the y-as with phi degrees */ - - panophi= -0.5*(R.r.xparts-1)*alpha + part*alpha; - - panovsi= sin(-panophi); - panovco= cos(-panophi); - -} - - - - -static int panotestclip(float *v) -{ - /* to be used for halos en infos */ - float abs4; - short c=0; - - if((R.r.mode & R_PANORAMA)==0) return RE_testclip(v); - - abs4= fabs(v[3]); - - if(v[2]< -abs4) c=16; /* this used to be " if(v[2]<0) ", see clippz() */ - else if(v[2]> abs4) c+= 32; - - if( v[1]>abs4) c+=4; - else if( v[1]< -abs4) c+=8; - - abs4*= R.r.xparts; - if( v[0]>abs4) c+=2; - else if( v[0]< -abs4) c+=1; - - return c; -} - -/* - - This adds the hcs coordinates to vertices. It iterates over all - vertices, halos and faces. After the conversion, we clip in hcs. - - Elsewhere, all primites are converted to vertices. - Called in - - envmapping (envmap.c) - - shadow buffering (shadbuf.c) - - preparation for rendering (renderPreAndPost.c) - -*/ - -/* move to renderer */ -void setzbufvlaggen( void (*projectfunc)(float *, float *) ) -/* homocos too */ -{ - VlakRen *vlr = NULL; - VertRen *ver = NULL; - HaloRen *har = NULL; - float zn, vec[3], si, co, hoco[4]; - int a; - float panophi = 0.0; - - panophi = getPanoPhi(); - si= sin(panophi); - co= cos(panophi); - - /* calculate view coordinates (and zbuffer value) */ - for(a=0; a< R.totvert;a++) { - if((a & 255)==0) ver= RE_findOrAddVert(a); - else ver++; - - if(R.r.mode & R_PANORAMA) { - vec[0]= co*ver->co[0] + si*ver->co[2]; - vec[1]= ver->co[1]; - vec[2]= -si*ver->co[0] + co*ver->co[2]; - } - else { - VECCOPY(vec, ver->co); - } - /* Go from wcs to hcs ... */ - projectfunc(vec, ver->ho); - /* ... and clip in that system. */ - ver->clip = RE_testclip(ver->ho); - /* - Because all other ops are performed in other systems, this is - the only thing that has to be done. - */ - } - - /* calculate view coordinates (and zbuffer value) */ - for(a=0; a>8]; - else har++; - - if(R.r.mode & R_PANORAMA) { - vec[0]= co*har->co[0] + si*har->co[2]; - vec[1]= har->co[1]; - vec[2]= -si*har->co[0] + co*har->co[2]; - } - else { - VECCOPY(vec, har->co); - } - - projectfunc(vec, hoco); - - /* we clip halos less critical, but not for the Z */ - hoco[0]*= 0.5; - hoco[1]*= 0.5; - - if( panotestclip(hoco) ) { - har->miny= har->maxy= -10000; /* that way render clips it */ - } - else if(hoco[3]<0.0) { - har->miny= har->maxy= -10000; /* render clips it */ - } - else /* do the projection...*/ - { - /* bring back hocos */ - hoco[0]*= 2.0; - hoco[1]*= 2.0; - - zn= hoco[3]; - har->xs= 0.5*R.rectx*(1.0+hoco[0]/zn); /* the 0.5 negates the previous 2...*/ - har->ys= 0.5*R.recty*(1.0+hoco[1]/zn); - - /* this should be the zbuffer coordinate */ - har->zs= 0x7FFFFF*(hoco[2]/zn); - /* taking this from the face clip functions? seems ok... */ - har->zBufDist = 0x7FFFFFFF*(hoco[2]/zn); - - vec[0]+= har->hasize; - projectfunc(vec, hoco); - vec[0]-= har->hasize; - zn= hoco[3]; - har->rad= fabs(har->xs- 0.5*R.rectx*(1.0+hoco[0]/zn)); - - /* this clip is not really OK, to prevent stars to become too large */ - if(har->type & HA_ONLYSKY) { - if(har->rad>3.0) har->rad= 3.0; - } - - har->radsq= har->rad*har->rad; - - har->miny= har->ys - har->rad/R.ycor; - har->maxy= har->ys + har->rad/R.ycor; - - /* the Zd value is still not really correct for pano */ - - vec[2]-= har->hasize; /* z negative, otherwise it's clipped */ - projectfunc(vec, hoco); - zn= hoco[3]; - zn= fabs( (float)har->zs - 0x7FFFFF*(hoco[2]/zn)); - har->zd= CLAMPIS(zn, 0, INT_MAX); - - } - - } - - /* set flags at 0 if clipped away */ - for(a=0; a>8]; - else vlr++; - - vlr->flag |= R_VISIBLE; - if(vlr->v4) { - if(vlr->v1->clip & vlr->v2->clip & vlr->v3->clip & vlr->v4->clip) vlr->flag &= ~R_VISIBLE; - } - else if(vlr->v1->clip & vlr->v2->clip & vlr->v3->clip) vlr->flag &= ~R_VISIBLE; - - } - -} - -/* ------------------------------------------------------------------------- */ -/* move to renderer */ - -void set_normalflags(void) -{ - VlakRen *vlr = NULL; - float *v1, xn, yn, zn; - int a1, doflip; - - /* switch normal 'snproj' values (define which axis is the optimal one for calculations) */ - for(a1=0; a1>8]; - else vlr++; - - /* abuse of this flag... this is code that just sets face normal in direction of camera */ - /* that convention we should get rid of */ - if((vlr->flag & R_NOPUNOFLIP)==0) { - - doflip= 0; - if(R.r.mode & R_ORTHO) { - if(vlr->n[2]>0.0) doflip= 1; - } - else { - v1= vlr->v1->co; - if( (v1[0]*vlr->n[0] +v1[1]*vlr->n[1] +v1[2]*vlr->n[2])<0.0 ) doflip= 1; - } - if(doflip) { - vlr->n[0]= -vlr->n[0]; - vlr->n[1]= -vlr->n[1]; - vlr->n[2]= -vlr->n[2]; - } - } - - /* recalculate puno. Displace & flipped matrices can screw up */ - vlr->puno= 0; - if(!(vlr->flag & R_TANGENT)) { - if( Inpf(vlr->n, vlr->v1->n) < 0.0 ) vlr->puno |= ME_FLIPV1; - if( Inpf(vlr->n, vlr->v2->n) < 0.0 ) vlr->puno |= ME_FLIPV2; - if( Inpf(vlr->n, vlr->v3->n) < 0.0 ) vlr->puno |= ME_FLIPV3; - if(vlr->v4 && Inpf(vlr->n, vlr->v4->n) < 0.0 ) vlr->puno |= ME_FLIPV4; - } - xn= fabs(vlr->n[0]); - yn= fabs(vlr->n[1]); - zn= fabs(vlr->n[2]); - if(zn>=xn && zn>=yn) vlr->snproj= 0; - else if(yn>=xn && yn>=zn) vlr->snproj= 1; - else vlr->snproj= 2; - - } -} diff --git a/source/blender/render/intern/source/renderPreAndPost.c b/source/blender/render/intern/source/renderPreAndPost.c deleted file mode 100644 index 0753a73276b..00000000000 --- a/source/blender/render/intern/source/renderPreAndPost.c +++ /dev/null @@ -1,103 +0,0 @@ -/** - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Prepare the scene data for rendering. - * - * $Id$ - */ - -#include "MEM_guardedalloc.h" - -#include "DNA_group_types.h" - -#include "render.h" -#include "renderPreAndPost.h" -#include "RE_callbacks.h" - -#include "shadbuf.h" -#include "envmap.h" -#include "renderHelp.h" -#include "radio.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -/** - * Rotate all objects, make shadowbuffers and environment maps. - */ -void prepareScene() -{ - GroupObject *go; - extern void makeoctree(void); - - RE_local_get_renderdata(); - - /* SHADOW BUFFER */ - for(go=R.lights.first; go; go= go->next) { - LampRen *lar= go->lampren; - if(lar->shb) makeshadowbuf(lar); - if(RE_local_test_break()) break; - } - - /* yafray: 'direct' radiosity, environment maps and octree init not needed for yafray render */ - /* although radio mode could be useful at some point, later */ - if (R.r.renderer==R_INTERN) { - - /* RADIO */ - if(R.r.mode & R_RADIO) do_radio_render(); - - /* octree */ - if(R.r.mode & R_RAYTRACE) makeoctree(); - - /* ENVIRONMENT MAPS */ - make_envmaps(); - - } -} - -void finalizeScene(void) -{ - extern void freeoctree(void); - - /* Among other things, it releases the shadow buffers. */ - RE_local_free_renderdata(); - /* yafray: freeoctree not needed after yafray render, not initialized, see above */ - if (R.r.renderer==R_INTERN) { - if(R.r.mode & R_RAYTRACE) freeoctree(); - } -} - - -void doClipping( void (*projectfunc)(float *, float *) ) -{ - setzbufvlaggen(projectfunc); -} - -/* eof */ diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 379b5415604..b226346ede9 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -1,15 +1,12 @@ /** * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,11 +20,10 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. + * Contributors: Hos, Robert Wenzlaff. + * Contributors: 2004/2005/2006 Blender Foundation, full recode * - * Contributor(s): Hos, Robert Wenzlaff. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ /* system includes */ @@ -36,83 +32,81 @@ #include /* External modules: */ -#include "MEM_guardedalloc.h" -#include "BLI_arithb.h" #include "MTC_matrixops.h" +#include "BLI_arithb.h" +#include "BLI_blenlib.h" +#include "BLI_rand.h" +#include "BLI_jitter.h" #include "BKE_utildefines.h" -#include "DNA_camera_types.h" #include "DNA_group_types.h" #include "DNA_image_types.h" #include "DNA_lamp_types.h" +#include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" #include "DNA_texture_types.h" #include "BKE_global.h" +#include "BKE_material.h" #include "BKE_node.h" #include "BKE_texture.h" -#include "BLI_rand.h" - /* local include */ -#include "RE_callbacks.h" -#include "render.h" -#include "zbuf.h" /* stuff like bgnaccumbuf, fillrect, ...*/ +#include "renderpipeline.h" +#include "render_types.h" +#include "renderdatabase.h" #include "pixelblending.h" #include "pixelshading.h" -#include "vanillaRenderPipe.h" /* transfercolour... */ #include "gammaCorrectionTables.h" #include "shadbuf.h" -#include "renderHelp.h" +#include "zbuf.h" -#include "jitter.h" #include "texture.h" /* own include */ #include "rendercore.h" -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "SDL_thread.h" - -/* global for this file. struct render will be more dynamic later, to allow multiple renderers */ -RE_Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -float bluroffsx=0.0, bluroffsy=0.0; // set in initrender.c (bad, ton) - -/* x and y are current pixels to be rendered */ +/* x and y are current pixels in rect to be rendered */ +/* do not normalize! */ void calc_view_vector(float *view, float x, float y) { - + if(R.r.mode & R_ORTHO) { view[0]= view[1]= 0.0; } else { - view[0]= (x+(R.xstart)+bluroffsx +0.5); + /* move x and y to real viewplane coords */ + x= (x/(float)R.winx); + view[0]= R.viewplane.xmin + x*(R.viewplane.xmax - R.viewplane.xmin); - if(R.flag & R_SEC_FIELD) { - if(R.r.mode & R_ODDFIELD) view[1]= (y+R.ystart)*R.ycor; - else view[1]= (y+R.ystart+1.0)*R.ycor; - } - else view[1]= (y+R.ystart+bluroffsy+0.5)*R.ycor; - } - view[2]= -R.viewfac; + y= (y/(float)R.winy); + view[1]= R.viewplane.ymin + y*(R.viewplane.ymax - R.viewplane.ymin); + +// if(R.flag & R_SEC_FIELD) { +// if(R.r.mode & R_ODDFIELD) view[1]= (y+R.ystart)*R.ycor; +// else view[1]= (y+R.ystart+1.0)*R.ycor; +// } +// else view[1]= (y+R.ystart+R.bluroffsy+0.5)*R.ycor; + } + + view[2]= -R.clipsta; if(R.r.mode & R_PANORAMA) { - float panoco, panosi, u, v; - panoco = getPanovCo(); - panosi = getPanovSi(); - - u= view[0]; v= view[2]; - view[0]= panoco*u + panosi*v; - view[2]= -panosi*u + panoco*v; + float u= view[0]; float v= view[2]; + view[0]= R.panoco*u + R.panosi*v; + view[2]= -R.panosi*u + R.panoco*v; } + } #if 0 @@ -194,32 +188,6 @@ float mistfactor(float zcor, float *co) /* dist en height, return alpha */ return (1.0-fac)* (1.0-R.wrld.misi); } -/* external for preview only */ -void RE_sky_char(float *view, char *col) -{ - float f, colf[3]; - float dither_value; - - dither_value = ( (BLI_frand()-0.5)*R.r.dither_intensity)/256.0; - - shadeSkyPixelFloat(colf, view, view, NULL); - - f= 255.0*(colf[0]+dither_value); - if(f<=0.0) col[0]= 0; else if(f>255.0) col[0]= 255; - else col[0]= (char)f; - f= 255.0*(colf[1]+dither_value); - if(f<=0.0) col[1]= 0; else if(f>255.0) col[1]= 255; - else col[1]= (char)f; - f= 255.0*(colf[2]+dither_value); - if(f<=0.0) col[2]= 0; else if(f>255.0) col[2]= 255; - else col[2]= (char)f; - col[3]= 1; /* to prevent wrong optimalisation alphaover of flares */ -} - - -/* ************************************** */ - - static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) { double a, b, c, disc, nray[3], npos[3]; @@ -433,9 +401,18 @@ static void renderspothalo(ShadeInput *shi, float *col, float alpha) } -static int calchalo_z(HaloRen *har, int zz) + +/* also used in zbuf.c */ +int count_mask(unsigned short mask) { + if(R.samples) + return (R.samples->cmask[mask & 255]+R.samples->cmask[mask>>8]); + return 0; +} +static int calchalo_z(HaloRen *har, int zz) +{ + if(har->type & HA_ONLYSKY) { if(zz!=0x7FFFFFFF) zz= - 0x7FFFFF; } @@ -445,186 +422,119 @@ static int calchalo_z(HaloRen *har, int zz) return zz; } -static void scanlinehaloPS(int *rectz, long *rectdelta, float *rowbuf, short ys) +static void halo_pixelstruct(HaloRen *har, float *rb, float dist, float xn, float yn, PixStr *ps) { - HaloRen *har = NULL; - PixStr *ps; - float dist, xsq, ysq, xn, yn; - float *rb; float col[4], accol[4]; - int a, *rz, zz, didgamma=0; - long *rd; - short minx, maxx, x, amount, amountm, flarec; - - for(a=0; a>8]; - if( RE_local_test_break() ) break; - } - else har++; - - if(ys>har->maxy); - else if(ysminy); - else { - minx= floor(har->xs-har->rad); - maxx= ceil(har->xs+har->rad); + int amount, amountm, zz, flarec; + + amount= 0; + accol[0]=accol[1]=accol[2]=accol[3]= 0.0; + flarec= har->flarec; + + while(ps) { + amountm= count_mask(ps->mask); + amount+= amountm; + + zz= calchalo_z(har, ps->z); + if(zz> har->zs) { + float fac; - if(maxx<0); - else if(R.rectx=R.rectx) maxx= R.rectx-1; - - rb= rowbuf + 4*minx; - rd= rectdelta + minx; - rz= rectz + minx; - - yn= (ys-har->ys)*R.ycor; - ysq= yn*yn; - for(x=minx; x<=maxx; x++) { - - xn= x-har->xs; - xsq= xn*xn; - dist= xsq+ysq; - - if(distradsq) { - - /* well yah, halo adding shouldnt be done gamma corrected, have to bypass it this way */ - /* alternative is moving it outside of thread renderlineDA */ - /* on positive side; the invert correct cancels out correcting halo color */ - if(do_gamma && didgamma==0) { - float *buf= rowbuf; - int xt; - for(xt=0; xtflarec; /* har->pixels is only allowed to count once */ - - if(*rd) { /* theres a pixel struct */ - - ps= (PixStr *)(*rd); - amount= 0; - accol[0]=accol[1]=accol[2]=accol[3]= 0.0; - - while(ps) { - amountm= count_mask(ps->mask); - amount+= amountm; - - zz= calchalo_z(har, ps->z); - if(zz> har->zs) { - float fac; - - shadeHaloFloat(har, col, zz, dist, xn, yn, flarec); - fac= ((float)amountm)/(float)R.osa; - accol[0]+= fac*col[0]; - accol[1]+= fac*col[1]; - accol[2]+= fac*col[2]; - accol[3]+= fac*col[3]; - flarec= 0; - } - - ps= ps->next; - } - /* now do the sky sub-pixels */ - amount= R.osa-amount; - if(amount) { - float fac; - - shadeHaloFloat(har, col, 0x7FFFFF, dist, xn, yn, flarec); - fac= ((float)amount)/(float)R.osa; - accol[0]+= fac*col[0]; - accol[1]+= fac*col[1]; - accol[2]+= fac*col[2]; - accol[3]+= fac*col[3]; - } - col[0]= accol[0]; - col[1]= accol[1]; - col[2]= accol[2]; - col[3]= accol[3]; - - addalphaAddfacFloat(rb, col, har->add); - } - else { - zz= calchalo_z(har, *rz); - if(zz> har->zs) { - - shadeHaloFloat(har, col, zz, dist, xn, yn, flarec); - addalphaAddfacFloat(rb, col, har->add); - } - } - } - rb+=4; - rz++; - rd++; - } - } + shadeHaloFloat(har, col, zz, dist, xn, yn, flarec); + fac= ((float)amountm)/(float)R.osa; + accol[0]+= fac*col[0]; + accol[1]+= fac*col[1]; + accol[2]+= fac*col[2]; + accol[3]+= fac*col[3]; + flarec= 0; } + + ps= ps->next; } + /* now do the sky sub-pixels */ + amount= R.osa-amount; + if(amount) { + float fac; - /* the entire scanline has to be put back in gammaspace */ - if(didgamma) { - float *buf= rowbuf; - int xt; - for(xt=0; xtadd); + } -static void scanlinehalo(int *rectz, float *rowbuf, short ys) +static void halo_tile(RenderPart *pa, float *pass) { HaloRen *har = NULL; + rcti disprect= pa->disprect; float dist, xsq, ysq, xn, yn, *rb; float col[4]; - int a, *rz, zz; - short minx, maxx, x; + long *rd= NULL; + int a, *rz, zz, y; + short minx, maxx, miny, maxy, x; for(a=0; a>8]; + if((a & 255)==0) { + if(R.test_break() ) break; + har= R.bloha[a>>8]; + } else har++; - if(RE_local_test_break() ) break; - - if(ys>har->maxy); - else if(ysminy); + /* clip halo with y */ + if(disprect.ymin > har->maxy); + else if(disprect.ymax < har->miny); else { + minx= floor(har->xs-har->rad); maxx= ceil(har->xs+har->rad); - if(maxx<0); - else if(R.rectx maxx); + else if(disprect.xmax < minx); else { - if(minx<0) minx= 0; - if(maxx>=R.rectx) maxx= R.rectx-1; - - rb= rowbuf + 4*minx; - rz= rectz + minx; - - yn= (ys-har->ys)*R.ycor; - ysq= yn*yn; - for(x=minx; x<=maxx; x++) { - zz= calchalo_z(har, *rz); - if(zz> har->zs) { + minx= MAX2(minx, disprect.xmin); + maxx= MIN2(maxx, disprect.xmax); + + miny= MAX2(har->miny, disprect.ymin); + maxy= MIN2(har->maxy, disprect.ymax); + + for(y=miny; yrectx + (minx - disprect.xmin); + rb= pass + 4*rectofs; + rz= pa->rectz + rectofs; + + if(pa->rectdaps) + rd= pa->rectdaps + rectofs; + + yn= (y-har->ys)*R.ycor; + ysq= yn*yn; + + for(x=minx; xxs; xsq= xn*xn; dist= xsq+ysq; if(distradsq) { - shadeHaloFloat(har, col, zz, dist, xn, yn, har->flarec); - addalphaAddfacFloat(rb, col, har->add); + if(rd && *rd) { + halo_pixelstruct(har, rb, dist, xn, yn, (PixStr *)*rd); + } + else { + zz= calchalo_z(har, *rz); + if(zz> har->zs) { + shadeHaloFloat(har, col, zz, dist, xn, yn, har->flarec); + addalphaAddfacFloat(rb, col, har->add); + } + } } + if(rd) rd++; } - - rb+=4; - rz++; } } } @@ -727,7 +637,7 @@ static float area_lamp_energy(float *co, float *vn, LampRen *lar) return pow(fac*lar->areasize, lar->k); // corrected for buttons size and lar->dist^2 } -float spec(float inp, int hard) +static float spec(float inp, int hard) { float b1; @@ -767,7 +677,7 @@ float spec(float inp, int hard) return inp; } -float Phong_Spec( float *n, float *l, float *v, int hard, int tangent ) +static float Phong_Spec( float *n, float *l, float *v, int hard, int tangent ) { float h[3]; float rslt; @@ -788,7 +698,7 @@ float Phong_Spec( float *n, float *l, float *v, int hard, int tangent ) /* reduced cook torrance spec (for off-specular peak) */ -float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent) +static float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent) { float i, nh, nv, h[3]; @@ -812,7 +722,7 @@ float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent) } /* Blinn spec */ -float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power, int tangent) +static float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power, int tangent) { float i, nh, nv, nl, vh, h[3]; float a, b, c, g=0.0, p, f, ang; @@ -866,7 +776,7 @@ float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power, i } /* cartoon render spec */ -float Toon_Spec( float *n, float *l, float *v, float size, float smooth, int tangent) +static float Toon_Spec( float *n, float *l, float *v, float size, float smooth, int tangent) { float h[3]; float ang; @@ -890,7 +800,7 @@ float Toon_Spec( float *n, float *l, float *v, float size, float smooth, int tan } /* Ward isotropic gaussian spec */ -float WardIso_Spec( float *n, float *l, float *v, float rms, int tangent) +static float WardIso_Spec( float *n, float *l, float *v, float rms, int tangent) { float i, nh, nv, nl, h[3], angle, alpha; @@ -916,13 +826,13 @@ float WardIso_Spec( float *n, float *l, float *v, float rms, int tangent) angle = tan(saacos(nh)); alpha = MAX2(rms,0.001); - i= nl * (1.0/(4*PI*alpha*alpha)) * (exp( -(angle*angle)/(alpha*alpha))/(sqrt(nv*nl))); + i= nl * (1.0/(4*M_PI*alpha*alpha)) * (exp( -(angle*angle)/(alpha*alpha))/(sqrt(nv*nl))); return i; } /* cartoon render diffuse */ -float Toon_Diff( float *n, float *l, float *v, float size, float smooth ) +static float Toon_Diff( float *n, float *l, float *v, float size, float smooth ) { float rslt, ang; @@ -941,7 +851,7 @@ float Toon_Diff( float *n, float *l, float *v, float size, float smooth ) /* 'nl' is either dot product, or return value of area light */ /* in latter case, only last multiplication uses 'nl' */ -static float OrenNayar_Diff_i(float nl, float *n, float *l, float *v, float rough ) +static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough ) { float i, nh, nv, vh, realnl, h[3]; float a, b, t, A, B; @@ -1000,15 +910,8 @@ static float OrenNayar_Diff_i(float nl, float *n, float *l, float *v, float roug return i; } -/* Oren Nayar diffuse */ -float OrenNayar_Diff(float *n, float *l, float *v, float rough ) -{ - float nl= n[0]*l[0] + n[1]*l[1] + n[2]*l[2]; - return OrenNayar_Diff_i(nl, n, l, v, rough); -} - /* Minnaert diffuse */ -float Minnaert_Diff(float nl, float *n, float *v, float darkness) +static float Minnaert_Diff(float nl, float *n, float *v, float darkness) { float i, nv; @@ -1030,7 +933,7 @@ float Minnaert_Diff(float nl, float *n, float *v, float darkness) return i; } -float Fresnel_Diff(float *vn, float *lv, float *view, float fac_i, float fac) +static float Fresnel_Diff(float *vn, float *lv, float *view, float fac_i, float fac) { return fresnel_fac(lv, vn, fac_i, fac); } @@ -1084,6 +987,7 @@ void calc_R_ref(ShadeInput *shi) } +/* called from ray.c */ void shade_color(ShadeInput *shi, ShadeResult *shr) { Material *ma= shi->mat; @@ -1114,91 +1018,8 @@ void shade_color(ShadeInput *shi, ShadeResult *shr) shr->alpha= shi->alpha; } -/* r g b = current value, col = new value, fac==0 is no change */ -/* if g==NULL, it only does r channel */ -void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) -{ - float tmp, facm= 1.0-fac; - - switch (type) { - case MA_RAMP_BLEND: - *r = facm*(*r) + fac*col[0]; - if(g) { - *g = facm*(*g) + fac*col[1]; - *b = facm*(*b) + fac*col[2]; - } - break; - case MA_RAMP_ADD: - *r += fac*col[0]; - if(g) { - *g += fac*col[1]; - *b += fac*col[2]; - } - break; - case MA_RAMP_MULT: - *r *= (facm + fac*col[0]); - if(g) { - *g *= (facm + fac*col[1]); - *b *= (facm + fac*col[2]); - } - break; - case MA_RAMP_SCREEN: - *r = 1.0 - (facm + fac*(1.0 - col[0])) * (1.0 - *r); - if(g) { - *g = 1.0 - (facm + fac*(1.0 - col[1])) * (1.0 - *g); - *b = 1.0 - (facm + fac*(1.0 - col[2])) * (1.0 - *b); - } - break; - case MA_RAMP_SUB: - *r -= fac*col[0]; - if(g) { - *g -= fac*col[1]; - *b -= fac*col[2]; - } - break; - case MA_RAMP_DIV: - if(col[0]!=0.0) - *r = facm*(*r) + fac*(*r)/col[0]; - if(g) { - if(col[1]!=0.0) - *g = facm*(*g) + fac*(*g)/col[1]; - if(col[2]!=0.0) - *b = facm*(*b) + fac*(*b)/col[2]; - } - break; - case MA_RAMP_DIFF: - *r = facm*(*r) + fac*fabs(*r-col[0]); - if(g) { - *g = facm*(*g) + fac*fabs(*g-col[1]); - *b = facm*(*b) + fac*fabs(*b-col[2]); - } - break; - case MA_RAMP_DARK: - tmp= fac*col[0]; - if(tmp < *r) *r= tmp; - if(g) { - tmp= fac*col[1]; - if(tmp < *g) *g= tmp; - tmp= fac*col[2]; - if(tmp < *b) *b= tmp; - } - break; - case MA_RAMP_LIGHT: - tmp= fac*col[0]; - if(tmp > *r) *r= tmp; - if(g) { - tmp= fac*col[1]; - if(tmp > *g) *g= tmp; - tmp= fac*col[2]; - if(tmp > *b) *b= tmp; - } - break; - } - -} - /* ramp for at end of shade */ -void ramp_diffuse_result(float *diff, ShadeInput *shi) +static void ramp_diffuse_result(float *diff, ShadeInput *shi) { Material *ma= shi->mat; float col[4], fac=0; @@ -1218,7 +1039,7 @@ void ramp_diffuse_result(float *diff, ShadeInput *shi) } /* r,g,b denote energy, ramp is used with different values to make new material color */ -void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b) +static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b) { Material *ma= shi->mat; float col[4], colt[3], fac=0; @@ -1267,7 +1088,7 @@ void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, fl } } -void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi) +static void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi) { Material *ma= shi->mat; float col[4]; @@ -1286,7 +1107,7 @@ void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi) } /* is = dot product shade, t = spec energy */ -void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec) +static void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec) { Material *ma= shi->mat; float col[4]; @@ -1323,32 +1144,32 @@ void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec) -static void ambient_occlusion(World *wrld, ShadeInput *shi, ShadeResult *shr) +static void ambient_occlusion(ShadeInput *shi, ShadeResult *shr) { float f, shadfac[4]; - if((wrld->mode & WO_AMB_OCC) && (R.r.mode & R_RAYTRACE) && shi->amb!=0.0) { - ray_ao(shi, wrld, shadfac); + if((R.wrld.mode & WO_AMB_OCC) && (R.r.mode & R_RAYTRACE) && shi->amb!=0.0) { + ray_ao(shi, shadfac); - if(wrld->aocolor==WO_AOPLAIN) { - if (wrld->aomix==WO_AOADDSUB) shadfac[3] = 2.0*shadfac[3]-1.0; - else if (wrld->aomix==WO_AOSUB) shadfac[3] = shadfac[3]-1.0; + if(R.wrld.aocolor==WO_AOPLAIN) { + if (R.wrld.aomix==WO_AOADDSUB) shadfac[3] = 2.0*shadfac[3]-1.0; + else if (R.wrld.aomix==WO_AOSUB) shadfac[3] = shadfac[3]-1.0; - f= wrld->aoenergy*shadfac[3]*shi->amb; + f= R.wrld.aoenergy*shadfac[3]*shi->amb; add_to_diffuse(shr->diff, shi, f, f, f, f); } else { - if (wrld->aomix==WO_AOADDSUB) { + if (R.wrld.aomix==WO_AOADDSUB) { shadfac[0] = 2.0*shadfac[0]-1.0; shadfac[1] = 2.0*shadfac[1]-1.0; shadfac[2] = 2.0*shadfac[2]-1.0; } - else if (wrld->aomix==WO_AOSUB) { + else if (R.wrld.aomix==WO_AOSUB) { shadfac[0] = shadfac[0]-1.0; shadfac[1] = shadfac[1]-1.0; shadfac[2] = shadfac[2]-1.0; } - f= wrld->aoenergy*shi->amb; + f= R.wrld.aoenergy*shi->amb; add_to_diffuse(shr->diff, shi, f, f*shadfac[0], f*shadfac[1], f*shadfac[2]); } } @@ -1410,7 +1231,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) if(lar->shb) i = testshadowbuf(lar->shb, shi->co, shi->dxco, shi->dyco, inp); else { float shad[4]; - //ray_shadow(shi, lar, shad); + ray_shadow(shi, lar, shad); i= shad[3]; } @@ -1435,7 +1256,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) /* single sided? */ if( shi->facenor[0]*lv[0] + shi->facenor[1]*lv[1] + shi->facenor[2]*lv[2] > -0.01) { - //ray_shadow(shi, lar, shad); + ray_shadow(shi, lar, shad); shadfac[3]+= shad[3]; ir+= 1.0; } @@ -1451,7 +1272,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) if((R.wrld.mode & WO_AMB_OCC) && (R.r.mode & R_RAYTRACE) && shi->amb!=0.0) { float f; - ray_ao(shi, &R.wrld, shadfac); // shadfac==0: full light + ray_ao(shi, shadfac); // shadfac==0: full light shadfac[3]= 1.0-shadfac[3]; f= R.wrld.aoenergy*shadfac[3]*shi->amb; @@ -1511,7 +1332,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) shr->diff[2]= shi->b*shi->emit; } - ambient_occlusion(&R.wrld, shi, shr); + ambient_occlusion(shi, shr); for(go=lights->first; go; go= go->next) { lar= go->lampren; @@ -1681,7 +1502,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) } /* diffuse shaders (oren nayer gets inp from area light) */ - if(ma->diff_shader==MA_DIFF_ORENNAYAR) is= OrenNayar_Diff_i(inp, vn, lv, view, ma->roughness); + if(ma->diff_shader==MA_DIFF_ORENNAYAR) is= OrenNayar_Diff(inp, vn, lv, view, ma->roughness); else if(ma->diff_shader==MA_DIFF_TOON) is= Toon_Diff(vn, lv, view, ma->param[0], ma->param[1]); else if(ma->diff_shader==MA_DIFF_MINNAERT) is= Minnaert_Diff(inp, vn, view, ma->darkness); else if(ma->diff_shader==MA_DIFF_FRESNEL) is= Fresnel_Diff(vn, lv, view, ma->param[0], ma->param[1]); @@ -1709,7 +1530,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) shadfac[3] = testshadowbuf(lar->shb, shi->co, shi->dxco, shi->dyco, inp); } else if(lar->mode & LA_SHAD_RAY) { - //ray_shadow(shi, lar, shadfac); + ray_shadow(shi, lar, shadfac); } /* warning, here it skips the loop */ @@ -2016,9 +1837,9 @@ void shade_input_set_coords(ShadeInput *shi, float u, float v, int i1, int i2, i if(mode & MA_TANGENT_V) { float *s1, *s2, *s3; - s1= RE_vertren_get_tangent(v1, 0); - s2= RE_vertren_get_tangent(v2, 0); - s3= RE_vertren_get_tangent(v3, 0); + s1= RE_vertren_get_tangent(&R, v1, 0); + s2= RE_vertren_get_tangent(&R, v2, 0); + s3= RE_vertren_get_tangent(&R, v3, 0); if(s1 && s2 && s3) { shi->tang[0]= (l*s3[0] - u*s1[0] - v*s2[0]); shi->tang[1]= (l*s3[1] - u*s1[1] - v*s2[1]); @@ -2177,9 +1998,9 @@ void shade_input_set_coords(ShadeInput *shi, float u, float v, int i1, int i2, i if(mode & MA_RADIO) { float *r1, *r2, *r3; - r1= RE_vertren_get_rad(v1, 0); - r2= RE_vertren_get_rad(v2, 0); - r3= RE_vertren_get_rad(v3, 0); + r1= RE_vertren_get_rad(&R, v1, 0); + r2= RE_vertren_get_rad(&R, v2, 0); + r3= RE_vertren_get_rad(&R, v3, 0); if(r1 && r2 && r3) { shi->rad[0]= (l*r3[0] - u*r1[0] - v*r2[0]); @@ -2200,9 +2021,9 @@ void shade_input_set_coords(ShadeInput *shi, float u, float v, int i1, int i2, i if(texco & TEXCO_STRESS) { float *s1, *s2, *s3; - s1= RE_vertren_get_stress(v1, 0); - s2= RE_vertren_get_stress(v2, 0); - s3= RE_vertren_get_stress(v3, 0); + s1= RE_vertren_get_stress(&R, v1, 0); + s2= RE_vertren_get_stress(&R, v2, 0); + s3= RE_vertren_get_stress(&R, v3, 0); if(s1 && s2 && s3) { shi->stress= l*s3[0] - u*s1[0] - v*s2[0]; if(shi->stress<1.0f) shi->stress-= 1.0f; @@ -2250,18 +2071,6 @@ static float isec_view_line(float *view, float *v3, float *v4) } #endif -void matlayer_blend(MaterialLayer *ml, float blendfac, ShadeResult *target, ShadeResult *src) -{ - - if(ml->flag & ML_DIFFUSE) - ramp_blend(ml->blendmethod, target->diff, target->diff+1, target->diff+2, blendfac*src->alpha, src->diff); - - if(ml->flag & ML_SPECULAR) - ramp_blend(ml->blendmethod, target->spec, target->spec+1, target->spec+2, blendfac*src->alpha, src->spec); - - if(ml->flag & ML_ALPHA) - ramp_blend(ml->blendmethod, &target->alpha, NULL, NULL, blendfac, &src->alpha); -} /* also used as callback for nodes */ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) @@ -2301,7 +2110,7 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) /* note, facenr declared volatile due to over-eager -O2 optimizations * on cygwin (particularly -frerun-cse-after-loop) */ -void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float *col, float *rco) +void *shadepixel(RenderPart *pa, float x, float y, int z, volatile int facenr, int mask, float *col, float *rco) { ShadeResult shr; ShadeInput shi; @@ -2310,10 +2119,11 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * if(facenr< 0) { /* error */ return NULL; } - /* currently in use for dithering (soft shadow) and detecting thread */ + /* currently in use for dithering (soft shadow) node preview */ shi.xs= (int)(x+0.5f); shi.ys= (int)(y+0.5f); - shi.do_preview= 0; + shi.thread= pa->thread; + shi.do_preview= R.r.scemode & R_NODE_PREVIEW; /* mask is used to indicate amount of samples (ray shad/mir and AO) */ shi.mask= mask; @@ -2327,7 +2137,7 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * VertRen *v1; float alpha, fac, zcor; - vlr= RE_findOrAddVlak( (facenr-1) & 0x7FFFFF); + vlr= RE_findOrAddVlak(&R, (facenr-1) & 0x7FFFFF); shi.vlr= vlr; shi.mat= vlr->mat; @@ -2341,7 +2151,7 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * v1= vlr->v1; /* COXYZ AND VIEW VECTOR */ - calc_view_vector(shi.view, x, y); + calc_view_vector(shi.view, x, y); /* returns not normalized, so is in viewplane coords */ /* wire cannot use normal for calculating shi.co */ if(shi.mat->mode & MA_WIRE) { @@ -2364,11 +2174,11 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * /* ortho viewplane cannot intersect using view vector originating in (0,0,0) */ if(R.r.mode & R_ORTHO) { /* x and y 3d coordinate can be derived from pixel coord and winmat */ - float fx= 2.0/(R.rectx*R.winmat[0][0]); - float fy= 2.0/(R.recty*R.winmat[1][1]); + float fx= 2.0/(R.winx*R.winmat[0][0]); + float fy= 2.0/(R.winy*R.winmat[1][1]); - shi.co[0]= (0.5 + x - 0.5*R.rectx)*fx - R.winmat[3][0]/R.winmat[0][0]; - shi.co[1]= (0.5 + y - 0.5*R.recty)*fy - R.winmat[3][1]/R.winmat[1][1]; + shi.co[0]= (0.5 + x - 0.5*R.winx)*fx - R.winmat[3][0]/R.winmat[0][0]; + shi.co[1]= (0.5 + y - 0.5*R.winy)*fy - R.winmat[3][1]/R.winmat[1][1]; /* using a*x + b*y + c*z = d equation, (a b c) is normal */ if(shi.facenor[2]!=0.0f) @@ -2407,15 +2217,15 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * /* pixel dx/dy for render coord */ if(shi.osatex || (R.r.mode & R_SHADOW) ) { - float u= dface/(div-shi.facenor[0]); - float v= dface/(div- R.ycor*shi.facenor[1]); + float u= dface/(div - R.viewdx*shi.facenor[0]); + float v= dface/(div - R.viewdy*shi.facenor[1]); - shi.dxco[0]= shi.co[0]- (shi.view[0]-1.0)*u; + shi.dxco[0]= shi.co[0]- (shi.view[0]-R.viewdx)*u; shi.dxco[1]= shi.co[1]- (shi.view[1])*u; shi.dxco[2]= shi.co[2]- (shi.view[2])*u; shi.dyco[0]= shi.co[0]- (shi.view[0])*v; - shi.dyco[1]= shi.co[1]- (shi.view[1]-1.0*R.ycor)*v; + shi.dyco[1]= shi.co[1]- (shi.view[1]-R.viewdy)*v; shi.dyco[2]= shi.co[2]- (shi.view[2])*v; } @@ -2424,14 +2234,14 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * /* rco might be used for sky texture */ VECCOPY(rco, shi.co); - /* cannot normalise earlier, code above needs it at pixel level */ + /* cannot normalise earlier, code above needs it at viewplane level */ fac= Normalise(shi.view); zcor*= fac; // for mist, distance of point from camera if(shi.osatex) { if( (shi.mat->texco & TEXCO_REFL) ) { - shi.dxview= -1.0/fac; - shi.dyview= -R.ycor/fac; + shi.dxview= -R.viewdx/fac; + shi.dyview= -R.viewdy/fac; } } @@ -2443,12 +2253,12 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * /* this only avalailable for scanline */ if(shi.mat->texco & TEXCO_WINDOW) { - shi.winco[0]= (x+(R.xstart))/(float)R.afmx; - shi.winco[1]= (y+(R.ystart))/(float)R.afmy; + shi.winco[0]= -1.0f + 2.0f*x/(float)R.winx; + shi.winco[1]= -1.0f + 2.0f*y/(float)R.winy; shi.winco[2]= 0.0; if(shi.osatex) { - shi.dxwin[0]= 0.5/(float)R.r.xsch; - shi.dywin[1]= 0.5/(float)R.r.ysch; + shi.dxwin[0]= 2.0/(float)R.winx; + shi.dywin[1]= 2.0/(float)R.winy; shi.dxwin[1]= shi.dxwin[2]= 0.0; shi.dywin[0]= shi.dywin[2]= 0.0; } @@ -2464,15 +2274,18 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * v2= vlr->v2; v3= vlr->v3; } - s1= RE_vertren_get_sticky(v1, 0); - s2= RE_vertren_get_sticky(v2, 0); - s3= RE_vertren_get_sticky(v3, 0); + s1= RE_vertren_get_sticky(&R, v1, 0); + s2= RE_vertren_get_sticky(&R, v2, 0); + s3= RE_vertren_get_sticky(&R, v3, 0); if(s1 && s2 && s3) { - extern float Zmulx, Zmuly; + float Zmulx, Zmuly; float hox, hoy, l, dl, u, v; float s00, s01, s10, s11, detsh; + /* XXXX */ + Zmulx= R.winx; Zmuly= R.winy; + s00= v3->ho[0]/v3->ho[3] - v1->ho[0]/v1->ho[3]; s01= v3->ho[1]/v3->ho[3] - v1->ho[1]/v1->ho[3]; s10= v3->ho[0]/v3->ho[3] - v2->ho[0]/v2->ho[3]; @@ -2598,12 +2411,12 @@ void *shadepixel(float x, float y, int z, volatile int facenr, int mask, float * return vlr; } -static void shadepixel_sky(float x, float y, int z, int facenr, int mask, float *colf) +static void shadepixel_sky(RenderPart *pa, float x, float y, int z, int facenr, int mask, float *colf) { VlakRen *vlr; float collector[4], rco[3]; - vlr= shadepixel(x, y, z, facenr, mask, colf, rco); + vlr= shadepixel(pa, x, y, z, facenr, mask, colf, rco); if(colf[3] != 1.0) { /* bail out when raytrace transparency (sky included already) */ if(vlr && (R.r.mode & R_RAYTRACE)) @@ -2615,120 +2428,30 @@ static void shadepixel_sky(float x, float y, int z, int facenr, int mask, float } } -/* ************* pixel struct ******** */ - -static PixStrMain psmfirst; -static int psmteller; - -static PixStr *addpsmain(void) -{ - PixStrMain *psm; - - psm= &psmfirst; - - while(psm->next) { - psm= psm->next; - } - - psm->next= (PixStrMain *)MEM_mallocN(sizeof(PixStrMain),"pixstrMain"); - - psm= psm->next; - psm->next=0; - psm->ps= (PixStr *)MEM_mallocN(4096*sizeof(PixStr),"pixstr"); - psmteller= 0; - - return psm->ps; -} - -static void freeps(void) -{ - PixStrMain *psm,*next; - - psm= &psmfirst; - - while(psm) { - next= psm->next; - if(psm->ps) { - MEM_freeN(psm->ps); - psm->ps= 0; - } - if(psm!= &psmfirst) MEM_freeN(psm); - psm= next; - } - - psmfirst.next= 0; - psmfirst.ps= 0; -} - -static void addps(long *rd, int facenr, int z, unsigned short mask) -{ - static PixStr *cur; - PixStr *ps, *last = NULL; - - if(*rd) { - ps= (PixStr *)(*rd); - - while(ps) { - if( ps->facenr == facenr ) { - ps->mask |= mask; - return; - } - last= ps; - ps= ps->next; - } - } - - /* make new PS (pixel struct) */ - if((psmteller & 4095)==0) cur= addpsmain(); - else cur++; - psmteller++; - - if(last) last->next= cur; - else *rd= (long)cur; - - cur->next= NULL; - cur->facenr= facenr; - cur->z= z; - cur->mask = mask; -} - - -int count_mask(unsigned short mask) -{ - extern char cmask[256]; - return (cmask[mask & 255]+cmask[mask>>8]); -} - -static void edge_enhance(void) +/* adds only alpha values */ +static void edge_enhance_calc(RenderPart *pa, float *rectf) { /* use zbuffer to define edges, add it to the image */ - int val, y, x, col, *rz, *rz1, *rz2, *rz3; + int y, x, col, *rz, *rz1, *rz2, *rz3; int zval1, zval2, zval3; - char *cp; + float *rf; /* shift values in zbuffer 4 to the right, for filter we need multiplying with 12 max */ - rz= (int *)R.rectz; + rz= pa->rectz; if(rz==NULL) return; - for(y=0; y>= 4; + for(y=0; yrecty; y++) { + for(x=0; xrectx; x++, rz++) (*rz)>>= 4; } - rz1= (int *)R.rectz; - rz2= rz1+R.rectx; - rz3= rz2+R.rectx; - - if(R.r.mode & R_OSA) { - cp= (char *)(R.rectaccu+R.rectx); - } - else { - cp= (char *)(R.rectot+R.rectx); - } - cp+= 4; + rz1= pa->rectz; + rz2= rz1+pa->rectx; + rz3= rz2+pa->rectx; - for(y=0; yrectx+1; + + for(y=0; yrecty-2; y++) { + for(x=0; xrectx-2; x++, rz1++, rz2++, rz3++, rf++) { /* prevent overflow with sky z values */ zval1= rz1[0] + 2*rz1[1] + rz1[2]; @@ -2742,482 +2465,348 @@ static void edge_enhance(void) else col= (R.r.edgeint*col)>>8; if(col>0) { - if(col>255) col= 255; + float fcol; - if(R.r.mode & R_OSA) { - col/= R.osa; - - val= cp[3]+col; - if(val>255) cp[3]= 255; else cp[3]= val; - } - else { - val= cp[0]- col; - if(val<0) cp[0]= 0; else cp[0]= val; - val= cp[1]- col; - if(val<0) cp[1]= 0; else cp[1]= val; - val= cp[2]- col; - if(val<0) cp[2]= 0; else cp[2]= val; - } + if(col>255) fcol= 1.0f; + else fcol= (float)col/255.0f; + + if(R.osa) + *rf+= fcol/(float)R.osa; + else + *rf= fcol; } } - rz++; rz1+= 2; rz2+= 2; rz3+= 2; - cp+= 8; + rf+= 2; } +} +static void edge_enhance_add(RenderPart *pa, float *rectf, float *arect) +{ + float addcol[4]; + int pix; + + for(pix= pa->rectx*pa->recty; pix>0; pix--, arect++, rectf+=4) { + if(*arect != 0.0f) { + addcol[0]= *arect * R.r.edgeR; + addcol[1]= *arect * R.r.edgeG; + addcol[2]= *arect * R.r.edgeB; + addcol[3]= *arect; + addAlphaOverFloat(rectf, addcol); + } + } } + /* ********************* MAINLOOPS ******************** */ -struct renderlineDA { - long *rd; - int *rz; - float *rb1, *rb2, *rb3; - float *acol; - int y; -}; - -static int do_renderlineDA(void *poin) + +static void shadeDA_tile(RenderPart *pa, float *rectf, float *recta) { - struct renderlineDA *rl= poin; PixStr *ps; float xs, ys; - float fcol[4], *acol=NULL, *rb1, *rb2, *rb3; - long *rd= rl->rd; + float fcol[4], *rf, *grf, *acol= NULL; + long *rd, *rectdaps= pa->rectdaps; int zbuf, samp, curmask, face, mask, fullmask; - int b, x, full_osa, seed; + int b, x, y, full_osa, seed, crop=0; - /* we set per pixel a fixed seed, for random AO and shadow samples */ - seed= (R.ystart + rl->y + R.afmy)*R.r.xsch + R.xstart + R.afmx; + if(R.test_break()) return; + /* we set per pixel a fixed seed, for random AO and shadow samples */ + seed= pa->rectx*pa->disprect.ymin; + fullmask= (1<rb1; - rb2= rl->rb2; - rb3= rl->rb3; - if(R.flag & R_ZTRA) { /* zbuf tra */ - abufsetrow(rl->acol, rl->y); - acol= rl->acol; + /* might need it for gamma, in end of this function */ + grf= rectf; + + /* filtered render, for now we assume only 1 filter size */ + if(pa->crop) { + crop= 1; + rectf+= 4*(pa->rectx + 1); + rectdaps+= pa->rectx + 1; + if(recta) recta+= 4*(pa->rectx + 1); } + + for(y=pa->disprect.ymin+crop; ydisprect.ymax-crop; y++) { + rf= rectf; + rd= rectdaps; + if(recta) acol= recta; - for(x=0; xy & 1, seed+x); - - ps= (PixStr *)(*rd); - mask= 0; - - /* complex loop, because empty spots are sky, without mask */ - while(TRUE) { - - if(ps==NULL) { - face= 0; - curmask= (~mask) & fullmask; - zbuf= *(rl->rz+x); - } - else { - face= ps->facenr; - curmask= ps->mask; - zbuf= ps->z; - } - - /* check osa level */ - if(face==0) full_osa= 0; - else { - VlakRen *vlr= RE_findOrAddVlak( (face-1) & 0x7FFFFF); - full_osa= (vlr->flag & R_FULL_OSA); - } + for(x=pa->disprect.xmin+crop; xdisprect.xmax-crop; x++, rd++, rf+=4) { + BLI_thread_srandom(pa->thread, seed+x); - if(full_osa) { - for(samp=0; sampy + jit[samp][1]; - shadepixel_sky(xs, ys, zbuf, face, (1<facenr; + curmask= ps->mask; + zbuf= ps->z; + } + + /* check osa level */ + if(face==0) full_osa= 0; + else { + VlakRen *vlr= RE_findOrAddVlak(&R, (face-1) & 0x7FFFFF); + full_osa= (vlr->flag & R_FULL_OSA); + } + + if(full_osa) { + for(samp=0; samprectx); } - add_filt_fmask(1<y+centLut[b>>4]; - shadepixel_sky(xs, ys, zbuf, face, curmask, fcol); + else { + b= R.samples->centmask[curmask]; + xs= (float)x+R.samples->centLut[b & 15]; + ys= (float)y+R.samples->centLut[b>>4]; + shadepixel_sky(pa, xs, ys, zbuf, face, curmask, fcol); + + if(acol && acol[3]!=0.0) addAlphaOverFloat(fcol, acol); + + if(R.do_gamma) { + fcol[0]= gammaCorrect(fcol[0]); + fcol[1]= gammaCorrect(fcol[1]); + fcol[2]= gammaCorrect(fcol[2]); + } + add_filt_fmask(curmask, fcol, rf, pa->rectx); + } - if(acol && acol[3]!=0.0) addAlphaOverFloat(fcol, acol); + mask |= curmask; - if(do_gamma) { - fcol[0]= gammaCorrect(fcol[0]); - fcol[1]= gammaCorrect(fcol[1]); - fcol[2]= gammaCorrect(fcol[2]); - } - add_filt_fmask(curmask, fcol, rb1, rb2, rb3); + if(ps==NULL) break; + else ps= ps->next; } - - mask |= curmask; - - if(ps==NULL) break; - else ps= ps->next; + if(acol) acol+=4; } - rb1+=4; - rb2+=4; - rb3+=4; - if(acol) acol+=4; + rectf+= 4*pa->rectx; + rectdaps+= pa->rectx; + if(recta) recta+= 4*pa->rectx; + seed+= pa->rectx; + + if(y&1) if(R.test_break()) break; } - - return 1; + + if(R.do_gamma) { + for(y= pa->rectx*pa->recty; y>0; y--, grf+=4) { + grf[0] = invGammaCorrect(grf[0]); + grf[1] = invGammaCorrect(grf[1]); + grf[2] = invGammaCorrect(grf[2]); + } + } + } -void zbufshadeDA(void) /* Delta Accum Pixel Struct */ -{ - extern float Zjitx,Zjity; - struct renderlineDA rl1, rl2; - float xd, yd, *rf; - long *rd; - int *rz, *rp, *rt; - float *rowbuf1, *rowbuf2, *rowbuf3, *rowbuf0, *rowbuf1a, *rowbuf2a, *rb3; - int a; - short v, x, y; +/* ************* pixel struct ******** */ - R.rectdaps= MEM_callocN(sizeof(long)*R.rectx*R.recty+4,"zbufDArectd"); + +static PixStrMain *addpsmain(ListBase *lb) +{ + PixStrMain *psm; - if(R.flag & R_ZTRA) { - bgnaccumbuf(); - rl1.acol= MEM_callocN((R.rectx+4)*4*sizeof(float), "Acol"); - rl2.acol= MEM_callocN((R.rectx+4)*4*sizeof(float), "Acol"); - } + psm= (PixStrMain *)RE_mallocN(sizeof(PixStrMain),"pixstrMain"); + BLI_addtail(lb, psm); + + psm->ps= (PixStr *)RE_mallocN(4096*sizeof(PixStr),"pixstr"); + psm->counter= 0; - psmteller= 0; + return psm; +} - if(R.r.mode & R_EDGE) { - R.rectaccu= (int *)MEM_callocN(sizeof(int)*R.rectx*R.recty,"zbufshadeDA"); +static void freeps(ListBase *lb) +{ + PixStrMain *psm, *psmnext; + + for(psm= lb->first; psm; psm= psmnext) { + psmnext= psm->next; + if(psm->ps) + RE_freeN(psm->ps); + RE_freeN(psm); } +} - for(v=0; v0) { - /* halos are alpha-added, not in thread loop (yet) because of gauss mask */ - if(R.flag & R_HALO) { - /* one scanline older... */ - scanlinehaloPS(rz-R.rectx, rd-R.rectx, rowbuf3+4, y-1); - } - - /* convert 4x32 bits buffer to 4x8, this can't be threaded due to gauss */ - transferColourBufferToOutput(rowbuf3+4, y-1); - if(R.rectftot) { - memcpy(rf, rowbuf3+4, 4*sizeof(float)*R.rectx); - rf+= 4*R.rectx; - } - - } - if(y0) { - if((y & 1)==0) { - RE_local_render_display(y-2, y-1, R.rectx, R.recty, R.rectot); - } + if(*rd) { + ps= (PixStr *)(*rd); + + while(ps) { + if( ps->facenr == facenr ) { + ps->mask |= mask; + return; } + last= ps; + ps= ps->next; } - if(RE_local_test_break()) break; } + + /* make new PS (pixel struct) */ + psm= lb->last; + + if(psm->counter==4095) + psm= addpsmain(lb); + + ps= psm->ps + psm->counter++; + + if(last) last->next= ps; + else *rd= (long)ps; + + ps->next= NULL; + ps->facenr= facenr; + ps->z= z; + ps->mask = mask; +} - if( (R.r.mode & R_EDGE) && RE_local_test_break()==0) { - if(R.rectftot) { - float *rtf= R.rectftot, colf[4]; - rp= R.rectaccu; - for(a= R.rectx*R.recty; a>0; a--, rtf+=4, rp++) { - cpCharColV2FloatColV((char *)rp, colf); - addAlphaOverFloat(rtf, colf); - } - RE_floatbuffer_to_output(); - } - else { - rt= R.rectot; - rp= R.rectaccu; - for(a= R.rectx*R.recty; a>0; a--, rt++, rp++) { - addalphaOver((char *)rt, (char *)rp); +static void make_pixelstructs(RenderPart *pa, ListBase *lb) +{ + long *rd= pa->rectdaps; + int *rp= pa->rectp; + int *rz= pa->rectz; + int x, y; + int mask= 1<sample; + + for(y=0; yrecty; y++) { + for(x=0; xrectx; x++, rd++, rp++) { + if(*rp) { + addps(lb, rd, *rp, *(rz+x), mask); } } + rz+= pa->rectx; } - - MEM_freeN(R.rectdaps); - freeps(); - MEM_freeN(rowbuf0); - MEM_freeN(rowbuf1); - MEM_freeN(rowbuf2); - MEM_freeN(rowbuf1a); - MEM_freeN(rowbuf2a); - MEM_freeN(rowbuf3); - R.rectdaps= NULL; - - if(R.r.mode & R_EDGE) if(R.rectaccu) MEM_freeN(R.rectaccu); - R.rectaccu= NULL; - if(R.flag & R_ZTRA) { - endaccumbuf(); - MEM_freeN(rl1.acol); - MEM_freeN(rl2.acol); - } - -} /* end of void zbufshadeDA() */ - -/* ------------------------------------------------------------------------ */ - -struct renderline { - float *rowbuf, *acol; - int *rp; - int *rz; - short ys; - float y; -}; +} -static int do_renderline(void *poin) +/* supposed to be fully threadable! */ +void zbufshadeDA_tile(RenderPart *pa) { - struct renderline *rl= poin; - float *fcol= rl->rowbuf; - float *acol=NULL; - int x, *rz, *rp, seed; + RenderLayer *rl= pa->result->layers.first; + ListBase psmlist= {NULL, NULL}; + float *acolrect= NULL, *edgerect= NULL; - /* we set per pixel a fixed seed, for random AO and shadow samples */ - seed= (R.ystart + rl->y + R.afmy)*R.r.xsch + R.xstart + R.afmx; + set_part_zbuf_clipflag(pa); - if(R.flag & R_ZTRA) { /* zbuf tra */ - abufsetrow(rl->acol, rl->ys); - acol= rl->acol; - } + /* allocate the necessary buffers */ + pa->rectdaps= RE_callocN(sizeof(long)*pa->rectx*pa->recty+4, "zbufDArectd"); + /* zbuffer inits these rects */ + pa->rectp= RE_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectp"); + pa->rectz= RE_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectz"); + if(R.r.mode & R_EDGE) edgerect= RE_callocN(sizeof(float)*pa->rectx*pa->recty, "rectedge"); + + /* initialize pixelstructs */ + addpsmain(&psmlist); - for(x=0, rz= rl->rz, rp= rl->rp; xys & 1, seed+x); + for(pa->sample=0; pa->samplesample++) { + zbuffer_solid(pa); + make_pixelstructs(pa, &psmlist); - shadepixel_sky((float)x, rl->y, *rz, *rp, 0, fcol); - if(acol) { - if(acol[3]!=0.0) addAlphaOverFloat(fcol, acol); - acol+= 4; - } + if(R.r.mode & R_EDGE) edge_enhance_calc(pa, edgerect); + if(R.test_break()) break; } - - if(R.flag & R_HALO) { - scanlinehalo(rl->rz, rl->rowbuf, rl->ys); + + /* we do transp layer first, so its get added with filter in main buffer... still incorrect though */ + if(R.flag & R_ZTRA) { + acolrect= RE_callocN(4*sizeof(float)*pa->rectx*pa->recty, "alpha layer"); + zbuffer_transp_shade(pa, acolrect); } - transferColourBufferToOutput(rl->rowbuf, rl->ys); - - if(R.rectftot) { - memcpy(R.rectftot + 4*rl->ys*R.rectx, rl->rowbuf, 4*sizeof(float)*R.rectx); - } + /* shades solid and adds transparent layer */ + shadeDA_tile(pa, rl->rectf, acolrect); + + /* extra layers */ + if(R.r.mode & R_EDGE) + edge_enhance_add(pa, rl->rectf, edgerect); + if(R.flag & R_HALO) + halo_tile(pa, rl->rectf); + + /* free all */ + RE_freeN(pa->rectp); pa->rectp= NULL; + RE_freeN(pa->rectz); pa->rectz= NULL; + RE_freeN(pa->rectdaps); pa->rectdaps= NULL; + if(acolrect) RE_freeN(acolrect); + if(edgerect) RE_freeN(edgerect); + + freeps(&psmlist); - return 1; } -void zbufshade(void) -{ - struct renderline rl1, rl2; - extern float Zjitx,Zjity; - int *rz, *rp; - float fy; - int y; +/* ------------------------------------------------------------------------ */ - rl1.rowbuf= MEM_callocN((R.rectx+4)*4*sizeof(float), "Zbufshade"); - rl2.rowbuf= MEM_callocN((R.rectx+4)*4*sizeof(float), "Zbufshade"); +/* supposed to be fully threadable! */ +void zbufshade_tile(RenderPart *pa) +{ + RenderLayer *rl= pa->result->layers.first; + float *fcol; + int x, y, *rp, *rz; - Zjitx=Zjity= -0.5; - - zbufferall(); - - /* SHADE */ - rp= R.rectot; - rz= R.rectz; - - if(R.flag & R_ZTRA) { - rl1.acol= MEM_callocN((R.rectx+4)*4*sizeof(float), "Acol"); - rl2.acol= MEM_callocN((R.rectx+4)*4*sizeof(float), "Acol"); - bgnaccumbuf(); - } - - for(y=0; yrectp= RE_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectp"); + rz= pa->rectz= RE_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectz"); + + zbuffer_solid(pa); + + if(!R.test_break()) { + fcol= rl->rectf; + for(y=pa->disprect.ymin; ydisprect.ymax; y++) { + for(x=pa->disprect.xmin; xdisprect.xmax; x++, rz++, rp++, fcol+=4) { + shadepixel_sky(pa, (float)x, (float)y, *rz, *rp, 0, fcol); } - rp+= R.rectx; - rz+= R.rectx; - - if(y < R.recty-1) { - rl2.rp= rp; - rl2.rz= rz; - rl2.y= fy+1.0; - rl2.ys= y+1; - do_renderline(&rl2); - rp+= R.rectx; - rz+= R.rectx; - y++; - } - SDL_WaitThread(thread, NULL); - } - else { - do_renderline(&rl1); - rp+= R.rectx; - rz+= R.rectx; + if(y&1) if(R.test_break()) break; } - - if(y & 1) { - RE_local_render_display(y-1, y, R.rectx, R.recty, R.rectot); - } - - if(RE_local_test_break()) break; } - MEM_freeN(rl1.rowbuf); - MEM_freeN(rl2.rowbuf); + if(!R.test_break()) + if(R.flag & R_ZTRA) + zbuffer_transp_shade(pa, rl->rectf); - if(R.flag & R_ZTRA) { - endaccumbuf(); - MEM_freeN(rl1.acol); - MEM_freeN(rl2.acol); + if(!R.test_break()) { + if(R.r.mode & R_EDGE) { + fillrect(pa->rectp, pa->rectx, pa->recty, 0); + edge_enhance_calc(pa, (float *)pa->rectp); + edge_enhance_add(pa, rl->rectf, (float *)pa->rectp); + } } - if(R.r.mode & R_EDGE) edge_enhance(); + if(!R.test_break()) + if(R.flag & R_HALO) + halo_tile(pa, rl->rectf); -} /* end of void zbufshade() */ + RE_freeN(pa->rectp); pa->rectp= NULL; + RE_freeN(pa->rectz); pa->rectz= NULL; +} /* ------------------------------------------------------------------------ */ -void RE_shadehalo(HaloRen *har, char *col, float *colf, int zz, float dist, float xn, float yn, short flarec) -{ - - shadeHaloFloat(har, colf, zz, dist, xn, yn, flarec); - - if(colf[0]<=0.0) col[0]= 0; else if(colf[0]>=1.0) col[0]= 255; else col[0]= 255.0*colf[0]; - if(colf[1]<=0.0) col[1]= 0; else if(colf[1]>=1.0) col[1]= 255; else col[1]= 255.0*colf[1]; - if(colf[2]<=0.0) col[2]= 0; else if(colf[2]>=1.0) col[2]= 255; else col[2]= 255.0*colf[2]; - if(colf[3]<=0.0) col[3]= 0; else if(colf[3]>=1.0) col[3]= 255; else col[3]= 255.0*colf[3]; - -} - static void renderhalo(HaloRen *har) /* postprocess version */ { - +#if 0 float dist, xsq, ysq, xn, yn, colf[4], *rectft, *rtf; int *rectt, *rt; int minx, maxx, miny, maxy, x, y; @@ -3262,7 +2851,7 @@ static void renderhalo(HaloRen *har) /* postprocess version */ if(R.rectftot) addalphaAddfacFloat(rtf, colf, har->add); else { std_floatcol_to_charcol(colf, col); - RE_addalphaAddfac((char *)rt, col, har->add); + addalphaAddfac((char *)rt, col, har->add); } } rt++; @@ -3272,14 +2861,15 @@ static void renderhalo(HaloRen *har) /* postprocess version */ rectt+= R.rectx; rectft+= 4*R.rectx; - if(RE_local_test_break()) break; + if(R.test_break()) break; } } } +#endif } /* ------------------------------------------------------------------------ */ -void RE_renderflare(HaloRen *har) +static void renderflare(HaloRen *har) { extern float hashvectf[]; HaloRen fla; @@ -3333,12 +2923,12 @@ void RE_renderflare(HaloRen *har) fla.radsq= fla.rad*fla.rad; - vec[0]= 1.4*rc[5]*(har->xs-R.afmx); - vec[1]= 1.4*rc[5]*(har->ys-R.afmy); + vec[0]= 1.4*rc[5]*(har->xs-R.winx/2); + vec[1]= 1.4*rc[5]*(har->ys-R.winy/2); vec[2]= 32.0*sqrt(vec[0]*vec[0] + vec[1]*vec[1] + 1.0); - fla.xs= R.afmx + vec[0] + (1.2+rc[8])*R.rectx*vec[0]/vec[2]; - fla.ys= R.afmy + vec[1] + (1.2+rc[8])*R.rectx*vec[1]/vec[2]; + fla.xs= R.winx/2 + vec[0] + (1.2+rc[8])*R.rectx*vec[0]/vec[2]; + fla.ys= R.winy/2 + vec[1] + (1.2+rc[8])*R.rectx*vec[1]/vec[2]; if(R.flag & R_SEC_FIELD) { if(R.r.mode & R_ODDFIELD) fla.ys += 0.5; @@ -3355,36 +2945,35 @@ void RE_renderflare(HaloRen *har) rc+= 7; } -} /* end of void renderflare(HaloRen *har) */ +} +/* needs recode... integrate this! */ void add_halo_flare(void) { -/* extern void RE_projectverto(); */ /* zbuf.c */ HaloRen *har = NULL; int a, mode; mode= R.r.mode; R.r.mode &= ~R_PANORAMA; - R.xstart= -R.afmx; - R.ystart= -R.afmy; - R.xend= R.xstart+R.rectx-1; - R.yend= R.ystart+R.recty-1; +// R.xstart= -R.afmx; +// R.ystart= -R.afmy; +// R.xend= R.xstart+R.rectx-1; +// R.yend= R.ystart+R.recty-1; - RE_setwindowclip(1,-1); /* no jit:(-1) */ - setzbufvlaggen(RE_projectverto); +// RE_setwindowclip(1,-1); /* no jit:(-1) */ + project_renderdata(&R, projectverto, 0, 0); for(a=0; a>8]; else har++; if(har->flarec) { - RE_renderflare(har); + renderflare(har); } } R.r.mode= mode; - if(R.rectftot) RE_floatbuffer_to_output(); } diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index d37c73dc932..098d4491060 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1,15 +1,12 @@ /** * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,15 +20,14 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. + * Contributor(s): 2004-2006, Blender Foundation, full recode * * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Storage, retrieval and query of render specific data. */ /* + * Storage, retrieval and query of render specific data. + * * All data from a Blender scene is converter by the renderconverter/ * into a special format that is used by the render module to make * images out of. These functions interface to the render-specific @@ -57,6 +53,7 @@ * */ +#include #include #include @@ -66,14 +63,20 @@ #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" #include "DNA_texture_types.h" #include "BKE_texture.h" -#include "render.h" +#include "RE_render_ext.h" /* externtex */ -/* ------------------------------------------------------------------------- */ +#include "renderpipeline.h" +#include "render_types.h" +#include "renderdatabase.h" +#include "texture.h" +#include "zbuf.h" +/* ------------------------------------------------------------------------- */ /* More dynamic allocation of options for render vertices, so we dont have to reserve this space inside vertices. @@ -99,30 +102,30 @@ typedef struct VertTableNode { float *stress; } VertTableNode; -float *RE_vertren_get_sticky(VertRen *ver, int verify) +float *RE_vertren_get_sticky(Render *re, VertRen *ver, int verify) { float *sticky; int nr= ver->index>>8; - sticky= R.vertnodes[nr].sticky; + sticky= re->vertnodes[nr].sticky; if(sticky==NULL) { if(verify) - sticky= R.vertnodes[nr].sticky= MEM_mallocN(256*RE_STICKY_ELEMS*sizeof(float), "sticky table"); + sticky= re->vertnodes[nr].sticky= MEM_mallocN(256*RE_STICKY_ELEMS*sizeof(float), "sticky table"); else return NULL; } return sticky + (ver->index & 255)*RE_STICKY_ELEMS; } -float *RE_vertren_get_stress(VertRen *ver, int verify) +float *RE_vertren_get_stress(Render *re, VertRen *ver, int verify) { float *stress; int nr= ver->index>>8; - stress= R.vertnodes[nr].stress; + stress= re->vertnodes[nr].stress; if(stress==NULL) { if(verify) - stress= R.vertnodes[nr].stress= MEM_mallocN(256*RE_STRESS_ELEMS*sizeof(float), "stress table"); + stress= re->vertnodes[nr].stress= MEM_mallocN(256*RE_STRESS_ELEMS*sizeof(float), "stress table"); else return NULL; } @@ -130,30 +133,30 @@ float *RE_vertren_get_stress(VertRen *ver, int verify) } /* this one callocs! */ -float *RE_vertren_get_rad(VertRen *ver, int verify) +float *RE_vertren_get_rad(Render *re, VertRen *ver, int verify) { float *rad; int nr= ver->index>>8; - rad= R.vertnodes[nr].rad; + rad= re->vertnodes[nr].rad; if(rad==NULL) { if(verify) - rad= R.vertnodes[nr].rad= MEM_callocN(256*RE_RAD_ELEMS*sizeof(float), "rad table"); + rad= re->vertnodes[nr].rad= MEM_callocN(256*RE_RAD_ELEMS*sizeof(float), "rad table"); else return NULL; } return rad + (ver->index & 255)*RE_RAD_ELEMS; } -float *RE_vertren_get_strand(VertRen *ver, int verify) +float *RE_vertren_get_strand(Render *re, VertRen *ver, int verify) { float *strand; int nr= ver->index>>8; - strand= R.vertnodes[nr].strand; + strand= re->vertnodes[nr].strand; if(strand==NULL) { if(verify) - strand= R.vertnodes[nr].strand= MEM_mallocN(256*RE_STRAND_ELEMS*sizeof(float), "strand table"); + strand= re->vertnodes[nr].strand= MEM_mallocN(256*RE_STRAND_ELEMS*sizeof(float), "strand table"); else return NULL; } @@ -161,15 +164,15 @@ float *RE_vertren_get_strand(VertRen *ver, int verify) } /* needs calloc */ -float *RE_vertren_get_tangent(VertRen *ver, int verify) +float *RE_vertren_get_tangent(Render *re, VertRen *ver, int verify) { float *tangent; int nr= ver->index>>8; - tangent= R.vertnodes[nr].tangent; + tangent= re->vertnodes[nr].tangent; if(tangent==NULL) { if(verify) - tangent= R.vertnodes[nr].tangent= MEM_callocN(256*RE_TANGENT_ELEMS*sizeof(float), "tangent table"); + tangent= re->vertnodes[nr].tangent= MEM_callocN(256*RE_TANGENT_ELEMS*sizeof(float), "tangent table"); else return NULL; } @@ -177,36 +180,35 @@ float *RE_vertren_get_tangent(VertRen *ver, int verify) } -VertRen *RE_findOrAddVert(int nr) +VertRen *RE_findOrAddVert(Render *re, int nr) { VertTableNode *temp; VertRen *v; - static int rvertnodeslen=TABLEINITSIZE; int a; if(nr<0) { printf("error in findOrAddVert: %d\n",nr); - return R.vertnodes[0].vert; + return NULL; } a= nr>>8; - if (a>=rvertnodeslen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */ - temp= R.vertnodes; + if (a>=re->vertnodeslen-1) { /* Need to allocate more columns..., and keep last element NULL for free loop */ + temp= re->vertnodes; - R.vertnodes= MEM_mallocN(sizeof(VertTableNode)*(rvertnodeslen+TABLEINITSIZE) , "vertnodes"); - memcpy(R.vertnodes, temp, rvertnodeslen*sizeof(VertTableNode)); - memset(R.vertnodes+rvertnodeslen, 0, TABLEINITSIZE*sizeof(VertTableNode)); + re->vertnodes= MEM_mallocN(sizeof(VertTableNode)*(re->vertnodeslen+TABLEINITSIZE) , "vertnodes"); + if(temp) memcpy(re->vertnodes, temp, re->vertnodeslen*sizeof(VertTableNode)); + memset(re->vertnodes+re->vertnodeslen, 0, TABLEINITSIZE*sizeof(VertTableNode)); - rvertnodeslen+=TABLEINITSIZE; - MEM_freeN(temp); + re->vertnodeslen+=TABLEINITSIZE; + if(temp) MEM_freeN(temp); } - v= R.vertnodes[a].vert; + v= re->vertnodes[a].vert; if(v==NULL) { int i; v= (VertRen *)MEM_callocN(256*sizeof(VertRen),"findOrAddVert"); - R.vertnodes[a].vert= v; + re->vertnodes[a].vert= v; for(i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++) { v[a].index= i; @@ -216,74 +218,80 @@ VertRen *RE_findOrAddVert(int nr) return v; } -void RE_free_vertex_tables(void) +void free_renderdata_tables(Render *re) { int a=0; - while(R.vertnodes[a].vert) { - if(R.vertnodes[a].vert) { - MEM_freeN(R.vertnodes[a].vert); - R.vertnodes[a].vert= NULL; - - if(R.vertnodes[a].rad) { - MEM_freeN(R.vertnodes[a].rad); - R.vertnodes[a].rad= NULL; - } - if(R.vertnodes[a].sticky) { - MEM_freeN(R.vertnodes[a].sticky); - R.vertnodes[a].sticky= NULL; - } - if(R.vertnodes[a].strand) { - MEM_freeN(R.vertnodes[a].strand); - R.vertnodes[a].strand= NULL; - } - if(R.vertnodes[a].tangent) { - MEM_freeN(R.vertnodes[a].tangent); - R.vertnodes[a].tangent= NULL; - } - if(R.vertnodes[a].stress) { - MEM_freeN(R.vertnodes[a].stress); - R.vertnodes[a].stress= NULL; - } + if(re->blovl) { + for(a=0; re->blovl[a]; a++) + MEM_freeN(re->blovl[a]); + + MEM_freeN(re->blovl); + re->blovl= NULL; + re->blovllen= 0; + } + + if(re->bloha) { + for(a=0; re->bloha[a]; a++) + MEM_freeN(re->bloha[a]); + + MEM_freeN(re->bloha); + re->bloha= NULL; + re->blohalen= 0; + } + + if(re->vertnodes) { + for(a=0; re->vertnodes[a].vert; a++) { + MEM_freeN(re->vertnodes[a].vert); + + if(re->vertnodes[a].rad) + MEM_freeN(re->vertnodes[a].rad); + if(re->vertnodes[a].sticky) + MEM_freeN(re->vertnodes[a].sticky); + if(re->vertnodes[a].strand) + MEM_freeN(re->vertnodes[a].strand); + if(re->vertnodes[a].tangent) + MEM_freeN(re->vertnodes[a].tangent); + if(re->vertnodes[a].stress) + MEM_freeN(re->vertnodes[a].stress); } - a++; + + MEM_freeN(re->vertnodes); + re->vertnodes= NULL; + re->vertnodeslen= 0; } } -/* only once, on startup */ -void RE_init_vertex_tables(void) -{ - R.vertnodes= MEM_callocN(sizeof(VertTableNode)*TABLEINITSIZE , "vertnodes"); -} /* ------------------------------------------------------------------------ */ -int rblohalen=TABLEINITSIZE; -HaloRen *RE_findOrAddHalo(int nr) + +HaloRen *RE_findOrAddHalo(Render *re, int nr) { HaloRen *h, **temp; int a; if(nr<0) { printf("error in findOrAddHalo: %d\n",nr); - return R.bloha[0]; + return NULL; } a= nr>>8; - if (a>=rblohalen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */ + if (a>=re->blohalen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */ //printf("Allocating %i more halo groups. %i total.\n", - // TABLEINITSIZE, rblohalen+TABLEINITSIZE ); - temp=R.bloha; - R.bloha=(HaloRen**)MEM_callocN(sizeof(void*)*(rblohalen+TABLEINITSIZE) , "Bloha"); - memcpy(R.bloha, temp, rblohalen*sizeof(void*)); - memset(&(R.bloha[rblohalen]), 0, TABLEINITSIZE*sizeof(void*)); - rblohalen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/ - MEM_freeN(temp); + // TABLEINITSIZE, re->blohalen+TABLEINITSIZE ); + temp=re->bloha; + + re->bloha=(HaloRen**)MEM_callocN(sizeof(void*)*(re->blohalen+TABLEINITSIZE) , "Bloha"); + if(temp) memcpy(re->bloha, temp, re->blohalen*sizeof(void*)); + memset(&(re->bloha[re->blohalen]), 0, TABLEINITSIZE*sizeof(void*)); + re->blohalen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/ + if(temp) MEM_freeN(temp); } - h= R.bloha[a]; - if(h==0) { + h= re->bloha[a]; + if(h==NULL) { h= (HaloRen *)MEM_callocN(256*sizeof(HaloRen),"findOrAdHalo"); - R.bloha[a]= h; + re->bloha[a]= h; } h+= (nr & 255); return h; @@ -291,34 +299,34 @@ HaloRen *RE_findOrAddHalo(int nr) /* ------------------------------------------------------------------------ */ -VlakRen *RE_findOrAddVlak(int nr) +VlakRen *RE_findOrAddVlak(Render *re, int nr) { VlakRen *v, **temp; - static int rblovllen=TABLEINITSIZE; int a; if(nr<0) { printf("error in findOrAddVlak: %d\n",nr); - return R.blovl[0]; + return re->blovl[0]; } a= nr>>8; - if (a>=rblovllen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */ + if (a>=re->blovllen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */ // printf("Allocating %i more face groups. %i total.\n", - // TABLEINITSIZE, rblovllen+TABLEINITSIZE ); - temp=R.blovl; - R.blovl=(VlakRen**)MEM_callocN(sizeof(void*)*(rblovllen+TABLEINITSIZE) , "Blovl"); - memcpy(R.blovl, temp, rblovllen*sizeof(void*)); - memset(&(R.blovl[rblovllen]), 0, TABLEINITSIZE*sizeof(void*)); - rblovllen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/ - MEM_freeN(temp); + // TABLEINITSIZE, re->blovllen+TABLEINITSIZE ); + temp= re->blovl; + + re->blovl=(VlakRen**)MEM_callocN(sizeof(void*)*(re->blovllen+TABLEINITSIZE) , "Blovl"); + if(temp) memcpy(re->blovl, temp, re->blovllen*sizeof(void*)); + memset(&(re->blovl[re->blovllen]), 0, TABLEINITSIZE*sizeof(void*)); + re->blovllen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/ + if(temp) MEM_freeN(temp); } - v= R.blovl[a]; + v= re->blovl[a]; - if(v==0) { + if(v==NULL) { v= (VlakRen *)MEM_callocN(256*sizeof(VlakRen),"findOrAddVlak"); - R.blovl[a]= v; + re->blovl[a]= v; } v+= (nr & 255); return v; @@ -326,7 +334,7 @@ VlakRen *RE_findOrAddVlak(int nr) /* ------------------------------------------------------------------------- */ -HaloRen *RE_inithalo(Material *ma, float *vec, float *vec1, +HaloRen *RE_inithalo(Render *re, Material *ma, float *vec, float *vec1, float *orco, float hasize, float vectsize, int seed) { HaloRen *har; @@ -336,18 +344,18 @@ HaloRen *RE_inithalo(Material *ma, float *vec, float *vec1, if(hasize==0.0) return NULL; - RE_projectverto(vec, hoco); + projectverto(vec, re->winmat, hoco); if(hoco[3]==0.0) return NULL; if(vec1) { - RE_projectverto(vec1, hoco1); + projectverto(vec1, re->winmat, hoco1); if(hoco1[3]==0.0) return NULL; } - har= RE_findOrAddHalo(R.tothalo++); + har= RE_findOrAddHalo(re, re->tothalo++); VECCOPY(har->co, vec); har->hasize= hasize; - /* projectvert is done in function 'zbufvlaggen' because of parts/border/pano */ + /* actual projectvert is done in function transform_renderdata() because of parts/border/pano */ /* halovect */ if(vec1) { @@ -355,14 +363,14 @@ HaloRen *RE_inithalo(Material *ma, float *vec, float *vec1, har->type |= HA_VECT; zn= hoco[3]; - har->xs= 0.5*R.rectx*(hoco[0]/zn); - har->ys= 0.5*R.recty*(hoco[1]/zn); + har->xs= 0.5*re->winx*(hoco[0]/zn); + har->ys= 0.5*re->winy*(hoco[1]/zn); har->zs= 0x7FFFFF*(hoco[2]/zn); har->zBufDist = 0x7FFFFFFF*(hoco[2]/zn); - xn= har->xs - 0.5*R.rectx*(hoco1[0]/hoco1[3]); - yn= har->ys - 0.5*R.recty*(hoco1[1]/hoco1[3]); + xn= har->xs - 0.5*re->winx*(hoco1[0]/hoco1[3]); + yn= har->ys - 0.5*re->winy*(hoco1[1]/hoco1[3]); if(xn==0.0 || (xn==0.0 && yn==0.0)) zn= 0.0; else zn= atan2(yn, xn); @@ -435,4 +443,228 @@ HaloRen *RE_inithalo(Material *ma, float *vec, float *vec1, return har; } + +/* -------------------------- operations on entire database ----------------------- */ + +static float get_pano_rot(Render *re, int part) +{ + static float alpha= 1.0; + + /* part==0 init all */ + if(part==0) { + alpha= ((float)re->r.xsch)/re->viewfac; + alpha= 2.0*atan(alpha/2.0); + } + + /* rotate it all around the y-as with phi degrees */ + return 0.5*(re->r.xparts-1)*alpha + part*alpha; +} + +/* ugly function for halos in panorama */ +static int panotestclip(Render *re, int do_pano, float *v) +{ + /* to be used for halos en infos */ + float abs4; + short c=0; + + if(do_pano) return testclip(v); + + abs4= fabs(v[3]); + + if(v[2]< -abs4) c=16; /* this used to be " if(v[2]<0) ", see clippz() */ + else if(v[2]> abs4) c+= 32; + + if( v[1]>abs4) c+=4; + else if( v[1]< -abs4) c+=8; + + abs4*= re->r.xparts; + if( v[0]>abs4) c+=2; + else if( v[0]< -abs4) c+=1; + + return c; +} + +/* + This adds the hcs coordinates to vertices. It iterates over all + vertices, halos and faces. After the conversion, we clip in hcs. + + Elsewhere, all primites are converted to vertices. + Called in + - envmapping (envmap.c) + - shadow buffering (shadbuf.c) +*/ + +void project_renderdata(Render *re, void (*projectfunc)(float *, float mat[][4], float *), int do_pano, int part) +{ + VlakRen *vlr = NULL; + VertRen *ver = NULL; + HaloRen *har = NULL; + float zn, vec[3], hoco[4]; + int a; + + if(do_pano) { + float panophi= get_pano_rot(re, part); + + re->panosi= sin(panophi); + re->panoco= cos(panophi); + } + + /* calculate view coordinates (and zbuffer value) */ + for(a=0; a< re->totvert;a++) { + if((a & 255)==0) ver= RE_findOrAddVert(re, a); + else ver++; + + if(do_pano) { + vec[0]= re->panoco*ver->co[0] + re->panosi*ver->co[2]; + vec[1]= ver->co[1]; + vec[2]= -re->panosi*ver->co[0] + re->panoco*ver->co[2]; + } + else { + VECCOPY(vec, ver->co); + } + /* Go from wcs to hcs ... */ + projectfunc(vec, re->winmat, ver->ho); + /* ... and clip in that system. */ + ver->clip = testclip(ver->ho); + /* + Because all other ops are performed in other systems, this is + the only thing that has to be done. + */ + } + + /* calculate view coordinates (and zbuffer value) */ + for(a=0; atothalo; a++) { + if((a & 255)==0) har= re->bloha[a>>8]; + else har++; + + if(do_pano) { + vec[0]= re->panoco*har->co[0] + re->panosi*har->co[2]; + vec[1]= har->co[1]; + vec[2]= -re->panosi*har->co[0] + re->panoco*har->co[2]; + } + else { + VECCOPY(vec, har->co); + } + + projectfunc(vec, re->winmat, hoco); + + /* we clip halos less critical, but not for the Z */ + hoco[0]*= 0.5; + hoco[1]*= 0.5; + + if( panotestclip(re, do_pano, hoco) ) { + har->miny= har->maxy= -10000; /* that way render clips it */ + } + else if(hoco[3]<0.0) { + har->miny= har->maxy= -10000; /* render clips it */ + } + else /* do the projection...*/ + { + /* bring back hocos */ + hoco[0]*= 2.0; + hoco[1]*= 2.0; + + zn= hoco[3]; + har->xs= 0.5*re->winx*(1.0+hoco[0]/zn); /* the 0.5 negates the previous 2...*/ + har->ys= 0.5*re->winy*(1.0+hoco[1]/zn); + + /* this should be the zbuffer coordinate */ + har->zs= 0x7FFFFF*(hoco[2]/zn); + /* taking this from the face clip functions? seems ok... */ + har->zBufDist = 0x7FFFFFFF*(hoco[2]/zn); + + vec[0]+= har->hasize; + projectfunc(vec, re->winmat, hoco); + vec[0]-= har->hasize; + zn= hoco[3]; + har->rad= fabs(har->xs- 0.5*re->winx*(1.0+hoco[0]/zn)); + + /* this clip is not really OK, to prevent stars to become too large */ + if(har->type & HA_ONLYSKY) { + if(har->rad>3.0) har->rad= 3.0; + } + + har->radsq= har->rad*har->rad; + + har->miny= har->ys - har->rad/re->ycor; + har->maxy= har->ys + har->rad/re->ycor; + + /* the Zd value is still not really correct for pano */ + + vec[2]-= har->hasize; /* z negative, otherwise it's clipped */ + projectfunc(vec, re->winmat, hoco); + zn= hoco[3]; + zn= fabs( (float)har->zs - 0x7FFFFF*(hoco[2]/zn)); + har->zd= CLAMPIS(zn, 0, INT_MAX); + + } + + } + + /* set flags at 0 if clipped away */ + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; + else vlr++; + + vlr->flag |= R_VISIBLE; + if(vlr->v4) { + if(vlr->v1->clip & vlr->v2->clip & vlr->v3->clip & vlr->v4->clip) vlr->flag &= ~R_VISIBLE; + } + else if(vlr->v1->clip & vlr->v2->clip & vlr->v3->clip) vlr->flag &= ~R_VISIBLE; + + } + +} + /* ------------------------------------------------------------------------- */ + +void set_normalflags(Render *re) +{ + VlakRen *vlr = NULL; + float *v1, xn, yn, zn; + int a1, doflip; + + /* switch normal 'snproj' values (define which axis is the optimal one for calculations) */ + for(a1=0; a1totvlak; a1++) { + if((a1 & 255)==0) vlr= re->blovl[a1>>8]; + else vlr++; + + /* abuse of this flag... this is code that just sets face normal in direction of camera */ + /* that convention we should get rid of */ + if((vlr->flag & R_NOPUNOFLIP)==0) { + + doflip= 0; + if(re->r.mode & R_ORTHO) { + if(vlr->n[2]>0.0) doflip= 1; + } + else { + v1= vlr->v1->co; + if( (v1[0]*vlr->n[0] +v1[1]*vlr->n[1] +v1[2]*vlr->n[2])<0.0 ) doflip= 1; + } + if(doflip) { + vlr->n[0]= -vlr->n[0]; + vlr->n[1]= -vlr->n[1]; + vlr->n[2]= -vlr->n[2]; + } + } + + /* recalculate puno. Displace & flipped matrices can screw up */ + vlr->puno= 0; + if(!(vlr->flag & R_TANGENT)) { + if( Inpf(vlr->n, vlr->v1->n) < 0.0 ) vlr->puno |= ME_FLIPV1; + if( Inpf(vlr->n, vlr->v2->n) < 0.0 ) vlr->puno |= ME_FLIPV2; + if( Inpf(vlr->n, vlr->v3->n) < 0.0 ) vlr->puno |= ME_FLIPV3; + if(vlr->v4 && Inpf(vlr->n, vlr->v4->n) < 0.0 ) vlr->puno |= ME_FLIPV4; + } + xn= fabs(vlr->n[0]); + yn= fabs(vlr->n[1]); + zn= fabs(vlr->n[2]); + if(zn>=xn && zn>=yn) vlr->snproj= 0; + else if(yn>=xn && yn>=zn) vlr->snproj= 1; + else vlr->snproj= 2; + + } +} + + + diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 9ff3c104d0a..1403139269f 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -1,14 +1,10 @@ -/* shadbuf.c RENDER - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** +/* + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -22,20 +18,10 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. + * Contributor(s): 2004-2006, Blender Foundation * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - * april 95 - * - * $Id$ - * - * 27-Jun-2001 switched the shadow buffer for UR to the object-shadow - * buffers, and removed all references and fixes for UR rendering from - * this one. - * */ + * ***** END GPL LICENSE BLOCK ***** + */ #include #include @@ -45,16 +31,18 @@ #include "DNA_lamp_types.h" #include "BKE_utildefines.h" + #include "BLI_arithb.h" +#include "BLI_jitter.h" -#include "render.h" +#include "renderpipeline.h" +#include "render_types.h" +#include "renderdatabase.h" #include "shadbuf.h" -#include "renderHelp.h" -#include "jitter.h" #include "zbuf.h" -/* XXX, could be better implemented... +/* XXX, could be better implemented... this is for endian issues */ #if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__) #define RCOMP 3 @@ -70,80 +58,27 @@ /* ------------------------------------------------------------------------- */ +/* initshadowbuf() in convertBlenderScene.c */ -void RE_initshadowbuf(LampRen *lar, float mat[][4]) -{ - struct ShadBuf *shb; - float hoek, temp, viewinv[4][4]; - - /* if(la->spsi<16) return; */ - - /* memory reservation */ - shb= (struct ShadBuf *)MEM_callocN( sizeof(struct ShadBuf),"initshadbuf"); - lar->shb= shb; - - if(shb==NULL) return; - - VECCOPY(shb->co, lar->co); - - /* percentage render: keep track of min and max */ - shb->size= (lar->bufsize*R.r.size)/100; - if(shb->size<512) shb->size= 512; - else if(shb->size > lar->bufsize) shb->size= lar->bufsize; - - shb->size &= ~15; /* make sure its multiples of 16 */ - - shb->samp= lar->samp; - shb->soft= lar->soft; - shb->shadhalostep= lar->shadhalostep; - - shb->zbuf= (unsigned long *)MEM_mallocN( sizeof(unsigned long)*(shb->size*shb->size)/256, "initshadbuf2"); - shb->cbuf= (char *)MEM_callocN( (shb->size*shb->size)/256, "initshadbuf3"); - - if(shb->zbuf==0 || shb->cbuf==0) { - if(shb->zbuf) MEM_freeN(shb->zbuf); - MEM_freeN(lar->shb); - lar->shb= 0; - return; - } - - MTC_Mat4Ortho(mat); - MTC_Mat4Invert(shb->winmat, mat); /* winmat is temp */ - - /* matrix: combination of inverse view and lampmat */ - /* calculate again: the ortho-render has no correct viewinv */ - MTC_Mat4Invert(viewinv, R.viewmat); - MTC_Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); - - /* projection */ - hoek= saacos(lar->spotsi); - temp= 0.5*shb->size*cos(hoek)/sin(hoek); - shb->d= lar->clipsta; - - shb->pixsize= (shb->d)/temp; - - shb->far= lar->clipend; - /* bias is percentage, made 2x karger because of correction for angle of incidence */ - /* when a ray is closer to parallel of a face, bias value is increased during render */ - shb->bias= (0.02*lar->bias)*0x7FFFFFFF; - shb->bias= shb->bias*(100/R.r.size); - -} /* ------------------------------------------------------------------------- */ - -static void lrectreadRectz(int x1, int y1, int x2, int y2, char *r1) /* reads part from rectz in r1 */ +static void copy_to_ztile(int *rectz, int size, int x1, int y1, int tile, char *r1) { - unsigned int len4, *rz; - - if(x1>=R.rectx || x2>=R.rectx || y1>=R.recty || y2>=R.recty) return; - if(x1>x2 || y1>y2) return; - - len4= 4*(x2- x1+1); - rz= R.rectz+R.rectx*y1+x1; - for(;y1<=y2;y1++) { - memcpy(r1,rz,len4); - rz+= R.rectx; + int len4, *rz; + int x2, y2; + + x2= x1+tile; + y2= y1+tile; + if(x2>=size) x2= size-1; + if(y2>=size) y2= size-1; + + if(x1>=x2 || y1>=y2) return; + + len4= 4*(x2- x1); + rz= rectz + size*y1 + x1; + for(; y1shb; - float panophi; - float temp, wsize, dist; - int *rz, *rz1, verg, verg1; + float wsize, dist; + int *rectz, *rz, *rz1, verg, verg1; unsigned long *ztile; - int a, x, y, minx, miny, byt1, byt2, tempmode; - short temprx,tempry, square; + int a, x, y, minx, miny, byt1, byt2, square; char *rc, *rcline, *ctile, *zt; - panophi = getPanoPhi(); - - /* store viewvars */ - temprx= R.rectx; tempry= R.recty; - tempmode= R.r.mode; - R.r.mode &= ~R_ORTHO; - R.rectx= R.recty= shb->size; - shb->jit= give_jitter_tab(shb->samp); - /* matrices and window: in R.winmat the transformation is being put, + /* matrices and window: in winmat the transformation is being put, transforming from observer view to lamp view, including lamp window matrix */ - wsize= shb->pixsize*(shb->size/2.0); - i_window(-wsize, wsize, -wsize, wsize, shb->d, shb->far, shb->winmat); + i_window(-wsize, wsize, -wsize, wsize, shb->d, shb->clipend, shb->winmat); MTC_Mat4MulMat4(shb->persmat, shb->viewmat, shb->winmat); /* temp, will be restored */ - MTC_Mat4SwapMat4(shb->persmat, R.winmat); + MTC_Mat4SwapMat4(shb->persmat, re->winmat); /* zbuffering */ - if(R.rectz) MEM_freeN(R.rectz); - R.rectz= (unsigned int *)MEM_mallocN(sizeof(int)*shb->size*shb->size,"makeshadbuf"); - rcline= MEM_mallocN(256*4+sizeof(int),"makeshadbuf2"); - - /* store: panorama rot */ - temp= panophi; - panophi= 0.0; - pushTempPanoPhi(0.0); - - /* pano interference here? */ - setzbufvlaggen(projectvert); + rectz= MEM_mallocN(sizeof(int)*shb->size*shb->size, "makeshadbuf"); + rcline= MEM_mallocN(256*4+sizeof(int), "makeshadbuf2"); - popTempPanoPhi(); - panophi= temp; + project_renderdata(re, projectvert, 0, 0); - zbuffershad(lar); + zbuffer_shadow(re, lar, rectz, shb->size); square= lar->mode & LA_SQUARE; @@ -263,7 +177,7 @@ void makeshadowbuf(LampRen *lar) rz1= (&verg)+1; } else { - lrectreadRectz(x, y, MIN2(shb->size-1,x+15), MIN2(shb->size-1,y+15), rcline); + copy_to_ztile(rectz, shb->size, x, y, 16, rcline); rz1= (int *)rcline; verg= (*rz1 & 0xFFFFFF00); @@ -334,12 +248,10 @@ void makeshadowbuf(LampRen *lar) } MEM_freeN(rcline); - MEM_freeN(R.rectz); R.rectz= NULL; + MEM_freeN(rectz); - /* old globals back */ - R.rectx= temprx; R.recty= tempry; - R.r.mode= tempmode; - MTC_Mat4SwapMat4(shb->persmat, R.winmat); + /* old matrix back */ + MTC_Mat4SwapMat4(shb->persmat, re->winmat); /* printf("lampbuf %d\n", sizeoflampbuf(shb)); */ } @@ -455,7 +367,7 @@ float testshadowbuf(struct ShadBuf *shb, float *rco, float *dxco, float *dyco, f xs1= siz*(1.0+co[0]/co[3]); ys1= siz*(1.0+co[1]/co[3]); - /* Clip for z: near and far clip values of the shadow buffer. We + /* Clip for z: clipsta and clipend clip values of the shadow buffer. We * can test for -1.0/1.0 because of the properties of the * coordinate transformations. */ fac= (co[2]/co[3]); diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index b3d053b3f34..fae58a1ec29 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1,17 +1,12 @@ -/* texture.c - * - * +/* * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -25,11 +20,9 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. + * Contributor(s): 2004-2006, Blender Foundation, full recode * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ #include @@ -37,10 +30,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - #include "MTC_matrixops.h" #include "BLI_blenlib.h" @@ -70,11 +59,19 @@ #include "BKE_key.h" #include "BKE_ipo.h" -#include "render.h" +#include "renderpipeline.h" +#include "render_types.h" #include "rendercore.h" #include "envmap.h" #include "texture.h" +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + /* prototypes */ static int calcimanr(int cfra, Tex *tex); @@ -174,12 +171,6 @@ void init_render_texture(Tex *tex) } } } - if(tex->imaflag & (TEX_ANTIALI+TEX_ANTISCALE)) { - if(tex->ima && tex->ima->lastqualityima->ibuf) IMB_freeImBuf(tex->ima->ibuf); - tex->ima->ibuf= 0; - } - } if(tex->type==TEX_PLUGIN) { if(tex->plugin && tex->plugin->doit) { @@ -194,8 +185,8 @@ void init_render_texture(Tex *tex) tex->extend= TEX_CLIP; if(tex->env) { - if(R.flag & R_RENDERING) { - if(tex->env->stype==ENV_ANIM) RE_free_envmapdata(tex->env); + if(G.rendering) { + if(tex->env->stype==ENV_ANIM) BKE_free_envmapdata(tex->env); } } } @@ -1232,34 +1223,6 @@ int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRes return retval; } -/* preview render */ -int multitex_ext(Tex *tex, float *texvec, float *tin, float *tr, float *tg, float *tb, float *ta) -{ - TexResult texr; - float dummy[3]; - int retval; - - /* does not return Tin, hackish... */ - if(tex->type==TEX_STUCCI) { - texr.nor= dummy; - dummy[0]= 1.0; - dummy[1]= dummy[2]= 0.0; - } - else texr.nor= NULL; - - retval= multitex(tex, texvec, NULL, NULL, 0, &texr); - if(tex->type==TEX_STUCCI) { - *tin= 0.5 + 0.7*texr.nor[0]; - CLAMP(*tin, 0.0, 1.0); - } - else *tin= texr.tin; - *tr= texr.tr; - *tg= texr.tg; - *tb= texr.tb; - *ta= texr.ta; - return retval; -} - /* ------------------------------------------------------------------------- */ /* in = destination, tex = texture, out = previous color */ diff --git a/source/blender/render/intern/source/vanillaRenderPipe.c b/source/blender/render/intern/source/vanillaRenderPipe.c deleted file mode 100644 index 1b74adaae9c..00000000000 --- a/source/blender/render/intern/source/vanillaRenderPipe.c +++ /dev/null @@ -1,1641 +0,0 @@ -/** - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * vanillaRenderPipe.c - * - * 28-06-2000 nzc - * - * $Id$ - * - */ - -/* - The render pipe - --------------- - - The overall results of the render pass should end up in R.rectot. This - buffer already exists, and although its contents may change, its location - may not. A lot of other routines depend on it! - -*/ - -/* global includes */ -#include -#include /* INT_MIN,MAX are used here */ -#include -#include "MTC_vectorops.h" -#include "MTC_matrixops.h" -#include "MEM_guardedalloc.h" - -#include "DNA_camera_types.h" -#include "DNA_object_types.h" -#include "BKE_global.h" -#include "BKE_utildefines.h" - -#include "BLI_arithb.h" -#include "BLI_rand.h" - -/* local includes (from the render module) */ -#include "RE_callbacks.h" -#include "render.h" /* all kinds of stuff */ -#include "zbuf.h" /* for vergzvlak, zbufclip, zbufclipwire */ -#include "edgeRender.h" /* all edge rendering stuff */ -#include "pixelshading.h" /* painting the pixels */ -#include "rendercore.h" - -/* general calculus and data manipulation, also local */ -#include "gammaCorrectionTables.h" -#include "jitter.h" -#include "pixelblending.h" -#include "zbufferdatastruct.h" - -/* own includes */ -#include "vanillaRenderPipe.h" - -#include "SDL_thread.h" - -/* threshold for alpha */ -#define RE_FULL_ALPHA_FLOAT 0.9998 - -/* ------------------------------------------------------------------------- */ -/* Debug defines: disable all for production level code. */ -/* These variables control faking of rendered colours, extra tracing, */ -/* extra error checking and such. */ -/* ------------------------------------------------------------------------- */ - -/* if defined: _very_ explicit tracing and checking enabled */ -/* #define RE_FULL_SAFETY */ -/* if defined: use 'simple' alpha thresholding on oversampling */ -/* #define RE_SIMPLE_ALPHA_THRESHOLD */ - -/* ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ - -/* External : -------------------------------------------------------------- */ - -extern float centLut[16]; /* Lookup for jitter offsets. */ -extern unsigned int Zsample; /* Nr. of the currently active oversample. This */ - /* counter must be set explicitly by the */ - /* function that builds the z-buffer. */ - /* The buffer-filling functions use it. */ -extern float Zjitx,Zjity; /* The x,y values for jitter offset */ - -extern float Zmulx, Zmuly; /* Some kind of scale? */ - -extern char cmask[256]; /* When a pixel is supersampled, we must */ -extern char *centmask; /* compute its colour on a point _on_ the face. */ - /* These two are used to compute an offset to */ - /* guarantee we use valid coordinates. */ - -extern RE_APixstrExt *APixbufExt;/*Zbuffer: linked list of face, halo indices*/ - -/* Globals : --------------------------------------------------------------- */ - /* we use 2 x three lines, for gaussian sample */ -RE_COLBUFTYPE *AColourBuffer0; /* Buffer for colours of 1 line of pixels */ -RE_COLBUFTYPE *AColourBuffer1; /* Buffer for colours of 1 line of pixels */ -RE_COLBUFTYPE *AColourBuffer2; /* Buffer for colours of 1 line of pixels */ -RE_COLBUFTYPE *AColourBuffer1a; /* Buffer for colours of 1 line of pixels */ -RE_COLBUFTYPE *AColourBuffer2a; /* Buffer for colours of 1 line of pixels */ -RE_COLBUFTYPE *AColourBuffer3; /* Buffer for colours of 1 line of pixels */ - -static int Aminy; /* y value of first line in the accu buffer */ -static int Amaxy; /* y value of last line in the accu buffer */ - /* -also used to clip when zbuffering */ - -/* Buffer width refers to the size of the buffers we build. Image size is */ -/* the same as R.rectx, R.recty. */ -static int zBufferWidth; /* special width because zbuffer needs to be */ - /* wider */ - -static int Azvoordeel; /* A small offset for transparent rendering. */ -int alphaLUT[32]; /* alpha lookuptable, for oversampling */ - /* Its function has been superceded because */ - /* pixels are always integrated. This */ - /* performs the same normalization. */ -int osaNr; /* The oversample number. I keep it */ - /* separately here, because I treat no OSA */ - /* as if it were osa=1. */ - -/* ------------------------------------------------------------------------- */ - -/** -* Z buffer initializer, for new pipeline. - *
  • - * AColourBuffer : colour buffer for one line - * APixbufExt : pixel data buffer for one line, depth RE_ZBUFLEN - *
  • - */ -static void initRenderBuffers(int bwidth) -{ - /* bwidth+4, as in rendercore.c. I think it's too much, but yah (ton) */ - AColourBuffer0 = MEM_callocN(4 * sizeof(RE_COLBUFTYPE) * (bwidth+4), "Acolrow"); - AColourBuffer1 = MEM_callocN(4 * sizeof(RE_COLBUFTYPE) * (bwidth+4), "Acolrow"); - AColourBuffer2 = MEM_callocN(4 * sizeof(RE_COLBUFTYPE) * (bwidth+4), "Acolrow"); - AColourBuffer1a = MEM_callocN(4 * sizeof(RE_COLBUFTYPE) * (bwidth+4), "Acolrow"); - AColourBuffer2a = MEM_callocN(4 * sizeof(RE_COLBUFTYPE) * (bwidth+4), "Acolrow"); - AColourBuffer3 = MEM_callocN(4 * sizeof(RE_COLBUFTYPE) * (bwidth+4), "Acolrow"); - - /* The +1 is needed because the fill-functions use a +1 offset when */ - /* filling in pixels. Mind that also the buffer-clearing function needs */ - /* this offset (done in calcZBufLine). */ - /* The offset is wrong: it shouldn't be there. I need to fix this still. */ - zBufferWidth = bwidth + 1; - initZbuffer(bwidth + 1); - - Aminy= -1000; /* indices of lines in the z buffer: no lines buffered */ - Amaxy= -1000; - - -} - -/* ------------------------------------------------------------------------- */ -/** - * Z buffer destructor, frees stuff from initZBuffers(). - */ - -static void freeRenderBuffers(void) { - if (AColourBuffer0) MEM_freeN(AColourBuffer0); - if (AColourBuffer1) MEM_freeN(AColourBuffer1); - if (AColourBuffer2) MEM_freeN(AColourBuffer2); - if (AColourBuffer1a) MEM_freeN(AColourBuffer1a); - if (AColourBuffer2a) MEM_freeN(AColourBuffer2a); - if (AColourBuffer3) MEM_freeN(AColourBuffer3); - freeZbuffer(); -} -/* ------------------------------------------------------------------------- */ - -/** - * New fill function for z buffer, for edge-only rendering. - */ -static void zBufferFillFace(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3) -{ - /* Coordinates of the vertices are specified in ZCS */ - VlakRen *vlr; - int apteller, apoffsetteller; - double z0; /* used as temp var*/ - double xx1; - double zxd,zyd,zy0, tmp; - float *minv,*maxv,*midv; - register int zverg,zvlak,x; - int my0,my2,sn1,sn2,rectx,zd; - int y,omsl,xs0,xs1,xs2,xs3, dx0,dx1,dx2, mask; - int obtype; - /* These used to be doubles. We may want to change them back if the */ - /* loss of accuracy proves to be a problem? There does not seem to be */ - /* any performance issues here, so I'll just keep the doubles. */ - /* float vec0[3], vec1[3], vec2[3]; */ - double vec0[3], vec1[3], vec2[3]; - - vlr= RE_findOrAddVlak( (zvlnr-1) & 0x7FFFFF); - if(vlr->mat->mode & MA_ZTRA) obtype= RE_POLY; - else obtype= RE_POLY|RE_SOLID; - - /* MIN MAX */ - /* sort vertices for min mid max y value */ - if(v1[1] Amaxy)) return; - - if(my02.0/65536.0) { - z0= (maxv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx0= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-minv[1])+minv[0]); - xs0= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx0= 0; - xs0= 65536.0*(MIN2(minv[0],maxv[0])); - } - /* EDGES : THE TOP ONE */ - xx1= maxv[1]-midv[1]; - if(xx1>2.0/65536.0) { - z0= (maxv[0]-midv[0])/xx1; - - tmp= (-65536.0*z0); - dx1= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-midv[1])+midv[0]); - xs1= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx1= 0; - xs1= 65536.0*(MIN2(midv[0],maxv[0])); - } - /* EDGES : THE BOTTOM ONE */ - xx1= midv[1]-minv[1]; - if(xx1>2.0/65536.0) { - z0= (midv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx2= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(omsl-minv[1])+minv[0]); - xs2= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx2= 0; - xs2= 65536.0*(MIN2(minv[0],midv[0])); - } - - /* ZBUF DX DY */ - /* xyz_1 = v_1 - v_2 */ - MTC_diff3DFF(vec1, v1, v2); - /* xyz_2 = v_2 - v_3 */ - MTC_diff3DFF(vec2, v2, v3); - /* xyz_0 = xyz_1 cross xyz_2 */ - MTC_cross3Double(vec0, vec1, vec2); - - /* cross product of two of the sides is 0 => this face is too small */ - if(vec0[2]==0.0) return; - - if(midv[1] == maxv[1]) omsl= my2; - if(omsl < Aminy) omsl= Aminy-1; /* make sure it takes the first loop entirely */ - - while (my2 > Amaxy) { /* my2 can be larger */ - xs0+=dx0; - if (my2<=omsl) { - xs2+= dx2; - } - else{ - xs1+= dx1; - } - my2--; - } - - xx1= (vec0[0]*v1[0]+vec0[1]*v1[1])/vec0[2]+v1[2]; - - zxd= -vec0[0]/vec0[2]; - zyd= -vec0[1]/vec0[2]; - zy0= my2*zyd+xx1; - zd= (int)CLAMPIS(zxd, INT_MIN, INT_MAX); - - /* start-ofset in rect */ - /* rectx= R.rectx; */ - /* I suspect this var needs very careful setting... When edge rendering */ - /* is on, this is strange */ - rectx = zBufferWidth; - apoffsetteller = rectx*(my2-Aminy); - - mask= 1<dx1) { - MTC_swapInt(&xs0, &xs1); - MTC_swapInt(&dx0, &dx1); - xs3= 1; /* flag */ - - } - - for(y=my2;y>omsl;y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs1>>16; - xs1+= dx1; - - sn1++; - - if(sn2>=rectx) sn2= rectx-1; - if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - apteller = apoffsetteller + sn1; - x= sn2-sn1; - - zverg-= Azvoordeel; - - while(x>=0) { - insertObject(apteller, zvlnr, obtype, zverg, mask); - zverg+= zd; - apteller++; - x--; - } - zy0-= zyd; - apoffsetteller -= rectx; - } - - if(xs3) { - xs0= xs1; - dx0= dx1; - } - if(xs0>xs2) { - xs3= xs0; - xs0= xs2; - xs2= xs3; - xs3= dx0; - dx0= dx2; - dx2= xs3; - } - - for(; y>=my0; y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs2>>16; - xs2+= dx2; - - sn1++; - - if(sn2>=rectx) sn2= rectx-1; - if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - apteller = apoffsetteller + sn1; - x= sn2-sn1; - - zverg-= Azvoordeel; - - while(x>=0) { - insertObject(apteller, zvlnr, obtype, zverg, mask); - zverg+= zd; - apteller++; - x--; - } - - zy0-=zyd; - apoffsetteller -= rectx; - } -} -/* ------------------------------------------------------------------------- */ - -static void zBufferFillEdge(int zvlnr, float *vec1, float *vec2) -{ - int apteller; - int start, end, x, y, oldx, oldy, ofs; - int dz, vergz, mask, maxtest=0; - float dx, dy; - float v1[3], v2[3]; - - dx= vec2[0]-vec1[0]; - dy= vec2[1]-vec1[1]; - - if(fabs(dx) > fabs(dy)) { - - /* all lines from left to right */ - if(vec1[0]= zBufferWidth) end = zBufferWidth - 1; - - oldy= floor(v1[1]); - dy/= dx; - - vergz= v1[2]; - vergz-= Azvoordeel; - dz= (v2[2]-v1[2])/dx; - if(vergz>0x70000000 && dz>0) maxtest= 1; // prevent overflow - - apteller = zBufferWidth*(oldy-Aminy) +start; - mask = 1<=0 && y>=Aminy && y<=Amaxy) { - insertObject(apteller, zvlnr, RE_POLY, vergz, mask); - } - - v1[1]+= dy; - vergz+= dz; - if(maxtest && vergz<0) vergz= 0x7FFFFFF0; - } - } - else { - - /* all lines from top to bottom */ - if(vec1[1]Amaxy || endAmaxy) end= Amaxy; - - oldx= floor(v1[0]); - dx/= dy; - - vergz= v1[2]; - vergz-= Azvoordeel; - dz= (v2[2]-v1[2])/dy; - if(vergz>0x70000000 && dz>0) maxtest= 1; // prevent overflow - - apteller = zBufferWidth*(start-Aminy) +oldx; - - mask= 1<=0 && y>=Aminy && (x < zBufferWidth)) { - insertObject(apteller, zvlnr, RE_POLY, vergz, mask); - } - - v1[0]+= dx; - vergz+= dz; - if(maxtest && vergz<0) vergz= 0x7FFFFFF0; - } - } -} -/* ------------------------------------------------------------------------- */ - -/** - * Count and sort the list behind ap into buf. Sorts on min. distance. - * Low index <=> high z - */ -static int countAndSortPixelFaces(int zrow[][RE_PIXELFIELDSIZE], - RE_APixstrExt *ap) -{ - int totvlak; /* face counter */ - int i; /* generic counter */ - - totvlak= 0; - while(ap) { - for(i=0; i<4; i++) { - if(ap->t[i]) { - zrow[totvlak][0] = ap->zmin[i]; - zrow[totvlak][1] = ap->p[i]; - zrow[totvlak][2] = ap->mask[i]; - zrow[totvlak][3] = ap->t[i]; - zrow[totvlak][4] = ap->zmax[i]; - totvlak++; - if(totvlak > (RE_MAX_FACES_PER_PIXEL - 1)) - { - totvlak = (RE_MAX_FACES_PER_PIXEL - 1); - } - } else break; - }; - ap= ap->next; - } - - if(totvlak==2) { /* Sort faces ----------------------------- */ - if(zrow[0][0] < zrow[1][0]) { - i= zrow[0][0]; zrow[0][0]= zrow[1][0]; zrow[1][0]= i; - i= zrow[0][1]; zrow[0][1]= zrow[1][1]; zrow[1][1]= i; - i= zrow[0][2]; zrow[0][2]= zrow[1][2]; zrow[1][2]= i; - i= zrow[0][3]; zrow[0][3]= zrow[1][3]; zrow[1][3]= i; - i= zrow[0][4]; zrow[0][4]= zrow[1][4]; zrow[1][4]= i; - } /* else: two faces, and ordering is ok */ - } else if (totvlak != 1) qsort(zrow, totvlak, - sizeof(int)*RE_PIXELFIELDSIZE, vergzvlak); - return totvlak; -} - -/* ------------------------------------------------------------------------- */ -/* Oversampler v3 - check CVS for older versions */ -/* */ -/* In this version, I have split up the rendering into several parts, so I */ -/* can generate better profiles. */ -/* */ -/* - multiple blend functions ? */ -/* - x-rays? */ -/* - volumetric stuff ? */ -/* - maybe the oversampling should move to the shading part */ -/* */ -/* ------------------------------------------------------------------------- */ - -/* These variables describe the buffers needed for the oversampling. */ -/* 1. A bit vector with flags to indicate which pixels have received colour. */ -static int VR_covered = 0; -/* 2. The local vector collector, for resolving conflicts only. */ -static int VR_cbuf[RE_MAX_FACES_PER_PIXEL][2]; - -/** - * Analyze the z-buffer, and pre-sample the colours. - */ -static int composeStack(int zrow[][RE_PIXELFIELDSIZE], RE_COLBUFTYPE *collector, - struct RE_faceField* stack, int ptr, - int totvlak, float x, float y, int osaNr) -{ - VlakRen *vlr= NULL; - float xs = 0.0; - float ys = 0.0; /* coordinates for the render-spot */ - float alphathreshold[RE_MAX_OSA_COUNT]; - float colbuf[4]; - int inconflict = 0; - int saturationthreshold = 0; - int saturated = 0; - int i = 0; - int Ccount = 0; - int Cthresh = 0; - int save_totvlak = totvlak; - int fullsubpixelflags = 0; - int full_osa; - - VR_covered = 0; - for(i = 0; i < osaNr; i++) alphathreshold[i] = 0.0; - saturationthreshold = ( (1< 0) ) { - totvlak--; - - full_osa= 0; - if(R.osa && (zrow[totvlak][RE_TYPE] & RE_POLY)) { - vlr= RE_findOrAddVlak((zrow[totvlak][RE_INDEX]-1) & 0x7FFFFF); - if(vlr->flag & R_FULL_OSA) full_osa= 1; - } - - if(full_osa) { - float div=0.0, accol[4]={0.0, 0.0, 0.0, 0.0}; - int a, mask= zrow[totvlak][RE_MASK]; - - for(a=0; a> 4]; - } - else { - xs= (float)x; - ys= (float)y; - } - - /* stack face ----------- */ - stack[ptr].mask = zrow[totvlak][RE_MASK]; - stack[ptr].data = renderPixel(collector, xs, ys, zrow[totvlak], stack[ptr].mask); - } - stack[ptr].faceType = zrow[totvlak][RE_TYPE]; - cpFloatColV(collector, stack[ptr].colour); - - /* This is done so that spothalos are properly overlayed on halos */ - /* maybe we need to check the colour here... */ - if(zrow[totvlak][RE_TYPE] & RE_POLY) VR_covered |= zrow[totvlak][RE_MASK]; - - /* calculate conflict parameters: ---------------------------------- */ - if( zrow[totvlak][RE_ZMIN] < Cthresh ) { - inconflict = 1; - /* Prevent from switching on bad data. This may be done more */ - /* efficiently later on. It is _quite_ important. */ - if (totvlak == save_totvlak - 1) Ccount = 0; - else if(Ccount == 0) Ccount = 2; - else Ccount++; - stack[ptr].conflictCount = Ccount; - if (zrow[totvlak][RE_ZMAX] > Cthresh) - Cthresh = zrow[totvlak][RE_ZMAX]; - } else { - Cthresh = zrow[totvlak][RE_ZMAX]; - Ccount = 0; - stack[ptr].conflictCount = 0; - if (totvlak > 0 ) - inconflict = (zrow[totvlak-1][RE_ZMIN] < Cthresh); - else inconflict = 0; - } - - ptr++; - - /* alpha threshold ------------------------------------------------- */ - /* There are currently two ways of blending: alpha-over, and add. */ - /* Add-blending does strange things, in the sense that alpha is */ - /* simply added, and colour is sort of alpha-over blended. Using the */ - /* same thresholding relation seems to work ok. For less than unity */ - /* add factor, the alpha threshold may rise faster, but currently we */ - /* do not check for this factor. */ - for(i = 0; i < osaNr; i++) { - if ( zrow[totvlak][RE_MASK] & (1< RE_FULL_ALPHA_FLOAT) - fullsubpixelflags |= (1<= saturationthreshold); - - } /* done stacking ----------------------------------------------------- */ - - /* - STACK_SKY Sometimes, a sky pixel is needed. Since there are - some issues with mist/ ztra/ env, I always put the sky here. - */ -/* if (!saturated) { */ - totvlak--; - - xs= (float)x; - ys= (float)y; - - /* code identical for rendering empty sky pixel */ - renderSkyPixelFloat(collector, xs, ys, NULL); - cpFloatColV(collector, colbuf); - - if(R.flag & R_LAMPHALO) { - renderSpotHaloPixel(x, y, collector); - addAlphaOverFloat(colbuf, collector); - } - - stack[ptr].faceType = RE_SKY; - cpFloatColV(colbuf, stack[ptr].colour); - stack[ptr].data = NULL; - stack[ptr].mask = 0xFFFF; - stack[ptr].conflictCount = 0; - ptr++; -/* } */ - - /* Index of the top of the stack */ - return ptr; -} - -/* ------------------------------------------------------------------------- */ - -/** - * Calculate the view depth to this object on this location, with - * the current view parameters in R. - */ -static int calcDepth(float x, float y, void *data, int type) -{ - float view[3]; - - if (type & RE_POLY) { - VlakRen* vlr = (VlakRen*) data; - VertRen* v1; - float dface, div, zco, hoco_z, hoco_w; - int zbuf_co; - - v1 = vlr->v1; - - /* vertex dot face normal: WCS */ - dface= v1->co[0]*vlr->n[0]+v1->co[1]*vlr->n[1]+v1->co[2]*vlr->n[2]; - - /* jitter has been added to x, y ! */ - /* view vector view: screen coords */ - view[0]= (x+(R.xstart)+0.5); - - if(R.flag & R_SEC_FIELD) { - if(R.r.mode & R_ODDFIELD) view[1]= (y + R.ystart)*R.ycor; - else view[1]= (y + R.ystart + 1.0)*R.ycor; - } - else view[1]= (y + R.ystart + 0.5)*R.ycor; - - - /* for pano, another rotation in the xz plane is needed.... */ - - /* this is ok, in WCS */ - view[2]= -R.viewfac; /* distance to viewplane */ - - /* calculate zcoord */ - if(R.r.mode & R_ORTHO) { - /* x and y 3d coordinate can be derived from pixel coord and winmat */ - float fx= 2.0/(R.rectx*R.winmat[0][0]); - float fy= 2.0/(R.recty*R.winmat[1][1]); - - fx= (0.5 + x - 0.5*R.rectx)*fx - R.winmat[3][0]/R.winmat[0][0]; - fy= (0.5 + y - 0.5*R.recty)*fy - R.winmat[3][1]/R.winmat[1][1]; - - /* using a*x + b*y + c*z = d equation, (a b c) is normal */ - zco= (dface - vlr->n[0]*fx - vlr->n[1]*fy)/vlr->n[2]; - - } - else { - /* face normal dot view vector: but how can this work? (nzc) */ - div = MTC_dot3Float(vlr->n, view); - if (div!=0.0) zco = (view[2]*dface)/div; - else zco = 0.0; - } - - /* same as in zbuf.c */ - hoco_z = zco*R.winmat[2][2] + R.winmat[3][2]; - hoco_w = zco*R.winmat[2][3] + R.winmat[3][3]; - - if(hoco_w!=0.0) zbuf_co = 0x7FFFFFFF*(hoco_z/hoco_w); - else zbuf_co= 0x7FFFFFFF; - - return zbuf_co; /* z component of R.co */ - } else if (type & RE_HALO) { - HaloRen* har = (HaloRen*) data; - return har->zBufDist; - } - return 0; -} - -/** - * Blend source over dest, and leave result in dest. 1 pixel. - */ -static void blendOverFloat(int type, float* dest, float* source, void* data) -{ - - if (type & RE_POLY) { - VlakRen *ver = (VlakRen*) data; - if ((ver->mat != NULL) && (ver->mat->add > RE_FACE_ADD_THRESHOLD)) { - char addf = (char) (ver->mat->add * 255.0); - addalphaAddfacFloat(dest, source, addf); - } - else - addAlphaOverFloat(dest, source); - } else if (type & RE_HALO) { - HaloRen *har= (HaloRen*) data; - addalphaAddfacFloat(dest, source, har->add); - } else if (type & RE_SKY) { - addAlphaOverFloat(dest, source); - } - -} - - -/** - * New approach: sample substacks. Each substack is first copied into - * a stack buffer, and then blended down. - * */ -static void integratePerSubStack(float *sampcol, struct RE_faceField* stack, - int ptr, float x, float y, int osaNr) -{ - int i = 0; - int j = 0; - int k = 0; - int l = 0; - int filterMask = 0; - /* next step would be to improve on the substack, I guess */ - int subStack[RE_MAX_FACES_PER_PIXEL + 1]; - float colSubStack[4 * (RE_MAX_FACES_PER_PIXEL + 1)]; - int subStackPtr = 0; - int subStackSize = 0; - float xs, ys; - - - while (i < osaNr) { - xs = x + jit[i][0]; - ys = y + jit[i][1]; - - /* - * 1. Copy all relevant faces. Mind that stack is built from - * low index = low z to high index =high z. The sub-stack is - * exactly the other way around! (low index = high z) - */ - filterMask = (1 << i); - subStackPtr = 0; - j = ptr - 1; /* the topmost valid face */ - while (j >= 0) { - if (stack[j].conflictCount) { - /* Conflict: we sort the faces for distance right - * away. We could adapt conflict count, and adjust the - * stack later on, but that's really doing too much, - * too complicated. This is just fine. - * */ - k = 0; - l = 0; - /* check whether the face intersects, and if so, - * stores depth */ - while (k < stack[j].conflictCount) { - if (stack[j - k].mask & filterMask) { - VR_cbuf[l][0] = calcDepth(xs, ys, - stack[j - k].data, - stack[j - k].faceType); - VR_cbuf[l][1] = j - k; - l++; - } - k++; - } - /* VR_cbuf now contains l pairs (distance, stackindex) */ - qsort(VR_cbuf, l, sizeof(int)*2, vergzvlak); - /* - * Now we put the sorted indices on the - * substack. qsort delivers low index = low z, which - * is the right wrong order for the substack */ - k = 0; - while (k < l) { - subStack[subStackPtr] = VR_cbuf[k][1]; - cpFloatColV(stack[VR_cbuf[k][1]].colour, &colSubStack[4*subStackPtr]); - subStackPtr++; - k++; - } - - j -= stack[j].conflictCount; - } else { - /* no conflict */ - if (stack[j].mask & filterMask) { - subStack[subStackPtr] = j; - cpFloatColV(stack[j].colour, &colSubStack[4*subStackPtr]); - subStackPtr++; - } - j--; - } - } - subStackSize = subStackPtr; - - /* 2. Operations on the faces can go here for now. I might - * want to mix this code with the blending. Currently, I only - * handle env/ztra faces. It's a dirty patch now...*/ - subStackPtr = subStackSize - 1; - while (subStackPtr >= 0) { - /* we can make a general meachanism here for operations */ - if (stack[subStack[subStackPtr]].faceType & RE_POLY){ - VlakRen* vlr = (VlakRen*) stack[subStack[subStackPtr]].data; - if (vlr->mat) { - /* ENV faces */ - if (vlr->mat->mode & MA_ENV) { - int m; - colSubStack[4*subStackPtr] = 0.0; - colSubStack[(4*subStackPtr) + 1] = 0.0; - colSubStack[(4*subStackPtr) + 2] = 0.0; - colSubStack[(4*subStackPtr) + 3] = 0.0; - m = subStackPtr - 1; - while (m >= 0) { - if (stack[subStack[m]].faceType != RE_SKY) { - colSubStack[4*m] = 0.0; - colSubStack[(4*m) + 1] = 0.0; - colSubStack[(4*m) + 2] = 0.0; - colSubStack[(4*m) + 3] = 0.0; - } - m--; - } - } - /* ZTRA faces */ - else if (!(vlr->mat->mode & MA_ZTRA)) { - int m; - m = subStackPtr - 1; - while (m >= 0) { - if (stack[subStack[m]].faceType != RE_SKY) { - colSubStack[4*m] = 0.0; - colSubStack[(4*m) + 1] = 0.0; - colSubStack[(4*m) + 2] = 0.0; - colSubStack[(4*m) + 3] = 0.0; - } - m--; - } - } - } - } - subStackPtr--; - } - - /* 3. blend down */ - subStackPtr = 0; - while( subStackPtr < subStackSize ) { - blendOverFloat(stack[subStack[subStackPtr]].faceType, /* type */ - sampcol + (4 * i), /* dest */ - &colSubStack[4 * subStackPtr], - stack[subStack[subStackPtr]].data); /* data */ - subStackPtr++; - } - - i++; - } -} - - - -/* ------------------------------------------------------------------------- */ -/* Rendering: per line */ -/* */ -/* For each pixel in this line, we render as follows: */ -/* a. Count the number of objects buffered for this pixel, and sort on z */ -/* ------- Result is left in zrow */ -/* b. Shade the pixel: */ -/* 1. From front to back: calculate the colour for this object */ -/* 2. Blend this colour in with the already calculated colour */ -/* Repeat 1. and 2. until no faces remain. */ -/* For each pixel, a face is only rendered once, even if it is */ -/* jittered. All subpixels get the colour of the weighted centre */ -/* of the jitter-positions this face covers. */ -/* ------- Result is left in sampcol[] */ -/* c. Copy the result to the colour buffer */ -/* d. Do gamma-corrected blending */ -/* */ -/* zrow may need some clarification: */ -/* 0 - min. distance */ -/* 1 - face/halo index */ -/* 2 - masks */ -/* 3 - type RE_POLY or RE_HALO */ -/* 4 - max. distance */ -/* It is used to store copies of RE_APixstrExt records. These are sorted for */ -/* distance, and then used for rendering pixels. zrow might be replaced by */ -/* an RE_APixstrExt* array */ -/* - redo the numbering to something more logical */ - - -/* threadsafe global arrays, too large for stack */ -typedef struct zbufline { - int zrow[RE_MAX_FACES_PER_PIXEL][RE_PIXELFIELDSIZE]; - struct RE_faceField osastack[RE_MAX_FACES_PER_PIXEL + 1]; -} zbufline; - -static zbufline zb1, zb2; - -static void renderZBufLine(int y, RE_COLBUFTYPE *colbuf1, RE_COLBUFTYPE *colbuf2, RE_COLBUFTYPE *colbuf3) -{ - RE_APixstrExt *ap; /* iterator for the face-lists */ - RE_COLBUFTYPE collector[4]; - RE_COLBUFTYPE sampcol[RE_MAX_OSA_COUNT * 4]; - RE_COLBUFTYPE *j = NULL; /* generic pixel pointer */ - int apteller; - int x; /* pixel counter */ - int i; /* yet another counter */ - int stackDepth; /* faces-behind-this-pixel counter */ - int osastack_ptr; /* Points to the lowest empty field. The indexed */ - zbufline *zbl; - - /* thread safe row buffers */ - if(y & 1) zbl= &zb1; - else zbl= &zb2; - - /* Prepare iterators */ - ap = APixbufExt + (zBufferWidth * (y - Aminy)); - apteller = (zBufferWidth * (y - Aminy)); - - /* Rendering: give the right colour to this pixel (shade it) */ - for( x = 0; x < R.rectx; x++, ap++, colbuf1+=4, colbuf2+=4, colbuf3+=4) { - if(ap->t[0]) { - /* reset sample collector */ - j = sampcol; - for(i = 0; i < osaNr; i++, j+=4) { - j[0] = 0.0f; j[1] = 0.0f; - j[2] = 0.0f; j[3] = 0.0f; - }; - - /* a. count and sort number of faces */ - stackDepth = countAndSortPixelFaces( zbl->zrow, ap); - - /* b,c. oversample all subpixels, then integrate */ - osastack_ptr = 0; - osastack_ptr = composeStack(zbl->zrow, collector, zbl->osastack, osastack_ptr, - stackDepth, x, y, osaNr); - integratePerSubStack(sampcol, zbl->osastack, osastack_ptr, x, y, osaNr); - - /* d. Gamma corrected blending and Gaussian */ - sampleFloatColV2FloatColVFilter(sampcol, colbuf1, colbuf2, colbuf3, osaNr); - - } else { - /* Remember to do things back-to-front! */ - - /* This is a bit dirty. Depending on sky-mode, the pixel is */ - /* blended in differently. */ - renderSkyPixelFloat(collector, x, y, NULL); - - j = sampcol; - for(i = 0; i < osaNr; i++, j+=4) { - j[0]= collector[0]; j[1]= collector[1]; - j[2]= collector[2]; j[3]= collector[3]; - } - - /* Spothalos are part of the normal pixelshader, so for covered */ - /* pixels they are handled ok. They are 'normally' alpha blended */ - /* onto the existing colour in the collector. */ - if(R.flag & R_LAMPHALO) { - renderSpotHaloPixel(x, y, collector); - if(do_gamma) { - collector[0]= gammaCorrect(collector[0]); - collector[1]= gammaCorrect(collector[1]); - collector[2]= gammaCorrect(collector[2]); - } - - j = sampcol; - for(i = 0; i < osaNr; i++, j+=4) { - addAlphaOverFloat(j, collector); - } - } - - sampleFloatColV2FloatColVFilter(sampcol, colbuf1, colbuf2, colbuf3, osaNr); - - } - } -} - - -/** - * Fills in distances of faces in the z buffer. - * - * Halo z buffering ---------------------------------------------- - * - * A halo is treated here as a billboard: no z-extension, always - * oriented perpendicular to the viewer. The rest of the z-buffer - * stores face-numbers first, then calculates colours as the - * final image is rendered. We'll use the same approach here, - * which differs from the original method (which was add halos per - * scan line). This means that the z-buffer now also needs to - * store info about what sort of 'thing' the index refers to. - * - * Halo extension: - * h.maxy --------- - * | h.xs + h.rad - * | h.xs - * | h.xs - h.rad - * h.miny --------- - * - * These coordinates must be clipped to picture size. - * I'm not quite certain about halo numbering. - * - * Halos and jittering ------------------------------------------- - * - * Halos were not jittered previously. Now they are. I wonder - * whether this may have some adverse effects here. - - * @return 1 for succes, 0 if the operation was interrupted. - */ - -/* ------------------------------------------------------------------------- */ -/* Transparent faces and the 'Azvoordeel' */ -/* A transparent face can get a z-offset, which is a */ -/* way of pretending the face is a bit closer than it */ -/* actually is. This is used in animations, when faces */ -/* that are used to glue on animated characters, items, */ -/* et. need their shadows to be drawn on top of the */ -/* objects they stand on. The Azvoordeel is added to */ -/* the calculated z-coordinate in the buffer-fill */ -/* procedures. */ - -/* static int RE_treat_face_as_opaque; */ - -static int zBufferAllFaces(void) -{ - VlakRen *vlr=NULL; - unsigned int zvlnr; - int faceCounter; - int keepLooping = 1; - float vec[3], hoco[4], mul, zval, fval; - Material *ma=0; - - faceCounter = 0; - -/* printf("Going to buffer faces:\n"); */ -/* printf("\tfirst pass:\n"); */ - -/* RE_treat_face_as_opaque = 1; */ - - while ( (faceCounter < R.totvlak) && keepLooping) { - if((faceCounter & 255)==0) { vlr= R.blovl[faceCounter>>8]; } - else vlr++; - - ma= vlr->mat; - - /* VERY dangerous construction... zoffs is set by a slide in the ui */ - /* so it should be safe... */ - if((ma->mode & (MA_ZTRA)) && (ma->zoffs != 0.0)) { - mul= 0x7FFFFFFF; - zval= mul*(1.0+vlr->v1->ho[2]/vlr->v1->ho[3]); - - VECCOPY(vec, vlr->v1->co); - /* z is negatief, wordt anders geclipt */ - vec[2]-= ma->zoffs; - RE_projectverto(vec, hoco); /* vec onto hoco */ - fval= mul*(1.0+hoco[2]/hoco[3]); - - Azvoordeel= (int) fabs(zval - fval ); - } else { - Azvoordeel= 0; - } - /* face number is used in the fill functions */ - zvlnr = faceCounter + 1; - - if(vlr->flag & R_VISIBLE) { /* might test for this sooner... */ - - if(ma->mode & (MA_WIRE)) zbufclipwire(zvlnr, vlr); - else { - zbufclip(NULL, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, - vlr->v1->clip, vlr->v2->clip, vlr->v3->clip); - if(vlr->v4) { - zvlnr+= 0x800000; /* in a sense, the 'adjoint' face */ - zbufclip(NULL, zvlnr, vlr->v1->ho, vlr->v3->ho, vlr->v4->ho, - vlr->v1->clip, vlr->v3->clip, vlr->v4->clip); - } - } - } - if(RE_local_test_break()) keepLooping = 0; - faceCounter++; - } - - return keepLooping; -} - -/** - * Fills in distances of halos in the z buffer. - * @return 1 for succes, 0 if the operation was interrupted. - */ - -/* ------------------------------------------------------------------------- */ -/* We cheat a little here: we only fill the halo on the first pass, and we */ -/* set a full complement of mask flags. This can be done because we consider */ -/* halos to be flat (billboards), so we do not have to correct the z range */ -/* every time we insert a halo. Also, halos fall off to zero at the edges, */ -/* so we can safely render them in pixels where they do not exist. */ -static int zBufferAllHalos(void) -{ - HaloRen *har = NULL; - int haloCounter = 0; - int dist = 0; - int keepLooping = 1; - short miny = 0, maxy = 0, minx = 0, maxx = 0; - short ycount = 0, xcount = 0; - RE_APixstrExt *ap, *apoffset; - int mask; /* jitter mask */ - - if (!Zsample) - { - mask = (1 << osaNr) - 1 ; /* Fill all samples together */ - - while ( (haloCounter < R.tothalo) && keepLooping) { - if((haloCounter & 255)==0) har= R.bloha[haloCounter>>8]; - else har++; - - /* Halos are sometimes wrongly kicked out of the box they belong */ - /* in... */ - - /* Only buffer the current alpha buffer contents!!! The line */ - /* indices have already been clipped to picture size. */ - minx = floor(har->xs - har->rad) - 1; /* assume min =< max is true*/ - if (minx < 0 ) minx = 0; - maxx = ceil(har->xs + har->rad ) + 1; - /* Do the extra -1 because of the +1 later on. I guess halos might */ - /* have to start one pixel sooner? Or maybe the lower clip should */ - /* be adjusted */ - if (maxx >= zBufferWidth - 1) maxx = zBufferWidth - 2; - - miny = har->miny; - if (miny < Aminy) miny = Aminy; - maxy = har->maxy; - if (maxy > Amaxy) maxy = Amaxy; - - if ( (minx <= maxx) && (miny <= maxy)) { - /* distance to this halo? */ - dist = har->zBufDist /* * R.ycor */; - /* strange that the ycor influences the z coordinate ..*/ - ycount = miny; - while (ycount <= maxy) { - apoffset = APixbufExt + (zBufferWidth * (ycount - Aminy)); - ap = apoffset + minx; - xcount = minx; - while (xcount <= maxx) { - insertFlatObjectNoOsa(ap, haloCounter, RE_HALO, dist, mask); - xcount++; - ap++; - } - ycount++; - } - } - if(RE_local_test_break()) keepLooping = 0; - haloCounter++; - } - } - - return keepLooping; -} -/* ------------------------------------------------------------------------- */ - -/** -* Fills in distances of all faces in a z buffer, for given jitter settings. - */ -static int fillZBufDistances() -{ - int keepLooping = 1; - - keepLooping = zBufferAllFaces(); /* Solid and transparent faces*/ - keepLooping = zBufferAllHalos() && keepLooping; /* ...and halos*/ - return keepLooping; - -} - - - -#if 0 -/* ------------------------------------------------------------------------- */ -/** - * One more filler: fill in halo data in z buffer. - * Empty so far, but may receive content of halo loop. - */ -void zBufferFillHalo(void) -{ - /* so far, intentionally empty */ -} -#endif - -/* ------------------------------------------------------------------------- */ -/* Colour buffer related: */ -/* This transforms the 4 inputvalues RE_COLBUFTYPE to a new value */ -/* It expects the values R.r.postigamma, R.r.postmul and R.r.postadd. */ -/* This is the standard transformation, more elaborate tools are for later. */ -/* ------------------------------------------------------------------------- */ -void std_floatcol_to_charcol( float *buf, char *target) -{ - float col[3]; - - float dither_value; - - dither_value = ((BLI_frand()-0.5)*R.r.dither_intensity)/256.0; - - /* alpha */ - if((buf[3]+dither_value)<=0.0) target[3]= 0; - else if((buf[3]+dither_value)>1.0) target[3]= 255; - else target[3]= 255.0*(buf[3]+dither_value); - - if(R.r.postgamma==1.0) { - /* r */ - col[0]= R.r.postmul*buf[0] + R.r.postadd + dither_value; - /* g */ - col[1]= R.r.postmul*buf[1] + R.r.postadd + dither_value; - /* b */ - col[2]= R.r.postmul*buf[2] + R.r.postadd + dither_value; - } - else { - /* putting the postmul within the pow() gives an - * easier control for the user, values from 1.0-2.0 - * are relevant then - */ - - /* r */ - col[0]= pow(R.r.postmul*buf[0], R.r.postigamma) + R.r.postadd + dither_value; - /* g */ - col[1]= pow( R.r.postmul*buf[1], R.r.postigamma) + R.r.postadd + dither_value; - /* b */ - col[2]= pow(R.r.postmul*buf[2], R.r.postigamma) + R.r.postadd + dither_value; - } - - if(R.r.posthue!=0.0 || R.r.postsat!=1.0) { - float hsv[3]; - - rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2); - hsv[0]+= R.r.posthue; - if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; - hsv[1]*= R.r.postsat; - if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0; - hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); - } - - if(col[0]<=0.0) target[0]= 0; - else if(col[0]>1.0) target[0]= 255; - else target[0]= 255.0*col[0]; - - if(col[1]<=0.0) target[1]= 0; - else if(col[1]>1.0) target[1]= 255; - else target[1]= 255.0*col[1]; - - if(col[2]<=0.0) target[2]= 0; - else if(col[2]>1.0) target[2]= 255; - else target[2]= 255.0*col[2]; -} - -/* ---------------------------------------------------------------------------- - - Colour buffer related: - - The colour buffer is a buffer of a single screen line. It contains - four fields of type RE_COLBUFTYPE per pixel. - - We can do several post-process steps. I would prefer to move them outside - the render module later on, but it's ok to leave it here for now. For the - time being, we have: - - post-process function - Does some operations with the colours. - - Multiply with some factor - - Add constant offset - - Apply extra gamma correction (seems weird...) - - key-alpha correction - Key alpha means 'un-applying' the alpha. For fully covered pixels, this - operation has no effect. - - - XXX WARNING! Added the inverse render gamma here, so this cannot be used external - without setting Osa or Gamme flags off (ton) - ----------------------------------------------------------------------------- */ -/* used external! */ -void transferColourBufferToOutput( float *buf, int y) -{ - /* Copy the contents of AColourBuffer3 to R.rectot + y * R.rectx */ - int x = 0; - char *target = (char*) (R.rectot + (y * R.rectx)); - - /* Copy the first pixels. We can do some more clipping on */ - /* the z buffer, I think. */ - while (x < R.rectx) { - - - /* invert gamma corrected additions */ - if(do_gamma) { - buf[0] = invGammaCorrect(buf[0]); - buf[1] = invGammaCorrect(buf[1]); - buf[2] = invGammaCorrect(buf[2]); - } - - std_floatcol_to_charcol(buf, target); - - /* - Key-alpha mode: - Need to un-apply alpha if alpha is non-full. For full alpha, - the operation doesn't have effect. Do this after the post- - processing, so we can still use the benefits of that. - - */ - - if (getSkyBlendingMode() == RE_ALPHA_KEY) { - applyKeyAlphaCharCol(target); - } - - target+=4; - buf+=4; - x++; - } -} - -/* used for redisplay after render. assumes size globals to be set OK! */ -void RE_floatbuffer_to_output(void) -{ - float *buf= R.rectftot; - int pix= R.rectx*R.recty; - char *target = (char *)R.rectot; - - if(R.rectftot==NULL) return; - - while(pix--) { - std_floatcol_to_charcol(buf, target); - buf+= 4; - target+= 4; - } -} - -/* ------------------------------------------------------------------------- */ - -static void eraseColBuf(RE_COLBUFTYPE *buf) -{ - /* By definition, the buffer's length is 4 * R.rectx items */ - int i = 0; - - while (i < 4 * (R.rectx+3)) { - *buf = 0.0f; - buf++; i++; - } -} - -/* ------------------------------------------------------------------------- */ - - -/** - * Fill the accumulation buffer APixbufExt with face and halo indices. - * Note: Uses globals. - * @param y the line number to set - */ -static void calcZBufLine(int y) -{ - int part; - int keepLooping = 1; - - if(y<0) return; - - /* zbuffer fix: here? */ - Zmulx= ((float) R.rectx)/2.0; - Zmuly= ((float) R.recty)/2.0; - - - /* use these buffer fill functions */ - zbuffunc = zBufferFillFace; - zbuflinefunc = zBufferFillEdge; - - /* (FORALL y: Aminy =< y =< Amaxy: y is buffered) */ - if( (y < Aminy) || (y > Amaxy)) { - - /* prepare buffer */ - part = (y/RE_ZBUFLEN); /* These two lines are mystifying me... */ - Aminy = part * RE_ZBUFLEN; /* Possibly for rounding things? */ - Amaxy = Aminy + RE_ZBUFLEN - 1; - /* if(Amaxy >= R.recty) Amaxy = R.recty-1; */ - if(Amaxy >= R.recty) Amaxy = R.recty - 1; - resetZbuffer(); - - Zsample = 0; /* Zsample is used internally ! */ - while ( (Zsample < osaNr) && keepLooping ) { - /* Apply jitter to this pixel. The jitter offsets are globals. */ - /* They are added in zbufclip() */ - /* Negative: these offsets are added to the vertex coordinates */ - /* so it equals translating viewpoint over the positive vector. */ - Zjitx= -jit[Zsample][0]-0.5; - Zjity= -jit[Zsample][1]-0.5; - - keepLooping = fillZBufDistances(); - - if(RE_local_test_break()) keepLooping = 0; - Zsample++; - } - } - -} - - -/* ------------------------------------------------------------------------- */ - -struct renderline { - RE_COLBUFTYPE *buf1, *buf2, *buf3; - int y; -}; - -static int do_renderline(void *poin) -{ - struct renderline *rl= poin; - - renderZBufLine(rl->y, rl->buf1, rl->buf2, rl->buf3); - return 1; -} - -void zBufShadeAdvanced() -{ - RE_COLBUFTYPE *cycle; - struct renderline rl1, rl2; - int y, keepLooping = 1; - float xjit = 0.0, yjit = 0.0; - - Zjitx=Zjity= -0.5; /* jitter preset: -0.5 pixel */ - - /* Set osaNr. Treat 'no osa' as 'osa = 1' */ - if(R.r.mode & R_OSA) { - osaNr = R.osa; - if(osaNr > 16) { /* check was moved from calcZBufLine */ - printf("zBufShadeAdvanced> osa too large (internal error)\n"); - G.afbreek= 1; - return; - } - } else { - /* little hack */ - osaNr = 1; - xjit = jit[0][0]; - yjit = jit[0][1]; - jit[0][0] = 0.0; - jit[0][1] = 0.0; - } - - RE_setwindowclip(0, -1); /* just to be sure, reset the view matrix */ - - initRenderBuffers(R.rectx); - - y = 0; - while ( (y < R.recty) && keepLooping) { - - calcZBufLine(y); - - rl1.buf1= AColourBuffer1; - rl1.buf2= AColourBuffer2; - rl1.buf3= AColourBuffer3; - rl1.y= y; - - if(R.r.mode & R_THREADS) { - if((y & 1)==0) { - SDL_Thread *thread; - - thread = SDL_CreateThread(do_renderline, &rl1); - if ( thread == NULL ) { - fprintf(stderr, "Unable to create thread"); - G.afbreek= 1; - break; - } - - rl2.buf1= AColourBuffer0; - rl2.buf2= AColourBuffer1a; - rl2.buf3= AColourBuffer2a; - rl2.y= y+1; - - do_renderline(&rl2); - - SDL_WaitThread(thread, NULL); - - if(R.r.filtertype) { - float *rb1= AColourBuffer1, *rb2= AColourBuffer2, *rb1a= AColourBuffer1a, *rb2a= AColourBuffer2a; - int a= 4*(R.rectx + 4); - while(a--) { - *rb1 += *rb1a; - *rb2 += *rb2a; - *(rb1a++)= 0.0; rb1++; - *(rb2a++)= 0.0; rb2++; - } - } - else { - cycle= AColourBuffer1a; AColourBuffer1a= AColourBuffer1; AColourBuffer1= cycle; - } - } - } - else do_renderline(&rl1); - - if(y) { - transferColourBufferToOutput(AColourBuffer3+4, y-1); - - if((y & 1)==0) RE_local_render_display(y-2, y-1, R.rectx, R.recty, R.rectot); - } - - /* buffer cycling */ - eraseColBuf(AColourBuffer3); - cycle= AColourBuffer3; - AColourBuffer3= AColourBuffer2; - AColourBuffer2= AColourBuffer1; - AColourBuffer1= AColourBuffer0; - AColourBuffer0= cycle; - - if(RE_local_test_break()) keepLooping = 0; - y++; - } - if(keepLooping) transferColourBufferToOutput(AColourBuffer3+4, y-1); - - freeRenderBuffers(); - - /* Edge rendering is done purely as a post-effect */ - if(R.r.mode & R_EDGE) { - addEdges((char*)R.rectot, R.rectx, R.recty, - osaNr, - R.r.edgeint, R.r.same_mat_redux, - G.compat, G.notonlysolid, - R.r.edgeR, R.r.edgeG, R.r.edgeB); - } - - if (!(R.r.mode & R_OSA)) { - jit[0][0] = xjit; - jit[0][1] = yjit; - } - -} - -/* ------------------------------------------------------------------------- */ - - - - -/* eof vanillaRenderPipe.c */ diff --git a/source/blender/render/intern/source/zblur.c b/source/blender/render/intern/source/zblur.c deleted file mode 100644 index a1e8304ba75..00000000000 --- a/source/blender/render/intern/source/zblur.c +++ /dev/null @@ -1,818 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - * This file is largely based on the focal blur plugin by onk, 8.99 - * - */ - -#include -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_camera_types.h" -#include "DNA_scene_types.h" - -#include "BKE_global.h" -#include "BKE_utildefines.h" - -#include "RE_callbacks.h" - -#include "render.h" -#include "pixelblending.h" - -#include "blendef.h" -#include "zblur.h" - -//#include "BIF_gl.h" - -/* ------------------------------------------------- - * defines, protos */ - -typedef enum { I_GRAY, I_FLOAT, I_FLOAT4 } IMGTYPE; - -typedef struct { - int x, y; - int size, el_size; - IMGTYPE type; - char *data; -} Image; - -typedef struct { /* blur mask struct */ - int size; - float fac; - float *val; -} Mask; - -typedef Mask* Maskarray; - -/* don't change these */ -#define NMASKS_SHIFT 2 -#define NMASKS 64 - - -static Image *alloc_img(int x, int y, IMGTYPE type) -{ - Image *ret; - int size, typesize; - - switch (type) { - case I_GRAY: - typesize = 1; - break; - case I_FLOAT: - typesize = sizeof(float); - break; - case I_FLOAT4: - typesize = 4 * sizeof(float); - break; - default: - return 0; - } - - size = x * y; - - ret = (Image *) MEM_mallocN(sizeof(Image) + size*typesize, "zblur_img"); - if (ret) { - ret->x = x; - ret->y = y; - ret->size = size; - ret->el_size = typesize; - ret->type = type; - ret->data = (char *) (ret + 1); - size *= typesize; - memset(ret->data, 0, size); - } - - return ret; -} - -static int free_img(Image *img) -{ - MEM_freeN(img); - return 1; -} - -/* 32 bits (int) rect to float buf */ -static void recti2imgf(unsigned int *src, Image *dest, int x, int y) -{ - char *from; - float *to; - int i, ix, iy; - - if(dest->type != I_FLOAT4) return; - - from = (char *) src; - to = (float *) dest->data; - - if (R.r.mode & R_FIELDS) { /* double each scanline */ - for (iy=0; iytype != I_FLOAT4) return; - - from = src; - to = (float *) dest->data; - - if (R.r.mode & R_FIELDS) { /* double each scanline */ - for (iy=0; iytype != I_FLOAT4) return; - - from = (float *) src->data; - to = (char *) dest; - - if (R.r.mode & R_FIELDS) { - for (iy=0; iyy; iy++) { - for (ix=0; ixx; ix++) { - *to++ = (char)(from[0]*255.0); - *to++ = (char)(from[1]*255.0); - *to++ = (char)(from[2]*255.0); - *to++ = (char)(from[3]*255.0); - from += 4; - } - iy++; - from+= 4*src->x; - } - } - else { - i = src->x * src->y; - while(i--) { - *to++ = (char)(from[0]*255.0); - *to++ = (char)(from[1]*255.0); - *to++ = (char)(from[2]*255.0); - *to++ = (char)(from[3]*255.0); - from += 4; - } - } -} - -/* floatbuf back to float rect */ -static void imgf2rectf(Image *src, float *dest) -{ - float *from; - float *to; - int i, iy; - - if(src->type != I_FLOAT4) return; - - from = (float *) src->data; - to = dest; - - if (R.r.mode & R_FIELDS) { - for (iy=0; iyy; iy++) { - - memcpy(to, from, 4*sizeof(float)*src->x); - - iy++; - to+= 4*src->x; - from+= 8*src->x; - } - } - else { - i = src->x * src->y; - memcpy(to, from, 4*sizeof(float)*i); - } -} - - -static void imgf_gamma(Image *src, float gamma) -{ - float *to; - int i; - - if(gamma==1.0) return; - - i = 4 * src->x * src->y; - to= (float *) src->data; - while(i--) { - *to = (float)pow(*to, gamma); - to++; - } -} - -#if 0 -/* create new image with alpha & color zero where mask is zero */ -static Image *imgf_apply_mask(Image *src, Image *zmask) -{ - Image *dest; - float *from, *to; - int i; - char *zptr; - - dest = alloc_img(src->x, src->y, I_FLOAT4); - - i= src->x * src->y; - from= (float *) src->data; - to= (float *) dest->data; - zptr= (char *)zmask->data; - - while(i--) { - if(*zptr) { - to[0]= from[0]; - to[1]= from[1]; - to[2]= from[2]; - to[3]= from[3]; - } - else { - to[0]= to[1]= to[2]= to[3]= 0.0f; - } - zptr++; - to+= 4; - from+= 4; - } - - return dest; -} - -static void imgf_alpha_over(Image *dest, Image *src) -{ - float *from, *to; - int i; - - i= src->x * src->y; - from= (float *) src->data; - to= (float *) dest->data; - - while(i--) { - addAlphaOverFloat(to, from); - to+= 4; - from+= 4; - } -} - -#endif - -/* --------------------------------------------------------------------- */ -/* mask routines */ - -static Mask *alloc_mask(int size) -{ - Mask *m; - int memsize; - - memsize = (sizeof(Mask) + (2 * size +1) * (2 * size +1) * sizeof(float)); - - m = (Mask*) MEM_mallocN(memsize, "zblur_mask"); - m->size = size; - m->val = (float *) (m + 1); - - return m; -} - -static void free_mask(Mask *m) -{ - int memsize; - - memsize = 2 * m->size + 1; - memsize *= memsize * sizeof(float); - memsize += sizeof(Mask); - - MEM_freeN(m); -} - -/* normalize mask to 1 */ - -static void norm_mask(Mask *m) -{ - float fac; - int size; - float *v; - - fac = m->fac; - size = (2 * m->size +1)*(2 * m->size +1); - - v = m->val; - while(size--) { - *v++ *= fac; - } - m->fac = 1.0; -} - -/* filters a grayvalue image with a gaussian IIR filter with blur radius "rad" - * For large blurs, it's more efficient to call the routine several times - * instead of using big blur radii. - * The original image is changed */ - - -static void gauss_blur(Image *img, float rad) -{ - Image *new; - register float sum, val; - float gval; - float *gausstab, *v; - int r, n, m; - int x, y; - int i; - int step, bigstep; - char *src, *dest; - - r = (1.5 * rad + 1.5); - n = 2 * r + 1; - - /* ugly : */ - if ((img->x <= n) || (img->y <= n)) { - return; - } - - gausstab = (float *) MEM_mallocN(n * sizeof(float), "zblur_gauss"); - if (!gausstab) { - return; - } - - sum = 0.0; - v = gausstab; - for (x = -r; x <= r; x++) { - - val = exp(-4*(float ) (x*x)/ (float) (r*r)); - sum += val; - *v++ = val; - } - - i = n; - v = gausstab; - while (i--) { - *v++ /= sum; - } - - new = alloc_img(img->x, img->y, I_GRAY); - if (!new) { - return; - } - - /* horizontal */ - - step = (n - 1); - - for (y = 0; y < img->y; y++) { - src = (char *)img->data + (y * img->x); - dest = (char *)new->data + (y * img->x); - - for (x = r; x > 0 ; x--) { - m = n - x; - gval = 0.0; - sum = 0.0; - v = gausstab + x; - for (i = 0; i < m; i++) { - val = *v++; - sum += val; - gval += val * (*src++); - } - *dest++ = gval / sum; - src -= m; - } - - for (x = 0; x <= (img->x - n); x++) { - gval = 0.0; - v = gausstab; - - for (i = 0; i < n; i++) { - val = *v++; - gval += val * (*src++); - } - *dest++ = gval; - src -= step; - } - - for (x = 1; x <= r ; x++) { - m = n - x; - gval = 0.0; - sum = 0.0; - v = gausstab; - for (i = 0; i < m; i++) { - val = *v++; - sum += val; - gval += val * (*src++); - } - *dest++ = gval / sum; - src -= (m - 1); - } - } - - /* vertical */ - - step = img->x; - bigstep = (n - 1) * step; - for (x = 0; x < step ; x++) { - src = new->data + x; - dest = img->data + x; - - for (y = r; y > 0; y--) { - m = n - y; - gval = 0.0; - sum = 0.0; - v = gausstab + y; - for (i = 0; i < m; i++) { - val = *v++; - sum += val; - gval += val * src[0]; - src += step; - } - dest[0] = gval / sum; - src -= m * step; - dest+= step; - } - for (y = 0; y <= (img->y - n); y++) { - gval = 0.0; - v = gausstab; - for (i = 0; i < n; i++) { - val = *v++; - gval += val * src[0]; - src += step; - } - dest[0] = gval; - dest += step; - src -= bigstep; - } - for (y = 1; y <= r ; y++) { - m = n - y; - gval = 0.0; - sum = 0.0; - v = gausstab; - for (i = 0; i < m; i++) { - val = *v++; - sum += val; - gval += val * src[0]; - src += step; - } - dest[0] = gval / sum; - dest += step; - src -= (m - 1) * step; - } - } - MEM_freeN(gausstab); - free_img(new); -} - -static float zigma(float x, float sigma, float sigma4) -{ - //return 1.0/(1.0+pow(x, sigma)); - - if(x < sigma) { - x*= sigma; - return 1.0/exp(x*x) - sigma4; - } - return 0.0; -} - - -static Mask *gauss_mask(float rad, float sigma) -{ - Mask *m; - float sum, val, *v, fac, radsq= rad*rad; - float sigma4; - int r; - int ix, iy; - - r = (1.0 * rad + 1.0); - m = alloc_mask(r); - v = m->val; - sum = 0.0; - - sigma4= 1.0/exp(sigma*sigma*sigma*sigma); - - for (iy = -r; iy <= r; iy++) { - for (ix = -r; ix <= r; ix++) { - - fac= ((float)(ix*ix + iy*iy))/(radsq); - val = zigma(fac, sigma, sigma4); - - // val = exp(-(float) (ix*ix + iy*iy)/(rad * rad)); - sum += val; - *v++ = val; - } - } - - m->fac = 1.0 / sum; - - norm_mask(m); - return m; -} - -/* generates #num masks with the maximal blur radius 'rad' - * */ -static Maskarray *init_masks(int num, float rad, float sigma) -{ - int i; - float r, step; - Maskarray *maskarray; - - maskarray = (Maskarray*) MEM_mallocN(num * sizeof (Maskarray), "zblur_masks"); - step = rad / num; - r = 0.1; - for (i = 0; i < num; i++) { - maskarray[i] = gauss_mask(r, sigma); - r += step; - } - return maskarray; -} - - -/* ********************* Do the blur ******************************** */ - -static Image *zblur(Image *src, Image *zbuf, float radius, float sigma) -{ - Image *dest; - Maskarray *mar; - Mask *m; - float *sptr, *dptr; - float *mval; /* mask value pointer */ - float rval, gval, bval, aval; - float norm, fac; - int tmp; - int zval; - int size; - int row; - int mrow; - int x, y; - int i; - int sx, sy, ex, ey; - int mx, my; - char *zptr; - - if(src->type != I_FLOAT4) return NULL; - - dest = alloc_img(src->x, src->y, I_FLOAT4); - row = src->x * 4; - - mar = init_masks(NMASKS, radius, sigma); - - for (y = 0; y < src->y ; y++) { - for (x = 0; x < src->x; x++) { - dptr = (float *) (dest->data + ((y * src->x + x) * src->el_size)); - zptr = zbuf->data + (y * src->x + x); - zval = *zptr; - sptr = (float *) (src->data + ((y *src->x + x )* src->el_size)); - - m = mar[zval >> NMASKS_SHIFT]; - - size = m->size; - - if(size==0 || zval==0) { - dptr[0] = sptr[0]; - dptr[1] = sptr[1]; - dptr[2] = sptr[2]; - dptr[3] = sptr[3]; - continue; - } - - ex = src->x - x; - ey = src->y - y; - - sx = (x < size) ? x : size; - sy = (y < size) ? y : size; - ex = (ex <= size) ? ex - 1: size; - ey = (ey <= size) ? ey - 1: size; - - sptr -= sy *src->x * 4; - zptr -= sy * src->x; - mrow = (size << 1) + 1; - mval = m->val + (size - sy) * mrow + size; - - norm = rval = gval = bval = aval= 0.0; - - for (my = -sy; my <= ey; my++) { - for (mx = -sx; mx <= ex; mx++) { - if( zptr[mx] ) { - tmp = 4 * mx; - fac = mval[mx] * (float) zptr[mx] /255.0 ; - - norm += fac; - rval += fac * sptr[tmp]; - gval += fac * sptr[tmp + 1]; - bval += fac * sptr[tmp + 2]; - aval += fac * sptr[tmp + 3]; - } - } - mval += mrow; - sptr += row; - zptr += src->x; - } - - dptr[0] = rval / norm; - dptr[1] = gval / norm; - dptr[2] = bval / norm; - dptr[3] = aval / norm; - } - if(!(y % 4) && RE_local_test_break()) break; - } - - for (i= 0; i < NMASKS; i++) { - free_mask(mar[i]); - } - - MEM_freeN(mar); - - return dest; -} - - -/* this splits the z-buffer into 2 gray-images (background, foreground) -* which are used for the weighted blur */ - -static void zsplit(int *zptr, Image *fg, Image *bg, int zfocus, int zmax, int zmin, int x, int y) -{ - char *p, *q; - int i, ix, iy; - float fdist; - float fgnorm, bgnorm; - - p = fg->data; - q = bg->data; - bgnorm = 255.0 / ((float) zmax - (float) zfocus); - fgnorm = 255.0 / ((float) zfocus - (float) zmin); - - if (R.r.mode & R_FIELDS) { - for (iy=0; iyzfocus) zmin= zfocus; - - zfront = alloc_img(x, y, I_GRAY); - zback = alloc_img(x, y, I_GRAY); - orig = alloc_img(x, y, I_FLOAT4); - - if(R.rectftot) rectf2imgf(R.rectftot, orig, x, y); - else recti2imgf(R.rectot, orig, x, y); - - imgf_gamma(orig, R.r.zgamma); // pregamma correct if required - - - /* split up z buffer into 2 gray images */ - zsplit(R.rectz, zfront, zback, zfocus, INT_MAX, zmin, x, y); - -// glDrawBuffer(GL_FRONT); -// glRasterPos2i(0, 0); -// glDrawPixels(x, y, GL_RED, GL_UNSIGNED_BYTE, zback->data); -// glFlush(); -// glDrawBuffer(GL_BACK); - - gauss_blur(zback, 1.0); - gauss_blur(zfront, zblurr); - - /* blur back part */ - work = zblur(orig, zback, zblurr, R.r.zsigma); - free_img(orig); - - /* blur front part */ - orig = zblur(work, zfront, zblurr, R.r.zsigma); - - imgf_gamma(orig, 1.0/R.r.zgamma); // pregamma correct if required - - if(R.rectftot) imgf2rectf(orig, R.rectftot); - else imgf2recti(orig, R.rectot); - - free_img(work); - free_img(orig); - free_img(zfront); - free_img(zback); - - /* make new display rect */ - if(R.rectftot) RE_floatbuffer_to_output(); -} - - diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 368acfe1a41..7790a4cff65 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -1,15 +1,12 @@ /** * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,21 +20,24 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. + * Contributors: Hos, RPW + * 2004-2006 Blender Foundation, full recode * - * Contributor(s): Hos, RPW. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** */ + /*---------------------------------------------------------------------------*/ /* Common includes */ /*---------------------------------------------------------------------------*/ #include +#include #include #include #include + +#include "BLI_blenlib.h" #include "MTC_matrixops.h" #include "MEM_guardedalloc.h" @@ -49,75 +49,57 @@ #include "BKE_utildefines.h" #include "radio_types.h" -#include "radio.h" /* needs RG, some root data for radiosity */ +#include "radio.h" /* needs RG, some root data for radiosity */ #include "SDL_thread.h" -#include "render.h" -#include "RE_callbacks.h" +#include "RE_render_ext.h" /* local includes */ -#include "rendercore.h" /* shade_pixel and count_mask */ +#include "render_types.h" +#include "renderpipeline.h" +#include "renderdatabase.h" +#include "rendercore.h" #include "pixelblending.h" -#include "jitter.h" /* own includes */ #include "zbuf.h" -#define FLT_EPSILON 1.19209290e-07F - -/*-----------------------------------------------------------*/ -/* Globals for this file */ -/* main reason for globals; unified zbuffunc() with simple args */ -/*-----------------------------------------------------------*/ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -float Zmulx; /* Half the screenwidth, in pixels. (used in render.c, */ - /* zbuf.c) */ -float Zmuly; /* Half the screenheight, in pixels. (used in render.c,*/ - /* zbuf.c) */ -float Zjitx; /* Jitter offset in x. When jitter is disabled, this */ - /* should be 0.5. (used in render.c, zbuf.c) */ -float Zjity; /* Jitter offset in y. When jitter is disabled, this */ - /* should be 0.5. (used in render.c, zbuf.c) */ - -int Zsample; -void (*zbuffunc)(ZSpan *, int, float *, float *, float *); -void (*zbuffunc4)(ZSpan *, int, float *, float *, float *, float *); -void (*zbuflinefunc)(int, float *, float *); - -static APixstr *APixbuf; /* Zbuffer: linked list of face indices */ -static int *Arectz; /* Zbuffer: distance buffer, almost obsolete */ -static int Aminy; /* y value of first line in the accu buffer */ -static int Amaxy; /* y value of last line in the accu buffer */ -static int Azvoordeel = 0; -static APixstrMain apsmfirst; -static short apsmteller = 0; /* ****************** Spans ******************************* */ -static void zbuf_alloc_span(ZSpan *zspan, int yres) +/* each zbuffer has coordinates transformed to local rect coordinates, so we can simply clip */ +void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty) { - zspan->yres= yres; + memset(zspan, 0, sizeof(ZSpan)); - zspan->span1= MEM_callocN(yres*sizeof(float), "zspan"); - zspan->span2= MEM_callocN(yres*sizeof(float), "zspan"); + zspan->rectx= rectx; + zspan->recty= recty; + + zspan->span1= RE_mallocN(recty*sizeof(float), "zspan"); + zspan->span2= RE_mallocN(recty*sizeof(float), "zspan"); } static void zbuf_free_span(ZSpan *zspan) { if(zspan) { - if(zspan->span1) MEM_freeN(zspan->span1); - if(zspan->span2) MEM_freeN(zspan->span2); + if(zspan->span1) RE_freeN(zspan->span1); + if(zspan->span2) RE_freeN(zspan->span2); zspan->span1= zspan->span2= NULL; } } -static void zbuf_init_span(ZSpan *zspan, int miny, int maxy) +/* reset range for clipping */ +static void zbuf_init_span(ZSpan *zspan) { - zspan->miny= miny; /* range for clipping */ - zspan->maxy= maxy; - zspan->miny1= zspan->miny2= maxy+1; - zspan->maxy1= zspan->maxy2= miny-1; + zspan->miny1= zspan->miny2= zspan->recty+1; + zspan->maxy1= zspan->maxy2= -1; zspan->minp1= zspan->maxp1= zspan->minp2= zspan->maxp2= NULL; } @@ -137,12 +119,12 @@ static void zbuf_add_to_span(ZSpan *zspan, float *v1, float *v2) my0= ceil(minv[1]); my2= floor(maxv[1]); - if(my2miny || my0> zspan->maxy) return; + if(my2<0 || my0>= zspan->recty) return; /* clip top */ - if(my2>=zspan->maxy) my2= zspan->maxy-1; + if(my2>=zspan->recty) my2= zspan->recty-1; /* clip bottom */ - if(my0miny) my0= zspan->miny; + if(my0<0) my0= 0; if(my0>my2) return; /* if(my0>my2) should still fill in, that way we get spans that skip nicely */ @@ -217,16 +199,7 @@ void fillrect(int *rect, int x, int y, int val) } } -/** -* Tests whether this coordinate is 'inside' or 'outside' of the view - * volume? By definition, this is in [0, 1]. - * @param p vertex z difference plus coordinate difference? - * @param q origin z plus r minus some coordinate? - * @param u1 [in/out] clip fraction for ? - * @param u2 [in/out] - * @return 0 if point is outside, or 1 if the point lies on the clip - * boundary - */ +/* based on Liang&Barsky, for clipping of pyramidical volume */ static short cliptestf(float p, float q, float *u1, float *u2) { float r; @@ -253,7 +226,7 @@ static short cliptestf(float p, float q, float *u1, float *u2) return 1; } -int RE_testclip(float *v) +int testclip(float *v) { float abs4; /* WATCH IT: this function should do the same as cliptestf, otherwise troubles in zbufclip()*/ short c=0; @@ -278,315 +251,42 @@ int RE_testclip(float *v) /* ************* ACCUMULATION ZBUF ************ */ -/*-APixstr---------------------(antialised pixel struct)------------------------------*/ -static APixstr *addpsmainA() +static APixstr *addpsmainA(ListBase *lb) { APixstrMain *psm; - psm= &apsmfirst; - - while(psm->next) { - psm= psm->next; - } - - psm->next= MEM_mallocN(sizeof(APixstrMain), "addpsmainA"); - - psm= psm->next; - psm->next=0; - psm->ps= MEM_callocN(4096*sizeof(APixstr),"pixstr"); - apsmteller= 0; + psm= RE_mallocN(sizeof(APixstrMain), "addpsmainA"); + BLI_addtail(lb, psm); + psm->ps= RE_mallocN(4096*sizeof(APixstr),"pixstr"); return psm->ps; } -static void freepsA() +static void freepsA(ListBase *lb) { - APixstrMain *psm, *next; - - psm= &apsmfirst; + APixstrMain *psm, *psmnext; - while(psm) { - next= psm->next; - if(psm->ps) { - MEM_freeN(psm->ps); - psm->ps= 0; - } - if(psm!= &apsmfirst) MEM_freeN(psm); - psm= next; + for(psm= lb->first; psm; psm= psmnext) { + psmnext= psm->next; + if(psm->ps) + RE_freeN(psm->ps); + RE_freeN(psm); } - - apsmfirst.next= 0; - apsmfirst.ps= 0; - apsmteller= 0; } -static APixstr *addpsA(void) +static APixstr *addpsA(ZSpan *zspan) { - static APixstr *prev; - - /* make first PS */ - if((apsmteller & 4095)==0) prev= addpsmainA(); - else prev++; - apsmteller++; - - return prev; -} - -/** - * Fill the z buffer for accumulation (transparency) - * - * This is one of the z buffer fill functions called in zbufclip() and - * zbufwireclip(). - * - * @param v1 [4 floats, world coordinates] first vertex - * @param v2 [4 floats, world coordinates] second vertex - * @param v3 [4 floats, world coordinates] third vertex - */ -static void zbufinvulAc(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3) -{ - APixstr *ap, *apofs, *apn; - double x0,y0,z0,x1,y1,z1,x2,y2,z2,xx1; - double zxd,zyd,zy0, tmp; - float *minv,*maxv,*midv; - int *rz,zverg,x; - int my0,my2,sn1,sn2,rectx,zd,*rectzofs; - int y,omsl,xs0,xs1,xs2,xs3, dx0,dx1,dx2, mask; - - /* MIN MAX */ - if(v1[1] Amaxy) return; - - if(my02.0/65536.0) { - z0= (maxv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx0= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-minv[1])+minv[0]); - xs0= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx0= 0; - xs0= 65536.0*(MIN2(minv[0],maxv[0])); - } - /* EDGES : THE TOP ONE */ - xx1= maxv[1]-midv[1]; - if(xx1>2.0/65536.0) { - z0= (maxv[0]-midv[0])/xx1; - - tmp= (-65536.0*z0); - dx1= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-midv[1])+midv[0]); - xs1= CLAMPIS(tmp, INT_MIN, INT_MAX); + /* make new PS */ + if(zspan->apsmcounter==0) { + zspan->curpstr= addpsmainA(zspan->apsmbase); + zspan->apsmcounter= 4095; } else { - dx1= 0; - xs1= 65536.0*(MIN2(midv[0],maxv[0])); - } - /* EDGES : BOTTOM ONE */ - xx1= midv[1]-minv[1]; - if(xx1>2.0/65536.0) { - z0= (midv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx2= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(omsl-minv[1])+minv[0]); - xs2= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx2= 0; - xs2= 65536.0*(MIN2(minv[0],midv[0])); - } - - /* ZBUF DX DY */ - x1= v1[0]- v2[0]; - x2= v2[0]- v3[0]; - y1= v1[1]- v2[1]; - y2= v2[1]- v3[1]; - z1= v1[2]- v2[2]; - z2= v2[2]- v3[2]; - x0= y1*z2-z1*y2; - y0= z1*x2-x1*z2; - z0= x1*y2-y1*x2; - if(z0==0.0) return; - - if(midv[1]==maxv[1]) omsl= my2; - if(omsl Amaxy) { /* my2 can be larger */ - xs0+=dx0; - if (my2<=omsl) { - xs2+= dx2; - } - else{ - xs1+= dx1; - } - my2--; - } - - xx1= (x0*v1[0]+y0*v1[1])/z0+v1[2]; - - zxd= -x0/z0; - zyd= -y0/z0; - zy0= my2*zyd+xx1; - zd= (int)CLAMPIS(zxd, INT_MIN, INT_MAX); - - /* start-offset in rect */ - rectx= R.rectx; - rectzofs= (int *)(Arectz+rectx*(my2-Aminy)); - apofs= (APixbuf+ rectx*(my2-Aminy)); - mask= 1<dx1) { - xs3= xs0; - xs0= xs1; - xs1= xs3; - xs3= dx0; - dx0= dx1; - dx1= xs3; - xs3= 1; /* flag */ - - } - - for(y=my2;y>omsl;y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs1>>16; - xs1+= dx1; - - sn1++; - - if(sn2>=rectx) sn2= rectx-1; - if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - rz= rectzofs+sn1; - ap= apofs+sn1; - x= sn2-sn1; - - zverg-= Azvoordeel; - - while(x>=0) { - if(zverg< *rz) { - apn= ap; - while(apn) { /* loop unrolled */ - if(apn->p[0]==0) {apn->p[0]= zvlnr; apn->z[0]= zverg; apn->mask[0]= mask; break; } - if(apn->p[0]==zvlnr) {apn->mask[0]|= mask; break; } - if(apn->p[1]==0) {apn->p[1]= zvlnr; apn->z[1]= zverg; apn->mask[1]= mask; break; } - if(apn->p[1]==zvlnr) {apn->mask[1]|= mask; break; } - if(apn->p[2]==0) {apn->p[2]= zvlnr; apn->z[2]= zverg; apn->mask[2]= mask; break; } - if(apn->p[2]==zvlnr) {apn->mask[2]|= mask; break; } - if(apn->p[3]==0) {apn->p[3]= zvlnr; apn->z[3]= zverg; apn->mask[3]= mask; break; } - if(apn->p[3]==zvlnr) {apn->mask[3]|= mask; break; } - if(apn->next==0) apn->next= addpsA(); - apn= apn->next; - } - } - zverg+= zd; - rz++; - ap++; - x--; - } - zy0-= zyd; - rectzofs-= rectx; - apofs-= rectx; - } - - if(xs3) { - xs0= xs1; - dx0= dx1; - } - if(xs0>xs2) { - xs3= xs0; - xs0= xs2; - xs2= xs3; - xs3= dx0; - dx0= dx2; - dx2= xs3; - } - - for(; y>=my0; y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs2>>16; - xs2+= dx2; - - sn1++; - - if(sn2>=rectx) sn2= rectx-1; - if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - rz= rectzofs+sn1; - ap= apofs+sn1; - x= sn2-sn1; - - zverg-= Azvoordeel; - - while(x>=0) { - if(zverg< *rz) { - apn= ap; - while(apn) { /* loop unrolled */ - if(apn->p[0]==0) {apn->p[0]= zvlnr; apn->z[0]= zverg; apn->mask[0]= mask; break; } - if(apn->p[0]==zvlnr) {apn->mask[0]|= mask; break; } - if(apn->p[1]==0) {apn->p[1]= zvlnr; apn->z[1]= zverg; apn->mask[1]= mask; break; } - if(apn->p[1]==zvlnr) {apn->mask[1]|= mask; break; } - if(apn->p[2]==0) {apn->p[2]= zvlnr; apn->z[2]= zverg; apn->mask[2]= mask; break; } - if(apn->p[2]==zvlnr) {apn->mask[2]|= mask; break; } - if(apn->p[3]==0) {apn->p[3]= zvlnr; apn->z[3]= zverg; apn->mask[3]= mask; break; } - if(apn->p[3]==zvlnr) {apn->mask[3]|= mask; break; } - if(apn->next==0) apn->next= addpsA(); - apn= apn->next; - } - } - zverg+= zd; - rz++; - ap++; - x--; - } - - zy0-=zyd; - rectzofs-= rectx; - apofs-= rectx; + zspan->curpstr++; + zspan->apsmcounter--; } + return zspan->curpstr; } static void zbufinvulAc4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3, float *v4) @@ -600,13 +300,17 @@ static void zbufinvulAc4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v int sn1, sn2, rectx, *rectzofs, my0, my2, mask; /* init */ - zbuf_init_span(zspan, Aminy, Amaxy+1); + zbuf_init_span(zspan); /* set spans */ zbuf_add_to_span(zspan, v1, v2); zbuf_add_to_span(zspan, v2, v3); - zbuf_add_to_span(zspan, v3, v4); - zbuf_add_to_span(zspan, v4, v1); + if(v4) { + zbuf_add_to_span(zspan, v3, v4); + zbuf_add_to_span(zspan, v4, v1); + } + else + zbuf_add_to_span(zspan, v3, v1); /* clipped */ if(zspan->minp2==NULL || zspan->maxp2==NULL) return; @@ -636,11 +340,11 @@ static void zbufinvulAc4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v zy0= ((double)my2)*zyd + (double)xx1; /* start-offset in rect */ - rectx= R.rectx; - rectzofs= (int *)(Arectz+rectx*(my2-Aminy)); - apofs= (APixbuf+ rectx*(my2-Aminy)); - mask= 1<rectx; + rectzofs= (int *)(zspan->arectz+rectx*(my2)); + apofs= (zspan->apixbuf+ rectx*(my2)); + mask= zspan->mask; + /* correct span */ sn1= (my0 + my2)/2; if(zspan->span1[sn1] < zspan->span2[sn1]) { @@ -667,7 +371,7 @@ static void zbufinvulAc4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v ap= apofs+sn1; x= sn2-sn1; - zverg-= Azvoordeel; + zverg-= zspan->polygon_offset; while(x>=0) { if( (int)zverg < *rz) { @@ -685,7 +389,7 @@ static void zbufinvulAc4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v if(apn->p[3]==zvlnr) {apn->mask[3]|= mask; break; } // if(apn->p[i]==0) {apn->p[i]= zvlnr; apn->z[i]= zverg; apn->mask[i]= mask; break; } // if(apn->p[i]==zvlnr) {apn->mask[i]|= mask; break; } - if(apn->next==NULL) apn->next= addpsA(); + if(apn->next==NULL) apn->next= addpsA(zspan); apn= apn->next; } } @@ -704,7 +408,7 @@ static void zbufinvulAc4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v -static void zbuflineAc(int zvlnr, float *vec1, float *vec2) +static void zbuflineAc(ZSpan *zspan, int zvlnr, float *vec1, float *vec2) { APixstr *ap, *apn; int *rectz; @@ -716,6 +420,8 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) dx= vec2[0]-vec1[0]; dy= vec2[1]-vec1[1]; + mask= zspan->mask; + if(fabs(dx) > fabs(dy)) { /* all lines from left to right */ @@ -731,22 +437,21 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) start= floor(v1[0]); end= start+floor(dx); - if(end>=R.rectx) end= R.rectx-1; + if(end>=zspan->rectx) end= zspan->rectx-1; oldy= floor(v1[1]); dy/= dx; vergz= v1[2]; - vergz-= Azvoordeel; + vergz-= zspan->polygon_offset; dz= (v2[2]-v1[2])/dx; if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow - rectz= (int *)(Arectz+R.rectx*(oldy-Aminy) +start); - ap= (APixbuf+ R.rectx*(oldy-Aminy) +start); - mask= 1<arectz+zspan->rectx*(oldy) +start); + ap= (zspan->apixbuf+ zspan->rectx*(oldy) +start); + + if(dy<0) ofs= -zspan->rectx; + else ofs= zspan->rectx; for(x= start; x<=end; x++, rectz++, ap++) { @@ -757,7 +462,7 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) ap+= ofs; } - if(x>=0 && y>=Aminy && y<=Amaxy) { + if(x>=0 && y>=0 && yrecty) { if(vergz<*rectz) { apn= ap; @@ -770,7 +475,7 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) if(apn->p[2]==zvlnr) {apn->mask[2]|= mask; break; } if(apn->p[3]==0) {apn->p[3]= zvlnr; apn->z[3]= vergz; apn->mask[3]= mask; break; } if(apn->p[3]==zvlnr) {apn->mask[3]|= mask; break; } - if(apn->next==0) apn->next= addpsA(); + if(apn->next==0) apn->next= addpsA(zspan); apn= apn->next; } @@ -798,26 +503,25 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) start= floor(v1[1]); end= start+floor(dy); - if(start>Amaxy || end=zspan->recty || end<0) return; - if(end>Amaxy) end= Amaxy; + if(end>=zspan->recty) end= zspan->recty-1; oldx= floor(v1[0]); dx/= dy; vergz= v1[2]; - vergz-= Azvoordeel; + vergz-= zspan->polygon_offset; dz= (v2[2]-v1[2])/dy; if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow - rectz= (int *)( Arectz+ (start-Aminy)*R.rectx+ oldx ); - ap= (APixbuf+ R.rectx*(start-Aminy) +oldx); - mask= 1<arectz+ (start)*zspan->rectx+ oldx ); + ap= (zspan->apixbuf+ zspan->rectx*(start) +oldx); if(dx<0) ofs= -1; else ofs= 1; - for(y= start; y<=end; y++, rectz+=R.rectx, ap+=R.rectx) { + for(y= start; y<=end; y++, rectz+=zspan->rectx, ap+=zspan->rectx) { x= floor(v1[0]); if(x!=oldx) { @@ -826,7 +530,7 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) ap+= ofs; } - if(x>=0 && y>=Aminy && x=0 && y>=0 && xrectx) { if(vergz<*rectz) { apn= ap; @@ -839,7 +543,7 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) if(apn->p[2]==zvlnr) {apn->mask[2]|= mask; break; } if(apn->p[3]==0) {apn->p[3]= zvlnr; apn->z[3]= vergz; apn->mask[3]= mask; break; } if(apn->p[3]==zvlnr) {apn->mask[3]|= mask; break; } - if(apn->next==0) apn->next= addpsA(); + if(apn->next==0) apn->next= addpsA(zspan); apn= apn->next; } @@ -853,30 +557,9 @@ static void zbuflineAc(int zvlnr, float *vec1, float *vec2) } } - - /* ************* NORMAL ZBUFFER ************ */ -/** - * Convert a homogenous coordinate to a z buffer coordinate. The - * function makes use of Zmulx, Zmuly, the x and y scale factors for - * the screen, and Zjitx, Zjity, the pixel offset. (These are declared - * in render.c) The normalised z coordinate must fall on [0, 1]. - * @param zco [3, 4 floats] pointer to the resulting z buffer coordinate - * @param hoco [4 floats] pointer to the homogenous coordinate of the - * vertex in world space. - */ -static void hoco_to_zco(float *zco, float *hoco) -{ - float deler; - - deler= hoco[3]; - zco[0]= Zmulx*(1.0+hoco[0]/deler)+ Zjitx; - zco[1]= Zmuly*(1.0+hoco[1]/deler)+ Zjity; - zco[2]= 0x7FFFFFFF *(hoco[2]/deler); -} - -static void zbufline(int zvlnr, float *vec1, float *vec2) +static void zbufline(ZSpan *zspan, int zvlnr, float *vec1, float *vec2) { int *rectz, *rectp; int start, end, x, y, oldx, oldy, ofs; @@ -902,7 +585,7 @@ static void zbufline(int zvlnr, float *vec1, float *vec2) start= floor(v1[0]); end= start+floor(dx); - if(end>=R.rectx) end= R.rectx-1; + if(end>=zspan->rectx) end= zspan->rectx-1; oldy= floor(v1[1]); dy/= dx; @@ -911,11 +594,11 @@ static void zbufline(int zvlnr, float *vec1, float *vec2) dz= floor((v2[2]-v1[2])/dx); if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow - rectz= R.rectz+ oldy*R.rectx+ start; - rectp= R.rectot+ oldy*R.rectx+ start; + rectz= zspan->rectz + oldy*zspan->rectx+ start; + rectp= zspan->rectp + oldy*zspan->rectx+ start; - if(dy<0) ofs= -R.rectx; - else ofs= R.rectx; + if(dy<0) ofs= -zspan->rectx; + else ofs= zspan->rectx; for(x= start; x<=end; x++, rectz++, rectp++) { @@ -926,7 +609,7 @@ static void zbufline(int zvlnr, float *vec1, float *vec2) rectp+= ofs; } - if(x>=0 && y>=0 && y=0 && y>=0 && yrecty) { if(vergz<*rectz) { *rectz= vergz; *rectp= zvlnr; @@ -954,7 +637,7 @@ static void zbufline(int zvlnr, float *vec1, float *vec2) start= floor(v1[1]); end= start+floor(dy); - if(end>=R.recty) end= R.recty-1; + if(end>=zspan->recty) end= zspan->recty-1; oldx= floor(v1[0]); dx/= dy; @@ -963,13 +646,13 @@ static void zbufline(int zvlnr, float *vec1, float *vec2) dz= floor((v2[2]-v1[2])/dy); if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow - rectz= R.rectz+ start*R.rectx+ oldx; - rectp= R.rectot+ start*R.rectx+ oldx; + rectz= zspan->rectz + start*zspan->rectx+ oldx; + rectp= zspan->rectp + start*zspan->rectx+ oldx; if(dx<0) ofs= -1; else ofs= 1; - for(y= start; y<=end; y++, rectz+=R.rectx, rectp+=R.rectx) { + for(y= start; y<=end; y++, rectz+=zspan->rectx, rectp+=zspan->rectx) { x= floor(v1[0]); if(x!=oldx) { @@ -978,7 +661,7 @@ static void zbufline(int zvlnr, float *vec1, float *vec2) rectp+= ofs; } - if(x>=0 && y>=0 && x=0 && y>=0 && xrectx) { if(vergz<*rectz) { *rectz= vergz; *rectp= zvlnr; @@ -992,7 +675,7 @@ static void zbufline(int zvlnr, float *vec1, float *vec2) } } -static void zbufline_onlyZ(int zvlnr, float *vec1, float *vec2) +static void zbufline_onlyZ(ZSpan *zspan, int zvlnr, float *vec1, float *vec2) { int *rectz; int start, end, x, y, oldx, oldy, ofs; @@ -1018,7 +701,7 @@ static void zbufline_onlyZ(int zvlnr, float *vec1, float *vec2) start= floor(v1[0]); end= start+floor(dx); - if(end>=R.rectx) end= R.rectx-1; + if(end>=zspan->rectx) end= zspan->rectx-1; oldy= floor(v1[1]); dy/= dx; @@ -1027,10 +710,10 @@ static void zbufline_onlyZ(int zvlnr, float *vec1, float *vec2) dz= floor((v2[2]-v1[2])/dx); if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow - rectz= R.rectz+ oldy*R.rectx+ start; + rectz= zspan->rectz + oldy*zspan->rectx+ start; - if(dy<0) ofs= -R.rectx; - else ofs= R.rectx; + if(dy<0) ofs= -zspan->rectx; + else ofs= zspan->rectx; for(x= start; x<=end; x++, rectz++) { @@ -1040,7 +723,7 @@ static void zbufline_onlyZ(int zvlnr, float *vec1, float *vec2) rectz+= ofs; } - if(x>=0 && y>=0 && y=0 && y>=0 && yrecty) { if(vergz<*rectz) { *rectz= vergz; } @@ -1067,7 +750,7 @@ static void zbufline_onlyZ(int zvlnr, float *vec1, float *vec2) start= floor(v1[1]); end= start+floor(dy); - if(end>=R.recty) end= R.recty-1; + if(end>=zspan->recty) end= zspan->recty-1; oldx= floor(v1[0]); dx/= dy; @@ -1076,12 +759,12 @@ static void zbufline_onlyZ(int zvlnr, float *vec1, float *vec2) dz= floor((v2[2]-v1[2])/dy); if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow - rectz= R.rectz+ start*R.rectx+ oldx; + rectz= zspan->rectz + start*zspan->rectx+ oldx; if(dx<0) ofs= -1; else ofs= 1; - for(y= start; y<=end; y++, rectz+=R.rectx) { + for(y= start; y<=end; y++, rectz+=zspan->rectx) { x= floor(v1[0]); if(x!=oldx) { @@ -1089,7 +772,7 @@ static void zbufline_onlyZ(int zvlnr, float *vec1, float *vec2) rectz+= ofs; } - if(x>=0 && y>=0 && x=0 && y>=0 && xrectx) { if(vergz<*rectz) { *rectz= vergz; } @@ -1153,10 +836,19 @@ static int clipline(float *v1, float *v2) /* return 0: do not draw */ return 0; } +static void hoco_to_zco(ZSpan *zspan, float *zco, float *hoco) +{ + float div; + + div= 1.0f/hoco[3]; + zco[0]= zspan->zmulx*(1.0+hoco[0]*div) + zspan->zofsx; + zco[1]= zspan->zmuly*(1.0+hoco[1]*div) + zspan->zofsy; + zco[2]= 0x7FFFFFFF *(hoco[2]*div); +} -void zbufclipwire(int zvlnr, VlakRen *vlr) +void zbufclipwire(ZSpan *zspan, int zvlnr, VlakRen *vlr) { - float vez[20], *f1, *f2, *f3, *f4= 0, deler; + float vez[20], *f1, *f2, *f3, *f4= 0; int c1, c2, c3, c4, ec, and, or; /* edgecode: 1= draw */ @@ -1192,18 +884,18 @@ void zbufclipwire(int zvlnr, VlakRen *vlr) QUATCOPY(vez, f1); QUATCOPY(vez+4, f2); if( clipline(vez, vez+4)) { - hoco_to_zco(vez, vez); - hoco_to_zco(vez+4, vez+4); - zbuflinefunc(zvlnr, vez, vez+4); + hoco_to_zco(zspan, vez, vez); + hoco_to_zco(zspan, vez+4, vez+4); + zspan->zbuflinefunc(zspan, zvlnr, vez, vez+4); } } if(ec & ME_V2V3) { QUATCOPY(vez, f2); QUATCOPY(vez+4, f3); if( clipline(vez, vez+4)) { - hoco_to_zco(vez, vez); - hoco_to_zco(vez+4, vez+4); - zbuflinefunc(zvlnr, vez, vez+4); + hoco_to_zco(zspan, vez, vez); + hoco_to_zco(zspan, vez+4, vez+4); + zspan->zbuflinefunc(zspan, zvlnr, vez, vez+4); } } if(vlr->v4) { @@ -1211,18 +903,18 @@ void zbufclipwire(int zvlnr, VlakRen *vlr) QUATCOPY(vez, f3); QUATCOPY(vez+4, f4); if( clipline(vez, vez+4)) { - hoco_to_zco(vez, vez); - hoco_to_zco(vez+4, vez+4); - zbuflinefunc(zvlnr, vez, vez+4); + hoco_to_zco(zspan, vez, vez); + hoco_to_zco(zspan, vez+4, vez+4); + zspan->zbuflinefunc(zspan, zvlnr, vez, vez+4); } } if(ec & ME_V4V1) { QUATCOPY(vez, f4); QUATCOPY(vez+4, f1); if( clipline(vez, vez+4)) { - hoco_to_zco(vez, vez); - hoco_to_zco(vez+4, vez+4); - zbuflinefunc(zvlnr, vez, vez+4); + hoco_to_zco(zspan, vez, vez); + hoco_to_zco(zspan, vez+4, vez+4); + zspan->zbuflinefunc(zspan, zvlnr, vez, vez+4); } } } @@ -1231,9 +923,9 @@ void zbufclipwire(int zvlnr, VlakRen *vlr) QUATCOPY(vez, f3); QUATCOPY(vez+4, f1); if( clipline(vez, vez+4)) { - hoco_to_zco(vez, vez); - hoco_to_zco(vez+4, vez+4); - zbuflinefunc(zvlnr, vez, vez+4); + hoco_to_zco(zspan, vez, vez); + hoco_to_zco(zspan, vez+4, vez+4); + zspan->zbuflinefunc(zspan, zvlnr, vez, vez+4); } } } @@ -1242,36 +934,21 @@ void zbufclipwire(int zvlnr, VlakRen *vlr) } } - deler= f1[3]; - vez[0]= Zmulx*(1.0+f1[0]/deler)+ Zjitx; - vez[1]= Zmuly*(1.0+f1[1]/deler)+ Zjity; - vez[2]= 0x7FFFFFFF *(f1[2]/deler); - - deler= f2[3]; - vez[4]= Zmulx*(1.0+f2[0]/deler)+ Zjitx; - vez[5]= Zmuly*(1.0+f2[1]/deler)+ Zjity; - vez[6]= 0x7FFFFFFF *(f2[2]/deler); - - deler= f3[3]; - vez[8]= Zmulx*(1.0+f3[0]/deler)+ Zjitx; - vez[9]= Zmuly*(1.0+f3[1]/deler)+ Zjity; - vez[10]= 0x7FFFFFFF *(f3[2]/deler); - + hoco_to_zco(zspan, vez, f1); + hoco_to_zco(zspan, vez+4, f2); + hoco_to_zco(zspan, vez+8, f3); if(vlr->v4) { - deler= f4[3]; - vez[12]= Zmulx*(1.0+f4[0]/deler)+ Zjitx; - vez[13]= Zmuly*(1.0+f4[1]/deler)+ Zjity; - vez[14]= 0x7FFFFFFF *(f4[2]/deler); + hoco_to_zco(zspan, vez+12, f4); - if(ec & ME_V3V4) zbuflinefunc(zvlnr, vez+8, vez+12); - if(ec & ME_V4V1) zbuflinefunc(zvlnr, vez+12, vez); + if(ec & ME_V3V4) zspan->zbuflinefunc(zspan, zvlnr, vez+8, vez+12); + if(ec & ME_V4V1) zspan->zbuflinefunc(zspan, zvlnr, vez+12, vez); } else { - if(ec & ME_V3V1) zbuflinefunc(zvlnr, vez+8, vez); + if(ec & ME_V3V1) zspan->zbuflinefunc(zspan, zvlnr, vez+8, vez); } - if(ec & ME_V1V2) zbuflinefunc(zvlnr, vez, vez+4); - if(ec & ME_V2V3) zbuflinefunc(zvlnr, vez+4, vez+8); + if(ec & ME_V1V2) zspan->zbuflinefunc(zspan, zvlnr, vez, vez+4); + if(ec & ME_V2V3) zspan->zbuflinefunc(zspan, zvlnr, vez+4, vez+8); } @@ -1286,226 +963,7 @@ void zbufclipwire(int zvlnr, VlakRen *vlr) * @param v2 [4 floats, world coordinates] second vertex * @param v3 [4 floats, world coordinates] third vertex */ -static void zbufinvulGLinv(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3) -{ - double x0,y0,z0,x1,y1,z1,x2,y2,z2,xx1; - double zxd,zyd,zy0,tmp; - float *minv,*maxv,*midv; - int *rectpofs,*rp; - int *rz,zverg,zvlak,x; - int my0,my2,sn1,sn2,rectx,zd,*rectzofs; - int y,omsl,xs0,xs1,xs2,xs3, dx0,dx1,dx2; - - /* MIN MAX */ - if(v1[1] R.recty) return; - - if(my0<0) my0=0; - - /* EDGES : LONGEST */ - xx1= maxv[1]-minv[1]; - if(xx1>2.0/65536.0) { - z0= (maxv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx0= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-minv[1])+minv[0]); - xs0= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx0= 0; - xs0= 65536.0*(MIN2(minv[0],maxv[0])); - } - /* EDGES : THE TOP ONE */ - xx1= maxv[1]-midv[1]; - if(xx1>2.0/65536.0) { - z0= (maxv[0]-midv[0])/xx1; - - tmp= (-65536.0*z0); - dx1= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-midv[1])+midv[0]); - xs1= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx1= 0; - xs1= 65536.0*(MIN2(midv[0],maxv[0])); - } - /* EDGES : THE BOTTOM ONE */ - xx1= midv[1]-minv[1]; - if(xx1>2.0/65536.0) { - z0= (midv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx2= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(omsl-minv[1])+minv[0]); - xs2= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx2= 0; - xs2= 65536.0*(MIN2(minv[0],midv[0])); - } - - /* ZBUF DX DY */ - x1= v1[0]- v2[0]; - x2= v2[0]- v3[0]; - y1= v1[1]- v2[1]; - y2= v2[1]- v3[1]; - z1= v1[2]- v2[2]; - z2= v2[2]- v3[2]; - x0= y1*z2-z1*y2; - y0= z1*x2-x1*z2; - z0= x1*y2-y1*x2; - - if(z0==0.0) return; - - if(midv[1]==maxv[1]) omsl= my2; - if(omsl<0) omsl= -1; /* then it does the first loop entirely */ - - while (my2 >= R.recty) { /* my2 can be larger */ - xs0+=dx0; - if (my2<=omsl) { - xs2+= dx2; - } - else{ - xs1+= dx1; - } - my2--; - } - - xx1= (x0*v1[0]+y0*v1[1])/z0+v1[2]; - - zxd= -x0/z0; - zyd= -y0/z0; - zy0= my2*zyd+xx1; - zd= (int)CLAMPIS(zxd, INT_MIN, INT_MAX); - - /* start-offset in rect */ - rectx= R.rectx; - rectzofs= (int *)(R.rectz+rectx*my2); - rectpofs= (R.rectot+rectx*my2); - zvlak= zvlnr; - - xs3= 0; /* flag */ - if(dx0>dx1) { - xs3= xs0; - xs0= xs1; - xs1= xs3; - xs3= dx0; - dx0= dx1; - dx1= xs3; - xs3= 1; /* flag */ - - } - - for(y=my2;y>omsl;y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs1>>16; - xs1+= dx1; - - sn1++; - - if(sn2>=rectx) sn2= rectx-1; - if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - rz= rectzofs+sn1; - rp= rectpofs+sn1; - x= sn2-sn1; - while(x>=0) { - if(zverg> *rz || *rz==0x7FFFFFFF) { - *rz= zverg; - *rp= zvlak; - } - zverg+= zd; - rz++; - rp++; - x--; - } - zy0-=zyd; - rectzofs-= rectx; - rectpofs-= rectx; - } - - if(xs3) { - xs0= xs1; - dx0= dx1; - } - if(xs0>xs2) { - xs3= xs0; - xs0= xs2; - xs2= xs3; - xs3= dx0; - dx0= dx2; - dx2= xs3; - } - - for(;y>=my0;y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs2>>16; - xs2+= dx2; - - sn1++; - - if(sn2>=rectx) sn2= rectx-1; - if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - rz= rectzofs+sn1; - rp= rectpofs+sn1; - x= sn2-sn1; - while(x>=0) { - if(zverg> *rz || *rz==0x7FFFFFFF) { - *rz= zverg; - *rp= zvlak; - } - zverg+= zd; - rz++; - rp++; - x--; - } - - zy0-=zyd; - rectzofs-= rectx; - rectpofs-= rectx; - } -} - -/* uses spanbuffers */ - -static void zbufinvulGL4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3, float *v4) +static void zbufinvulGLinv4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3, float *v4) { double zxd, zyd, zy0, zverg; float x0,y0,z0; @@ -1516,13 +974,17 @@ static void zbufinvulGL4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v int sn1, sn2, rectx, *rectzofs, my0, my2; /* init */ - zbuf_init_span(zspan, 0, R.recty); + zbuf_init_span(zspan); /* set spans */ zbuf_add_to_span(zspan, v1, v2); zbuf_add_to_span(zspan, v2, v3); - zbuf_add_to_span(zspan, v3, v4); - zbuf_add_to_span(zspan, v4, v1); + if(v4) { + zbuf_add_to_span(zspan, v3, v4); + zbuf_add_to_span(zspan, v4, v1); + } + else + zbuf_add_to_span(zspan, v3, v1); /* clipped */ if(zspan->minp2==NULL || zspan->maxp2==NULL) return; @@ -1530,7 +992,7 @@ static void zbufinvulGL4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1; if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1; -// printf("my %d %d\n", my0, my2); + // printf("my %d %d\n", my0, my2); if(my2rectx; + rectzofs= (zspan->rectz+rectx*my2); + rectpofs= (zspan->rectp+rectx*my2); + /* correct span */ sn1= (my0 + my2)/2; if(zspan->span1[sn1] < zspan->span2[sn1]) { @@ -1585,7 +1047,7 @@ static void zbufinvulGL4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v x= sn2-sn1; while(x>=0) { - if( (int)zverg < *rz) { + if( (int)zverg > *rz || *rz==0x7FFFFFFF) { *rz= (int)zverg; *rp= zvlnr; } @@ -1602,33 +1064,42 @@ static void zbufinvulGL4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v } } -static void zbufinvulGL(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3) +/* uses spanbuffers */ + +static void zbufinvulGL4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3, float *v4) { - double x0,y0,z0; - double x1,y1,z1,x2,y2,z2,xx1; - double zxd, zyd, zy0, zverg, zd; + double zxd, zyd, zy0, zverg; + float x0,y0,z0; + float x1,y1,z1,x2,y2,z2,xx1; float *span1, *span2; int *rectpofs, *rp; - int *rz, zvlak, x, y, my0, my2; - int sn1,sn2, rectx, *rectzofs; + int *rz, x, y; + int sn1, sn2, rectx, *rectzofs, my0, my2; /* init */ - zbuf_init_span(zspan, 0, R.recty); + zbuf_init_span(zspan); /* set spans */ zbuf_add_to_span(zspan, v1, v2); zbuf_add_to_span(zspan, v2, v3); - zbuf_add_to_span(zspan, v3, v1); - - /* clipped */ + if(v4) { + zbuf_add_to_span(zspan, v3, v4); + zbuf_add_to_span(zspan, v4, v1); + } + else + zbuf_add_to_span(zspan, v3, v1); + + /* clipped */ if(zspan->minp2==NULL || zspan->maxp2==NULL) return; if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1; if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1; +// printf("my %d %d\n", my0, my2); if(my2rectx; + rectzofs= (zspan->rectz+rectx*my2); + rectpofs= (zspan->rectp+rectx*my2); + + /* correct span */ sn1= (my0 + my2)/2; if(zspan->span1[sn1] < zspan->span2[sn1]) { span1= zspan->span1+my2; @@ -1669,24 +1138,23 @@ static void zbufinvulGL(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3 sn1= floor(*span1); sn2= floor(*span2); - sn1++; if(sn2>=rectx) sn2= rectx-1; if(sn1<0) sn1= 0; if(sn2>=sn1) { - zverg= sn1*zxd+zy0; + zverg= (double)sn1*zxd + zy0; rz= rectzofs+sn1; rp= rectpofs+sn1; x= sn2-sn1; while(x>=0) { - if(zverg< *rz) { - *rz= floor(zverg); - *rp= zvlak; + if( (int)zverg < *rz) { + *rz= (int)zverg; + *rp= zvlnr; } - zverg+= zd; + zverg+= zxd; rz++; rp++; x--; @@ -1699,8 +1167,6 @@ static void zbufinvulGL(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3 } } - - /** * Fill the z buffer. The face buffer is not operated on! * @@ -1712,106 +1178,39 @@ static void zbufinvulGL(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3 * @param v3 [4 floats, world coordinates] third vertex */ -static void zbufinvulGL_onlyZ(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3) +static void zbufinvulGL_onlyZ(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3, float *v4) { - double x0,y0,z0,x1,y1,z1,x2,y2,z2,xx1; - double zxd,zyd,zy0,tmp; - float *minv,*maxv,*midv; - int *rz,zverg,x; - int my0,my2,sn1,sn2,rectx,zd,*rectzofs; - int y,omsl,xs0,xs1,xs2,xs3, dx0,dx1,dx2; - - /* MIN MAX */ - if(v1[1] R.recty) return; - - if(my0<0) my0=0; - - /* EDGES : LONGEST */ - xx1= maxv[1]-minv[1]; - if(xx1!=0.0) { - z0= (maxv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx0= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-minv[1])+minv[0]); - xs0= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx0= 0; - xs0= 65536.0*(MIN2(minv[0],maxv[0])); - } - /* EDGES : TOP */ - xx1= maxv[1]-midv[1]; - if(xx1!=0.0) { - z0= (maxv[0]-midv[0])/xx1; - - tmp= (-65536.0*z0); - dx1= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(my2-midv[1])+midv[0]); - xs1= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx1= 0; - xs1= 65536.0*(MIN2(midv[0],maxv[0])); - } - /* EDGES : BOTTOM */ - xx1= midv[1]-minv[1]; - if(xx1!=0.0) { - z0= (midv[0]-minv[0])/xx1; - - tmp= (-65536.0*z0); - dx2= CLAMPIS(tmp, INT_MIN, INT_MAX); - - tmp= 65536.0*(z0*(omsl-minv[1])+minv[0]); - xs2= CLAMPIS(tmp, INT_MIN, INT_MAX); - } - else { - dx2= 0; - xs2= 65536.0*(MIN2(minv[0],midv[0])); + double zxd, zyd, zy0, zverg; + float x0,y0,z0; + float x1,y1,z1,x2,y2,z2,xx1; + float *span1, *span2; + int *rz, x, y; + int sn1, sn2, rectx, *rectzofs, my0, my2; + + /* init */ + zbuf_init_span(zspan); + + /* set spans */ + zbuf_add_to_span(zspan, v1, v2); + zbuf_add_to_span(zspan, v2, v3); + if(v4) { + zbuf_add_to_span(zspan, v3, v4); + zbuf_add_to_span(zspan, v4, v1); } - - /* ZBUF DX DY */ + else + zbuf_add_to_span(zspan, v3, v1); + + /* clipped */ + if(zspan->minp2==NULL || zspan->maxp2==NULL) return; + + if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1; + if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1; + + // printf("my %d %d\n", my0, my2); + if(my2= R.recty) { /* my2 can be larger */ - xs0+=dx0; - if (my2<=omsl) { - xs2+= dx2; - } - else{ - xs1+= dx1; - } - my2--; - } - - xx1= (x0*v1[0]+y0*v1[1])/z0+v1[2]; - - zxd= -x0/z0; - zyd= -y0/z0; - zy0= my2*zyd+xx1; - zd= (int)CLAMPIS(zxd, INT_MIN, INT_MAX); - + + xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2]; + + zxd= -(double)x0/(double)z0; + zyd= -(double)y0/(double)z0; + zy0= ((double)my2)*zyd + (double)xx1; + /* start-offset in rect */ - rectx= R.rectx; - rectzofs= (int *)(R.rectz+rectx*my2); - - xs3= 0; /* flag */ - if(dx0>dx1) { - xs3= xs0; - xs0= xs1; - xs1= xs3; - xs3= dx0; - dx0= dx1; - dx1= xs3; - xs3= 1; /* flag */ - - } - - for(y=my2;y>omsl;y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs1>>16; - xs1+= dx1; - - sn1++; - - if(sn2>=rectx) sn2= rectx-1; - if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - rz= rectzofs+sn1; - - x= sn2-sn1; - while(x>=0) { - if(zverg< *rz) { - *rz= zverg; - } - zverg+= zd; - rz++; - x--; - } - zy0-=zyd; - rectzofs-= rectx; - } - - if(xs3) { - xs0= xs1; - dx0= dx1; + rectx= zspan->rectx; + rectzofs= (zspan->rectz+rectx*my2); + + /* correct span */ + sn1= (my0 + my2)/2; + if(zspan->span1[sn1] < zspan->span2[sn1]) { + span1= zspan->span1+my2; + span2= zspan->span2+my2; } - if(xs0>xs2) { - xs3= xs0; - xs0= xs2; - xs2= xs3; - xs3= dx0; - dx0= dx2; - dx2= xs3; + else { + span1= zspan->span2+my2; + span2= zspan->span1+my2; } - - for(;y>=my0;y--) { - - sn1= xs0>>16; - xs0+= dx0; - - sn2= xs2>>16; - xs2+= dx2; - - sn1++; - + + for(y=my2; y>=my0; y--, span1--, span2--) { + + sn1= floor(*span1); + sn2= floor(*span2); + sn1++; + if(sn2>=rectx) sn2= rectx-1; if(sn1<0) sn1= 0; - zverg= (int) CLAMPIS((sn1*zxd+zy0), INT_MIN, INT_MAX); - rz= rectzofs+sn1; - - x= sn2-sn1; - while(x>=0) { - if(zverg< *rz) { - *rz= zverg; + + if(sn2>=sn1) { + zverg= (double)sn1*zxd + zy0; + rz= rectzofs+sn1; + x= sn2-sn1; + + while(x>=0) { + if( (int)zverg < *rz) { + *rz= (int)zverg; + } + zverg+= zxd; + rz++; + x--; } - zverg+= zd; - rz++; - x--; } - + zy0-=zyd; rectzofs-= rectx; } @@ -1958,7 +1299,7 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a db= v2[3]-v1[3]; /* according the original article by Liang&Barsky, for clipping of - * homeginic coordinates with viewplane, the value of "0" is used instead of "-w" . + * homogenous coordinates with viewplane, the value of "0" is used instead of "-w" . * This differs from the other clipping cases (like left or top) and I considered * it to be not so 'homogenic'. But later it has proven to be an error, * who would have thought that of L&B! @@ -2032,7 +1373,7 @@ static void makevertpyra(float *vez, float *labda, float **trias, float *v1, flo /* ------------------------------------------------------------------------- */ -void RE_projectverto(float *v1, float *adr) +void projectverto(float *v1, float winmat[][4], float *adr) { /* calcs homogenic coord of vertex v1 */ float x,y,z; @@ -2040,17 +1381,17 @@ void RE_projectverto(float *v1, float *adr) x= v1[0]; y= v1[1]; z= v1[2]; - adr[0]= x*R.winmat[0][0] + z*R.winmat[2][0] + R.winmat[3][0]; - adr[1]= y*R.winmat[1][1] + z*R.winmat[2][1] + R.winmat[3][1]; - adr[2]= z*R.winmat[2][2] + R.winmat[3][2]; - adr[3]= z*R.winmat[2][3] + R.winmat[3][3]; + adr[0]= x*winmat[0][0] + z*winmat[2][0] + winmat[3][0]; + adr[1]= y*winmat[1][1] + z*winmat[2][1] + winmat[3][1]; + adr[2]= z*winmat[2][2] + winmat[3][2]; + adr[3]= z*winmat[2][3] + winmat[3][3]; //printf("hoco %f %f %f %f\n", adr[0], adr[1], adr[2], adr[3]); } /* ------------------------------------------------------------------------- */ -void projectvert(float *v1, float *adr) +void projectvert(float *v1, float winmat[][4], float *adr) { /* calcs homogenic coord of vertex v1 */ float x,y,z; @@ -2058,17 +1399,16 @@ void projectvert(float *v1, float *adr) x= v1[0]; y= v1[1]; z= v1[2]; - adr[0]= x*R.winmat[0][0]+ y*R.winmat[1][0]+ z*R.winmat[2][0]+ R.winmat[3][0]; - adr[1]= x*R.winmat[0][1]+ y*R.winmat[1][1]+ z*R.winmat[2][1]+ R.winmat[3][1]; - adr[2]= x*R.winmat[0][2]+ y*R.winmat[1][2]+ z*R.winmat[2][2]+ R.winmat[3][2]; - adr[3]= x*R.winmat[0][3]+ y*R.winmat[1][3]+ z*R.winmat[2][3]+ R.winmat[3][3]; + adr[0]= x*winmat[0][0]+ y*winmat[1][0]+ z*winmat[2][0]+ winmat[3][0]; + adr[1]= x*winmat[0][1]+ y*winmat[1][1]+ z*winmat[2][1]+ winmat[3][1]; + adr[2]= x*winmat[0][2]+ y*winmat[1][2]+ z*winmat[2][2]+ winmat[3][2]; + adr[3]= x*winmat[0][3]+ y*winmat[1][3]+ z*winmat[2][3]+ winmat[3][3]; } /* do zbuffering and clip, f1 f2 f3 are hocos, c1 c2 c3 are clipping flags */ void zbufclip(ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3) { - float deler; float *vlzp[32][3], labda[3][2]; float vez[400], *trias[40]; @@ -2127,7 +1467,7 @@ void zbufclip(ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, int c1, clipflag[1]= clipflag[2]= 0; f1= vez; for(b3=0; b3zbuffunc(zspan, zvlnr, vlzp[b][0],vlzp[b][1],vlzp[b][2], NULL); } } return; @@ -2171,28 +1508,15 @@ void zbufclip(ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, int c1, } /* perspective division: HCS to ZCS */ - - deler= f1[3]; - vez[0]= Zmulx*(1.0+f1[0]/deler)+ Zjitx; - vez[1]= Zmuly*(1.0+f1[1]/deler)+ Zjity; - vez[2]= 0x7FFFFFFF *(f1[2]/deler); - - deler= f2[3]; - vez[4]= Zmulx*(1.0+f2[0]/deler)+ Zjitx; - vez[5]= Zmuly*(1.0+f2[1]/deler)+ Zjity; - vez[6]= 0x7FFFFFFF *(f2[2]/deler); + hoco_to_zco(zspan, vez, f1); + hoco_to_zco(zspan, vez+4, f2); + hoco_to_zco(zspan, vez+8, f3); - deler= f3[3]; - vez[8]= Zmulx*(1.0+f3[0]/deler)+ Zjitx; - vez[9]= Zmuly*(1.0+f3[1]/deler)+ Zjity; - vez[10]= 0x7FFFFFFF *(f3[2]/deler); - - zbuffunc(zspan, zvlnr, vez,vez+4,vez+8); + zspan->zbuffunc(zspan, zvlnr, vez,vez+4,vez+8, NULL); } static void zbufclip4(ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, float *f4, int c1, int c2, int c3, int c4) { - float div; float vez[16]; if(c1 | c2 | c3 | c4) { /* not in middle */ @@ -2206,52 +1530,102 @@ static void zbufclip4(ZSpan *zspan, int zvlnr, float *f1, float *f2, float *f3, } /* perspective division: HCS to ZCS */ + hoco_to_zco(zspan, vez, f1); + hoco_to_zco(zspan, vez+4, f2); + hoco_to_zco(zspan, vez+8, f3); + hoco_to_zco(zspan, vez+12, f4); - div= 1.0f/f1[3]; - vez[0]= Zmulx*(1.0+f1[0]*div)+ Zjitx; - vez[1]= Zmuly*(1.0+f1[1]*div)+ Zjity; - vez[2]= 0x7FFFFFFF *(f1[2]*div); - - div= 1.0f/f2[3]; - vez[4]= Zmulx*(1.0+f2[0]*div)+ Zjitx; - vez[5]= Zmuly*(1.0+f2[1]*div)+ Zjity; - vez[6]= 0x7FFFFFFF *(f2[2]*div); - - div= 1.0f/f3[3]; - vez[8]= Zmulx*(1.0+f3[0]*div)+ Zjitx; - vez[9]= Zmuly*(1.0+f3[1]*div)+ Zjity; - vez[10]= 0x7FFFFFFF *(f3[2]*div); - - div= 1.0f/f4[3]; - vez[12]= Zmulx*(1.0+f4[0]*div)+ Zjitx; - vez[13]= Zmuly*(1.0+f4[1]*div)+ Zjity; - vez[14]= 0x7FFFFFFF *(f4[2]*div); - - zbuffunc4(zspan, zvlnr, vez, vez+4, vez+8, vez+12); + zspan->zbuffunc(zspan, zvlnr, vez, vez+4, vez+8, vez+12); } /* ***************** ZBUFFER MAIN ROUTINES **************** */ +void set_part_zbuf_clipflag(RenderPart *pa) +{ + VertRen *ver=NULL; + float minx, miny, maxx, maxy, wco; + unsigned short clipclear; + int v; + + minx= (2*pa->disprect.xmin - R.winx-1)/(float)R.winx; + maxx= (2*pa->disprect.xmax - R.winx+1)/(float)R.winx; + miny= (2*pa->disprect.ymin - R.winy-1)/(float)R.winy; + maxy= (2*pa->disprect.ymax - R.winy+1)/(float)R.winy; + + /* supports up to 4 threads this way */ + clipclear= ~(15 << 4*(pa->thread & 3)); + + for(v=0; vho[3]; + ver->flag &= clipclear; + + switch(pa->thread & 3) { + case 0: + if( ver->ho[0] > maxx*wco) ver->flag |= 1; + else if( ver->ho[0]< minx*wco) ver->flag |= 2; + if( ver->ho[1] > maxy*wco) ver->flag |= 4; + else if( ver->ho[1]< miny*wco) ver->flag |= 8; + break; + case 1: + if( ver->ho[0] > maxx*wco) ver->flag |= 16; + else if( ver->ho[0]< minx*wco) ver->flag |= 32; + if( ver->ho[1] > maxy*wco) ver->flag |= 64; + else if( ver->ho[1]< miny*wco) ver->flag |= 128; + break; + case 2: + if( ver->ho[0] > maxx*wco) ver->flag |= 256; + else if( ver->ho[0]< minx*wco) ver->flag |= 512; + if( ver->ho[1] > maxy*wco) ver->flag |= 1024; + else if( ver->ho[1]< miny*wco) ver->flag |= 2048; + break; + case 3: + if( ver->ho[0] > maxx*wco) ver->flag |= 4096; + else if( ver->ho[0]< minx*wco) ver->flag |= 8192; + if( ver->ho[1] > maxy*wco) ver->flag |= 16384; + else if( ver->ho[1]< miny*wco) ver->flag |= 32768; + break; + } + } +} -void zbufferall(void) +void zbuffer_solid(RenderPart *pa) { ZSpan zspan; VlakRen *vlr= NULL; Material *ma=0; int v, zvlnr; + unsigned short clipmask; short transp=0, env=0, wire=0; - Zmulx= ((float)R.rectx)/2.0; - Zmuly= ((float)R.recty)/2.0; - - fillrect(R.rectz, R.rectx, R.recty, 0x7FFFFFFF); - - zbuf_alloc_span(&zspan, R.recty); + zbuf_alloc_span(&zspan, pa->rectx, pa->recty); + + /* needed for transform from hoco to zbuffer co */ + zspan.zmulx= ((float)R.winx)/2.0; + zspan.zmuly= ((float)R.winy)/2.0; + zspan.zofsx= -pa->disprect.xmin -0.5f; + zspan.zofsy= -pa->disprect.ymin -0.5f; + + if(R.osa) { + zspan.zofsx-= R.jit[pa->sample][0]; + zspan.zofsy-= R.jit[pa->sample][1]; + } + + /* the buffers */ + zspan.rectz= pa->rectz; + zspan.rectp= pa->rectp; + fillrect(pa->rectp, pa->rectx, pa->recty, 0); + fillrect(pa->rectz, pa->rectx, pa->recty, 0x7FFFFFFF); - zbuffunc= zbufinvulGL; - zbuffunc4= zbufinvulGL4; - zbuflinefunc= zbufline; + /* filling methods */ + zspan.zbuffunc= zbufinvulGL4; + zspan.zbuflinefunc= zbufline; + + /* part clipflag, threaded */ + clipmask= (15 << 4*(pa->thread & 3)); for(v=0; vmode & MA_ENV); wire= (ma->mode & MA_WIRE); - if(ma->mode & MA_ZINV) zbuffunc= zbufinvulGLinv; - else zbuffunc= zbufinvulGL; + if(ma->mode & MA_ZINV) zspan.zbuffunc= zbufinvulGLinv4; + else zspan.zbuffunc= zbufinvulGL4; } if(transp==0) { - if(env) zvlnr= 0; - else zvlnr= v+1; + unsigned short partclip; - if(wire) zbufclipwire(zvlnr, vlr); - else { - if(vlr->v4 && (vlr->flag & R_STRAND)) { - zbufclip4(&zspan, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip, vlr->v4->clip); - } + /* partclipping doesn't need viewplane clipping */ + if(vlr->v4) partclip= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag & vlr->v4->flag; + else partclip= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag; + + if((partclip & clipmask)==0) { + + if(env) zvlnr= 0; + else zvlnr= v+1; + + if(wire) zbufclipwire(&zspan, zvlnr, vlr); else { - zbufclip(&zspan, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip); - if(vlr->v4) { - if(zvlnr) zvlnr+= 0x800000; - zbufclip(&zspan, zvlnr, vlr->v1->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v3->clip, vlr->v4->clip); + /* strands allow to be filled in as quad */ + if(vlr->v4 && (vlr->flag & R_STRAND)) { + zbufclip4(&zspan, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip, vlr->v4->clip); + } + else { + zbufclip(&zspan, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip); + if(vlr->v4) { + if(zvlnr) zvlnr+= 0x800000; + zbufclip(&zspan, zvlnr, vlr->v1->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v3->clip, vlr->v4->clip); + } } } } @@ -2293,11 +1677,19 @@ void zbufferall(void) zbuf_free_span(&zspan); } -static int hashlist_projectvert(float *v1, float *hoco) +typedef struct { + float *vert; + float hoco[4]; + int clip; +} VertBucket; + +/* warning, not threaded! */ +static int hashlist_projectvert(float *v1, float winmat[][4], float *hoco) { static VertBucket bucket[256], *buck; - if(v1==0) { + /* init static bucket */ + if(v1==NULL) { memset(bucket, 0, 256*sizeof(VertBucket)); return 0; } @@ -2308,49 +1700,42 @@ static int hashlist_projectvert(float *v1, float *hoco) return buck->clip; } - projectvert(v1, hoco); - buck->clip = RE_testclip(hoco); + projectvert(v1, winmat, hoco); + buck->clip = testclip(hoco); buck->vert= v1; QUATCOPY(buck->hoco, hoco); return buck->clip; } /* used for booth radio 'tool' as during render */ -void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem) +void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem, Render *re) { ZSpan zspan; - float hoco[4][4]; + float hoco[4][4], winmat[4][4]; int a, zvlnr; int c1, c2, c3, c4= 0; - int *rectoto, *rectzo; - int rectxo, rectyo; if(rg_totelem==0) return; - hashlist_projectvert(NULL, NULL); + hashlist_projectvert(NULL, winmat, NULL); - rectxo= R.rectx; - rectyo= R.recty; - rectoto= R.rectot; - rectzo= R.rectz; - - R.rectx= vw->rectx; - R.recty= vw->recty; - R.rectot= vw->rect; - R.rectz= vw->rectz; - - Zmulx= ((float)R.rectx)/2.0; - Zmuly= ((float)R.recty)/2.0; - /* needed for projectvert */ - MTC_Mat4MulMat4(R.winmat, vw->viewmat, vw->winmat); + MTC_Mat4MulMat4(winmat, vw->viewmat, vw->winmat); - fillrect(R.rectz, R.rectx, R.recty, 0x7FFFFFFF); - fillrect(R.rectot, R.rectx, R.recty, 0xFFFFFF); - - zbuf_alloc_span(&zspan, R.recty); + zbuf_alloc_span(&zspan, vw->rectx, vw->recty); + zspan.zmulx= ((float)vw->rectx)/2.0; + zspan.zmuly= ((float)vw->recty)/2.0; + zspan.zofsx= 0; + zspan.zofsy= 0; + + /* the buffers */ + zspan.rectz= vw->rectz; + zspan.rectp= vw->rect; + fillrect(zspan.rectz, vw->rectx, vw->recty, 0x7FFFFFFF); + fillrect(zspan.rectp, vw->rectx, vw->recty, 0xFFFFFF); - zbuffunc= zbufinvulGL; + /* filling methods */ + zspan.zbuffunc= zbufinvulGL4; if(rg_elem) { /* radio tool */ RNode **re, *rn; @@ -2365,18 +1750,18 @@ void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem) else if( rn->f & RAD_BACKFACE) zvlnr= 0xFFFFFF; else zvlnr= a; - c1= hashlist_projectvert(rn->v1, hoco[0]); - c2= hashlist_projectvert(rn->v2, hoco[1]); - c3= hashlist_projectvert(rn->v3, hoco[2]); + c1= hashlist_projectvert(rn->v1, winmat, hoco[0]); + c2= hashlist_projectvert(rn->v2, winmat, hoco[1]); + c3= hashlist_projectvert(rn->v3, winmat, hoco[2]); if(rn->v4) { - c4= hashlist_projectvert(rn->v4, hoco[3]); + c4= hashlist_projectvert(rn->v4, winmat, hoco[3]); } - zbufclip(&zspan, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); - if(rn->v4) { - zbufclip(&zspan, zvlnr, hoco[0], hoco[2], hoco[3], c1, c3, c4); - } + if(rn->v4) + zbufclip4(&zspan, zvlnr, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4); + else + zbufclip(&zspan, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); } } } @@ -2385,8 +1770,8 @@ void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem) RadFace *rf; int totface=0; - for(a=0; a>8]; else vlr++; + for(a=0; atotvlak; a++) { + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->radface) { rf= vlr->radface; @@ -2396,34 +1781,28 @@ void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem) else if( rf->flag & RAD_BACKFACE) zvlnr= 0xFFFFFF; /* receives no energy, but is zbuffered */ else zvlnr= totface; - c1= hashlist_projectvert(vlr->v1->co, hoco[0]); - c2= hashlist_projectvert(vlr->v2->co, hoco[1]); - c3= hashlist_projectvert(vlr->v3->co, hoco[2]); + c1= hashlist_projectvert(vlr->v1->co, winmat, hoco[0]); + c2= hashlist_projectvert(vlr->v2->co, winmat, hoco[1]); + c3= hashlist_projectvert(vlr->v3->co, winmat, hoco[2]); if(vlr->v4) { - c4= hashlist_projectvert(vlr->v4->co, hoco[3]); + c4= hashlist_projectvert(vlr->v4->co, winmat, hoco[3]); } - zbufclip(&zspan, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); - if(vlr->v4) { - zbufclip(&zspan, zvlnr, hoco[0], hoco[2], hoco[3], c1, c3, c4); - } + if(vlr->v4) + zbufclip4(&zspan, zvlnr, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4); + else + zbufclip(&zspan, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); } totface++; } } } - - /* restore */ - R.rectx= rectxo; - R.recty= rectyo; - R.rectot= rectoto; - R.rectz= rectzo; zbuf_free_span(&zspan); } -void zbuffershad(LampRen *lar) +void zbuffer_shadow(Render *re, LampRen *lar, int *rectz, int size) { ZSpan zspan; VlakRen *vlr= NULL; @@ -2432,20 +1811,23 @@ void zbuffershad(LampRen *lar) if(lar->mode & LA_LAYER) lay= lar->lay; - Zmulx= ((float)R.rectx)/2.0; - Zmuly= ((float)R.recty)/2.0; - Zjitx= Zjity= -0.5; - - fillrect(R.rectz,R.rectx,R.recty,0x7FFFFFFE); - - zbuf_alloc_span(&zspan, R.recty); + zbuf_alloc_span(&zspan, size, size); + zspan.zmulx= ((float)size)/2.0; + zspan.zmuly= ((float)size)/2.0; + zspan.zofsx= -0.5f; + zspan.zofsy= -0.5f; + + /* the buffers */ + zspan.rectz= rectz; + fillrect(rectz, size, size, 0x7FFFFFFE); - zbuflinefunc= zbufline_onlyZ; - zbuffunc= zbufinvulGL_onlyZ; + /* filling methods */ + zspan.zbuflinefunc= zbufline_onlyZ; + zspan.zbuffunc= zbufinvulGL_onlyZ; - for(a=0;atotvlak; a++) { - if((a & 255)==0) vlr= R.blovl[a>>8]; + if((a & 255)==0) vlr= re->blovl[a>>8]; else vlr++; if(vlr->mat!= ma) { @@ -2455,11 +1837,13 @@ void zbuffershad(LampRen *lar) } if(ok && (vlr->flag & R_VISIBLE) && (vlr->lay & lay)) { - if(ma->mode & MA_WIRE) zbufclipwire(a+1, vlr); - else if(vlr->flag & R_STRAND) zbufclipwire(a+1, vlr); + if(ma->mode & MA_WIRE) zbufclipwire(&zspan, a+1, vlr); + else if(vlr->flag & R_STRAND) zbufclipwire(&zspan, a+1, vlr); else { - zbufclip(&zspan, 0, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip); - if(vlr->v4) zbufclip(&zspan, 0, vlr->v1->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v3->clip, vlr->v4->clip); + if(vlr->v4) + zbufclip4(&zspan, 0, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip, vlr->v4->clip); + else + zbufclip(&zspan, 0, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip); } } } @@ -2470,57 +1854,31 @@ void zbuffershad(LampRen *lar) /* ******************** ABUF ************************* */ - -void bgnaccumbuf(void) -{ - - Arectz= MEM_mallocN(sizeof(int)*ABUFPART*R.rectx, "Arectz"); - APixbuf= MEM_mallocN(ABUFPART*R.rectx*sizeof(APixstr), "APixbuf"); - - Aminy= -1000; - Amaxy= -1000; - - apsmteller= 0; - apsmfirst.next= 0; - apsmfirst.ps= 0; -} -/* ------------------------------------------------------------------------ */ - -void endaccumbuf(void) -{ - - MEM_freeN(Arectz); - MEM_freeN(APixbuf); - freepsA(); -} - -/* ------------------------------------------------------------------------ */ - /** * Copy results from the solid face z buffering to the transparent * buffer. */ -static void copyto_abufz(int sample) +static void copyto_abufz(RenderPart *pa, int *arectz, int sample) { PixStr *ps; int x, y, *rza; long *rd; /* now, in OSA the pixstructs contain all faces filled in */ - if(R.r.mode & R_OSA) fillrect(Arectz, R.rectx, Amaxy-Aminy+1, 0x7FFFFFFF); + if(R.r.mode & R_OSA) fillrect(arectz, pa->rectx, pa->recty, 0x7FFFFFFF); else { - memcpy(Arectz, R.rectz+ R.rectx*Aminy, 4*R.rectx*(Amaxy-Aminy+1)); + memcpy(arectz, pa->rectz, 4*pa->rectx*pa->recty); return; } - //if( (R.r.mode & R_OSA)==0 || sample==0) return; + if( (R.r.mode & R_OSA)==0 || sample==0) return; - rza= Arectz; - rd= (R.rectdaps+ R.rectx*Aminy); + rza= arectz; + rd= pa->rectdaps; sample= (1<recty; y++) { + for(x=0; xrectx; x++) { if(*rd) { ps= (PixStr *)(*rd); @@ -2547,93 +1905,60 @@ static void copyto_abufz(int sample) * Do accumulation z buffering. */ - -static void set_faces_raycountflag(void) -{ - VertRen *ver=NULL; - VlakRen *vlr=NULL; - float wco, miny, maxy; - int v, clipval; - - miny= (float)(2*Aminy-R.recty-1)/(float)R.recty; - maxy= (float)(2*Amaxy-R.recty+2)/(float)R.recty; - - for(v=0; vho[3]; - ver->flag= 0; - if( ver->ho[1] > maxy*wco) ver->flag |= 64; - else if( ver->ho[1]< miny*wco) ver->flag |= 128; - } - - for(v=0; v>8]; - } - else vlr++; - - if(vlr->v4) - clipval= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag & vlr->v4->flag; - else - clipval= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag; - - if(clipval==64 || clipval==128) - vlr->raycount= 0; - else - vlr->raycount= 1; - } -} - - -static void zbuffer_abuf() +static void zbuffer_abuf(RenderPart *pa, APixstr *APixbuf, ListBase *apsmbase) { ZSpan zspan; Material *ma=0; VlakRen *vlr=NULL; float vec[3], hoco[4], mul, zval, fval; - int v, zvlnr; - int len; + int v, zvlnr, zsample; + unsigned short clipmask; - Zjitx= Zjity= -0.5; - Zmulx= ((float)R.rectx)/2.0; - Zmuly= ((float)R.recty)/2.0; - - /* clear APixstructs */ - len= sizeof(APixstr)*R.rectx*ABUFPART; - memset(APixbuf, 0, len); + zbuf_alloc_span(&zspan, pa->rectx, pa->recty); - zbuf_alloc_span(&zspan, R.recty); + /* needed for transform from hoco to zbuffer co */ + zspan.zmulx= ((float)R.winx)/2.0; + zspan.zmuly= ((float)R.winy)/2.0; + zspan.zofsx= -pa->disprect.xmin -0.5f; + zspan.zofsy= -pa->disprect.ymin -0.5f; - zbuffunc= zbufinvulAc; - zbuffunc4= zbufinvulAc4; - zbuflinefunc= zbuflineAc; - - set_faces_raycountflag(); + /* the buffers */ + zspan.arectz= RE_mallocN(sizeof(int)*pa->rectx*pa->recty, "Arectz"); + zspan.apixbuf= APixbuf; + zspan.apsmbase= apsmbase; + + /* filling methods */ + zspan.zbuffunc= zbufinvulAc4; + zspan.zbuflinefunc= zbuflineAc; - for(Zsample=0; Zsamplethread & 3)); + + for(zsample=0; zsampledisprect.xmin-R.jit[zsample][0]-0.5; + zspan.zofsy= -pa->disprect.ymin-R.jit[zsample][1]-0.5; } for(v=0; v>8]; - } else vlr++; - if(vlr->raycount) { - ma= vlr->mat; - - if(ma->mode & (MA_ZTRA)) { - - if(vlr->flag & R_VISIBLE) { - + ma= vlr->mat; + if(ma->mode & (MA_ZTRA)) { + if(vlr->flag & R_VISIBLE) { + unsigned short partclip; + + /* partclipping doesn't need viewplane clipping */ + if(vlr->v4) partclip= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag & vlr->v4->flag; + else partclip= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag; + + if((partclip & clipmask)==0) { /* a little advantage for transp rendering (a z offset) */ if( ma->zoffs != 0.0) { mul= 0x7FFFFFFF; @@ -2642,16 +1967,16 @@ static void zbuffer_abuf() VECCOPY(vec, vlr->v1->co); /* z is negative, otherwise its being clipped */ vec[2]-= ma->zoffs; - RE_projectverto(vec, hoco); + projectverto(vec, R.winmat, hoco); fval= mul*(1.0+hoco[2]/hoco[3]); - Azvoordeel= (int) fabs(zval - fval ); + zspan.polygon_offset= (int) fabs(zval - fval ); } - else Azvoordeel= 0; + else zspan.polygon_offset= 0; zvlnr= v+1; - if(ma->mode & (MA_WIRE)) zbufclipwire(zvlnr, vlr); + if(ma->mode & (MA_WIRE)) zbufclipwire(&zspan, zvlnr, vlr); else { if(vlr->v4 && (vlr->flag & R_STRAND)) { zbufclip4(&zspan, zvlnr, vlr->v1->ho, vlr->v2->ho, vlr->v3->ho, vlr->v4->ho, vlr->v1->clip, vlr->v2->clip, vlr->v3->clip, vlr->v4->clip); @@ -2665,21 +1990,23 @@ static void zbuffer_abuf() } } } - if( (v & 255)==255) - if(RE_local_test_break()) - break; } + if( (v & 255)==255) + if(R.test_break()) + break; } } if((R.r.mode & R_OSA)==0) break; - if(RE_local_test_break()) break; + if(R.test_break()) break; } + RE_freeN(zspan.arectz); zbuf_free_span(&zspan); + } -int vergzvlak(const void *a1, const void *a2) +static int vergzvlak(const void *a1, const void *a2) { const int *x1=a1, *x2=a2; @@ -2691,7 +2018,7 @@ int vergzvlak(const void *a1, const void *a2) /** * Shade this face at this location in SCS. */ -static void shadetrapixel(float x, float y, int z, int facenr, int mask, float *fcol) +static void shadetrapixel(RenderPart *pa, float x, float y, int z, int facenr, int mask, float *fcol) { float rco[3]; @@ -2700,14 +2027,14 @@ static void shadetrapixel(float x, float y, int z, int facenr, int mask, float * return; } if(R.r.mode & R_OSA) { - VlakRen *vlr= RE_findOrAddVlak( (facenr-1) & 0x7FFFFF); + VlakRen *vlr= RE_findOrAddVlak(&R, (facenr-1) & 0x7FFFFF); float accumcol[4]={0,0,0,0}, tot=0.0; int a; if(vlr->flag & R_FULL_OSA) { for(a=0; a>4]; - shadepixel(x, y, z, facenr, mask, fcol, rco); + int b= R.samples->centmask[mask]; + x= x+R.samples->centLut[b & 15]; + y= y+R.samples->centLut[b>>4]; + shadepixel(pa, x, y, z, facenr, mask, fcol, rco); } } - else shadepixel(x, y, z, facenr, mask, fcol, rco); + else shadepixel(pa, x, y, z, facenr, mask, fcol, rco); } static int addtosampcol(float *sampcol, float *fcol, int mask) @@ -2747,29 +2071,31 @@ static int addtosampcol(float *sampcol, float *fcol, int mask) return retval; } -/* - * renders when needed the Abuffer with faces stored in pixels, returns 1 scanline rendered - */ - #define MAX_ZROW 1000 -void abufsetrow(float *acolrow, int y) +/* main render call to fill in pass the full transparent layer */ + +void zbuffer_transp_shade(RenderPart *pa, float *pass) { - extern SDL_mutex *render_abuf_lock; // initrender.c + APixstr *APixbuf; /* Zbuffer: linked list of face samples */ APixstr *ap, *apn; - float *col, fcol[4], tempcol[4], sampcol[16*4], *scol, accumcol[4]; - float ys, fac, alpha[32]; - int x, part, a, zrow[MAX_ZROW][3], totface, nr; + ListBase apsmbase={NULL, NULL}; + float col[4], fcol[4], tempcol[4], sampcol[16*4], *scol, accumcol[4]; + float fac, alpha[32]; + int x, y, a, zrow[MAX_ZROW][3], totface, nr; int sval; - if(y<0) return; + /* looks nicer for calling code */ + if(R.test_break()) + return; + + APixbuf= RE_callocN(pa->rectx*pa->recty*sizeof(APixstr), "APixbuf"); + if(R.osa>16) { printf("abufsetrow: osa too large\n"); G.afbreek= 1; return; } - - //R.flag &= ~R_LAMPHALO; - + /* alpha LUT */ if(R.r.mode & R_OSA ) { fac= (1.0/(float)R.osa); @@ -2777,146 +2103,132 @@ void abufsetrow(float *acolrow, int y) alpha[a]= (float)a*fac; } } - - if(R.r.mode & R_THREADS) { - /* lock thread if... */ - if(y>Aminy+2 && yAmaxy) { - part= (y/ABUFPART); - Aminy= part*ABUFPART; - Amaxy= Aminy+ABUFPART-1; - if(Amaxy>=R.recty) Amaxy= R.recty-1; - freepsA(); - zbuffer_abuf(); - } - - /* render row */ - col= acolrow; - memset(col, 0, 4*sizeof(float)*R.rectx); - ap= APixbuf + R.rectx*(y-Aminy); - ys= y; - - for(x=0; xp[0]) { - /* sort in z */ - totface= 0; - apn= ap; - while(apn) { - for(a=0; a<4; a++) { - if(apn->p[a]) { - zrow[totface][0]= apn->z[a]; - zrow[totface][1]= apn->p[a]; - zrow[totface][2]= apn->mask[a]; - totface++; - if(totface>=MAX_ZROW) totface= MAX_ZROW-1; + /* fill the Apixbuf */ + zbuffer_abuf(pa, APixbuf, &apsmbase); + + /* render tile */ + ap= APixbuf; + + for(y=pa->disprect.ymin; ydisprect.ymax; y++) { + for(x=pa->disprect.xmin; xdisprect.xmax; x++, ap++, pass+=4) { + + if(ap->p[0]) { + /* sort in z */ + totface= 0; + apn= ap; + while(apn) { + for(a=0; a<4; a++) { + if(apn->p[a]) { + zrow[totface][0]= apn->z[a]; + zrow[totface][1]= apn->p[a]; + zrow[totface][2]= apn->mask[a]; + totface++; + if(totface>=MAX_ZROW) totface= MAX_ZROW-1; + } + else break; } - else break; + apn= apn->next; } - apn= apn->next; - } - - if(totface==1) { - shadetrapixel((float)x, (float)y, zrow[0][0], zrow[0][1], zrow[0][2], fcol); - - nr= count_mask(zrow[0][2]); - if( (R.r.mode & R_OSA) && nr2 */ + qsort(zrow, totface, sizeof(int)*3, vergzvlak); } - - } - else { /* totface>2 */ - qsort(zrow, totface, sizeof(int)*3, vergzvlak); - } - - /* join when pixels are adjacent */ - - while(totface>0) { - totface--; - shadetrapixel((float)x, (float)y, zrow[totface][0], zrow[totface][1], zrow[totface][2], fcol); + /* join when pixels are adjacent */ - a= count_mask(zrow[totface][2]); - if( (R.r.mode & R_OSA ) && a0) { - memset(sampcol, 0, 4*sizeof(float)*R.osa); - sval= addtosampcol(sampcol, fcol, zrow[totface][2]); - - /* sval==0: alpha completely full */ - while( (sval != 0) && (totface>0) ) { - a= count_mask(zrow[totface-1][2]); - if(a==R.osa) break; - totface--; - - shadetrapixel((float)x, (float)y, zrow[totface][0], zrow[totface][1], zrow[totface][2], fcol); + while(totface>0) { + totface--; + + shadetrapixel(pa, (float)x, (float)y, zrow[totface][0], zrow[totface][1], zrow[totface][2], fcol); + + a= count_mask(zrow[totface][2]); + if( (R.r.mode & R_OSA ) && a0) { + memset(sampcol, 0, 4*sizeof(float)*R.osa); sval= addtosampcol(sampcol, fcol, zrow[totface][2]); + + /* sval==0: alpha completely full */ + while( (sval != 0) && (totface>0) ) { + a= count_mask(zrow[totface-1][2]); + if(a==R.osa) break; + totface--; + + shadetrapixel(pa, (float)x, (float)y, zrow[totface][0], zrow[totface][1], zrow[totface][2], fcol); + sval= addtosampcol(sampcol, fcol, zrow[totface][2]); + } + + scol= sampcol; + accumcol[0]= scol[0]; accumcol[1]= scol[1]; + accumcol[2]= scol[2]; accumcol[3]= scol[3]; + scol+= 4; + for(a=1; a=0.999) break; + } + else addAlphaUnderFloat(col, fcol); /* no osa or full pixel with same face? */ + + if(col[3]>=0.999) break; + } } + if(col[3]!=0.0) addAlphaOverFloat(pass, col); } } } - if(R.r.mode & R_THREADS) { - if(y>Aminy+2 && y - -#include "MEM_guardedalloc.h" -#include "zbufferdatastruct.h" -#include "vanillaRenderPipe_types.h" -#include "render.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* if defined: all jittersamples are stored individually. _very_ serious */ -/* performance hit ! also gives some buffer size problems in big scenes */ -#define RE_INDIVIDUAL_SUBPIXELS - -/* ------------------------------------------------------------------------- */ - -static RE_APixstrExtMain RE_apsemfirst; /* pixstr bookkeeping var */ -static short RE_apsemteller = 0; /* pixstr bookkeeping var */ -static int RE_zbufferwidth; /* width of the z-buffer (pixels) */ -RE_APixstrExt *APixbufExt; /* Zbuffer: linked list of face, halo indices */ - -/*-RE_APixstrExt------------------------------------------------------------ */ - -void initZbuffer(int width) -{ - APixbufExt = MEM_callocN(RE_ZBUFLEN * width * sizeof(RE_APixstrExt), - "APixbufExt"); - RE_zbufferwidth = width; - RE_apsemteller = 0; - RE_apsemfirst.next = NULL; - RE_apsemfirst.ps = NULL; -} /* end of RE_APixstrExt *initZbufferDataStruct() */ - -/* ------------------------------------------------------------------------- */ - -void freeZbuffer(void) -{ - if (APixbufExt) MEM_freeN(APixbufExt); - freepseA(); -} /* end of void freeZbuffer(void) */ - -/* ------------------------------------------------------------------------- */ - -void resetZbuffer(void) -{ - int len; - - freepseA(); - len = sizeof(RE_APixstrExt) * RE_zbufferwidth * RE_ZBUFLEN; - memset(APixbufExt, 0, len); -} /* end of void resetZbuffer(void) */ - -/* ------------------------------------------------------------------------- */ - -RE_APixstrExt *addpsemainA() -{ - RE_APixstrExtMain *psm; - - psm= &RE_apsemfirst; - - while(psm->next) { - psm= psm->next; - } - - psm->next= MEM_callocN(sizeof(RE_APixstrExtMain), "addpsemainA"); - - psm= psm->next; - - /* Initialise the new structure to safe values. Memory that is newly */ - /* allocated must be zero... Not sure if that happens everywhere now.*/ - psm->next=0; - psm->ps= MEM_callocN(4096*sizeof(RE_APixstrExt),"pixstrext"); - RE_apsemteller= 0; - - return psm->ps; -} /* End of RE_APixstrExt *addpsemainA() */ - -/* ------------------------------------------------------------------------- */ - -void freepseA() -{ - RE_APixstrExtMain *psm, *next; - - psm= &RE_apsemfirst; - - while(psm) { - next= psm->next; - if(psm->ps) { - MEM_freeN(psm->ps); - psm->ps= 0; - } - if(psm!= &RE_apsemfirst) MEM_freeN(psm); - psm= next; - } - - RE_apsemfirst.next= 0; - RE_apsemfirst.ps= 0; - RE_apsemteller= 0; -} /* End of void freepseA() */ - -/* ------------------------------------------------------------------------- */ - -RE_APixstrExt *addpseA(void) -{ - static RE_APixstrExt *prev; - - /* eerste PS maken */ - if((RE_apsemteller & 4095)==0) prev= addpsemainA(); - else prev++; - RE_apsemteller++; - - return prev; -} /* End of RE_APixstrExt *addpseA(void) */ - -/* ------------------------------------------------------------------------- */ - -void insertObject(int apteller, - int obindex, - int obtype, - int dist, - int mask) -{ - /* Guard the insertion if needed? */ - RE_APixstrExt* apn = &APixbufExt[apteller]; - int all_subpixels= 0; // not used now... (ton) - - while(apn) { - - if(apn->t[0] == RE_NONE) { - apn->p[0] = obindex; apn->t[0] = obtype; - apn->zmin[0] = dist; apn->zmax[0] = dist; - apn->mask[0] = mask; - break; - } - else if(all_subpixels==0) { - if((apn->p[0] == obindex) && (apn->t[0] & obtype)) { - if(dist < apn->zmin[0]) apn->zmin[0] = dist; - else if(dist > apn->zmax[0]) apn->zmax[0] = dist; - apn->mask[0]|= mask; - break; - } - } - - if(apn->t[1] == RE_NONE) { - apn->p[1] = obindex; apn->t[1] = obtype; - apn->zmin[1] = dist; apn->zmax[1] = dist; - apn->mask[1] = mask; - break; - } - else if(all_subpixels==0) { - if((apn->p[1] == obindex) && (apn->t[1] & obtype)) { - if(dist < apn->zmin[1]) apn->zmin[1] = dist; - else if(dist > apn->zmax[1]) apn->zmax[1] = dist; - apn->mask[1]|= mask; - break; - } - } - - if(apn->t[2] == RE_NONE) { - apn->p[2] = obindex; apn->t[2] = obtype; - apn->zmin[2] = dist; apn->zmax[2] = dist; - apn->mask[2] = mask; - break; - } - else if(all_subpixels==0) { - if((apn->p[2] == obindex) && (apn->t[2] & obtype)) { - if(dist < apn->zmin[2]) apn->zmin[2] = dist; - else if(dist > apn->zmax[2]) apn->zmax[2] = dist; - apn->mask[2]|= mask; - break; - } - } - - if(apn->t[3] == RE_NONE) { - apn->p[3] = obindex; apn->t[3] = obtype; - apn->zmin[3] = dist; apn->zmax[3] = dist; - apn->mask[3] = mask; - break; - } - else if(all_subpixels==0) { - if((apn->p[3] == obindex) && (apn->t[3] & obtype)) { - if(dist < apn->zmin[3]) apn->zmin[3] = dist; - else if(dist > apn->zmax[3]) apn->zmax[3] = dist; - apn->mask[3]|= mask; - break; - } - } - - if(apn->next==0) apn->next= addpseA(); - apn= apn->next; - } -} - -/* ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ - -/* This function might be helped by an end-of-list marker */ -void insertFlatObjectNoOsa(RE_APixstrExt *ap, - int obindex, - int obtype, - int dist, - int mask) -{ - int counter=0; - - while(ap) { - if(ap->t[0] == RE_NONE) { - ap->p[0] = obindex; ap->zmin[0] = dist; - ap->zmax[0] = dist; ap->mask[0] = mask; - ap->t[0] = obtype; - break; - } - else if(ap->t[0] & RE_SOLID) if( dist > ap->zmin[0] ) break; - - if(ap->t[1] == RE_NONE) { - ap->p[1] = obindex; ap->zmin[1] = dist; - ap->zmax[1] = dist; ap->mask[1] = mask; - ap->t[1] = obtype; - break; - } - else if(ap->t[1] & RE_SOLID) if( dist > ap->zmin[1] ) break; - - if(ap->t[2] == RE_NONE) { - ap->p[2] = obindex; ap->zmin[2] = dist; - ap->zmax[2] = dist; ap->mask[2] = mask; - ap->t[2] = obtype; - break; - } - else if(ap->t[2] & RE_SOLID) if( dist > ap->zmin[2] ) break; - - if(ap->t[3] == RE_NONE) { - ap->p[3] = obindex; ap->zmin[3] = dist; - ap->zmax[3] = dist; ap->mask[3] = mask; - ap->t[3] = obtype; - break; - } - else if(ap->t[3] & RE_SOLID) if( dist > ap->zmin[3] ) break; - - counter+= 4; - if(counter > RE_MAX_FACES_PER_PIXEL) break; - - if(ap->next==0) ap->next= addpseA(); - ap= ap->next; - }; -} - -/* ------------------------------------------------------------------------- */ - -/* EOF */ diff --git a/source/blender/src/Makefile b/source/blender/src/Makefile index f89f8965fd5..d3b1240a671 100644 --- a/source/blender/src/Makefile +++ b/source/blender/src/Makefile @@ -64,7 +64,6 @@ CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS) # External interfaces of modules: CPPFLAGS += -I../render/extern/include -CPPFLAGS += -I../renderconverter CPPFLAGS += -I../blenkernel CPPFLAGS += -I../blenlib CPPFLAGS += -I../python diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript index f817bd45c16..c94c2e67cf8 100644 --- a/source/blender/src/SConscript +++ b/source/blender/src/SConscript @@ -150,7 +150,6 @@ src_env.Append (CPPPATH = ['#/intern/guardedalloc', '../imbuf', '../render/extern/include', '#/intern/bsp/extern', - '../renderconverter', '../radiosity/extern/include', '#/intern/decimation/extern', '../blenloader', diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c index efb59495fd1..93d97372ec5 100644 --- a/source/blender/src/butspace.c +++ b/source/blender/src/butspace.c @@ -241,6 +241,24 @@ void test_texpoin_but(char *name, ID **idpp) *idpp= NULL; } +void test_imapoin_but(char *name, ID **idpp) +{ + ID *id; + + if( *idpp ) (*idpp)->us--; + + id= G.main->image.first; + while(id) { + if( strcmp(name, id->name+2)==0 ) { + *idpp= id; + id_us_plus(id); + return; + } + id= id->next; + } + *idpp= NULL; +} + /* ----------- custom button group ---------------------- */ static void curvemap_buttons_zoom_in(void *cumap_v, void *unused) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 5f1ac30107a..34a2ff01ead 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -153,7 +153,7 @@ #include "BSE_view.h" #include "BSE_seqaudio.h" -#include "RE_renderconverter.h" // make_sticky +#include "RE_render_ext.h" // make_sticky #include "butspace.h" // own module diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 0e76593aeaf..6c76171dac4 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -74,7 +74,6 @@ /* -----includes for this file specific----- */ -#include "render.h" #include "DNA_image_types.h" #include "BKE_writeavi.h" #include "BKE_image.h" @@ -83,6 +82,7 @@ #include "BIF_editsound.h" #include "BSE_seqaudio.h" #include "BSE_headerbuttons.h" + #include "butspace.h" // own module #ifdef WITH_QUICKTIME @@ -509,7 +509,8 @@ static void run_playanim(char *file) { char str[FILE_MAXDIR+FILE_MAXFILE]; int pos[2], size[2]; - calc_renderwin_rectangle(G.winpos, pos, size); + /* image size not so relevant for now */ + calc_renderwin_rectangle(640, 480, G.winpos, pos, size); sprintf(str, "%s -a -p %d %d \"%s\"", bprogname, pos[0], pos[1], file); system(str); @@ -524,12 +525,12 @@ void playback_anim(void) makeqtstring(file); else #endif - makeavistring(file); + makeavistring(&G.scene->r, file); if(BLI_exist(file)) { run_playanim(file); } else { - makepicstring(file, G.scene->r.sfra); + BKE_makepicstring(file, G.scene->r.sfra); if(BLI_exist(file)) { run_playanim(file); } @@ -598,7 +599,7 @@ void do_render_panels(unsigned short event) G.scene->r.size= 100; G.scene->r.frs_sec= 25; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); BIF_undo_push("Set PAL"); @@ -641,7 +642,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 1; G.scene->r.size= 100; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); BIF_undo_push("Set FULL"); @@ -655,7 +656,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 1; G.scene->r.size= 50; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); allqueue(REDRAWVIEWCAM, 0); @@ -668,7 +669,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 1; G.scene->r.size= 100; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.15, 0.85, 0.15, 0.85); allqueue(REDRAWVIEWCAM, 0); @@ -682,7 +683,7 @@ void do_render_panels(unsigned short event) G.scene->r.size= 100; G.scene->r.frs_sec= 25; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); BIF_undo_push("Set PAL 16/9"); @@ -696,7 +697,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 1; G.scene->r.size= 50; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); allqueue(REDRAWVIEWCAM, 0); @@ -709,7 +710,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 100; G.scene->r.size= 100; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); allqueue(REDRAWVIEWCAM, 0); @@ -722,7 +723,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 100; G.scene->r.size= 100; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.0, 1.0, 0.0, 1.0); BIF_undo_push("Set PC"); @@ -737,7 +738,7 @@ void do_render_panels(unsigned short event) G.scene->r.size= 100; G.scene->r.mode= R_OSA+R_SHADOW+R_FIELDS; G.scene->r.imtype= R_TARGA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 4; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); BIF_undo_push("Set Default"); @@ -767,7 +768,7 @@ void do_render_panels(unsigned short event) G.scene->r.size= 100; G.scene->r.frs_sec= 30; G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 1; + G.scene->r.xparts= G.scene->r.yparts= 2; BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); BIF_undo_push("Set NTSC"); @@ -793,19 +794,19 @@ void do_render_panels(unsigned short event) scene_change_set(G.scene, NULL); break; case B_FBUF_REDO: - if(R.rectftot) { +// if(R.rectftot) { /* copy is needed... not so nice, but how better? */ - R.r.postgamma= G.scene->r.postgamma; - R.r.postigamma= 1.0/R.r.postgamma; - R.r.postadd= G.scene->r.postadd; - R.r.postmul= G.scene->r.postmul; - R.r.posthue= G.scene->r.posthue; - R.r.postsat= G.scene->r.postsat; - R.r.dither_intensity= G.scene->r.dither_intensity; +// R.r.postgamma= G.scene->r.postgamma; +// R.r.postigamma= 1.0/R.r.postgamma; +// R.r.postadd= G.scene->r.postadd; +// R.r.postmul= G.scene->r.postmul; +// R.r.posthue= G.scene->r.posthue; +// R.r.postsat= G.scene->r.postsat; +// R.r.dither_intensity= G.scene->r.dither_intensity; - RE_floatbuffer_to_output(); - BIF_redraw_render_rect(); - } +// _floatbuffer_to_output(); +// BIF_redraw_render_rect(); +// } break; case B_SET_EDGE: G.scene->r.mode &= ~R_ZBLUR; @@ -1112,10 +1113,10 @@ static void render_panel_output(void) /* postprocess render buttons */ uiBlockBeginAlign(block); - if(R.rectftot) - uiDefIconTextButBitI(block, TOG, R_FBUF, B_NOP, ICON_IMAGE_DEHLT," Fbuf", 100, 68, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render; buffer available"); - else - uiDefButBitI(block, TOG, R_FBUF, 0,"Fbuf", 100, 68, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render, no buffer available now"); +// if(R.rectftot) +// uiDefIconTextButBitI(block, TOG, R_FBUF, B_NOP, ICON_IMAGE_DEHLT," Fbuf", 100, 68, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render; buffer available"); +// else +// uiDefButBitI(block, TOG, R_FBUF, 0,"Fbuf", 100, 68, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render, no buffer available now"); uiDefBlockBut(block, post_render_menu, NULL, "Post process", 170, 68, 140, 20, "Applies on RGBA floats while render or with Fbuf available"); uiBlockEndAlign(block); @@ -1155,8 +1156,8 @@ static void render_panel_render(void) uiBlockEndAlign(block); uiBlockBeginAlign(block); - uiDefButS(block, NUM,B_DIFF,"Xparts:", 369,46,95,29,&G.scene->r.xparts,1.0, 64.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)"); - uiDefButS(block, NUM,B_DIFF,"Yparts:", 465,46,95,29,&G.scene->r.yparts,1.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in"); + uiDefButS(block, NUM,B_DIFF,"Xparts:", 369,46,95,29,&G.scene->r.xparts,2.0, 64.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)"); + uiDefButS(block, NUM,B_DIFF,"Yparts:", 465,46,95,29,&G.scene->r.yparts,2.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in"); uiBlockEndAlign(block); uiBlockBeginAlign(block); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index f44efcc8e48..64474c7f343 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -101,7 +101,6 @@ #include "mydevice.h" #include "blendef.h" #include "radio.h" -#include "render.h" /* -----includes for this file specific----- */ @@ -401,7 +400,7 @@ void do_texbuts(unsigned short event) tex->ima->ok= 1; if(tex->env) - RE_free_envmapdata(tex->env); + BKE_free_envmapdata(tex->env); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); @@ -482,7 +481,7 @@ void do_texbuts(unsigned short event) case B_ENV_DELETE: if(tex->env) { - RE_free_envmap(tex->env); + BKE_free_envmap(tex->env); tex->env= 0; allqueue(REDRAWBUTSSHADING, 0); BIF_preview_changed(ID_TE); @@ -490,7 +489,7 @@ void do_texbuts(unsigned short event) break; case B_ENV_FREE: if(tex->env) { - RE_free_envmapdata(tex->env); + BKE_free_envmapdata(tex->env); allqueue(REDRAWBUTSSHADING, 0); BIF_preview_changed(ID_TE); } @@ -500,7 +499,7 @@ void do_texbuts(unsigned short event) while(tex) { if(tex->id.us && tex->type==TEX_ENVMAP) { if(tex->env) { - if(tex->env->stype!=ENV_LOAD) RE_free_envmapdata(tex->env); + if(tex->env->stype!=ENV_LOAD) BKE_free_envmapdata(tex->env); } } tex= tex->id.next; @@ -857,7 +856,7 @@ static void texture_panel_envmap(Tex *tex) uiSetButLock(tex->id.lib!=0, "Can't edit library data"); if(tex->env==NULL) { - tex->env= RE_add_envmap(); + tex->env= BKE_add_envmap(); tex->env->object= OBACT; } if(tex->env) { @@ -2435,6 +2434,7 @@ void do_matbuts(unsigned short event) // BIF_previewdraw(); push/pop! break; case B_MATPRV: + if(ma) end_render_material(ma); /// temporal... 3d preview BIF_preview_changed(ID_MA); allqueue(REDRAWBUTSSHADING, 0); shade_buttons_change_3d(); @@ -2468,6 +2468,7 @@ void do_matbuts(unsigned short event) MEM_freeN(mtex); ma->mtex[ (int) ma->texact ]= 0; BIF_undo_push("Unlink material texture"); + if(ma) end_render_material(ma); /// temporal... 3d preview allqueue(REDRAWBUTSSHADING, 0); allqueue(REDRAWOOPS, 0); BIF_preview_changed(ID_MA); @@ -2509,6 +2510,7 @@ void do_matbuts(unsigned short event) case B_MATZTRANSP: if(ma) { ma->mode &= ~MA_RAYTRANSP; + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); /// temporal... 3d preview allqueue(REDRAWBUTSSHADING, 0); BIF_preview_changed(ID_MA); } @@ -2516,6 +2518,7 @@ void do_matbuts(unsigned short event) case B_MATRAYTRANSP: if(ma) { ma->mode &= ~MA_ZTRA; + if(ma) end_render_material(ma); /// temporal... 3d preview allqueue(REDRAWBUTSSHADING, 0); BIF_preview_changed(ID_MA); } @@ -2527,50 +2530,26 @@ void do_matbuts(unsigned short event) if(ma->mode & MA_RAMP_SPEC) if(ma->ramp_spec==NULL) ma->ramp_spec= add_colorband(0); + if(ma) end_render_material(ma); /// temporal... 3d preview allqueue(REDRAWBUTSSHADING, 0); BIF_preview_changed(ID_MA); shade_buttons_change_3d(); } break; - case B_MAT_LAYERBROWSE: - ma= G.buts->lockpoin; /* use base material instead */ - if(ma) { - MaterialLayer *ml; - - /* the one with a menu set is the browser */ - for(ml= ma->layers.first; ml; ml= ml->next) { - if(ml->menunr) { - if(ml->menunr==32767) { - if(ml->mat) { - ml->mat->id.us--; - ml->mat= copy_material(ml->mat); - } - else ml->mat= add_material("Layer"); - } - else { - ml->mat= BLI_findlink(&G.main->mat, ml->menunr-1); - ml->mat->id.us++; - } - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_MA); - - break; - } - } - } - break; case B_MAT_USENODES: ma= G.buts->lockpoin; /* use base material instead */ if(ma) { if(ma->use_nodes && ma->nodetree==NULL) { node_shader_default(ma); } + if(ma) end_render_material(ma); /// temporal... 3d preview BIF_preview_changed(ID_MA); allqueue(REDRAWNODE, 0); allqueue(REDRAWBUTSSHADING, 0); } break; case B_NODE_EXEC: + if(ma) end_render_material(ma); /// temporal... 3d preview BIF_preview_changed(ID_MA); allqueue(REDRAWNODE, 0); allqueue(REDRAWBUTSSHADING, 0); @@ -2976,8 +2955,8 @@ static void material_panel_shading(Material *ma) uiDefButF(block, NUMSLI, B_MATPRV, "rms:", 90, 100,150,19, &(ma->rms), 0.0, 0.4, 0, 0, "Sets the standard deviation of surface slope"); /* default shading variables */ uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_DIFF, "Tralu ", 9,30,150,19, &(ma->translucency), 0.0, 1.0, 100, 2, "Translucency, amount of diffuse shading of the back side"); - uiDefButF(block, NUMSLI, B_DIFF, "SBias ", 159,30,151,19, &(ma->sbias), 0.0, 0.25, 10, 2, "Shadow bias, to prevent terminator problems on shadow boundary"); + uiDefButF(block, NUMSLI, B_MATPRV, "Tralu ", 9,30,150,19, &(ma->translucency), 0.0, 1.0, 100, 2, "Translucency, amount of diffuse shading of the back side"); + uiDefButF(block, NUMSLI, B_MATPRV, "SBias ", 159,30,151,19, &(ma->sbias), 0.0, 0.25, 10, 2, "Shadow bias, to prevent terminator problems on shadow boundary"); uiDefButF(block, NUMSLI, B_MATPRV, "Amb ", 9,10,150,19, &(ma->amb), 0.0, 1.0, 0, 0, "Sets the amount of global ambient color the material receives"); uiDefButF(block, NUMSLI, B_MATPRV, "Emit ", 159,10,151,19, &(ma->emit), 0.0, 1.0, 0, 0, "Sets the amount of light the material emits"); uiBlockEndAlign(block); @@ -2986,13 +2965,13 @@ static void material_panel_shading(Material *ma) uiDefButBitI(block, TOG, MA_TANGENT_V, B_MATPRV, "Tangent V", 245,180,65,19, &(ma->mode), 0, 0, 0, 0, "Use the tangent vector in V direction for shading"); uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MA_SHADOW, B_NOP, "Shadow", 245,140,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows"); - uiDefButBitI(block, TOG, MA_SHADOW_TRA, B_NOP, "TraShadow", 245,120,65,19, &(ma->mode), 0, 0, 0, 0, "Recieves transparent shadows based at material color and alpha"); - uiDefButBitI(block, TOG, MA_ONLYSHADOW, 0, "OnlyShad", 245,100,65,20, &(ma->mode), 0, 0, 0, 0, "Renders shadows on material as Alpha value"); - uiDefButBitI(block, TOG, MA_RAYBIAS, B_NOP, "Bias", 245,80,65,19, &(ma->mode), 0, 0, 0, 0, "Prevents ray traced shadow errors with phong interpolated normals (terminator problem)"); + uiDefButBitI(block, TOG, MA_SHADOW, B_MATPRV, "Shadow", 245,140,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows"); + uiDefButBitI(block, TOG, MA_SHADOW_TRA, B_MATPRV, "TraShadow", 245,120,65,19, &(ma->mode), 0, 0, 0, 0, "Recieves transparent shadows based at material color and alpha"); + uiDefButBitI(block, TOG, MA_ONLYSHADOW, B_MATPRV, "OnlyShad", 245,100,65,20, &(ma->mode), 0, 0, 0, 0, "Renders shadows on material as Alpha value"); + uiDefButBitI(block, TOG, MA_RAYBIAS, B_MATPRV, "Bias", 245,80,65,19, &(ma->mode), 0, 0, 0, 0, "Prevents ray traced shadow errors with phong interpolated normals (terminator problem)"); uiBlockEndAlign(block); - uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_NOP, "GR:", 9, 55, 150, 19, &ma->group, "Limit Lighting to Lamps in this Group"); + uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_MATPRV, "GR:", 9, 55, 150, 19, &ma->group, "Limit Lighting to Lamps in this Group"); } } @@ -3287,12 +3266,12 @@ static void material_panel_preview(Material *ma) uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, ""); uiBlockSetCol(block, TH_BUT_NEUTRAL); uiBlockBeginAlign(block); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MATPLANE, 210,180,25,22, &(ma->pr_type), 10, 0, 0, 0, ""); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 210,158,25,22, &(ma->pr_type), 10, 1, 0, 0, ""); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MATCUBE, 210,136,25,22, &(ma->pr_type), 10, 2, 0, 0, ""); + uiDefIconButC(block, ROW, B_MATPRV, ICON_MATPLANE, 210,180,25,22, &(ma->pr_type), 10, 2, 0, 0, ""); + uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 210,158,25,22, &(ma->pr_type), 10, 0, 0, 0, ""); + uiDefIconButC(block, ROW, B_MATPRV, ICON_MATCUBE, 210,136,25,22, &(ma->pr_type), 10, 1, 0, 0, ""); + uiDefIconButC(block, ROW, B_MATPRV, MA_DARK, 210,114,25,22, &(ma->pr_type), 10, 3, 0, 0, ""); + uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 210, 92,25,22, &(ma->pr_type), 10, 4, 0, 0, ""); uiBlockEndAlign(block); - - uiDefIconButBitS(block, ICONTOG, MA_DARK, B_MATPRV, ICON_TRANSP_HLT, 210,100,25,22, &(ma->pr_back), 0, 0, 0, 0, ""); uiBlockBeginAlign(block); uiDefIconButBitS(block, TOG, 2, B_MATPRV, ICON_LAMP, 210,40,25,20, &(ma->pr_lamp), 0, 0, 0, 0, ""); diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 0f5edee1328..9a002005e06 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -1106,7 +1106,7 @@ static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, uns /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); - glaDrawPixelsSafe(x1, y1, rectx, recty, GL_LUMINANCE, GL_UNSIGNED_INT, recti); + glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_UNSIGNED_INT, recti); glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); } @@ -1123,7 +1123,7 @@ static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int glPixelTransferf(GL_GREEN_BIAS, 0.5f); glPixelTransferf(GL_BLUE_BIAS, 0.5f); - glaDrawPixelsSafe(x1, y1, rectx, recty, GL_LUMINANCE, GL_INT, recti); + glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_INT, recti); glPixelTransferf(GL_RED_SCALE, 1.0f); glPixelTransferf(GL_GREEN_SCALE, 1.0f); @@ -1154,7 +1154,7 @@ static void sima_draw_zbuffloat_pixels(float x1, float y1, int rectx, int recty, for(a= rectx*recty -1; a>=0; a--) rectf[a]= (rect_float[a]-bias)*scale; - glaDrawPixelsSafe(x1, y1, rectx, recty, GL_LUMINANCE, GL_FLOAT, rectf); + glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_FLOAT, rectf); MEM_freeN(rectf); } @@ -1195,7 +1195,7 @@ void drawimagespace(ScrArea *sa, void *spacedata) ibuf= sima->image->ibuf; } - if(ibuf==NULL || ibuf->rect==NULL) { + if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) { calc_image_view(sima, 'f'); myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); BIF_ThemeColorShade(TH_BACK, 20); @@ -1216,7 +1216,7 @@ void drawimagespace(ScrArea *sa, void *spacedata) glPixelZoom((float)sima->zoom, (float)sima->zoom); if(sima->flag & SI_EDITTILE) { - glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); + glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); glPixelZoom(1.0, 1.0); @@ -1261,7 +1261,7 @@ void drawimagespace(ScrArea *sa, void *spacedata) /* rect= ibuf->rect; */ for(sy= 0; sy+dy<=ibuf->y; sy+= dy) { for(sx= 0; sx+dx<=ibuf->x; sx+= dx) { - glaDrawPixelsSafe(x1+sx*sima->zoom, y1+sy*sima->zoom, dx, dy, GL_RGBA, GL_UNSIGNED_BYTE, rect); + glaDrawPixelsSafe(x1+sx*sima->zoom, y1+sy*sima->zoom, dx, dy, dx, GL_RGBA, GL_UNSIGNED_BYTE, rect); } } @@ -1269,7 +1269,8 @@ void drawimagespace(ScrArea *sa, void *spacedata) } else { if(sima->flag & SI_SHOW_ALPHA) { - sima_draw_alpha_pixels(x1, y1, ibuf->x, ibuf->y, ibuf->rect); + if(ibuf->rect) + sima_draw_alpha_pixels(x1, y1, ibuf->x, ibuf->y, ibuf->rect); } else if(sima->flag & SI_SHOW_ZBUF) { if(ibuf->zbuf) @@ -1282,7 +1283,10 @@ void drawimagespace(ScrArea *sa, void *spacedata) sima_draw_alpha_backdrop(sima, x1, y1, (float)ibuf->x, (float)ibuf->y); glEnable(GL_BLEND); } - glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); + if(ibuf->rect) + glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); + else + glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float); if(sima->flag & SI_USE_ALPHA) glDisable(GL_BLEND); @@ -1304,7 +1308,7 @@ void drawimagespace(ScrArea *sa, void *spacedata) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glaDrawPixelsSafe(x1 + offx, y1 + offy, w, h, GL_RGBA, GL_UNSIGNED_BYTE, clonerect); + glaDrawPixelsSafe(x1 + offx, y1 + offy, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, clonerect); glDisable(GL_BLEND); MEM_freeN(clonerect); diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index 626e72ccecf..7f9f13920d3 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -36,9 +36,10 @@ #include "DNA_action_types.h" #include "DNA_ipo_types.h" -#include "DNA_object_types.h" +#include "DNA_ID.h" #include "DNA_material_types.h" #include "DNA_node_types.h" +#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" #include "DNA_screen_types.h" @@ -46,11 +47,12 @@ #include "DNA_userdef_types.h" #include "BKE_global.h" -#include "BKE_object.h" +#include "BKE_image.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_material.h" #include "BKE_node.h" +#include "BKE_object.h" #include "BKE_texture.h" #include "BKE_utildefines.h" @@ -154,6 +156,19 @@ static void node_ID_title_cb(void *node_v, void *unused_v) } } + +static void node_but_title_cb(void *node_v, void *but_v) +{ + bNode *node= node_v; + uiBut *bt= but_v; + BLI_strncpy(node->name, bt->drawstr, NODE_MAXSTR); + + allqueue(REDRAWNODE, 0); +} + + +/* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */ + static int node_buts_group(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) { if(block && node->id) { @@ -178,12 +193,102 @@ static int node_buts_group(uiBlock *block, bNodeTree *ntree, bNode *node, rctf * NULL, 0, 0, 0, 0, "Displays number of users. Click to make a single-user copy."); //uiButSetFunc(bt, node_mat_alone_cb, node, NULL); } - + uiBlockEndAlign(block); } return 19; } +static int node_buts_value(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + bNodeSocket *sock= node->outputs.first; /* first socket stores value */ + + uiDefButF(block, NUM, B_NODE_EXEC, "", + butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, + sock->ns.vec, 0.0f, 1.0f, 10, 2, ""); + + } + return 20; +} + +static int node_buts_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + bNodeSocket *sock= node->outputs.first; /* first socket stores value */ + + /* enforce square box drawing */ + uiBlockSetEmboss(block, UI_EMBOSSP); + + uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", + butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12, + sock->ns.vec, 0.0f, 1.0f, 3, 0, ""); + uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", + butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15, + sock->ns.vec, 0.0f, 1.0f, 2, 0, ""); + uiDefButF(block, COL, B_NOP, "", + butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12, + sock->ns.vec, 0.0, 0.0, -1, 0, ""); + /* the -1 above prevents col button to popup a color picker */ + + uiBlockSetEmboss(block, UI_EMBOSS); + } + return 30 + (int)(node->width-NODE_DY); +} + +static int node_buts_mix_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + uiBut *bt; + + /* blend type */ + bt=uiDefButS(block, MENU, B_NODE_EXEC, "Mix %x0|Add %x1|Subtract %x3|Multiply %x2|Screen %x4|Divide %x5|Difference %x6|Darken %x7|Lighten %x8", + butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, + &node->custom1, 0, 0, 0, 0, ""); + uiButSetFunc(bt, node_but_title_cb, node, bt); + } + return 20; +} + +static int node_buts_valtorgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + if(node->storage) { + draw_colorband_buts_small(block, node->storage, butr, B_NODE_EXEC); + } + } + return 40; +} + +static int node_buts_curvevec(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + curvemap_buttons(block, node->storage, 'v', B_NODE_EXEC, B_REDR, butr); + } + return (int)(node->width-NODE_DY); +} + +static int node_buts_curvecol(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + curvemap_buttons(block, node->storage, 'c', B_NODE_EXEC, B_REDR, butr); + } + return (int)(node->width-NODE_DY); +} + +static int node_buts_normal(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + bNodeSocket *sock= node->outputs.first; /* first socket stores normal */ + + uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "", + butr->xmin, butr->ymin, butr->xmax-butr->xmin, butr->ymax-butr->ymin, + sock->ns.vec, 0.0f, 1.0f, 0, 0, ""); + + } + return (int)(node->width-NODE_DY); +} + /* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */ @@ -261,8 +366,6 @@ static void node_texmap_cb(void *texmap_v, void *unused_v) init_mapping(texmap_v); } - - static int node_shader_buts_material(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) { if(block) { @@ -348,29 +451,6 @@ static int node_shader_buts_texture(uiBlock *block, bNodeTree *ntree, bNode *nod return 19; } -static int node_shader_buts_normal(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - bNodeSocket *sock= node->outputs.first; /* first socket stores normal */ - - uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, butr->ymax-butr->ymin, - sock->ns.vec, 0.0f, 1.0f, 0, 0, ""); - - } - return (int)(node->width-NODE_DY); -} - -static int node_shader_buts_curve(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - if(node->type==SH_NODE_CURVE_VEC) - curvemap_buttons(block, node->storage, 'v', B_NODE_EXEC, B_REDR, butr); - else - curvemap_buttons(block, node->storage, 'c', B_NODE_EXEC, B_REDR, butr); - } - return (int)(node->width-NODE_DY); -} static int node_shader_buts_mapping(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) { @@ -421,116 +501,195 @@ static int node_shader_buts_mapping(uiBlock *block, bNodeTree *ntree, bNode *nod return 5*19 + 6; } -static int node_shader_buts_value(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) + +/* only once called */ +static void node_shader_set_butfunc(bNodeType *ntype) { - if(block) { - bNodeSocket *sock= node->outputs.first; /* first socket stores value */ - - uiDefButF(block, NUM, B_NODE_EXEC, "", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - sock->ns.vec, 0.0f, 1.0f, 10, 2, ""); - + switch(ntype->type) { + case NODE_GROUP: /* note, generic type, but put here because we call this function anyway */ + ntype->butfunc= node_buts_group; + break; + case SH_NODE_MATERIAL: + ntype->butfunc= node_shader_buts_material; + break; + case SH_NODE_TEXTURE: + ntype->butfunc= node_shader_buts_texture; + break; + case SH_NODE_NORMAL: + ntype->butfunc= node_buts_normal; + break; + case SH_NODE_CURVE_VEC: + ntype->butfunc= node_buts_curvevec; + break; + case SH_NODE_CURVE_RGB: + ntype->butfunc= node_buts_curvecol; + break; + case SH_NODE_MAPPING: + ntype->butfunc= node_shader_buts_mapping; + break; + case SH_NODE_VALUE: + ntype->butfunc= node_buts_value; + break; + case SH_NODE_RGB: + ntype->butfunc= node_buts_rgb; + break; + case SH_NODE_MIX_RGB: + ntype->butfunc= node_buts_mix_rgb; + break; + case SH_NODE_VALTORGB: + ntype->butfunc= node_buts_valtorgb; + break; + default: + ntype->butfunc= NULL; } - return 20; } -static int node_shader_buts_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +/* ****************** BUTTON CALLBACKS FOR COMPOSIT NODES ***************** */ + + + +static void node_browse_image_cb(void *ntree_v, void *node_v) { - if(block) { - bNodeSocket *sock= node->outputs.first; /* first socket stores value */ + bNodeTree *ntree= ntree_v; + bNode *node= node_v; + + nodeSetActive(ntree, node); + + if(node->menunr<1) return; + if(node->menunr==32767) { /* code for Load New */ + addqueue(curarea->win, UI_BUT_EVENT, B_NODE_LOADIMAGE); + } + else { + if(node->id) node->id->us--; + node->id= BLI_findlink(&G.main->image, node->menunr-1); + id_us_plus(node->id); - /* enforce square box drawing */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12, - sock->ns.vec, 0.0f, 1.0f, 3, 0, ""); - uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", - butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15, - sock->ns.vec, 0.0f, 1.0f, 2, 0, ""); - uiDefButF(block, COL, B_NOP, "", - butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12, - sock->ns.vec, 0.0, 0.0, -1, 0, ""); - /* the -1 above prevents col button to popup a color picker */ - - uiBlockSetEmboss(block, UI_EMBOSS); + BLI_strncpy(node->name, node->id->name+2, 21); + + addqueue(curarea->win, RENDERPREVIEW, 1); } - return 30 + (int)(node->width-NODE_DY); + node->menunr= 0; } -static void node_but_title_cb(void *node_v, void *but_v) +static void node_active_cb(void *ntree_v, void *node_v) { - bNode *node= node_v; - uiBut *bt= but_v; - BLI_strncpy(node->name, bt->drawstr, NODE_MAXSTR); - - allqueue(REDRAWNODE, 0); + nodeSetActive(ntree_v, node_v); } -static int node_shader_buts_mix_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +static int node_composit_buts_image(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) { if(block) { uiBut *bt; + short dy= (short)butr->ymin; + char *strp; - /* blend type */ - bt=uiDefButS(block, MENU, B_NODE_EXEC, "Mix %x0|Add %x1|Subtract %x3|Multiply %x2|Screen %x4|Divide %x5|Difference %x6|Darken %x7|Lighten %x8", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &node->custom1, 0, 0, 0, 0, ""); - uiButSetFunc(bt, node_but_title_cb, node, bt); + uiBlockBeginAlign(block); + uiBlockSetCol(block, TH_BUT_SETTING2); + + /* browse button */ + IDnames_to_pupstring(&strp, NULL, "LOAD NEW %x32767", &(G.main->image), NULL, NULL); + node->menunr= 0; + bt= uiDefButS(block, MENU, B_NOP, strp, + butr->xmin, dy, 19, 19, + &node->menunr, 0, 0, 0, 0, "Browses existing choices"); + uiButSetFunc(bt, node_browse_image_cb, ntree, node); + if(strp) MEM_freeN(strp); + + /* Add New button */ + if(node->id==NULL) { + bt= uiDefBut(block, BUT, B_NODE_LOADIMAGE, "Load New", + butr->xmin+19, dy, (short)(butr->xmax-butr->xmin-19.0f), 19, + NULL, 0.0, 0.0, 0, 0, "Add new Image"); + uiButSetFunc(bt, node_active_cb, ntree, node); + uiBlockSetCol(block, TH_AUTO); + } + else { + /* name button */ + short width= (short)(butr->xmax-butr->xmin-19.0f); + bt= uiDefBut(block, TEX, B_NOP, "IMA:", + butr->xmin+19, dy, width, 19, + node->id->name+2, 0.0, 19.0, 0, 0, "Image name"); + uiButSetFunc(bt, node_ID_title_cb, node, NULL); + } + + } + return 19; +} + +static int node_composit_buts_blur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + uiBut *bt; + + uiBlockBeginAlign(block); + bt=uiDefButS(block, NUM, B_NODE_EXEC, "X:", + butr->xmin, butr->ymin, (butr->xmax-butr->xmin)/2, 19, + &node->custom1, 0, 256, 0, 0, ""); + bt=uiDefButS(block, NUM, B_NODE_EXEC, "Y:", + butr->xmin+(butr->xmax-butr->xmin)/2, butr->ymin, (butr->xmax-butr->xmin)/2, 19, + &node->custom2, 0, 256, 0, 0, ""); } - return 20; + return 19; } -static int node_shader_buts_valtorgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +static int node_composit_buts_filter(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) { if(block) { - if(node->storage) { - draw_colorband_buts_small(block, node->storage, butr, B_NODE_EXEC); - } + uiBut *bt; + + /* blend type */ + bt=uiDefButS(block, MENU, B_NODE_EXEC, "Soften %x0|Sharpen %x1|Laplace %x2|Sobel %x3|Prewitt %x4|Kirsch %x5|Shadow %x6", + butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, + &node->custom1, 0, 0, 0, 0, ""); + uiButSetFunc(bt, node_but_title_cb, node, bt); } - return 40; + return 20; } + /* only once called */ -static void node_shader_set_butfunc(bNodeType *ntype) +static void node_composit_set_butfunc(bNodeType *ntype) { switch(ntype->type) { case NODE_GROUP: /* note, generic type, but put here because we call this function anyway */ ntype->butfunc= node_buts_group; break; - case SH_NODE_MATERIAL: - ntype->butfunc= node_shader_buts_material; + case CMP_NODE_IMAGE: + ntype->butfunc= node_composit_buts_image; break; - case SH_NODE_TEXTURE: - ntype->butfunc= node_shader_buts_texture; + case CMP_NODE_NORMAL: + ntype->butfunc= node_buts_normal; break; - case SH_NODE_NORMAL: - ntype->butfunc= node_shader_buts_normal; + case CMP_NODE_CURVE_VEC: + ntype->butfunc= node_buts_curvevec; break; - case SH_NODE_CURVE_VEC: - case SH_NODE_CURVE_RGB: - ntype->butfunc= node_shader_buts_curve; + case CMP_NODE_CURVE_RGB: + ntype->butfunc= node_buts_curvecol; break; - case SH_NODE_MAPPING: - ntype->butfunc= node_shader_buts_mapping; + case CMP_NODE_VALUE: + ntype->butfunc= node_buts_value; break; - case SH_NODE_VALUE: - ntype->butfunc= node_shader_buts_value; + case CMP_NODE_RGB: + ntype->butfunc= node_buts_rgb; break; - case SH_NODE_RGB: - ntype->butfunc= node_shader_buts_rgb; + case CMP_NODE_MIX_RGB: + ntype->butfunc= node_buts_mix_rgb; break; - case SH_NODE_MIX_RGB: - ntype->butfunc= node_shader_buts_mix_rgb; + case CMP_NODE_VALTORGB: + ntype->butfunc= node_buts_valtorgb; break; - case SH_NODE_VALTORGB: - ntype->butfunc= node_shader_buts_valtorgb; + case CMP_NODE_BLUR: + ntype->butfunc= node_composit_buts_blur; + break; + case CMP_NODE_FILTER: + ntype->butfunc= node_composit_buts_filter; break; default: ntype->butfunc= NULL; } } + /* ******* init draw callbacks for all tree types, only called in usiblender.c, once ************* */ void init_node_butfuncs(void) @@ -543,6 +702,12 @@ void init_node_butfuncs(void) node_shader_set_butfunc(*typedefs); typedefs++; } + /* composit nodes */ + typedefs= node_all_composit; /* BKE_node.h */ + while( *typedefs) { + node_composit_set_butfunc(*typedefs); + typedefs++; + } } /* ************** Generic drawing ************** */ @@ -778,9 +943,14 @@ static void node_update(bNode *node) /* preview rect? */ if(node->flag & NODE_PREVIEW) { + float aspect= 1.0f; + + if(node->preview && node->preview->xsize && node->preview->ysize) + aspect= (float)node->preview->ysize/(float)node->preview->xsize; + dy-= NODE_DYS/2; node->prvr.ymax= dy; - node->prvr.ymin= dy-(node->width-NODE_DY); + node->prvr.ymin= dy - aspect*(node->width-NODE_DY); dy= node->prvr.ymin - NODE_DYS/2; } @@ -1076,7 +1246,7 @@ static void node_draw_basis(ScrArea *sa, SpaceNode *snode, bNode *node) /* preview */ if(node->flag & NODE_PREVIEW) - if(node->preview) + if(node->preview && node->preview->rect) node_draw_preview(node->preview, &node->prvr); /* buttons */ @@ -1365,7 +1535,6 @@ static void node_draw_group(ScrArea *sa, SpaceNode *snode, bNode *gnode) } - void drawnodespace(ScrArea *sa, void *spacedata) { SpaceNode *snode= sa->spacedata.first; diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index 36647ea5064..c06108e1e16 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -470,13 +470,16 @@ static void draw_image_seq(ScrArea *sa) SpaceSeq *sseq; StripElem *se; struct ImBuf *ibuf; - int x1, y1; + int x1, y1, rectx, recty; float zoom; glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); - - ibuf= (ImBuf *)give_ibuf_seq( (G.scene->r.cfra)); + + rectx= (G.scene->r.size*G.scene->r.xsch)/100; + recty= (G.scene->r.size*G.scene->r.ysch)/100; + + ibuf= (ImBuf *)give_ibuf_seq(rectx, recty, (G.scene->r.cfra)); if(special_seq_update) { se = special_seq_update->curelem; @@ -503,7 +506,7 @@ static void draw_image_seq(ScrArea *sa) glaDefine2DArea(&curarea->winrct); glPixelZoom(zoom, zoom); - glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); + glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); glPixelZoom(1.0, 1.0); diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index f065a052dd7..f5dc0f458cf 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -35,10 +35,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - #ifndef WIN32 #include #include @@ -67,10 +63,12 @@ #include "DNA_meta_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "DNA_scene_types.h" +#include "DNA_space_types.h" #include "DNA_texture_types.h" -#include "DNA_view3d_types.h" #include "DNA_userdef_types.h" -#include "DNA_space_types.h" +#include "DNA_view3d_types.h" +#include "DNA_world_types.h" #include "BLI_blenlib.h" #include "BLI_arithb.h" @@ -105,6 +103,7 @@ #include "BIF_interface_icons.h" #include "BIF_mywindow.h" #include "BIF_poseobject.h" +#include "BIF_previewrender.h" #include "BIF_resources.h" #include "BIF_screen.h" #include "BIF_space.h" @@ -122,7 +121,6 @@ #include "BSE_time.h" #include "BSE_view.h" -#include "RE_renderconverter.h" #include "BPY_extern.h" #include "blendef.h" @@ -132,7 +130,6 @@ #include "BIF_transform.h" /* Modules used */ -#include "render.h" // for ogl render #include "radio.h" /* locals */ @@ -340,7 +337,7 @@ static void draw_bgpic(void) if(bgpic==0) return; if(bgpic->tex) { - init_render_texture(bgpic->tex); +// init_render_texture(bgpic->tex); free_unused_animimages(); ima= bgpic->tex->ima; } @@ -435,7 +432,7 @@ static void draw_bgpic(void) glaDefine2DArea(&curarea->winrct); glPixelZoom(zoomx, zoomy); - glaDrawPixelsSafe(x1, y1, ima->ibuf->x, ima->ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, bgpic->rect); + glaDrawPixelsSafe(x1, y1, ima->ibuf->x, ima->ibuf->y, ima->ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, bgpic->rect); glPixelZoom(1.0, 1.0); glMatrixMode(GL_PROJECTION); @@ -450,23 +447,6 @@ static void draw_bgpic(void) areawinset(curarea->win); // restore viewport / scissor } -void timestr(double time, char *str) -{ - /* format 00:00:00.00 (hr:min:sec) string has to be 12 long */ - int hr= (int) time/(60*60); - int min= (int) fmod(time/60, 60.0); - int sec= (int) fmod(time, 60.0); - int hun= (int) fmod(time*100.0, 100.0); - - if (hr) { - sprintf(str, "%.2d:%.2d:%.2d.%.2d",hr,min,sec,hun); - } else { - sprintf(str, "%.2d:%.2d.%.2d",min,sec,hun); - } - - str[11]=0; -} - static void drawgrid_draw(float wx, float wy, float x, float y, float dx) { float fx, fy; @@ -2032,6 +2012,29 @@ static void view3d_panel_properties(short cntrl) // VIEW3D_HANDLER_SETTINGS } +static void view3d_panel_preview(ScrArea *sa, short cntrl) // VIEW3D_HANDLER_PREVIEW +{ + uiBlock *block; + View3D *v3d= sa->spacedata.first; + int ofsx, ofsy; + + block= uiNewBlock(&sa->uiblocks, "view3d_panel_preview", UI_EMBOSS, UI_HELV, sa->win); + uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl); + uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); // for close and esc + + ofsx= -150+(sa->winx/2)/v3d->blockscale; + ofsy= -100+(sa->winy/2)/v3d->blockscale; + if(uiNewPanel(sa, block, "Preview", "View3d", ofsx, ofsy, 300, 200)==0) return; + + uiBlockSetDrawExtraFunc(block, BIF_view3d_previewdraw); + + if(G.scene->recalc & SCE_PRV_CHANGED) { + G.scene->recalc &= ~SCE_PRV_CHANGED; + //printf("found recalc\n"); + BIF_view3d_previewrender_free(sa); + BIF_preview_changed(0); + } +} static void view3d_blockhandlers(ScrArea *sa) @@ -2054,9 +2057,11 @@ static void view3d_blockhandlers(ScrArea *sa) break; case VIEW3D_HANDLER_OBJECT: view3d_panel_object(v3d->blockhandler[a+1]); - break; - + case VIEW3D_HANDLER_PREVIEW: + view3d_panel_preview(sa, v3d->blockhandler[a+1]); + break; + } /* clear action value for event */ v3d->blockhandler[a+1]= 0; @@ -2176,10 +2181,10 @@ void drawview3dspace(ScrArea *sa, void *spacedata) Object *ob; Scene *setscene; - setwinmatrixview3d(0); /* 0= no pick rect */ + setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */ setviewmatrixview3d(); /* note: calls where_is_object for camera... */ - Mat4MulMat4(v3d->persmat, v3d->viewmat, curarea->winmat); + Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); Mat4Invert(v3d->persinv, v3d->persmat); Mat4Invert(v3d->viewinv, v3d->viewmat); @@ -2195,7 +2200,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata) v3d->pixsize= 2.0f*(len1>len2?len1:len2); /* correct for window size */ - if(curarea->winx > sa->winy) v3d->pixsize/= (float)sa->winx; + if(sa->winx > sa->winy) v3d->pixsize/= (float)sa->winx; else v3d->pixsize/= (float)sa->winy; } @@ -2238,8 +2243,8 @@ void drawview3dspace(ScrArea *sa, void *spacedata) if(v3d->persp==2) { if(G.scene->world) { if(G.scene->world->mode & WO_STARS) { - RE_make_stars(star_stuff_init_func, star_stuff_vertex_func, - star_stuff_term_func); +// RE_make_stars(star_stuff_init_func, star_stuff_vertex_func, +// star_stuff_term_func); } } if(v3d->flag & V3D_DISPBGPIC) draw_bgpic(); @@ -2351,19 +2356,19 @@ void drawview3dspace(ScrArea *sa, void *spacedata) bwin_scalematrix(sa->win, v3d->blockscale, v3d->blockscale, v3d->blockscale); view3d_blockhandlers(sa); - curarea->win_swap= WIN_BACK_OK; + sa->win_swap= WIN_BACK_OK; if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT)) { v3d->flag |= V3D_NEEDBACKBUFDRAW; - addafterqueue(curarea->win, BACKBUFDRAW, 1); + addafterqueue(sa->win, BACKBUFDRAW, 1); } // test for backbuf select if(G.obedit && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT)) { extern int afterqtest(short win, unsigned short evt); //editscreen.c v3d->flag |= V3D_NEEDBACKBUFDRAW; - if(afterqtest(curarea->win, BACKBUFDRAW)==0) { - addafterqueue(curarea->win, BACKBUFDRAW, 1); + if(afterqtest(sa->win, BACKBUFDRAW)==0) { + addafterqueue(sa->win, BACKBUFDRAW, 1); } } @@ -2380,28 +2385,20 @@ void drawview3dspace(ScrArea *sa, void *spacedata) } - /* Called back by rendering system, icky - */ -void drawview3d_render(struct View3D *v3d) +void drawview3d_render(struct View3D *v3d, int winx, int winy) { - extern short v3d_windowmode; Base *base; Scene *setscene; update_for_newframe_muted(); /* first, since camera can be animated */ - v3d_windowmode= 1; - setwinmatrixview3d(0); - v3d_windowmode= 0; - glMatrixMode(GL_PROJECTION); - myloadmatrix(R.winmat); - glMatrixMode(GL_MODELVIEW); + setwinmatrixview3d(winx, winy, NULL); setviewmatrixview3d(); myloadmatrix(v3d->viewmat); - Mat4MulMat4(v3d->persmat, v3d->viewmat, R.winmat); - Mat4Invert(v3d->persinv, v3d->persmat); - Mat4Invert(v3d->viewinv, v3d->viewmat); +// Mat4MulMat4(v3d->persmat, v3d->viewmat, winmat); +// Mat4Invert(v3d->persinv, v3d->persmat); +// Mat4Invert(v3d->viewinv, v3d->viewmat); free_all_realtime_images(); reshadeall_displist(); @@ -2422,10 +2419,7 @@ void drawview3d_render(struct View3D *v3d) glClearColor(col[0], col[1], col[2], 0.0); } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glLoadIdentity(); - myloadmatrix(v3d->viewmat); - + /* abuse! to make sure it doesnt draw the helpstuff */ G.f |= G_SIMULATION; @@ -2510,7 +2504,6 @@ void drawview3d_render(struct View3D *v3d) glFlush(); - glReadPixels(0, 0, R.rectx, R.recty, GL_RGBA, GL_UNSIGNED_BYTE, R.rectot); glLoadIdentity(); free_all_realtime_images(); diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index 4fc0eb7f293..330555c5f14 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -91,9 +91,10 @@ editmesh_mods.c, UI level access, no geometry changes #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" +#include "RE_render_ext.h" // externtex + #include "mydevice.h" #include "blendef.h" -#include "render.h" // externtex #include "editmesh.h" diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index 1881ea08a56..e6fce5f948d 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -35,6 +35,7 @@ #include "MEM_guardedalloc.h" #include "DNA_action_types.h" +#include "DNA_image_types.h" #include "DNA_ipo_types.h" #include "DNA_object_types.h" #include "DNA_material_types.h" @@ -42,8 +43,10 @@ #include "DNA_space_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" +#include "DNA_userdef_types.h" #include "BKE_global.h" +#include "BKE_image.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_node.h" @@ -63,6 +66,7 @@ #include "BSE_drawipo.h" #include "BSE_edit.h" +#include "BSE_filesel.h" #include "BSE_headerbuttons.h" #include "BSE_node.h" @@ -116,10 +120,10 @@ static void shader_node_previewrender(ScrArea *sa, SpaceNode *snode) BIF_previewrender(snode->id, &ri, NULL, PR_DO_RENDER); /* sends redraw event */ if(ri.rect) MEM_freeN(ri.rect); - if(node->lastywin, RENDERPREVIEW, 1); // if(test!=node->lasty) -// printf("node rendered y %d to %d\n", test, node->lasty); +// printf("node rendered to %d\n", node->lasty); break; } @@ -134,13 +138,49 @@ static void snode_handle_recalc(SpaceNode *snode) if(snode->treetype==NTREE_SHADER) { BIF_preview_changed(ID_MA); /* signals buttons windows and node editors */ } - else + else if(snode->treetype==NTREE_COMPOSIT) { + ntreeCompositExecTree(snode->nodetree); allqueue(REDRAWNODE, 1); + allqueue(REDRAWIMAGE, 1); + } } static void shader_node_event(SpaceNode *snode, short event) { -// bNode *node; + switch(event) { + case B_NODE_EXEC: + snode_handle_recalc(snode); + break; + case B_REDR: + allqueue(REDRAWNODE, 1); + break; + } +} + +static void load_node_image(char *str) /* called from fileselect */ +{ + SpaceNode *snode= curarea->spacedata.first; + bNode *node= nodeGetActive(snode->nodetree); + Image *ima= NULL; + + ima= add_image(str); + if(ima) { + if(node->id) + node->id->us--; + else { + node->id= &ima->id; + ima->id.us++; + } + free_image_buffers(ima); /* force read again */ + ima->ok= 1; + + addqueue(curarea->win, RENDERPREVIEW, 1); + allqueue(REDRAWNODE, 0); + } +} + +static void composit_node_event(SpaceNode *snode, short event) +{ switch(event) { case B_NODE_EXEC: @@ -149,9 +189,25 @@ static void shader_node_event(SpaceNode *snode, short event) case B_REDR: allqueue(REDRAWNODE, 1); break; + case B_NODE_LOADIMAGE: + { + bNode *node= nodeGetActive(snode->nodetree); + char name[FILE_MAXDIR+FILE_MAXFILE]; + + if(node->id) + strcpy(name, ((Image *)node->id)->name); + else strcpy(name, U.textudir); + + /* we make store node->block pointers, and filesel frees it, so we need to clear them */ + for(node= snode->edittree->nodes.first; node; node= node->next) + node->block= NULL; + + activate_fileselect(FILE_SPECIAL, "SELECT IMAGE", name, load_node_image); + } } } + /* assumes nothing being done in ntree yet, sets the default in/out node */ /* called from shading buttons or header */ void node_shader_default(Material *ma) @@ -182,6 +238,45 @@ void node_shader_default(Material *ma) ntreeSolveOrder(ma->nodetree); /* needed for pointers */ } +/* assumes nothing being done in ntree yet, sets the default in/out node */ +/* called from shading buttons or header */ +void node_composit_default(Scene *sce) +{ + bNode *in, *out; + bNodeSocket *fromsock, *tosock; + + /* but lets check it anyway */ + if(sce->nodetree) { + printf("error in composit initialize\n"); + return; + } + + sce->nodetree= ntreeAddTree(NTREE_COMPOSIT); + + out= nodeAddNodeType(sce->nodetree, CMP_NODE_OUTPUT, NULL); + out->locx= 300.0f; out->locy= 300.0f; + + in= nodeAddNodeType(sce->nodetree, CMP_NODE_R_RESULT, NULL); + in->locx= 10.0f; in->locy= 300.0f; + nodeSetActive(sce->nodetree, in); + + /* only a link from color to color */ + fromsock= in->outputs.first; + tosock= out->inputs.first; + nodeAddLink(sce->nodetree, in, fromsock, out, tosock); + + ntreeSolveOrder(sce->nodetree); /* needed for pointers */ + + out->id= find_id("IM", "Compositor"); + if(out->id==NULL) { + Image *ima= alloc_libblock(&G.main->image, ID_IM, "Compositor"); + strcpy(ima->name, "Compositor"); + ima->ok= 1; + ima->xrep= ima->yrep= 1; + out->id= &ima->id; + } +} + /* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */ void snode_set_context(SpaceNode *snode) { @@ -202,6 +297,11 @@ void snode_set_context(SpaceNode *snode) } } } + else if(snode->treetype==NTREE_COMPOSIT) { + snode->from= NULL; + snode->id= &G.scene->id; + snode->nodetree= G.scene->nodetree; + } /* find editable group */ if(snode->nodetree) @@ -990,7 +1090,7 @@ void node_border_select(SpaceNode *snode) /* ****************** Add *********************** */ /* can be called from menus too, but they should do own undopush and redraws */ -bNode *node_add_shadernode(SpaceNode *snode, int type, float locx, float locy) +bNode *node_add_node(SpaceNode *snode, int type, float locx, float locy) { bNode *node= NULL, *gnode; @@ -1022,13 +1122,21 @@ static void node_add_menu(SpaceNode *snode) float locx, locy; short event, mval[2]; - /* shader menu, still hardcoded defines... solve */ - event= pupmenu("Add Node%t|Output%x1|Geometry%x108|Material%x100|Texture%x106|Mapping%x109|Normal%x107|RGB Curves%x111|Vector Curves%x110|Value %x102|Color %x101|Mix Color %x103|ColorRamp %x104|Color to BW %x105"); - if(event<1) return; + if(snode->treetype==NTREE_SHADER) { + /* shader menu, still hardcoded defines... solve */ + event= pupmenu("Add Node%t|Output%x1|Geometry%x108|Material%x100|Texture%x106|Mapping%x109|Normal%x107|RGB Curves%x111|Vector Curves%x110|Value %x102|Color %x101|Mix Color %x103|ColorRamp %x104|Color to BW %x105"); + if(event<1) return; + } + else if(snode->treetype==NTREE_COMPOSIT) { + /* compo menu, still hardcoded defines... solve */ + event= pupmenu("Add Node%t|Output%x201|Render Result %x221|Image %x220|RGB Curves%x209|AlphaOver %x210|Blur %x211|Filter %x212|Value %x203|Color %x202|Mix %x204|ColorRamp %x205|Color to BW %x206|Normal %x207"); + if(event<1) return; + } + else return; getmouseco_areawin(mval); areamouseco_to_ipoco(G.v2d, mval, &locx, &locy); - node_add_shadernode(snode, event, locx, locy); + node_add_node(snode, event, locx, locy); snode_handle_recalc(snode); @@ -1051,24 +1159,32 @@ static void node_insert_convertor(SpaceNode *snode, bNodeLink *link) { bNode *newnode= NULL; - if(snode->edittree->type==NTREE_SHADER) { - if(link->fromsock->type==SOCK_RGBA && link->tosock->type==SOCK_VALUE) { - newnode= node_add_shadernode(snode, SH_NODE_RGBTOBW, 0.0f, 0.0f); - } - else if(link->fromsock->type==SOCK_VALUE && link->tosock->type==SOCK_RGBA) { - newnode= node_add_shadernode(snode, SH_NODE_VALTORGB, 0.0f, 0.0f); - } + if(link->fromsock->type==SOCK_RGBA && link->tosock->type==SOCK_VALUE) { + if(snode->edittree->type==NTREE_SHADER) + newnode= node_add_node(snode, SH_NODE_RGBTOBW, 0.0f, 0.0f); + else if(snode->edittree->type==NTREE_COMPOSIT) + newnode= node_add_node(snode, CMP_NODE_RGBTOBW, 0.0f, 0.0f); + else + newnode= NULL; + } + else if(link->fromsock->type==SOCK_VALUE && link->tosock->type==SOCK_RGBA) { + if(snode->edittree->type==NTREE_SHADER) + newnode= node_add_node(snode, SH_NODE_VALTORGB, 0.0f, 0.0f); + else if(snode->edittree->type==NTREE_COMPOSIT) + newnode= node_add_node(snode, CMP_NODE_VALTORGB, 0.0f, 0.0f); + else + newnode= NULL; + } + + if(newnode) { + /* dangerous assumption to use first in/out socks, but thats fine for now */ + newnode->flag |= NODE_HIDDEN; + newnode->locx= 0.5f*(link->fromsock->locx + link->tosock->locx); + newnode->locy= 0.5f*(link->fromsock->locy + link->tosock->locy) + HIDDEN_RAD; - if(newnode) { - /* dangerous assumption to use first in/out socks, but thats fine for now */ - newnode->flag |= NODE_HIDDEN; - newnode->locx= 0.5f*(link->fromsock->locx + link->tosock->locx); - newnode->locy= 0.5f*(link->fromsock->locy + link->tosock->locy) + HIDDEN_RAD; - - nodeAddLink(snode->edittree, newnode, newnode->outputs.first, link->tonode, link->tosock); - link->tonode= newnode; - link->tosock= newnode->inputs.first; - } + nodeAddLink(snode->edittree, newnode, newnode->outputs.first, link->tonode, link->tosock); + link->tonode= newnode; + link->tosock= newnode->inputs.first; } } @@ -1350,52 +1466,6 @@ static void node_border_link_delete(SpaceNode *snode) /* ********************** */ -static void convert_nodes(SpaceNode *snode) -{ - bNode *node, *bnode, *prevnode; - bNodeSocket *fromsock, *tosock; - Material *mat= (Material *)snode->id; - MaterialLayer *ml; - float locx= 200; - - if(GS(mat->id.name)!=ID_MA) return; - - prevnode= snode->nodetree->nodes.first; - - for(ml= mat->layers.first; ml; ml= ml->next) { - if(ml->mat) { - node= nodeAddNodeType(snode->nodetree, SH_NODE_MATERIAL, NULL); - node->id= (ID *)ml->mat; - node->locx= locx; locx+= 100; - node->locy= 300; - - bnode= nodeAddNodeType(snode->nodetree, SH_NODE_MIX_RGB, NULL); - bnode->custom1= ml->blendmethod; - bnode->locx= locx; locx+= 100; - bnode->locy= 200; - - fromsock= bnode->inputs.first; - fromsock->ns.vec[0]= ml->blendfac; - - if(prevnode) { - fromsock= prevnode->outputs.first; - tosock= bnode->inputs.last; - nodeAddLink(snode->nodetree, prevnode, fromsock, bnode, tosock); - } - - fromsock= node->outputs.first; - tosock= bnode->inputs.first; tosock= tosock->next; - nodeAddLink(snode->nodetree, node, fromsock, bnode, tosock); - - prevnode= bnode; - - } - } - - ntreeSolveOrder(snode->nodetree); - allqueue(REDRAWNODE, 0); -} - void node_make_group(SpaceNode *snode) { bNode *gnode; @@ -1420,6 +1490,7 @@ void node_make_group(SpaceNode *snode) /* ******************** main event loop ****************** */ /* special version to prevent overlapping buttons, has a bit of hack... */ +/* yes, check for example composit_node_event(), file window use... */ int node_uiDoBlocks(SpaceNode *snode, ListBase *lb, short event) { bNode *node; @@ -1507,10 +1578,15 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) /* future: handlerize this! */ if(snode->treetype==NTREE_SHADER) shader_node_event(snode, val); + else if(snode->treetype==NTREE_COMPOSIT) + composit_node_event(snode, val); break; case RENDERPREVIEW: - shader_node_previewrender(sa, snode); + if(snode->treetype==NTREE_SHADER) + shader_node_previewrender(sa, snode); + else if(snode->treetype==NTREE_COMPOSIT) + snode_handle_recalc(snode); break; case PADPLUSKEY: @@ -1557,8 +1633,6 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) node_border_select(snode); break; case CKEY: /* sort again, showing cyclics */ - if(G.qual==LR_ALTKEY) - convert_nodes(snode); /* temporal for layers */ ntreeSolveOrder(snode->edittree); doredraw= 1; break; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 663adfa27a7..1498bf15c06 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -279,7 +279,7 @@ void delete_obj(int ok) allqueue(REDRAWNLA, 0); DAG_scene_sort(G.scene); - + BIF_undo_push("Delete object(s)"); } @@ -4039,7 +4039,6 @@ void single_user(void) /* helper for below, ma was checked to be not NULL */ static void make_local_makelocalmaterial(Material *ma) { - MaterialLayer *ml; ID *id; int b; @@ -4054,21 +4053,7 @@ static void make_local_makelocalmaterial(Material *ma) id= (ID *)ma->ipo; if(id && id->lib) make_local_ipo(ma->ipo); - for(ml=ma->layers.first; ml; ml= ml->next) { - if(ml->mat) { - make_local_material(ml->mat); - - for(b=0; bmat->mtex[b] && ml->mat->mtex[b]->tex) { - make_local_texture(ml->mat->mtex[b]->tex); - } - } - - id= (ID *)ml->mat->ipo; - if(id && id->lib) make_local_ipo(ml->mat->ipo); - } - - } + /* nodetree? XXX */ } void make_local(void) diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 299eaf3b0df..061e70c5938 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -58,6 +58,7 @@ #include "DNA_action_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_sound_types.h" @@ -99,7 +100,6 @@ #include "BPY_extern.h" #include "mydevice.h" #include "blendef.h" -#include "render.h" /* R.flag */ #include "winlay.h" @@ -861,7 +861,7 @@ static void flush_extqd_events(void) { ext_inputchange= ext_reshape= ext_redraw= ext_mousemove= 0; } -unsigned short qtest(void) +int qtest(void) { if (!mainqtest()) { winlay_process_events(0); @@ -1773,7 +1773,7 @@ static void del_area(ScrArea *sa) closeareawin(sa); closeheadwin(sa); - freespacelist(&sa->spacedata); + freespacelist(sa); uiFreeBlocks(&sa->uiblocks); uiFreePanels(&sa->panels); @@ -1792,7 +1792,7 @@ static void copy_areadata(ScrArea *sa1, ScrArea *sa2) sa1->spacetype= sa2->spacetype; Mat4CpyMat4(sa1->winmat, sa2->winmat); - freespacelist(&sa1->spacedata); + freespacelist(sa1); duplicatespacelist(sa1, &sa1->spacedata, &sa2->spacedata); BLI_freelistN(&sa1->panels); @@ -3645,7 +3645,7 @@ int get_cursor(void) { } void set_cursor(int curs) { - if (!(R.flag & R_RENDERING) && G.background == 0) { + if (!(G.rendering) && G.background == 0) { if (curs!=curcursor) { curcursor= curs; window_set_cursor(mainwin, curs); diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c index 3044584cb31..bab93250d23 100644 --- a/source/blender/src/fluidsim.c +++ b/source/blender/src/fluidsim.c @@ -80,7 +80,6 @@ #include "BSE_headerbuttons.h" #include "mydevice.h" -#include "render.h" // for RE_make_existing_file #include "SDL.h" #include "SDL_thread.h" @@ -357,7 +356,7 @@ void fluidsimBake(struct Object *ob) // make sure all directories exist // as the bobjs use the same dir, this only needs to be checked // for the cfg output - RE_make_existing_file(targetFile); + BLI_make_existing_file(targetFile); // check selected directory // simply try to open cfg file for writing to test validity of settings @@ -408,7 +407,7 @@ void fluidsimBake(struct Object *ob) strcat(targetFile, suffixConfig); // make sure these directories exist as well if(outStringsChanged) { - RE_make_existing_file(targetFile); + BLI_make_existing_file(targetFile); } fileCfg = fopen(targetFile, "w"); if(!fileCfg) { diff --git a/source/blender/src/glutil.c b/source/blender/src/glutil.c index a8e10f05b28..4cdc65f621c 100644 --- a/source/blender/src/glutil.c +++ b/source/blender/src/glutil.c @@ -286,7 +286,7 @@ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void * glPixelStorei(GL_UNPACK_ROW_LENGTH, lrowlength); } -void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int format, int type, void *rect) +void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int format, int type, void *rect) { float xzoom= glaGetOneFloat(GL_ZOOM_X); float yzoom= glaGetOneFloat(GL_ZOOM_Y); @@ -338,25 +338,25 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int format, int t glaRasterPosSafe2f(rast_x, rast_y, 0, 0); } - glPixelStorei(GL_UNPACK_ROW_LENGTH, img_w); + glPixelStorei(GL_UNPACK_ROW_LENGTH, row_w); if(format==GL_LUMINANCE || format==GL_RED) { if(type==GL_FLOAT) { float *f_rect= (float *)rect; - glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*img_w + off_x)); + glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*row_w + off_x)); } else if(type==GL_INT || type==GL_UNSIGNED_INT) { int *i_rect= (int *)rect; - glDrawPixels(draw_w, draw_h, format, type, i_rect + (off_y*img_w + off_x)); + glDrawPixels(draw_w, draw_h, format, type, i_rect + (off_y*row_w + off_x)); } } else { /* RGBA */ if(type==GL_FLOAT) { float *f_rect= (float *)rect; - glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*img_w + off_x)*4); + glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*row_w + off_x)*4); } else if(type==GL_UNSIGNED_BYTE) { unsigned char *uc_rect= (unsigned char *) rect; - glDrawPixels(draw_w, draw_h, format, type, uc_rect + (off_y*img_w + off_x)*4); + glDrawPixels(draw_w, draw_h, format, type, uc_rect + (off_y*row_w + off_x)*4); } } diff --git a/source/blender/src/header_buttonswin.c b/source/blender/src/header_buttonswin.c index 6d6512417a3..b1fdf0f5475 100644 --- a/source/blender/src/header_buttonswin.c +++ b/source/blender/src/header_buttonswin.c @@ -108,7 +108,7 @@ void free_matcopybuf(void) matcopybuf.ramp_col= NULL; matcopybuf.ramp_spec= NULL; - BLI_freelistN(&matcopybuf.layers); + ntreeFreeTree(matcopybuf.nodetree); default_mtex(&mtexcopybuf); } @@ -118,7 +118,6 @@ void do_buts_buttons(short event) static short matcopied=0; MTex *mtex; Material *ma; - MaterialLayer *ml; ID id; int a; float dx, dy; @@ -166,7 +165,7 @@ void do_buts_buttons(short event) matcopybuf.mtex[a]= MEM_dupallocN(mtex); } } - duplicatelist(&matcopybuf.layers, &ma->layers); + matcopybuf.nodetree= ntreeCopyTree(ma->nodetree, 0); matcopied= 1; } @@ -183,11 +182,7 @@ void do_buts_buttons(short event) if(mtex && mtex->tex) mtex->tex->id.us--; if(mtex) MEM_freeN(mtex); } - for(ml= ma->layers.first; ml; ml= ml->next) - if(ml->mat) ml->mat->id.us--; - BLI_freelistN(&ma->layers); - id= (ma->id); memcpy(G.buts->lockpoin, &matcopybuf, sizeof(Material)); (ma->id)= id; @@ -202,11 +197,9 @@ void do_buts_buttons(short event) if(mtex->tex) id_us_plus((ID *)mtex->tex); } } - duplicatelist(&ma->layers, &matcopybuf.layers); + ntreeFreeTree(ma->nodetree); + ma->nodetree= ntreeCopyTree(matcopybuf.nodetree, 0); - for(ml= ma->layers.first; ml; ml= ml->next) - if(ml->mat) ml->mat->id.us++; - BIF_preview_changed(ID_MA); BIF_undo_push("Paste material settings"); scrarea_queue_winredraw(curarea); diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index 22cd439f543..d3ef7ebb8f0 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -182,9 +182,9 @@ static void save_paint(char *name) BLI_strncpy(str, name, sizeof(str)); BLI_convertstringcode(str, G.sce, G.scene->r.cfra); - + if (saveover(str)) { - if (BIF_write_ibuf(ima->ibuf, str)) { + if (BKE_write_ibuf(ima->ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality)) { BLI_strncpy(ima->name, name, sizeof(ima->name)); ima->ibuf->userflags &= ~IB_BITMAPDIRTY; allqueue(REDRAWHEADERS, 0); @@ -328,7 +328,13 @@ void do_image_buttons(unsigned short event) if (ima) { strcpy(name, ima->name); if (ima->ibuf) { - activate_fileselect(FILE_SPECIAL, "Save in own image type", name, save_paint); + char str[64]; + save_image_filesel_str(str); + + if(G.scene->r.scemode & R_EXTENSION) + BKE_add_image_extension(name, G.scene->r.imtype); + + activate_fileselect(FILE_SPECIAL, str, name, save_paint); } } break; @@ -712,7 +718,13 @@ static void do_image_imagemenu(void *arg, int event) if (ima) { strcpy(name, ima->name); if (ima->ibuf) { - activate_fileselect(FILE_SPECIAL, "Save in own image type", name, save_paint); + char str[64]; + save_image_filesel_str(str); + + if(G.scene->r.scemode & R_EXTENSION) + BKE_add_image_extension(name, G.scene->r.imtype); + + activate_fileselect(FILE_SPECIAL, str, name, save_paint); } } break; diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 5aebdac7c65..8cbdb197a9d 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -73,6 +73,7 @@ #include "BIF_toets.h" #include "BIF_toolbox.h" #include "BIF_usiblender.h" +#include "BIF_writeimage.h" #include "BIF_drawscene.h" #include "BKE_blender.h" @@ -81,6 +82,7 @@ #include "BKE_image.h" #include "BKE_library.h" #include "BKE_main.h" +#include "BKE_node.h" #include "BKE_packedFile.h" #include "BKE_scene.h" #include "BKE_world.h" @@ -313,6 +315,8 @@ Scene *copy_scene(Scene *sce, int level) duplicatelist(&(scen->markers), &(sce->markers)); + scen->nodetree= ntreeCopyTree(sce->nodetree, 0); + obase= sce->base.first; base= scen->base.first; while(base) { @@ -762,7 +766,7 @@ static void do_info_filemenu(void *arg, int event) } break; case 6: /* save image */ - BIF_save_rendered_image(); + BIF_save_rendered_image_fs(); break; case 22: /* save runtime */ activate_fileselect(FILE_SPECIAL, "Save Runtime", "", write_runtime_check); diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c index 34c6f5e2da9..18df9c084ae 100644 --- a/source/blender/src/header_node.c +++ b/source/blender/src/header_node.c @@ -80,6 +80,12 @@ void do_node_buttons(ScrArea *sa, unsigned short event) allqueue(REDRAWBUTSSHADING, 0); } break; + + case B_NODE_USESCENE: + node_composit_default(G.scene); + snode_set_context(snode); + allqueue(REDRAWNODE, 0); + break; } } @@ -104,25 +110,20 @@ void node_buttons(ScrArea *sa) uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco, 0, XIC+10, YIC, &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0, - "Displays Current Window Type. " - "Click for menu of available types."); + "Displays Current Window Type"); xco += XIC + 14; uiBlockSetEmboss(block, UI_EMBOSSN); if (sa->flag & HEADER_NO_PULLDOWN) { uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(sa->flag), 0, 0, 0, 0, - "Show pulldown menus"); + ICON_DISCLOSURE_TRI_RIGHT, xco,2,XIC,YIC-2, + &(sa->flag), 0, 0, 0, 0, "Show pulldown menus"); } else { uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(sa->flag), 0, 0, 0, 0, - "Hide pulldown menus"); + ICON_DISCLOSURE_TRI_DOWN, xco,2,XIC,YIC-2, + &(sa->flag), 0, 0, 0, 0, "Hide pulldown menus"); } xco+=XIC; @@ -138,6 +139,16 @@ void node_buttons(ScrArea *sa) uiBlockSetEmboss(block, UI_EMBOSS); + /* main type choosing */ + uiBlockBeginAlign(block); + uiDefIconButI(block, ROW, B_REDR, ICON_MATERIAL_DEHLT, xco,2,XIC,YIC-2, + &(snode->treetype), 2, 0, 0, 0, "Material Nodes"); + xco+= XIC; + uiDefIconButI(block, ROW, B_REDR, ICON_IMAGE_DEHLT, xco,2,XIC,YIC-2, + &(snode->treetype), 2, 1, 0, 0, "Composit Nodes"); + xco+= 2*XIC; + uiBlockEndAlign(block); + /* find and set the context */ snode_set_context(snode); @@ -154,6 +165,9 @@ void node_buttons(ScrArea *sa) } } } + else if(snode->treetype==NTREE_COMPOSIT) { + uiDefButS(block, TOG, B_NODE_USESCENE, "Use Nodes", xco+5,0,70,19, &G.scene->use_nodes, 0.0f, 0.0f, 0, 0, ""); + } /* always as last */ sa->headbutlen= xco+2*XIC; diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index 733c9b752f2..8955794b755 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -412,6 +412,8 @@ static void do_update_for_newframe(int mute, int events) scene_update_for_newframe(G.scene, screen_view3d_layers()); /* BKE_scene.h */ if ( (CFRA>1) && (!mute) && (G.scene->audio.flag & AUDIO_SCRUB)) audiostream_scrub( CFRA ); + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); + } void update_for_newframe(void) @@ -1637,13 +1639,7 @@ void do_global_buttons2(short event) ma= give_current_material(ob, ob->actcol); if(ma && ma->id.lib) { if(okee("Make local")) { - MaterialLayer *ml; - make_local_material(ma); - for(ml= ma->layers.first; ml; ml= ml->next) { - if(ml->mat) - make_local_material(ml->mat); - } } } } diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index cb0a8ae1617..7ebaf09e60f 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -94,7 +94,7 @@ #include "BIF_interface.h" #include "BIF_interface_icons.h" #include "BIF_butspace.h" - +#include "BIF_previewrender.h" #include "BSE_view.h" @@ -158,6 +158,24 @@ void ui_graphics_to_window(int win, float *x, float *y) /* for rectwrite */ *y= ((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1])); } +void ui_graphics_to_window_rct(int win, rctf *graph, rcti *winr) +{ + float gx, gy; + int sx, sy; + int getsizex, getsizey; + + bwin_getsize(win, &getsizex, &getsizey); + bwin_getsuborigin(win, &sx, &sy); + + gx= graph->xmin; + gy= graph->ymin; + winr->xmin= (int)((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0])); + winr->ymin= (int)((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1])); + gx= graph->xmax; + gy= graph->ymax; + winr->xmax= (int)((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0])); + winr->ymax= (int)((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1])); +} void ui_window_to_graphics(int win, float *x, float *y) /* for mouse cursor */ @@ -937,7 +955,7 @@ void uiDrawBlock(uiBlock *block) if(block->panel) ui_draw_panel(block); } - if(block->drawextra) block->drawextra(); + if(block->drawextra) block->drawextra(curarea, block); for (but= block->buttons.first; but; but= but->next) { @@ -4022,13 +4040,19 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) } else if( (block->maxy <= uevent->mval[1]) && (block->maxy+PNL_HEADER >= uevent->mval[1]) ) inside= 2; - + else if( block->panel->control & UI_PNL_SCALE) { + if( (block->maxx-PNL_HEADER <= uevent->mval[0])) + if( (block->miny+PNL_HEADER >= uevent->mval[1]) && inside ) + inside= 3; + } + if(inside) { // this stuff should move to do_panel if(uevent->event==LEFTMOUSE) { - if(inside==2) { + if(inside>=2) { uiPanelPop(block); // pop matrix; no return without pop! - ui_do_panel(block, uevent); + if(inside==2) ui_do_panel(block, uevent); + else ui_scale_panel(block); return UI_EXIT_LOOP; // exit loops because of moving panels } } @@ -4041,11 +4065,13 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) else if(uevent->event==PADPLUSKEY || uevent->event==PADMINUS) { SpaceLink *sl= curarea->spacedata.first; if(curarea->spacetype!=SPACE_BUTS) { - if(uevent->event==PADPLUSKEY) sl->blockscale+= 0.1; - else sl->blockscale-= 0.1; - CLAMP(sl->blockscale, 0.6, 1.0); - addqueue(block->winq, REDRAW, 1); - retval= UI_RETURN_OK; + if(!(block->panel->control & UI_PNL_SCALE)) { + if(uevent->event==PADPLUSKEY) sl->blockscale+= 0.1; + else sl->blockscale-= 0.1; + CLAMP(sl->blockscale, 0.6, 1.0); + addqueue(block->winq, REDRAW, 1); + retval= UI_RETURN_OK; + } } } } diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c index fccfc4dcb0f..35889e3c220 100644 --- a/source/blender/src/interface_icons.c +++ b/source/blender/src/interface_icons.c @@ -83,11 +83,8 @@ #include "PIL_time.h" -#include "RE_renderconverter.h" - #include "blendef.h" // CLAMP #include "datatoc.h" -#include "render.h" #include "mydevice.h" /* OpenGL textures have to be size 2n+2 x 2m+2 for some n,m */ @@ -635,9 +632,12 @@ static void icon_from_image(Image* img, RenderInfo* ri, unsigned int w, unsigned memset(ri->rect, 0xFF, w*h*sizeof(unsigned int)); } - if(img->ibuf==NULL) { - load_image(img, IB_rect, G.sce, G.scene->r.cfra); + /* bail out now... loading and reducing images is too expensive */ + if(img->ibuf==NULL || img->ibuf->rect==NULL) { + return; +// load_image(img, IB_rect, G.sce, G.scene->r.cfra); } + ima = IMB_dupImBuf(img->ibuf); if (!ima) diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c index 2bb31032a04..d1ba75a5036 100644 --- a/source/blender/src/interface_panel.c +++ b/source/blender/src/interface_panel.c @@ -72,6 +72,7 @@ #include "BIF_keyval.h" #include "BIF_mainqueue.h" +#include "BIF_previewrender.h" #include "BIF_screen.h" #include "BIF_toolbox.h" #include "BIF_mywindow.h" @@ -481,10 +482,14 @@ int uiNewPanel(ScrArea *sa, uiBlock *block, char *panelname, char *tabname, int } if(pa) { - if(pa->sizex != sizex) { + /* scale correction */ + if(pa->control & UI_PNL_SCALE); + else { pa->sizex= sizex; - pa->ofsy+= (pa->sizey - sizey); // check uiNewPanelHeight() - pa->sizey= sizey; + if(pa->sizey != sizey) { + pa->ofsy+= (pa->sizey - sizey); // check uiNewPanelHeight() + pa->sizey= sizey; + } } } else { @@ -928,6 +933,30 @@ static void ui_draw_panel_header(uiBlock *block) } +static void ui_draw_panel_scalewidget(uiBlock *block) +{ + float xmin, xmax, dx; + float ymin, ymax, dy; + + xmin= block->maxx-PNL_HEADER+2; + xmax= block->maxx-3; + ymin= block->miny+3; + ymax= block->miny+PNL_HEADER-2; + + dx= 0.5f*(xmax-xmin); + dy= 0.5f*(ymax-ymin); + + glEnable(GL_BLEND); + glColor4ub(255, 255, 255, 50); + fdrawline(xmin, ymin, xmax, ymax); + fdrawline(xmin+dx, ymin, xmax, ymax-dy); + + glColor4ub(0, 0, 0, 50); + fdrawline(xmin, ymin+block->aspect, xmax, ymax+block->aspect); + fdrawline(xmin+dx, ymin+block->aspect, xmax, ymax-dy+block->aspect); + glDisable(GL_BLEND); +} + void ui_draw_panel(uiBlock *block) { Panel *panel= block->panel; @@ -1070,6 +1099,9 @@ void ui_draw_panel(uiBlock *block) uiRoundRect(block->minx, block->miny, block->maxx, block->maxy+PNL_HEADER, 8); } + if(panel->control & UI_PNL_SCALE) + ui_draw_panel_scalewidget(block); + /* and a soft shadow-line for now */ /* glEnable( GL_BLEND ); @@ -1496,11 +1528,12 @@ static void test_add_new_tabs(ScrArea *sa) /* ------------ panel drag ---------------- */ -static void ui_drag_panel(uiBlock *block) +static void ui_drag_panel(uiBlock *block, int doscale) { Panel *panel= block->panel; - short align=0, first=1, ofsx, ofsy, dx=0, dy=0, dxo=0, dyo=0, mval[2], mvalo[2]; - + short align=0, first=1, dx=0, dy=0, dxo=0, dyo=0, mval[2], mvalo[2]; + short ofsx, ofsy, sizex, sizey; + if(curarea->spacetype==SPACE_BUTS) { SpaceButs *sbuts= curarea->spacedata.first; align= sbuts->align; @@ -1509,9 +1542,15 @@ static void ui_drag_panel(uiBlock *block) uiGetMouse(block->win, mvalo); ofsx= block->panel->ofsx; ofsy= block->panel->ofsy; + sizex= block->panel->sizex; + sizey= block->panel->sizey; panel->flag |= PNL_SELECT; + /* exception handling, 3d window preview panel */ + if(block->drawextra==BIF_view3d_previewdraw) + BIF_view3d_previewrender_clear(curarea); + while(TRUE) { if( !(get_mbut() & L_MOUSE) ) break; @@ -1528,13 +1567,25 @@ static void ui_drag_panel(uiBlock *block) dxo= dx; dyo= dy; first= 0; - panel->ofsx = ofsx+dx; - panel->ofsy = ofsy+dy; - - check_panel_overlap(curarea, panel); - - if(align) uiAlignPanelStep(curarea, 0.2); + if(doscale) { + panel->sizex = MAX2(sizex+dx, UI_PANEL_MINX); + + if(sizey-dy < UI_PANEL_MINY) { + dy= -UI_PANEL_MINY+sizey; + } + panel->sizey = sizey-dy; + + panel->ofsy= ofsy+dy; + } + else { + panel->ofsx = ofsx+dx; + panel->ofsy = ofsy+dy; + check_panel_overlap(curarea, panel); + + if(align) uiAlignPanelStep(curarea, 0.2); + } + /* warn: this re-allocs blocks! */ scrarea_do_windraw(curarea); ui_redraw_select_panel(curarea); @@ -1568,6 +1619,11 @@ static void ui_drag_panel(uiBlock *block) if(align==0) addqueue(block->win, REDRAW, 1); else ui_animate_panels(curarea); + + /* exception handling, 3d window preview panel */ + if(block->drawextra==BIF_view3d_previewdraw) + BIF_view3d_previewrender_signal(curarea, PR_DISPRECT); + } @@ -1608,7 +1664,7 @@ static void ui_panel_untab(uiBlock *block) pa= pa->next; } - ui_drag_panel(block); + ui_drag_panel(block, 0); break; } @@ -1782,16 +1838,25 @@ void ui_do_panel(uiBlock *block, uiEvent *uevent) } else if(block->panel->flag & PNL_CLOSED) { - ui_drag_panel(block); + ui_drag_panel(block, 0); } /* check if clicked in tabbed area */ else if(uevent->mval[0] < block->maxx-PNL_ICON-3 && panel_has_tabs(block->panel)) { panel_clicked_tabs(block, uevent->mval[0]); } else { - ui_drag_panel(block); + ui_drag_panel(block, 0); } } } +/* panel with scaling widget */ +void ui_scale_panel(uiBlock *block) +{ + if(block->panel->flag & PNL_CLOSED) + return; + + ui_drag_panel(block, 1); +} + diff --git a/source/blender/src/preview.blend.c b/source/blender/src/preview.blend.c new file mode 100644 index 00000000000..d3441287c00 --- /dev/null +++ b/source/blender/src/preview.blend.c @@ -0,0 +1,4634 @@ +/* DataToC output of file */ + +int datatoc_preview_blend_size= 148112; +char datatoc_preview_blend[]= { + 66, 76, 69, 78, 68, 69, 82, 95, 86, 50, 52, 48, 82, 69, 78, 68, + 0, 0, 0, 32,191,255,243, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250,112,114,101,118,105,101,119, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 83, 82, 0, 0, 0,116, 3, 59, 65,112, 0, 0, 0,111, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82,115, 99,114,101,101,110, 0, 45, 83, 99, +114,105,112,116,105,110,103, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 56,232, 64, 3, 54, 11, 96, 3, 54, 11, 0, + 3, 59, 67, 16, 3, 59, 67, 80, 3, 59, 95, 0, 3,152,218, 32, 0, 0, 3,231, 1,143, 4,174, 3,232, 3, 32, 0, 1, 0, 1, + 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, + 3, 56,232, 64, 0, 0, 0,112, 0, 0, 0, 1, 3, 55,114, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 0, 0, 0, 20, 3, 55,114, 48, 0, 0, 0,112, 0, 0, 0, 1, 3, 55,113,208, 3, 56,232, 64, 0, 0, 0, 0, + 0, 0, 3, 32, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 3, 55,113,208, 0, 0, 0,112, 0, 0, 0, 1, 3, 55,113,112, + 3, 55,114, 48, 0, 0, 0, 0, 3,232, 3, 32, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 3, 55,113,112, 0, 0, 0,112, + 0, 0, 0, 1, 3, 54, 11,176, 3, 55,113,208, 0, 0, 0, 0, 3,232, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, + 3, 54, 11,176, 0, 0, 0,112, 0, 0, 0, 1, 3, 54, 11, 96, 3, 55,113,112, 0, 0, 0, 0, 0, 0, 2, 76, 0, 0, 0, 0, + 68, 65, 84, 65, 0, 0, 0, 20, 3, 54, 11, 96, 0, 0, 0,112, 0, 0, 0, 1, 0, 0, 0, 0, 3, 54, 11,176, 0, 0, 0, 0, + 3,232, 2, 76, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 3, 54, 11, 0, 0, 0, 0,113, 0, 0, 0, 1, 3, 58,168,192, + 0, 0, 0, 0, 3, 55,113,208, 3, 55,114, 48, 0, 1, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 3, 58,168,192, + 0, 0, 0,113, 0, 0, 0, 1, 3, 59, 66, 16, 3, 54, 11, 0, 3, 54, 11,176, 3, 55,114, 48, 0, 1, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 0, 0, 0, 24, 3, 59, 66, 16, 0, 0, 0,113, 0, 0, 0, 1, 3, 59, 66, 80, 3, 58,168,192, 3, 54, 11, 96, + 3, 55,113,208, 0, 1, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 3, 59, 66, 80, 0, 0, 0,113, 0, 0, 0, 1, + 3, 59, 66,144, 3, 59, 66, 16, 3, 54, 11, 96, 3, 54, 11,176, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, + 3, 59, 66,144, 0, 0, 0,113, 0, 0, 0, 1, 3, 59, 66,208, 3, 59, 66, 80, 3, 54, 11, 96, 3, 55,113,112, 0, 0, 0, 0, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 3, 59, 66,208, 0, 0, 0,113, 0, 0, 0, 1, 3, 59, 67, 16, 3, 59, 66,144, + 3, 54, 11,176, 3, 56,232, 64, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 3, 59, 67, 16, 0, 0, 0,113, + 0, 0, 0, 1, 0, 0, 0, 0, 3, 59, 66,208, 3, 55,113,112, 3, 56,232, 64, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0,204, 3, 59, 67, 80, 0, 0, 0,115, 0, 0, 0, 1, 3, 59, 95, 0, 0, 0, 0, 0, 3, 54, 11,176, 3, 55,114, 48, + 3, 55,113,208, 3, 54, 11, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 2, 77, 0, 0, 3, 32, 0, 0, 0, 0, + 0, 0, 3,232, 0, 0, 2, 77, 0, 0, 2,103, 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 2,104, 0, 0, 3, 32, 0, 5, 0, 4, + 0, 1, 4, 4, 3,233, 0,185, 1, 0, 1, 1, 1,176, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 59, 92,176, 3, 59, 93,176, 3, 58,217, 0, 3, 58,225, 64, 3, 59, 68, 80, 3, 55,165,112, 68, 65, 84, 65, + 0, 0, 0,164, 3, 59, 68, 80, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 69, 32, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 1, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 73, 48, 0, 0, 0,114, 0, 0, 0, 1, + 3, 59, 74, 0, 3, 59, 72, 96, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 74, 0, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 74,208, 3, 59, 73, 48, + 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0,164, 3, 59, 74,208, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 75,160, 3, 59, 74, 0, 77, 97,112, 32, 84,111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, + 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 3, 59, 74, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 75,160, + 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 76,112, 3, 59, 74,208, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 76,112, 0, 0, 0,114, 0, 0, 0, 1, + 3, 59, 77, 64, 3, 59, 75,160, 76,105,110,107,115, 32, 97,110,100, 32, 80,105,112,101,108,105,110,101, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 77, 64, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 78, 16, 3, 59, 76,112, + 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 79,176, 0, 0, 0,114, 0, 0, 0, 1, + 3, 59, 80,128, 3, 59, 78,224, 77,105,114,114,111,114, 32, 84,114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 3, 59, 78,224, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 80,128, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 81, 80, 3, 59, 79,176, + 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 24, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0,164, 3, 59, 81, 80, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 82, 32, 3, 59, 80,128, 77, 97,112, 32, 73,110,112,117, +116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 24, 0, 0, 1, 62, 0,204, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59, 80,128, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 82, 32, + 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 82,240, 3, 59, 81, 80, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 24, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 59, 80,128, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 82,240, 0, 0, 0,114, 0, 0, 0, 1, + 3, 59, 83,192, 3, 59, 82, 32, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 83,192, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 84,144, 3, 59, 82,240, +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3, 59, 85, 96, + 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 86, 48, 3, 59, 84,144, 83,104, 97,112,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 3, 59, 84,144, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 86, 48, 0, 0, 0,114, 0, 0, 0, 1, + 3, 59, 87, 0, 3, 59, 85, 96, 77,101,115,104, 32, 84,111,111,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 87, 0, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 87,208, 3, 59, 86, 48, + 77,101,115,104, 32, 84,111,111,108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 24, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0,164, 3, 59, 87,208, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 88,160, 3, 59, 87, 0, 80,114,101,118,105,101,119, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 88,160, + 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 89,112, 3, 59, 87,208, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 89,112, 0, 0, 0,114, 0, 0, 0, 1, + 3, 59, 90, 64, 3, 59, 88,160, 77,105,115,116, 32, 47, 32, 83,116, 97,114,115, 32, 47, 32, 80,104,121,115,105, 99,115, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 90, 64, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 91, 16, 3, 59, 89,112, + 65,109, 98, 32, 79, 99, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 3, 59, 89,112, 68, 65, 84, 65, + 0, 0, 0,164, 3, 59, 91, 16, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 91,224, 3, 59, 90, 64, 84,101,120,116,117,114,101, 32, + 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 55,131,240, 0, 0, 0,114, 0, 0, 0, 1, 3, 55,132,192, 3, 56,228, 48, + 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0,164, 3, 55,132,192, 0, 0, 0,114, 0, 0, 0, 1, 3, 58,187, 64, 3, 55,131,240, 67,111,108,111,114,115, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 55,131,240, 68, 65, 84, 65, 0, 0, 0,164, 3, 58,187, 64, + 0, 0, 0,114, 0, 0, 0, 1, 3, 56,230, 16, 3, 55,132,192, 79, 98,106,101, 99,116, 32, 97,110,100, 32, 76,105,110,107,115, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 56,230, 16, 0, 0, 0,114, 0, 0, 0, 1, + 3, 55,160,160, 3, 58,187, 64, 65,110,105,109, 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 55,160,160, 0, 0, 0,114, 0, 0, 0, 1, 3, 55,165,112, 3, 56,230, 16, + 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0,164, 3, 55,165,112, 0, 0, 0,114, 0, 0, 0, 1, 0, 0, 0, 0, 3, 55,160,160, 67,111,110,115,116,114, 97,105, +110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,204, 3, 59, 92,176, + 0, 0, 0, 95, 0, 0, 0, 1, 3, 59, 93,176, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 3, 59, 67, 80, 3, 56,238, 96, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4,193, 0, 0, 0, 68,203,192, 0, +193, 0, 0, 0, 67,104, 0, 0,192,255,255,129, 68,161, 83, 8,193, 0, 0, 0, 67,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0, 66, 40, 0, 0, 69, 0, 0, 0, 67,225, 0, 0, 63, 0, 0, 0, 63,154,225, 72, + 0, 0, 0, 1, 0, 1, 0, 1, 3,233, 0,185, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 3, 3, 59,121, 0,255,255, 0, 0, + 0, 0, 0, 0, 1,150, 0, 0, 1, 51, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 40, 3, 59, 93,176, + 0, 0, 0, 94, 0, 0, 0, 1, 0, 0, 0, 0, 3, 59, 92,176, 0, 0, 0, 2, 63, 51, 51, 51, 3, 59, 67, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, + 63,140,204,205, 63,128, 0, 0, 67,122, 0, 0,192,160, 0, 0, 64,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0,185, 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 16, + 0, 0, 0,185, 60, 35,215, 10, 60, 35,215, 10, 70,106, 96, 0, 70, 28, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,152,242, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, 63,140,204,205, 68, 65, 84, 65, 0, 0, 0,204, 3, 59, 95, 0, 0, 0, 0,115, + 0, 0, 0, 1, 0, 0, 0, 0, 3, 59, 67, 80, 3, 56,232, 64, 3, 54, 11,176, 3, 54, 11, 96, 3, 55,113,112, 0, 0, 0, 0, + 60,190,133,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 41,249,186, 0, 0, 0, 0, 0, 0, 0, 0, +128, 0, 0, 0,128, 0, 0, 0,187,131, 18,111,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 0, 0, 0, 0, 2, 75, 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 0, 0, 0, 0, 0, 26, + 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 0, 27, 0, 0, 2, 75, 0, 7, 0, 6, 0, 1, 1, 1, 3,233, 2, 49, 1, 0, 1, 0, + 2,195, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,152,214, 32, 3, 59,113, 16, + 3, 55,190, 16, 3, 55,190, 16, 3, 59, 96, 0, 3, 59,104,240, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 96, 0, 0, 0, 0,114, + 0, 0, 0, 1, 3, 59, 96,208, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 1, 62, 0,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 96,208, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 97,160, + 3, 59, 96, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 0, 0, 0,164, 3, 59, 97,160, 0, 0, 0,114, 0, 0, 0, 1, 3, 59, 98,112, 3, 59, 96,208, 82,101,110,100, +101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100, +101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,192, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59,100, 16, 0, 0, 0,114, 0, 0, 0, 1, 3, 59,100,224, + 3, 59, 99, 64, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 0, 0, 0,164, 3, 59,100,224, 0, 0, 0,114, 0, 0, 0, 1, 3, 59,101,176, 3, 59,100, 16, 67, 97,109,101, +114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59,103, 80, 0, 0, 0,114, 0, 0, 0, 1, 3, 59,104, 32, + 3, 59,102,128, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 0, 0, 0,164, 3, 59,104, 32, 0, 0, 0,114, 0, 0, 0, 1, 3, 59,104,240, 3, 59,103, 80, 84,101,120,116, +117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 1, 63, 51, 51, 51, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 51, 19, 2,174, +191,127,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 63,127,255,255, 51, 19, 2,174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 19, 2,176, + 63,128, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 0, 1, 51, 19, 2,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 60,190,133,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,195, 56, 91, + 59,131, 18,110, 0, 0, 0, 0, 0, 0, 0, 0, 61, 41,249,185,175, 22,137,234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 66, 43,253,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 93,105,149, + 65,192,199,223, 0, 0, 0, 0, 0, 0, 0, 0, 67,122, 0, 1,183, 15,144,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 60,190,133,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 41,249,186, + 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,187,131, 18,111,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 51, 19, 2,174, +191,127,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 63,127,255,255, 51, 19, 2,174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63, 53, 4,243,191, 53, 4,243, 0, 0, 0, 0, 0, 0, 0, 0, 66, 43,253,156, 0, 0, 0, 1, + 3,152,230, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 1, 0, 0, +255,251, 24, 8, 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 61,175,241, 71, 60, 35,215, 10, 67,250, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 2, + 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,255,255, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,204, 3, 59,105,192, 0, 0, 0, 95, 0, 0, 0, 1, 3, 59,106,192, 3,152,214, 32, + 0, 0, 0, 4, 0, 0, 0, 0, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0, 68,160, 0, 0,196, 46, 0, 0, 67,100, 0, 0, 55,136,197,197, 68, 78,209,118, +195,231,222, 40, 67, 25,158,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0, 66, 40, 0, 0, + 69, 0, 0, 0, 67,225, 0, 0, 63, 0, 0, 0, 63,154,225, 72, 0, 0, 0, 1, 0, 1, 0, 1, 3,233, 2,235, 0, 0, 0, 0, + 0, 3, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 1,150, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 40, 3, 59,106,192, 0, 0, 0, 94, 0, 0, 0, 1, 3, 59,108, 16, 3, 59,105,192, + 0, 0, 0, 2, 63, 51, 51, 51, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, 63,140,204,205, 63,128, 0, 0, 67,122, 0, 0,192,160, 0, 0, + 64,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 2,235, 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 16, 0, 0, 2,235, 60, 35,215, 10, 60, 35,215, 10, 70,106, 96, 0, + 68,122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,152,242, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, 63,140,204,205, + 68, 65, 84, 65, 0, 0, 0,120, 3, 59,108, 16, 0, 0, 0,101, 0, 0, 0, 1, 3, 59,108,176, 3, 59,106,192, 0, 0, 0, 9, + 63, 51, 51, 51, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,123,128, 0, 0, 0, 0, + 0, 0, 0, 62, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 5, 0, 0, 0, 17, 0, 0, 2,225, 0, 0, 2,227, 0, 0, 0, 5, + 0, 0, 0, 17, 0, 0, 2,207, 0, 0, 2,227, 68, 65, 84, 65, 0, 0, 0,188, 3, 59,108,176, 0, 0, 0, 99, 0, 0, 0, 1, + 3, 59,109,160, 3, 59,108, 16, 0, 0, 0, 6, 63, 51, 51, 51, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0, 0, 0, 0, 0, 67,128, 0, 0,190,120, 0, 0, 63,159, 0, 0,190,242, 0, 0, + 63,188,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 1,242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0,196, 3, 59,109,160, 0, 0, 0, 98, 0, 0, 0, 1, 3, 59,110,144, 3, 59,108,176, 0, 0, 0, 3, 63, 51, 51, 51, + 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,195,209, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,195,190, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 1,124, 0, 0, 0, 0, + 0, 0, 1,124,195,190, 0, 0,195,190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1, + 0, 1, 0, 1, 1,108, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,142, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,160, 3, 59,110,144, + 0, 0, 0,168, 0, 0, 0, 1, 3, 59,111, 96, 3, 59,109,160, 0, 0, 0, 11, 63, 51, 51, 51, 3, 59, 95, 0,192,128, 0, 0, + 67,122, 0, 0,192,128, 0, 0, 67,127, 0, 0,192,128, 0, 0, 66, 72, 0, 0,192,128, 0, 0, 67,127, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 1,124, 0, 0, 0, 16, 0, 0, 1,124, 63,128, 0, 0, 67,129,128, 0, 70,250, 0, 0, 67,129,128, 0, 61,204,204,205, + 65, 32, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,164, 3, 59,111, 96, 0, 0, 0,100, 0, 0, 0, 1, 3, 59,112, 48, + 3, 59,110,144, 0, 0, 0, 13, 63, 51, 51, 51, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 68,122, 0, 0, 0, 0, 0, 0, 68,122, 0, 0,192,160, 0, 0, 66,130, 0, 0, + 0, 0, 0, 0, 67,182, 0, 0, 0, 0, 1,108, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0,196, 0, 0, 1,108, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,196, 0, 0, 1,108, 0, 0, 0, 16, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, + 68,122, 0, 0, 68,122, 0, 0, 61,204,204,205, 66, 72, 0, 0, 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 0, 0, 0,176, 3, 59,112, 48, 0, 0, 0,177, 0, 0, 0, 1, 3, 59,113, 16, 3, 59,111, 96, 0, 0, 0, 12, + 63, 51, 51, 51, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 0, 66, 2, 0, 0, +193,128, 0, 0, 67,247, 0, 0,191, 0, 0, 0, 66, 2, 0, 0,193,128, 0, 0, 67,247, 0, 0, 0, 0, 1,108, 0, 0, 1,124, + 0, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0,128, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 1,108, + 0, 0, 0, 16, 0, 0, 2, 14, 0, 0, 0, 0, 0, 0, 0, 0, 70,250, 0, 0, 68,122, 0, 0, 60, 35,215, 10, 66, 72, 0, 0, + 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 84, 3, 59,113, 16, 0, 0, 0, 97, 0, 0, 0, 1, 0, 0, 0, 0, 3, 59,112, 48, + 0, 0, 0, 5, 63, 51, 51, 51, 3, 59, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,101, 83, 97,118,101, 32, 70,105,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101, +114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112,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59,116, 32,192,170, 70, 9, 65,150,211,102, 65, 24,138,188,190, 20, 72, 63, 63,236, 94, 79, + 63,212,186,156,190, 20, 72, 63, 63,236, 94, 79, 63,212,186,156,190, 20, 72, 63, 63,236, 94, 79, 63,212,186,156, 0, 0, 0, 16, + 61,204,204,205, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,117, 96, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,117,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0,250, 0,100, + 0,100, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,128, + 1,224, 0, 60, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 25, 0,141, 2, 88, 2, 88, 0,100, 0,100, 0, 4, + 0, 4, 0, 0, 0, 24, 0, 4, 0, 0, 0, 0, 0, 90, 0, 16, 0, 0, 0, 2, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5, 0, 25, 0, 10, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63, 76,204,205, 63,102,102,102, 63,128, 0, 0, 64,128, 0, 0, 65, 32, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 28, 3, 59,114,224, + 0, 0, 0, 80, 0, 0, 0, 1, 3, 59,115, 48, 3, 59,114,144, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 4, 0, 1, 85, 0,253, + 3,152,234, 32, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,115, 48, 0, 0, 0, 80, 0, 0, 0, 1, 3, 59,115,128, 3, 59,114,224, + 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 1,241, 1, 51, 3,152,250, 32, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,115,128, + 0, 0, 0, 80, 0, 0, 0, 1, 3, 59,115,208, 3, 59,115, 48, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 1,242, 1, 43, + 3,153, 6, 32, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,115,208, 0, 0, 0, 80, 0, 0, 0, 1, 3, 59,116, 32, 3, 59,115,128, + 0, 0, 0, 11, 0, 0, 0, 3, 0, 0, 0, 0, 1,245, 1, 44, 3,152,246, 32, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,116, 32, + 0, 0, 0, 80, 0, 0, 0, 1, 3, 59,116,112, 3, 59,115,208, 0, 0, 0, 27, 0, 0, 0, 4, 0, 0, 4, 1, 1,210, 2, 8, + 3,152,242, 32, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,116,112, 0, 0, 0, 80, 0, 0, 0, 1, 3, 59,116,192, 3, 59,116, 32, + 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 1,229, 1, 56, 3,153, 2, 32, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,116,192, + 0, 0, 0, 80, 0, 0, 0, 1, 3, 59,117, 16, 3, 59,116,112, 0, 0, 0, 31, 0, 0, 0, 5, 0, 0, 4, 0, 2, 45, 1, 75, + 3,152,238, 32, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,117, 16, 0, 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, 0, 3, 59,116,192, + 0, 0, 0, 31, 0, 0, 0, 6, 0, 0, 4, 0, 1,243, 1, 44, 3,152,230, 32, 68, 65, 84, 65, 0, 0, 0, 40, 3, 59,117, 96, + 0, 0, 0, 79, 0, 0, 0, 1, 1, 44, 0, 0, 0, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 1, 1,244, 0,200, 0,100, 0, 20, + 0, 0, 39, 16, 61,204,204,205, 65,240, 0, 0, 64, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 28, 3, 59,117,176, 0, 0, 0, 87, + 0, 0, 0, 1, 0, 1, 0, 1, 0, 90, 0, 9, 0, 1, 0,248, 63,128, 0, 0, 58,131, 18,111, 0, 32, 0, 32, 0, 32, 0, 12, + 0, 0, 67, 65, 0, 0, 0,116, 3, 59,118, 0, 0, 0, 0, 23, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 12, 62, 76,204,205, 0, 0, 0, 0, 61,204,204,205, 66,200, 0, 0, 65,240, 0, 0, 64,234, 14,161, + 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 0,252, 3, 59,118,160, 0, 0, 0, 32, 0, 0, 0, 1, 3, 59,119,208, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 7, 0, 0, 48, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 63,128, 0, 0, 62,241,111,110, 65,239,255,247, 66,150, 0, 0, 62, 25,153,154, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 11, 64, 0, 3, 63,128, 26, 46, 65,240, 4, 25, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 0,252, + 3, 59,119,208, 0, 0, 0, 32, 0, 0, 0, 1, 3, 59,121, 0, 3, 59,118,160, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112, +111,116, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 8, 0, 0, 32, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 65,239,255,247, 66,150, 0, 0, + 62, 25,153,154, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 11, 64, 0, 3, 63,128, 26, 46, 65,240, 4, 25, 66, 52, 0, 0, + 63,128, 0, 0, 64, 64, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 0,252, 3, 59,121, 0, 0, 0, 0, 32, 0, 0, 0, 1, 0, 0, 0, 0, + 3, 59,119,208, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 9, 0, 2, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 63,128, 0, 0, 63,128, 0, 0, 65,239,255,247, 66,134,189, 89, 63, 8,156,171, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 2, 0, 0, 3, 65, 68,207, 78, 65,240, 4, 25, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 0, 0, 0,100, + 3, 59,123,128, 0, 0, 0, 21, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 84,101, +120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 0, 0, 0, 1, 3, 59,124, 16, 3, 59,124, 16, 3, 59,124, 16, 3, 59,124, 16, 0, 0, 0, 0, 0, 0, 0, 0, + 3,152,224, 32,255,255,255,255, 0, 0, 4, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 3, 59,124, 16, 0, 0, 0, 20, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 54,253, 48, 0, 0, 0, 0, 0, 0, 0, 0, 70, 82, 69, 69, 68, 65, 84, 65, + 0, 0, 0, 4, 3, 54,253, 48, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 79, 66, 0, 0, 2,220, 3,152,230, 32, + 0, 0, 0, 72, 0, 0, 0, 1, 3,152,234, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67, 97,109,101,114, 97, + 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +188, 41,199, 78,193, 30,230,225, 63,230,129,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,201, 15,218, + 37,128, 0, 0, 37,127,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 37,127,255,255,165,128, 0, 0, + 0, 0, 0, 0, 37,127,255,255, 51,162, 33,105, 63,128, 0, 0, 0, 0, 0, 0, 37,128, 0, 0,191,128, 0, 0, 51,162, 33,105, + 0, 0, 0, 0,188, 41,199, 78,193, 30,230,225, 63,230,129,216, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,137,145,110, 60, 24,136,133,160, + 0, 0, 0, 0, 25,127,255,254, 63,128, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,165,127,255,255,176,136, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,118,160, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 90,123, 84,192,142, 0, 91,192, 20,182,149, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,103, 90, 85,190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 62,255,247,136, 63, 74, 39, 37, 62,182, 26,138, 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176, + 0, 0, 0, 0, 63, 11,203,251,191, 27, 45,217, 63, 20, 7, 47, 0, 0, 0, 0,193, 90,123, 84,192,142, 0, 91,192, 20,182,149, + 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 62,255,247,135,191, 44, 21,165, 63, 11,203,251, 0, 0, 0, 0, 62,182, 26,138, 63, 59,248,176, 63, 20, 7, 45, + 0, 0, 0, 0,191, 74, 39, 36,189,194, 67, 20, 63, 27, 45,217, 0, 0, 0, 0, 64,124,208, 20,192,213, 69,117, 65, 82,168,235, + 63,128, 0, 0, 0, 0, 0, 31, 4, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, + 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 2,220, 3,152,238, 32, + 0, 0, 0, 72, 0, 0, 0, 1, 3,152,242, 32, 3,152,234, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, + 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,119,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64,158,166,168,193, 49,113, 32, 64,141,166, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,103, 90, 85, +190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,255,247,136, 63, 74, 39, 37, 62,182, 26,138, + 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176, 0, 0, 0, 0, 63, 11,203,251,191, 27, 45,217, 63, 20, 7, 47, + 0, 0, 0, 0, 64,158,166,168,193, 49,113, 32, 64,141,166, 74, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,255,247,138,191, 44, 21,164, 63, 11,203,252, + 0, 0, 0, 0, 62,182, 26,139, 63, 59,248,175, 63, 20, 7, 46, 0, 0, 0, 0,191, 74, 39, 35,189,194, 67, 22, 63, 27, 45,218, + 0, 0, 0, 0,192, 32, 43,120, 63,194,195,233,192,157,225, 9, 63,128, 0, 0, 0, 0, 0, 31, 4, 0, 0, 0, 0, 0, 0, 68, + 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, + 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 2,220, 3,152,242, 32, 0, 0, 0, 72, 0, 0, 0, 1, 3,152,246, 32, 3,152,238, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,121, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 57, 60,242,192, 12,214, 41, 65,165,198, 39, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,189,202,150, 78,190,106, 34, 54, 63,210, 21,188, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,189,140,126,106, 63,120,183,216, 62,104, 25, 82, 0, 0, 0, 0,191,126,132,252,189, 67,160,106,189,196,254, 53, + 0, 0, 0, 0,189,169, 56, 36,190,109,131,118, 63,120, 30, 85, 0, 0, 0, 0,192, 57, 60,242,192, 12,214, 41, 65,165,198, 39, + 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0,189,140,126,123,191,126,132,253,189,169, 56, 56, 0, 0, 0, 0, 62,104, 25, 88,189,196,254, 53, 63,120, 30, 85, + 0, 0, 0, 0,191,120,183,216, 61, 67,160,105, 62,109,131,124, 0, 0, 0, 0,193, 63,245, 23,191, 45,152,205,193,134, 68,185, + 63,128, 0, 0, 0, 0, 0, 27, 4, 1, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, + 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,234,184,168, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 64,234,184,168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,234,184,168, + 0, 0, 0, 0, 62, 42,129, 6, 64, 10, 76, 70, 63,224,238, 21, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 11,154,150, 36, 11,154,149,164, 11,154,150, + 0, 0, 0, 0, 35,208, 20,224, 50, 48,212, 20, 62, 11,154,150, 0, 0, 0, 0, 46,229, 96, 14,190, 11,154,150, 50, 46, 47, 96, + 0, 0, 0, 0,188,197,136,191,191,211, 4, 23, 59,194,166, 86, 63,128, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, + 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 86,211,235, 64, 86,211,232, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,209,255, 6,190,200, 64, 93, 63, 41, 50, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 64, 28,200,191, 63,243,211, 29, 63,163,203, 32, 0, 0, 0, 0,192, 18,182,139, 64, 7,122,207, 63,158, 98,192, + 0, 0, 0, 0,189,214,156, 60,191,227,115,184, 64, 54, 34, 4, 0, 0, 0, 0,190,128,229, 16, 64, 34, 43, 64, 64, 25, 22,237, + 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 62, 94,163,153,190, 80, 86,110,188, 24, 96,158, 0, 0, 0, 0, 61,232,151,178, 61,224,233,205, 62,129, 81, 75, + 0, 0, 0, 0,190, 45, 30,172,190, 64, 98,200, 62, 33,126,180, 0, 0, 0, 0,192, 7,207,232,192, 29, 46,151, 63,232, 60, 1, + 63,128, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, + 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 55, 39,112, 60,149,192, 57,191,103,204, 21, + 63,230,165,241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,155, 39,153, + 64,155, 39,153, 64,155, 39,153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,201, 15,218, 37,192, 0, 0, 36,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,155, 39,153, 38, 27, 39,152,166,232,187,102, 0, 0, 0, 0, 38,232,187,102, + 52,196,134,157, 64,155, 39,153, 0, 0, 0, 0, 38, 27, 39,154,192,155, 39,153, 52,196,134,157, 0, 0, 0, 0, 60,149,192, 57, +191,103,204, 21, 63,230,165,241, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 83, 50, 25, 35,211, 50, 28,163,211, 50, 23, 0, 0, 0, 0,163,211, 50, 27, + 62, 83, 50, 25, 38,174, 59,158, 0, 0, 0, 0, 43,109, 64, 0,175, 96, 79,158, 62, 83, 50, 25, 0, 0, 0, 0,187,193,146,253, +185,110, 94,217, 63,238, 71,118, 63,128, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, + 79, 66, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, + 63,128, 0, 0, 62,204,204,205, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0, 4, 3, 55, 39,112, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 2,220, 3,153, 2, 32, + 0, 0, 0, 72, 0, 0, 0, 1, 3,153, 6, 32, 3,152,254, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101, +119, 46, 48, 48, 50, 0, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,129,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,124, 80, 3, 59,124, 80, 3, 55, 8, 96, +191,155,194,150, 63,165,215, 50, 64, 52,152, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 65, 50,249, 88, 65, 50,249, 90, 65, 50,249, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,163, 13,190, + 62,170,212,237,191, 14,142,222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 15,142, 5,192,178,192,180,192,106,116,153, + 0, 0, 0, 0, 64,150,132, 32, 63,109, 78, 95, 65, 33,180, 10, 0, 0, 0, 0,192,151,201,228,193, 26, 89, 80, 64, 69,234,108, + 0, 0, 0, 0,191,155,194,150, 63,165,215, 50, 64, 52,152, 12, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,146,218,202, 61, 25,249,216,189, 27, 71, 31, + 0, 0, 0, 0,188,239,216, 77, 61,165,107,151, 60,202,119, 22, 0, 0, 0, 0, 61, 54,220,153,187,242,194,197, 61,157,229,156, + 0, 0, 0, 0, 63, 30, 28,147,189,246, 87, 4, 63, 75,107,128, 63,128, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, + 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 58,186, 16, + 3, 58,227, 32, 68, 65, 84, 65, 0, 0, 0, 4, 3, 55, 8, 96, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0, 68, 3, 59,124, 80, 0, 0, 0, 56, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 23, + 83,117, 98,115,117,114,102, 0, 0, 0, 0, 0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, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 76, 39,227, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 51,129, 75,227, 63, 76, 39,227, 0, 0, 0, 0, 0, 0, 0, 0,191, 76, 39,227, 51,129, 75,227, + 0, 0, 0, 0,190, 20, 72, 63, 63,236, 94, 79, 63,212,186,156, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,160,129, 63,165,160,129, 62,165,160,129, 63, + 0, 0, 0, 0, 37,160,129, 63, 63,160,129, 63, 40, 73, 67,160, 0, 0, 0, 0, 48, 3,174, 26,175,163, 58, 36, 63,160,129, 63, + 0, 0, 0, 0, 62, 44,161,191, 62, 50, 87,173, 65,108, 77,158, 63,128, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0,201,150,180, 56, + 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 0, 4, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 63,110,188, 91, 63,110,188, 91, 63,110,188, 91, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,201, 15,218,128, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,110,188, 91, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,151, 50, 90, 63,110,188, 91, 0, 0, 0, 0, 0, 0, 0, 0, +191,110,188, 91, 51,151, 50, 90, 0, 0, 0, 0, 58, 10, 31, 0, 63,236, 94, 59, 63,231, 84,236, 63,128, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,137, 65,160, +165,137, 65,159,165,137, 65,161, 0, 0, 0, 0, 37,137, 65,160, 63,137, 65,160, 40, 19, 46,157, 0, 0, 0, 0, 45, 14,127,248, +176,150,195,159, 63,137, 65,161, 0, 0, 0, 0,188, 63, 80, 29,187,226, 95, 62, 65, 74, 19, 87, 63,128, 0, 0, 0, 0, 0, 16, + 4, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, + 0, 0, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 0, 0, 0, 0, 61,204,204,205, + 0, 0, 0, 0, 4, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 55,126, 16, 3, 55,131, 80, 68, 65, 84, 65, 0, 0, 0, 4, 3, 54,238,240, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 77, 65, 0, 0, 1,164, 3, 59,124,192, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 77, 65,112,114,101,118,105,101,119, 0, 0, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63, 54,232, 61, 63, 23,161,184, 63,128, 0, 0, 63,128, 0, 0, + 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 76,204,205, 63, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, + 0, 50, 0, 6, 3, 17, 0, 3, 3, 17, 0, 3, 0, 1, 0, 4, 0, 12, 0, 4, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 2, + 0, 0, 0, 0, 63, 0, 0, 0, 64,128, 0, 0, 63, 0, 0, 0, 61,204,204,205, 63, 0, 0, 0, 61,204,204,205, 61,204,204,205, + 63,128, 0, 0, 8, 1, 0, 1, 3, 59,127, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 3, 59,126,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, + 0, 0, 0, 88, 3, 59,126,144, 0, 0, 0, 25, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,128,192, + 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 16, 0, 0, + 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, + 62, 76,204,205, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1,136, 3, 59,127, 16, 0, 0, 0, 28, 0, 0, 0, 1, 0, 0, 0, 2, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,220, 40,245, 0, 0, 0, 0, 63,125,112,164, + 63,128, 0, 0, 63, 24,214,106, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 1, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, + 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, + 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, + 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, + 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, + 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, + 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, + 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 84, 69, 0, 0, 0,228, 3, 59,128,192, 0, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 1, 5, 62,128, 0, 0, 64,160, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 32, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 5, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1, + 0, 3, 0, 0, 0, 0, 0, 0, 60,204,204,205, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, + 0, 0, 0,188, 3, 59,129,208, 0, 0, 0, 47, 0, 0, 0, 1, 3, 59,130,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 69, 67,117, 98,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 3, 58,185,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 57, 0,144, 3,153, 98, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 3,153, 10, 32, 3,153, 50, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1,251, 0, 0, 3,237, 0, 0, 1,244, 0, 0, 0, 1, 61, 88,133,192,189, 85, 45,184,190, 24,181,196, + 63, 35, 71,185, 62,235, 31,153, 62,203,102,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 30, 0, 4, 0, 1, 0, 1, 0, 1, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 3, 57, 0,144, 0, 0, 0, 0, 0, 0, 0, 1, + 3, 59,124,192, 68, 65, 84, 65, 0, 0, 39,156, 3,153, 10, 32, 0, 0, 0, 52, 0, 0, 1,251, 62,131,144,140, 60,200,163,119, + 62, 85, 9,156, 92,125,170, 70, 21,228, 1,255,190, 26,222, 50, 60,200,163,119, 62, 85, 9,156,163,131,170, 70, 21,228, 1,255, + 62,146,126, 61,188, 8, 37,223, 62, 47,183, 99, 76,247,194,191, 81,228, 3,255,190, 56,185,147,188, 8, 37,223, 62, 47,183, 99, +179, 9,194,191, 81,228, 3,255, 62,157,176,129,188,217, 91,211, 61,246,238,244, 84, 31,181,226, 61,191, 3,255,190, 79, 30, 28, +188,217, 91,211, 61,246,238,244,171,225,181,226, 61,191, 3,255, 62, 94, 19,115,189,128,251,103, 62, 14, 32,150, 9,241,144,155, + 62, 64, 3,255,189,227,161, 26,189,128,251,103, 62, 14, 32,150,246, 15,144,155, 62, 64, 3,255, 62, 94, 19,115,189, 25,118,251, + 62, 62,165, 20, 14,184,163,144, 87, 76, 3,255,189,227,161, 26,189, 25,118,251, 62, 62,165, 20,241, 72,163,144, 87, 76, 3,255, + 62, 94, 19,115, 60, 34,107,232, 62, 92,128,116, 3, 3,131,121, 29,110, 1,255,189,227,161, 26, 60, 34,107,232, 62, 92,128,116, +252,253,131,121, 29,110, 1,255, 62, 56,193, 58, 60,200,163,119, 62, 99,247, 77,171, 56,167,117, 36,206, 1,255,189,152,252,168, + 60,200,163,119, 62, 99,247, 77, 84,200,167,117, 36,206, 1,255, 62, 23, 42,109,188, 8, 37,223, 62, 73,215, 88,200,184,189,130, + 94, 93, 3,255,189, 43,158, 31,188, 8, 37,223, 62, 73,215, 88, 55, 72,189,130, 94, 93, 3,255, 62, 0,197,229,188,217, 91,211, + 62, 29, 14, 71,184,179,175, 93, 69, 66, 3,255,188,164, 23,249,188,217, 91,211, 62, 29, 14, 71, 71, 77,175, 93, 69, 66, 3,255, + 61,182,231, 88, 61,121,154,159, 62, 32,201,179,151,181,255,104, 74, 51, 3,255, 60,134,121,207, 61,121,154,159, 62, 32,201,179, +104, 75,255,104, 74, 51, 3,255, 61,242,158, 25, 61,121,154,159, 62, 73,215, 88,171, 78,255,150, 95,246, 3,255,188, 80,194,110, + 61,121,154,159, 62, 73,215, 88, 84,178,255,150, 95,246, 3,255, 62, 41,211,138, 61,121,154,159, 62, 99,247, 77,133,152,254,153, + 37, 98, 1,255,189,118, 66,143, 61,121,154,159, 62, 99,247, 77,122,104,254,153, 37, 98, 1,255, 62, 56,193, 58, 61,206,232,154, + 62, 99,247, 77,170, 24, 88, 13, 35, 89, 1,255,189,152,252,168, 61,206,232,154, 62, 99,247, 77, 85,232, 88, 13, 35, 89, 1,255, + 62, 23, 42,109, 62, 5, 79,173, 62, 73,215, 88,200,249, 65,221, 94,244, 3,255,189, 43,158, 31, 62, 5, 79,173, 62, 73,215, 88, + 55, 7, 65,221, 94,244, 3,255, 62, 0,197,229, 62, 27,180, 54, 62, 29, 14, 71,186, 51, 78, 86, 73, 78, 3,255,188,164, 23,249, + 62, 27,180, 54, 62, 29, 14, 71, 69,205, 78, 86, 73, 78, 3,255, 62, 94, 19,115, 62, 65, 6,111, 62, 14, 32,150, 11, 2,107,152, + 68,114, 3,255,189,227,161, 26, 62, 65, 6,111, 62, 14, 32,150,244,254,107,152, 68,114, 3,255, 62, 94, 19,115, 62, 35, 43, 14, + 62, 62,165, 20, 14,201, 91,180, 88, 14, 3,255,189,227,161, 26, 62, 35, 43, 14, 62, 62,165, 20,241, 55, 91,180, 88, 14, 3,255, + 62, 94, 19,115, 61,236,195,250, 62, 92,128,116, 2,134,125, 29, 26,228, 1,255,189,227,161, 26, 61,236,195,250, 62, 92,128,116, +253,122,125, 29, 26,228, 1,255, 62,131,144,140, 61,206,232,154, 62, 85, 9,156, 93, 54, 85, 67, 20,154, 1,255,190, 26,222, 50, + 61,206,232,154, 62, 85, 9,156,162,202, 85, 67, 20,154, 1,255, 62,146,126, 61, 62, 5, 79,173, 62, 47,183, 99, 76,241, 60,161, + 82, 97, 3,255,190, 56,185,147, 62, 5, 79,173, 62, 47,183, 99,179, 15, 60,161, 82, 97, 3,255, 62,157,176,129, 62, 27,180, 54, + 61,246,238,244, 83,179, 71,157, 65, 45, 3,255,190, 79, 30, 28, 62, 27,180, 54, 61,246,238,244,172, 77, 71,157, 65, 45, 3,255, + 62,176, 89,157, 61,121,154,159, 61,232, 1, 67,111, 40,255,113, 63,117, 3,255,190,116,112, 84, 61,121,154,159, 61,232, 1, 67, +144,216,255,113, 63,117, 3,255, 62,161,107,237, 61,121,154,159, 62, 40, 64,139,100, 48,255,154, 79,167, 3,255,190, 86,148,244, + 61,121,154,159, 62, 40, 64,139,155,208,255,154, 79,167, 3,255, 62,139, 7,100, 61,121,154,159, 62, 81, 78, 48,126,117,254,181, + 19,185, 1,255,190, 41,203,227, 61,121,154,159, 62, 81, 78, 48,129,139,254,181, 19,185, 1,255, 62,140,229, 26, 61,121,154,159, + 62, 88,197, 8,120,160,254,106, 42,198, 3,255,190, 45,135, 79, 61,121,154,159, 62, 88,197, 8,135, 96,254,106, 42,198, 3,255, + 62,133,110, 66, 61,214, 95,114, 62, 92,128,116, 93,173, 74,126, 45, 93, 3,255,190, 30,153,158, 61,214, 95,114, 62, 92,128,116, +162, 83, 74,126, 45, 93, 3,255, 62, 94, 19,115, 61,251,177,170, 62,103,178,185, 11, 9,115, 31, 54,216, 3,255,189,227,161, 26, + 61,251,177,170, 62,103,178,185,244,247,115, 31, 54,216, 3,255, 62, 53, 5,206, 61,214, 95,114, 62,111, 41,145,181, 9, 80,184, + 65, 43, 3,255,189,145,133,208, 61,214, 95,114, 62,111, 41,145, 74,247, 80,184, 65, 43, 3,255, 62, 34, 92,178, 61,121,154,159, + 62,111, 41,145,146,116,254, 57, 66, 43, 3,255,189, 88,103, 48, 61,121,154,159, 62,111, 41,145,109,140,254, 57, 66, 43, 3,255, + 62, 53, 5,206, 60,170,200, 22, 62,111, 41,145,182, 34,173,181, 64,115, 3,255,189,145,133,208, 60,170,200, 22, 62,111, 41,145, + 73,222,173,181, 64,115, 3,255, 62, 94, 19,115, 61,121,154,159, 62,114,228,253, 24, 74,255,139,125,171, 3,255,189,227,161, 26, + 61,121,154,159, 62,114,228,253,231,182,255,139,125,171, 3,255, 62, 94, 19,115, 59, 43,249,149, 62,103,178,185, 10,218,140,140, + 54, 45, 3,255,189,227,161, 26, 59, 43,249,149, 62,103,178,185,245, 38,140,140, 54, 45, 3,255, 62,133,110, 66, 60,170,200, 22, + 62, 92,128,116, 92,141,179,203, 44,210, 3,255,190, 30,153,158, 60,170,200, 22, 62, 92,128,116,163,115,179,203, 44,210, 3,255, + 61, 88,133,203, 62, 23,248,202, 62, 73,215, 88, 0, 0,124, 43, 31, 17, 1,255, 61, 88,133,203, 61,229, 77, 34, 62,111, 41,145, + 0, 0,249, 63,127,209, 1,255, 61, 88,133,203,190,188,254,150, 62, 70, 27,236, 0, 0,251,204,127,237, 1,255, 61, 88,133,203, +190, 78, 79,191, 62, 92,128,116, 0, 0,150, 33, 71,238, 3,255, 61, 88,133,203,190, 14,221,146, 62, 99,247, 77, 0, 0,100, 28, + 79,192, 1,255, 61, 88,133,203,190,211, 99, 30, 62, 62,165, 20, 0, 0,142,184, 59,147, 3,255, 61, 88,133,203, 62, 12,198,133, + 62, 6,169,190, 0, 0,103,143, 75, 57, 1,255, 61, 88,133,203, 62, 91, 38, 99, 61,239,120, 28, 0, 0, 78,115,101, 34, 1,255, + 61, 88,133,203, 62,187,243, 16,190,206,250,170, 0, 0,110,190,191,212, 3,255, 61, 88,133,203, 62, 87,106,247,191, 11,224,178, + 0, 0, 35,144,133, 12, 3,255, 61, 88,133,203,188,157,165, 18,191, 9, 20, 33, 0, 0,214,194,134,213, 3,255, 61, 88,133,203, +190,108, 43, 32,190,160, 83,227, 0, 0,134,154,215,113, 3,255, 62, 23, 42,109,190, 14,221,146, 61,232, 1, 67,113,144,198,122, + 13, 79, 1,255,189, 43,158, 31,190, 14,221,146, 61,232, 1, 67,142,112,198,122, 13, 79, 1,255, 62, 75,106, 87,190,131, 37,138, + 61,239,120, 28,122,196, 31, 19, 18,152, 3,255,189,190, 78,225,190,131, 37,138, 61,239,120, 28,133, 60, 31, 19, 18,152, 3,255, + 62, 94, 19,115,190,192,186, 2, 61,239,120, 28,125,167, 12,146, 20,226, 1,255,189,227,161, 26,190,192,186, 2, 61,239,120, 28, +130, 89, 12,146, 20,226, 1,255, 62,101,138, 75,190,239, 96,200, 61,202, 37,227,124,113,242,142, 26,196, 3,255,189,242,142,203, +190,239, 96,200, 61,202, 37,227,131,143,242,142, 26,196, 3,255, 62, 82,225, 47,190,252,112,195, 61,194,175, 10, 79,159,159, 44, + 25,210, 3,255,189,205, 60,146,190,252,112,195, 61,194,175, 10,176, 97,159, 44, 25,210, 3,255, 62, 11,248, 41,191, 1, 4,242, + 61,224,138,107, 19,143,131, 13, 19,178, 3,255,188,253,170, 27,191, 1, 4,242, 61,224,138,107,236,113,131, 13, 19,178, 3,255, + 61, 88,133,203,191, 2,226,168, 61,246,238,244, 0, 0,130, 75, 24, 21, 3,255, 62,131,144,140,189,240,242, 18, 61,202, 37,227, + 47,114,137,117, 8,232, 3,255,190, 26,222, 50,189,240,242, 18, 61,202, 37,227,208,142,137,117, 8,232, 3,255, 62,178, 55, 83, +189,143,233, 23, 61,209,156,187, 77, 25,154,198, 13,214, 3,255,190,120, 43,193,189,143,233, 23, 61,209,156,187,178,231,154,198, + 13,214, 3,255, 62,224,222, 26, 60,140,236,182, 61,112, 21, 49,113,216,198,247, 12,255, 3,255,190,170,188,167, 60,140,236,182, + 61,112, 21, 49,142, 40,198,247, 12,255, 3,255, 62,232, 84,243, 62, 23,248,202, 62, 2,238, 82,113,104, 51, 31, 30, 32, 3,255, +190,178, 51,128, 62, 23,248,202, 62, 2,238, 82,142,152, 51, 31, 30, 32, 3,255, 62,196,224,112, 62, 50, 24,190, 62, 17,220, 2, + 64,216,106,225, 27,121, 1,255,190,142,190,253, 62, 50, 24,190, 62, 17,220, 2,191, 40,106,225, 27,121, 1,255, 62,144,160,134, + 62,106, 20, 20, 62, 47,183, 99, 75,137,101, 82, 20, 70, 1,255,190, 52,254, 39, 62,106, 20, 20, 62, 47,183, 99,180,119,101, 82, + 20, 70, 1,255, 62, 79, 37,195, 62,154, 92, 67, 62, 70, 27,236, 38,241,119, 19, 26, 54, 3,255,189,197,197,186, 62,154, 92, 67, + 62, 70, 27,236,217, 15,119, 19, 26, 54, 3,255, 62, 0,197,229, 62,145, 7,181, 62, 81, 78, 48,175, 21, 96, 54, 24, 12, 3,255, +188,164, 23,249, 62,145, 7,181, 62, 81, 78, 48, 80,235, 96, 54, 24, 12, 3,255, 61,167,249,168, 62, 53,212, 42, 62, 77,146,196, +155,174, 76,128, 21,151, 1,255, 60,194, 48,144, 62, 53,212, 42, 62, 77,146,196,100, 82, 76,128, 21,151, 1,255, 62, 4,129, 81, + 62, 16,129,241, 62, 88,197, 8, 25, 0,237, 4,124, 22, 1,255,188,193,243, 89, 62, 16,129,241, 62, 88,197, 8,231, 0,237, 4, +124, 22, 1,255, 61,227,176,105, 61,184,132, 17, 62, 85, 9,156,255,160,232,126,125,209, 1,255,187,178,169,214, 61,184,132, 17, + 62, 85, 9,156, 0, 96,232,126,125,209, 1,255, 62, 23, 42,109,188, 8, 37,223, 62, 73,215, 88,238, 27,221,135,121,245, 1,255, +189, 43,158, 31,188, 8, 37,223, 62, 73,215, 88, 17,229,221,135,121,245, 1,255, 62,105, 69,184,189, 55, 82, 92, 62, 55, 46, 59, + 34,106,200,119,110, 16, 1,255,189,250, 5,163,189, 55, 82, 92, 62, 55, 46, 59,221,150,200,119,110, 16, 1,255, 62,144,160,134, +188,187,128,115, 62, 40, 64,139, 55,161,207, 60,104,115, 1,255,190, 52,254, 39,188,187,128,115, 62, 40, 64,139,200, 95,207, 60, +104,115, 1,255, 62,176, 89,157, 61, 17, 26,205, 62, 29, 14, 71, 58,181,226,123,109,214, 1,255,190,116,112, 84, 61, 17, 26,205, + 62, 29, 14, 71,197, 75,226,123,109,214, 1,255, 62,180, 21, 9, 61,177, 13, 57, 62, 29, 14, 71, 49,157,230, 61,115, 36, 1,255, +190,123,231, 45, 61,177, 13, 57, 62, 29, 14, 71,206, 99,230, 61,115, 36, 1,255, 62,170,192,123, 61,251,177,170, 62, 36,133, 31, + 39,206,234,175,119,196, 1,255,190,105, 62, 16, 61,251,177,170, 62, 36,133, 31,216, 50,234,175,119,196, 1,255, 62,129,178,214, + 62, 27,180, 54, 62, 62,165, 20, 24, 62,255, 85,125,173, 1,255,190, 23, 34,198, 62, 27,180, 54, 62, 62,165, 20,231,194,255, 85, +125,173, 1,255, 62, 45,142,246, 62, 42,161,230, 62, 81, 78, 48, 31,251,247, 40,123,158, 1,255,189,130,152, 32, 62, 42,161,230, + 62, 81, 78, 48,224, 5,247, 40,123,158, 1,255, 61, 88,133,203,190,209,133,104, 62, 70, 27,236, 0, 0,210,148,119,170, 1,255, + 61,212,194,185,190,198, 83, 36, 62, 70, 27,236, 19, 39,222, 65,121,248, 1,255, 58,240,196,191,190,198, 83, 36, 62, 70, 27,236, +236,217,222, 65,121,248, 1,255, 61,220, 57,145,190,226, 80,207, 62, 58,233,167, 2,134,217,132,122, 12, 1,255,186,236,241, 77, +190,226, 80,207, 62, 58,233,167,253,122,217,132,122, 12, 1,255, 61,167,249,168,190,237,131, 19, 62, 51,114,207,252, 13,214,169, +121, 18, 1,255, 60,194, 48,144,190,237,131, 19, 62, 51,114,207, 3,243,214,169,121, 18, 1,255, 61, 88,133,203,190,239, 96,200, + 62, 47,183, 99, 0, 0,219,150,122,180, 1,255, 61, 88,133,203,190, 18,152,254, 62, 77,146,196, 0, 0, 97, 46, 83, 76, 1,255, + 61, 88,133,203,189,240,242, 18, 62, 73,215, 88, 0, 0,104,197, 73,134, 1,255, 61,205, 75,225,189,248,104,235, 62, 73,215, 88, + 36, 52, 53, 2,110,187, 1,255, 59,179,158,179,189,248,104,235, 62, 73,215, 88,219,204, 53, 2,110,187, 1,255, 61,227,176,105, +190, 33,134,174, 62, 77,146,196, 95,187,212, 14, 72,182, 1,255,187,178,169,214,190, 33,134,174, 62, 77,146,196,160, 69,212, 14, + 72,182, 1,255, 61,190, 94, 48,190, 63, 98, 15, 62, 73,215, 88, 64,117,207,117, 99, 90, 1,255, 60, 81, 60,220,190, 63, 98, 15, + 62, 73,215, 88,191,139,207,117, 99, 90, 1,255, 62,116,119,252,189,151, 95,239, 62, 40, 64,139, 49,103,196,157,102, 13, 1,255, +190, 8, 53, 22,189,151, 95,239, 62, 40, 64,139,206,153,196,157,102, 13, 1,255, 62,174,123,231,188,217, 91,211, 62, 17,220, 2, + 59,142,204,107,100,223, 3,255,190,112,180,232,188,217, 91,211, 62, 17,220, 2,196,114,204,107,100,223, 3,255, 62,200,155,220, + 61, 46,246, 45, 62, 6,169,190, 66,102,217, 11,102, 65, 1,255,190,146,122,105, 61, 46,246, 45, 62, 6,169,190,189,154,217, 11, +102, 65, 1,255, 62,204, 87, 72, 61,251,177,170, 62, 32,201,179, 54, 87,228,142,112,151, 1,255,190,150, 53,213, 61,251,177,170, + 62, 32,201,179,201,169,228,142,112,151, 1,255, 62,191, 71, 78, 62, 16,129,241, 62, 66, 96,128, 42, 82,247, 97,120,125, 3,255, +190,137, 37,219, 62, 16,129,241, 62, 66, 96,128,213,174,247, 97,120,125, 3,255, 62,131,144,140, 62, 79,244, 31, 62, 99,247, 77, + 41,192,254,216,120,253, 1,255,190, 26,222, 50, 62, 79,244, 31, 62, 99,247, 77,214, 64,254,216,120,253, 1,255, 62, 75,106, 87, + 62,124,189, 48, 62,118,160,105, 28,217, 7, 53,124,126, 1,255,189,190, 78,225, 62,124,189, 48, 62,118,160,105,227, 39, 7, 53, +124,126, 1,255, 62, 23, 42,109, 62,113,138,236, 62,126, 23, 65,255,125, 5, 44,127,227, 1,255,189, 43,158, 31, 62,113,138,236, + 62,126, 23, 65, 0,131, 5, 44,127,227, 1,255, 61,205, 75,225, 62, 23,248,202, 62,122, 91,213,238,130, 2, 89,126,197, 1,255, + 59,179,158,179, 62, 23,248,202, 62,122, 91,213, 17,126, 2, 89,126,197, 1,255, 61,227,176,105,189,203,159,217, 62,107,110, 37, + 23,115,230, 27,123, 34, 1,255,187,178,169,214,189,203,159,217, 62,107,110, 37,232,141,230, 27,123, 34, 1,255, 62, 26,229,218, +190,133, 3, 64, 62, 58,233,167, 74,212, 14, 28,102,225, 3,255,189, 58,139,207,190,133, 3, 64, 62, 58,233,167,181, 44, 14, 28, +102,225, 3,255, 62, 45,142,246,190,194,151,184, 62, 47,183, 99, 72,235,252, 17,105, 31, 3,255,189,130,152, 32,190,194,151,184, + 62, 47,183, 99,183, 21,252, 17,105, 31, 3,255, 62, 53, 5,206,190,222,149, 99, 62, 36,133, 31, 66,179,225,197,104,249, 3,255, +189,145,133,208,190,222,149, 99, 62, 36,133, 31,189, 77,225,197,104,249, 3,255, 62, 38, 24, 30,190,244,249,234, 62, 21,151,111, + 44, 62,183, 4, 95, 98, 3,255,189,103, 84,224,190,244,249,234, 62, 21,151,111,211,194,183, 4, 95, 98, 3,255, 62, 4,129, 81, +190,248,181, 86, 62, 21,151,111, 19,155,158, 52, 80, 54, 3,255,188,193,243, 89,190,248,181, 86, 62, 21,151,111,236,101,158, 52, + 80, 54, 3,255, 61, 88,133,203,190,252,112,195, 62, 25, 82,219, 0, 0,154,201, 78, 88, 3,255, 61, 88,133,203,188,247, 55, 52, + 62, 66, 96,128, 0, 0,252, 2,127,239, 1,255, 61, 88,133,203, 61, 61,227,222, 62, 85, 9,156, 0, 0,227,112,124,196, 1,255, + 62, 82,225, 47, 62, 46, 93, 82, 62, 73,215, 88, 21, 58,254,234,126, 56, 1,255,189,205, 60,146, 62, 46, 93, 82, 62, 73,215, 88, +234,198,254,234,126, 56, 1,255, 62, 4,129, 81, 60, 94, 34,170, 62, 77,146,196,214, 37,232,110,118,163, 1,255,188,193,243, 89, + 60, 94, 34,170, 62, 77,146,196, 41,219,232,110,118,163, 1,255, 61,235, 39, 65, 61, 61,227,222, 62, 81, 78, 48,232,150,230,127, +123, 57, 1,255,188, 21, 11,173, 61, 61,227,222, 62, 81, 78, 48, 23,106,230,127,123, 57, 1,255, 61,220, 57,145,190,190,220, 76, + 62, 70, 27,236, 20,117,248,197,126, 36, 1,255,186,236,241, 77,190,190,220, 76, 62, 70, 27,236,235,139,248,197,126, 36, 1,255, + 61,182,231, 88,190,133, 3, 64, 62, 77,146,196, 19, 43, 0,128,126,141, 3,255, 60,134,121,207,190,133, 3, 64, 62, 77,146,196, +236,213, 0,128,126,141, 3,255, 61, 88,133,203,190,133, 3, 64, 62, 77,146,196, 0, 0,255,122,127,254, 1,255, 61, 88,133,203, +190, 82, 11, 43, 62, 73,215, 88, 0, 0,184,121,106, 36, 1,255, 61,197,213, 8,190, 55,235, 55, 62, 92,128,116, 66,167,160,139, + 53, 45, 3,255, 60, 21,134, 27,190, 55,235, 55, 62, 92,128,116,189, 89,160,139, 53, 45, 3,255, 61,235, 39, 65,190, 33,134,174, + 62, 99,247, 77,118,133,224,215, 36,239, 3,255,188, 21, 11,173,190, 33,134,174, 62, 99,247, 77,137,123,224,215, 36,239, 3,255, + 61,212,194,185,189,233,123, 57, 62, 92,128,116, 81,167, 95,141, 24, 49, 3,255, 58,240,196,191,189,233,123, 57, 62, 92,128,116, +174, 89, 95,141, 24, 49, 3,255, 61,145,149, 31,189,226, 4, 97, 62, 92,128,116,200,189,108,160, 39, 26, 3,255, 61, 13,225, 89, +189,226, 4, 97, 62, 92,128,116, 55, 67,108,160, 39, 26, 3,255, 61, 88,133,203,190, 22, 84,106, 62,114,228,253, 0, 0, 23, 42, +125,225, 1,255, 61,153, 11,247,189,248,104,235, 62,107,110, 37,231,186, 78, 89, 98, 66, 3,255, 60,253,231, 82,189,248,104,235, + 62,107,110, 37, 24, 70, 78, 89, 98, 66, 3,255, 61,197,213, 8,189,255,223,195, 62,107,110, 37, 43, 88, 62,134,102,237, 3,255, + 60, 21,134, 27,189,255,223,195, 62,107,110, 37,212,168, 62,134,102,237, 3,255, 61,212,194,185,190, 33,134,174, 62,114,228,253, + 46,247,233, 89,116,228, 3,255, 58,240,196,191,190, 33,134,174, 62,114,228,253,209, 9,233, 89,116,228, 3,255, 61,182,231, 88, +190, 44,184,243, 62,103,178,185, 31, 46,181,198, 99,128, 3,255, 60,134,121,207,190, 44,184,243, 62,103,178,185,224,210,181,198, + 99,128, 3,255, 61, 88,133,203,190, 63, 98, 15, 62,103,178,185, 0, 0,191,185,110,175, 3,255, 62, 49, 74, 98,190, 74,148, 83, + 61,224,138,107,120, 23, 41, 34, 16, 99, 1,255,189,138, 14,248,190, 74,148, 83, 61,224,138,107,135,233, 41, 34, 16, 99, 1,255, + 62, 4,129, 81,190, 40,253,134, 62, 58,233,167, 80,251,250, 26, 98,241, 1,255,188,193,243, 89,190, 40,253,134, 62, 58,233,167, +175, 5,250, 26, 98,241, 1,255, 62, 11,248, 41,190, 74,148, 83, 62, 58,233,167, 83,215, 16,153, 95, 71, 1,255,188,253,170, 27, +190, 74,148, 83, 62, 58,233,167,172, 41, 16,153, 95, 71, 1,255, 62, 38, 24, 30,190, 44,184,243, 61,224,138,107,122, 24, 35, 67, + 15, 64, 1,255,189,103, 84,224,190, 44,184,243, 61,224,138,107,133,232, 35, 67, 15, 64, 1,255, 61, 88,133,203,190,235,165, 93, + 62, 47,183, 99, 0, 0, 86,139, 94, 77, 1,255, 61,153, 11,247,190,233,199,167, 62, 47,183, 99,206,144, 70,200, 94,125, 1,255, + 60,253,231, 82,190,233,199,167, 62, 47,183, 99, 49,112, 70,200, 94,125, 1,255, 61,197,213, 8,190,222,149, 99, 62, 58,233,167, +164,253, 17,109, 88, 75, 1,255, 60, 21,134, 27,190,222,149, 99, 62, 58,233,167, 91, 3, 17,109, 88, 75, 1,255, 61,197,213, 8, +190,203,236, 70, 62, 66, 96,128,225,141,168, 87, 88, 39, 1,255, 60, 21,134, 27,190,203,236, 70, 62, 66, 96,128, 30,115,168, 87, + 88, 39, 1,255, 61, 88,133,203,190,213, 64,212, 62, 32,201,179, 0, 0,159, 20, 83,153, 1,255, 61,197,213, 8,190,205,201,252, + 62, 36,133, 31,230, 5,177,250, 98, 20, 1,255, 60, 21,134, 27,190,205,201,252, 62, 36,133, 31, 25,251,177,250, 98, 20, 1,255, + 61,197,213, 8,190,220,183,173, 62, 25, 82,219,152, 18, 24, 8, 70,188, 1,255, 60, 21,134, 27,190,220,183,173, 62, 25, 82,219, +103,238, 24, 8, 70,188, 1,255, 61,153, 11,247,190,230, 12, 59, 62, 21,151,111,222, 26, 49,242,112,221, 1,255, 60,253,231, 82, +190,230, 12, 59, 62, 21,151,111, 33,230, 49,242,112,221, 1,255, 61, 88,133,203,190,231,233,241, 62, 21,151,111, 0, 0, 60, 18, +113, 5, 1,255, 62, 8, 60,189, 61, 76,209,142, 62, 92,128,116, 30, 4,244, 93,123,225, 1,255,188,223,206,186, 61, 76,209,142, + 62, 92,128,116,225,252,244, 93,123,225, 1,255, 62, 15,179,149, 60,170,200, 22, 62, 88,197, 8, 9, 71,251, 34,127,144, 1,255, +189, 13,194,190, 60,170,200, 22, 62, 88,197, 8,246,185,251, 34,127,144, 1,255, 62, 86,156,155, 62, 23,248,202, 62, 81, 78, 48, + 17, 81, 2, 74,126,204, 1,255,189,212,179,106, 62, 23,248,202, 62, 81, 78, 48,238,175, 2, 74,126,204, 1,255, 62, 56,193, 58, + 62, 20, 61, 94, 62, 88,197, 8, 25,218,253,177,125, 86, 3,255,189,152,252,168, 62, 20, 61, 94, 62, 88,197, 8,230, 38,253,177, +125, 86, 3,255, 62,127,170, 64, 62, 9, 11, 25, 62, 88,197, 8, 21,182,240,210,125, 57, 3,255,190, 19,103, 90, 62, 9, 11, 25, + 62, 88,197, 8,234, 74,240,210,125, 57, 3,255, 62,161,107,237, 61,229, 77, 34, 62, 51,114,207, 28,143,237,249,123,117, 1,255, +190, 86,148,244, 61,229, 77, 34, 62, 51,114,207,227,113,237,249,123,117, 1,255, 62,167, 5, 15, 61,169,150, 97, 62, 47,183, 99, + 15,209,246,217,126,175, 1,255,190, 97,199, 56, 61,169,150, 97, 62, 47,183, 99,240, 47,246,217,126,175, 1,255, 62,165, 39, 89, + 61, 32, 8,125, 62, 43,251,247, 24,177,253,190,125,146, 1,255,190, 94, 11,204, 61, 32, 8,125, 62, 43,251,247,231, 79,253,190, +125,146, 1,255, 62,140,229, 26,187,152,222, 60, 62, 62,165, 20, 33, 20, 2, 75,123,160, 1,255,190, 45,135, 79,187,152,222, 60, + 62, 62,165, 20,222,236, 2, 75,123,160, 1,255, 62,105, 69,184,188,187,128,115, 62, 73,215, 88, 26, 85,248,238,125, 14, 1,255, +189,250, 5,163,188,187,128,115, 62, 73,215, 88,229,171,248,238,125, 14, 1,255, 62, 34, 92,178,186,133,194,226, 62, 92,128,116, + 7, 8,250,142,127,175, 1,255,189, 88,103, 48,186,133,194,226, 62, 92,128,116,248,248,250,142,127,175, 1,255, 62, 11,248, 41, + 61,177, 13, 57, 62, 92,128,116, 34,169,240, 2,122, 43, 1,255,188,253,170, 27, 61,177, 13, 57, 62, 92,128,116,221, 87,240, 2, +122, 43, 1,255, 62, 26,229,218, 61,251,177,170, 62, 92,128,116, 27,126,239,108,123,231, 1,255,189, 58,139,207, 61,251,177,170, + 62, 92,128,116,228,130,239,108,123,231, 1,255, 62, 38, 24, 30, 61,236,195,250, 62, 81, 78, 48, 64,226,207, 13, 98,224, 1,255, +189,103, 84,224, 61,236,195,250, 62, 81, 78, 48,191, 30,207, 13, 98,224, 1,255, 62, 19,111, 1, 61,177, 13, 57, 62, 81, 78, 48, + 96, 29,229,169, 80, 81, 1,255,189, 28,176,110, 61,177, 13, 57, 62, 81, 78, 48,159,227,229,169, 80, 81, 1,255, 62, 41,211,138, + 59,205,106, 77, 62, 81, 78, 48, 55, 36, 71,122, 90,188, 1,255,189,118, 66,143, 59,205,106, 77, 62, 81, 78, 48,200,220, 71,122, + 90,188, 1,255, 62,105, 69,184,188, 67,220,161, 62, 66, 96,128, 21, 76, 78, 90, 98,241, 1,255,189,250, 5,163,188, 67,220,161, + 62, 66, 96,128,234,180, 78, 90, 98,241, 1,255, 62,137, 41,174, 59, 43,249,149, 62, 55, 46, 59,245, 85, 69, 69,107, 25, 1,255, +190, 38, 16,118, 59, 43,249,149, 62, 55, 46, 59, 10,171, 69, 69,107, 25, 1,255, 62,157,176,129, 61, 61,227,222, 62, 40, 64,139, +223,232, 29,211,120, 67, 1,255,190, 79, 30, 28, 61, 61,227,222, 62, 40, 64,139, 32, 24, 29,211,120, 67, 1,255, 62,159,142, 55, + 61,162, 31,137, 62, 40, 64,139,210,148,238,123,118, 95, 1,255,190, 82,217,136, 61,162, 31,137, 62, 40, 64,139, 45,108,238,123, +118, 95, 1,255, 62,153,245, 21, 61,214, 95,114, 62, 43,251,247,229,216,179,108, 99, 43, 1,255,190, 71,167, 67, 61,214, 95,114, + 62, 43,251,247, 26, 40,179,108, 99, 43, 1,255, 62,123,238,212, 62, 5, 79,173, 62, 77,146,196,237,202,158,179, 81, 35, 3,255, +190, 15,171,238, 62, 5, 79,173, 62, 77,146,196, 18, 54,158,179, 81, 35, 3,255, 62, 60,124,166, 62, 9, 11, 25, 62, 85, 9,156, + 39, 24,212,118,113,214, 3,255,189,160,115,129, 62, 9, 11, 25, 62, 85, 9,156,216,232,212,118,113,214, 3,255, 62, 86,156,155, + 62, 12,198,133, 62, 77,146,196, 1,213,193,189,111,208, 1,255,189,212,179,106, 62, 12,198,133, 62, 77,146,196,254, 43,193,189, +111,208, 1,255, 62, 23, 42,109, 60,230,126,216, 62, 77,146,196, 84,226, 42,192, 85,187, 1,255,189, 43,158, 31, 60,230,126,216, + 62, 77,146,196,171, 30, 42,192, 85,187, 1,255, 62, 19,111, 1, 61, 91,191, 63, 62, 77,146,196,102,235, 2,196, 76, 11, 1,255, +189, 28,176,110, 61, 91,191, 63, 62, 77,146,196,153, 21, 2,196, 76, 11, 1,255, 61,212,194,185, 62, 38,230,122, 62, 10,101, 42, +182,183,104,118,246, 5, 1,255, 58,240,196,191, 62, 38,230,122, 62, 10,101, 42, 73, 73,104,118,246, 5, 1,255, 62, 19,111, 1, + 62,131,247,186, 62, 14, 32,150,192,208, 66,221,167, 3, 3,255,189, 28,176,110, 62,131,247,186, 62, 14, 32,150, 63, 48, 66,221, +167, 3, 3,255, 62, 86,156,155, 62,137,144,220, 62, 2,238, 82, 9, 59, 90, 89,165,208, 3,255,189,212,179,106, 62,137,144,220, + 62, 2,238, 82,246,197, 90, 89,165,208, 3,255, 62,142,194,208, 62, 83,175,139, 61,224,138,107, 37,165,114,104,212,176, 1,255, +190, 49, 66,187, 62, 83,175,139, 61,224,138,107,218, 91,114,104,212,176, 1,255, 62,189,105,152, 62, 35, 43, 14, 61,164,211,170, + 45, 67,116, 40,227, 1, 1,255,190,135, 72, 37, 62, 35, 43, 14, 61,164,211,170,210,189,116, 40,227, 1, 1,255, 62,217,103, 66, + 62, 12,198,133, 61,134,248, 73, 94,100, 79,237,223, 18, 1,255,190,163, 69,207, 62, 12,198,133, 61,134,248, 73,161,156, 79,237, +223, 18, 1,255, 62,211,206, 32, 60,200,163,119, 60,211,115,252,120,247,221,255,231,165, 1,255,190,157,172,173, 60,200,163,119, + 60,211,115,252,135, 9,221,255,231,165, 1,255, 62,170,192,123,189, 85, 45,188, 61, 52, 94,112, 76,155,154,106,242, 19, 1,255, +190,105, 62, 16,189, 85, 45,188, 61, 52, 94,112,179,101,154,106,242, 19, 1,255, 62,131,144,140,189,196, 41, 0, 61,142,111, 33, + 56,204,142, 26, 13,138, 1,255,190, 26,222, 50,189,196, 41, 0, 61,142,111, 33,199, 52,142, 26, 13,138, 1,255, 61, 88,133,203, + 62,187,243, 16,188,105,242, 89, 0, 0,106,155, 70,214, 3,255, 61, 88,133,203, 62,208,121,226,190, 62, 7,254, 0, 0,127,243, + 3, 82, 3,255, 61, 88,133,203,190, 18,152,254,190,236,214, 11, 0, 0,164, 54,166,204, 3,255, 61, 88,133,203,190,136,190,173, +189,124,142,139, 0, 0,129,179,235, 65, 1,255, 61, 88,133,203,191, 1,243,205, 61,134,248, 73, 0, 0,151,182,181,204, 3,255, + 61, 88,133,203,190,218,217,247, 60, 56, 12,241, 0, 0,221,231,132,162, 3,255, 61, 88,133,203,190,162,222,161, 57,157, 21,147, + 0, 0,212, 16,135,201, 1,255, 61, 88,133,203,190,142, 87,207,188,146,212,141, 0, 0,147,245,187, 97, 1,255, 62,230,119, 61, + 61,106,172,239,189,253, 43,161,125,164,235,181, 13,156, 1,255,190,176, 85,202, 61,106,172,239,189,253, 43,161,130, 92,235,181, + 13,156, 1,255, 62,232, 84,243, 61,199,113,194,190, 47, 26, 78,126,174,238, 23,252, 66, 1,255,190,178, 51,128, 61,199,113,194, +190, 47, 26, 78,129, 82,238, 23,252, 66, 1,255, 62,211,206, 32, 61,147, 49,216,190,180,218,181, 81, 70, 13,148,158, 15, 1,255, +190,157,172,173, 61,147, 49,216,190,180,218,181,174,186, 13,148,158, 15, 1,255, 62,137, 41,174, 62, 27,180, 54,190,244, 76,226, + 58,123, 21,228,144, 70, 3,255,190, 38, 16,118, 62, 27,180, 54,190,244, 76,226,197,133, 21,228,144, 70, 3,255, 62,202,121,146, +189,151, 95,239,189,238, 61,240, 89, 76,164,139, 6,161, 3,255,190,148, 88, 31,189,151, 95,239,189,238, 61,240,166,180,164,139, + 6,161, 3,255, 62,168,226,197,189,226, 4, 97,190,103, 21,163, 38, 93,134, 34, 7,182, 1,255,190,101,130,164,189,226, 4, 97, +190,103, 21,163,217,163,134, 34, 7,182, 1,255, 62,180, 21, 9,189,100, 27,109,190,178,252,255, 43,106,170,219,170,222, 1,255, +190,123,231, 45,189,100, 27,109,190,178,252,255,212,150,170,219,170,222, 1,255, 62, 86,156,155,188,217, 91,211,190,234,248, 85, + 55,168,213,109,148,229, 3,255,189,212,179,106,188,217, 91,211,190,234,248, 85,200, 88,213,109,148,229, 3,255, 62, 38, 24, 30, +190, 93, 61,112, 61, 37,112,191,120,197,255, 36,213,158, 1,255,189,103, 84,224,190, 93, 61,112, 61, 37,112,191,135, 59,255, 36, +213,158, 1,255, 62, 11,248, 41,190,123, 24,209,188,236,102,176, 84,188,181, 20,196, 24, 1,255,188,253,170, 27,190,123, 24,209, +188,236,102,176,171, 68,181, 20,196, 24, 1,255, 62, 64, 56, 19,190,196,117,110, 60,241, 79, 92, 79,131,254, 86,155,183, 3,255, +189,167,234, 89,190,196,117,110, 60,241, 79, 92,176,125,254, 86,155,183, 3,255, 62, 45,142,246,190,146, 19, 59, 61, 7,149, 95, + 99, 5, 1, 8,174,231, 1,255,189,130,152, 32,190,146, 19, 59, 61, 7,149, 95,156,251, 1, 8,174,231, 1,255, 62, 82,225, 47, +190,244,249,234, 61, 22,131, 15, 62, 65,185,227,168,224, 3,255,189,205, 60,146,190,244,249,234, 61, 22,131, 15,193,191,185,227, +168,224, 3,255, 61,242,158, 25,190,207,167,178, 60,181,152,155, 16,133,232,208,131, 55, 1,255,188, 80,194,110,190,207,167,178, + 60,181,152,155,239,123,232,208,131, 55, 1,255, 61,227,176,105,190,155,103,201, 60,151,189, 58, 48, 7,224,163,141,149, 1,255, +187,178,169,214,190,155,103,201, 60,151,189, 58,207,249,224,163,141,149, 1,255, 62, 4,129, 81,190,252,112,195, 61, 97, 39,129, + 12, 68,158,218,173,147, 1,255,188,193,243, 89,190,252,112,195, 61, 97, 39,129,243,188,158,218,173,147, 1,255, 62, 30,161, 70, +190, 59,166,163, 61, 82, 57,208,124,195,227,106,255,203, 1,255,189, 73,121,127,190, 59,166,163, 61, 82, 57,208,131, 61,227,106, +255,203, 1,255, 62, 26,229,218,190, 33,134,174, 61,142,111, 33,120, 29,231,105, 36,193, 1,255,189, 58,139,207,190, 33,134,174, + 61,142,111, 33,135,227,231,105, 36,193, 1,255, 62, 23, 42,109,190, 7,102,186, 61,172, 74,130,101,160,182,164, 25,240, 1,255, +189, 43,158, 31,190, 7,102,186, 61,172, 74,130,154, 96,182,164, 25,240, 1,255, 62, 26,229,218,190,111,230,140,189,148,171,206, + 84,120,159,221,253,198, 1,255,189, 58,139,207,190,111,230,140,189,148,171,206,171,136,159,221,253,198, 1,255, 62, 67,243,127, +190, 74,148, 83,190,139,205, 16, 67,255,151, 42,228, 73, 3,255,189,175, 97, 49,190, 74,148, 83,190,139,205, 16,188, 1,151, 42, +228, 73, 3,255, 62, 90, 88, 7,189,248,104,235,190,205, 28,244, 63,201,176, 25,179, 0, 3,255,189,220, 42, 66,189,248,104,235, +190,205, 28,244,192, 55,176, 25,179, 0, 3,255, 62,135, 75,248, 62,180,124, 55,190,167,202,187, 56, 34, 95,160,192, 17, 3,255, +190, 34, 85, 10, 62,180,124, 55,190,167,202,187,199,222, 95,160,192, 17, 3,255, 62,135, 75,248, 62,195,105,232,190, 58, 76,146, + 55, 54,115,120, 0,239, 3,255,190, 34, 85, 10, 62,195,105,232,190, 58, 76,146,200,202,115,120, 0,239, 3,255, 62,135, 75,248, + 62,176,192,203,189, 34,252,105, 63,239, 92,164, 60,238, 3,255,190, 34, 85, 10, 62,176,192,203,189, 34,252,105,192, 17, 92,164, + 60,238, 3,255, 62,137, 41,174, 62, 68,193,219, 61, 82, 57,208, 49,123,102,255, 57,170, 1,255,190, 38, 16,118, 62, 68,193,219, + 61, 82, 57,208,206,133,102,255, 57,170, 1,255, 62,200,155,220, 62, 12,198,133, 59,248,172, 95, 98,142, 73,198, 35, 6, 1,255, +190,146,122,105, 62, 12,198,133, 59,248,172, 95,157,114, 73,198, 35, 6, 1,255, 62,178, 55, 83, 62, 35, 43, 14,188,146,212,141, + 61,129,106,254, 33,241, 1,255,190,120, 43,193, 62, 35, 43, 14,188,146,212,141,194,127,106,254, 33,241, 1,255, 62,180, 21, 9, + 62,141, 76, 72,189,253, 43,161, 76,234, 87,151, 52,221, 1,255,190,123,231, 45, 62,141, 76, 72,189,253, 43,161,179, 22, 87,151, + 52,221, 1,255, 62,217,103, 66, 62, 87,106,247,189,185,254, 7,101,187, 66, 28, 40,199, 3,255,190,163, 69,207, 62, 87,106,247, +189,185,254, 7,154, 69, 66, 28, 40,199, 3,255, 62,217,103, 66, 62,113,138,236,190, 80,177, 26,113,183, 58, 68,248,119, 3,255, +190,163, 69,207, 62,113,138,236,190, 80,177, 26,142, 73, 58, 68,248,119, 3,255, 62,180, 21, 9, 62,152,126,141,190,118, 3, 83, + 86,235, 93,238,253,205, 1,255,190,123,231, 45, 62,152,126,141,190,118, 3, 83,169, 21, 93,238,253,205, 1,255, 62,180, 21, 9, + 62,135,179, 38,190,182,184,107, 85,232, 70,154,192,157, 3,255,190,123,231, 45, 62,135,179, 38,190,182,184,107,170, 24, 70,154, +192,157, 3,255, 62,217,103, 66, 62, 76, 56,179,190,162, 49,153,110,166, 42,177,207,222, 3,255,190,163, 69,207, 62, 76, 56,179, +190,162, 49,153,145, 90, 42,177,207,222, 3,255, 62,174,123,231, 61,206,232,154,190,216, 79, 56, 75, 58, 1, 57,152,116, 3,255, +190,112,180,232, 61,206,232,154,190,216, 79, 56,180,198, 1, 57,152,116, 3,255, 62,142,194,208,189, 40,100,171,190,206,250,170, + 70, 73,187,147,173,200, 1,255,190, 49, 66,187,189, 40,100,171,190,206,250,170,185,183,187,147,173,200, 1,255, 62,223, 0,100, + 61,206,232,154,190,121,190,191,114,194, 41, 80, 38,207, 1,255,190,168,222,241, 61,206,232,154,190,121,190,191,141, 62, 41, 80, + 38,207, 1,255, 62,120, 51,104,190, 7,102,186,189,163,153,127, 74,232,154,153, 22, 28, 1,255,190, 11,240,130,190, 7,102,186, +189,163,153,127,181, 24,154,153, 22, 28, 1,255, 62,129,178,214,190, 18,152,254,190,125,122, 44, 71, 89,151,115,237, 1, 1,255, +190, 23, 34,198,190, 18,152,254,190,125,122, 44,184,167,151,115,237, 1, 1,255, 62,239,203,202, 62, 12,198,133,190,132, 86, 56, +220, 72, 93,207, 79,106, 3,255,190,185,170, 88, 62, 12,198,133,190,132, 86, 56, 35,184, 93,207, 79,106, 3,255, 62,211,206, 32, +189,240,242, 18,190, 84,108,135, 15, 30,150, 34, 70, 84, 3,255,190,157,172,173,189,240,242, 18,190, 84,108,135,240,226,150, 34, + 70, 84, 3,255, 63, 9,160, 38,189,203,159,217,190,154,186,192, 67,164,166,138, 61,172, 1,255,190,221, 30,219,189,203,159,217, +190,154,186,192,188, 92,166,138, 61,172, 1,255, 63, 38,140,172,188,217, 91,211,190,178,252,255, 83,179,206,223, 83,114, 1,255, +191, 11,123,244,188,217, 91,211,190,178,252,255,172, 77,206,223, 83,114, 1,255, 63, 46,242, 95, 61,199,113,194,190,177, 31, 73, + 92, 54, 12,232, 87,210, 3,255,191, 19,225,167, 61,199,113,194,190,177, 31, 73,163,202, 12,232, 87,210, 3,255, 63, 32,243,138, + 62, 61, 75, 3,190,177, 31, 73, 62,247, 83,221, 73, 97, 1,255,191, 5,226,209, 62, 61, 75, 3,190,177, 31, 73,193, 9, 83,221, + 73, 97, 1,255, 63, 7,194,112, 62, 46, 93, 82,190,150,255, 84, 5,181,111, 80, 62,236, 1,255,190,217, 99,111, 62, 46, 93, 82, +190,150,255, 84,250, 75,111, 80, 62,236, 1,255, 63, 6,211,149, 62, 16,129,241,190,145,102, 50, 69,236,239,117,105,236, 1,255, +190,215,133,185, 62, 16,129,241,190,145,102, 50,186, 20,239,117,105,236, 1,255, 63, 27, 90,104, 62, 27,180, 54,190,169,168,113, + 24, 34,231,205,123, 89, 1,255,191, 0, 73,175, 62, 27,180, 54,190,169,168,113,231,222,231,205,123, 89, 1,255, 63, 36,174,246, + 61,169,150, 97,190,173, 99,221,223, 69,252, 16,123,173, 1,255,191, 9,158, 62, 61,169,150, 97,190,173, 99,221, 32,187,252, 16, +123,173, 1,255, 63, 30, 38,249,188,127,147, 98,190,173, 99,221,239,171, 39, 0,120,207, 1,255,191, 3, 22, 64,188,127,147, 98, +190,173, 99,221, 16, 85, 39, 0,120,207, 1,255, 63, 8,177, 75,189,143,233, 23,190,149, 33,158, 51, 9, 45, 56,108, 82, 1,255, +190,219, 65, 37,189,143,233, 23,190,149, 33,158,204,247, 45, 56,108, 82, 1,255, 62,224,222, 26,189,173,196,120,190, 88, 39,243, + 38,147, 62,224,104,153, 3,255,190,170,188,167,189,173,196,120,190, 88, 39,243,217,109, 62,224,104,153, 3,255, 62,247, 66,162, + 61,236,195,250,190,128,154,204, 62,218,243,152,110,206, 3,255,190,193, 33, 48, 61,236,195,250,190,128,154,204,193, 38,243,152, +110,206, 3,255, 62,252,219,196, 61,184,132, 17,190,145,102, 50, 87, 10,182, 73, 58, 19, 1,255,190,198,186, 82, 61,184,132, 17, +190,145,102, 50,168,246,182, 73, 58, 19, 1,255, 62,237,238, 21,189,128,251,103,190,125,122, 44, 15,232,121,106, 37, 64, 1,255, +190,183,204,162,189,128,251,103,190,125,122, 44,240, 24,121,106, 37, 64, 1,255, 63, 9,160, 38,189, 85, 45,188,190,164, 15, 79, +239,157,122, 89, 33,212, 1,255,190,221, 30,219,189, 85, 45,188,190,164, 15, 79, 16, 99,122, 89, 33,212, 1,255, 63, 27, 90,104, +188, 8, 37,223,190,182,184,107,158, 8, 81,202, 9,185, 1,255,191, 0, 73,175,188, 8, 37,223,190,182,184,107, 97,248, 81,202, + 9,185, 1,255, 63, 32,243,138, 61,132, 68, 40,190,182,184,107,131, 60,239,145, 23, 95, 1,255,191, 5,226,209, 61,132, 68, 40, +190,182,184,107,124,196,239,145, 23, 95, 1,255, 63, 25,124,178, 61,236,195,250,190,180,218,181,228, 27,153, 22, 70,206, 1,255, +190,252,215,242, 61,236,195,250,190,180,218,181, 27,229,153, 22, 70,206, 1,255, 63, 7,194,112, 61,221,214, 74,190,162, 49,153, + 68, 65,168,253, 64,113, 1,255,190,217, 99,111, 61,221,214, 74,190,162, 49,153,187,191,168,253, 64,113, 1,255, 62,228,153,135, + 61,169,150, 97,190,125,122, 44, 86,113,222,190, 88, 87, 1,255,190,174,120, 20, 61,169,150, 97,190,125,122, 44,169,143,222,190, + 88, 87, 1,255, 62,226,187,209, 60,230,126,216,190,141,170,198, 95,196,182,107, 42,100, 1,255,190,172,154, 93, 60,230,126,216, +190,141,170,198,160, 60,182,107, 42,100, 1,255, 62,208, 18,180,188, 8, 37,223,190,141,170,198,111, 42, 14, 21, 61,220, 1,255, +190,153,241, 65,188, 8, 37,223,190,141,170,198,144,214, 14, 21, 61,220, 1,255, 62,223, 0,100,188, 67,220,161,190,141,170,198, + 79, 3, 91, 4, 43, 19, 3,255,190,168,222,241,188, 67,220,161,190,141,170,198,176,253, 91, 4, 43, 19, 3,255, 62,228,153,135, +189, 55, 82, 92,190,141,170,198,107,207,254,198, 68,250, 3,255,190,174,120, 20,189, 55, 82, 92,190,141,170,198,148, 49,254,198, + 68,250, 3,255, 62,221, 34,174,189,115, 9, 29,190,141,170,198, 82, 7, 64,225, 73,200, 1,255,190,167, 1, 59,189,115, 9, 29, +190,141,170,198,173,249, 64,225, 73,200, 1,255, 62,200,155,220,189, 85, 45,188,190, 58, 76,146,117, 38,207, 66,239, 47, 1,255, +190,146,122,105,189, 85, 45,188,190, 58, 76,146,138,218,207, 66,239, 47, 1,255, 62,198,190, 38,189,128,251,103,190,106,209, 15, + 97,150, 18,139, 80,184, 1,255,190,144,156,179,189,128,251,103,190,106,209, 15,158,106, 18,139, 80,184, 1,255, 62,198,190, 38, +189, 10,137, 74,190,114, 71,231,116, 17,240, 66, 51,154, 1,255,190,144,156,179,189, 10,137, 74,190,114, 71,231,139,239,240, 66, + 51,154, 1,255, 62,217,103, 66, 61, 46,246, 45,190,125,122, 44,113,112,204,245, 30, 39, 1,255,190,163, 69,207, 61, 46,246, 45, +190,125,122, 44,142,144,204,245, 30, 39, 1,255, 62,239,203,202, 61,121,154,159,190,139,205, 16, 90,105,185, 61, 56,146, 1,255, +190,185,170, 88, 61,121,154,159,190,139,205, 16,165,151,185, 61, 56,146, 1,255, 62,239,203,202, 61,106,172,239,190,152,221, 10, + 82,191,204,102, 82,230, 1,255,190,185,170, 88, 61,106,172,239,190,152,221, 10,173, 65,204,102, 82,230, 1,255, 62,221, 34,174, +189,115, 9, 29,190,152,221, 10, 29,246, 98, 64, 76, 94, 1,255,190,167, 1, 59,189,115, 9, 29,190,152,221, 10,226, 10, 98, 64, + 76, 94, 1,255, 62,230,119, 61,189, 55, 82, 92,190,152,221, 10, 77,150, 17,111,100, 75, 1,255,190,176, 85,202,189, 55, 82, 92, +190,152,221, 10,178,106, 17,111,100, 75, 1,255, 62,224,222, 26,188,127,147, 98,190,152,221, 10, 60,239, 60,190, 94,195, 1,255, +190,170,188,167,188,127,147, 98,190,152,221, 10,195, 17, 60,190, 94,195, 1,255, 62,209,240,106,188, 8, 37,223,190,152,221, 10, + 83,199, 23,178, 93,209, 1,255,190,155,206,247,188, 8, 37,223,190,152,221, 10,172, 57, 23,178, 93,209, 1,255, 62,228,153,135, + 60,230,126,216,190,152,221, 10, 73, 98,200, 1, 88,170, 1,255,190,174,120, 20, 60,230,126,216,190,152,221, 10,182,158,200, 1, + 88,170, 1,255, 63, 9,160, 38, 61,206,232,154,190,175, 65,147, 68, 23,223,166,103,112, 1,255,190,221, 30,219, 61,206,232,154, +190,175, 65,147,187,233,223,166,103,112, 1,255, 63, 27, 90,104, 61,221,214, 74,190,192, 12,249, 18,165,216,156,120, 89, 1,255, +191, 0, 73,175, 61,221,214, 74,190,192, 12,249,237, 91,216,156,120, 89, 1,255, 63, 35,192, 27, 61,121,154,159,190,193,234,175, +185, 25,231, 29,103,157, 1,255,191, 8,175, 98, 61,121,154,159,190,193,234,175, 70,231,231, 29,103,157, 1,255, 63, 30, 38,249, +188, 67,220,161,190,192, 12,249,209, 43, 64, 0,100,119, 1,255,191, 3, 22, 64,188, 67,220,161,190,192, 12,249, 46,213, 64, 0, +100,119, 1,255, 63, 10,143, 1,189, 85, 45,188,190,177, 31, 73, 26, 52, 92,240, 84, 3, 1,255,190,222,252,145,189, 85, 45,188, +190,177, 31, 73,229,204, 92,240, 84, 3, 1,255, 62,237,238, 21,189,115, 9, 29,190,139,205, 16, 8, 58,111,116, 62,101, 1,255, +190,183,204,162,189,115, 9, 29,190,139,205, 16,247,198,111,116, 62,101, 1,255, 62,254,185,122, 61,169,150, 97,190,158,118, 45, + 80,198,213,102, 89,175, 1,255,190,200,152, 8, 61,169,150, 97,190,158,118, 45,175, 58,213,102, 89,175, 1,255, 62,239,203,202, +186,133,194,226,190,154,186,192, 25,136, 0,130,125,108, 1,255,190,185,170, 88,186,133,194,226,190,154,186,192,230,120, 0,130, +125,108, 1,255, 62,250,254, 14,188,187,128,115,190,156,152,119, 27, 2, 30, 58,121,104, 1,255,190,196,220,156,188,187,128,115, +190,156,152,119,228,254, 30, 58,121,104, 1,255, 63, 4,245,223, 59,205,106, 77,190,164, 15, 79, 55,218,253,126,115, 35, 1,255, +190,211,202, 76, 59,205,106, 77,190,164, 15, 79,200, 38,253,126,115, 35, 1,255, 63, 0, 75,152, 60,230,126,216,190,160, 83,227, + 41,164,255,199,121, 8, 1,255,190,202,117,190, 60,230,126,216,190,160, 83,227,214, 92,255,199,121, 8, 1,255, 63, 6,211,149, + 61,106,172,239,190,165,237, 5, 39,237, 9,191,121, 55, 1,255,190,215,133,185, 61,106,172,239,190,165,237, 5,216, 19, 9,191, +121, 55, 1,255, 63, 11,125,220, 61, 17, 26,205,190,167,202,187, 46,208,244, 41,118,137, 1,255,190,224,218, 71, 61, 17, 26,205, +190,167,202,187,209, 48,244, 41,118,137, 1,255, 63, 18, 5,218, 61, 61,227,222,190,169,168,113, 53, 70, 3, 84,116, 85, 3,255, +190,237,234, 65, 61, 61,227,222,190,169,168,113,202,186, 3, 84,116, 85, 3,255, 63, 15, 57, 73, 61,154,168,176,190,169,168,113, + 44, 99, 38, 36,113,212, 3,255,190,232, 81, 31, 61,154,168,176,190,169,168,113,211,157, 38, 36,113,212, 3,255, 63, 7,194,112, + 62, 27,180, 54,190,192, 12,249,198,249, 72, 3,166,222, 3,255,190,217, 99,111, 62, 27,180, 54,190,192, 12,249, 57, 7, 72, 3, +166,222, 3,255, 63, 34,209, 64, 62, 42,161,230,190,206,250,170, 37,198, 68,123,154,174, 3,255,191, 7,192,135, 62, 42,161,230, +190,206,250,170,218, 58, 68,123,154,174, 3,255, 63, 48,208, 21, 61,177, 13, 57,190,195,200,102,121, 3, 17,201,218, 73, 3,255, +191, 21,191, 93, 61,177, 13, 57,190,195,200,102,134,253, 17,201,218, 73, 3,255, 63, 42, 72, 24,188,217, 91,211,190,203, 63, 62, + 82, 59,200, 75,175, 70, 3,255,191, 15, 55, 96,188,217, 91,211,190,203, 63, 62,173,197,200, 75,175, 70, 3,255, 63, 9,160, 38, +189,188,178, 40,190,193,234,175,249,134,165,184,165,129, 3,255,190,221, 30,219,189,188,178, 40,190,193,234,175, 6,122,165,184, +165,129, 3,255, 62,215,137,140,189,226, 4, 97,190,154,186,192,249,126,163,122,167,205, 1,255,190,161,104, 25,189,226, 4, 97, +190,154,186,192, 6,130,163,122,167,205, 1,255, 62,232, 84,243, 62, 1,148, 65,190,167,202,187,193, 93, 65,224,165,229, 1,255, +190,178, 51,128, 62, 1,148, 65,190,167,202,187, 62,163, 65,224,165,229, 1,255, 68, 65, 84, 65, 0, 0, 47, 28, 3,153, 50, 32, + 0, 0, 0, 49, 0, 0, 3,237, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 35, + 0, 0, 0, 2, 0, 0, 0, 44, 0, 0, 0, 35, 0, 0, 0, 44, 0, 0, 0, 46, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 3, + 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 0, 47, 0, 0, 0, 35, 0, 0, 0, 3, + 0, 0, 0, 45, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 42, 0, 0, 0, 35, + 0, 0, 0, 42, 0, 0, 0, 44, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 43, 0, 0, 0, 45, + 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0, 43, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 35, 0, 0, 0, 6, + 0, 0, 0, 8, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0, 7, 0, 0, 0, 9, 0, 0, 0, 35, + 0, 0, 0, 3, 0, 0, 0, 9, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 10, + 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, 0, 35, 0, 0, 0, 9, 0, 0, 0, 11, 0, 0, 0, 35, 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, 0, 64, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 65, + 0, 0, 0, 35, 0, 0, 0, 63, 0, 0, 0, 65, 0, 0, 0, 35, 0, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, 35, 0, 0, 0, 49, + 0, 0, 0, 65, 0, 0, 0, 35, 0, 0, 0, 60, 0, 0, 0, 64, 0, 0, 0, 35, 0, 0, 0, 48, 0, 0, 0, 60, 0, 0, 0, 35, + 0, 0, 0, 61, 0, 0, 0, 65, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 0, 60, 0, 0, 0, 62, + 0, 0, 0, 35, 0, 0, 0, 61, 0, 0, 0, 63, 0, 0, 0, 35, 0, 0, 0, 58, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 0, 59, + 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 0, 56, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 0, 57, 0, 0, 0, 61, 0, 0, 0, 35, + 0, 0, 0, 54, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 0, 55, 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 0, 52, 0, 0, 0, 60, + 0, 0, 0, 35, 0, 0, 0, 53, 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 0, 50, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 0, 51, + 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 0, 88, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 0,175, 0, 0, 0, 35, + 0, 0, 0, 90, 0, 0, 0,175, 0, 0, 0, 35, 0, 0, 0, 88, 0, 0, 0, 90, 0, 0, 0, 35, 0, 0, 0,174, 0, 0, 0,175, + 0, 0, 0, 35, 0, 0, 0, 89, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0, 89, 0, 0, 0, 90, 0, 0, 0, 35, 0, 0, 0, 86, + 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0, 86, 0, 0, 0, 88, 0, 0, 0, 35, + 0, 0, 0,172, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0, 87, 0, 0, 0,172, 0, 0, 0, 35, 0, 0, 0, 87, 0, 0, 0, 89, + 0, 0, 0, 35, 0, 0, 0, 84, 0, 0, 0,169, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0, 84, + 0, 0, 0, 86, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 0,172, 0, 0, 0, 35, 0, 0, 0, 85, 0, 0, 0,170, 0, 0, 0, 35, + 0, 0, 0, 85, 0, 0, 0, 87, 0, 0, 0, 35, 0, 0, 0, 82, 0, 0, 0,167, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 0,169, + 0, 0, 0, 35, 0, 0, 0, 82, 0, 0, 0, 84, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0, 83, + 0, 0, 0,168, 0, 0, 0, 35, 0, 0, 0, 83, 0, 0, 0, 85, 0, 0, 0, 35, 0, 0, 0, 80, 0, 0, 0,165, 0, 0, 0, 35, + 0, 0, 0,165, 0, 0, 0,167, 0, 0, 0, 35, 0, 0, 0, 80, 0, 0, 0, 82, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,168, + 0, 0, 0, 35, 0, 0, 0, 81, 0, 0, 0,166, 0, 0, 0, 35, 0, 0, 0, 81, 0, 0, 0, 83, 0, 0, 0, 35, 0, 0, 0, 78, + 0, 0, 0, 91, 0, 0, 0, 35, 0, 0, 0, 91, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 0,145, 0, 0, 0,163, 0, 0, 0, 35, + 0, 0, 0, 78, 0, 0, 0,163, 0, 0, 0, 35, 0, 0, 0, 92, 0, 0, 0,146, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 0, 92, + 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 0,164, 0, 0, 0, 35, 0, 0, 0,146, 0, 0, 0,164, 0, 0, 0, 35, 0, 0, 0, 91, + 0, 0, 0, 93, 0, 0, 0, 35, 0, 0, 0, 93, 0, 0, 0,147, 0, 0, 0, 35, 0, 0, 0,145, 0, 0, 0,147, 0, 0, 0, 35, + 0, 0, 0, 94, 0, 0, 0,148, 0, 0, 0, 35, 0, 0, 0, 92, 0, 0, 0, 94, 0, 0, 0, 35, 0, 0, 0,146, 0, 0, 0,148, + 0, 0, 0, 35, 0, 0, 0, 93, 0, 0, 0, 95, 0, 0, 0, 35, 0, 0, 0, 95, 0, 0, 0,149, 0, 0, 0, 35, 0, 0, 0,147, + 0, 0, 0,149, 0, 0, 0, 35, 0, 0, 0, 96, 0, 0, 0,150, 0, 0, 0, 35, 0, 0, 0, 94, 0, 0, 0, 96, 0, 0, 0, 35, + 0, 0, 0,148, 0, 0, 0,150, 0, 0, 0, 35, 0, 0, 0, 95, 0, 0, 0, 97, 0, 0, 0, 35, 0, 0, 0, 97, 0, 0, 0,151, + 0, 0, 0, 35, 0, 0, 0,149, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 0, 98, 0, 0, 0,152, 0, 0, 0, 35, 0, 0, 0, 96, + 0, 0, 0, 98, 0, 0, 0, 35, 0, 0, 0,150, 0, 0, 0,152, 0, 0, 0, 35, 0, 0, 0, 97, 0, 0, 0, 99, 0, 0, 0, 35, + 0, 0, 0, 99, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 0,151, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 0,100, 0, 0, 0,154, + 0, 0, 0, 35, 0, 0, 0, 98, 0, 0, 0,100, 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 0,154, 0, 0, 0, 35, 0, 0, 0, 99, + 0, 0, 0,101, 0, 0, 0, 35, 0, 0, 0,101, 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 0,155, 0, 0, 0, 35, + 0, 0, 0,102, 0, 0, 0,156, 0, 0, 0, 35, 0, 0, 0,100, 0, 0, 0,102, 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 0,156, + 0, 0, 0, 35, 0, 0, 0,101, 0, 0, 0,103, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 0,155, + 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 0,104, 0, 0, 0,158, 0, 0, 0, 35, 0, 0, 0,102, 0, 0, 0,104, 0, 0, 0, 35, + 0, 0, 0,156, 0, 0, 0,158, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 0,105, 0, 0, 0, 35, 0, 0, 0,105, 0, 0, 0,159, + 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 0,106, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 0,104, + 0, 0, 0,106, 0, 0, 0, 35, 0, 0, 0,158, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 0,105, 0, 0, 0,107, 0, 0, 0, 35, + 0, 0, 0,107, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 0,108, 0, 0, 0,162, + 0, 0, 0, 35, 0, 0, 0,106, 0, 0, 0,108, 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 0,162, 0, 0, 0, 35, 0, 0, 0, 66, + 0, 0, 0,107, 0, 0, 0, 35, 0, 0, 0, 66, 0, 0, 0, 67, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 0,161, 0, 0, 0, 35, + 0, 0, 0, 66, 0, 0, 0,108, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 0,162, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 0,127, + 0, 0, 0, 35, 0, 0, 0,127, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 0,128, + 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 0,110, 0, 0, 0,128, 0, 0, 0, 35, 0, 0, 0,110, 0, 0, 0,162, 0, 0, 0, 35, + 0, 0, 0,127, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 0,158, 0, 0, 0,179, + 0, 0, 0, 35, 0, 0, 0,128, 0, 0, 0,179, 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 0,125, + 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 0,126, 0, 0, 0,156, 0, 0, 0, 35, 0, 0, 0,126, 0, 0, 0,179, 0, 0, 0, 35, + 0, 0, 0,123, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 0,125, 0, 0, 0, 35, 0, 0, 0,124, 0, 0, 0,154, + 0, 0, 0, 35, 0, 0, 0,124, 0, 0, 0,126, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 0,121, + 0, 0, 0,123, 0, 0, 0, 35, 0, 0, 0,122, 0, 0, 0,152, 0, 0, 0, 35, 0, 0, 0,122, 0, 0, 0,124, 0, 0, 0, 35, + 0, 0, 0,119, 0, 0, 0,149, 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 0,120, 0, 0, 0,150, + 0, 0, 0, 35, 0, 0, 0,120, 0, 0, 0,122, 0, 0, 0, 35, 0, 0, 0,117, 0, 0, 0,147, 0, 0, 0, 35, 0, 0, 0,117, + 0, 0, 0,119, 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 0,148, 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 0,120, 0, 0, 0, 35, + 0, 0, 0,115, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 0,117, 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 0,146, + 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 0,118, 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 0,163, 0, 0, 0, 35, 0, 0, 0,113, + 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 0,164, 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 0,116, 0, 0, 0, 35, + 0, 0, 0,113, 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 0,176, + 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0,164, + 0, 0, 0,176, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 0,111, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 0,111, 0, 0, 0, 35, + 0, 0, 0,110, 0, 0, 0,112, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 0,112, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 0,177, + 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 0,182, 0, 0, 0, 35, 0, 0, 0,111, 0, 0, 0,182, 0, 0, 0, 35, 0, 0, 0,112, + 0, 0, 0,183, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 0,183, 0, 0, 0, 35, 0, 0, 0,180, 0, 0, 0,182, 0, 0, 0, 35, + 0, 0, 0,176, 0, 0, 0,177, 0, 0, 0, 33, 0, 0, 0,181, 0, 0, 0,183, 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 0,136, + 0, 0, 0, 35, 0, 0, 0,136, 0, 0, 0,175, 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0,135, + 0, 0, 0,136, 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 0,134, 0, 0, 0, 35, + 0, 0, 0,132, 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 0,135, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 0,172, + 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 0,132, 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 0,169, 0, 0, 0, 35, 0, 0, 0,131, + 0, 0, 0,133, 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 0,186, 0, 0, 0, 35, + 0, 0, 0,184, 0, 0, 0,186, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 0,184, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 0,187, + 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,187, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,185, 0, 0, 0, 35, 0, 0, 0,130, + 0, 0, 0,184, 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 0,185, 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 0,189, 0, 0, 0, 35, + 0, 0, 0,188, 0, 0, 0,189, 0, 0, 0, 33, 0, 0, 0,186, 0, 0, 0,188, 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 0,186, + 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 0,189, 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 0,187, 0, 0, 0, 35, 0, 0, 0,187, + 0, 0, 0,188, 0, 0, 0, 35, 0, 0, 0, 68, 0, 0, 0,188, 0, 0, 0, 33, 0, 0, 0, 68, 0, 0, 0,184, 0, 0, 0, 35, + 0, 0, 0, 68, 0, 0, 0,185, 0, 0, 0, 35, 0, 0, 0,129, 0, 0, 0,130, 0, 0, 0, 35, 0, 0, 0, 68, 0, 0, 0,129, + 0, 0, 0, 33, 0, 0, 0,129, 0, 0, 0,131, 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 0,192, 0, 0, 0, 35, 0, 0, 0,190, + 0, 0, 0,192, 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 0,190, 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 0,143, 0, 0, 0, 35, + 0, 0, 0,191, 0, 0, 0,193, 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 0,193, 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 0,144, + 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 0,191, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 0,194, 0, 0, 0, 35, 0, 0, 0,192, + 0, 0, 0,194, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 0,141, 0, 0, 0, 35, 0, 0, 0,193, 0, 0, 0,195, 0, 0, 0, 35, + 0, 0, 0,140, 0, 0, 0,195, 0, 0, 0, 35, 0, 0, 0,140, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 0,196, + 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 0,196, 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 0,195, + 0, 0, 0,197, 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 0,197, 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 0,140, 0, 0, 0, 35, + 0, 0, 0, 70, 0, 0, 0,137, 0, 0, 0, 35, 0, 0, 0, 70, 0, 0, 0,196, 0, 0, 0, 35, 0, 0, 0,137, 0, 0, 0,138, + 0, 0, 0, 35, 0, 0, 0, 70, 0, 0, 0,197, 0, 0, 0, 35, 0, 0, 0, 69, 0, 0, 0,190, 0, 0, 0, 35, 0, 0, 0, 69, + 0, 0, 0,189, 0, 0, 0, 35, 0, 0, 0, 69, 0, 0, 0,191, 0, 0, 0, 35, 0, 0, 0,190, 0, 0, 0,205, 0, 0, 0, 35, + 0, 0, 0,205, 0, 0, 0,207, 0, 0, 0, 35, 0, 0, 0, 69, 0, 0, 0,207, 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 0,206, + 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 0,207, 0, 0, 0, 35, 0, 0, 0, 70, 0, 0, 0,198, 0, 0, 0, 35, 0, 0, 0,198, + 0, 0, 0,199, 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 0,199, 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 0,200, 0, 0, 0, 35, + 0, 0, 0,197, 0, 0, 0,200, 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 0,201, 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 0,201, + 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 0,202, 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 0,202, 0, 0, 0, 35, 0, 0, 0,201, + 0, 0, 0,203, 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 0,203, 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 0,204, 0, 0, 0, 35, + 0, 0, 0,193, 0, 0, 0,204, 0, 0, 0, 35, 0, 0, 0,203, 0, 0, 0,205, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 0,206, + 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 0,203, 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 0,204, 0, 0, 0, 35, 0, 0, 0,198, + 0, 0, 0,207, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 0,163, 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 0,176, 0, 0, 0, 35, + 0, 0, 0,140, 0, 0, 0,164, 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 0,210, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 0,210, + 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 0,211, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0,211, 0, 0, 0, 35, 0, 0, 0,143, + 0, 0, 0,212, 0, 0, 0, 35, 0, 0, 0,210, 0, 0, 0,212, 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 0,213, 0, 0, 0, 35, + 0, 0, 0,211, 0, 0, 0,213, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 0,212, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,213, + 0, 0, 0, 35, 0, 0, 0, 80, 0, 0, 0,208, 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 0,212, 0, 0, 0, 35, 0, 0, 0,209, + 0, 0, 0,213, 0, 0, 0, 35, 0, 0, 0, 81, 0, 0, 0,209, 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 0,214, 0, 0, 0, 35, + 0, 0, 0,210, 0, 0, 0,214, 0, 0, 0, 35, 0, 0, 0,211, 0, 0, 0,215, 0, 0, 0, 35, 0, 0, 0,209, 0, 0, 0,215, + 0, 0, 0, 35, 0, 0, 0, 78, 0, 0, 0,214, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 0,215, 0, 0, 0, 35, 0, 0, 0, 71, + 0, 0, 0,129, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 0,221, 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 0,221, 0, 0, 0, 35, + 0, 0, 0,131, 0, 0, 0,222, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 0,222, 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 0,221, + 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 0,219, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 0,220, 0, 0, 0, 35, 0, 0, 0,220, + 0, 0, 0,222, 0, 0, 0, 35, 0, 0, 0,217, 0, 0, 0,219, 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 0,217, 0, 0, 0, 35, + 0, 0, 0,135, 0, 0, 0,218, 0, 0, 0, 35, 0, 0, 0,218, 0, 0, 0,220, 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 0,217, + 0, 0, 0, 35, 0, 0, 0,136, 0, 0, 0,216, 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 0,218, 0, 0, 0, 35, 0, 0, 0,217, + 0, 0, 0,228, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 0,230, 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 0,230, 0, 0, 0, 35, + 0, 0, 0,218, 0, 0, 0,229, 0, 0, 0, 35, 0, 0, 0,229, 0, 0, 0,230, 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 0,226, + 0, 0, 0, 35, 0, 0, 0,226, 0, 0, 0,228, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 0,227, 0, 0, 0, 35, 0, 0, 0,227, + 0, 0, 0,229, 0, 0, 0, 35, 0, 0, 0,221, 0, 0, 0,224, 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 0,226, 0, 0, 0, 35, + 0, 0, 0,222, 0, 0, 0,225, 0, 0, 0, 35, 0, 0, 0,225, 0, 0, 0,227, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 0,223, + 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 0,224, 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 0,225, 0, 0, 0, 35, 0, 0, 0,223, + 0, 0, 0,230, 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 0,228, 0, 0, 0, 35, 0, 0, 0,225, 0, 0, 0,229, 0, 0, 0, 35, + 0, 0, 0,180, 0, 0, 0,233, 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 0,233, 0, 0, 0, 35, 0, 0, 0,182, 0, 0, 0,231, + 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 0,234, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 0,232, 0, 0, 0, 35, 0, 0, 0,232, + 0, 0, 0,234, 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 0,253, 0, 0, 0, 35, 0, 0, 0,111, 0, 0, 0,253, 0, 0, 0, 35, + 0, 0, 0,112, 0, 0, 0,254, 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 0,254, 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 0,255, + 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 0,255, 0, 0, 0, 35, 0, 0, 0,110, 0, 0, 1, 0, 0, 0, 0, 35, 0, 0, 0,254, + 0, 0, 1, 0, 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 0,251, 0, 0, 0, 35, 0, 0, 0,233, 0, 0, 0,251, 0, 0, 0, 35, + 0, 0, 0,114, 0, 0, 0,252, 0, 0, 0, 35, 0, 0, 0,234, 0, 0, 0,252, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 0,249, + 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 0,251, 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 0,250, 0, 0, 0, 35, 0, 0, 0,250, + 0, 0, 0,252, 0, 0, 0, 35, 0, 0, 0,117, 0, 0, 0,247, 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 0,249, 0, 0, 0, 35, + 0, 0, 0,118, 0, 0, 0,248, 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 0,250, 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 0,245, + 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 0,247, 0, 0, 0, 35, 0, 0, 0,120, 0, 0, 0,246, 0, 0, 0, 35, 0, 0, 0,246, + 0, 0, 0,248, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 0,243, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 0,245, 0, 0, 0, 35, + 0, 0, 0,122, 0, 0, 0,244, 0, 0, 0, 35, 0, 0, 0,244, 0, 0, 0,246, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 0,241, + 0, 0, 0, 35, 0, 0, 0,241, 0, 0, 0,243, 0, 0, 0, 35, 0, 0, 0,124, 0, 0, 0,242, 0, 0, 0, 35, 0, 0, 0,242, + 0, 0, 0,244, 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 0,239, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 0,241, 0, 0, 0, 35, + 0, 0, 0,126, 0, 0, 0,240, 0, 0, 0, 35, 0, 0, 0,240, 0, 0, 0,242, 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 0,235, + 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 0,239, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 0,236, 0, 0, 0, 35, 0, 0, 0,236, + 0, 0, 0,240, 0, 0, 0, 35, 0, 0, 0,127, 0, 0, 0,237, 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 0,237, 0, 0, 0, 35, + 0, 0, 0,128, 0, 0, 0,238, 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 0,238, 0, 0, 0, 35, 0, 0, 0,237, 0, 0, 0,255, + 0, 0, 0, 35, 0, 0, 0,238, 0, 0, 1, 0, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 1, 1, 0, 0, 0, 35, 0, 0, 1, 1, + 0, 0, 1, 19, 0, 0, 0, 35, 0, 0, 0,237, 0, 0, 1, 19, 0, 0, 0, 35, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 0, 35, + 0, 0, 0,238, 0, 0, 1, 20, 0, 0, 0, 35, 0, 0, 1, 2, 0, 0, 1, 20, 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 1, 21, + 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 1, 21, 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 1, 20, + 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 1, 17, 0, 0, 1, 21, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 1, 17, 0, 0, 0, 35, + 0, 0, 0,240, 0, 0, 1, 18, 0, 0, 0, 35, 0, 0, 1, 18, 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 1, 17, + 0, 0, 0, 35, 0, 0, 0,241, 0, 0, 1, 15, 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 1, 16, 0, 0, 0, 35, 0, 0, 1, 16, + 0, 0, 1, 18, 0, 0, 0, 35, 0, 0, 1, 13, 0, 0, 1, 15, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 1, 13, 0, 0, 0, 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 1, 26, 0, 0, 0, 35, 0, 0, 1, 4, + 0, 0, 1, 26, 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 1, 25, 0, 0, 0, 35, 0, 0, 1, 24, 0, 0, 1, 26, 0, 0, 0, 35, + 0, 0, 0,107, 0, 0, 1, 27, 0, 0, 0, 35, 0, 0, 0, 72, 0, 0, 1, 27, 0, 0, 0, 35, 0, 0, 0, 66, 0, 0, 0, 72, + 0, 0, 0, 35, 0, 0, 0,108, 0, 0, 1, 28, 0, 0, 0, 35, 0, 0, 0, 72, 0, 0, 1, 28, 0, 0, 0, 35, 0, 0, 0,105, + 0, 0, 1, 29, 0, 0, 0, 35, 0, 0, 1, 27, 0, 0, 1, 29, 0, 0, 0, 35, 0, 0, 0,106, 0, 0, 1, 30, 0, 0, 0, 35, + 0, 0, 1, 28, 0, 0, 1, 30, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 1, 31, 0, 0, 0, 35, 0, 0, 1, 29, 0, 0, 1, 31, + 0, 0, 0, 35, 0, 0, 0,104, 0, 0, 1, 32, 0, 0, 0, 35, 0, 0, 1, 30, 0, 0, 1, 32, 0, 0, 0, 35, 0, 0, 0,101, + 0, 0, 1, 33, 0, 0, 0, 35, 0, 0, 1, 31, 0, 0, 1, 33, 0, 0, 0, 35, 0, 0, 0,102, 0, 0, 1, 34, 0, 0, 0, 35, + 0, 0, 1, 32, 0, 0, 1, 34, 0, 0, 0, 35, 0, 0, 0, 99, 0, 0, 1, 35, 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 1, 35, + 0, 0, 0, 35, 0, 0, 0,100, 0, 0, 1, 36, 0, 0, 0, 35, 0, 0, 1, 34, 0, 0, 1, 36, 0, 0, 0, 35, 0, 0, 0, 97, + 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 1, 35, 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 0, 98, 0, 0, 1, 38, 0, 0, 0, 35, + 0, 0, 1, 36, 0, 0, 1, 38, 0, 0, 0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, 0, 35, 0, 0, 1, 59, 0, 0, 1, 97, + 0, 0, 0, 35, 0, 0, 0, 74, 0, 0, 0, 75, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 1, 98, 0, 0, 0, 35, 0, 0, 1, 37, + 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 1,107, 0, 0, 0, 35, 0, 0, 1, 35, 0, 0, 1,107, 0, 0, 0, 35, + 0, 0, 1, 38, 0, 0, 1,106, 0, 0, 0, 35, 0, 0, 1, 36, 0, 0, 1,108, 0, 0, 0, 35, 0, 0, 1,106, 0, 0, 1,108, + 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 1,111, 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 1,111, 0, 0, 0, 35, 0, 0, 1,107, + 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 1,106, 0, 0, 1,112, 0, 0, 0, 35, 0, 0, 1,108, 0, 0, 1,110, 0, 0, 0, 35, + 0, 0, 1,110, 0, 0, 1,112, 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 1,113, 0, 0, 0, 35, 0, 0, 1,113, 0, 0, 1,115, + 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 1,115, 0, 0, 0, 35, 0, 0, 1,112, 0, 0, 1,114, 0, 0, 0, 35, 0, 0, 1,110, + 0, 0, 1,116, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 1,116, 0, 0, 0, 35, 0, 0, 1,113, 0, 0, 1,119, 0, 0, 0, 35, + 0, 0, 1,117, 0, 0, 1,119, 0, 0, 0, 35, 0, 0, 1,115, 0, 0, 1,117, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 1,120, + 0, 0, 0, 35, 0, 0, 1,116, 0, 0, 1,118, 0, 0, 0, 35, 0, 0, 1,118, 0, 0, 1,120, 0, 0, 0, 35, 0, 0, 1, 57, + 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 1,117, 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1,119, 0, 0, 0, 35, + 0, 0, 1,118, 0, 0, 1,122, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 1,122, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 1,120, + 0, 0, 0, 35, 0, 0, 1, 97, 0, 0, 1,117, 0, 0, 0, 35, 0, 0, 1, 59, 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 1, 98, + 0, 0, 1,118, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 1,122, 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 1,115, 0, 0, 0, 35, + 0, 0, 1,100, 0, 0, 1,116, 0, 0, 0, 35, 0, 0, 1,101, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 1,102, 0, 0, 1,110, + 0, 0, 0, 35, 0, 0, 1,101, 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 1,103, 0, 0, 1,107, 0, 0, 0, 35, 0, 0, 1,104, + 0, 0, 1,108, 0, 0, 0, 35, 0, 0, 1,102, 0, 0, 1,104, 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 1,103, 0, 0, 0, 35, + 0, 0, 1, 34, 0, 0, 1,104, 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 1, 45, + 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 1,104, 0, 0, 0, 35, 0, 0, 1, 27, 0, 0, 1, 33, 0, 0, 0, 35, 0, 0, 1, 28, + 0, 0, 1, 34, 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 1, 27, 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 1, 28, 0, 0, 0, 35, + 0, 0, 0, 72, 0, 0, 0, 73, 0, 0, 0, 35, 0, 0, 1, 53, 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 1, 54, 0, 0, 1,106, + 0, 0, 0, 35, 0, 0, 1, 53, 0, 0, 1, 55, 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 1,111, 0, 0, 0, 35, 0, 0, 1, 56, + 0, 0, 1,112, 0, 0, 0, 35, 0, 0, 1, 54, 0, 0, 1, 56, 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 1,125, 0, 0, 0, 35, + 0, 0, 1,113, 0, 0, 1,125, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 1,126, 0, 0, 0, 35, 0, 0, 1, 56, 0, 0, 1,126, + 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1,125, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 1,126, 0, 0, 0, 35, 0, 0, 1, 93, + 0, 0, 1,129, 0, 0, 0, 35, 0, 0, 1,127, 0, 0, 1,129, 0, 0, 0, 35, 0, 0, 1, 91, 0, 0, 1,127, 0, 0, 0, 35, + 0, 0, 1, 94, 0, 0, 1,130, 0, 0, 0, 35, 0, 0, 1, 92, 0, 0, 1,128, 0, 0, 0, 35, 0, 0, 1,128, 0, 0, 1,130, + 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 1,129, 0, 0, 0, 35, 0, 0, 1, 61, + 0, 0, 1, 63, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 1,128, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 1, 64, 0, 0, 0, 35, + 0, 0, 1, 64, 0, 0, 1,130, 0, 0, 0, 35, 0, 0, 1, 43, 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 1, 44, 0, 0, 1,128, + 0, 0, 0, 35, 0, 0, 1, 43, 0, 0, 1, 87, 0, 0, 0, 35, 0, 0, 1, 85, 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 1, 44, + 0, 0, 1, 88, 0, 0, 0, 35, 0, 0, 1, 86, 0, 0, 1,128, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1, 65, 0, 0, 0, 35, + 0, 0, 1, 65, 0, 0, 1,123, 0, 0, 0, 35, 0, 0, 1,121, 0, 0, 1,123, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 1,124, + 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 1, 66, 0, 0, 0, 35, 0, 0, 1,122, 0, 0, 1,124, 0, 0, 0, 35, 0, 0, 1, 67, + 0, 0, 1,123, 0, 0, 0, 35, 0, 0, 1, 68, 0, 0, 1,124, 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 1,129, 0, 0, 0, 35, + 0, 0, 1, 63, 0, 0, 1, 65, 0, 0, 0, 35, 0, 0, 1,124, 0, 0, 1,130, 0, 0, 0, 35, 0, 0, 1, 64, 0, 0, 1, 66, + 0, 0, 0, 35, 0, 0, 1, 95, 0, 0, 1,123, 0, 0, 0, 35, 0, 0, 1, 96, 0, 0, 1,124, 0, 0, 0, 35, 0, 0, 1,131, + 0, 0, 1,143, 0, 0, 0, 35, 0, 0, 1,131, 0, 0, 1,157, 0, 0, 0, 35, 0, 0, 1,145, 0, 0, 1,157, 0, 0, 0, 35, + 0, 0, 1,143, 0, 0, 1,145, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 1,158, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 1,144, + 0, 0, 0, 35, 0, 0, 1,144, 0, 0, 1,146, 0, 0, 0, 35, 0, 0, 1,146, 0, 0, 1,158, 0, 0, 0, 35, 0, 0, 1,145, + 0, 0, 1,147, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 1,147, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 1,143, 0, 0, 0, 35, + 0, 0, 1,146, 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 1,142, 0, 0, 1,144, 0, 0, 0, 35, 0, 0, 1,142, 0, 0, 1,148, + 0, 0, 0, 35, 0, 0, 1,147, 0, 0, 1,149, 0, 0, 0, 35, 0, 0, 1,139, 0, 0, 1,149, 0, 0, 0, 35, 0, 0, 1,139, + 0, 0, 1,141, 0, 0, 0, 35, 0, 0, 1,148, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 1,140, 0, 0, 1,142, 0, 0, 0, 35, + 0, 0, 1,140, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 1,149, 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 1,137, 0, 0, 1,151, + 0, 0, 0, 35, 0, 0, 1,137, 0, 0, 1,139, 0, 0, 0, 35, 0, 0, 1,150, 0, 0, 1,152, 0, 0, 0, 35, 0, 0, 1,138, + 0, 0, 1,140, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 1,152, 0, 0, 0, 35, 0, 0, 1,151, 0, 0, 1,153, 0, 0, 0, 35, + 0, 0, 1,135, 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 1,137, 0, 0, 0, 35, 0, 0, 1,152, 0, 0, 1,154, + 0, 0, 0, 35, 0, 0, 1,136, 0, 0, 1,138, 0, 0, 0, 35, 0, 0, 1,136, 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 1,153, + 0, 0, 1,155, 0, 0, 0, 35, 0, 0, 1,133, 0, 0, 1,155, 0, 0, 0, 35, 0, 0, 1,133, 0, 0, 1,135, 0, 0, 0, 35, + 0, 0, 1,154, 0, 0, 1,156, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 1,136, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 1,156, + 0, 0, 0, 35, 0, 0, 1,153, 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1,161, 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1,155, + 0, 0, 1,161, 0, 0, 0, 35, 0, 0, 1,162, 0, 0, 1,164, 0, 0, 0, 35, 0, 0, 1,154, 0, 0, 1,164, 0, 0, 0, 35, + 0, 0, 1,156, 0, 0, 1,162, 0, 0, 0, 35, 0, 0, 1,151, 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 1,163, 0, 0, 1,165, + 0, 0, 0, 35, 0, 0, 1,164, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 1,152, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 1,149, + 0, 0, 1,167, 0, 0, 0, 35, 0, 0, 1,165, 0, 0, 1,167, 0, 0, 0, 35, 0, 0, 1,166, 0, 0, 1,168, 0, 0, 0, 35, + 0, 0, 1,150, 0, 0, 1,168, 0, 0, 0, 35, 0, 0, 1,147, 0, 0, 1,169, 0, 0, 0, 35, 0, 0, 1,167, 0, 0, 1,169, + 0, 0, 0, 35, 0, 0, 1,168, 0, 0, 1,170, 0, 0, 0, 35, 0, 0, 1,148, 0, 0, 1,170, 0, 0, 0, 35, 0, 0, 1,145, + 0, 0, 1,171, 0, 0, 0, 35, 0, 0, 1,169, 0, 0, 1,171, 0, 0, 0, 35, 0, 0, 1,170, 0, 0, 1,172, 0, 0, 0, 35, + 0, 0, 1,146, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 1,157, 0, 0, 1,159, 0, 0, 0, 35, 0, 0, 1,159, 0, 0, 1,171, + 0, 0, 0, 35, 0, 0, 1,158, 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 1,160, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 1, 63, + 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1,185, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 1,185, 0, 0, 0, 35, + 0, 0, 1, 64, 0, 0, 1,188, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 1,186, 0, 0, 1,188, + 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 1,133, 0, 0, 0, 35, 0, 0, 1,155, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1, 64, + 0, 0, 1,134, 0, 0, 0, 35, 0, 0, 1,156, 0, 0, 1,188, 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 1,185, 0, 0, 0, 35, + 0, 0, 1, 56, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 1,125, 0, 0, 1,173, 0, 0, 0, 35, 0, 0, 1,157, 0, 0, 1,173, + 0, 0, 0, 35, 0, 0, 1,125, 0, 0, 1,131, 0, 0, 0, 35, 0, 0, 1,158, 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 1,126, + 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 1,126, 0, 0, 1,132, 0, 0, 0, 35, 0, 0, 1,161, 0, 0, 1,183, 0, 0, 0, 35, + 0, 0, 1,183, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1,162, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 1,184, 0, 0, 1,188, + 0, 0, 0, 35, 0, 0, 1,181, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 1,187, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 1,181, + 0, 0, 1,183, 0, 0, 0, 35, 0, 0, 1,188, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 1,182, 0, 0, 1,190, 0, 0, 0, 35, + 0, 0, 1,182, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 1,177, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 1,179, 0, 0, 1,181, + 0, 0, 0, 35, 0, 0, 1,177, 0, 0, 1,179, 0, 0, 0, 35, 0, 0, 1,178, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 1,178, + 0, 0, 1,180, 0, 0, 0, 35, 0, 0, 1,180, 0, 0, 1,182, 0, 0, 0, 35, 0, 0, 1,175, 0, 0, 1,191, 0, 0, 0, 35, + 0, 0, 1,189, 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 1,175, 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 1,190, 0, 0, 1,192, + 0, 0, 0, 35, 0, 0, 1,176, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 1,176, 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 1,173, + 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 1,175, 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 1,173, 0, 0, 1,193, 0, 0, 0, 33, + 0, 0, 1,174, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 1,174, 0, 0, 1,194, 0, 0, 0, 33, 0, 0, 1,176, 0, 0, 1,194, + 0, 0, 0, 35, 0, 0, 1,159, 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 1,160, 0, 0, 1,194, 0, 0, 0, 35, 0, 0, 1, 55, + 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 1, 56, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 1,185, 0, 0, 1,189, 0, 0, 0, 35, + 0, 0, 1,186, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 1,193, 0, 0, 1,195, 0, 0, 0, 35, 0, 0, 1,195, 0, 0, 1,219, + 0, 0, 0, 35, 0, 0, 1,159, 0, 0, 1,219, 0, 0, 0, 35, 0, 0, 1,194, 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 1,160, + 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 1,196, 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 1,175, 0, 0, 1,205, 0, 0, 0, 35, + 0, 0, 1,195, 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 1,176, 0, 0, 1,206, 0, 0, 0, 35, 0, 0, 1,196, 0, 0, 1,206, + 0, 0, 0, 35, 0, 0, 1,177, 0, 0, 1,203, 0, 0, 0, 35, 0, 0, 1,203, 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 1,178, + 0, 0, 1,204, 0, 0, 0, 35, 0, 0, 1,204, 0, 0, 1,206, 0, 0, 0, 35, 0, 0, 1,179, 0, 0, 1,201, 0, 0, 0, 35, + 0, 0, 1,201, 0, 0, 1,203, 0, 0, 0, 35, 0, 0, 1,180, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 1,202, 0, 0, 1,204, + 0, 0, 0, 35, 0, 0, 1,181, 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1,199, 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 1,182, + 0, 0, 1,200, 0, 0, 0, 35, 0, 0, 1,200, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 1,183, 0, 0, 1,197, 0, 0, 0, 35, + 0, 0, 1,197, 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1,184, 0, 0, 1,198, 0, 0, 0, 35, 0, 0, 1,198, 0, 0, 1,200, + 0, 0, 0, 35, 0, 0, 1,161, 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 1,197, 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 1,162, + 0, 0, 1,218, 0, 0, 0, 35, 0, 0, 1,198, 0, 0, 1,218, 0, 0, 0, 35, 0, 0, 1,207, 0, 0, 1,219, 0, 0, 0, 35, + 0, 0, 1,171, 0, 0, 1,207, 0, 0, 0, 35, 0, 0, 1,172, 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 1,208, 0, 0, 1,220, + 0, 0, 0, 35, 0, 0, 1,207, 0, 0, 1,209, 0, 0, 0, 35, 0, 0, 1,169, 0, 0, 1,209, 0, 0, 0, 35, 0, 0, 1,170, + 0, 0, 1,210, 0, 0, 0, 35, 0, 0, 1,208, 0, 0, 1,210, 0, 0, 0, 35, 0, 0, 1,209, 0, 0, 1,211, 0, 0, 0, 35, + 0, 0, 1,167, 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 1,168, 0, 0, 1,212, 0, 0, 0, 35, 0, 0, 1,210, 0, 0, 1,212, + 0, 0, 0, 35, 0, 0, 1,211, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 1,165, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 1,166, + 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1,212, 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1,213, 0, 0, 1,215, 0, 0, 0, 35, + 0, 0, 1,163, 0, 0, 1,215, 0, 0, 0, 35, 0, 0, 1,164, 0, 0, 1,216, 0, 0, 0, 35, 0, 0, 1,214, 0, 0, 1,216, + 0, 0, 0, 35, 0, 0, 1,215, 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 1,216, 0, 0, 1,218, 0, 0, 0, 35, 0, 0, 1,199, + 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1,221, 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1,201, 0, 0, 1,221, 0, 0, 0, 35, + 0, 0, 1,200, 0, 0, 1,224, 0, 0, 0, 35, 0, 0, 1,202, 0, 0, 1,222, 0, 0, 0, 35, 0, 0, 1,222, 0, 0, 1,224, + 0, 0, 0, 35, 0, 0, 1,223, 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 1,225, 0, 0, 1,227, 0, 0, 0, 33, 0, 0, 1,221, + 0, 0, 1,227, 0, 0, 0, 35, 0, 0, 1,224, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1,222, 0, 0, 1,228, 0, 0, 0, 35, + 0, 0, 1,226, 0, 0, 1,228, 0, 0, 0, 33, 0, 0, 1,225, 0, 0, 1,231, 0, 0, 0, 35, 0, 0, 1,229, 0, 0, 1,231, + 0, 0, 0, 35, 0, 0, 1,227, 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 1,226, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 1,228, + 0, 0, 1,230, 0, 0, 0, 35, 0, 0, 1,230, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 1,231, 0, 0, 1,233, 0, 0, 0, 35, + 0, 0, 1,233, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1,229, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1,232, 0, 0, 1,234, + 0, 0, 0, 35, 0, 0, 1,230, 0, 0, 1,236, 0, 0, 0, 35, 0, 0, 1,234, 0, 0, 1,236, 0, 0, 0, 35, 0, 0, 1,219, + 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 1,207, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1,220, 0, 0, 1,230, 0, 0, 0, 35, + 0, 0, 1,208, 0, 0, 1,236, 0, 0, 0, 35, 0, 0, 1,195, 0, 0, 1,227, 0, 0, 0, 35, 0, 0, 1,196, 0, 0, 1,228, + 0, 0, 0, 35, 0, 0, 1,205, 0, 0, 1,221, 0, 0, 0, 35, 0, 0, 1,206, 0, 0, 1,222, 0, 0, 0, 35, 0, 0, 1,217, + 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1,218, 0, 0, 1,224, 0, 0, 0, 35, 0, 0, 1,215, 0, 0, 1,225, 0, 0, 0, 35, + 0, 0, 1,216, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1,213, 0, 0, 1,231, 0, 0, 0, 35, 0, 0, 1,214, 0, 0, 1,232, + 0, 0, 0, 35, 0, 0, 1,211, 0, 0, 1,233, 0, 0, 0, 35, 0, 0, 1,212, 0, 0, 1,234, 0, 0, 0, 35, 0, 0, 1,209, + 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1,210, 0, 0, 1,236, 0, 0, 0, 35, 0, 0, 1,133, 0, 0, 1,247, 0, 0, 0, 35, + 0, 0, 1,245, 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 1,248, + 0, 0, 0, 35, 0, 0, 1,136, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 1,246, 0, 0, 1,248, 0, 0, 0, 35, 0, 0, 1,243, + 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 1,137, 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 1,244, 0, 0, 0, 35, + 0, 0, 1,244, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 1,241, 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 1,139, 0, 0, 1,241, + 0, 0, 0, 35, 0, 0, 1,140, 0, 0, 1,242, 0, 0, 0, 35, 0, 0, 1,242, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 1,239, + 0, 0, 1,241, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 1,239, 0, 0, 0, 35, 0, 0, 1,142, 0, 0, 1,240, 0, 0, 0, 35, + 0, 0, 1,240, 0, 0, 1,242, 0, 0, 0, 35, 0, 0, 1,237, 0, 0, 1,239, 0, 0, 0, 35, 0, 0, 1,143, 0, 0, 1,237, + 0, 0, 0, 35, 0, 0, 1,144, 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 1,238, 0, 0, 1,240, 0, 0, 0, 35, 0, 0, 1,237, + 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 1,131, 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 1,250, 0, 0, 0, 35, + 0, 0, 1,238, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1,237, 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 1,247, 0, 0, 1,249, + 0, 0, 0, 35, 0, 0, 1,238, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 1,248, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1,239, + 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 1,240, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1,249, 0, 0, 0, 35, + 0, 0, 1, 58, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1, 65, 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 1,248, + 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 39, 16, 3,153, 98, 32, 0, 0, 0, 48, 0, 0, 1,244, 0, 0, 0, 46, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 44, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, 45, 0, 0, 0, 3, + 0, 0, 0, 44, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 42, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 45, + 0, 0, 0, 43, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 8, 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 0, 0,165, + 0, 0, 0,167, 0, 0, 0, 82, 0, 0, 0, 3, 0, 0, 0,168, 0, 0, 0,166, 0, 0, 0, 81, 0, 0, 0, 83, 0, 0, 0, 3, + 0, 0, 0, 78, 0, 0, 0, 91, 0, 0, 0,145, 0, 0, 0,163, 0, 0, 0, 3, 0, 0, 0,146, 0, 0, 0, 92, 0, 0, 0, 79, + 0, 0, 0,164, 0, 0, 0, 3, 0, 0, 0, 91, 0, 0, 0, 93, 0, 0, 0,147, 0, 0, 0,145, 0, 0, 0, 3, 0, 0, 0,148, + 0, 0, 0, 94, 0, 0, 0, 92, 0, 0, 0,146, 0, 0, 0, 3, 0, 0, 0, 93, 0, 0, 0, 95, 0, 0, 0,149, 0, 0, 0,147, + 0, 0, 0, 3, 0, 0, 0,150, 0, 0, 0, 96, 0, 0, 0, 94, 0, 0, 0,148, 0, 0, 0, 3, 0, 0, 0, 95, 0, 0, 0, 97, + 0, 0, 0,151, 0, 0, 0,149, 0, 0, 0, 3, 0, 0, 0,152, 0, 0, 0, 98, 0, 0, 0, 96, 0, 0, 0,150, 0, 0, 0, 3, + 0, 0, 0, 97, 0, 0, 0, 99, 0, 0, 0,153, 0, 0, 0,151, 0, 0, 0, 3, 0, 0, 0,154, 0, 0, 0,100, 0, 0, 0, 98, + 0, 0, 0,152, 0, 0, 0, 3, 0, 0, 0, 99, 0, 0, 0,101, 0, 0, 0,155, 0, 0, 0,153, 0, 0, 0, 3, 0, 0, 0,156, + 0, 0, 0,102, 0, 0, 0,100, 0, 0, 0,154, 0, 0, 0, 3, 0, 0, 0,101, 0, 0, 0,103, 0, 0, 0,157, 0, 0, 0,155, + 0, 0, 0, 3, 0, 0, 0,158, 0, 0, 0,104, 0, 0, 0,102, 0, 0, 0,156, 0, 0, 0, 3, 0, 0, 0,103, 0, 0, 0,105, + 0, 0, 0,159, 0, 0, 0,157, 0, 0, 0, 3, 0, 0, 0,160, 0, 0, 0,106, 0, 0, 0,104, 0, 0, 0,158, 0, 0, 0, 3, + 0, 0, 0,105, 0, 0, 0,107, 0, 0, 0,161, 0, 0, 0,159, 0, 0, 0, 3, 0, 0, 0,162, 0, 0, 0,108, 0, 0, 0,106, + 0, 0, 0,160, 0, 0, 0, 3, 0, 0, 0,107, 0, 0, 0, 66, 0, 0, 0, 67, 0, 0, 0,161, 0, 0, 0, 3, 0, 0, 0, 67, + 0, 0, 0, 66, 0, 0, 0,108, 0, 0, 0,162, 0, 0, 0, 3, 0, 0, 0,109, 0, 0, 0,127, 0, 0, 0,159, 0, 0, 0,161, + 0, 0, 0, 3, 0, 0, 0,160, 0, 0, 0,128, 0, 0, 0,110, 0, 0, 0,162, 0, 0, 0, 3, 0, 0, 0,127, 0, 0, 0,178, + 0, 0, 0,157, 0, 0, 0,159, 0, 0, 0, 3, 0, 0, 0,158, 0, 0, 0,179, 0, 0, 0,128, 0, 0, 0,160, 0, 0, 0, 3, + 0, 0, 0,125, 0, 0, 0,155, 0, 0, 0,157, 0, 0, 0,178, 0, 0, 0, 3, 0, 0, 0,158, 0, 0, 0,156, 0, 0, 0,126, + 0, 0, 0,179, 0, 0, 0, 3, 0, 0, 0,123, 0, 0, 0,153, 0, 0, 0,155, 0, 0, 0,125, 0, 0, 0, 3, 0, 0, 0,156, + 0, 0, 0,154, 0, 0, 0,124, 0, 0, 0,126, 0, 0, 0, 3, 0, 0, 0,121, 0, 0, 0,151, 0, 0, 0,153, 0, 0, 0,123, + 0, 0, 0, 3, 0, 0, 0,154, 0, 0, 0,152, 0, 0, 0,122, 0, 0, 0,124, 0, 0, 0, 3, 0, 0, 0,119, 0, 0, 0,149, + 0, 0, 0,151, 0, 0, 0,121, 0, 0, 0, 3, 0, 0, 0,152, 0, 0, 0,150, 0, 0, 0,120, 0, 0, 0,122, 0, 0, 0, 3, + 0, 0, 0,117, 0, 0, 0,147, 0, 0, 0,149, 0, 0, 0,119, 0, 0, 0, 3, 0, 0, 0,150, 0, 0, 0,148, 0, 0, 0,118, + 0, 0, 0,120, 0, 0, 0, 3, 0, 0, 0,115, 0, 0, 0,145, 0, 0, 0,147, 0, 0, 0,117, 0, 0, 0, 3, 0, 0, 0,148, + 0, 0, 0,146, 0, 0, 0,116, 0, 0, 0,118, 0, 0, 0, 3, 0, 0, 0,113, 0, 0, 0,163, 0, 0, 0,145, 0, 0, 0,115, + 0, 0, 0, 3, 0, 0, 0,146, 0, 0, 0,164, 0, 0, 0,114, 0, 0, 0,116, 0, 0, 0, 3, 0, 0, 0,113, 0, 0, 0,180, + 0, 0, 0,176, 0, 0, 0,163, 0, 0, 0, 3, 0, 0, 0,176, 0, 0, 0,181, 0, 0, 0,114, 0, 0, 0,164, 0, 0, 0, 3, + 0, 0, 0,109, 0, 0, 0,161, 0, 0, 0, 67, 0, 0, 0,111, 0, 0, 0, 3, 0, 0, 0, 67, 0, 0, 0,162, 0, 0, 0,110, + 0, 0, 0,112, 0, 0, 0, 3, 0, 0, 0,111, 0, 0, 0, 67, 0, 0, 0,177, 0, 0, 0,182, 0, 0, 0, 3, 0, 0, 0,177, + 0, 0, 0, 67, 0, 0, 0,112, 0, 0, 0,183, 0, 0, 0, 3, 0, 0, 0,176, 0, 0, 0,180, 0, 0, 0,182, 0, 0, 0,177, + 0, 0, 0, 3, 0, 0, 0,183, 0, 0, 0,181, 0, 0, 0,176, 0, 0, 0,177, 0, 0, 0, 3, 0, 0, 0,134, 0, 0, 0,136, + 0, 0, 0,175, 0, 0, 0,173, 0, 0, 0, 3, 0, 0, 0,175, 0, 0, 0,136, 0, 0, 0,135, 0, 0, 0,174, 0, 0, 0, 3, + 0, 0, 0,132, 0, 0, 0,134, 0, 0, 0,173, 0, 0, 0,171, 0, 0, 0, 3, 0, 0, 0,174, 0, 0, 0,135, 0, 0, 0,133, + 0, 0, 0,172, 0, 0, 0, 3, 0, 0, 0,130, 0, 0, 0,132, 0, 0, 0,171, 0, 0, 0,169, 0, 0, 0, 3, 0, 0, 0,172, + 0, 0, 0,133, 0, 0, 0,131, 0, 0, 0,170, 0, 0, 0, 3, 0, 0, 0,165, 0, 0, 0,186, 0, 0, 0,184, 0, 0, 0,167, + 0, 0, 0, 3, 0, 0, 0,185, 0, 0, 0,187, 0, 0, 0,166, 0, 0, 0,168, 0, 0, 0, 3, 0, 0, 0,130, 0, 0, 0,169, + 0, 0, 0,167, 0, 0, 0,184, 0, 0, 0, 3, 0, 0, 0,168, 0, 0, 0,170, 0, 0, 0,131, 0, 0, 0,185, 0, 0, 0, 3, + 0, 0, 0,143, 0, 0, 0,189, 0, 0, 0,188, 0, 0, 0,186, 0, 0, 0, 3, 0, 0, 0,188, 0, 0, 0,189, 0, 0, 0,144, + 0, 0, 0,187, 0, 0, 0, 3, 0, 0, 0,184, 0, 0, 0,186, 0, 0, 0,188, 0, 0, 0, 68, 0, 0, 0, 3, 0, 0, 0,188, + 0, 0, 0,187, 0, 0, 0,185, 0, 0, 0, 68, 0, 0, 0, 3, 0, 0, 0,129, 0, 0, 0,130, 0, 0, 0,184, 0, 0, 0, 68, + 0, 0, 0, 3, 0, 0, 0,185, 0, 0, 0,131, 0, 0, 0,129, 0, 0, 0, 68, 0, 0, 0, 3, 0, 0, 0,141, 0, 0, 0,192, + 0, 0, 0,190, 0, 0, 0,143, 0, 0, 0, 3, 0, 0, 0,191, 0, 0, 0,193, 0, 0, 0,142, 0, 0, 0,144, 0, 0, 0, 3, + 0, 0, 0,139, 0, 0, 0,194, 0, 0, 0,192, 0, 0, 0,141, 0, 0, 0, 3, 0, 0, 0,193, 0, 0, 0,195, 0, 0, 0,140, + 0, 0, 0,142, 0, 0, 0, 3, 0, 0, 0,138, 0, 0, 0,196, 0, 0, 0,194, 0, 0, 0,139, 0, 0, 0, 3, 0, 0, 0,195, + 0, 0, 0,197, 0, 0, 0,138, 0, 0, 0,140, 0, 0, 0, 3, 0, 0, 0,137, 0, 0, 0, 70, 0, 0, 0,196, 0, 0, 0,138, + 0, 0, 0, 3, 0, 0, 0,197, 0, 0, 0, 70, 0, 0, 0,137, 0, 0, 0,138, 0, 0, 0, 3, 0, 0, 0,189, 0, 0, 0,143, + 0, 0, 0,190, 0, 0, 0, 69, 0, 0, 0, 3, 0, 0, 0,191, 0, 0, 0,144, 0, 0, 0,189, 0, 0, 0, 69, 0, 0, 0, 3, + 0, 0, 0, 69, 0, 0, 0,190, 0, 0, 0,205, 0, 0, 0,207, 0, 0, 0, 3, 0, 0, 0,206, 0, 0, 0,191, 0, 0, 0, 69, + 0, 0, 0,207, 0, 0, 0, 3, 0, 0, 0, 70, 0, 0, 0,198, 0, 0, 0,199, 0, 0, 0,196, 0, 0, 0, 3, 0, 0, 0,200, + 0, 0, 0,198, 0, 0, 0, 70, 0, 0, 0,197, 0, 0, 0, 3, 0, 0, 0,196, 0, 0, 0,199, 0, 0, 0,201, 0, 0, 0,194, + 0, 0, 0, 3, 0, 0, 0,202, 0, 0, 0,200, 0, 0, 0,197, 0, 0, 0,195, 0, 0, 0, 3, 0, 0, 0,194, 0, 0, 0,201, + 0, 0, 0,203, 0, 0, 0,192, 0, 0, 0, 3, 0, 0, 0,204, 0, 0, 0,202, 0, 0, 0,195, 0, 0, 0,193, 0, 0, 0, 3, + 0, 0, 0,192, 0, 0, 0,203, 0, 0, 0,205, 0, 0, 0,190, 0, 0, 0, 3, 0, 0, 0,206, 0, 0, 0,204, 0, 0, 0,193, + 0, 0, 0,191, 0, 0, 0, 3, 0, 0, 0,198, 0, 0, 0,203, 0, 0, 0,201, 0, 0, 0,199, 0, 0, 0, 3, 0, 0, 0,202, + 0, 0, 0,204, 0, 0, 0,198, 0, 0, 0,200, 0, 0, 0, 3, 0, 0, 0,198, 0, 0, 0,207, 0, 0, 0,205, 0, 0, 0,203, + 0, 0, 0, 3, 0, 0, 0,206, 0, 0, 0,207, 0, 0, 0,198, 0, 0, 0,204, 0, 0, 0, 3, 0, 0, 0,138, 0, 0, 0,139, + 0, 0, 0,163, 0, 0, 0,176, 0, 0, 0, 3, 0, 0, 0,164, 0, 0, 0,140, 0, 0, 0,138, 0, 0, 0,176, 0, 0, 0, 3, + 0, 0, 0,139, 0, 0, 0,141, 0, 0, 0,210, 0, 0, 0,163, 0, 0, 0, 3, 0, 0, 0,211, 0, 0, 0,142, 0, 0, 0,140, + 0, 0, 0,164, 0, 0, 0, 3, 0, 0, 0,141, 0, 0, 0,143, 0, 0, 0,212, 0, 0, 0,210, 0, 0, 0, 3, 0, 0, 0,213, + 0, 0, 0,144, 0, 0, 0,142, 0, 0, 0,211, 0, 0, 0, 3, 0, 0, 0,143, 0, 0, 0,186, 0, 0, 0,165, 0, 0, 0,212, + 0, 0, 0, 3, 0, 0, 0,166, 0, 0, 0,187, 0, 0, 0,144, 0, 0, 0,213, 0, 0, 0, 3, 0, 0, 0, 80, 0, 0, 0,208, + 0, 0, 0,212, 0, 0, 0,165, 0, 0, 0, 3, 0, 0, 0,213, 0, 0, 0,209, 0, 0, 0, 81, 0, 0, 0,166, 0, 0, 0, 3, + 0, 0, 0,208, 0, 0, 0,214, 0, 0, 0,210, 0, 0, 0,212, 0, 0, 0, 3, 0, 0, 0,211, 0, 0, 0,215, 0, 0, 0,209, + 0, 0, 0,213, 0, 0, 0, 3, 0, 0, 0, 78, 0, 0, 0,163, 0, 0, 0,210, 0, 0, 0,214, 0, 0, 0, 3, 0, 0, 0,211, + 0, 0, 0,164, 0, 0, 0, 79, 0, 0, 0,215, 0, 0, 0, 3, 0, 0, 0,130, 0, 0, 0,129, 0, 0, 0, 71, 0, 0, 0,221, + 0, 0, 0, 3, 0, 0, 0, 71, 0, 0, 0,129, 0, 0, 0,131, 0, 0, 0,222, 0, 0, 0, 3, 0, 0, 0,132, 0, 0, 0,130, + 0, 0, 0,221, 0, 0, 0,219, 0, 0, 0, 3, 0, 0, 0,222, 0, 0, 0,131, 0, 0, 0,133, 0, 0, 0,220, 0, 0, 0, 3, + 0, 0, 0,134, 0, 0, 0,132, 0, 0, 0,219, 0, 0, 0,217, 0, 0, 0, 3, 0, 0, 0,220, 0, 0, 0,133, 0, 0, 0,135, + 0, 0, 0,218, 0, 0, 0, 3, 0, 0, 0,136, 0, 0, 0,134, 0, 0, 0,217, 0, 0, 0,216, 0, 0, 0, 3, 0, 0, 0,218, + 0, 0, 0,135, 0, 0, 0,136, 0, 0, 0,216, 0, 0, 0, 3, 0, 0, 0,216, 0, 0, 0,217, 0, 0, 0,228, 0, 0, 0,230, + 0, 0, 0, 3, 0, 0, 0,229, 0, 0, 0,218, 0, 0, 0,216, 0, 0, 0,230, 0, 0, 0, 3, 0, 0, 0,217, 0, 0, 0,219, + 0, 0, 0,226, 0, 0, 0,228, 0, 0, 0, 3, 0, 0, 0,227, 0, 0, 0,220, 0, 0, 0,218, 0, 0, 0,229, 0, 0, 0, 3, + 0, 0, 0,219, 0, 0, 0,221, 0, 0, 0,224, 0, 0, 0,226, 0, 0, 0, 3, 0, 0, 0,225, 0, 0, 0,222, 0, 0, 0,220, + 0, 0, 0,227, 0, 0, 0, 3, 0, 0, 0,221, 0, 0, 0, 71, 0, 0, 0,223, 0, 0, 0,224, 0, 0, 0, 3, 0, 0, 0,223, + 0, 0, 0, 71, 0, 0, 0,222, 0, 0, 0,225, 0, 0, 0, 3, 0, 0, 0,223, 0, 0, 0,230, 0, 0, 0,228, 0, 0, 0,224, + 0, 0, 0, 3, 0, 0, 0,229, 0, 0, 0,230, 0, 0, 0,223, 0, 0, 0,225, 0, 0, 0, 3, 0, 0, 0,224, 0, 0, 0,228, + 0, 0, 0,226, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,227, 0, 0, 0,229, 0, 0, 0,225, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0,182, 0, 0, 0,180, 0, 0, 0,233, 0, 0, 0,231, 0, 0, 0, 3, 0, 0, 0,234, 0, 0, 0,181, 0, 0, 0,183, + 0, 0, 0,232, 0, 0, 0, 3, 0, 0, 0,111, 0, 0, 0,182, 0, 0, 0,231, 0, 0, 0,253, 0, 0, 0, 3, 0, 0, 0,232, + 0, 0, 0,183, 0, 0, 0,112, 0, 0, 0,254, 0, 0, 0, 3, 0, 0, 0,109, 0, 0, 0,111, 0, 0, 0,253, 0, 0, 0,255, + 0, 0, 0, 3, 0, 0, 0,254, 0, 0, 0,112, 0, 0, 0,110, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0,180, 0, 0, 0,113, + 0, 0, 0,251, 0, 0, 0,233, 0, 0, 0, 3, 0, 0, 0,252, 0, 0, 0,114, 0, 0, 0,181, 0, 0, 0,234, 0, 0, 0, 3, + 0, 0, 0,113, 0, 0, 0,115, 0, 0, 0,249, 0, 0, 0,251, 0, 0, 0, 3, 0, 0, 0,250, 0, 0, 0,116, 0, 0, 0,114, + 0, 0, 0,252, 0, 0, 0, 3, 0, 0, 0,115, 0, 0, 0,117, 0, 0, 0,247, 0, 0, 0,249, 0, 0, 0, 3, 0, 0, 0,248, + 0, 0, 0,118, 0, 0, 0,116, 0, 0, 0,250, 0, 0, 0, 3, 0, 0, 0,117, 0, 0, 0,119, 0, 0, 0,245, 0, 0, 0,247, + 0, 0, 0, 3, 0, 0, 0,246, 0, 0, 0,120, 0, 0, 0,118, 0, 0, 0,248, 0, 0, 0, 3, 0, 0, 0,119, 0, 0, 0,121, + 0, 0, 0,243, 0, 0, 0,245, 0, 0, 0, 3, 0, 0, 0,244, 0, 0, 0,122, 0, 0, 0,120, 0, 0, 0,246, 0, 0, 0, 3, + 0, 0, 0,121, 0, 0, 0,123, 0, 0, 0,241, 0, 0, 0,243, 0, 0, 0, 3, 0, 0, 0,242, 0, 0, 0,124, 0, 0, 0,122, + 0, 0, 0,244, 0, 0, 0, 3, 0, 0, 0,123, 0, 0, 0,125, 0, 0, 0,239, 0, 0, 0,241, 0, 0, 0, 3, 0, 0, 0,240, + 0, 0, 0,126, 0, 0, 0,124, 0, 0, 0,242, 0, 0, 0, 3, 0, 0, 0,125, 0, 0, 0,178, 0, 0, 0,235, 0, 0, 0,239, + 0, 0, 0, 3, 0, 0, 0,236, 0, 0, 0,179, 0, 0, 0,126, 0, 0, 0,240, 0, 0, 0, 3, 0, 0, 0,178, 0, 0, 0,127, + 0, 0, 0,237, 0, 0, 0,235, 0, 0, 0, 3, 0, 0, 0,238, 0, 0, 0,128, 0, 0, 0,179, 0, 0, 0,236, 0, 0, 0, 3, + 0, 0, 0,127, 0, 0, 0,109, 0, 0, 0,255, 0, 0, 0,237, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0,110, 0, 0, 0,128, + 0, 0, 0,238, 0, 0, 0, 3, 0, 0, 0,237, 0, 0, 0,255, 0, 0, 1, 1, 0, 0, 1, 19, 0, 0, 0, 3, 0, 0, 1, 2, + 0, 0, 1, 0, 0, 0, 0,238, 0, 0, 1, 20, 0, 0, 0, 3, 0, 0, 0,235, 0, 0, 0,237, 0, 0, 1, 19, 0, 0, 1, 21, + 0, 0, 0, 3, 0, 0, 1, 20, 0, 0, 0,238, 0, 0, 0,236, 0, 0, 1, 22, 0, 0, 0, 3, 0, 0, 0,239, 0, 0, 0,235, + 0, 0, 1, 21, 0, 0, 1, 17, 0, 0, 0, 3, 0, 0, 1, 22, 0, 0, 0,236, 0, 0, 0,240, 0, 0, 1, 18, 0, 0, 0, 3, + 0, 0, 0,241, 0, 0, 0,239, 0, 0, 1, 17, 0, 0, 1, 15, 0, 0, 0, 3, 0, 0, 1, 18, 0, 0, 0,240, 0, 0, 0,242, + 0, 0, 1, 16, 0, 0, 0, 3, 0, 0, 0,243, 0, 0, 0,241, 0, 0, 1, 15, 0, 0, 1, 13, 0, 0, 0, 3, 0, 0, 1, 16, + 0, 0, 0,242, 0, 0, 0,244, 0, 0, 1, 14, 0, 0, 0, 3, 0, 0, 0,245, 0, 0, 0,243, 0, 0, 1, 13, 0, 0, 1, 11, + 0, 0, 0, 3, 0, 0, 1, 14, 0, 0, 0,244, 0, 0, 0,246, 0, 0, 1, 12, 0, 0, 0, 3, 0, 0, 0,247, 0, 0, 0,245, + 0, 0, 1, 11, 0, 0, 1, 9, 0, 0, 0, 3, 0, 0, 1, 12, 0, 0, 0,246, 0, 0, 0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,114, 0, 0, 1,112, 0, 0, 1,110, 0, 0, 1,116, 0, 0, 0, 3, 0, 0, 1,115, 0, 0, 1,113, + 0, 0, 1,119, 0, 0, 1,117, 0, 0, 0, 3, 0, 0, 1,120, 0, 0, 1,114, 0, 0, 1,116, 0, 0, 1,118, 0, 0, 0, 3, + 0, 0, 1, 57, 0, 0, 1,121, 0, 0, 1,117, 0, 0, 1,119, 0, 0, 0, 3, 0, 0, 1,118, 0, 0, 1,122, 0, 0, 1, 58, + 0, 0, 1,120, 0, 0, 0, 3, 0, 0, 1, 59, 0, 0, 1, 97, 0, 0, 1,117, 0, 0, 1,121, 0, 0, 0, 3, 0, 0, 1,118, + 0, 0, 1, 98, 0, 0, 1, 60, 0, 0, 1,122, 0, 0, 0, 3, 0, 0, 1, 97, 0, 0, 1, 99, 0, 0, 1,115, 0, 0, 1,117, + 0, 0, 0, 3, 0, 0, 1,116, 0, 0, 1,100, 0, 0, 1, 98, 0, 0, 1,118, 0, 0, 0, 3, 0, 0, 1, 99, 0, 0, 1,101, + 0, 0, 1,109, 0, 0, 1,115, 0, 0, 0, 3, 0, 0, 1,110, 0, 0, 1,102, 0, 0, 1,100, 0, 0, 1,116, 0, 0, 0, 3, + 0, 0, 1,101, 0, 0, 1,103, 0, 0, 1,107, 0, 0, 1,109, 0, 0, 0, 3, 0, 0, 1,108, 0, 0, 1,104, 0, 0, 1,102, + 0, 0, 1,110, 0, 0, 0, 3, 0, 0, 1, 33, 0, 0, 1, 35, 0, 0, 1,107, 0, 0, 1,103, 0, 0, 0, 3, 0, 0, 1,108, + 0, 0, 1, 36, 0, 0, 1, 34, 0, 0, 1,104, 0, 0, 0, 3, 0, 0, 0, 73, 0, 0, 1,103, 0, 0, 1,101, 0, 0, 1, 45, + 0, 0, 0, 3, 0, 0, 1,102, 0, 0, 1,104, 0, 0, 0, 73, 0, 0, 1, 45, 0, 0, 0, 3, 0, 0, 1, 27, 0, 0, 1, 29, + 0, 0, 1, 31, 0, 0, 1, 33, 0, 0, 0, 3, 0, 0, 1, 32, 0, 0, 1, 30, 0, 0, 1, 28, 0, 0, 1, 34, 0, 0, 0, 3, + 0, 0, 1, 27, 0, 0, 1, 33, 0, 0, 1,103, 0, 0, 0, 73, 0, 0, 0, 3, 0, 0, 1,104, 0, 0, 1, 34, 0, 0, 1, 28, + 0, 0, 0, 73, 0, 0, 0, 3, 0, 0, 0, 72, 0, 0, 1, 27, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 73, + 0, 0, 1, 28, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 37, 0, 0, 1, 39, 0, 0, 1, 53, 0, 0, 1,105, + 0, 0, 0, 3, 0, 0, 1, 54, 0, 0, 1, 40, 0, 0, 1, 38, 0, 0, 1,106, 0, 0, 0, 3, 0, 0, 1, 53, 0, 0, 1, 55, + 0, 0, 1,111, 0, 0, 1,105, 0, 0, 0, 3, 0, 0, 1,112, 0, 0, 1, 56, 0, 0, 1, 54, 0, 0, 1,106, 0, 0, 0, 3, + 0, 0, 1, 55, 0, 0, 1,125, 0, 0, 1,113, 0, 0, 1,111, 0, 0, 0, 3, 0, 0, 1,114, 0, 0, 1,126, 0, 0, 1, 56, + 0, 0, 1,112, 0, 0, 0, 3, 0, 0, 1, 57, 0, 0, 1,119, 0, 0, 1,113, 0, 0, 1,125, 0, 0, 0, 3, 0, 0, 1,114, + 0, 0, 1,120, 0, 0, 1, 58, 0, 0, 1,126, 0, 0, 0, 3, 0, 0, 1, 91, 0, 0, 1, 93, 0, 0, 1,129, 0, 0, 1,127, + 0, 0, 0, 3, 0, 0, 1,130, 0, 0, 1, 94, 0, 0, 1, 92, 0, 0, 1,128, 0, 0, 0, 3, 0, 0, 1, 61, 0, 0, 1,127, + 0, 0, 1,129, 0, 0, 1, 63, 0, 0, 0, 3, 0, 0, 1,130, 0, 0, 1,128, 0, 0, 1, 62, 0, 0, 1, 64, 0, 0, 0, 3, + 0, 0, 1, 41,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 1, 68, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,143, 0, 0, 1,131, 0, 0, 1,157, 0, 0, 1,145, 0, 0, 0, 3, 0, 0, 1,158, + 0, 0, 1,132, 0, 0, 1,144, 0, 0, 1,146, 0, 0, 0, 3, 0, 0, 1,143, 0, 0, 1,145, 0, 0, 1,147, 0, 0, 1,141, + 0, 0, 0, 3, 0, 0, 1,148, 0, 0, 1,146, 0, 0, 1,144, 0, 0, 1,142, 0, 0, 0, 3, 0, 0, 1,141, 0, 0, 1,147, + 0, 0, 1,149, 0, 0, 1,139, 0, 0, 0, 3, 0, 0, 1,150, 0, 0, 1,148, 0, 0, 1,142, 0, 0, 1,140, 0, 0, 0, 3, + 0, 0, 1,139, 0, 0, 1,149, 0, 0, 1,151, 0, 0, 1,137, 0, 0, 0, 3, 0, 0, 1,152, 0, 0, 1,150, 0, 0, 1,140, + 0, 0, 1,138, 0, 0, 0, 3, 0, 0, 1,137, 0, 0, 1,151, 0, 0, 1,153, 0, 0, 1,135, 0, 0, 0, 3, 0, 0, 1,154, + 0, 0, 1,152, 0, 0, 1,138, 0, 0, 1,136, 0, 0, 0, 3, 0, 0, 1,135, 0, 0, 1,153, 0, 0, 1,155, 0, 0, 1,133, + 0, 0, 0, 3, 0, 0, 1,156, 0, 0, 1,154, 0, 0, 1,136, 0, 0, 1,134, 0, 0, 0, 3, 0, 0, 1,153, 0, 0, 1,163, + 0, 0, 1,161, 0, 0, 1,155, 0, 0, 0, 3, 0, 0, 1,162, 0, 0, 1,164, 0, 0, 1,154, 0, 0, 1,156, 0, 0, 0, 3, + 0, 0, 1,151, 0, 0, 1,165, 0, 0, 1,163, 0, 0, 1,153, 0, 0, 0, 3, 0, 0, 1,164, 0, 0, 1,166, 0, 0, 1,152, + 0, 0, 1,154, 0, 0, 0, 3, 0, 0, 1,149, 0, 0, 1,167, 0, 0, 1,165, 0, 0, 1,151, 0, 0, 0, 3, 0, 0, 1,166, + 0, 0, 1,168, 0, 0, 1,150, 0, 0, 1,152, 0, 0, 0, 3, 0, 0, 1,147, 0, 0, 1,169, 0, 0, 1,167, 0, 0, 1,149, + 0, 0, 0, 3, 0, 0, 1,168, 0, 0, 1,170, 0, 0, 1,148, 0, 0, 1,150, 0, 0, 0, 3, 0, 0, 1,145, 0, 0, 1,171, + 0, 0, 1,169, 0, 0, 1,147, 0, 0, 0, 3, 0, 0, 1,170, 0, 0, 1,172, 0, 0, 1,146, 0, 0, 1,148, 0, 0, 0, 3, + 0, 0, 1,145, 0, 0, 1,157, 0, 0, 1,159, 0, 0, 1,171, 0, 0, 0, 3, 0, 0, 1,160, 0, 0, 1,158, 0, 0, 1,146, + 0, 0, 1,172, 0, 0, 0, 3, 0, 0, 1, 61, 0, 0, 1, 63, 0, 0, 1,187, 0, 0, 1,185, 0, 0, 0, 3, 0, 0, 1,188, + 0, 0, 1, 64, 0, 0, 1, 62, 0, 0, 1,186, 0, 0, 0, 3, 0, 0, 1, 63, 0, 0, 1,133, 0, 0, 1,155, 0, 0, 1,187, + 0, 0, 0, 3, 0, 0, 1,156, 0, 0, 1,134, 0, 0, 1, 64, 0, 0, 1,188, 0, 0, 0, 3, 0, 0, 1, 53, 0, 0, 1, 61, + 0, 0, 1,185, 0, 0, 1, 55, 0, 0, 0, 3, 0, 0, 1,186, 0, 0, 1, 62, 0, 0, 1, 54, 0, 0, 1, 56, 0, 0, 0, 3, + 0, 0, 1,125, 0, 0, 1,173, 0, 0, 1,157, 0, 0, 1,131, 0, 0, 0, 3, 0, 0, 1,158, 0, 0, 1,174, 0, 0, 1,126, + 0, 0, 1,132, 0, 0, 0, 3, 0, 0, 1,155, 0, 0, 1,161, 0, 0, 1,183, 0, 0, 1,187, 0, 0, 0, 3, 0, 0, 1,184, + 0, 0, 1,162, 0, 0, 1,156, 0, 0, 1,188, 0, 0, 0, 3, 0, 0, 1,181, 0, 0, 1,189, 0, 0, 1,187, 0, 0, 1,183, + 0, 0, 0, 3, 0, 0, 1,188, 0, 0, 1,190, 0, 0, 1,182, 0, 0, 1,184, 0, 0, 0, 3, 0, 0, 1,177, 0, 0, 1,189, + 0, 0, 1,181, 0, 0, 1,179, 0, 0, 0, 3, 0, 0, 1,182, 0, 0, 1,190, 0, 0, 1,178, 0, 0, 1,180, 0, 0, 0, 3, + 0, 0, 1,175, 0, 0, 1,191, 0, 0, 1,189, 0, 0, 1,177, 0, 0, 0, 3, 0, 0, 1,190, 0, 0, 1,192, 0, 0, 1,176, + 0, 0, 1,178, 0, 0, 0, 3, 0, 0, 1,173, 0, 0, 1,191, 0, 0, 1,175, 0, 0, 1,193, 0, 0, 0, 3, 0, 0, 1,176, + 0, 0, 1,192, 0, 0, 1,174, 0, 0, 1,194, 0, 0, 0, 3, 0, 0, 1,157, 0, 0, 1,173, 0, 0, 1,193, 0, 0, 1,159, + 0, 0, 0, 3, 0, 0, 1,194, 0, 0, 1,174, 0, 0, 1,158, 0, 0, 1,160, 0, 0, 0, 3, 0, 0, 1, 55, 0, 0, 1,191, + 0, 0, 1,173, 0, 0, 1,125, 0, 0, 0, 3, 0, 0, 1,174, 0, 0, 1,192, 0, 0, 1, 56, 0, 0, 1,126, 0, 0, 0, 3, + 0, 0, 1, 55, 0, 0, 1,185, 0, 0, 1,189, 0, 0, 1,191, 0, 0, 0, 3, 0, 0, 1,190, 0, 0, 1,186, 0, 0, 1, 56, + 0, 0, 1,192, 0, 0, 0, 3, 0, 0, 1,185, 0, 0, 1,187, 0, 0, 1,189, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,190, + 0, 0, 1,188, 0, 0, 1,186, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,159, 0, 0, 1,193, 0, 0, 1,195, 0, 0, 1,219, + 0, 0, 0, 3, 0, 0, 1,196, 0, 0, 1,194, 0, 0, 1,160, 0, 0, 1,220, 0, 0, 0, 3, 0, 0, 1,193, 0, 0, 1,175, + 0, 0, 1,205, 0, 0, 1,195, 0, 0, 0, 3, 0, 0, 1,206, 0, 0, 1,176, 0, 0, 1,194, 0, 0, 1,196, 0, 0, 0, 3, + 0, 0, 1,175, 0, 0, 1,177, 0, 0, 1,203, 0, 0, 1,205, 0, 0, 0, 3, 0, 0, 1,204, 0, 0, 1,178, 0, 0, 1,176, + 0, 0, 1,206, 0, 0, 0, 3, 0, 0, 1,177, 0, 0, 1,179, 0, 0, 1,201, 0, 0, 1,203, 0, 0, 0, 3, 0, 0, 1,202, + 0, 0, 1,180, 0, 0, 1,178, 0, 0, 1,204, 0, 0, 0, 3, 0, 0, 1,179, 0, 0, 1,181, 0, 0, 1,199, 0, 0, 1,201, + 0, 0, 0, 3, 0, 0, 1,200, 0, 0, 1,182, 0, 0, 1,180, 0, 0, 1,202, 0, 0, 0, 3, 0, 0, 1,181, 0, 0, 1,183, + 0, 0, 1,197, 0, 0, 1,199, 0, 0, 0, 3, 0, 0, 1,198, 0, 0, 1,184, 0, 0, 1,182, 0, 0, 1,200, 0, 0, 0, 3, + 0, 0, 1,183, 0, 0, 1,161, 0, 0, 1,217, 0, 0, 1,197, 0, 0, 0, 3, 0, 0, 1,218, 0, 0, 1,162, 0, 0, 1,184, + 0, 0, 1,198, 0, 0, 0, 3, 0, 0, 1,171, 0, 0, 1,159, 0, 0, 1,219, 0, 0, 1,207, 0, 0, 0, 3, 0, 0, 1,220, + 0, 0, 1,160, 0, 0, 1,172, 0, 0, 1,208, 0, 0, 0, 3, 0, 0, 1,169, 0, 0, 1,171, 0, 0, 1,207, 0, 0, 1,209, + 0, 0, 0, 3, 0, 0, 1,208, 0, 0, 1,172, 0, 0, 1,170, 0, 0, 1,210, 0, 0, 0, 3, 0, 0, 1,167, 0, 0, 1,169, + 0, 0, 1,209, 0, 0, 1,211, 0, 0, 0, 3, 0, 0, 1,210, 0, 0, 1,170, 0, 0, 1,168, 0, 0, 1,212, 0, 0, 0, 3, + 0, 0, 1,165, 0, 0, 1,167, 0, 0, 1,211, 0, 0, 1,213, 0, 0, 0, 3, 0, 0, 1,212, 0, 0, 1,168, 0, 0, 1,166, + 0, 0, 1,214, 0, 0, 0, 3, 0, 0, 1,163, 0, 0, 1,165, 0, 0, 1,213, 0, 0, 1,215, 0, 0, 0, 3, 0, 0, 1,214, + 0, 0, 1,166, 0, 0, 1,164, 0, 0, 1,216, 0, 0, 0, 3, 0, 0, 1,161, 0, 0, 1,163, 0, 0, 1,215, 0, 0, 1,217, + 0, 0, 0, 3, 0, 0, 1,216, 0, 0, 1,164, 0, 0, 1,162, 0, 0, 1,218, 0, 0, 0, 3, 0, 0, 1,201, 0, 0, 1,199, + 0, 0, 1,223, 0, 0, 1,221, 0, 0, 0, 3, 0, 0, 1,224, 0, 0, 1,200, 0, 0, 1,202, 0, 0, 1,222, 0, 0, 0, 3, + 0, 0, 1,221, 0, 0, 1,223, 0, 0, 1,225, 0, 0, 1,227, 0, 0, 0, 3, 0, 0, 1,226, 0, 0, 1,224, 0, 0, 1,222, + 0, 0, 1,228, 0, 0, 0, 3, 0, 0, 1,227, 0, 0, 1,225, 0, 0, 1,231, 0, 0, 1,229, 0, 0, 0, 3, 0, 0, 1,232, + 0, 0, 1,226, 0, 0, 1,228, 0, 0, 1,230, 0, 0, 0, 3, 0, 0, 1,229, 0, 0, 1,231, 0, 0, 1,233, 0, 0, 1,235, + 0, 0, 0, 3, 0, 0, 1,234, 0, 0, 1,232, 0, 0, 1,230, 0, 0, 1,236, 0, 0, 0, 3, 0, 0, 1,207, 0, 0, 1,219, + 0, 0, 1,229, 0, 0, 1,235, 0, 0, 0, 3, 0, 0, 1,230, 0, 0, 1,220, 0, 0, 1,208, 0, 0, 1,236, 0, 0, 0, 3, + 0, 0, 1,195, 0, 0, 1,227, 0, 0, 1,229, 0, 0, 1,219, 0, 0, 0, 3, 0, 0, 1,230, 0, 0, 1,228, 0, 0, 1,196, + 0, 0, 1,220, 0, 0, 0, 3, 0, 0, 1,195, 0, 0, 1,205, 0, 0, 1,221, 0, 0, 1,227, 0, 0, 0, 3, 0, 0, 1,222, + 0, 0, 1,206, 0, 0, 1,196, 0, 0, 1,228, 0, 0, 0, 3, 0, 0, 1,201, 0, 0, 1,221, 0, 0, 1,205, 0, 0, 1,203, + 0, 0, 0, 3, 0, 0, 1,206, 0, 0, 1,222, 0, 0, 1,202, 0, 0, 1,204, 0, 0, 0, 3, 0, 0, 1,197, 0, 0, 1,217, + 0, 0, 1,223, 0, 0, 1,199, 0, 0, 0, 3, 0, 0, 1,224, 0, 0, 1,218, 0, 0, 1,198, 0, 0, 1,200, 0, 0, 0, 3, + 0, 0, 1,215, 0, 0, 1,225, 0, 0, 1,223, 0, 0, 1,217, 0, 0, 0, 3, 0, 0, 1,224, 0, 0, 1,226, 0, 0, 1,216, + 0, 0, 1,218, 0, 0, 0, 3, 0, 0, 1,213, 0, 0, 1,231, 0, 0, 1,225, 0, 0, 1,215, 0, 0, 0, 3, 0, 0, 1,226, + 0, 0, 1,232, 0, 0, 1,214, 0, 0, 1,216, 0, 0, 0, 3, 0, 0, 1,211, 0, 0, 1,233, 0, 0, 1,231, 0, 0, 1,213, + 0, 0, 0, 3, 0, 0, 1,232, 0, 0, 1,234, 0, 0, 1,212, 0, 0, 1,214, 0, 0, 0, 3, 0, 0, 1,209, 0, 0, 1,235, + 0, 0, 1,233, 0, 0, 1,211, 0, 0, 0, 3, 0, 0, 1,234, 0, 0, 1,236, 0, 0, 1,210, 0, 0, 1,212, 0, 0, 0, 3, + 0, 0, 1,207, 0, 0, 1,235, 0, 0, 1,209, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,210, 0, 0, 1,236, 0, 0, 1,208, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,135, 0, 0, 1,133, 0, 0, 1,247, 0, 0, 1,245, 0, 0, 0, 3, 0, 0, 1,248, + 0, 0, 1,134, 0, 0, 1,136, 0, 0, 1,246, 0, 0, 0, 3, 0, 0, 1,137, 0, 0, 1,135, 0, 0, 1,245, 0, 0, 1,243, + 0, 0, 0, 3, 0, 0, 1,246, 0, 0, 1,136, 0, 0, 1,138, 0, 0, 1,244, 0, 0, 0, 3, 0, 0, 1,139, 0, 0, 1,137, + 0, 0, 1,243, 0, 0, 1,241, 0, 0, 0, 3, 0, 0, 1,244, 0, 0, 1,138, 0, 0, 1,140, 0, 0, 1,242, 0, 0, 0, 3, + 0, 0, 1,141, 0, 0, 1,139, 0, 0, 1,241, 0, 0, 1,239, 0, 0, 0, 3, 0, 0, 1,242, 0, 0, 1,140, 0, 0, 1,142, + 0, 0, 1,240, 0, 0, 0, 3, 0, 0, 1,143, 0, 0, 1,141, 0, 0, 1,239, 0, 0, 1,237, 0, 0, 0, 3, 0, 0, 1,240, + 0, 0, 1,142, 0, 0, 1,144, 0, 0, 1,238, 0, 0, 0, 3, 0, 0, 1,131, 0, 0, 1,143, 0, 0, 1,237, 0, 0, 1,249, + 0, 0, 0, 3, 0, 0, 1,238, 0, 0, 1,144, 0, 0, 1,132, 0, 0, 1,250, 0, 0, 0, 3, 0, 0, 1,237, 0, 0, 1,245, + 0, 0, 1,247, 0, 0, 1,249, 0, 0, 0, 3, 0, 0, 1,248, 0, 0, 1,246, 0, 0, 1,238, 0, 0, 1,250, 0, 0, 0, 3, + 0, 0, 1,237, 0, 0, 1,239, 0, 0, 1,243, 0, 0, 1,245, 0, 0, 0, 3, 0, 0, 1,244, 0, 0, 1,240, 0, 0, 1,238, + 0, 0, 1,246, 0, 0, 0, 3, 0, 0, 1,239, 0, 0, 1,241, 0, 0, 1,243, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,244, + 0, 0, 1,242, 0, 0, 1,240, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 57, 0, 0, 1,125, 0, 0, 1,131, 0, 0, 1,249, + 0, 0, 0, 3, 0, 0, 1,132, 0, 0, 1,126, 0, 0, 1, 58, 0, 0, 1,250, 0, 0, 0, 3, 0, 0, 1, 57, 0, 0, 1,249, + 0, 0, 1,247, 0, 0, 1, 65, 0, 0, 0, 3, 0, 0, 1,248, 0, 0, 1,250, 0, 0, 1, 58, 0, 0, 1, 66, 0, 0, 0, 3, + 0, 0, 1, 63, 0, 0, 1, 65, 0, 0, 1,247, 0, 0, 1,133, 0, 0, 0, 3, 0, 0, 1,248, 0, 0, 1, 66, 0, 0, 1, 64, + 0, 0, 1,134, 0, 0, 0, 3, 0, 0, 77, 69, 0, 0, 0,188, 3, 59,130,192, 0, 0, 0, 47, 0, 0, 0, 1, 3, 59,133,192, + 3, 59,129,208, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 67,117, 98,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 56,212,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 59,133, 64, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,131,176, 3, 59,132,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 4, 0, 0, 0, 1, + 51,128, 0, 0,180, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 4, 63,128, 0, 4, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,160, + 3, 59,131,176, 0, 0, 0, 52, 0, 0, 0, 8, 63,128, 0, 0, 63,127,255,255,191,128, 0, 0, 73,230, 73,230,182, 26, 2,255, + 63,128, 0, 0,191,128, 0, 0,191,128, 0, 0, 90,129, 0, 0,165,127, 2,255,191,128, 0, 1,191,127,255,253,191,128, 0, 0, +165,127, 0, 0,165,127, 2,255,191,127,255,250, 63,128, 0, 3,191,128, 0, 0,182, 26, 73,230,182, 26, 2,255, 63,128, 0, 4, + 63,127,255,247, 63,128, 0, 0, 90,129, 90,129, 0, 0, 3,255, 63,127,255,245,191,128, 0, 5, 63,128, 0, 0,127,255, 0, 0, + 0, 0, 0,255,191,128, 0, 3,191,127,255,250, 63,128, 0, 0,128, 1, 0, 0, 0, 0, 0,255,191,127,255,255, 63,128, 0, 0, + 63,128, 0, 0,165,127, 90,129, 0, 0, 3,255, 68, 65, 84, 65, 0, 0, 0,144, 3, 59,132,128, 0, 0, 0, 49, 0, 0, 0, 12, + 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 5, + 0, 0, 0, 6, 0, 0, 0,162, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 35, + 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 6, + 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 34, 68, 65, 84, 65, 0, 0, 0, 80, 3, 59,133, 64, 0, 0, 0, 48, + 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, + 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 77, 69, 0, 0, 0,188, 3, 59,133,192, + 0, 0, 0, 47, 0, 0, 0, 1, 3, 59,134,176, 3, 59,130,192, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69,112,114,101,118,105,101, +119, 0, 0, 0, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 56,214,160, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 54,175, 96, 7, 83,240, 32, 0, 0, 0, 0, 0, 0, 0, 0, 3,153,138, 32, + 7, 83,144, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,130, + 0, 0, 7,128, 0, 0, 5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,187, 89, 64, 64,187, 89, 64, + 64,187, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, + 0, 1, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 3, 54,175, 96, 0, 0, 0, 0, 0, 0, 0, 1, 3, 59,124,192, 68, 65, 84, 65, + 0, 0, 50, 40, 3,153,138, 32, 0, 0, 0, 52, 0, 0, 2,130, 0, 0, 0, 0, 52,129,183,166,192,187, 89, 64, 0, 0, 0, 0, +128, 1, 3,255, 64,135,144,195,192, 68,252, 96,192, 39,145,252, 92,158,188,182,198,195, 3,255,191,207, 31, 22,192,159, 93,194, +192, 39,145,252,220,160,147, 31,198,194, 3,255,192,167,145,189, 51,232, 11,214,192, 39,145,251,141,133, 0, 0,198,195, 3,255, +191,207, 31, 22, 64,159, 93,194,192, 39,145,250,220,160,108,225,198,194, 3,255, 64,135,144,195, 64, 68,252, 96,192, 39,145,250, + 92,158, 67, 74,198,195, 3,255, 63,207, 31, 22,192,159, 93,194, 64, 39,145,250, 35, 96,147, 31, 57, 62, 3,255,192,135,144,195, +192, 68,252, 96, 64, 39,145,250,163, 98,188,182, 57, 61, 3,255,192,135,144,195, 64, 68,252, 96, 64, 39,145,252,163, 98, 67, 74, + 57, 61, 3,255, 63,207, 31, 22, 64,159, 93,194, 64, 39,145,252, 35, 96,108,225, 57, 62, 3,255, 64,167,145,189,179,232, 11,214, + 64, 39,145,251,114,123, 0, 0, 57, 61, 3,255, 0, 0, 0, 0,180,129,183,166, 64,187, 89, 64, 0, 0, 0, 0,127,255, 3,255, + 64, 31, 94, 5,191,231,146, 73,192,159, 94,112, 54,112,216,115,147, 31, 3,255,191,115,124,146,192, 59, 88,202,192,159, 94,114, +235, 53,192, 1,147, 31, 3,255, 63,196,254, 18,192,151,145, 54,192, 68,254, 20, 33,165,152,116,188,182, 3,255, 64, 31, 94, 5, + 63,231,146, 77,192,159, 94,112, 54,112, 39,141,147, 31, 3,255, 64,159, 94, 34, 52, 8,100,231,192, 68,253,230,108,225, 0, 0, +188,182, 3,255,192, 68,253, 80, 52, 92,176, 70,192,159, 94, 80,188,182, 0, 0,147, 31, 3,255,192,128,238,107,192, 59, 88,243, +192, 68,253,238,167,235,192, 1,188,182, 3,255,191,115,124,146, 64, 59, 88,205,192,159, 94,114,235, 53, 63,255,147, 31, 3,255, +192,128,238,107, 64, 59, 88,244,192, 68,253,238,167,235, 63,255,188,182, 3,255, 63,196,254, 21, 64,151,145, 54,192, 68,254, 17, + 33,165,103,140,188,182, 3,255, 64,178, 45,238, 63,231,146,136, 51,160, 86, 86,121,187, 39,141, 0, 0, 3,255, 64,178, 45,238, +191,231,146,136,179,160, 86, 86,121,187,216,115, 0, 0, 3,255, 64, 92, 61,222,192,151,145,116,180, 81,227, 20, 75, 59,152,115, + 0, 0, 3,255, 0, 0, 0, 0,192,187, 89, 64,180,129,183,166, 0, 0,128, 1, 0, 0, 3,255,192, 92, 61,222,192,151,145,116, +180, 81,227, 20,180,197,152,115, 0, 0, 3,255,192,178, 45,238,191,231,146,136,179,160, 86, 86,134, 69,216,115, 0, 0, 3,255, +192,178, 45,238, 63,231,146,136, 51,160, 86, 86,134, 69, 39,141, 0, 0, 3,255,192, 92, 61,222, 64,151,145,116, 52, 81,227, 20, +180,197,103,141, 0, 0, 3,255, 0, 0, 0, 0, 64,187, 89, 64, 52,129,183,166, 0, 0,127,255, 0, 0, 3,255, 64, 92, 61,222, + 64,151,145,116, 52, 81,227, 20, 75, 59,103,141, 0, 0, 3,255, 64,128,238,107,192, 59, 88,244, 64, 68,253,238, 88, 21,192, 1, + 67, 74, 3,255,191,196,254, 21,192,151,145, 54, 64, 68,254, 17,222, 91,152,116, 67, 74, 3,255,192,159, 94, 34,180, 8,100,231, + 64, 68,253,230,147, 31, 0, 0, 67, 74, 3,255,191,196,254, 18, 64,151,145, 54, 64, 68,254, 20,222, 91,103,140, 67, 74, 3,255, + 64,128,238,107, 64, 59, 88,243, 64, 68,253,238, 88, 21, 63,255, 67, 74, 3,255, 64, 68,253, 80,180, 92,176, 70, 64,159, 94, 80, + 67, 74, 0, 0,108,225, 3,255, 63,115,124,146,192, 59, 88,205, 64,159, 94,114, 20,203,192, 1,108,225, 3,255,192, 31, 94, 5, +191,231,146, 77, 64,159, 94,112,201,144,216,115,108,225, 3,255,192, 31, 94, 5, 63,231,146, 73, 64,159, 94,112,201,144, 39,141, +108,225, 3,255, 63,115,124,146, 64, 59, 88,202, 64,159, 94,114, 20,203, 63,255,108,225, 3,255, 63,165,172, 68,191,112,187,226, +192,180, 55,208, 27, 45,236, 66,132,126, 3,255, 64, 95,196,100,192, 34,147, 13,192,124,198,189, 77, 56,199,230,170,185, 3,255, +190,253, 30,222,191,194,194,112,192,180, 55,208,245,159,224, 14,132,126, 3,255,191,170,240,131,192,131,134,210,192,124,198,200, +226,130,165, 58,170,185, 3,255, 64, 64, 32,141,192,129,250, 84,192, 61,126,166, 66,214,167,244,191,123, 3,255,189, 40,121,238, +192,161,158,120,192, 61,126,170,253,175,145,123,191,123, 3,255, 63,165,172, 68, 63,112,187,235,192,180, 55,208, 27, 45, 19,190, +132,126, 3,255, 64, 95,196,100, 64, 34,147, 15,192,124,198,189, 77, 56, 56, 26,170,185, 3,255, 64,153, 77, 89,191,204,199,236, +192, 61,126,133,104,100,219,165,191,123, 3,255, 64,153, 77, 89, 63,204,199,238,192, 61,126,133,104,100, 36, 91,191,123, 3,255, +191,204,200,173, 52,121,143,111,192,180, 55,199,222,105, 0, 0,132,126, 3,255,192,138, 75,191, 52, 47, 4,116,192,124,198, 84, +160,142, 0, 0,170,184, 3,255,192, 59,220,246,192,131,134,225,192, 61,126,162,192,235,165, 58,191,123, 3,255,192,154, 29,197, +191,194,194,172,192, 61,126, 91,150, 45,224, 14,191,123, 3,255,190,253, 30,222, 63,194,194,116,192,180, 55,208,245,159, 31,242, +132,126, 3,255,191,170,240,131, 64,131,134,211,192,124,198,197,226,130, 90,198,170,185, 3,255,192,154, 29,197, 63,194,194,174, +192, 61,126, 91,150, 45, 31,242,191,123, 3,255,192, 59,220,246, 64,131,134,225,192, 61,126,160,192,235, 90,198,191,123, 3,255, +189, 40,121,203, 64,161,158,120,192, 61,126,168,253,175,110,133,191,123, 3,255, 64, 64, 32,144, 64,129,250, 84,192, 61,126,164, + 66,214, 88, 12,191,123, 3,255, 64,163, 20,153, 64, 34,147, 37,191,174, 51,154,110,207, 56, 26,225, 18, 3,255, 64,179,182,246, + 63,112,188, 61, 63,174, 51, 96,122,159, 19,190, 30,237, 3,255, 64,163, 20,153,192, 34,147, 37,191,174, 51,156,110,207,199,230, +225, 19, 3,255, 64,179,182,246,191,112,188, 63, 63,174, 51, 96,122,159,236, 66, 30,237, 3,255, 64,127,104,189,192,129,250,128, +191,174, 51,162, 87,153,167,244,225, 19, 3,255, 64, 40, 78,241,192,161,158,170, 63,174, 51,166, 56,171,145,123, 30,237, 3,255, +191, 87, 81,103,192,180, 55,196,191,174, 51,160,236,227,133, 71,225, 19, 3,255, 63, 87, 81,103,192,180, 55,196, 63,174, 51,154, + 19, 29,133, 71, 30,237, 3,255,192, 40, 78,241,192,161,158,170,191,174, 51,170,199, 85,145,123,225, 19, 3,255,192,127,104,189, +192,129,250,128, 63,174, 51,160,168,103,167,244, 30,237, 3,255,192,179,182,246,191,112,188, 61,191,174, 51, 96,133, 97,236, 66, +225, 19, 3,255,192,163, 20,153,192, 34,147, 37, 63,174, 51,154,145, 49,199,230, 30,238, 3,255,192,179,182,246, 63,112,188, 63, +191,174, 51, 96,133, 97, 19,190,225, 19, 3,255,192,163, 20,153, 64, 34,147, 37, 63,174, 51,156,145, 49, 56, 26, 30,237, 3,255, +192, 40, 78,241, 64,161,158,170,191,174, 51,166,199, 85,110,133,225, 19, 3,255,192,127,104,189, 64,129,250,128, 63,174, 51,162, +168,103, 88, 12, 30,237, 3,255,191, 87, 81,103, 64,180, 55,196,191,174, 51,154,236,227,122,185,225, 19, 3,255, 63, 87, 81,103, + 64,180, 55,196, 63,174, 51,160, 19, 29,122,185, 30,237, 3,255, 64,127,104,189, 64,129,250,128,191,174, 51,160, 87,153, 88, 12, +225, 19, 3,255, 64, 40, 78,241, 64,161,158,170, 63,174, 51,170, 56,171,110,133, 30,237, 3,255, 64, 59,220,246,192,131,134,225, + 64, 61,126,160, 63, 21,165, 58, 64,133, 3,255, 64,154, 29,197,191,194,194,174, 64, 61,126, 91,105,211,224, 14, 64,133, 3,255, + 61, 40,121,203,192,161,158,120, 64, 61,126,168, 2, 81,145,123, 64,133, 3,255,192, 64, 32,144,192,129,250, 84, 64, 61,126,164, +189, 42,167,244, 64,133, 3,255,192,153, 77, 89,191,204,199,238, 64, 61,126,133,151,156,219,165, 64,133, 3,255,192,153, 77, 89, + 63,204,199,236, 64, 61,126,133,151,156, 36, 91, 64,133, 3,255,192, 64, 32,141, 64,129,250, 84, 64, 61,126,166,189, 42, 88, 12, + 64,133, 3,255, 61, 40,121,238, 64,161,158,120, 64, 61,126,170, 2, 81,110,133, 64,133, 3,255, 64, 59,220,246, 64,131,134,225, + 64, 61,126,162, 63, 21, 90,198, 64,133, 3,255, 64,154, 29,197, 63,194,194,172, 64, 61,126, 91,105,211, 31,242, 64,133, 3,255, + 64,138, 75,191,180, 47, 4,116, 64,124,198, 84, 95,114, 0, 0, 85, 72, 3,255, 63,204,200,173,180,121,143,111, 64,180, 55,199, + 33,151, 0, 0,123,130, 3,255, 63,170,240,131,192,131,134,211, 64,124,198,197, 29,126,165, 58, 85, 71, 3,255, 62,253, 30,222, +191,194,194,116, 64,180, 55,208, 10, 97,224, 14,123,130, 3,255,192, 95,196,100,192, 34,147, 15, 64,124,198,189,178,200,199,230, + 85, 71, 3,255,191,165,172, 68,191,112,187,235, 64,180, 55,208,228,211,236, 66,123,130, 3,255,192, 95,196,100, 64, 34,147, 13, + 64,124,198,189,178,200, 56, 26, 85, 71, 3,255,191,165,172, 68, 63,112,187,226, 64,180, 55,208,228,211, 19,190,123,130, 3,255, + 63,170,240,131, 64,131,134,210, 64,124,198,200, 29,126, 90,198, 85, 71, 3,255, 62,253, 30,222, 63,194,194,112, 64,180, 55,208, + 10, 97, 31,242,123,130, 3,255, 64, 7,145, 25,192, 92, 61, 64,192,135,145, 82, 44,235,180,198,162,178, 3,255, 63, 79, 32,238, +192, 31, 93,182,192,167,145,250, 18, 29,200, 63,142, 56, 3,255, 62,158, 62, 68,192,128,238, 59,192,135,145, 83, 7,224,168,189, +162,178, 3,255, 64,123, 90,114,191,115,125, 12,192,135,145, 70, 85,109,236,135,162,178, 3,255, 64, 39,145,127, 52,104, 11,198, +192,167,145,240, 58,159, 0, 0,142, 56, 3,255, 64,123, 90,114, 63,115,125, 17,192,135,145, 70, 85,109, 19,121,162,178, 3,255, +192, 39,145,142,192, 68,253, 15,192,135,145, 80,198, 86,190, 9,162,178, 3,255,192, 7,144,204,191,196,252,242,192,167,145,242, +208,147,221,139,142, 56, 3,255,192,111, 33, 55,191,196,253, 22,192,135,145, 53,175,113,221,139,162,178, 3,255,192,111, 33, 55, + 63,196,253, 25,192,135,145, 53,175,113, 34,117,162,178, 3,255,192, 7,144,204, 63,196,252,247,192,167,145,242,208,147, 34,117, +142, 56, 3,255,192, 39,145,142, 64, 68,253, 17,192,135,145, 80,198, 86, 65,247,162,178, 3,255, 62,158, 62, 72, 64,128,238, 60, +192,135,145, 83, 7,224, 87, 67,162,178, 3,255, 63, 79, 32,238, 64, 31, 93,184,192,167,145,250, 18, 29, 55,193,142, 56, 3,255, + 64, 7,145, 25, 64, 92, 61, 64,192,135,145, 81, 44,235, 75, 58,162,178, 3,255, 64,177,117,134,191,115,125, 94,191,207, 33, 40, +121,168,236,135,221, 82, 3,255, 64,177,117,134, 63,115,125, 96,191,207, 33, 40,121,168, 19,121,221, 82, 3,255, 64,187, 89, 64, + 0, 0, 0, 0, 0, 0, 0, 0,127,252, 0, 0,254,116, 3,255, 63, 79, 33,102,192,178, 45,204,191,207, 33,104, 19, 18,134, 72, +221, 82, 3,255, 64, 39,146, 16,192,159, 94, 42,191,207, 33, 92, 56, 29,146, 81,221, 82, 3,255, 63,231,147,105,192,178, 45,219, +180,118,188,176, 39,140,134, 72,254,116, 3,255,192,161,117, 52,192, 31, 93,241,191,207, 33, 58,146, 34,200, 63,221, 82, 3,255, +192,123, 90,196,192,128,238,114,191,207, 33, 58,169, 6,168,189,221, 82, 3,255,192,151,145,138,192, 92, 61,163,180, 24,125,204, +152,117,180,198,254,116, 3,255,192,123, 90,196, 64,128,238,114,191,207, 33, 56,169, 6, 87, 67,221, 82, 3,255,192,161,117, 52, + 64, 31, 93,241,191,207, 33, 56,146, 34, 55,193,221, 82, 3,255,192,151,145,138, 64, 92, 61,163, 52, 24,125,204,152,117, 75, 58, +254,116, 3,255, 64, 39,146, 17, 64,159, 94, 42,191,207, 33, 90, 56, 29,109,175,221, 82, 3,255, 63, 79, 33,103, 64,178, 45,202, +191,207, 33, 99, 19, 18,121,184,221, 82, 3,255, 63,231,147,105, 64,178, 45,219, 52,118,188,176, 39,140,121,184,254,116, 3,255, + 64,161,117, 52,192, 31, 93,241, 63,207, 33, 56,109,222,200, 63, 34,174, 3,255, 64,151,145,138,192, 92, 61,163,180, 24,125,204, +103,139,180,198, 1,140, 3,255, 64,123, 90,196,192,128,238,114, 63,207, 33, 56, 86,250,168,189, 34,174, 3,255,191, 79, 33,103, +192,178, 45,202, 63,207, 33, 99,236,238,134, 72, 34,174, 3,255,191,231,147,105,192,178, 45,219,180,118,188,176,216,116,134, 72, + 1,140, 3,255,192, 39,146, 17,192,159, 94, 42, 63,207, 33, 90,199,227,146, 81, 34,174, 3,255,192,177,117,134,191,115,125, 96, + 63,207, 33, 40,134, 88,236,135, 34,174, 3,255,192,187, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0,128, 4, 0, 0, 1,140, 3,255, +192,177,117,134, 63,115,125, 94, 63,207, 33, 40,134, 88, 19,121, 34,174, 3,255,192, 39,146, 16, 64,159, 94, 42, 63,207, 33, 92, +199,227,109,175, 34,174, 3,255,191,231,147,105, 64,178, 45,219, 52,118,188,176,216,116,121,184, 1,140, 3,255,191, 79, 33,102, + 64,178, 45,204, 63,207, 33,104,236,238,121,184, 34,174, 3,255, 64,123, 90,196, 64,128,238,114, 63,207, 33, 58, 86,250, 87, 67, + 34,174, 3,255, 64,151,145,138, 64, 92, 61,163, 52, 24,125,204,103,139, 75, 58, 1,140, 3,255, 64,161,117, 52, 64, 31, 93,241, + 63,207, 33, 58,109,222, 55,193, 34,174, 3,255, 64, 39,145,142,192, 68,253, 17, 64,135,145, 80, 57,170,190, 9, 93, 78, 3,255, + 64,111, 33, 55,191,196,253, 25, 64,135,145, 53, 80,143,221,139, 93, 78, 3,255, 64, 7,144,204,191,196,252,247, 64,167,145,242, + 47,109,221,139,113,200, 3,255,192, 7,145, 25,192, 92, 61, 64, 64,135,145, 81,211, 21,180,198, 93, 78, 3,255,190,158, 62, 76, +192,128,238, 60, 64,135,145, 83,248, 32,168,189, 93, 78, 3,255,191, 79, 32,238,192, 31, 93,184, 64,167,145,250,237,227,200, 63, +113,200, 3,255,192,123, 90,114, 63,115,125, 12, 64,135,145, 70,170,147, 19,121, 93, 78, 3,255,192,123, 90,114,191,115,125, 17, + 64,135,145, 70,170,147,236,135, 93, 78, 3,255,192, 39,145,127,180,104, 11,198, 64,167,145,240,197, 97, 0, 0,113,200, 3,255, +190,158, 62, 68, 64,128,238, 59, 64,135,145, 83,248, 32, 87, 67, 93, 78, 3,255,192, 7,145, 25, 64, 92, 61, 64, 64,135,145, 82, +211, 21, 75, 58, 93, 78, 3,255,191, 79, 32,238, 64, 31, 93,182, 64,167,145,250,237,227, 55,193,113,200, 3,255, 64,111, 33, 55, + 63,196,253, 22, 64,135,145, 53, 80,143, 34,117, 93, 78, 3,255, 64, 39,145,142, 64, 68,253, 15, 64,135,145, 80, 57,170, 65,247, + 93, 78, 3,255, 64, 7,144,204, 63,196,252,242, 64,167,145,242, 47,109, 34,117,113,200, 3,255, 63, 39, 66,179,190,243, 10, 91, +192,185,187,205, 13, 92,246, 76,129, 19, 3,255, 63,244,239,138,191,177,244, 56,192,171,199,156, 41, 94,225,242,138,170, 3,255, + 64,122, 24, 18,192, 53,179,169,192, 84, 91, 86, 85,223,193,157,184,120, 3,255, 64, 65,212,177,192, 12,211, 32,192,144,133,164, + 66,103,207,193,157,202, 3,255,190,127,139,187,191, 68,160, 51,192,185,187,205,250,230,240, 76,129, 19, 3,255,191, 59, 28, 68, +192, 15,248, 27,192,171,199,160,240, 52,207, 95,138,170, 3,255,191,191, 13, 15,192,147, 0, 76,192, 84, 91, 95,223, 52,155, 14, +184,121, 3,255,191,148, 18, 19,192, 99,220,112,192,144,133,165,230,163,177,240,157,202, 3,255, 64,106, 31, 84,192,102,219,243, +192, 52,105,160, 80,197,177,233,194,173, 3,255, 64, 19, 13,184,192,142,101,215,192, 67,124,168, 50,154,159, 32,189,101, 3,255, +191, 86,214,196,192,162, 49, 8,192, 52,105,161,236,143,145, 89,194,173, 3,255, 63, 65,187,181,192,158,107,124,192, 67,124,164, + 16, 0,147,226,189,101, 3,255, 63, 39, 66,179, 62,243, 10,108,192,185,187,205, 13, 92, 9,180,129, 19, 3,255, 63,244,239,138, + 63,177,244, 60,192,171,199,156, 41, 94, 30, 14,138,170, 3,255, 64,122, 24, 36, 64, 53,179,185,192, 84, 91, 93, 85,223, 62, 99, +184,120, 3,255, 64, 65,212,177, 64, 12,211, 34,192,144,133,164, 66,103, 48, 63,157,202, 3,255, 64,145,244,108,192, 23, 82, 63, +192, 52,105,140, 99, 58,203, 81,194,173, 3,255, 64,158, 38, 86,191, 79, 99,171,192, 67,124,124,107,198,237,208,189,101, 3,255, + 64,145,244,110, 64, 23, 82, 67,192, 52,105,139, 99, 58, 52,175,194,173, 3,255, 64,158, 38, 86, 63, 79, 99,175,192, 67,124,124, +107,198, 18, 48,189,101, 3,255,191, 78,191, 25, 52,126,127, 94,192,185,187,208,239,125, 0, 0,129, 19, 3,255,192, 23, 97, 18, + 52,107, 31,218,192,171,199,134,204,222, 0, 0,138,170, 3,255,192,154,145, 70, 52, 17,133, 48,192, 84, 91, 36,149,220, 0, 0, +184,120, 3,255,192,111,150,175, 52, 69,218, 93,192,144,133,120,173,235, 0, 0,157,202, 3,255,192, 19, 54,137,192,147, 0, 88, +192, 52,105,166,206,177,155, 14,194,173, 3,255,192, 97,106,126,192, 99,220,148,192, 67,124,143,179,129,177,240,189,101, 3,255, +192,162,141,165,191, 68,160,121,192, 52,105,115,144,194,240, 76,194,173, 3,255,192,143, 47, 14,192, 15,248, 68,192, 67,124,117, +158, 30,207, 95,189,101, 3,255,190,127,139,187, 63, 68,160, 59,192,185,187,205,250,230, 15,180,129, 19, 3,255,191, 59, 28, 68, + 64, 15,248, 30,192,171,199,160,240, 52, 48,161,138,170, 3,255,191,191, 13, 15, 64,147, 0, 76,192, 84, 91, 93,223, 52,100,242, +184,121, 3,255,191,148, 18, 19, 64, 99,220,115,192,144,133,164,230,163, 78, 16,157,202, 3,255,192,162,141,165, 63, 68,160,125, +192, 52,105,115,144,194, 15,180,194,173, 3,255,192,143, 47, 14, 64, 15,248, 70,192, 67,124,117,158, 30, 48,161,189,101, 3,255, +192, 19, 54,137, 64,147, 0, 88,192, 52,105,164,206,177,100,242,194,173, 3,255,192, 97,106,126, 64, 99,220,149,192, 67,124,142, +179,129, 78, 16,189,101, 3,255,191, 86,214,195, 64,162, 49, 8,192, 52,105,159,236,143,110,167,194,173, 3,255, 63, 65,187,185, + 64,158,107,124,192, 67,124,161, 16, 0,108, 30,189,101, 3,255, 64,106, 31, 90, 64,102,219,246,192, 52,105,157, 80,197, 78, 23, +194,173, 3,255, 64, 19, 13,186, 64,142,101,215,192, 67,124,165, 50,154, 96,224,189,101, 3,255, 64,150,228, 3, 64, 53,179,167, +192, 0,185,129,102, 97, 62, 99,211, 47, 3,255, 64,172,155, 50, 64, 12,211, 68,191, 48,107,191,117,138, 48, 63,240,135, 3,255, + 64,175,121,166, 62,243, 10,215, 64, 0,185,124,119,128, 9,180, 44,208, 3,255, 64,181, 7,115, 63,177,244,113, 63, 48,107, 94, +123,115, 30, 14, 15,121, 3,255, 64,150,228, 12,192, 53,179,179,192, 0,185,145,102, 97,193,157,211, 47, 3,255, 64,172,155, 50, +192, 12,211, 68,191, 48,107,193,117,138,207,193,240,135, 3,255, 64,175,121,166,190,243, 10,221, 64, 0,185,124,119,128,246, 76, + 44,208, 3,255, 64,181, 7,115,191,177,244,114, 63, 48,107, 94,123,115,225,242, 15,121, 3,255, 64,133, 8,140,192,102,220, 34, +192, 0,185,151, 90,249,177,233,211, 47, 3,255, 64,112,156,117,192,142,102, 25,191, 48,107,199, 82, 53,159, 32,240,135, 3,255, + 64, 9, 87,134,192,162, 49, 39, 64, 0,185,151, 46, 40,145, 89, 44,209, 3,255, 64, 68,129,119,192,158,107,189, 63, 48,107,200, + 66,187,147,225, 15,121, 3,255,191,159, 27,126,192,171,148,137,192, 0,185,149,228, 78,139, 90,211, 47, 3,255,190,218, 15,112, +192,185,234,179,191, 48,107,180,246,112,129, 78,240,135, 3,255, 63,159, 27,126,192,171,148,137, 64, 0,185,146, 27,178,139, 90, + 44,209, 3,255, 62,218, 15,112,192,185,234,179, 63, 48,107,170, 9,144,129, 78, 15,121, 3,255,192, 9, 87,134,192,162, 49, 39, +192, 0,185,153,209,216,145, 89,211, 47, 3,255,192, 68,129,119,192,158,107,189,191, 48,107,206,189, 69,147,225,240,135, 3,255, +192,133, 8,132,192,102,220, 22, 64, 0,185,135,165, 7,177,233, 44,209, 3,255,192,112,156,117,192,142,102, 25, 63, 48,107,195, +173,203,159, 32, 15,121, 3,255,192,175,121,166,190,243, 10,215,192, 0,185,124,136,128,246, 76,211, 48, 3,255,192,181, 7,115, +191,177,244,113,191, 48,107, 94,132,141,225,242,240,135, 3,255,192,150,228, 3,192, 53,179,167, 64, 0,185,129,153,159,193,157, + 44,209, 3,255,192,172,155, 50,192, 12,211, 68, 63, 48,107,191,138,118,207,193, 15,121, 3,255,192,175,121,166, 62,243, 10,221, +192, 0,185,124,136,128, 9,180,211, 48, 3,255,192,181, 7,115, 63,177,244,114,191, 48,107, 94,132,141, 30, 14,240,135, 3,255, +192,150,228, 12, 64, 53,179,179, 64, 0,185,145,153,159, 62, 99, 44,209, 3,255,192,172,155, 50, 64, 12,211, 68, 63, 48,107,193, +138,118, 48, 63, 15,121, 3,255,192, 9, 87,134, 64,162, 49, 39,192, 0,185,151,209,216,110,167,211, 47, 3,255,192, 68,129,119, + 64,158,107,189,191, 48,107,200,189, 69,108, 31,240,135, 3,255,192,133, 8,140, 64,102,220, 34, 64, 0,185,151,165, 7, 78, 23, + 44,209, 3,255,192,112,156,117, 64,142,102, 25, 63, 48,107,199,173,203, 96,224, 15,121, 3,255,191,159, 27,126, 64,171,148,137, +192, 0,185,146,228, 78,116,166,211, 47, 3,255,190,218, 15,112, 64,185,234,179,191, 48,107,170,246,112,126,178,240,135, 3,255, + 63,159, 27,126, 64,171,148,137, 64, 0,185,149, 27,178,116,166, 44,209, 3,255, 62,218, 15,112, 64,185,234,179, 63, 48,107,180, + 9,144,126,178, 15,121, 3,255, 64,133, 8,132, 64,102,220, 22,192, 0,185,135, 90,249, 78, 23,211, 47, 3,255, 64,112,156,117, + 64,142,102, 25,191, 48,107,195, 82, 53, 96,224,240,135, 3,255, 64, 9, 87,134, 64,162, 49, 39, 64, 0,185,153, 46, 40,110,167, + 44,209, 3,255, 64, 68,129,119, 64,158,107,189, 63, 48,107,206, 66,187,108, 31, 15,121, 3,255, 64, 19, 54,137,192,147, 0, 88, + 64, 52,105,164, 49, 79,155, 14, 61, 83, 3,255, 64, 97,106,126,192, 99,220,149, 64, 67,124,142, 76,127,177,240, 66,155, 3,255, + 64,162,141,165,191, 68,160,125, 64, 52,105,115,111, 62,240, 76, 61, 83, 3,255, 64,143, 47, 14,192, 15,248, 70, 64, 67,124,117, + 97,226,207, 95, 66,155, 3,255, 63, 86,214,195,192,162, 49, 8, 64, 52,105,159, 19,113,145, 89, 61, 83, 3,255,191, 65,187,185, +192,158,107,124, 64, 67,124,161,240, 0,147,226, 66,155, 3,255,192,106, 31, 90,192,102,219,246, 64, 52,105,157,175, 59,177,233, + 61, 83, 3,255,192, 19, 13,186,192,142,101,215, 64, 67,124,165,205,102,159, 32, 66,155, 3,255,192,145,244,110,192, 23, 82, 67, + 64, 52,105,139,156,198,203, 81, 61, 83, 3,255,192,158, 38, 86,191, 79, 99,175, 64, 67,124,124,148, 58,237,208, 66,155, 3,255, +192,145,244,108, 64, 23, 82, 63, 64, 52,105,140,156,198, 52,175, 61, 83, 3,255,192,158, 38, 86, 63, 79, 99,171, 64, 67,124,124, +148, 58, 18, 48, 66,155, 3,255,192,106, 31, 84, 64,102,219,243, 64, 52,105,160,175, 59, 78, 23, 61, 83, 3,255,192, 19, 13,184, + 64,142,101,215, 64, 67,124,168,205,102, 96,224, 66,155, 3,255, 63, 86,214,196, 64,162, 49, 8, 64, 52,105,161, 19,113,110,167, + 61, 83, 3,255,191, 65,187,181, 64,158,107,124, 64, 67,124,164,240, 0,108, 30, 66,155, 3,255, 64, 19, 54,137, 64,147, 0, 88, + 64, 52,105,166, 49, 79,100,242, 61, 83, 3,255, 64, 97,106,126, 64, 99,220,148, 64, 67,124,143, 76,127, 78, 16, 66,155, 3,255, + 64,162,141,165, 63, 68,160,121, 64, 52,105,115,111, 62, 15,180, 61, 83, 3,255, 64,143, 47, 14, 64, 15,248, 68, 64, 67,124,117, + 97,226, 48,161, 66,155, 3,255, 64,154,145, 70,180, 17,133, 48, 64, 84, 91, 36,106, 36, 0, 0, 71,136, 3,255, 64,111,150,175, +180, 69,218, 93, 64,144,133,120, 82, 21, 0, 0, 98, 54, 3,255, 63, 78,191, 25,180,126,127, 94, 64,185,187,208, 16,131, 0, 0, +126,237, 3,255, 64, 23, 97, 18,180,107, 31,218, 64,171,199,134, 51, 34, 0, 0,117, 86, 3,255, 63,191, 13, 15,192,147, 0, 76, + 64, 84, 91, 93, 32,204,155, 14, 71,135, 3,255, 63,148, 18, 19,192, 99,220,115, 64,144,133,164, 25, 93,177,240, 98, 54, 3,255, + 62,127,139,187,191, 68,160, 59, 64,185,187,205, 5, 26,240, 76,126,237, 3,255, 63, 59, 28, 68,192, 15,248, 30, 64,171,199,160, + 15,204,207, 95,117, 86, 3,255,192,122, 24, 36,192, 53,179,185, 64, 84, 91, 93,170, 33,193,157, 71,136, 3,255,192, 65,212,177, +192, 12,211, 34, 64,144,133,164,189,153,207,193, 98, 54, 3,255,191, 39, 66,179,190,243, 10,108, 64,185,187,205,242,164,246, 76, +126,237, 3,255,191,244,239,138,191,177,244, 60, 64,171,199,156,214,162,225,242,117, 86, 3,255,192,122, 24, 18, 64, 53,179,169, + 64, 84, 91, 86,170, 33, 62, 99, 71,136, 3,255,192, 65,212,177, 64, 12,211, 32, 64,144,133,164,189,153, 48, 63, 98, 54, 3,255, +191, 39, 66,179, 62,243, 10, 91, 64,185,187,205,242,164, 9,180,126,237, 3,255,191,244,239,138, 63,177,244, 56, 64,171,199,156, +214,162, 30, 14,117, 86, 3,255, 63,191, 13, 15, 64,147, 0, 76, 64, 84, 91, 95, 32,204,100,242, 71,135, 3,255, 63,148, 18, 19, + 64, 99,220,112, 64,144,133,165, 25, 93, 78, 16, 98, 54, 3,255, 62,127,139,187, 63, 68,160, 51, 64,185,187,205, 5, 26, 15,180, +126,237, 3,255, 63, 59, 28, 68, 64, 15,248, 27, 64,171,199,160, 15,204, 48,161,117, 86, 3,255, 64, 21,138,248,192, 42,105,206, +192,149,149, 95, 49,236,198, 3,153,102, 3,255, 63,237, 88, 66,192,132,182,148,192,109,108,160, 39, 84,165,105,174,149, 3,255, + 63,214, 47,159,192, 11,146, 94,192,165,204, 53, 36,248,207,108,143,129, 3,255,189,147, 52, 95,192, 47,221, 3,192,165,204, 33, +254,166,194,248,143,129, 3,255,190,166,130,182,192, 97,196, 44,192,149,149, 90,249,179,179,190,153,102, 3,255, 63,112, 9, 19, +192,142, 62,107,192,109,108,166, 21,110,159,152,174,149, 3,255, 64, 80, 72,241,191,179, 31, 82,192,149,149, 86, 70,148,226,113, +153,102, 3,255, 64,144,141,216,190,246,186, 92,192,109,108,135, 98, 80,246,151,174,149, 3,255, 64, 37,213,194,191,106,225,102, +192,165,204, 35, 57,160,235,218,143,129, 3,255, 64, 37,213,194, 63,106,225,110,192,165,204, 35, 57,160, 20, 38,143,129, 3,255, + 64, 80, 72,241, 63,179, 31, 85,192,149,149, 86, 70,148, 29,143,153,102, 3,255, 64,144,141,216, 62,246,186,101,192,109,108,135, + 98, 80, 9,105,174,149, 3,255,191,231,185, 68,192, 66,226, 56,192,149,149, 91,216, 71,190,154,153,102, 3,255,192, 87,195,219, +192, 66,226, 86,192,109,108,146,181,255,190,154,174,150, 3,255,191,199, 75,140,192, 16,251, 51,192,165,204, 49,221, 58,205,212, +143,129, 3,255,192, 40,173,206,191, 71,224, 82,192,165,204, 20,197,138,238,110,143,129, 3,255,192, 93, 38, 96,191, 71,224,102, +192,149,149, 54,181,135,238,110,153,102, 3,255,192,124, 5,156,192, 16,251, 86,192,109,108,129,170,239,205,212,174,149, 3,255, +192, 93, 38, 96, 63, 71,224,107,192,149,149, 54,181,135, 17,146,153,102, 3,255,192,124, 5,156, 64, 16,251, 87,192,109,108,129, +170,239, 50, 44,174,149, 3,255,192, 40,173,206, 63, 71,224, 89,192,165,204, 20,197,138, 17,146,143,129, 3,255,191,199, 75,140, + 64, 16,251, 53,192,165,204, 49,221, 58, 50, 44,143,129, 3,255,191,231,185, 68, 64, 66,226, 59,192,149,149, 91,216, 71, 65,102, +153,102, 3,255,192, 87,195,219, 64, 66,226, 87,192,109,108,146,181,255, 65,102,174,150, 3,255,190,166,130,180, 64, 97,196, 46, +192,149,149, 90,249,179, 76, 66,153,102, 3,255, 63,112, 9, 23, 64,142, 62,108,192,109,108,165, 21,110, 96,104,174,149, 3,255, + 63,214, 47,159, 64, 11,146, 96,192,165,204, 53, 36,248, 48,148,143,129, 3,255,189,147, 52, 96, 64, 47,221, 5,192,165,204, 33, +254,166, 61, 8,143,129, 3,255, 64, 21,138,248, 64, 42,105,207,192,149,149, 94, 49,236, 57,253,153,102, 3,255, 63,237, 88, 68, + 64,132,182,148,192,109,108,158, 39, 84, 90,151,174,149, 3,255, 64,170,211, 33,190,246,186,163,192, 24,104,236,116,202,246,151, +204,122, 3,255, 64,180, 93,120,191,179, 31,134,191, 82, 6,178,123, 86,226,113,238,194, 3,255, 64,170,211, 33, 62,246,186,169, +192, 24,104,236,116,202, 9,105,204,122, 3,255, 64,180, 93,120, 63,179, 31,134,191, 82, 6,178,123, 86, 29,143,238,194, 3,255, + 64,185, 96, 37, 63,106,225,166,186, 15,228,112,126,100, 20, 38,254,197, 3,255, 64,185, 96, 37,191,106,225,166,186, 15,233,114, +126,100,235,218,254,197, 3,255, 63,152,125, 62,192,167, 58,164,192, 24,105, 27, 27, 35,142, 5,204,122, 3,255, 62,210, 87,126, +192,185, 96, 33,191, 82, 6,240, 9,255,129,145,238,194, 3,255, 64, 6,232,178,192,157,178,203,192, 24,105, 26, 45, 10,147,214, +204,122, 3,255, 64, 68,166,195,192,157,178,228,191, 82, 6,223, 66, 58,147,214,238,194, 3,255, 64, 42,106, 94,192,167, 58,200, +186, 15,249, 32, 58, 56,142, 5,254,197, 3,255, 63,106,226, 91,192,185, 96, 31,186, 15,243,211, 19,229,129,145,254,197, 3,255, +192,147, 67,187,192, 47,221, 76,192, 24,105, 1,155,252,194,248,204,122, 3,255,192,172, 61,143,192, 11,146,133,191, 82, 6,184, +138,216,207,108,238,194, 3,255,192,129, 34,217,192, 97,196,126,192, 24,104,250,167, 13,179,190,204,122, 3,255,192,111, 49,112, +192,142, 62,171,191, 82, 6,194,173,153,159,151,238,194, 3,255,192,132,182,227,192,132,182,213,186, 15,241, 17,165,151,165,105, +254,197, 3,255,192,167, 58,235,192, 42,106, 25,186, 15,241, 48,141,231,198, 3,254,197, 3,255,192,129, 34,217, 64, 97,196,126, +192, 24,104,249,167, 13, 76, 66,204,122, 3,255,192,111, 49,112, 64,142, 62,171,191, 82, 6,190,173,153, 96,105,238,194, 3,255, +192,147, 67,187, 64, 47,221, 76,192, 24,105, 0,155,252, 61, 8,204,122, 3,255,192,172, 61,143, 64, 11,146,133,191, 82, 6,182, +138,216, 48,148,238,194, 3,255,192,167, 58,235, 64, 42,106, 25,186, 15,226,166,141,231, 57,253,254,197, 3,255,192,132,182,227, + 64,132,182,213,186, 15,218,107,165,151, 90,151,254,197, 3,255, 64, 6,232,180, 64,157,178,203,192, 24,105, 24, 45, 10,108, 42, +204,122, 3,255, 64, 68,166,196, 64,157,178,228,191, 82, 6,219, 66, 58,108, 42,238,194, 3,255, 63,152,125, 64, 64,167, 58,163, +192, 24,105, 24, 27, 35,113,251,204,122, 3,255, 62,210, 87,126, 64,185, 96, 32,191, 82, 6,230, 9,255,126,111,238,194, 3,255, + 63,106,226, 91, 64,185, 96, 31,186, 15,212, 49, 19,229,126,111,254,197, 3,255, 64, 42,106, 94, 64,167, 58,200,186, 15,220,150, + 58, 56,113,251,254,197, 3,255, 64,172, 61,143,192, 11,146,133, 63, 82, 6,182,117, 40,207,108, 17, 62, 3,255, 64,147, 67,187, +192, 47,221, 76, 64, 24,105, 0,100, 4,194,248, 51,134, 3,255, 64,167, 58,235,192, 42,106, 25, 58, 15,226,166,114, 25,198, 3, + 1, 59, 3,255, 64,132,182,227,192,132,182,213, 58, 15,218,107, 90,105,165,105, 1, 59, 3,255, 64,111, 49,112,192,142, 62,171, + 63, 82, 6,190, 82,103,159,151, 17, 62, 3,255, 64,129, 34,217,192, 97,196,126, 64, 24,104,249, 88,243,179,190, 51,134, 3,255, +190,210, 87,126,192,185, 96, 32, 63, 82, 6,230,246, 1,129,145, 17, 62, 3,255,191,152,125, 64,192,167, 58,163, 64, 24,105, 24, +228,221,142, 5, 51,134, 3,255,191,106,226, 91,192,185, 96, 31, 58, 15,212, 49,236, 27,129,145, 1, 59, 3,255,192, 42,106, 94, +192,167, 58,200, 58, 15,220,150,197,200,142, 5, 1, 59, 3,255,192, 68,166,196,192,157,178,228, 63, 82, 6,219,189,198,147,214, + 17, 62, 3,255,192, 6,232,180,192,157,178,203, 64, 24,105, 24,210,246,147,214, 51,134, 3,255,192,180, 93,120,191,179, 31,134, + 63, 82, 6,178,132,170,226,113, 17, 62, 3,255,192,170,211, 33,190,246,186,169, 64, 24,104,236,139, 54,246,151, 51,134, 3,255, +192,185, 96, 37,191,106,225,166, 58, 15,228,112,129,156,235,218, 1, 59, 3,255,192,185, 96, 37, 63,106,225,166, 58, 15,233,114, +129,156, 20, 38, 1, 59, 3,255,192,180, 93,120, 63,179, 31,134, 63, 82, 6,178,132,170, 29,143, 17, 62, 3,255,192,170,211, 33, + 62,246,186,163, 64, 24,104,236,139, 54, 9,105, 51,134, 3,255,192, 68,166,195, 64,157,178,228, 63, 82, 6,223,189,198,108, 42, + 17, 62, 3,255,192, 6,232,178, 64,157,178,203, 64, 24,105, 26,210,246,108, 42, 51,134, 3,255,192, 42,106, 94, 64,167, 58,200, + 58, 15,249, 32,197,200,113,251, 1, 59, 3,255,191,106,226, 91, 64,185, 96, 31, 58, 15,243,211,236, 27,126,111, 1, 59, 3,255, +190,210, 87,126, 64,185, 96, 33, 63, 82, 6,240,246, 1,126,111, 17, 62, 3,255,191,152,125, 62, 64,167, 58,164, 64, 24,105, 27, +228,221,113,251, 51,134, 3,255, 64,111, 49,112, 64,142, 62,171, 63, 82, 6,194, 82,103, 96,105, 17, 62, 3,255, 64,129, 34,217, + 64, 97,196,126, 64, 24,104,250, 88,243, 76, 66, 51,134, 3,255, 64,167, 58,235, 64, 42,106, 25, 58, 15,241, 48,114, 25, 57,253, + 1, 59, 3,255, 64,132,182,227, 64,132,182,213, 58, 15,241, 17, 90,105, 90,151, 1, 59, 3,255, 64,172, 61,143, 64, 11,146,133, + 63, 82, 6,184,117, 40, 48,148, 17, 62, 3,255, 64,147, 67,187, 64, 47,221, 76, 64, 24,105, 1,100, 4, 61, 8, 51,134, 3,255, + 64, 87,195,219,192, 66,226, 87, 64,109,108,146, 74, 1,190,154, 81,106, 3,255, 63,231,185, 68,192, 66,226, 59, 64,149,149, 91, + 39,185,190,154,102,154, 3,255, 64,124, 5,156,192, 16,251, 87, 64,109,108,129, 85, 17,205,212, 81,106, 3,255, 64, 93, 38, 96, +191, 71,224,107, 64,149,149, 54, 74,121,238,110,102,154, 3,255, 64, 40,173,206,191, 71,224, 89, 64,165,204, 20, 58,118,238,110, +112,127, 3,255, 63,199, 75,140,192, 16,251, 53, 64,165,204, 49, 34,198,205,212,112,127, 3,255,191,237, 88, 68,192,132,182,148, + 64,109,108,158,216,172,165,105, 81,107, 3,255,192, 21,138,248,192, 42,105,207, 64,149,149, 94,206, 20,198, 3,102,154, 3,255, +191,112, 9, 24,192,142, 62,108, 64,109,108,165,234,146,159,152, 81,107, 3,255, 62,166,130,178,192, 97,196, 46, 64,149,149, 90, + 6, 77,179,190,102,154, 3,255, 61,147, 52, 96,192, 47,221, 5, 64,165,204, 33, 1, 90,194,248,112,127, 3,255,191,214, 47,159, +192, 11,146, 96, 64,165,204, 53,219, 8,207,108,112,127, 3,255,192,144,141,216, 62,246,186, 92, 64,109,108,135,157,176, 9,105, + 81,107, 3,255,192, 80, 72,241, 63,179, 31, 82, 64,149,149, 86,185,108, 29,143,102,154, 3,255,192,144,141,216,190,246,186,101, + 64,109,108,135,157,176,246,151, 81,107, 3,255,192, 80, 72,241,191,179, 31, 85, 64,149,149, 86,185,108,226,113,102,154, 3,255, +192, 37,213,194,191,106,225,110, 64,165,204, 35,198, 96,235,218,112,127, 3,255,192, 37,213,194, 63,106,225,102, 64,165,204, 35, +198, 96, 20, 38,112,127, 3,255,191,112, 9, 19, 64,142, 62,107, 64,109,108,166,234,146, 96,104, 81,107, 3,255, 62,166,130,182, + 64, 97,196, 44, 64,149,149, 90, 6, 77, 76, 66,102,154, 3,255,191,237, 88, 66, 64,132,182,148, 64,109,108,160,216,172, 90,151, + 81,107, 3,255,192, 21,138,248, 64, 42,105,206, 64,149,149, 95,206, 20, 57,253,102,154, 3,255,191,214, 47,159, 64, 11,146, 94, + 64,165,204, 53,219, 8, 48,148,112,127, 3,255, 61,147, 52, 95, 64, 47,221, 3, 64,165,204, 33, 1, 90, 61, 8,112,127, 3,255, + 64,124, 5,156, 64, 16,251, 86, 64,109,108,129, 85, 17, 50, 44, 81,107, 3,255, 64, 93, 38, 96, 63, 71,224,102, 64,149,149, 54, + 74,121, 17,146,102,154, 3,255, 64, 87,195,219, 64, 66,226, 86, 64,109,108,146, 74, 1, 65,102, 81,106, 3,255, 63,231,185, 68, + 64, 66,226, 56, 64,149,149, 91, 39,185, 65,102,102,154, 3,255, 64, 40,173,206, 63, 71,224, 82, 64,165,204, 20, 58,118, 17,146, +112,127, 3,255, 63,199, 75,140, 64, 16,251, 51, 64,165,204, 49, 34,198, 50, 44,112,127, 3,255, 64, 37,228,132,192,115, 22,142, +192,105, 57, 50, 56,212,173, 76,176,140, 3,255, 64, 82,251,148,192, 86, 75, 93,192, 96, 71,141, 72, 81,182,242,179,189, 3,255, + 64, 53,229,224,192, 65,211,158,192,132,158, 20, 62, 49,189,205,165,210, 3,255, 63,189,254, 99,192, 64,142,120,192,153,190,125, + 31,245,189,207,151, 55, 3,255, 63, 17, 81,228,192, 83,158, 90,192,153,190,111, 13, 13,183,171,151, 55, 3,255, 63,157,144,120, +192,114,118, 71,192,137,135,100, 26,187,173,186,161,170, 3,255,191, 50,231,197,192,148,176,195,192, 96, 71,159,240,112,154,100, +179,189, 3,255, 62, 10,212,139,192,147, 21,246,192,105, 57, 57, 2,163,155,176,176,140, 3,255,191, 4,232,193,192,131,220,246, +192,132,158, 26,244,154,165,227,165,210, 3,255, 62, 35,154,206,192, 1,253, 58,192,176, 18, 9, 3,147,211,253,135,221, 3,255, + 63,136, 68,236,191,222, 88,175,192,176, 18, 33, 22,250,218, 75,135,221, 3,255, 62,207,150,238,191,159,184, 77,192,182,208,203, + 8,185,229, 37,131, 41, 3,255, 64,141, 58, 69,191,165, 78, 36,192,105, 57, 29, 96, 56,227,131,176,140, 3,255, 64,134,128,163, +192, 6,110,247,192, 96, 71,136, 91,211,209,205,179,189, 3,255, 64,112,141, 26,191,226, 49,224,192,132,158, 23, 82, 45,217, 80, +165,210, 3,255, 64, 84,124,245,190,246,189,198,192,153,190, 97, 72,212,246, 16,151, 55, 3,255, 64, 84,124,245, 62,246,189,210, +192,153,190, 97, 72,212, 9,240,151, 55, 3,255, 64,126,240,177, 52, 0, 0, 0,192,137,135, 73, 86,129, 0, 0,161,170, 3,255, + 64,134,128,163, 64, 6,110,248,192, 96, 71,136, 91,211, 46, 51,179,189, 3,255, 64,141, 58, 69, 63,165, 78, 38,192,105, 57, 29, + 96, 56, 28,125,176,140, 3,255, 64,112,141, 26, 63,226, 49,227,192,132,158, 23, 82, 45, 38,176,165,210, 3,255, 63,253,147, 30, + 62,243,142, 49,192,176, 18, 8, 42,247, 10, 51,135,221, 3,255, 63,253,147, 30,190,243,142, 32,192,176, 18, 8, 42,247,245,205, +135,221, 3,255, 63,167,240,198, 52,128, 0, 0,192,182,208,181, 28, 61, 0, 0,131, 41, 3,255,192, 51,237,147,192,104,228, 14, +192,105, 57, 55,194,232,176,101,176,140, 3,255,192, 10,156, 9,192,133,112, 59,192, 96, 71,154,208,223,164,166,179,189, 3,255, +192, 0, 33,148,192,104,227,254,192,132,158, 29,212, 66,176,101,165,210, 3,255,192, 25,198,253,192, 21,217,132,192,153,190,111, +202,237,205, 39,151, 55, 3,255,192, 62, 9, 62,191,199,227,165,192,153,190,101,191, 62,221, 60,151, 55, 3,255,192, 78, 64,100, +192, 21,217,149,192,137,135, 89,186, 4,205, 39,161,170, 3,255,192,148, 83, 9,191, 69,109, 36,192, 96, 71, 57,154,143,239,103, +179,189, 3,255,192,138,140, 12,191,198, 79, 2,192,105, 56,245,161,106,222,127,176,140, 3,255,192,130,139, 63,191, 71,146,193, +192,132,157,232,166,198,239, 0,165,210, 3,255,191,240,239,195,191, 71,146,150,192,176, 18, 3,215, 63,239, 0,135,221, 3,255, +191,169, 91, 0,191,198, 78,203,192,176, 18, 21,227, 61,222,127,135,221, 3,255,191,135,221,228,191, 69,108,244,192,182,208,206, +233, 40,239,103,131, 41, 3,255,192,138,140, 12, 63,198, 79, 5,192,105, 56,245,161,106, 33,129,176,140, 3,255,192,148, 83, 9, + 63, 69,109, 42,192, 96, 71, 57,154,143, 16,153,179,189, 3,255,192,130,139, 63, 63, 71,146,200,192,132,157,231,166,198, 17, 0, +165,210, 3,255,192, 62, 9, 62, 63,199,227,169,192,153,190,101,191, 62, 34,196,151, 55, 3,255,192, 25,198,253, 64, 21,217,134, +192,153,190,111,202,237, 50,217,151, 55, 3,255,192, 78, 64,100, 64, 21,217,151,192,137,135, 89,186, 4, 50,217,161,170, 3,255, +192, 10,156, 9, 64,133,112, 59,192, 96, 71,151,208,223, 91, 90,179,189, 3,255,192, 51,237,147, 64,104,228, 16,192,105, 57, 54, +194,232, 79,155,176,140, 3,255,192, 0, 33,148, 64,104,228, 0,192,132,158, 28,212, 66, 79,155,165,210, 3,255,191,169, 91, 0, + 63,198, 78,208,192,176, 18, 21,227, 61, 33,129,135,221, 3,255,191,240,239,195, 63, 71,146,159,192,176, 18, 3,215, 63, 17, 0, +135,221, 3,255,191,135,221,228, 63, 69,108,252,192,182,208,206,233, 40, 16,153,131, 41, 3,255, 62, 10,212,148, 64,147, 21,246, +192,105, 57, 56, 2,163,100, 80,176,140, 3,255,191, 50,231,196, 64,148,176,196,192, 96, 71,156,240,112,101,156,179,189, 3,255, +191, 4,232,191, 64,131,220,248,192,132,158, 25,244,154, 90, 29,165,210, 3,255, 63, 17, 81,229, 64, 83,158, 92,192,153,190,111, + 13, 13, 72, 85,151, 55, 3,255, 63,189,254, 98, 64, 64,142,121,192,153,190,125, 31,245, 66, 49,151, 55, 3,255, 63,157,144,120, + 64,114,118, 72,192,137,135,100, 26,187, 82, 70,161,170, 3,255, 64, 82,251,150, 64, 86, 75, 95,192, 96, 71,139, 72, 80, 73, 14, +179,189, 3,255, 64, 37,228,133, 64,115, 22,142,192,105, 57, 48, 56,212, 82,180,176,140, 3,255, 64, 53,229,224, 64, 65,211,160, +192,132,158, 20, 62, 49, 66, 51,165,210, 3,255, 63,136, 68,236, 63,222, 88,179,192,176, 18, 33, 22,250, 37,181,135,221, 3,255, + 62, 35,154,206, 64, 1,253, 60,192,176, 18, 9, 3,147, 44, 3,135,221, 3,255, 62,207,150,238, 63,159,184, 82,192,182,208,203, + 8,185, 26,219,131, 41, 3,255, 64,172,103,184,191,226, 50, 13,191,193, 21, 59,117,105,217, 80,222,212, 3,255, 64,160,115,141, +192, 6,111, 1,192, 12, 78,195,109, 71,209,205,207,249, 3,255, 64,167,117,111,191,165, 78, 66,192, 20, 86,160,114, 24,227,131, +205,121, 3,255, 64,180, 3,220, 51,128, 0, 0,191,210, 9,202,123, 16, 0, 0,220,208, 3,255, 64,185, 6,190, 62,246,190, 47, +191, 82, 45,247,126, 75, 9,240,237,185, 3,255, 64,185, 6,190,190,246,190, 45,191, 82, 45,247,126, 75,246, 16,237,185, 3,255, + 64,182, 74,149,179,128, 0, 0, 63,176,209,130,124, 74, 0, 0, 30,146, 3,255, 64,185,213, 38,190,243,142,111, 63, 48, 81, 0, +126,171,245,205, 15, 76, 3,255, 64,185,213, 38, 62,243,142,109, 63, 48, 81, 0,126,171, 10, 51, 15, 76, 3,255, 64,172,103,184, + 63,226, 50, 14,191,193, 21, 58,117,105, 38,176,222,212, 3,255, 64,167,117,111, 63,165, 78, 67,192, 20, 86,160,114, 24, 28,125, +205,121, 3,255, 64,160,115,141, 64, 6,111, 1,192, 12, 78,194,109, 71, 46, 51,207,249, 3,255,188,129, 88,227,192,181,112,251, +191,193, 21, 76,255,125,132, 98,222,212, 3,255,190,229,132, 59,192,173, 94,142,192, 12, 78,213,245,213,137,204,207,249, 3,255, + 62,199, 26,166,192,172, 8,123,192, 20, 86,191, 8, 41,138,175,205,121, 3,255, 63,222,131, 86,192,171, 52, 96,191,210, 10, 28, + 38, 7,138,246,220,208, 3,255, 64, 15,175,214,192,171, 52,115,191, 82, 46, 55, 48,122,138,246,237,185, 3,255, 63,170, 9,210, +192,180,188,102,191, 82, 46, 65, 29,146,132,209,237,185, 3,255, 63,225, 82,188,192,173, 94,178, 63,176,210, 0, 38,104,137,203, + 30,147, 3,255, 63,171,202,104,192,181,113, 16, 63, 48, 81,129, 29,112,132, 97, 15, 76, 3,255, 64, 15,206, 77,192,172, 8,151, + 63, 48, 81,125, 48,216,138,175, 15, 76, 3,255, 64, 86, 29,211,192,146,125,223,191,193, 21, 84, 73, 20,156, 75,222,212, 3,255, + 64, 54, 26,206,192,146,125,208,192, 20, 86,191, 62, 90,156, 75,205,121, 3,255, 64, 99, 5, 62,192,131,211,129,192, 12, 78,211, + 77,181,166, 90,207,249, 3,255,192,172,183,192,191,222, 88,251,191,193, 21, 30,138, 70,218, 75,222,212, 3,255,192,169, 81, 83, +191,159,184,152,192, 12, 78,161,140,112,229, 37,207,250, 3,255,192,159,196,184,192, 1,253,119,192, 20, 86,141,146,243,211,253, +205,121, 3,255,192,145,162,193,192, 83,158,188,191,210, 9,250,156,113,183,171,220,208, 3,255,192,140,159,254,192,114,118,183, +191, 82, 46, 18,159,172,173,186,237,185, 3,255,192,158,193, 35,192, 64,142,207,191, 82, 46, 27,147,252,189,207,237,185, 3,255, +192,147,122, 46,192, 86, 75,147, 63,176,209,233,155,115,182,242, 30,147, 3,255,192,159, 74, 54,192, 65,211,225, 63, 48, 81,112, +147,136,189,205, 15, 76, 3,255,192,141,100,255,192,115, 22,230, 63, 48, 81,119,159,133,173, 76, 15, 76, 3,255,192, 84,122,147, +192,147, 22, 43,191,193, 21, 73,183,194,155,176,222,212, 3,255,192, 94, 94,244,192,131,221, 35,192, 20, 86,180,180,113,165,227, +205,121, 3,255,192, 52,152,140,192,148,176,228,192, 12, 78,213,194,192,154,100,207,249, 3,255,192, 84,122,147, 64,147, 22, 43, +191,193, 21, 70,183,194,100, 80,222,212, 3,255,192, 52,152,140, 64,148,176,228,192, 12, 78,211,194,192,101,156,207,249, 3,255, +192, 94, 94,244, 64,131,221, 35,192, 20, 86,178,180,113, 90, 29,205,121, 3,255,192,145,162,193, 64, 83,158,188,191,210, 9,248, +156,113, 72, 85,220,208, 3,255,192,158,193, 35, 64, 64,142,207,191, 82, 46, 23,147,252, 66, 49,237,185, 3,255,192,140,159,254, + 64,114,118,183,191, 82, 46, 14,159,172, 82, 70,237,185, 3,255,192,147,122, 46, 64, 86, 75,147, 63,176,209,235,155,115, 73, 14, + 30,147, 3,255,192,141,100,255, 64,115, 22,230, 63, 48, 81,123,159,133, 82,180, 15, 76, 3,255,192,159, 74, 54, 64, 65,211,225, + 63, 48, 81,116,147,136, 66, 51, 15, 76, 3,255,192,172,183,192, 63,222, 88,251,191,193, 21, 29,138, 70, 37,181,222,212, 3,255, +192,159,196,184, 64, 1,253,119,192, 20, 86,141,146,243, 44, 3,205,121, 3,255,192,169, 81, 83, 63,159,184,154,192, 12, 78,161, +140,112, 26,219,207,250, 3,255, 64, 86, 29,212, 64,146,125,223,191,193, 21, 82, 73, 20, 99,181,222,212, 3,255, 64, 99, 5, 63, + 64,131,211,129,192, 12, 78,209, 77,181, 89,166,207,249, 3,255, 64, 54, 26,208, 64,146,125,208,192, 20, 86,189, 62, 90, 99,181, +205,121, 3,255, 63,222,131, 88, 64,171, 52, 95,191,210, 10, 24, 38, 7,117, 10,220,208, 3,255, 63,170, 9,210, 64,180,188,100, +191, 82, 46, 55, 29,146,123, 47,237,185, 3,255, 64, 15,175,215, 64,171, 52,115,191, 82, 46, 49, 48,122,117, 10,237,185, 3,255, + 63,225, 82,187, 64,173, 94,178, 63,176,210, 5, 38,104,118, 53, 30,147, 3,255, 64, 15,206, 77, 64,172, 8,151, 63, 48, 81,133, + 48,216,117, 81, 15, 76, 3,255, 63,171,202,104, 64,181,113, 16, 63, 48, 81,139, 29,112,123,159, 15, 76, 3,255,188,129, 88,216, + 64,181,112,250,191,193, 21, 70,255,125,123,158,222,212, 3,255, 62,199, 26,169, 64,172, 8,122,192, 20, 86,189, 8, 41,117, 81, +205,121, 3,255,190,229,132, 56, 64,173, 94,142,192, 12, 78,210,245,213,118, 52,207,249, 3,255, 64,159,196,184,192, 1,253,119, + 64, 20, 86,141,109, 13,211,253, 50,135, 3,255, 64,169, 81, 83,191,159,184,154, 64, 12, 78,161,115,144,229, 37, 48, 6, 3,255, + 64,172,183,192,191,222, 88,251, 63,193, 21, 29,117,186,218, 75, 33, 44, 3,255, 64,158,193, 35,192, 64,142,207, 63, 82, 46, 23, +108, 4,189,207, 18, 71, 3,255, 64,140,159,254,192,114,118,183, 63, 82, 46, 14, 96, 84,173,186, 18, 71, 3,255, 64,145,162,193, +192, 83,158,188, 63,210, 9,248, 99,143,183,171, 35, 48, 3,255, 64, 52,152,140,192,148,176,228, 64, 12, 78,211, 61, 64,154,100, + 48, 7, 3,255, 64, 94, 94,244,192,131,221, 35, 64, 20, 86,178, 75,143,165,227, 50,135, 3,255, 64, 84,122,147,192,147, 22, 43, + 63,193, 21, 70, 72, 62,155,176, 33, 44, 3,255, 64,141,100,255,192,115, 22,230,191, 48, 81,123, 96,123,173, 76,240,180, 3,255, + 64,159, 74, 54,192, 65,211,225,191, 48, 81,116,108,120,189,205,240,180, 3,255, 64,147,122, 46,192, 86, 75,147,191,176,209,235, +100,141,182,242,225,109, 3,255,190,199, 26,169,192,172, 8,122, 64, 20, 86,189,247,215,138,175, 50,135, 3,255, 62,229,132, 57, +192,173, 94,142, 64, 12, 78,210, 10, 43,137,204, 48, 7, 3,255, 60,129, 88,216,192,181,112,250, 63,193, 21, 70, 0,131,132, 98, + 33, 44, 3,255,191,170, 9,210,192,180,188,100, 63, 82, 46, 55,226,110,132,209, 18, 71, 3,255,192, 15,175,215,192,171, 52,115, + 63, 82, 46, 49,207,134,138,246, 18, 71, 3,255,191,222,131, 87,192,171, 52, 95, 63,210, 10, 24,217,249,138,246, 35, 48, 3,255, +192, 99, 5, 63,192,131,211,129, 64, 12, 78,209,178, 75,166, 90, 48, 7, 3,255,192, 54, 26,208,192,146,125,208, 64, 20, 86,189, +193,166,156, 75, 50,135, 3,255,192, 86, 29,212,192,146,125,223, 63,193, 21, 82,182,236,156, 75, 33, 44, 3,255,192, 15,206, 77, +192,172, 8,151,191, 48, 81,133,207, 40,138,175,240,180, 3,255,191,171,202,104,192,181,113, 16,191, 48, 81,139,226,144,132, 97, +240,180, 3,255,191,225, 82,187,192,173, 94,178,191,176,210, 5,217,152,137,203,225,109, 3,255,192,167,117,111,191,165, 78, 67, + 64, 20, 86,160,141,232,227,131, 50,135, 3,255,192,160,115,141,192, 6,111, 1, 64, 12, 78,194,146,185,209,205, 48, 7, 3,255, +192,172,103,184,191,226, 50, 14, 63,193, 21, 58,138,151,217, 80, 33, 44, 3,255,192,185, 6,190,190,246,190, 47, 63, 82, 45,247, +129,181,246, 16, 18, 71, 3,255,192,185, 6,190, 62,246,190, 45, 63, 82, 45,247,129,181, 9,240, 18, 71, 3,255,192,180, 3,220, +179,128, 0, 0, 63,210, 9,202,132,240, 0, 0, 35, 48, 3,255,192,160,115,141, 64, 6,111, 1, 64, 12, 78,195,146,185, 46, 51, + 48, 7, 3,255,192,167,117,111, 63,165, 78, 66, 64, 20, 86,160,141,232, 28,125, 50,135, 3,255,192,172,103,184, 63,226, 50, 13, + 63,193, 21, 59,138,151, 38,176, 33, 44, 3,255,192,185,213, 38, 62,243,142,111,191, 48, 81, 0,129, 85, 10, 51,240,180, 3,255, +192,185,213, 38,190,243,142,109,191, 48, 81, 0,129, 85,245,205,240,180, 3,255,192,182, 74,149, 51,128, 0, 0,191,176,209,130, +131,182, 0, 0,225,110, 3,255,192, 54, 26,206, 64,146,125,208, 64, 20, 86,191,193,166, 99,181, 50,135, 3,255,192, 99, 5, 62, + 64,131,211,129, 64, 12, 78,211,178, 75, 89,166, 48, 7, 3,255,192, 86, 29,211, 64,146,125,223, 63,193, 21, 84,182,236, 99,181, + 33, 44, 3,255,192, 15,175,214, 64,171, 52,115, 63, 82, 46, 55,207,134,117, 10, 18, 71, 3,255,191,170, 9,210, 64,180,188,102, + 63, 82, 46, 65,226,110,123, 47, 18, 71, 3,255,191,222,131, 86, 64,171, 52, 96, 63,210, 10, 28,217,249,117, 10, 35, 48, 3,255, + 62,229,132, 59, 64,173, 94,142, 64, 12, 78,213, 10, 43,118, 52, 48, 7, 3,255,190,199, 26,166, 64,172, 8,123, 64, 20, 86,191, +247,215,117, 81, 50,135, 3,255, 60,129, 88,227, 64,181,112,251, 63,193, 21, 76, 0,131,123,158, 33, 44, 3,255,191,171,202,104, + 64,181,113, 16,191, 48, 81,129,226,144,123,159,240,180, 3,255,192, 15,206, 77, 64,172, 8,151,191, 48, 81,125,207, 40,117, 81, +240,180, 3,255,191,225, 82,188, 64,173, 94,178,191,176,210, 0,217,152,118, 53,225,109, 3,255, 64, 94, 94,244, 64,131,221, 35, + 64, 20, 86,180, 75,143, 90, 29, 50,135, 3,255, 64, 52,152,140, 64,148,176,228, 64, 12, 78,213, 61, 64,101,156, 48, 7, 3,255, + 64, 84,122,147, 64,147, 22, 43, 63,193, 21, 73, 72, 62,100, 80, 33, 44, 3,255, 64,140,159,254, 64,114,118,183, 63, 82, 46, 18, + 96, 84, 82, 70, 18, 71, 3,255, 64,158,193, 35, 64, 64,142,207, 63, 82, 46, 27,108, 4, 66, 49, 18, 71, 3,255, 64,145,162,193, + 64, 83,158,188, 63,210, 9,250, 99,143, 72, 85, 35, 48, 3,255, 64,169, 81, 83, 63,159,184,152, 64, 12, 78,161,115,144, 26,219, + 48, 6, 3,255, 64,159,196,184, 64, 1,253,119, 64, 20, 86,141,109, 13, 44, 3, 50,135, 3,255, 64,172,183,192, 63,222, 88,251, + 63,193, 21, 30,117,186, 37,181, 33, 44, 3,255, 64,159, 74, 54, 64, 65,211,225,191, 48, 81,112,108,120, 66, 51,240,180, 3,255, + 64,141,100,255, 64,115, 22,230,191, 48, 81,119, 96,123, 82,180,240,180, 3,255, 64,147,122, 46, 64, 86, 75,147,191,176,209,233, +100,141, 73, 14,225,109, 3,255, 64, 0, 33,148,192,104,228, 0, 64,132,158, 28, 43,190,176,101, 90, 46, 3,255, 64, 10,156, 9, +192,133,112, 59, 64, 96, 71,151, 47, 33,164,166, 76, 67, 3,255, 64, 51,237,147,192,104,228, 16, 64,105, 57, 54, 61, 24,176,101, + 79,116, 3,255, 64, 78, 64,100,192, 21,217,151, 64,137,135, 89, 69,252,205, 39, 94, 86, 3,255, 64, 62, 9, 62,191,199,227,169, + 64,153,190,101, 64,194,221, 60,104,201, 3,255, 64, 25,198,253,192, 21,217,134, 64,153,190,111, 53, 19,205, 39,104,201, 3,255, + 63,135,221,228,191, 69,108,252, 64,182,208,206, 22,216,239,103,124,215, 3,255, 63,169, 91, 0,191,198, 78,208, 64,176, 18, 21, + 28,195,222,127,120, 35, 3,255, 63,240,239,195,191, 71,146,159, 64,176, 18, 3, 40,193,239, 0,120, 35, 3,255, 64,130,139, 63, +191, 71,146,200, 64,132,157,231, 89, 58,239, 0, 90, 46, 3,255, 64,138,140, 12,191,198, 79, 5, 64,105, 56,245, 94,150,222,127, + 79,116, 3,255, 64,148, 83, 9,191, 69,109, 41, 64, 96, 71, 57,101,113,239,103, 76, 67, 3,255,192, 53,229,224,192, 65,211,160, + 64,132,158, 20,193,207,189,205, 90, 46, 3,255,192, 82,251,150,192, 86, 75, 95, 64, 96, 71,139,183,176,182,242, 76, 67, 3,255, +192, 37,228,133,192,115, 22,142, 64,105, 57, 48,199, 44,173, 76, 79,116, 3,255,191,157,144,120,192,114,118, 72, 64,137,135,100, +229, 69,173,186, 94, 86, 3,255,191, 17, 81,230,192, 83,158, 92, 64,153,190,111,242,243,183,171,104,201, 3,255,191,189,254, 98, +192, 64,142,121, 64,153,190,125,224, 11,189,207,104,201, 3,255,190,207,150,240,191,159,184, 82, 64,182,208,203,247, 71,229, 37, +124,215, 3,255,191,136, 68,236,191,222, 88,179, 64,176, 18, 33,233, 6,218, 75,120, 35, 3,255,190, 35,154,206,192, 1,253, 60, + 64,176, 18, 9,252,109,211,253,120, 35, 3,255, 63, 4,232,190,192,131,220,248, 64,132,158, 25, 11,102,165,227, 90, 46, 3,255, +190, 10,212,152,192,147, 21,246, 64,105, 57, 56,253, 93,155,176, 79,116, 3,255, 63, 50,231,197,192,148,176,196, 64, 96, 71,156, + 15,144,154,100, 76, 67, 3,255,192,112,141, 26, 63,226, 49,224, 64,132,158, 23,173,211, 38,176, 90, 46, 3,255,192,134,128,163, + 64, 6,110,247, 64, 96, 71,136,164, 45, 46, 51, 76, 67, 3,255,192,141, 58, 69, 63,165, 78, 36, 64,105, 57, 29,159,200, 28,125, + 79,116, 3,255,192,126,240,177,180, 0, 0, 0, 64,137,135, 73,169,127, 0, 0, 94, 86, 3,255,192, 84,124,245,190,246,189,211, + 64,153,190, 97,183, 44,246, 16,104,201, 3,255,192, 84,124,245, 62,246,189,198, 64,153,190, 97,183, 44, 9,240,104,201, 3,255, +191,167,240,198,180,160, 0, 0, 64,182,208,181,227,195, 0, 0,124,215, 3,255,191,253,147, 30, 62,243,142, 32, 64,176, 18, 8, +213, 9, 10, 51,120, 35, 3,255,191,253,147, 30,190,243,142, 49, 64,176, 18, 8,213, 9,245,205,120, 35, 3,255,192,112,141, 26, +191,226, 49,227, 64,132,158, 23,173,211,217, 80, 90, 46, 3,255,192,141, 58, 69,191,165, 78, 38, 64,105, 57, 29,159,200,227,131, + 79,116, 3,255,192,134,128,163,192, 6,110,248, 64, 96, 71,136,164, 45,209,205, 76, 67, 3,255, 63, 4,232,193, 64,131,220,246, + 64,132,158, 26, 11,102, 90, 29, 90, 46, 3,255, 63, 50,231,198, 64,148,176,195, 64, 96, 71,159, 15,144,101,156, 76, 67, 3,255, +190, 10,212,139, 64,147, 21,246, 64,105, 57, 57,253, 93,100, 80, 79,116, 3,255,191,157,144,120, 64,114,118, 71, 64,137,135,100, +229, 69, 82, 70, 94, 86, 3,255,191,189,254, 99, 64, 64,142,120, 64,153,190,125,224, 11, 66, 49,104,201, 3,255,191, 17, 81,228, + 64, 83,158, 90, 64,153,190,111,242,243, 72, 85,104,201, 3,255,190,207,150,238, 63,159,184, 77, 64,182,208,203,247, 71, 26,219, +124,215, 3,255,190, 35,154,206, 64, 1,253, 58, 64,176, 18, 9,252,109, 44, 3,120, 35, 3,255,191,136, 68,236, 63,222, 88,175, + 64,176, 18, 33,233, 6, 37,181,120, 35, 3,255,192, 53,229,224, 64, 65,211,158, 64,132,158, 20,193,207, 66, 51, 90, 46, 3,255, +192, 37,228,132, 64,115, 22,142, 64,105, 57, 50,199, 44, 82,180, 79,116, 3,255,192, 82,251,148, 64, 86, 75, 93, 64, 96, 71,141, +183,175, 73, 14, 76, 67, 3,255, 64,130,139, 63, 63, 71,146,193, 64,132,157,232, 89, 58, 17, 0, 90, 46, 3,255, 64,148, 83, 9, + 63, 69,109, 37, 64, 96, 71, 57,101,113, 16,153, 76, 67, 3,255, 64,138,140, 12, 63,198, 79, 2, 64,105, 56,245, 94,150, 33,129, + 79,116, 3,255, 64, 78, 64,100, 64, 21,217,149, 64,137,135, 89, 69,252, 50,217, 94, 86, 3,255, 64, 25,198,253, 64, 21,217,132, + 64,153,190,111, 53, 19, 50,217,104,201, 3,255, 64, 62, 9, 62, 63,199,227,165, 64,153,190,101, 64,194, 34,196,104,201, 3,255, + 63,135,221,228, 63, 69,108,244, 64,182,208,206, 22,216, 16,153,124,215, 3,255, 63,240,239,195, 63, 71,146,150, 64,176, 18, 3, + 40,193, 17, 0,120, 35, 3,255, 63,169, 91, 0, 63,198, 78,203, 64,176, 18, 21, 28,195, 33,129,120, 35, 3,255, 64, 0, 33,148, + 64,104,227,254, 64,132,158, 29, 43,190, 79,155, 90, 46, 3,255, 64, 51,237,147, 64,104,228, 14, 64,105, 57, 55, 61, 24, 79,155, + 79,116, 3,255, 64, 10,156, 9, 64,133,112, 59, 64, 96, 71,154, 47, 33, 91, 90, 76, 67, 3,255, 68, 65, 84, 65, 0, 0, 90, 0, + 7, 83,144, 32, 0, 0, 0, 49, 0, 0, 7,128, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0, 42, + 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 0, 12, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 0, 42, 0, 0, 0, 35, 0, 0, 0,164, + 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0, 43, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 0, 12, 0, 0, 0, 35, + 0, 0, 0,165, 0, 0, 0, 43, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0, 44, + 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 0, 13, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 0, 44, 0, 0, 0, 35, 0, 0, 0,168, + 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0, 45, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 0, 13, 0, 0, 0, 35, + 0, 0, 0,169, 0, 0, 0, 45, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 0, 46, + 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 0, 14, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 0, 46, 0, 0, 0, 35, 0, 0, 0,172, + 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0,172, 0, 0, 0, 47, 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 0, 14, 0, 0, 0, 35, + 0, 0, 0,173, 0, 0, 0, 47, 0, 0, 0, 35, 0, 0, 0,174, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,174, 0, 0, 0, 48, + 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 0, 15, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 0, 48, 0, 0, 0, 35, 0, 0, 0,176, + 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0, 49, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 0, 15, 0, 0, 0, 35, + 0, 0, 0,177, 0, 0, 0, 49, 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 0, 50, + 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 0, 16, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 0, 50, 0, 0, 0, 35, 0, 0, 0,180, + 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0,180, 0, 0, 0, 51, 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 0, 16, 0, 0, 0, 35, + 0, 0, 0,181, 0, 0, 0, 51, 0, 0, 0, 35, 0, 0, 0,182, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,182, 0, 0, 0, 52, + 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 0, 17, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 0, 52, 0, 0, 0, 35, 0, 0, 0,184, + 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0,184, 0, 0, 0, 53, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 0, 17, 0, 0, 0, 35, + 0, 0, 0,185, 0, 0, 0, 53, 0, 0, 0, 35, 0, 0, 0,186, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0,186, 0, 0, 0, 54, + 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 0, 54, 0, 0, 0, 35, 0, 0, 0,188, + 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0,188, 0, 0, 0, 55, 0, 0, 0, 35, 0, 0, 0,189, 0, 0, 0, 18, 0, 0, 0, 35, + 0, 0, 0,189, 0, 0, 0, 55, 0, 0, 0, 35, 0, 0, 0,190, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,190, 0, 0, 0, 56, + 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 0, 19, 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 0, 56, 0, 0, 0, 35, 0, 0, 0,192, + 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 0, 57, 0, 0, 0, 35, 0, 0, 0,193, 0, 0, 0, 19, 0, 0, 0, 35, + 0, 0, 0,193, 0, 0, 0, 57, 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 0, 58, + 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 0, 20, 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 0, 58, 0, 0, 0, 35, 0, 0, 0,196, + 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 0, 59, 0, 0, 0, 35, 0, 0, 0,197, 0, 0, 0, 20, 0, 0, 0, 35, + 0, 0, 0,197, 0, 0, 0, 59, 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 0, 60, + 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 0, 21, 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 0,200, + 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 0,201, 0, 0, 0, 21, 0, 0, 0, 35, + 0, 0, 0,201, 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 0, 62, + 0, 0, 0, 35, 0, 0, 0,203, 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 0,203, 0, 0, 0, 62, 0, 0, 0, 35, 0, 0, 0,204, + 0, 0, 0, 10, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 0, 63, 0, 0, 0, 35, 0, 0, 0,205, 0, 0, 0, 22, 0, 0, 0, 35, + 0, 0, 0,205, 0, 0, 0, 63, 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 0, 64, + 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 0, 23, 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 0, 64, 0, 0, 0, 35, 0, 0, 0,208, + 0, 0, 0, 10, 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 0, 65, 0, 0, 0, 35, 0, 0, 0,209, 0, 0, 0, 23, 0, 0, 0, 35, + 0, 0, 0,209, 0, 0, 0, 65, 0, 0, 0, 35, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0,210, 0, 0, 0, 66, + 0, 0, 0, 35, 0, 0, 0,211, 0, 0, 0, 24, 0, 0, 0, 35, 0, 0, 0,211, 0, 0, 0, 66, 0, 0, 0, 35, 0, 0, 0,212, + 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 0, 67, 0, 0, 0, 35, 0, 0, 0,213, 0, 0, 0, 24, 0, 0, 0, 35, + 0, 0, 0,213, 0, 0, 0, 67, 0, 0, 0, 35, 0, 0, 0,214, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0,214, 0, 0, 0, 68, + 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 0, 25, 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 0, 68, 0, 0, 0, 35, 0, 0, 0,216, + 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 0, 69, 0, 0, 0, 35, 0, 0, 0,217, 0, 0, 0, 25, 0, 0, 0, 35, + 0, 0, 0,217, 0, 0, 0, 69, 0, 0, 0, 35, 0, 0, 0,218, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0,218, 0, 0, 0, 70, + 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 0, 26, 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 0, 70, 0, 0, 0, 35, 0, 0, 0,220, + 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 0, 71, 0, 0, 0, 35, 0, 0, 0,221, 0, 0, 0, 26, 0, 0, 0, 35, + 0, 0, 0,221, 0, 0, 0, 71, 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 0, 72, + 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 0, 27, 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 0, 72, 0, 0, 0, 35, 0, 0, 0,224, + 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 0, 73, 0, 0, 0, 35, 0, 0, 0,225, 0, 0, 0, 27, 0, 0, 0, 35, + 0, 0, 0,225, 0, 0, 0, 73, 0, 0, 0, 35, 0, 0, 0,226, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0,226, 0, 0, 0, 74, + 0, 0, 0, 35, 0, 0, 0,227, 0, 0, 0, 28, 0, 0, 0, 35, 0, 0, 0,227, 0, 0, 0, 74, 0, 0, 0, 35, 0, 0, 0,228, + 0, 0, 0, 8, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 0, 75, 0, 0, 0, 35, 0, 0, 0,229, 0, 0, 0, 28, 0, 0, 0, 35, + 0, 0, 0,229, 0, 0, 0, 75, 0, 0, 0, 35, 0, 0, 0,230, 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0,230, 0, 0, 0, 76, + 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 0, 29, 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 0, 76, 0, 0, 0, 35, 0, 0, 0,232, + 0, 0, 0, 8, 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 0, 77, 0, 0, 0, 35, 0, 0, 0,233, 0, 0, 0, 29, 0, 0, 0, 35, + 0, 0, 0,233, 0, 0, 0, 77, 0, 0, 0, 35, 0, 0, 0,234, 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0,234, 0, 0, 0, 78, + 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 0, 30, 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 0, 78, 0, 0, 0, 35, 0, 0, 0,236, + 0, 0, 0, 9, 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 0, 79, 0, 0, 0, 35, 0, 0, 0,237, 0, 0, 0, 30, 0, 0, 0, 35, + 0, 0, 0,237, 0, 0, 0, 79, 0, 0, 0, 35, 0, 0, 0,238, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0,238, 0, 0, 0, 80, + 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 0, 31, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 0, 80, 0, 0, 0, 35, 0, 0, 0,240, + 0, 0, 0, 9, 0, 0, 0, 35, 0, 0, 0,240, 0, 0, 0, 81, 0, 0, 0, 35, 0, 0, 0,241, 0, 0, 0, 31, 0, 0, 0, 35, + 0, 0, 0,241, 0, 0, 0, 81, 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 0, 82, + 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 0, 32, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 0, 82, 0, 0, 0, 35, 0, 0, 0,244, + 0, 0, 0, 10, 0, 0, 0, 35, 0, 0, 0,244, 0, 0, 0, 83, 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 0, 32, 0, 0, 0, 35, + 0, 0, 0,245, 0, 0, 0, 83, 0, 0, 0, 35, 0, 0, 0,246, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0,246, 0, 0, 0, 84, + 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 0, 33, 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 0, 84, 0, 0, 0, 35, 0, 0, 0,248, + 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 0, 85, 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 0, 33, 0, 0, 0, 35, + 0, 0, 0,249, 0, 0, 0, 85, 0, 0, 0, 35, 0, 0, 0,250, 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0,250, 0, 0, 0, 86, + 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 0, 86, 0, 0, 0, 35, 0, 0, 0,252, + 0, 0, 0, 8, 0, 0, 0, 35, 0, 0, 0,252, 0, 0, 0, 87, 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 0, 34, 0, 0, 0, 35, + 0, 0, 0,253, 0, 0, 0, 87, 0, 0, 0, 35, 0, 0, 0,254, 0, 0, 0, 8, 0, 0, 0, 35, 0, 0, 0,254, 0, 0, 0, 88, + 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 0, 88, 0, 0, 0, 35, 0, 0, 1, 0, + 0, 0, 0, 9, 0, 0, 0, 35, 0, 0, 1, 0, 0, 0, 0, 89, 0, 0, 0, 35, 0, 0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, 0, 0, 0, 35, + 0, 0, 1, 29, 0, 0, 0,103, 0, 0, 0, 35, 0, 0, 1, 30, 0, 0, 0, 13, 0, 0, 0, 35, 0, 0, 1, 30, 0, 0, 0,104, + 0, 0, 0, 35, 0, 0, 1, 31, 0, 0, 0, 14, 0, 0, 0, 35, 0, 0, 1, 31, 0, 0, 0,104, 0, 0, 0, 35, 0, 0, 1, 32, + 0, 0, 0, 12, 0, 0, 0, 35, 0, 0, 1, 32, 0, 0, 0,105, 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 0, 16, 0, 0, 0, 35, + 0, 0, 1, 33, 0, 0, 0,105, 0, 0, 0, 35, 0, 0, 1, 34, 0, 0, 0, 12, 0, 0, 0, 35, 0, 0, 1, 34, 0, 0, 0,106, + 0, 0, 0, 35, 0, 0, 1, 35, 0, 0, 0, 15, 0, 0, 0, 35, 0, 0, 1, 35, 0, 0, 0,106, 0, 0, 0, 35, 0, 0, 1, 36, + 0, 0, 0, 15, 0, 0, 0, 35, 0, 0, 1, 36, 0, 0, 0,107, 0, 0, 0, 35, 0, 0, 1, 37, 0, 0, 0, 16, 0, 0, 0, 35, + 0, 0, 1, 37, 0, 0, 0,107, 0, 0, 0, 35, 0, 0, 1, 38, 0, 0, 0, 13, 0, 0, 0, 35, 0, 0, 1, 38, 0, 0, 0,108, + 0, 0, 0, 35, 0, 0, 1, 39, 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 1, 39, 0, 0, 0,108, 0, 0, 0, 35, 0, 0, 1, 40, + 0, 0, 0, 13, 0, 0, 0, 35, 0, 0, 1, 40, 0, 0, 0,109, 0, 0, 0, 35, 0, 0, 1, 41, 0, 0, 0, 17, 0, 0, 0, 35, + 0, 0, 1, 41, 0, 0, 0,109, 0, 0, 0, 35, 0, 0, 1, 42, 0, 0, 0, 17, 0, 0, 0, 35, 0, 0, 1, 42, 0, 0, 0,110, + 0, 0, 0, 35, 0, 0, 1, 43, 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 1, 43, 0, 0, 0,110, 0, 0, 0, 35, 0, 0, 1, 44, + 0, 0, 0, 17, 0, 0, 0, 35, 0, 0, 1, 44, 0, 0, 0,111, 0, 0, 0, 35, 0, 0, 1, 45, 0, 0, 0, 20, 0, 0, 0, 35, + 0, 0, 1, 45, 0, 0, 0,111, 0, 0, 0, 35, 0, 0, 1, 46, 0, 0, 0, 17, 0, 0, 0, 35, 0, 0, 1, 46, 0, 0, 0,112, + 0, 0, 0, 35, 0, 0, 1, 47, 0, 0, 0, 19, 0, 0, 0, 35, 0, 0, 1, 47, 0, 0, 0,112, 0, 0, 0, 35, 0, 0, 1, 48, + 0, 0, 0, 19, 0, 0, 0, 35, 0, 0, 1, 48, 0, 0, 0,113, 0, 0, 0, 35, 0, 0, 1, 49, 0, 0, 0, 20, 0, 0, 0, 35, + 0, 0, 1, 49, 0, 0, 0,113, 0, 0, 0, 35, 0, 0, 1, 50, 0, 0, 0, 19, 0, 0, 0, 35, 0, 0, 1, 50, 0, 0, 0,114, + 0, 0, 0, 35, 0, 0, 1, 51, 0, 0, 0, 21, 0, 0, 0, 35, 0, 0, 1, 51, 0, 0, 0,114, 0, 0, 0, 35, 0, 0, 1, 52, + 0, 0, 0, 15, 0, 0, 0, 35, 0, 0, 1, 52, 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 1, 53, 0, 0, 0, 19, 0, 0, 0, 35, + 0, 0, 1, 53, 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 1, 54, 0, 0, 0, 15, 0, 0, 0, 35, 0, 0, 1, 54, 0, 0, 0,116, + 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 0, 21, 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 0,116, 0, 0, 0, 35, 0, 0, 1, 56, + 0, 0, 0, 16, 0, 0, 0, 35, 0, 0, 1, 56, 0, 0, 0,117, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 0, 23, 0, 0, 0, 35, + 0, 0, 1, 57, 0, 0, 0,117, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 0, 16, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 0,118, + 0, 0, 0, 35, 0, 0, 1, 59, 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 1, 59, 0, 0, 0,118, 0, 0, 0, 35, 0, 0, 1, 60, + 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 0,119, 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 0, 23, 0, 0, 0, 35, + 0, 0, 1, 61, 0, 0, 0,119, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 0, 14, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 0,120, + 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 0, 25, 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 0,120, 0, 0, 0, 35, 0, 0, 1, 64, + 0, 0, 0, 14, 0, 0, 0, 35, 0, 0, 1, 64, 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 1, 65, 0, 0, 0, 24, 0, 0, 0, 35, + 0, 0, 1, 65, 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 0, 24, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 0,122, + 0, 0, 0, 35, 0, 0, 1, 67, 0, 0, 0, 25, 0, 0, 0, 35, 0, 0, 1, 67, 0, 0, 0,122, 0, 0, 0, 35, 0, 0, 1, 68, + 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 1, 68, 0, 0, 0,123, 0, 0, 0, 35, 0, 0, 1, 69, 0, 0, 0, 27, 0, 0, 0, 35, + 0, 0, 1, 69, 0, 0, 0,123, 0, 0, 0, 35, 0, 0, 1, 70, 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 1, 70, 0, 0, 0,124, + 0, 0, 0, 35, 0, 0, 1, 71, 0, 0, 0, 26, 0, 0, 0, 35, 0, 0, 1, 71, 0, 0, 0,124, 0, 0, 0, 35, 0, 0, 1, 72, + 0, 0, 0, 26, 0, 0, 0, 35, 0, 0, 1, 72, 0, 0, 0,125, 0, 0, 0, 35, 0, 0, 1, 73, 0, 0, 0, 27, 0, 0, 0, 35, + 0, 0, 1, 73, 0, 0, 0,125, 0, 0, 0, 35, 0, 0, 1, 74, 0, 0, 0, 20, 0, 0, 0, 35, 0, 0, 1, 74, 0, 0, 0,126, + 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 0, 29, 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 0,126, 0, 0, 0, 35, 0, 0, 1, 76, + 0, 0, 0, 20, 0, 0, 0, 35, 0, 0, 1, 76, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 1, 77, 0, 0, 0, 28, 0, 0, 0, 35, + 0, 0, 1, 77, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 1, 78, 0, 0, 0, 28, 0, 0, 0, 35, 0, 0, 1, 78, 0, 0, 0,128, + 0, 0, 0, 35, 0, 0, 1, 79, 0, 0, 0, 29, 0, 0, 0, 35, 0, 0, 1, 79, 0, 0, 0,128, 0, 0, 0, 35, 0, 0, 1, 80, + 0, 0, 0, 21, 0, 0, 0, 35, 0, 0, 1, 80, 0, 0, 0,129, 0, 0, 0, 35, 0, 0, 1, 81, 0, 0, 0, 31, 0, 0, 0, 35, + 0, 0, 1, 81, 0, 0, 0,129, 0, 0, 0, 35, 0, 0, 1, 82, 0, 0, 0, 21, 0, 0, 0, 35, 0, 0, 1, 82, 0, 0, 0,130, + 0, 0, 0, 35, 0, 0, 1, 83, 0, 0, 0, 30, 0, 0, 0, 35, 0, 0, 1, 83, 0, 0, 0,130, 0, 0, 0, 35, 0, 0, 1, 84, + 0, 0, 0, 30, 0, 0, 0, 35, 0, 0, 1, 84, 0, 0, 0,131, 0, 0, 0, 35, 0, 0, 1, 85, 0, 0, 0, 31, 0, 0, 0, 35, + 0, 0, 1, 85, 0, 0, 0,131, 0, 0, 0, 35, 0, 0, 1, 86, 0, 0, 0, 23, 0, 0, 0, 35, 0, 0, 1, 86, 0, 0, 0,132, + 0, 0, 0, 35, 0, 0, 1, 87, 0, 0, 0, 32, 0, 0, 0, 35, 0, 0, 1, 87, 0, 0, 0,132, 0, 0, 0, 35, 0, 0, 1, 88, + 0, 0, 0, 23, 0, 0, 0, 35, 0, 0, 1, 88, 0, 0, 0,133, 0, 0, 0, 35, 0, 0, 1, 89, 0, 0, 0, 24, 0, 0, 0, 35, + 0, 0, 1, 89, 0, 0, 0,133, 0, 0, 0, 35, 0, 0, 1, 90, 0, 0, 0, 24, 0, 0, 0, 35, 0, 0, 1, 90, 0, 0, 0,134, + 0, 0, 0, 35, 0, 0, 1, 91, 0, 0, 0, 32, 0, 0, 0, 35, 0, 0, 1, 91, 0, 0, 0,134, 0, 0, 0, 35, 0, 0, 1, 92, + 0, 0, 0, 25, 0, 0, 0, 35, 0, 0, 1, 92, 0, 0, 0,135, 0, 0, 0, 35, 0, 0, 1, 93, 0, 0, 0, 33, 0, 0, 0, 35, + 0, 0, 1, 93, 0, 0, 0,135, 0, 0, 0, 35, 0, 0, 1, 94, 0, 0, 0, 25, 0, 0, 0, 35, 0, 0, 1, 94, 0, 0, 0,136, + 0, 0, 0, 35, 0, 0, 1, 95, 0, 0, 0, 26, 0, 0, 0, 35, 0, 0, 1, 95, 0, 0, 0,136, 0, 0, 0, 35, 0, 0, 1, 96, + 0, 0, 0, 26, 0, 0, 0, 35, 0, 0, 1, 96, 0, 0, 0,137, 0, 0, 0, 35, 0, 0, 1, 97, 0, 0, 0, 33, 0, 0, 0, 35, + 0, 0, 1, 97, 0, 0, 0,137, 0, 0, 0, 35, 0, 0, 1, 98, 0, 0, 0, 27, 0, 0, 0, 35, 0, 0, 1, 98, 0, 0, 0,138, + 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 0,138, 0, 0, 0, 35, 0, 0, 1,100, + 0, 0, 0, 27, 0, 0, 0, 35, 0, 0, 1,100, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 1,101, 0, 0, 0, 28, 0, 0, 0, 35, + 0, 0, 1,101, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 1,102, 0, 0, 0, 28, 0, 0, 0, 35, 0, 0, 1,102, 0, 0, 0,140, + 0, 0, 0, 35, 0, 0, 1,103, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 1,103, 0, 0, 0,140, 0, 0, 0, 35, 0, 0, 1,104, + 0, 0, 0, 29, 0, 0, 0, 35, 0, 0, 1,104, 0, 0, 0,141, 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 0, 35, + 0, 0, 1,105, 0, 0, 0,141, 0, 0, 0, 35, 0, 0, 1,106, 0, 0, 0, 29, 0, 0, 0, 35, 0, 0, 1,106, 0, 0, 0,142, + 0, 0, 0, 35, 0, 0, 1,107, 0, 0, 0, 30, 0, 0, 0, 35, 0, 0, 1,107, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 1,108, + 0, 0, 0, 30, 0, 0, 0, 35, 0, 0, 1,108, 0, 0, 0,143, 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 0, 35, + 0, 0, 1,109, 0, 0, 0,143, 0, 0, 0, 35, 0, 0, 1,110, 0, 0, 0, 31, 0, 0, 0, 35, 0, 0, 1,110, 0, 0, 0,144, + 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 0, 36, 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 0,144, 0, 0, 0, 35, 0, 0, 1,112, + 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 1,112, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 1,113, 0, 0, 0, 31, 0, 0, 0, 35, + 0, 0, 1,113, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 0,146, + 0, 0, 0, 35, 0, 0, 1,115, 0, 0, 0, 36, 0, 0, 0, 35, 0, 0, 1,115, 0, 0, 0,146, 0, 0, 0, 35, 0, 0, 1,116, + 0, 0, 0, 32, 0, 0, 0, 35, 0, 0, 1,116, 0, 0, 0,147, 0, 0, 0, 35, 0, 0, 1,117, 0, 0, 0, 38, 0, 0, 0, 35, + 0, 0, 1,117, 0, 0, 0,147, 0, 0, 0, 35, 0, 0, 1,118, 0, 0, 0, 32, 0, 0, 0, 35, 0, 0, 1,118, 0, 0, 0,148, + 0, 0, 0, 35, 0, 0, 1,119, 0, 0, 0, 37, 0, 0, 0, 35, 0, 0, 1,119, 0, 0, 0,148, 0, 0, 0, 35, 0, 0, 1,120, + 0, 0, 0, 37, 0, 0, 0, 35, 0, 0, 1,120, 0, 0, 0,149, 0, 0, 0, 35, 0, 0, 1,121, 0, 0, 0, 38, 0, 0, 0, 35, + 0, 0, 1,121, 0, 0, 0,149, 0, 0, 0, 35, 0, 0, 1,122, 0, 0, 0, 33, 0, 0, 0, 35, 0, 0, 1,122, 0, 0, 0,150, + 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 0, 39, 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 0,150, 0, 0, 0, 35, 0, 0, 1,124, + 0, 0, 0, 33, 0, 0, 0, 35, 0, 0, 1,124, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 1,125, 0, 0, 0, 38, 0, 0, 0, 35, + 0, 0, 1,125, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 1,126, 0, 0, 0, 38, 0, 0, 0, 35, 0, 0, 1,126, 0, 0, 0,152, + 0, 0, 0, 35, 0, 0, 1,127, 0, 0, 0, 39, 0, 0, 0, 35, 0, 0, 1,127, 0, 0, 0,152, 0, 0, 0, 35, 0, 0, 1,128, + 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 1,128, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 1,129, 0, 0, 0, 40, 0, 0, 0, 35, + 0, 0, 1,129, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 1,130, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 1,130, 0, 0, 0,154, + 0, 0, 0, 35, 0, 0, 1,131, 0, 0, 0, 39, 0, 0, 0, 35, 0, 0, 1,131, 0, 0, 0,154, 0, 0, 0, 35, 0, 0, 1,132, + 0, 0, 0, 39, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 1,133, 0, 0, 0, 40, 0, 0, 0, 35, + 0, 0, 1,133, 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 0,156, + 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 0, 41, 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 0,156, 0, 0, 0, 35, 0, 0, 1,136, + 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 1,136, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 1,137, 0, 0, 0, 40, 0, 0, 0, 35, + 0, 0, 1,137, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 0, 40, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 0,158, + 0, 0, 0, 35, 0, 0, 1,139, 0, 0, 0, 41, 0, 0, 0, 35, 0, 0, 1,139, 0, 0, 0,158, 0, 0, 0, 35, 0, 0, 1,140, + 0, 0, 0, 36, 0, 0, 0, 35, 0, 0, 1,140, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 0, 37, 0, 0, 0, 35, + 0, 0, 1,141, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 1,142, 0, 0, 0, 36, 0, 0, 0, 35, 0, 0, 1,142, 0, 0, 0,160, + 0, 0, 0, 35, 0, 0, 1,143, 0, 0, 0, 41, 0, 0, 0, 35, 0, 0, 1,143, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 1,144, + 0, 0, 0, 37, 0, 0, 0, 35, 0, 0, 1,144, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 1,145, 0, 0, 0, 41, 0, 0, 0, 35, + 0, 0, 1,145, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 1,146, 0, 0, 0, 46, 0, 0, 0, 35, 0, 0, 1,146, 0, 0, 0,102, + 0, 0, 0, 35, 0, 0, 1,147, 0, 0, 0, 43, 0, 0, 0, 33, 0, 0, 1,147, 0, 0, 0, 46, 0, 0, 0, 33, 0, 0, 1,148, + 0, 0, 0, 43, 0, 0, 0, 35, 0, 0, 1,148, 0, 0, 0,102, 0, 0, 0, 35, 0, 0, 1,149, 0, 0, 0,102, 0, 0, 0, 35, + 0, 0, 1,149, 0, 0, 0,103, 0, 0, 0, 35, 0, 0, 1,150, 0, 0, 0,103, 0, 0, 0, 35, 0, 0, 1,150, 0, 0, 0,104, + 0, 0, 0, 35, 0, 0, 1,151, 0, 0, 0,102, 0, 0, 0, 35, 0, 0, 1,151, 0, 0, 0,104, 0, 0, 0, 35, 0, 0, 1,152, + 0, 0, 0, 45, 0, 0, 0, 33, 0, 0, 1,152, 0, 0, 0, 47, 0, 0, 0, 33, 0, 0, 1,153, 0, 0, 0, 47, 0, 0, 0, 35, + 0, 0, 1,153, 0, 0, 0,104, 0, 0, 0, 35, 0, 0, 1,154, 0, 0, 0, 45, 0, 0, 0, 35, 0, 0, 1,154, 0, 0, 0,104, + 0, 0, 0, 35, 0, 0, 1,155, 0, 0, 0, 44, 0, 0, 0, 35, 0, 0, 1,155, 0, 0, 0,103, 0, 0, 0, 35, 0, 0, 1,156, + 0, 0, 0, 42, 0, 0, 0, 35, 0, 0, 1,156, 0, 0, 0,103, 0, 0, 0, 35, 0, 0, 1,157, 0, 0, 0, 42, 0, 0, 0, 33, + 0, 0, 1,157, 0, 0, 0, 44, 0, 0, 0, 33, 0, 0, 1,158, 0, 0, 0, 50, 0, 0, 0, 35, 0, 0, 1,158, 0, 0, 0,105, + 0, 0, 0, 35, 0, 0, 1,159, 0, 0, 0, 43, 0, 0, 0, 33, 0, 0, 1,159, 0, 0, 0, 50, 0, 0, 0, 33, 0, 0, 1,160, + 0, 0, 0, 43, 0, 0, 0, 35, 0, 0, 1,160, 0, 0, 0,105, 0, 0, 0, 35, 0, 0, 1,161, 0, 0, 0,105, 0, 0, 0, 35, + 0, 0, 1,161, 0, 0, 0,106, 0, 0, 0, 35, 0, 0, 1,162, 0, 0, 0,106, 0, 0, 0, 35, 0, 0, 1,162, 0, 0, 0,107, + 0, 0, 0, 35, 0, 0, 1,163, 0, 0, 0,105, 0, 0, 0, 35, 0, 0, 1,163, 0, 0, 0,107, 0, 0, 0, 35, 0, 0, 1,164, + 0, 0, 0, 49, 0, 0, 0, 33, 0, 0, 1,164, 0, 0, 0, 51, 0, 0, 0, 33, 0, 0, 1,165, 0, 0, 0, 51, 0, 0, 0, 35, + 0, 0, 1,165, 0, 0, 0,107, 0, 0, 0, 35, 0, 0, 1,166, 0, 0, 0, 49, 0, 0, 0, 35, 0, 0, 1,166, 0, 0, 0,107, + 0, 0, 0, 35, 0, 0, 1,167, 0, 0, 0, 48, 0, 0, 0, 35, 0, 0, 1,167, 0, 0, 0,106, 0, 0, 0, 35, 0, 0, 1,168, + 0, 0, 0, 42, 0, 0, 0, 35, 0, 0, 1,168, 0, 0, 0,106, 0, 0, 0, 35, 0, 0, 1,169, 0, 0, 0, 42, 0, 0, 0, 33, + 0, 0, 1,169, 0, 0, 0, 48, 0, 0, 0, 33, 0, 0, 1,170, 0, 0, 0, 54, 0, 0, 0, 35, 0, 0, 1,170, 0, 0, 0,108, + 0, 0, 0, 35, 0, 0, 1,171, 0, 0, 0, 45, 0, 0, 0, 33, 0, 0, 1,171, 0, 0, 0, 54, 0, 0, 0, 33, 0, 0, 1,172, + 0, 0, 0, 45, 0, 0, 0, 35, 0, 0, 1,172, 0, 0, 0,108, 0, 0, 0, 35, 0, 0, 1,173, 0, 0, 0,108, 0, 0, 0, 35, + 0, 0, 1,173, 0, 0, 0,109, 0, 0, 0, 35, 0, 0, 1,174, 0, 0, 0,109, 0, 0, 0, 35, 0, 0, 1,174, 0, 0, 0,110, + 0, 0, 0, 35, 0, 0, 1,175, 0, 0, 0,108, 0, 0, 0, 35, 0, 0, 1,175, 0, 0, 0,110, 0, 0, 0, 35, 0, 0, 1,176, + 0, 0, 0, 53, 0, 0, 0, 33, 0, 0, 1,176, 0, 0, 0, 55, 0, 0, 0, 33, 0, 0, 1,177, 0, 0, 0, 55, 0, 0, 0, 35, + 0, 0, 1,177, 0, 0, 0,110, 0, 0, 0, 35, 0, 0, 1,178, 0, 0, 0, 53, 0, 0, 0, 35, 0, 0, 1,178, 0, 0, 0,110, + 0, 0, 0, 35, 0, 0, 1,179, 0, 0, 0, 52, 0, 0, 0, 35, 0, 0, 1,179, 0, 0, 0,109, 0, 0, 0, 35, 0, 0, 1,180, + 0, 0, 0, 44, 0, 0, 0, 35, 0, 0, 1,180, 0, 0, 0,109, 0, 0, 0, 35, 0, 0, 1,181, 0, 0, 0, 44, 0, 0, 0, 33, + 0, 0, 1,181, 0, 0, 0, 52, 0, 0, 0, 33, 0, 0, 1,182, 0, 0, 0, 58, 0, 0, 0, 35, 0, 0, 1,182, 0, 0, 0,111, + 0, 0, 0, 35, 0, 0, 1,183, 0, 0, 0, 53, 0, 0, 0, 33, 0, 0, 1,183, 0, 0, 0, 58, 0, 0, 0, 33, 0, 0, 1,184, + 0, 0, 0, 53, 0, 0, 0, 35, 0, 0, 1,184, 0, 0, 0,111, 0, 0, 0, 35, 0, 0, 1,185, 0, 0, 0,111, 0, 0, 0, 35, + 0, 0, 1,185, 0, 0, 0,112, 0, 0, 0, 35, 0, 0, 1,186, 0, 0, 0,112, 0, 0, 0, 35, 0, 0, 1,186, 0, 0, 0,113, + 0, 0, 0, 35, 0, 0, 1,187, 0, 0, 0,111, 0, 0, 0, 35, 0, 0, 1,187, 0, 0, 0,113, 0, 0, 0, 35, 0, 0, 1,188, + 0, 0, 0, 57, 0, 0, 0, 33, 0, 0, 1,188, 0, 0, 0, 59, 0, 0, 0, 33, 0, 0, 1,189, 0, 0, 0, 59, 0, 0, 0, 35, + 0, 0, 1,189, 0, 0, 0,113, 0, 0, 0, 35, 0, 0, 1,190, 0, 0, 0, 57, 0, 0, 0, 35, 0, 0, 1,190, 0, 0, 0,113, + 0, 0, 0, 35, 0, 0, 1,191, 0, 0, 0, 56, 0, 0, 0, 35, 0, 0, 1,191, 0, 0, 0,112, 0, 0, 0, 35, 0, 0, 1,192, + 0, 0, 0, 52, 0, 0, 0, 35, 0, 0, 1,192, 0, 0, 0,112, 0, 0, 0, 35, 0, 0, 1,193, 0, 0, 0, 52, 0, 0, 0, 33, + 0, 0, 1,193, 0, 0, 0, 56, 0, 0, 0, 33, 0, 0, 1,194, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 1,194, 0, 0, 0,114, + 0, 0, 0, 35, 0, 0, 1,195, 0, 0, 0, 57, 0, 0, 0, 33, 0, 0, 1,195, 0, 0, 0, 60, 0, 0, 0, 33, 0, 0, 1,196, + 0, 0, 0, 57, 0, 0, 0, 35, 0, 0, 1,196, 0, 0, 0,114, 0, 0, 0, 35, 0, 0, 1,197, 0, 0, 0,114, 0, 0, 0, 35, + 0, 0, 1,197, 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 1,198, 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 1,198, 0, 0, 0,116, + 0, 0, 0, 35, 0, 0, 1,199, 0, 0, 0,114, 0, 0, 0, 35, 0, 0, 1,199, 0, 0, 0,116, 0, 0, 0, 35, 0, 0, 1,200, + 0, 0, 0, 49, 0, 0, 0, 33, 0, 0, 1,200, 0, 0, 0, 61, 0, 0, 0, 33, 0, 0, 1,201, 0, 0, 0, 61, 0, 0, 0, 35, + 0, 0, 1,201, 0, 0, 0,116, 0, 0, 0, 35, 0, 0, 1,202, 0, 0, 0, 49, 0, 0, 0, 35, 0, 0, 1,202, 0, 0, 0,116, + 0, 0, 0, 35, 0, 0, 1,203, 0, 0, 0, 48, 0, 0, 0, 35, 0, 0, 1,203, 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 1,204, + 0, 0, 0, 56, 0, 0, 0, 35, 0, 0, 1,204, 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 1,205, 0, 0, 0, 48, 0, 0, 0, 33, + 0, 0, 1,205, 0, 0, 0, 56, 0, 0, 0, 33, 0, 0, 1,206, 0, 0, 0, 64, 0, 0, 0, 35, 0, 0, 1,206, 0, 0, 0,117, + 0, 0, 0, 35, 0, 0, 1,207, 0, 0, 0, 50, 0, 0, 0, 33, 0, 0, 1,207, 0, 0, 0, 64, 0, 0, 0, 33, 0, 0, 1,208, + 0, 0, 0, 50, 0, 0, 0, 35, 0, 0, 1,208, 0, 0, 0,117, 0, 0, 0, 35, 0, 0, 1,209, 0, 0, 0,117, 0, 0, 0, 35, + 0, 0, 1,209, 0, 0, 0,118, 0, 0, 0, 35, 0, 0, 1,210, 0, 0, 0,118, 0, 0, 0, 35, 0, 0, 1,210, 0, 0, 0,119, + 0, 0, 0, 35, 0, 0, 1,211, 0, 0, 0,117, 0, 0, 0, 35, 0, 0, 1,211, 0, 0, 0,119, 0, 0, 0, 35, 0, 0, 1,212, + 0, 0, 0, 63, 0, 0, 0, 33, 0, 0, 1,212, 0, 0, 0, 65, 0, 0, 0, 33, 0, 0, 1,213, 0, 0, 0, 65, 0, 0, 0, 35, + 0, 0, 1,213, 0, 0, 0,119, 0, 0, 0, 35, 0, 0, 1,214, 0, 0, 0, 63, 0, 0, 0, 35, 0, 0, 1,214, 0, 0, 0,119, + 0, 0, 0, 35, 0, 0, 1,215, 0, 0, 0, 62, 0, 0, 0, 35, 0, 0, 1,215, 0, 0, 0,118, 0, 0, 0, 35, 0, 0, 1,216, + 0, 0, 0, 51, 0, 0, 0, 35, 0, 0, 1,216, 0, 0, 0,118, 0, 0, 0, 35, 0, 0, 1,217, 0, 0, 0, 51, 0, 0, 0, 33, + 0, 0, 1,217, 0, 0, 0, 62, 0, 0, 0, 33, 0, 0, 1,218, 0, 0, 0, 68, 0, 0, 0, 35, 0, 0, 1,218, 0, 0, 0,120, + 0, 0, 0, 35, 0, 0, 1,219, 0, 0, 0, 47, 0, 0, 0, 33, 0, 0, 1,219, 0, 0, 0, 68, 0, 0, 0, 33, 0, 0, 1,220, + 0, 0, 0, 47, 0, 0, 0, 35, 0, 0, 1,220, 0, 0, 0,120, 0, 0, 0, 35, 0, 0, 1,221, 0, 0, 0,120, 0, 0, 0, 35, + 0, 0, 1,221, 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 1,222, 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 1,222, 0, 0, 0,122, + 0, 0, 0, 35, 0, 0, 1,223, 0, 0, 0,120, 0, 0, 0, 35, 0, 0, 1,223, 0, 0, 0,122, 0, 0, 0, 35, 0, 0, 1,224, + 0, 0, 0, 67, 0, 0, 0, 33, 0, 0, 1,224, 0, 0, 0, 69, 0, 0, 0, 33, 0, 0, 1,225, 0, 0, 0, 69, 0, 0, 0, 35, + 0, 0, 1,225, 0, 0, 0,122, 0, 0, 0, 35, 0, 0, 1,226, 0, 0, 0, 67, 0, 0, 0, 35, 0, 0, 1,226, 0, 0, 0,122, + 0, 0, 0, 35, 0, 0, 1,227, 0, 0, 0, 66, 0, 0, 0, 35, 0, 0, 1,227, 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 1,228, + 0, 0, 0, 46, 0, 0, 0, 35, 0, 0, 1,228, 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 1,229, 0, 0, 0, 46, 0, 0, 0, 33, + 0, 0, 1,229, 0, 0, 0, 66, 0, 0, 0, 33, 0, 0, 1,230, 0, 0, 0, 72, 0, 0, 0, 35, 0, 0, 1,230, 0, 0, 0,123, + 0, 0, 0, 35, 0, 0, 1,231, 0, 0, 0, 55, 0, 0, 0, 33, 0, 0, 1,231, 0, 0, 0, 72, 0, 0, 0, 33, 0, 0, 1,232, + 0, 0, 0, 55, 0, 0, 0, 35, 0, 0, 1,232, 0, 0, 0,123, 0, 0, 0, 35, 0, 0, 1,233, 0, 0, 0,123, 0, 0, 0, 35, + 0, 0, 1,233, 0, 0, 0,124, 0, 0, 0, 35, 0, 0, 1,234, 0, 0, 0,124, 0, 0, 0, 35, 0, 0, 1,234, 0, 0, 0,125, + 0, 0, 0, 35, 0, 0, 1,235, 0, 0, 0,123, 0, 0, 0, 35, 0, 0, 1,235, 0, 0, 0,125, 0, 0, 0, 35, 0, 0, 1,236, + 0, 0, 0, 71, 0, 0, 0, 33, 0, 0, 1,236, 0, 0, 0, 73, 0, 0, 0, 33, 0, 0, 1,237, 0, 0, 0, 73, 0, 0, 0, 35, + 0, 0, 1,237, 0, 0, 0,125, 0, 0, 0, 35, 0, 0, 1,238, 0, 0, 0, 71, 0, 0, 0, 35, 0, 0, 1,238, 0, 0, 0,125, + 0, 0, 0, 35, 0, 0, 1,239, 0, 0, 0, 70, 0, 0, 0, 35, 0, 0, 1,239, 0, 0, 0,124, 0, 0, 0, 35, 0, 0, 1,240, + 0, 0, 0, 54, 0, 0, 0, 35, 0, 0, 1,240, 0, 0, 0,124, 0, 0, 0, 35, 0, 0, 1,241, 0, 0, 0, 54, 0, 0, 0, 33, + 0, 0, 1,241, 0, 0, 0, 70, 0, 0, 0, 33, 0, 0, 1,242, 0, 0, 0, 76, 0, 0, 0, 35, 0, 0, 1,242, 0, 0, 0,126, + 0, 0, 0, 35, 0, 0, 1,243, 0, 0, 0, 59, 0, 0, 0, 33, 0, 0, 1,243, 0, 0, 0, 76, 0, 0, 0, 33, 0, 0, 1,244, + 0, 0, 0, 59, 0, 0, 0, 35, 0, 0, 1,244, 0, 0, 0,126, 0, 0, 0, 35, 0, 0, 1,245, 0, 0, 0,126, 0, 0, 0, 35, + 0, 0, 1,245, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 1,246, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 1,246, 0, 0, 0,128, + 0, 0, 0, 35, 0, 0, 1,247, 0, 0, 0,126, 0, 0, 0, 35, 0, 0, 1,247, 0, 0, 0,128, 0, 0, 0, 35, 0, 0, 1,248, + 0, 0, 0, 75, 0, 0, 0, 33, 0, 0, 1,248, 0, 0, 0, 77, 0, 0, 0, 33, 0, 0, 1,249, 0, 0, 0, 77, 0, 0, 0, 35, + 0, 0, 1,249, 0, 0, 0,128, 0, 0, 0, 35, 0, 0, 1,250, 0, 0, 0, 75, 0, 0, 0, 35, 0, 0, 1,250, 0, 0, 0,128, + 0, 0, 0, 35, 0, 0, 1,251, 0, 0, 0, 74, 0, 0, 0, 35, 0, 0, 1,251, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 1,252, + 0, 0, 0, 58, 0, 0, 0, 35, 0, 0, 1,252, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 1,253, 0, 0, 0, 58, 0, 0, 0, 33, + 0, 0, 1,253, 0, 0, 0, 74, 0, 0, 0, 33, 0, 0, 1,254, 0, 0, 0, 80, 0, 0, 0, 35, 0, 0, 1,254, 0, 0, 0,129, + 0, 0, 0, 35, 0, 0, 1,255, 0, 0, 0, 61, 0, 0, 0, 33, 0, 0, 1,255, 0, 0, 0, 80, 0, 0, 0, 33, 0, 0, 2, 0, + 0, 0, 0, 61, 0, 0, 0, 35, 0, 0, 2, 0, 0, 0, 0,129, 0, 0, 0, 35, 0, 0, 2, 1, 0, 0, 0,129, 0, 0, 0, 35, + 0, 0, 2, 1, 0, 0, 0,130, 0, 0, 0, 35, 0, 0, 2, 2, 0, 0, 0,130, 0, 0, 0, 35, 0, 0, 2, 2, 0, 0, 0,131, + 0, 0, 0, 35, 0, 0, 2, 3, 0, 0, 0,129, 0, 0, 0, 35, 0, 0, 2, 3, 0, 0, 0,131, 0, 0, 0, 35, 0, 0, 2, 4, + 0, 0, 0, 79, 0, 0, 0, 33, 0, 0, 2, 4, 0, 0, 0, 81, 0, 0, 0, 33, 0, 0, 2, 5, 0, 0, 0, 81, 0, 0, 0, 35, + 0, 0, 2, 5, 0, 0, 0,131, 0, 0, 0, 35, 0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 64, 0, 0, 0, 35, 0, 0, 2, 20, 0, 0, 0,133, 0, 0, 0, 35, 0, 0, 2, 21, 0, 0, 0, 64, 0, 0, 0, 33, + 0, 0, 2, 21, 0, 0, 0, 66, 0, 0, 0, 33, 0, 0, 2, 22, 0, 0, 0, 84, 0, 0, 0, 35, 0, 0, 2, 22, 0, 0, 0,135, + 0, 0, 0, 35, 0, 0, 2, 23, 0, 0, 0, 69, 0, 0, 0, 33, 0, 0, 2, 23, 0, 0, 0, 84, 0, 0, 0, 33, 0, 0, 2, 24, + 0, 0, 0, 69, 0, 0, 0, 35, 0, 0, 2, 24, 0, 0, 0,135, 0, 0, 0, 35, 0, 0, 2, 25, 0, 0, 0,135, 0, 0, 0, 35, + 0, 0, 2, 25, 0, 0, 0,136, 0, 0, 0, 35, 0, 0, 2, 26, 0, 0, 0,136, 0, 0, 0, 35, 0, 0, 2, 26, 0, 0, 0,137, + 0, 0, 0, 35, 0, 0, 2, 27, 0, 0, 0,135, 0, 0, 0, 35, 0, 0, 2, 27, 0, 0, 0,137, 0, 0, 0, 35, 0, 0, 2, 28, + 0, 0, 0, 71, 0, 0, 0, 33, 0, 0, 2, 28, 0, 0, 0, 85, 0, 0, 0, 33, 0, 0, 2, 29, 0, 0, 0, 85, 0, 0, 0, 35, + 0, 0, 2, 29, 0, 0, 0,137, 0, 0, 0, 35, 0, 0, 2, 30, 0, 0, 0, 71, 0, 0, 0, 35, 0, 0, 2, 30, 0, 0, 0,137, + 0, 0, 0, 35, 0, 0, 2, 31, 0, 0, 0, 70, 0, 0, 0, 35, 0, 0, 2, 31, 0, 0, 0,136, 0, 0, 0, 35, 0, 0, 2, 32, + 0, 0, 0, 68, 0, 0, 0, 35, 0, 0, 2, 32, 0, 0, 0,136, 0, 0, 0, 35, 0, 0, 2, 33, 0, 0, 0, 68, 0, 0, 0, 33, + 0, 0, 2, 33, 0, 0, 0, 70, 0, 0, 0, 33, 0, 0, 2, 34, 0, 0, 0, 86, 0, 0, 0, 35, 0, 0, 2, 34, 0, 0, 0,138, + 0, 0, 0, 35, 0, 0, 2, 35, 0, 0, 0, 73, 0, 0, 0, 33, 0, 0, 2, 35, 0, 0, 0, 86, 0, 0, 0, 33, 0, 0, 2, 36, + 0, 0, 0, 73, 0, 0, 0, 35, 0, 0, 2, 36, 0, 0, 0,138, 0, 0, 0, 35, 0, 0, 2, 37, 0, 0, 0,138, 0, 0, 0, 35, + 0, 0, 2, 37, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 2, 38, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 2, 38, 0, 0, 0,140, + 0, 0, 0, 35, 0, 0, 2, 39, 0, 0, 0,138, 0, 0, 0, 35, 0, 0, 2, 39, 0, 0, 0,140, 0, 0, 0, 35, 0, 0, 2, 40, + 0, 0, 0, 75, 0, 0, 0, 33, 0, 0, 2, 40, 0, 0, 0, 87, 0, 0, 0, 33, 0, 0, 2, 41, 0, 0, 0, 87, 0, 0, 0, 35, + 0, 0, 2, 41, 0, 0, 0,140, 0, 0, 0, 35, 0, 0, 2, 42, 0, 0, 0, 75, 0, 0, 0, 35, 0, 0, 2, 42, 0, 0, 0,140, + 0, 0, 0, 35, 0, 0, 2, 43, 0, 0, 0, 74, 0, 0, 0, 35, 0, 0, 2, 43, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 2, 44, + 0, 0, 0, 72, 0, 0, 0, 35, 0, 0, 2, 44, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 2, 45, 0, 0, 0, 72, 0, 0, 0, 33, + 0, 0, 2, 45, 0, 0, 0, 74, 0, 0, 0, 33, 0, 0, 2, 46, 0, 0, 0, 88, 0, 0, 0, 35, 0, 0, 2, 46, 0, 0, 0,141, + 0, 0, 0, 35, 0, 0, 2, 47, 0, 0, 0, 77, 0, 0, 0, 33, 0, 0, 2, 47, 0, 0, 0, 88, 0, 0, 0, 33, 0, 0, 2, 48, + 0, 0, 0, 77, 0, 0, 0, 35, 0, 0, 2, 48, 0, 0, 0,141, 0, 0, 0, 35, 0, 0, 2, 49, 0, 0, 0,141, 0, 0, 0, 35, + 0, 0, 2, 49, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 2, 50, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 2, 50, 0, 0, 0,143, + 0, 0, 0, 35, 0, 0, 2, 51, 0, 0, 0,141, 0, 0, 0, 35, 0, 0, 2, 51, 0, 0, 0,143, 0, 0, 0, 35, 0, 0, 2, 52, + 0, 0, 0, 79, 0, 0, 0, 33, 0, 0, 2, 52, 0, 0, 0, 89, 0, 0, 0, 33, 0, 0, 2, 53, 0, 0, 0, 89, 0, 0, 0, 35, + 0, 0, 2, 53, 0, 0, 0,143, 0, 0, 0, 35, 0, 0, 2, 54, 0, 0, 0, 79, 0, 0, 0, 35, 0, 0, 2, 54, 0, 0, 0,143, + 0, 0, 0, 35, 0, 0, 2, 55, 0, 0, 0, 78, 0, 0, 0, 35, 0, 0, 2, 55, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 2, 56, + 0, 0, 0, 76, 0, 0, 0, 35, 0, 0, 2, 56, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 2, 57, 0, 0, 0, 76, 0, 0, 0, 33, + 0, 0, 2, 57, 0, 0, 0, 78, 0, 0, 0, 33, 0, 0, 2, 58, 0, 0, 0, 90, 0, 0, 0, 35, 0, 0, 2, 58, 0, 0, 0,144, + 0, 0, 0, 35, 0, 0, 2, 59, 0, 0, 0, 81, 0, 0, 0, 33, 0, 0, 2, 59, 0, 0, 0, 90, 0, 0, 0, 33, 0, 0, 2, 60, + 0, 0, 0, 81, 0, 0, 0, 35, 0, 0, 2, 60, 0, 0, 0,144, 0, 0, 0, 35, 0, 0, 2, 61, 0, 0, 0,144, 0, 0, 0, 35, + 0, 0, 2, 61, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 2, 62, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 2, 62, 0, 0, 0,146, + 0, 0, 0, 35, 0, 0, 2, 63, 0, 0, 0,144, 0, 0, 0, 35, 0, 0, 2, 63, 0, 0, 0,146, 0, 0, 0, 35, 0, 0, 2, 64, + 0, 0, 0, 63, 0, 0, 0, 33, 0, 0, 2, 64, 0, 0, 0, 91, 0, 0, 0, 33, 0, 0, 2, 65, 0, 0, 0, 91, 0, 0, 0, 35, + 0, 0, 2, 65, 0, 0, 0,146, 0, 0, 0, 35, 0, 0, 2, 66, 0, 0, 0, 63, 0, 0, 0, 35, 0, 0, 2, 66, 0, 0, 0,146, + 0, 0, 0, 35, 0, 0, 2, 67, 0, 0, 0, 62, 0, 0, 0, 35, 0, 0, 2, 67, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 2, 68, + 0, 0, 0, 80, 0, 0, 0, 35, 0, 0, 2, 68, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 2, 69, 0, 0, 0, 62, 0, 0, 0, 33, + 0, 0, 2, 69, 0, 0, 0, 80, 0, 0, 0, 33, 0, 0, 2, 70, 0, 0, 0, 94, 0, 0, 0, 35, 0, 0, 2, 70, 0, 0, 0,147, + 0, 0, 0, 35, 0, 0, 2, 71, 0, 0, 0, 82, 0, 0, 0, 33, 0, 0, 2, 71, 0, 0, 0, 94, 0, 0, 0, 33, 0, 0, 2, 72, + 0, 0, 0, 82, 0, 0, 0, 35, 0, 0, 2, 72, 0, 0, 0,147, 0, 0, 0, 35, 0, 0, 2, 73, 0, 0, 0,147, 0, 0, 0, 35, + 0, 0, 2, 73, 0, 0, 0,148, 0, 0, 0, 35, 0, 0, 2, 74, 0, 0, 0,148, 0, 0, 0, 35, 0, 0, 2, 74, 0, 0, 0,149, + 0, 0, 0, 35, 0, 0, 2, 75, 0, 0, 0,147, 0, 0, 0, 35, 0, 0, 2, 75, 0, 0, 0,149, 0, 0, 0, 35, 0, 0, 2, 76, + 0, 0, 0, 93, 0, 0, 0, 33, 0, 0, 2, 76, 0, 0, 0, 95, 0, 0, 0, 33, 0, 0, 2, 77, 0, 0, 0, 95, 0, 0, 0, 35, + 0, 0, 2, 77, 0, 0, 0,149, 0, 0, 0, 35, 0, 0, 2, 78, 0, 0, 0, 93, 0, 0, 0, 35, 0, 0, 2, 78, 0, 0, 0,149, + 0, 0, 0, 35, 0, 0, 2, 79, 0, 0, 0, 92, 0, 0, 0, 35, 0, 0, 2, 79, 0, 0, 0,148, 0, 0, 0, 35, 0, 0, 2, 80, + 0, 0, 0, 83, 0, 0, 0, 35, 0, 0, 2, 80, 0, 0, 0,148, 0, 0, 0, 35, 0, 0, 2, 81, 0, 0, 0, 83, 0, 0, 0, 33, + 0, 0, 2, 81, 0, 0, 0, 92, 0, 0, 0, 33, 0, 0, 2, 82, 0, 0, 0, 96, 0, 0, 0, 35, 0, 0, 2, 82, 0, 0, 0,150, + 0, 0, 0, 35, 0, 0, 2, 83, 0, 0, 0, 85, 0, 0, 0, 33, 0, 0, 2, 83, 0, 0, 0, 96, 0, 0, 0, 33, 0, 0, 2, 84, + 0, 0, 0, 85, 0, 0, 0, 35, 0, 0, 2, 84, 0, 0, 0,150, 0, 0, 0, 35, 0, 0, 2, 85, 0, 0, 0,150, 0, 0, 0, 35, + 0, 0, 2, 85, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 2, 86, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 2, 86, 0, 0, 0,152, + 0, 0, 0, 35, 0, 0, 2, 87, 0, 0, 0,150, 0, 0, 0, 35, 0, 0, 2, 87, 0, 0, 0,152, 0, 0, 0, 35, 0, 0, 2, 88, + 0, 0, 0, 95, 0, 0, 0, 33, 0, 0, 2, 88, 0, 0, 0, 97, 0, 0, 0, 33, 0, 0, 2, 89, 0, 0, 0, 97, 0, 0, 0, 35, + 0, 0, 2, 89, 0, 0, 0,152, 0, 0, 0, 35, 0, 0, 2, 90, 0, 0, 0, 95, 0, 0, 0, 35, 0, 0, 2, 90, 0, 0, 0,152, + 0, 0, 0, 35, 0, 0, 2, 91, 0, 0, 0, 94, 0, 0, 0, 35, 0, 0, 2, 91, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 2, 92, + 0, 0, 0, 84, 0, 0, 0, 35, 0, 0, 2, 92, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 2, 93, 0, 0, 0, 84, 0, 0, 0, 33, + 0, 0, 2, 93, 0, 0, 0, 94, 0, 0, 0, 33, 0, 0, 2, 94, 0, 0, 0, 98, 0, 0, 0, 35, 0, 0, 2, 94, 0, 0, 0,153, + 0, 0, 0, 35, 0, 0, 2, 95, 0, 0, 0, 87, 0, 0, 0, 33, 0, 0, 2, 95, 0, 0, 0, 98, 0, 0, 0, 33, 0, 0, 2, 96, + 0, 0, 0, 87, 0, 0, 0, 35, 0, 0, 2, 96, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 2, 97, 0, 0, 0,153, 0, 0, 0, 35, + 0, 0, 2, 97, 0, 0, 0,154, 0, 0, 0, 35, 0, 0, 2, 98, 0, 0, 0,154, 0, 0, 0, 35, 0, 0, 2, 98, 0, 0, 0,155, + 0, 0, 0, 35, 0, 0, 2, 99, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 2, 99, 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 2,100, + 0, 0, 0, 97, 0, 0, 0, 33, 0, 0, 2,100, 0, 0, 0, 99, 0, 0, 0, 33, 0, 0, 2,101, 0, 0, 0, 99, 0, 0, 0, 35, + 0, 0, 2,101, 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 2,102, 0, 0, 0, 97, 0, 0, 0, 35, 0, 0, 2,102, 0, 0, 0,155, + 0, 0, 0, 35, 0, 0, 2,103, 0, 0, 0, 96, 0, 0, 0, 35, 0, 0, 2,103, 0, 0, 0,154, 0, 0, 0, 35, 0, 0, 2,104, + 0, 0, 0, 86, 0, 0, 0, 35, 0, 0, 2,104, 0, 0, 0,154, 0, 0, 0, 35, 0, 0, 2,105, 0, 0, 0, 86, 0, 0, 0, 33, + 0, 0, 2,105, 0, 0, 0, 96, 0, 0, 0, 33, 0, 0, 2,106, 0, 0, 0,100, 0, 0, 0, 35, 0, 0, 2,106, 0, 0, 0,156, + 0, 0, 0, 35, 0, 0, 2,107, 0, 0, 0, 89, 0, 0, 0, 33, 0, 0, 2,107, 0, 0, 0,100, 0, 0, 0, 33, 0, 0, 2,108, + 0, 0, 0, 89, 0, 0, 0, 35, 0, 0, 2,108, 0, 0, 0,156, 0, 0, 0, 35, 0, 0, 2,109, 0, 0, 0,156, 0, 0, 0, 35, + 0, 0, 2,109, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 2,110, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 2,110, 0, 0, 0,158, + 0, 0, 0, 35, 0, 0, 2,111, 0, 0, 0,156, 0, 0, 0, 35, 0, 0, 2,111, 0, 0, 0,158, 0, 0, 0, 35, 0, 0, 2,112, + 0, 0, 0, 99, 0, 0, 0, 33, 0, 0, 2,112, 0, 0, 0,101, 0, 0, 0, 33, 0, 0, 2,113, 0, 0, 0,101, 0, 0, 0, 35, + 0, 0, 2,113, 0, 0, 0,158, 0, 0, 0, 35, 0, 0, 2,114, 0, 0, 0, 99, 0, 0, 0, 35, 0, 0, 2,114, 0, 0, 0,158, + 0, 0, 0, 35, 0, 0, 2,115, 0, 0, 0, 98, 0, 0, 0, 35, 0, 0, 2,115, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 2,116, + 0, 0, 0, 88, 0, 0, 0, 35, 0, 0, 2,116, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 2,117, 0, 0, 0, 88, 0, 0, 0, 33, + 0, 0, 2,117, 0, 0, 0, 98, 0, 0, 0, 33, 0, 0, 2,118, 0, 0, 0, 92, 0, 0, 0, 35, 0, 0, 2,118, 0, 0, 0,159, + 0, 0, 0, 35, 0, 0, 2,119, 0, 0, 0, 91, 0, 0, 0, 33, 0, 0, 2,119, 0, 0, 0, 92, 0, 0, 0, 33, 0, 0, 2,120, + 0, 0, 0, 91, 0, 0, 0, 35, 0, 0, 2,120, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 2,121, 0, 0, 0,159, 0, 0, 0, 35, + 0, 0, 2,121, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 2,122, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 2,122, 0, 0, 0,161, + 0, 0, 0, 35, 0, 0, 2,123, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 2,123, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 2,124, + 0, 0, 0, 93, 0, 0, 0, 33, 0, 0, 2,124, 0, 0, 0,101, 0, 0, 0, 33, 0, 0, 2,125, 0, 0, 0, 93, 0, 0, 0, 35, + 0, 0, 2,125, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 2,126, 0, 0, 0,101, 0, 0, 0, 35, 0, 0, 2,126, 0, 0, 0,161, + 0, 0, 0, 35, 0, 0, 2,127, 0, 0, 0,100, 0, 0, 0, 35, 0, 0, 2,127, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 2,128, + 0, 0, 0, 90, 0, 0, 0, 35, 0, 0, 2,128, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 2,129, 0, 0, 0, 90, 0, 0, 0, 33, + 0, 0, 2,129, 0, 0, 0,100, 0, 0, 0, 33, 0, 0, 1, 27, 0, 0, 1,146, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 1,146, + 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 1, 27, 0, 0, 0, 35, 0, 0, 1,146, 0, 0, 1,147, 0, 0, 0, 35, 0, 0, 1,146, + 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 1,147, 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 1, 26, 0, 0, 0, 35, + 0, 0, 0,165, 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 1, 26, 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 1,147, + 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 1,147, 0, 0, 0, 35, 0, 0, 1, 26, + 0, 0, 1,149, 0, 0, 0, 35, 0, 0, 1, 28, 0, 0, 1,149, 0, 0, 0, 35, 0, 0, 1, 26, 0, 0, 1, 28, 0, 0, 0, 35, + 0, 0, 1,149, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 1,149, 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 1,150, 0, 0, 1,151, + 0, 0, 0, 35, 0, 0, 1, 27, 0, 0, 1, 31, 0, 0, 0, 35, 0, 0, 1, 31, 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 1, 27, + 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 1, 30, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 1, 29, 0, 0, 1, 30, 0, 0, 0, 35, + 0, 0, 1, 29, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 1,152, 0, 0, 0, 35, 0, 0, 0,172, 0, 0, 1,152, + 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,172, 0, 0, 0, 35, 0, 0, 1,152, 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 1,152, + 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 1,153, 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 1, 30, 0, 0, 0, 35, + 0, 0, 1, 30, 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 1, 31, 0, 0, 1,153, + 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 1, 31, 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 0,167, + 0, 0, 1,155, 0, 0, 0, 35, 0, 0, 1, 29, 0, 0, 1,155, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 1, 29, 0, 0, 0, 35, + 0, 0, 1,155, 0, 0, 1,156, 0, 0, 0, 35, 0, 0, 1,155, 0, 0, 1,157, 0, 0, 0, 35, 0, 0, 1,156, 0, 0, 1,157, + 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,166, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 1,157, 0, 0, 0, 35, 0, 0, 0,166, + 0, 0, 1,157, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 1,156, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 1, 28, 0, 0, 0, 35, + 0, 0, 1, 28, 0, 0, 1,156, 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 1,158, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 1, 33, + 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 1,158, 0, 0, 0, 35, 0, 0, 1,158, 0, 0, 1,159, 0, 0, 0, 35, 0, 0, 1,159, + 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 1,158, 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 1, 32, 0, 0, 0, 35, + 0, 0, 1, 32, 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 1,159, + 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 1,159, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 1, 32, + 0, 0, 1,161, 0, 0, 0, 35, 0, 0, 1, 32, 0, 0, 1, 34, 0, 0, 0, 35, 0, 0, 1, 34, 0, 0, 1,161, 0, 0, 0, 35, + 0, 0, 1,161, 0, 0, 1,162, 0, 0, 0, 35, 0, 0, 1,162, 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1,161, 0, 0, 1,163, + 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1, 37, + 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1, 36, 0, 0, 1,162, 0, 0, 0, 35, 0, 0, 1, 35, 0, 0, 1,162, 0, 0, 0, 35, + 0, 0, 1, 35, 0, 0, 1, 36, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 1,164, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0,180, + 0, 0, 0, 35, 0, 0, 0,180, 0, 0, 1,164, 0, 0, 0, 35, 0, 0, 1,164, 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 1,165, + 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 1,164, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 1, 36, 0, 0, 0, 35, + 0, 0, 0,177, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 1, 36, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 1, 37, 0, 0, 1,165, + 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 0,175, + 0, 0, 1,167, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 1, 35, 0, 0, 0, 35, 0, 0, 1, 35, 0, 0, 1,167, 0, 0, 0, 35, + 0, 0, 1,167, 0, 0, 1,168, 0, 0, 0, 35, 0, 0, 1,168, 0, 0, 1,169, 0, 0, 0, 35, 0, 0, 1,167, 0, 0, 1,169, + 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0,174, 0, 0, 1,169, 0, 0, 0, 35, 0, 0, 0,162, + 0, 0, 1,169, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 1,168, 0, 0, 0, 35, 0, 0, 1, 34, 0, 0, 1,168, 0, 0, 0, 35, + 0, 0, 0,163, 0, 0, 1, 34, 0, 0, 0, 35, 0, 0, 1, 39, 0, 0, 1,170, 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 1,170, + 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 1, 39, 0, 0, 0, 35, 0, 0, 1,170, 0, 0, 1,171, 0, 0, 0, 35, 0, 0, 1,170, + 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 1,171, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 1, 38, 0, 0, 0, 35, + 0, 0, 0,169, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 1, 38, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 1,171, + 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,186, 0, 0, 0, 35, 0, 0, 0,186, 0, 0, 1,171, 0, 0, 0, 35, 0, 0, 1, 38, + 0, 0, 1,173, 0, 0, 0, 35, 0, 0, 1, 40, 0, 0, 1,173, 0, 0, 0, 35, 0, 0, 1, 38, 0, 0, 1, 40, 0, 0, 0, 35, + 0, 0, 1,173, 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 1,173, 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 1,174, 0, 0, 1,175, + 0, 0, 0, 35, 0, 0, 1, 39, 0, 0, 1, 43, 0, 0, 0, 35, 0, 0, 1, 43, 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 1, 39, + 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 1, 42, 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 1, 41, 0, 0, 1, 42, 0, 0, 0, 35, + 0, 0, 1, 41, 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 0,184, 0, 0, 1,176, 0, 0, 0, 35, 0, 0, 0,188, 0, 0, 1,176, + 0, 0, 0, 35, 0, 0, 0,188, 0, 0, 0,184, 0, 0, 0, 35, 0, 0, 1,176, 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 1,176, + 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 1,177, 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 1, 42, 0, 0, 0, 35, + 0, 0, 1, 42, 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 1, 43, 0, 0, 1,177, + 0, 0, 0, 35, 0, 0, 0,189, 0, 0, 1, 43, 0, 0, 0, 35, 0, 0, 0,189, 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 0,183, + 0, 0, 1,179, 0, 0, 0, 35, 0, 0, 1, 41, 0, 0, 1,179, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 1, 41, 0, 0, 0, 35, + 0, 0, 1,179, 0, 0, 1,180, 0, 0, 0, 35, 0, 0, 1,179, 0, 0, 1,181, 0, 0, 0, 35, 0, 0, 1,180, 0, 0, 1,181, + 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,182, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 1,181, 0, 0, 0, 35, 0, 0, 0,182, + 0, 0, 1,181, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 1,180, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 1, 40, 0, 0, 0, 35, + 0, 0, 1, 40, 0, 0, 1,180, 0, 0, 0, 35, 0, 0, 1, 45, 0, 0, 1,182, 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 1,182, + 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 1, 45, 0, 0, 0, 35, 0, 0, 1,182, 0, 0, 1,183, 0, 0, 0, 35, 0, 0, 1,182, + 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 1,183, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 1, 44, 0, 0, 0, 35, + 0, 0, 0,185, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 1, 44, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 0,184, 0, 0, 1,183, + 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 0,184, 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 1,183, 0, 0, 0, 35, 0, 0, 1, 44, + 0, 0, 1,185, 0, 0, 0, 35, 0, 0, 1, 46, 0, 0, 1,185, 0, 0, 0, 35, 0, 0, 1, 44, 0, 0, 1, 46, 0, 0, 0, 35, + 0, 0, 1,185, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 1,185, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1,186, 0, 0, 1,187, + 0, 0, 0, 35, 0, 0, 1, 45, 0, 0, 1, 49, 0, 0, 0, 35, 0, 0, 1, 49, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1, 45, + 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1, 48, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 1, 47, 0, 0, 1, 48, 0, 0, 0, 35, + 0, 0, 1, 47, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 1,188, 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 1,188, + 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 0,192, 0, 0, 0, 35, 0, 0, 1,188, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 1,188, + 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 1,189, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 0,193, 0, 0, 1, 48, 0, 0, 0, 35, + 0, 0, 1, 48, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 0,193, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 1, 49, 0, 0, 1,189, + 0, 0, 0, 35, 0, 0, 0,197, 0, 0, 1, 49, 0, 0, 0, 35, 0, 0, 0,197, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 0,191, + 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 1, 47, 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 1, 47, 0, 0, 0, 35, + 0, 0, 1,191, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 1,191, 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 1,192, 0, 0, 1,193, + 0, 0, 0, 35, 0, 0, 0,190, 0, 0, 0,182, 0, 0, 0, 35, 0, 0, 0,182, 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 0,190, + 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 1, 46, 0, 0, 0, 35, + 0, 0, 1, 46, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 1, 51, 0, 0, 1,194, 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 1,194, + 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 1, 51, 0, 0, 0, 35, 0, 0, 1,194, 0, 0, 1,195, 0, 0, 0, 35, 0, 0, 1,194, + 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 1,195, 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 0,193, 0, 0, 1, 50, 0, 0, 0, 35, + 0, 0, 0,193, 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 1, 50, 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 1,195, + 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 0,192, 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 1,195, 0, 0, 0, 35, 0, 0, 1, 50, + 0, 0, 1,197, 0, 0, 0, 35, 0, 0, 1, 53, 0, 0, 1,197, 0, 0, 0, 35, 0, 0, 1, 50, 0, 0, 1, 53, 0, 0, 0, 35, + 0, 0, 1,197, 0, 0, 1,198, 0, 0, 0, 35, 0, 0, 1,197, 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1,198, 0, 0, 1,199, + 0, 0, 0, 35, 0, 0, 1, 51, 0, 0, 1, 55, 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1, 51, + 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1, 54, 0, 0, 1,198, 0, 0, 0, 35, 0, 0, 1, 52, 0, 0, 1, 54, 0, 0, 0, 35, + 0, 0, 1, 52, 0, 0, 1,198, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 1,200, 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 1,200, + 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 0,176, 0, 0, 0, 35, 0, 0, 1,200, 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 1,200, + 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 1,201, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 1, 54, 0, 0, 0, 35, + 0, 0, 1, 54, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 1,201, + 0, 0, 0, 35, 0, 0, 0,201, 0, 0, 1, 55, 0, 0, 0, 35, 0, 0, 0,201, 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 0,175, + 0, 0, 1,203, 0, 0, 0, 35, 0, 0, 1, 52, 0, 0, 1,203, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 1, 52, 0, 0, 0, 35, + 0, 0, 1,203, 0, 0, 1,204, 0, 0, 0, 35, 0, 0, 1,203, 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 1,204, 0, 0, 1,205, + 0, 0, 0, 35, 0, 0, 0,190, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0,190, 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 0,174, + 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 1,204, 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 1, 53, 0, 0, 0, 35, + 0, 0, 1, 53, 0, 0, 1,204, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1,206, 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 1, 57, + 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 1,206, 0, 0, 0, 35, 0, 0, 1,206, 0, 0, 1,207, 0, 0, 0, 35, 0, 0, 1,207, + 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 1,206, 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 1, 56, 0, 0, 0, 35, + 0, 0, 1, 56, 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 1,207, + 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 1,207, 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 1, 56, + 0, 0, 1,209, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 1, 56, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 1,209, 0, 0, 0, 35, + 0, 0, 1,209, 0, 0, 1,210, 0, 0, 0, 35, 0, 0, 1,210, 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 1,209, 0, 0, 1,211, + 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 1, 57, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 1, 61, + 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 1,210, 0, 0, 0, 35, 0, 0, 1, 59, 0, 0, 1,210, 0, 0, 0, 35, + 0, 0, 1, 59, 0, 0, 1, 60, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 1,212, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 0,208, + 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 1,212, 0, 0, 0, 35, 0, 0, 1,212, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 1,213, + 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1,212, 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 0,205, 0, 0, 0, 35, + 0, 0, 0,205, 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 1,213, + 0, 0, 0, 35, 0, 0, 0,209, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 0,209, 0, 0, 0, 35, 0, 0, 0,203, + 0, 0, 1,215, 0, 0, 0, 35, 0, 0, 1, 59, 0, 0, 0,203, 0, 0, 0, 35, 0, 0, 1, 59, 0, 0, 1,215, 0, 0, 0, 35, + 0, 0, 1,215, 0, 0, 1,216, 0, 0, 0, 35, 0, 0, 1,216, 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 1,215, 0, 0, 1,217, + 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 0,180, + 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 1,216, 0, 0, 0, 35, 0, 0, 1, 58, 0, 0, 1,216, 0, 0, 0, 35, + 0, 0, 1, 58, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 1,218, 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 0,215, + 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 1,218, 0, 0, 0, 35, 0, 0, 1,218, 0, 0, 1,219, 0, 0, 0, 35, 0, 0, 1,219, + 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 1,218, 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 0,173, 0, 0, 0, 35, + 0, 0, 1, 62, 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 0,172, 0, 0, 1,219, + 0, 0, 0, 35, 0, 0, 0,214, 0, 0, 1,219, 0, 0, 0, 35, 0, 0, 0,172, 0, 0, 0,214, 0, 0, 0, 35, 0, 0, 1, 62, + 0, 0, 1,221, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 1, 64, 0, 0, 0, 35, 0, 0, 1, 64, 0, 0, 1,221, 0, 0, 0, 35, + 0, 0, 1,221, 0, 0, 1,222, 0, 0, 0, 35, 0, 0, 1,222, 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1,221, 0, 0, 1,223, + 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 1, 67, 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1, 67, + 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 1,222, 0, 0, 0, 35, 0, 0, 1, 65, 0, 0, 1,222, 0, 0, 0, 35, + 0, 0, 1, 65, 0, 0, 1, 66, 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 1,224, 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 0,216, + 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 1,224, 0, 0, 0, 35, 0, 0, 1,224, 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 1,225, + 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1,224, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 0,213, 0, 0, 0, 35, + 0, 0, 0,213, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1, 67, 0, 0, 1,225, + 0, 0, 0, 35, 0, 0, 0,217, 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 1, 67, 0, 0, 0,217, 0, 0, 0, 35, 0, 0, 0,211, + 0, 0, 1,227, 0, 0, 0, 35, 0, 0, 1, 65, 0, 0, 0,211, 0, 0, 0, 35, 0, 0, 1, 65, 0, 0, 1,227, 0, 0, 0, 35, + 0, 0, 1,227, 0, 0, 1,228, 0, 0, 0, 35, 0, 0, 1,228, 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 1,227, 0, 0, 1,229, + 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 0,210, 0, 0, 0, 35, 0, 0, 0,210, 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 0,170, + 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 1,228, 0, 0, 0, 35, 0, 0, 1, 64, 0, 0, 1,228, 0, 0, 0, 35, + 0, 0, 1, 64, 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 1, 69, 0, 0, 1,230, 0, 0, 0, 35, 0, 0, 1, 69, 0, 0, 0,223, + 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 1,230, 0, 0, 0, 35, 0, 0, 1,230, 0, 0, 1,231, 0, 0, 0, 35, 0, 0, 1,231, + 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 1,230, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 1, 68, 0, 0, 0,189, 0, 0, 0, 35, + 0, 0, 1, 68, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 0,189, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 0,188, 0, 0, 1,231, + 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 1,231, 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 0,188, 0, 0, 0, 35, 0, 0, 1, 68, + 0, 0, 1,233, 0, 0, 0, 35, 0, 0, 1, 68, 0, 0, 1, 70, 0, 0, 0, 35, 0, 0, 1, 70, 0, 0, 1,233, 0, 0, 0, 35, + 0, 0, 1,233, 0, 0, 1,234, 0, 0, 0, 35, 0, 0, 1,234, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1,233, 0, 0, 1,235, + 0, 0, 0, 35, 0, 0, 1, 69, 0, 0, 1, 73, 0, 0, 0, 35, 0, 0, 1, 69, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1, 73, + 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1, 72, 0, 0, 1,234, 0, 0, 0, 35, 0, 0, 1, 71, 0, 0, 1,234, 0, 0, 0, 35, + 0, 0, 1, 71, 0, 0, 1, 72, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 1,236, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 0,224, + 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 1,236, 0, 0, 0, 35, 0, 0, 1,236, 0, 0, 1,237, 0, 0, 0, 35, 0, 0, 1,237, + 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 1,236, 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 1, 72, 0, 0, 0,221, 0, 0, 0, 35, + 0, 0, 0,221, 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 1, 72, 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 1, 73, 0, 0, 1,237, + 0, 0, 0, 35, 0, 0, 0,225, 0, 0, 1,237, 0, 0, 0, 35, 0, 0, 1, 73, 0, 0, 0,225, 0, 0, 0, 35, 0, 0, 0,219, + 0, 0, 1,239, 0, 0, 0, 35, 0, 0, 1, 71, 0, 0, 0,219, 0, 0, 0, 35, 0, 0, 1, 71, 0, 0, 1,239, 0, 0, 0, 35, + 0, 0, 1,239, 0, 0, 1,240, 0, 0, 0, 35, 0, 0, 1,240, 0, 0, 1,241, 0, 0, 0, 35, 0, 0, 1,239, 0, 0, 1,241, + 0, 0, 0, 35, 0, 0, 0,218, 0, 0, 0,186, 0, 0, 0, 35, 0, 0, 0,218, 0, 0, 1,241, 0, 0, 0, 35, 0, 0, 0,186, + 0, 0, 1,241, 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 1,240, 0, 0, 0, 35, 0, 0, 1, 70, 0, 0, 1,240, 0, 0, 0, 35, + 0, 0, 1, 70, 0, 0, 0,187, 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 1,242, 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 0,231, + 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 1,242, 0, 0, 0, 35, 0, 0, 1,242, 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 1,243, + 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 1,242, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 1, 74, 0, 0, 0,197, 0, 0, 0, 35, + 0, 0, 1, 74, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 0,197, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 1,243, + 0, 0, 0, 35, 0, 0, 0,230, 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 0,230, 0, 0, 0, 35, 0, 0, 1, 74, + 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 1, 74, 0, 0, 1, 76, 0, 0, 0, 35, 0, 0, 1, 76, 0, 0, 1,245, 0, 0, 0, 35, + 0, 0, 1,245, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 1,246, 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1,245, 0, 0, 1,247, + 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 1, 79, 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1, 79, + 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1, 78, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 1, 77, 0, 0, 1,246, 0, 0, 0, 35, + 0, 0, 1, 77, 0, 0, 1, 78, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 1,248, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 0,232, + 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 1,248, 0, 0, 0, 35, 0, 0, 1,248, 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 1,249, + 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1,248, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1, 78, 0, 0, 0,229, 0, 0, 0, 35, + 0, 0, 0,229, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1, 78, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1, 79, 0, 0, 1,249, + 0, 0, 0, 35, 0, 0, 0,233, 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 1, 79, 0, 0, 0,233, 0, 0, 0, 35, 0, 0, 0,227, + 0, 0, 1,251, 0, 0, 0, 35, 0, 0, 1, 77, 0, 0, 0,227, 0, 0, 0, 35, 0, 0, 1, 77, 0, 0, 1,251, 0, 0, 0, 35, + 0, 0, 1,251, 0, 0, 1,252, 0, 0, 0, 35, 0, 0, 1,252, 0, 0, 1,253, 0, 0, 0, 35, 0, 0, 1,251, 0, 0, 1,253, + 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 0,226, 0, 0, 0, 35, 0, 0, 0,226, 0, 0, 1,253, 0, 0, 0, 35, 0, 0, 0,194, + 0, 0, 1,253, 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 1,252, 0, 0, 0, 35, 0, 0, 1, 76, 0, 0, 1,252, 0, 0, 0, 35, + 0, 0, 1, 76, 0, 0, 0,195, 0, 0, 0, 35, 0, 0, 1, 81, 0, 0, 1,254, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 1, 81, + 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 1,254, 0, 0, 0, 35, 0, 0, 1,254, 0, 0, 1,255, 0, 0, 0, 35, 0, 0, 1,255, + 0, 0, 2, 0, 0, 0, 0, 35, 0, 0, 1,254, 0, 0, 2, 0, 0, 0, 0, 35, 0, 0, 0,201, 0, 0, 1, 80, 0, 0, 0, 35, + 0, 0, 1, 80, 0, 0, 2, 0, 0, 0, 0, 35, 0, 0, 0,201, 0, 0, 2, 0, 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 1,255, + 0, 0, 0, 35, 0, 0, 0,238, 0, 0, 1,255, 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 0,238, 0, 0, 0, 35, 0, 0, 1, 80, + 0, 0, 2, 1, 0, 0, 0, 35, 0, 0, 1, 80, 0, 0, 1, 82, 0, 0, 0, 35, 0, 0, 1, 82, 0, 0, 2, 1, 0, 0, 0, 35, + 0, 0, 2, 1, 0, 0, 2, 2, 0, 0, 0, 35, 0, 0, 2, 2, 0, 0, 2, 3, 0, 0, 0, 35, 0, 0, 2, 1, 0, 0, 2, 3, + 0, 0, 0, 35, 0, 0, 1, 81, 0, 0, 1, 85, 0, 0, 0, 35, 0, 0, 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0, 0, 35, 0, 0, 1, 87, 0, 0, 2, 10, 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 2, 10, + 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 1, 87, 0, 0, 0, 35, 0, 0, 2, 10, 0, 0, 2, 11, 0, 0, 0, 35, 0, 0, 2, 10, + 0, 0, 2, 12, 0, 0, 0, 35, 0, 0, 2, 11, 0, 0, 2, 12, 0, 0, 0, 35, 0, 0, 0,209, 0, 0, 1, 86, 0, 0, 0, 35, + 0, 0, 0,209, 0, 0, 2, 12, 0, 0, 0, 35, 0, 0, 1, 86, 0, 0, 2, 12, 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 2, 11, + 0, 0, 0, 35, 0, 0, 0,244, 0, 0, 0,208, 0, 0, 0, 35, 0, 0, 0,244, 0, 0, 2, 11, 0, 0, 0, 35, 0, 0, 1, 86, + 0, 0, 2, 13, 0, 0, 0, 35, 0, 0, 1, 88, 0, 0, 2, 13, 0, 0, 0, 35, 0, 0, 1, 86, 0, 0, 1, 88, 0, 0, 0, 35, + 0, 0, 2, 13, 0, 0, 2, 14, 0, 0, 0, 35, 0, 0, 2, 13, 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 2, 14, 0, 0, 2, 15, + 0, 0, 0, 35, 0, 0, 1, 87, 0, 0, 1, 91, 0, 0, 0, 35, 0, 0, 1, 91, 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 1, 87, + 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 1, 90, 0, 0, 2, 14, 0, 0, 0, 35, 0, 0, 1, 89, 0, 0, 1, 90, 0, 0, 0, 35, + 0, 0, 1, 89, 0, 0, 2, 14, 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 2, 16, 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 2, 16, + 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 0,212, 0, 0, 0, 35, 0, 0, 2, 16, 0, 0, 2, 17, 0, 0, 0, 35, 0, 0, 2, 16, + 0, 0, 2, 18, 0, 0, 0, 35, 0, 0, 2, 17, 0, 0, 2, 18, 0, 0, 0, 35, 0, 0, 0,213, 0, 0, 1, 90, 0, 0, 0, 35, + 0, 0, 1, 90, 0, 0, 2, 18, 0, 0, 0, 35, 0, 0, 0,213, 0, 0, 2, 18, 0, 0, 0, 35, 0, 0, 1, 91, 0, 0, 2, 17, + 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 1, 91, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 2, 17, 0, 0, 0, 35, 0, 0, 0,211, + 0, 0, 2, 19, 0, 0, 0, 35, 0, 0, 1, 89, 0, 0, 2, 19, 0, 0, 0, 35, 0, 0, 0,211, 0, 0, 1, 89, 0, 0, 0, 35, + 0, 0, 2, 19, 0, 0, 2, 20, 0, 0, 0, 35, 0, 0, 2, 19, 0, 0, 2, 21, 0, 0, 0, 35, 0, 0, 2, 20, 0, 0, 2, 21, + 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 0,210, 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 2, 21, 0, 0, 0, 35, 0, 0, 0,210, + 0, 0, 2, 21, 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 2, 20, 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 1, 88, 0, 0, 0, 35, + 0, 0, 1, 88, 0, 0, 2, 20, 0, 0, 0, 35, 0, 0, 1, 93, 0, 0, 2, 22, 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 2, 22, + 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 1, 93, 0, 0, 0, 35, 0, 0, 2, 22, 0, 0, 2, 23, 0, 0, 0, 35, 0, 0, 2, 22, + 0, 0, 2, 24, 0, 0, 0, 35, 0, 0, 2, 23, 0, 0, 2, 24, 0, 0, 0, 35, 0, 0, 0,217, 0, 0, 1, 92, 0, 0, 0, 35, + 0, 0, 0,217, 0, 0, 2, 24, 0, 0, 0, 35, 0, 0, 1, 92, 0, 0, 2, 24, 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 2, 23, + 0, 0, 0, 35, 0, 0, 0,246, 0, 0, 0,216, 0, 0, 0, 35, 0, 0, 0,246, 0, 0, 2, 23, 0, 0, 0, 35, 0, 0, 1, 92, + 0, 0, 2, 25, 0, 0, 0, 35, 0, 0, 1, 94, 0, 0, 2, 25, 0, 0, 0, 35, 0, 0, 1, 92, 0, 0, 1, 94, 0, 0, 0, 35, + 0, 0, 2, 25, 0, 0, 2, 26, 0, 0, 0, 35, 0, 0, 2, 25, 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 2, 26, 0, 0, 2, 27, + 0, 0, 0, 35, 0, 0, 1, 93, 0, 0, 1, 97, 0, 0, 0, 35, 0, 0, 1, 97, 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 1, 93, + 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 1, 96, 0, 0, 2, 26, 0, 0, 0, 35, 0, 0, 1, 95, 0, 0, 1, 96, 0, 0, 0, 35, + 0, 0, 1, 95, 0, 0, 2, 26, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 2, 28, 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 2, 28, + 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 0,220, 0, 0, 0, 35, 0, 0, 2, 28, 0, 0, 2, 29, 0, 0, 0, 35, 0, 0, 2, 28, + 0, 0, 2, 30, 0, 0, 0, 35, 0, 0, 2, 29, 0, 0, 2, 30, 0, 0, 0, 35, 0, 0, 0,221, 0, 0, 1, 96, 0, 0, 0, 35, + 0, 0, 1, 96, 0, 0, 2, 30, 0, 0, 0, 35, 0, 0, 0,221, 0, 0, 2, 30, 0, 0, 0, 35, 0, 0, 1, 97, 0, 0, 2, 29, + 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 1, 97, 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 2, 29, 0, 0, 0, 35, 0, 0, 0,219, + 0, 0, 2, 31, 0, 0, 0, 35, 0, 0, 1, 95, 0, 0, 2, 31, 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 1, 95, 0, 0, 0, 35, + 0, 0, 2, 31, 0, 0, 2, 32, 0, 0, 0, 35, 0, 0, 2, 31, 0, 0, 2, 33, 0, 0, 0, 35, 0, 0, 2, 32, 0, 0, 2, 33, + 0, 0, 0, 35, 0, 0, 0,214, 0, 0, 0,218, 0, 0, 0, 35, 0, 0, 0,214, 0, 0, 2, 33, 0, 0, 0, 35, 0, 0, 0,218, + 0, 0, 2, 33, 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 2, 32, 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 1, 94, 0, 0, 0, 35, + 0, 0, 1, 94, 0, 0, 2, 32, 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 2, 34, 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 2, 34, + 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 1, 99, 0, 0, 0, 35, 0, 0, 2, 34, 0, 0, 2, 35, 0, 0, 0, 35, 0, 0, 2, 34, + 0, 0, 2, 36, 0, 0, 0, 35, 0, 0, 2, 35, 0, 0, 2, 36, 0, 0, 0, 35, 0, 0, 0,225, 0, 0, 1, 98, 0, 0, 0, 35, + 0, 0, 0,225, 0, 0, 2, 36, 0, 0, 0, 35, 0, 0, 1, 98, 0, 0, 2, 36, 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 2, 35, + 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 0,250, 0, 0, 0, 35, 0, 0, 0,250, 0, 0, 2, 35, 0, 0, 0, 35, 0, 0, 1, 98, + 0, 0, 2, 37, 0, 0, 0, 35, 0, 0, 1,100, 0, 0, 2, 37, 0, 0, 0, 35, 0, 0, 1, 98, 0, 0, 1,100, 0, 0, 0, 35, + 0, 0, 2, 37, 0, 0, 2, 38, 0, 0, 0, 35, 0, 0, 2, 37, 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 2, 38, 0, 0, 2, 39, + 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 1,103, 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 1, 99, + 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 1,102, 0, 0, 2, 38, 0, 0, 0, 35, 0, 0, 1,101, 0, 0, 1,102, 0, 0, 0, 35, + 0, 0, 1,101, 0, 0, 2, 38, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 2, 40, 0, 0, 0, 35, 0, 0, 0,252, 0, 0, 2, 40, + 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 0,252, 0, 0, 0, 35, 0, 0, 2, 40, 0, 0, 2, 41, 0, 0, 0, 35, 0, 0, 2, 40, + 0, 0, 2, 42, 0, 0, 0, 35, 0, 0, 2, 41, 0, 0, 2, 42, 0, 0, 0, 35, 0, 0, 0,229, 0, 0, 1,102, 0, 0, 0, 35, + 0, 0, 1,102, 0, 0, 2, 42, 0, 0, 0, 35, 0, 0, 0,229, 0, 0, 2, 42, 0, 0, 0, 35, 0, 0, 1,103, 0, 0, 2, 41, + 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 2, 41, 0, 0, 0, 35, 0, 0, 0,227, + 0, 0, 2, 43, 0, 0, 0, 35, 0, 0, 1,101, 0, 0, 2, 43, 0, 0, 0, 35, 0, 0, 0,227, 0, 0, 1,101, 0, 0, 0, 35, + 0, 0, 2, 43, 0, 0, 2, 44, 0, 0, 0, 35, 0, 0, 2, 43, 0, 0, 2, 45, 0, 0, 0, 35, 0, 0, 2, 44, 0, 0, 2, 45, + 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 0,226, 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 2, 45, 0, 0, 0, 35, 0, 0, 0,226, + 0, 0, 2, 45, 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 2, 44, 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 1,100, 0, 0, 0, 35, + 0, 0, 1,100, 0, 0, 2, 44, 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 2, 46, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 2, 46, + 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 2, 46, 0, 0, 2, 47, 0, 0, 0, 35, 0, 0, 2, 46, + 0, 0, 2, 48, 0, 0, 0, 35, 0, 0, 2, 47, 0, 0, 2, 48, 0, 0, 0, 35, 0, 0, 0,233, 0, 0, 1,104, 0, 0, 0, 35, + 0, 0, 0,233, 0, 0, 2, 48, 0, 0, 0, 35, 0, 0, 1,104, 0, 0, 2, 48, 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 2, 47, + 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 0,254, 0, 0, 0, 35, 0, 0, 0,254, 0, 0, 2, 47, 0, 0, 0, 35, 0, 0, 1,104, + 0, 0, 2, 49, 0, 0, 0, 35, 0, 0, 1,106, 0, 0, 2, 49, 0, 0, 0, 35, 0, 0, 1,104, 0, 0, 1,106, 0, 0, 0, 35, + 0, 0, 2, 49, 0, 0, 2, 50, 0, 0, 0, 35, 0, 0, 2, 49, 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 2, 50, 0, 0, 2, 51, + 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 1,105, + 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 1,108, 0, 0, 2, 50, 0, 0, 0, 35, 0, 0, 1,108, 0, 0, 1,107, 0, 0, 0, 35, + 0, 0, 1,107, 0, 0, 2, 50, 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 2, 52, 0, 0, 0, 35, 0, 0, 1, 0, 0, 0, 2, 52, + 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 1, 0, 0, 0, 0, 35, 0, 0, 2, 52, 0, 0, 2, 53, 0, 0, 0, 35, 0, 0, 2, 52, + 0, 0, 2, 54, 0, 0, 0, 35, 0, 0, 2, 53, 0, 0, 2, 54, 0, 0, 0, 35, 0, 0, 0,237, 0, 0, 1,108, 0, 0, 0, 35, + 0, 0, 1,108, 0, 0, 2, 54, 0, 0, 0, 35, 0, 0, 0,237, 0, 0, 2, 54, 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 2, 53, + 0, 0, 0, 35, 0, 0, 1, 1, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 1, 1, 0, 0, 2, 53, 0, 0, 0, 35, 0, 0, 0,235, + 0, 0, 2, 55, 0, 0, 0, 35, 0, 0, 1,107, 0, 0, 2, 55, 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 1,107, 0, 0, 0, 35, + 0, 0, 2, 55, 0, 0, 2, 56, 0, 0, 0, 35, 0, 0, 2, 55, 0, 0, 2, 57, 0, 0, 0, 35, 0, 0, 2, 56, 0, 0, 2, 57, + 0, 0, 0, 35, 0, 0, 0,230, 0, 0, 0,234, 0, 0, 0, 35, 0, 0, 0,230, 0, 0, 2, 57, 0, 0, 0, 35, 0, 0, 0,234, + 0, 0, 2, 57, 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 2, 56, 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 1,106, 0, 0, 0, 35, + 0, 0, 1,106, 0, 0, 2, 56, 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 2, 58, 0, 0, 0, 35, 0, 0, 1, 3, 0, 0, 2, 58, + 0, 0, 0, 35, 0, 0, 1, 3, 0, 0, 1,111, 0, 0, 0, 35, 0, 0, 2, 58, 0, 0, 2, 59, 0, 0, 0, 35, 0, 0, 2, 58, + 0, 0, 2, 60, 0, 0, 0, 35, 0, 0, 2, 59, 0, 0, 2, 60, 0, 0, 0, 35, 0, 0, 0,241, 0, 0, 1,110, 0, 0, 0, 35, + 0, 0, 0,241, 0, 0, 2, 60, 0, 0, 0, 35, 0, 0, 1,110, 0, 0, 2, 60, 0, 0, 0, 35, 0, 0, 0,240, 0, 0, 2, 59, + 0, 0, 0, 35, 0, 0, 0,240, 0, 0, 1, 2, 0, 0, 0, 35, 0, 0, 1, 2, 0, 0, 2, 59, 0, 0, 0, 35, 0, 0, 1,110, + 0, 0, 2, 61, 0, 0, 0, 35, 0, 0, 1,113, 0, 0, 2, 61, 0, 0, 0, 35, 0, 0, 1,110, 0, 0, 1,113, 0, 0, 0, 35, + 0, 0, 2, 61, 0, 0, 2, 62, 0, 0, 0, 35, 0, 0, 2, 61, 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 2, 62, 0, 0, 2, 63, + 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 1,115, 0, 0, 0, 35, 0, 0, 1,115, 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 1,111, + 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 2, 62, 0, 0, 0, 35, 0, 0, 1,112, 0, 0, 1,114, 0, 0, 0, 35, + 0, 0, 1,112, 0, 0, 2, 62, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 2, 64, 0, 0, 0, 35, 0, 0, 1, 4, 0, 0, 2, 64, + 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 1, 4, 0, 0, 0, 35, 0, 0, 2, 64, 0, 0, 2, 65, 0, 0, 0, 35, 0, 0, 2, 64, + 0, 0, 2, 66, 0, 0, 0, 35, 0, 0, 2, 65, 0, 0, 2, 66, 0, 0, 0, 35, 0, 0, 0,205, 0, 0, 1,114, 0, 0, 0, 35, + 0, 0, 1,114, 0, 0, 2, 66, 0, 0, 0, 35, 0, 0, 0,205, 0, 0, 2, 66, 0, 0, 0, 35, 0, 0, 1,115, 0, 0, 2, 65, + 0, 0, 0, 35, 0, 0, 1, 5, 0, 0, 1,115, 0, 0, 0, 35, 0, 0, 1, 5, 0, 0, 2, 65, 0, 0, 0, 35, 0, 0, 0,203, + 0, 0, 2, 67, 0, 0, 0, 35, 0, 0, 1,112, 0, 0, 2, 67, 0, 0, 0, 35, 0, 0, 0,203, 0, 0, 1,112, 0, 0, 0, 35, + 0, 0, 2, 67, 0, 0, 2, 68, 0, 0, 0, 35, 0, 0, 2, 67, 0, 0, 2, 69, 0, 0, 0, 35, 0, 0, 2, 68, 0, 0, 2, 69, + 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 0,238, 0, 0, 0, 35, 0, 0, 0,238, 0, 0, 2, 69, 0, 0, 0, 35, 0, 0, 0,202, + 0, 0, 2, 69, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 2, 68, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 1,113, 0, 0, 0, 35, + 0, 0, 1,113, 0, 0, 2, 68, 0, 0, 0, 35, 0, 0, 1,117, 0, 0, 2, 70, 0, 0, 0, 35, 0, 0, 1, 11, 0, 0, 1,117, + 0, 0, 0, 35, 0, 0, 1, 11, 0, 0, 2, 70, 0, 0, 0, 35, 0, 0, 2, 70, 0, 0, 2, 71, 0, 0, 0, 35, 0, 0, 2, 71, + 0, 0, 2, 72, 0, 0, 0, 35, 0, 0, 2, 70, 0, 0, 2, 72, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 1,116, 0, 0, 0, 35, + 0, 0, 1,116, 0, 0, 2, 72, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 2, 72, 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 2, 71, + 0, 0, 0, 35, 0, 0, 1, 10, 0, 0, 2, 71, 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 1, 10, 0, 0, 0, 35, 0, 0, 1,116, + 0, 0, 2, 73, 0, 0, 0, 35, 0, 0, 1,116, 0, 0, 1,118, 0, 0, 0, 35, 0, 0, 1,118, 0, 0, 2, 73, 0, 0, 0, 35, + 0, 0, 2, 73, 0, 0, 2, 74, 0, 0, 0, 35, 0, 0, 2, 74, 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 2, 73, 0, 0, 2, 75, + 0, 0, 0, 35, 0, 0, 1,117, 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 1,117, 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 1,121, + 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 1,120, 0, 0, 2, 74, 0, 0, 0, 35, 0, 0, 1,119, 0, 0, 2, 74, 0, 0, 0, 35, + 0, 0, 1,119, 0, 0, 1,120, 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 2, 76, 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 1, 12, + 0, 0, 0, 35, 0, 0, 1, 12, 0, 0, 2, 76, 0, 0, 0, 35, 0, 0, 2, 76, 0, 0, 2, 77, 0, 0, 0, 35, 0, 0, 2, 77, + 0, 0, 2, 78, 0, 0, 0, 35, 0, 0, 2, 76, 0, 0, 2, 78, 0, 0, 0, 35, 0, 0, 1, 9, 0, 0, 1,120, 0, 0, 0, 35, + 0, 0, 1, 9, 0, 0, 2, 78, 0, 0, 0, 35, 0, 0, 1,120, 0, 0, 2, 78, 0, 0, 0, 35, 0, 0, 1,121, 0, 0, 2, 77, + 0, 0, 0, 35, 0, 0, 1, 13, 0, 0, 2, 77, 0, 0, 0, 35, 0, 0, 1, 13, 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 1, 7, + 0, 0, 2, 79, 0, 0, 0, 35, 0, 0, 1, 7, 0, 0, 1,119, 0, 0, 0, 35, 0, 0, 1,119, 0, 0, 2, 79, 0, 0, 0, 35, + 0, 0, 2, 79, 0, 0, 2, 80, 0, 0, 0, 35, 0, 0, 2, 80, 0, 0, 2, 81, 0, 0, 0, 35, 0, 0, 2, 79, 0, 0, 2, 81, + 0, 0, 0, 35, 0, 0, 0,244, 0, 0, 1, 6, 0, 0, 0, 35, 0, 0, 1, 6, 0, 0, 2, 81, 0, 0, 0, 35, 0, 0, 0,244, + 0, 0, 2, 81, 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 2, 80, 0, 0, 0, 35, 0, 0, 1,118, 0, 0, 2, 80, 0, 0, 0, 35, + 0, 0, 0,245, 0, 0, 1,118, 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 2, 82, 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 1,123, + 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 2, 82, 0, 0, 0, 35, 0, 0, 2, 82, 0, 0, 2, 83, 0, 0, 0, 35, 0, 0, 2, 83, + 0, 0, 2, 84, 0, 0, 0, 35, 0, 0, 2, 82, 0, 0, 2, 84, 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 1,122, 0, 0, 0, 35, + 0, 0, 1,122, 0, 0, 2, 84, 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 2, 84, 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 2, 83, + 0, 0, 0, 35, 0, 0, 1, 14, 0, 0, 2, 83, 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 1, 14, 0, 0, 0, 35, 0, 0, 1,122, + 0, 0, 2, 85, 0, 0, 0, 35, 0, 0, 1,122, 0, 0, 1,124, 0, 0, 0, 35, 0, 0, 1,124, 0, 0, 2, 85, 0, 0, 0, 35, + 0, 0, 2, 85, 0, 0, 2, 86, 0, 0, 0, 35, 0, 0, 2, 86, 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 2, 85, 0, 0, 2, 87, + 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 1,127, + 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 1,126, 0, 0, 2, 86, 0, 0, 0, 35, 0, 0, 1,125, 0, 0, 2, 86, 0, 0, 0, 35, + 0, 0, 1,125, 0, 0, 1,126, 0, 0, 0, 35, 0, 0, 1, 12, 0, 0, 2, 88, 0, 0, 0, 35, 0, 0, 1, 12, 0, 0, 1, 16, + 0, 0, 0, 35, 0, 0, 1, 16, 0, 0, 2, 88, 0, 0, 0, 35, 0, 0, 2, 88, 0, 0, 2, 89, 0, 0, 0, 35, 0, 0, 2, 89, + 0, 0, 2, 90, 0, 0, 0, 35, 0, 0, 2, 88, 0, 0, 2, 90, 0, 0, 0, 35, 0, 0, 1, 13, 0, 0, 1,126, 0, 0, 0, 35, + 0, 0, 1, 13, 0, 0, 2, 90, 0, 0, 0, 35, 0, 0, 1,126, 0, 0, 2, 90, 0, 0, 0, 35, 0, 0, 1,127, 0, 0, 2, 89, + 0, 0, 0, 35, 0, 0, 1, 17, 0, 0, 2, 89, 0, 0, 0, 35, 0, 0, 1, 17, 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 1, 11, + 0, 0, 2, 91, 0, 0, 0, 35, 0, 0, 1, 11, 0, 0, 1,125, 0, 0, 0, 35, 0, 0, 1,125, 0, 0, 2, 91, 0, 0, 0, 35, + 0, 0, 2, 91, 0, 0, 2, 92, 0, 0, 0, 35, 0, 0, 2, 92, 0, 0, 2, 93, 0, 0, 0, 35, 0, 0, 2, 91, 0, 0, 2, 93, + 0, 0, 0, 35, 0, 0, 0,246, 0, 0, 1, 10, 0, 0, 0, 35, 0, 0, 1, 10, 0, 0, 2, 93, 0, 0, 0, 35, 0, 0, 0,246, + 0, 0, 2, 93, 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 2, 92, 0, 0, 0, 35, 0, 0, 1,124, 0, 0, 2, 92, 0, 0, 0, 35, + 0, 0, 0,247, 0, 0, 1,124, 0, 0, 0, 35, 0, 0, 1,129, 0, 0, 2, 94, 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 1,129, + 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 2, 94, 0, 0, 0, 35, 0, 0, 2, 94, 0, 0, 2, 95, 0, 0, 0, 35, 0, 0, 2, 95, + 0, 0, 2, 96, 0, 0, 0, 35, 0, 0, 2, 94, 0, 0, 2, 96, 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 1,128, 0, 0, 0, 35, + 0, 0, 1,128, 0, 0, 2, 96, 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 2, 96, 0, 0, 0, 35, 0, 0, 0,252, 0, 0, 2, 95, + 0, 0, 0, 35, 0, 0, 1, 18, 0, 0, 2, 95, 0, 0, 0, 35, 0, 0, 0,252, 0, 0, 1, 18, 0, 0, 0, 35, 0, 0, 1,128, + 0, 0, 2, 97, 0, 0, 0, 35, 0, 0, 1,128, 0, 0, 1,130, 0, 0, 0, 35, 0, 0, 1,130, 0, 0, 2, 97, 0, 0, 0, 35, + 0, 0, 2, 97, 0, 0, 2, 98, 0, 0, 0, 35, 0, 0, 2, 98, 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 2, 97, 0, 0, 2, 99, + 0, 0, 0, 35, 0, 0, 1,129, 0, 0, 1,133, 0, 0, 0, 35, 0, 0, 1,129, 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 1,133, + 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 2, 98, 0, 0, 0, 35, 0, 0, 1,131, 0, 0, 2, 98, 0, 0, 0, 35, + 0, 0, 1,131, 0, 0, 1,132, 0, 0, 0, 35, 0, 0, 1, 16, 0, 0, 2,100, 0, 0, 0, 35, 0, 0, 1, 16, 0, 0, 1, 20, + 0, 0, 0, 35, 0, 0, 1, 20, 0, 0, 2,100, 0, 0, 0, 35, 0, 0, 2,100, 0, 0, 2,101, 0, 0, 0, 35, 0, 0, 2,101, + 0, 0, 2,102, 0, 0, 0, 35, 0, 0, 2,100, 0, 0, 2,102, 0, 0, 0, 35, 0, 0, 1, 17, 0, 0, 1,132, 0, 0, 0, 35, + 0, 0, 1, 17, 0, 0, 2,102, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 2,102, 0, 0, 0, 35, 0, 0, 1,133, 0, 0, 2,101, + 0, 0, 0, 35, 0, 0, 1, 21, 0, 0, 2,101, 0, 0, 0, 35, 0, 0, 1, 21, 0, 0, 1,133, 0, 0, 0, 35, 0, 0, 1, 15, + 0, 0, 2,103, 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 1,131, 0, 0, 0, 35, 0, 0, 1,131, 0, 0, 2,103, 0, 0, 0, 35, + 0, 0, 2,103, 0, 0, 2,104, 0, 0, 0, 35, 0, 0, 2,104, 0, 0, 2,105, 0, 0, 0, 35, 0, 0, 2,103, 0, 0, 2,105, + 0, 0, 0, 35, 0, 0, 0,250, 0, 0, 1, 14, 0, 0, 0, 35, 0, 0, 1, 14, 0, 0, 2,105, 0, 0, 0, 35, 0, 0, 0,250, + 0, 0, 2,105, 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 2,104, 0, 0, 0, 35, 0, 0, 1,130, 0, 0, 2,104, 0, 0, 0, 35, + 0, 0, 0,251, 0, 0, 1,130, 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 2,106, 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 1,135, + 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 2,106, 0, 0, 0, 35, 0, 0, 2,106, 0, 0, 2,107, 0, 0, 0, 35, 0, 0, 2,107, + 0, 0, 2,108, 0, 0, 0, 35, 0, 0, 2,106, 0, 0, 2,108, 0, 0, 0, 35, 0, 0, 1, 1, 0, 0, 1,134, 0, 0, 0, 35, + 0, 0, 1,134, 0, 0, 2,108, 0, 0, 0, 35, 0, 0, 1, 1, 0, 0, 2,108, 0, 0, 0, 35, 0, 0, 1, 0, 0, 0, 2,107, + 0, 0, 0, 35, 0, 0, 1, 22, 0, 0, 2,107, 0, 0, 0, 35, 0, 0, 1, 0, 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 1,134, + 0, 0, 2,109, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 1,136, 0, 0, 0, 35, 0, 0, 1,136, 0, 0, 2,109, 0, 0, 0, 35, + 0, 0, 2,109, 0, 0, 2,110, 0, 0, 0, 35, 0, 0, 2,110, 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 2,109, 0, 0, 2,111, + 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 1,139, 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 1,139, + 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 2,110, 0, 0, 0, 35, 0, 0, 1,137, 0, 0, 2,110, 0, 0, 0, 35, + 0, 0, 1,137, 0, 0, 1,138, 0, 0, 0, 35, 0, 0, 1, 20, 0, 0, 2,112, 0, 0, 0, 35, 0, 0, 1, 20, 0, 0, 1, 24, + 0, 0, 0, 35, 0, 0, 1, 24, 0, 0, 2,112, 0, 0, 0, 35, 0, 0, 2,112, 0, 0, 2,113, 0, 0, 0, 35, 0, 0, 2,113, + 0, 0, 2,114, 0, 0, 0, 35, 0, 0, 2,112, 0, 0, 2,114, 0, 0, 0, 35, 0, 0, 1, 21, 0, 0, 1,138, 0, 0, 0, 35, + 0, 0, 1, 21, 0, 0, 2,114, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 2,114, 0, 0, 0, 35, 0, 0, 1,139, 0, 0, 2,113, + 0, 0, 0, 35, 0, 0, 1, 25, 0, 0, 2,113, 0, 0, 0, 35, 0, 0, 1, 25, 0, 0, 1,139, 0, 0, 0, 35, 0, 0, 1, 19, + 0, 0, 2,115, 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 1,137, 0, 0, 0, 35, 0, 0, 1,137, 0, 0, 2,115, 0, 0, 0, 35, + 0, 0, 2,115, 0, 0, 2,116, 0, 0, 0, 35, 0, 0, 2,116, 0, 0, 2,117, 0, 0, 0, 35, 0, 0, 2,115, 0, 0, 2,117, + 0, 0, 0, 35, 0, 0, 0,254, 0, 0, 1, 18, 0, 0, 0, 35, 0, 0, 1, 18, 0, 0, 2,117, 0, 0, 0, 35, 0, 0, 0,254, + 0, 0, 2,117, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 2,116, 0, 0, 0, 35, 0, 0, 1,136, 0, 0, 2,116, 0, 0, 0, 35, + 0, 0, 0,255, 0, 0, 1,136, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 2,118, 0, 0, 0, 35, 0, 0, 1, 7, 0, 0, 1,141, + 0, 0, 0, 35, 0, 0, 1, 7, 0, 0, 2,118, 0, 0, 0, 35, 0, 0, 2,118, 0, 0, 2,119, 0, 0, 0, 35, 0, 0, 2,119, + 0, 0, 2,120, 0, 0, 0, 35, 0, 0, 2,118, 0, 0, 2,120, 0, 0, 0, 35, 0, 0, 1, 5, 0, 0, 1,140, 0, 0, 0, 35, + 0, 0, 1,140, 0, 0, 2,120, 0, 0, 0, 35, 0, 0, 1, 5, 0, 0, 2,120, 0, 0, 0, 35, 0, 0, 1, 4, 0, 0, 2,119, + 0, 0, 0, 35, 0, 0, 1, 6, 0, 0, 2,119, 0, 0, 0, 35, 0, 0, 1, 4, 0, 0, 1, 6, 0, 0, 0, 35, 0, 0, 1,140, + 0, 0, 2,121, 0, 0, 0, 35, 0, 0, 1,140, 0, 0, 1,142, 0, 0, 0, 35, 0, 0, 1,142, 0, 0, 2,121, 0, 0, 0, 35, + 0, 0, 2,121, 0, 0, 2,122, 0, 0, 0, 35, 0, 0, 2,122, 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 2,121, 0, 0, 2,123, + 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 1,144, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 1,144, + 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 1,145, 0, 0, 2,122, 0, 0, 0, 35, 0, 0, 1,143, 0, 0, 2,122, 0, 0, 0, 35, + 0, 0, 1,143, 0, 0, 1,145, 0, 0, 0, 35, 0, 0, 1, 24, 0, 0, 2,124, 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 1, 24, + 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 2,124, 0, 0, 0, 35, 0, 0, 2,124, 0, 0, 2,125, 0, 0, 0, 35, 0, 0, 2,125, + 0, 0, 2,126, 0, 0, 0, 35, 0, 0, 2,124, 0, 0, 2,126, 0, 0, 0, 35, 0, 0, 1, 25, 0, 0, 1,145, 0, 0, 0, 35, + 0, 0, 1, 25, 0, 0, 2,126, 0, 0, 0, 35, 0, 0, 1,145, 0, 0, 2,126, 0, 0, 0, 35, 0, 0, 1,144, 0, 0, 2,125, + 0, 0, 0, 35, 0, 0, 1, 9, 0, 0, 2,125, 0, 0, 0, 35, 0, 0, 1, 9, 0, 0, 1,144, 0, 0, 0, 35, 0, 0, 1, 23, + 0, 0, 2,127, 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 1,143, 0, 0, 0, 35, 0, 0, 1,143, 0, 0, 2,127, 0, 0, 0, 35, + 0, 0, 2,127, 0, 0, 2,128, 0, 0, 0, 35, 0, 0, 2,128, 0, 0, 2,129, 0, 0, 0, 35, 0, 0, 2,127, 0, 0, 2,129, + 0, 0, 0, 35, 0, 0, 1, 2, 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 1, 22, 0, 0, 2,129, 0, 0, 0, 35, 0, 0, 1, 2, + 0, 0, 2,129, 0, 0, 0, 35, 0, 0, 1, 3, 0, 0, 2,128, 0, 0, 0, 35, 0, 0, 1,142, 0, 0, 2,128, 0, 0, 0, 35, + 0, 0, 1, 3, 0, 0, 1,142, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0,100, 0, 7, 83,240, 32, 0, 0, 0, 48, 0, 0, 5, 0, + 0, 0, 1, 27, 0, 0, 0,102, 0, 0, 1,146, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,146, 0, 0, 0,171, 0, 0, 1, 27, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 14, 0, 0, 1, 27, 0, 0, 0,171, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,171, + 0, 0, 1,146, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,147, 0, 0, 0, 46, 0, 0, 1,146, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 1,146, 0, 0, 1,148, 0, 0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, 0, 0, 3, 0, 0, 1, 22, 0, 0, 2,107, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 2,109, 0, 0, 0,156, 0, 0, 1,134, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,134, 0, 0, 1,136, 0, 0, 2,109, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,157, 0, 0, 2,109, 0, 0, 1,136, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,136, + 0, 0, 1,134, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,109, 0, 0, 0,157, 0, 0, 2,110, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 2,110, 0, 0, 2,111, 0, 0, 2,109, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,156, 0, 0, 2,109, + 0, 0, 2,111, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,111, 0, 0, 2,110, 0, 0, 0,158, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 1,139, 0, 0, 0, 41, 0, 0, 1,135, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,135, 0, 0, 2,111, 0, 0, 1,139, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,158, 0, 0, 1,139, 0, 0, 2,111, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,111, + 0, 0, 1,135, 0, 0, 0,156, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,138, 0, 0, 0,158, 0, 0, 2,110, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 2,110, 0, 0, 1,137, 0, 0, 1,138, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 40, 0, 0, 1,138, + 0, 0, 1,137, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,137, 0, 0, 2,110, 0, 0, 0,157, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 2,112, 0, 0, 0, 99, 0, 0, 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, 0, 3, 0, 0, 2,122, 0, 0, 2,123, 0, 0, 2,121, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,159, 0, 0, 2,121, + 0, 0, 2,123, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,123, 0, 0, 2,122, 0, 0, 0,161, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 1,144, 0, 0, 0, 37, 0, 0, 1,141, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,141, 0, 0, 2,123, 0, 0, 1,144, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,161, 0, 0, 1,144, 0, 0, 2,123, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,123, + 0, 0, 1,141, 0, 0, 0,159, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,145, 0, 0, 0,161, 0, 0, 2,122, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 2,122, 0, 0, 1,143, 0, 0, 1,145, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 41, 0, 0, 1,145, + 0, 0, 1,143, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,143, 0, 0, 2,122, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 2,124, 0, 0, 0,101, 0, 0, 1, 24, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 24, 0, 0, 1, 8, 0, 0, 2,124, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 93, 0, 0, 2,124, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 8, + 0, 0, 1, 24, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,124, 0, 0, 0, 93, 0, 0, 2,125, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 2,125, 0, 0, 2,126, 0, 0, 2,124, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,101, 0, 0, 2,124, + 0, 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+ 0, 0, 1, 2, 0, 0, 0, 9, 0, 0, 1, 22, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 22, 0, 0, 2,129, 0, 0, 1, 2, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 90, 0, 0, 1, 2, 0, 0, 2,129, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,129, + 0, 0, 1, 22, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 3, 0, 0, 0, 90, 0, 0, 2,128, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 2,128, 0, 0, 1,142, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 36, 0, 0, 1, 3, + 0, 0, 1,142, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,142, 0, 0, 2,128, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 77, 69, 0, 0, 0,188, 3, 59,134,176, 0, 0, 0, 47, 0, 0, 0, 1, 3, 59,137,208, 3, 59,133,192, 0, 0, 0, 0, + 0, 0, 0, 0, 77, 69,112,114,101,118,105,101,119, 46, 48, 48, 49, 0, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 58,138, 16, 3, 59,137, 48, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 59,135,160, 3, 59,136,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6, 0, 0, 0, 1, 51,128, 0, 0,180, 0, 0, 0, + 0, 0, 0, 0, 63,128, 0, 4, 63,128, 0, 4, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 3, 58,138, 16, 0, 0, 0, 0, + 0, 0, 0, 1, 3, 59,124,192, 68, 65, 84, 65, 0, 0, 0,160, 3, 59,135,160, 0, 0, 0, 52, 0, 0, 0, 8, 63,128, 0, 0, + 63,127,255,255,191,128, 0, 0, 73,230, 73,230,182, 26, 3,255, 63,128, 0, 0,191,128, 0, 0,191,128, 0, 0, 73,230,182, 26, +182, 26, 3,255,191,128, 0, 1,191,127,255,253,191,128, 0, 0,182, 26,182, 26,182, 26, 3,255,191,127,255,250, 63,128, 0, 3, +191,128, 0, 0,182, 26, 73,230,182, 26, 3,255, 63,128, 0, 4, 63,127,255,247, 63,128, 0, 0, 73,230, 73,230, 73,230, 3,255, + 63,127,255,245,191,128, 0, 5, 63,128, 0, 0, 73,230,182, 26, 73,230, 3,255,191,128, 0, 3,191,127,255,250, 63,128, 0, 0, +182, 26,182, 26, 73,230, 3,255,191,127,255,255, 63,128, 0, 0, 63,128, 0, 0,182, 26, 73,230, 73,230, 3,255, 68, 65, 84, 65, + 0, 0, 0,144, 3, 59,136,112, 0, 0, 0, 49, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 35, + 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0, 7, + 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 35, + 68, 65, 84, 65, 0, 0, 0,120, 3, 59,137, 48, 0, 0, 0, 48, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, + 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 2, + 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 77, 69, 0, 0, 0,188, 3, 59,137,208, 0, 0, 0, 47, 0, 0, 0, 1, + 0, 0, 0, 0, 3, 59,134,176, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69,112,114,101,118,105,101,119, 46, 48, 48, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 57,233,208, 3, 59,139,160, 3, 59,139,224, 0, 0, 0, 0, 3, 59,138,192, 3, 59,139, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, + 0, 0, 0, 1,179,128, 0, 0, 52, 64, 0, 0, 28,192, 0, 0, 63,128, 0, 0, 63,128, 0, 2, 55, 39,197,172, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 68, 65, 84, 65, + 0, 0, 0, 4, 3, 57,233,208, 0, 0, 0, 0, 0, 0, 0, 1, 3, 59,124,192, 68, 65, 84, 65, 0, 0, 0, 80, 3, 59,138,192, + 0, 0, 0, 52, 0, 0, 0, 4, 63,128, 0, 0, 63,127,255,255, 39,251,255,255, 0, 0, 0, 0,127,255, 3,255, 63,128, 0, 0, +191,128, 0, 0,168, 2, 0, 0, 0, 0, 0, 0,127,255, 3,255,191,128, 0, 1,191,127,255,253,167,251,255,253, 0, 0, 0, 0, +127,255, 3,255,191,127,255,250, 63,128, 0, 3, 40, 2, 0, 3, 0, 0, 0, 0,127,255, 3,255, 68, 65, 84, 65, 0, 0, 0, 48, + 3, 59,139, 64, 0, 0, 0, 49, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 35, 68, 65, 84, 65, + 0, 0, 0, 20, 3, 59,139,160, 0, 0, 0, 48, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, + 0, 0, 0, 2, 68, 65, 84, 65, 0, 0, 0, 60, 3, 59,139,224, 0, 0, 0, 46, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255, 1, 0, 0, 1, 0, 0, 0, 0, 71, 76, 79, 66, 0, 0, 0, 24,191,255,243, 16, + 0, 0, 0,116, 0, 0, 0, 1, 3, 59, 65,112, 3,152,218, 32, 0, 1, 1, 0, 0, 0, 0, 0, 0, 4, 0,128, 0, 0, 0, 10, + 68, 78, 65, 49, 0, 0,104, 56, 7, 80, 16, 32, 0, 0, 0, 0, 0, 0, 0, 1, 83, 68, 78, 65, 78, 65, 77, 69, 0, 0, 5,255, + 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120, 0,121, 0,122, 0,119, + 0,120,109,105,110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, + 0,110, 97,109,101, 91, 50, 52, 93, 0,117,115, 0,102,108, 97,103, 0,105, 99,111,110, 95,105,100, 0,105,100, 0, 42,105,100, + 98,108,111, 99,107, 0, 42,102,105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 50, 52, 48, 93, 0,102,105,108,101,110, 97, +109,101, 91, 50, 52, 48, 93, 0,116,111,116, 0,112, 97,100, 0, 99,117,114,118,101, 0, 99,117,114, 0, 98,108,111, 99,107,116, +121,112,101, 0,115,104,111,119,107,101,121, 0,112,111,115, 0, 99,117,114,118, 97,108, 0,116,121,112,101, 0, 97,100,114, 99, +111,100,101, 0,116,111,116,101,108,101,109, 0, 42,100, 97,116, 97, 0, 42,119,101,105,103,104,116,115, 0,110, 97,109,101, 91, + 51, 50, 93, 0,118,103,114,111,117,112, 91, 51, 50, 93, 0,115,108,105,100,101,114,109,105,110, 0,115,108,105,100,101,114,109, + 97,120, 0, 42,114,101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0,101,108,101,109,115,105,122,101, 0, + 98,108,111, 99,107, 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108,117,114,112,104, 0, 42, + 42,115, 99,114,105,112,116,115, 0, 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112,116, 0,116,111,116,115, 99,114,105, +112,116, 0, 42,108,105,110,101, 0, 42,102,111,114,109, 97,116, 0,108,101,110, 0, 98,108,101,110, 0, 42,110, 97,109,101, 0, +102,108, 97,103,115, 0,110,108,105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,115,101,108,108, 0, 99, +117,114, 99, 0,115,101,108, 99, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,115, 0,117,110,100,111, + 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,115,105,122,101, 0,115,101,101,107, 0,112, 97,115,115,101,112, 97, +114,116, 97,108,112,104, 97, 0,112, 97,100, 49, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112,101,110,100, 0,108,101,110, +115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0, 89, 70, 95,100,111,102,100,105,115, +116, 0, 89, 70, 95, 97,112,101,114,116,117,114,101, 0, 89, 70, 95, 98,107,104,116,121,112,101, 0, 89, 70, 95, 98,107,104, 98, +105, 97,115, 0, 89, 70, 95, 98,107,104,114,111,116, 0,115, 99,114,105,112,116,108,105,110,107, 0,110, 97,109,101, 91, 49, 54, + 48, 93, 0, 42, 97,110,105,109, 0, 42,105, 98,117,102, 0, 42,109,105,112,109, 97,112, 91, 49, 48, 93, 0,111,107, 0,108, 97, +115,116,102,114, 97,109,101, 0,116,112, 97,103,101,102,108, 97,103, 0,116,111,116, 98,105,110,100, 0,120,114,101,112, 0,121, +114,101,112, 0,116,119,115,116, 97, 0,116,119,101,110,100, 0, 98,105,110,100, 99,111,100,101, 0, 42,114,101,112, 98,105,110, +100, 0, 42,112, 97, 99,107,101,100,102,105,108,101, 0,108, 97,115,116,117,112,100, 97,116,101, 0,108, 97,115,116,117,115,101, +100, 0, 97,110,105,109,115,112,101,101,100, 0,114,101,115,101,114,118,101,100, 49, 0,114,101,115,101,114,118,101,100, 50, 0, +116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,101,103, 0, 98,108,101,110,100,116,121,112,101, 0, 42, +111, 98,106,101, 99,116, 0, 42,116,101,120, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,112,114,111,106,122, 0,109, 97, +112,112,105,110,103, 0,111,102,115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,116,101,120,102,108, 97,103, 0, 99,111,108, +111,114,109,111,100,101,108, 0,114, 0,103, 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0, 99,111,108,102, 97, 99, 0,110, +111,114,102, 97, 99, 0,118, 97,114,102, 97, 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114,112,102, 97, 99, 0, 42,104, 97, +110,100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121,112,101,115, 0,118, 97,114,115, + 0, 42,118, 97,114,115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100, 97,116, 97, 91, 51, 50, 93, 0, + 40, 42,100,111,105,116, 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97, 99,107, 41, 40, 41, 0,118,101,114,115,105,111,110, 0, + 97, 0,105,112,111,116,121,112,101, 0,100, 97,116, 97, 91, 49, 54, 93, 0, 42,105,109, 97, 0, 42, 99,117, 98,101, 91, 54, 93, + 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,115,116,121,112,101, 0,110,111,116,108, 97,121, 0, 99,117, 98,101,114,101,115, + 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,110,111,105,115,101,115,105,122,101, + 0,116,117,114, 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,115,116, 0,114,102, 97, 99, 0,103,102, 97, + 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95, 72, 0,109,103, 95,108, 97, 99,117,110, 97, +114,105,116,121, 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,102,115,101,116, 0,109,103, 95,103, 97,105, +110, 0,100,105,115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115, 99, 97,108,101, 0,118,110, 95,119, 49, 0, +118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,109,101,120,112, 0,118,110, 95,100,105,115, +116,109, 0,118,110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,112,116,104, 0,110,111,105,115,101,116,121, +112,101, 0,110,111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,115,105,115, 50, 0,105,109, 97,102,108, 97, +103, 0, 99,114,111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,114,111,112,120,109, 97,120, 0, 99,114,111, +112,121,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116, 0,101,120,116,101,110,100, 0, 99,104,101, + 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, 97, 0,102,114, 97,109,101,115, 0,111,102,102,115,101,116, 0,115,102,114, + 97, 0,102,105,101, 95,105,109, 97, 0, 42,112,108,117,103,105,110, 0, 42, 99,111, 98, 97, 0, 42,101,110,118, 0,102,114, 97, +100,117,114, 91, 52, 93, 91, 50, 93, 0,108,111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,109, 97,116, 91, 52, 93, 91, 52, + 93, 0,109,105,110, 91, 51, 93, 0,109, 97,120, 91, 51, 93, 0, 42,111, 98, 0,109,111,100,101, 0,116,111,116,101,120, 0,101, +110,101,114,103,121, 0,100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0,104, 97, +105,110,116, 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 98,117,102,115,105,122,101, 0,115, 97,109,112, 0,115,104, 97,100,115, +112,111,116,115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, + 97,109,112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95,115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, + 97, 95,115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97,114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, + 97, 95,115,105,122,101,122, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108,111,115,116,101,112, 0, 89, 70, 95,110, +117,109,112,104,111,116,111,110,115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, 89, 70, 95,112,104,100,101,112,116, +104, 0, 89, 70, 95,117,115,101,113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, 89, 70, 95,112, 97,100, 0, 89, 70, + 95, 99, 97,117,115,116,105, 99, 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117,115, 0, 89, 70, 95,103,108,111,119, +105,110,116, 0, 89, 70, 95,103,108,111,119,111,102,115, 0, 89, 70, 95,112, 97,100, 51, 0, 89, 70, 95,103,108,111,119,116,121, +112,101, 0, 89, 70, 95,112, 97,100, 50, 0, 42,109,116,101,120, 91, 49, 48, 93, 0,108, 97,121, 0,115,112,101, 99,114, 0,115, +112,101, 99,103, 0,115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97, +109, 98, 98, 0, 97,109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, 0,115,112,101, 99,116,114, 97, 0,114, 97, +121, 95,109,105,114,114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112,101, 99, 0,122,111,102,102,115, 0, 97,100, +100, 0,116,114, 97,110,115,108,117, 99,101,110, 99,121, 0,102,114,101,115,110,101,108, 95,109,105,114, 0,102,114,101,115,110, +101,108, 95,109,105,114, 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, 0,102,114,101,115,110,101,108, 95,116,114, 97, + 95,105, 0,102,105,108,116,101,114, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, + 97, 0,104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0,109,111,100,101, 95,108, 0,102,108, 97,114,101, 99, 0, +115,116, 97,114, 99, 0,108,105,110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101,115,105, +122,101, 0,115,117, 98,115,105,122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115,116, 97, + 0,115,116,114, 97,110,100, 95,101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,101, 0,115, 98,105, 97,115, 0,114,103, + 98,115,101,108, 0,112,114, 95,116,121,112,101, 0,117,115,101, 95,110,111,100,101,115, 0,112,114, 95, 98, 97, 99,107, 0,112, +114, 95,108, 97,109,112, 0,115,101,112,116,101,120, 0,109,108, 95,102,108, 97,103, 0,100,105,102,102, 95,115,104, 97,100,101, +114, 0,115,112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117,103,104,110,101,115,115, 0,114,101,102,114, 97, 99, 0,112, + 97,114, 97,109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110,101,115,115, 0, 42,114, 97,109,112, 95, 99,111,108, 0, 42, +114, 97,109,112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95, 99,111,108, 0,114, 97,109,112,105,110, 95,115,112,101, 99, + 0,114, 97,109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97,109,112, 98,108,101,110,100, 95,115,112,101, 99, 0,114, 97, +109,112, 95,115,104,111,119, 0,112, 97,100, 51, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99, + 95,115,112,101, 99, 0, 42,110,111,100,101,116,114,101,101, 0, 42,103,114,111,117,112, 0,102,114,105, 99,116,105,111,110, 0, +102,104, 0,114,101,102,108,101, 99,116, 0,102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111, +100,101, 0,112, 97,100, 50, 0, 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103, 0, 89, 70, 95, 97, 98, 0, 89, 70, 95,100,115, 99, + 97,108,101, 0, 89, 70, 95,100,112,119,114, 0, 89, 70, 95,100,115,109,112, 0, 89, 70, 95,112,114,101,115,101,116, 0, 89, 70, + 95,100,106,105,116, 0,110, 97,109,101, 91, 50, 53, 54, 93, 0,115, 99, 97,108,101, 0, 42, 98, 98, 0,105, 49, 0,106, 49, 0, +107, 49, 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108, 99,111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, + 91, 52, 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, + 97,116, 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,105,115,112, 0, 42, 42,109, 97,116, 0,116,111,116, 99,111,108, + 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,101, 0,116,104,114,101,115,104, 0,118,101, 99, 91, + 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,104,116, 0,104, 49, 0,104, 50, 0,102, 49, 0,102, 50, 0,102, 51, + 0,104,105,100,101, 0,118,101, 99, 91, 52, 93, 0,109, 97,116, 95,110,114, 0,112,110,116,115,117, 0,112,110,116,115,118, 0, +114,101,115,111,108,117, 0,114,101,115,111,108,118, 0,111,114,100,101,114,117, 0,111,114,100,101,114,118, 0,102,108, 97,103, +117, 0,102,108, 97,103,118, 0, 42,107,110,111,116,115,117, 0, 42,107,110,111,116,115,118, 0, 42, 98,112, 0, 42, 98,101,122, +116, 0, 99,104, 97,114,105,100,120, 0,107,101,114,110, 0,104, 0,110,117,114, 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116, + 97,112,101,114,111, 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, 0, 42,112, 97,116,104, 0, 42,107,101,121, 0, + 98,101,118, 0,112, 97,116,104,108,101,110, 0, 98,101,118,114,101,115,111,108, 0,119,105,100,116,104, 0,101,120,116, 49, 0, +101,120,116, 50, 0,115,112, 97, 99,101,109,111,100,101, 0,115,112, 97, 99,105,110,103, 0,108,105,110,101,100,105,115,116, 0, +115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114,100,115,112, 97, 99,101, 0,117,108,112,111,115, 0,117,108,104,101, +105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105,110,101,119,105,100,116,104, 0, 42,115,116,114, 0,102, 97,109,105, +108,121, 91, 50, 52, 93, 0, 42,118,102,111,110,116, 0, 42,118,102,111,110,116, 98, 0, 42,118,102,111,110,116,105, 0, 42,118, +102,111,110,116, 98,105, 0,115,101,112, 99,104, 97,114, 0,116,111,116, 98,111,120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, + 0,115,101,108,115,116, 97,114,116, 0,115,101,108,101,110,100, 0, 42,115,116,114,105,110,102,111, 0, 99,117,114,105,110,102, +111, 0,110, 97,109,101, 91, 49, 50, 56, 93, 0,109, 97,120,114, 99,116, 0,116,111,116,114, 99,116, 0,118, 97,114,116,121,112, +101, 0,116,111,116,118,101,114,116, 0,105,112,111, 0,101,120,116,114, 97,112, 0,114,116, 0, 98,105,116,109, 97,115,107, 0, + 42,100,114,105,118,101,114, 0, 42,116,112, 97,103,101, 0,117,118, 91, 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116, +114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114, 97,112, 0,101,102,102,101, 99,116, 0, 42,109,102, 97, 99,101, 0, + 42,116,102, 97, 99,101, 0, 42,100,102, 97, 99,101, 0, 42,109,118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,101, +114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107,121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,111, 99, + 0, 42,115,117,109,111,104, 97,110,100,108,101, 0,116,111,116,101,100,103,101, 0,116,111,116,102, 97, 99,101, 0, 99,117, 98, +101,109, 97,112,115,105,122,101, 0,115,109,111,111,116,104,114,101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105, +118,114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0,118, 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100, +101, 0, 99,114,101, 97,115,101, 0,100,101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, 99,111, + 91, 51, 93, 0,110,111, 91, 51, 93, 0, 99,111, 91, 50, 93, 0, 42,101,114,114,111,114, 0,109,111,100,105,102,105,101,114, 0, +115,117, 98,100,105,118, 84,121,112,101, 0,108,101,118,101,108,115, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42, +101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0,115,116, 97,114,116, 0,108,101,110,103,116,104, 0,114, 97,110, +100,111,109,105,122,101, 0,115,101,101,100, 0, 97,120,105,115, 0,116,111,108,101,114, 97,110, 99,101, 0,112,101,114, 99,101, +110,116, 0,102, 97, 99,101, 67,111,117,110,116, 0,115,116, 97,114,116,120, 0,115,116, 97,114,116,121, 0,104,101,105,103,104, +116, 0,110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100, 97,109,112, 0,116,105,109,101,111,102,102,115, 0,108,105,102, +101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103, 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93, 91, 52, 93, + 0, 99,101,110,116, 91, 51, 93, 0,102, 97,108,108,111,102,102, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100, +101,120, 0,102,111,114, 99,101, 0,111,112,101,114, 97,116,105,111,110, 0,112,110,116,115,119, 0,111,112,110,116,115,117, 0, +111,112,110,116,115,118, 0,111,112,110,116,115,119, 0,116,121,112,101,117, 0,116,121,112,101,118, 0,116,121,112,101,119, 0, +102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100,119, 0, 42,100,101,102, 0,118,101, 99, 91, 56, 93, 91, 51, 93, + 0,100,118,101, 99, 91, 51, 93, 0,109, 97,120, 0, 42, 42,111, 98, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, + 97,114, 50, 0,112, 97,114, 51, 0,112, 97,114,115,117, 98,115,116,114, 91, 51, 50, 93, 0, 42,112, 97,114,100, 97,116, 97, 0, + 42,112, 97,114,101,110,116, 0, 42,116,114, 97, 99,107, 0, 42, 97, 99,116,105,111,110, 0, 42,112,111,115,101, 0, 99,111,110, +115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, 0,110,101,116,119,111,114,107, 0,100,101,102, 98, 97,115,101, 0, +109,111,100,105,102,105,101,114,115, 0,100,108,111, 99, 91, 51, 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, + 51, 93, 0,100,114,111,116, 91, 51, 93, 0,100,113,117, 97,116, 91, 52, 93, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0, + 99,111,108, 98,105,116,115, 0,116,114, 97,110,115,102,108, 97,103, 0,105,112,111,102,108, 97,103, 0,116,114, 97, 99,107,102, +108, 97,103, 0,117,112,102,108, 97,103, 0,110,108, 97,102,108, 97,103, 0,112,114,111,116,101, 99,116,102,108, 97,103, 0,105, +112,111,119,105,110, 0,115, 99, 97,102,108, 97,103, 0,115, 99, 97,118,105,115,102,108, 97,103, 0, 98,111,117,110,100,116,121, +112,101, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0,100,117,112,115,116, 97, 0,100,117,112,101,110,100, 0,115,102, + 0, 99,116,105,109,101, 0,109, 97,115,115, 0,100, 97,109,112,105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109, +102, 97, 99,116,111,114, 0,115,111,102,116,116,105,109,101, 0,114,100, 97,109,112,105,110,103, 0,115,105,122,101,102, 97, 99, + 0,100,116, 0,100,116,120, 0, 97, 99,116, 99,111,108, 0,112,114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116, +114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116,111,114,115, 0, 98, 98,115,105,122,101, 91, 51, 93, 0,100,102,114, 97, +115, 0, 97, 99,116,100,101,102, 0,103, 97,109,101,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103, 50, 0,115,111,102,116, +102,108, 97,103, 0, 97,110,105,115,111,116,114,111,112,105, 99, 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115, +116,114, 97,105,110,116,115, 0,110,108, 97,115,116,114,105,112,115, 0,104,111,111,107,115, 0, 42,112,100, 0, 42,115,111,102, +116, 0, 42,100,117,112, 95,103,114,111,117,112, 0,102,108,117,105,100,115,105,109, 70,108, 97,103, 0,115,104, 97,112,101,110, +114, 0,115,104, 97,112,101,102,108, 97,103, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42,100, +101,114,105,118,101,100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0, 99,117,114,105,110, +100,101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102,105,101,108,100, 0,112,100, +101,102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112, 0,112,100,101,102, 95,112,101,114,109, 0,102, 95,115, +116,114,101,110,103,116,104, 0,102, 95,112,111,119,101,114, 0,109, 97,120,100,105,115,116, 0,112,100,101,102, 95,115, 98,100, + 97,109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,101,102, 95,115, 98,111,102,116, 0,116,111,116,112,111,105, +110,116, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,115,112,114,105,110,103, 0,110,111, +100,101,109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107,108,105,109,105,116, 0,112, +104,121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103,111, 97,108,102,114,105, 99, +116, 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, 0,118,101,114,116,103,114, +111,117,112, 0,105,110,115,112,114,105,110,103, 0,105,110,102,114,105, 99,116, 0,101,102,114, 97, 0,105,110,116,101,114,118, + 97,108, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,104,111,119, 95, 97,100,118, 97,110, + 99,101,100,111,112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119, +114,101,115,120,121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114, +101,110,100,101,114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0, +118,105,115, 99,111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0, +103,114, 97,118,120, 0,103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, + 69,110,100, 0,103,115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86, +101,108,121, 0,105,110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99, +101, 0, 42,109,101,115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, + 97,114,116, 91, 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,111, +114,103, 0,104,111,114, 98, 0,104,111,114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,122,101,110,107, + 0, 97,109, 98,107, 0,102, 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,101, + 0,108,105,110,102, 97, 99, 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121, 66, +111,120, 82, 97,100,105,117,115, 0,115,107,121,116,121,112,101, 0,112,104,121,115,105, 99,115, 69,110,103,105,110,101, 0,109, +105,115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104,105, 0,115,116, 97,114, +114, 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105,122,101, 0,115,116, 97, +114,109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110,111,105,115,101, 0,100, +111,102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,115, +116, 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,111, +100,101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 42, 97,111,115,112,104,101,114, +101, 0,104,101,109,105,114,101,115, 0,109, 97,120,105,116,101,114, 0,100,114, 97,119,116,121,112,101, 0,115,117, 98,115,104, +111,111,116,112, 0,115,117, 98,115,104,111,111,116,101, 0,110,111,100,101,108,105,109, 0,109, 97,120,115,117, 98,108, 97,109, +112, 0,112, 97,109, 97, 0,112, 97,109,105, 0,101,108,109, 97, 0,101,108,109,105, 0,109, 97,120,110,111,100,101, 0, 99,111, +110,118,101,114,103,101,110, 99,101, 0,114, 97,100,102, 97, 99, 0,103, 97,109,109, 97, 0,115,101,108, 99,111,108, 0,115,120, + 0,115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, 99, 98, 70,111,114,109, 97,116, 0, + 99, 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100,108,101,114, 0,100,119, 75,101,121, + 70,114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, 66,121,116,101,115, 80,101,114, 83, +101, 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, 97,118,101, 69,118,101,114,121, 0, + 97,118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97,114,109,115, 0, 42,112, 97,100, 0, + 99,100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0,109,105,120,114, 97,116,101, 0, +109, 97,105,110, 0,112, 97,100, 91, 51, 93, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100, +101, 99,100, 97,116, 97, 0, 99,102,114, 97, 0,105,109, 97,103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,102,114, 97,109, +101,108,101,110, 0, 98,108,117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102, +117,108,108,115, 99,114,101,101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97, +116,116,114,105, 98, 0,114,116, 49, 0,114,116, 50, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105, +111,110,115,112,114,101,115,101,116, 0,102,105,108,116,101,114,116,121,112,101, 0,109, 97,120,105,109,115,105,122,101, 0,120, +115, 99,104, 0,121,115, 99,104, 0,120, 97,115,112, 0,121, 97,115,112, 0,120,112, 97,114,116,115, 0,121,112, 97,114,116,115, + 0,119,105,110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121,112,101, 0,115,117, 98,105,109,116,121,112,101, 0, + 98,117,102,102,108, 97,103, 0,113,117, 97,108,105,116,121, 0,115, 99,101,109,111,100,101, 0,114,101,110,100,101,114,101,114, + 0,111, 99,114,101,115, 0,114,112, 97,100, 91, 50, 93, 0, 97,108,112,104, 97,109,111,100,101, 0,100,111,103, 97,109,109, 97, + 0,111,115, 97, 0,102,114,115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,109,101, 95,109, 97,116, 95,114,101, +100,117,120, 0,115, 97,102,101,116,121, 0, 98,111,114,100,101,114, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, 0, +112,111,115,116,103, 97,109,109, 97, 0,112,111,115,116, 97,100,100, 0,112,111,115,116,105,103, 97,109,109, 97, 0,112,111,115, +116,104,117,101, 0,112,111,115,116,115, 97,116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,116,121, 0,122,109, +105,110, 0,102,111, 99,117,115, 0,122,103, 97,109,109, 97, 0,122,115,105,103,109, 97, 0,122, 98,108,117,114, 0, 71, 73,113, +117, 97,108,105,116,121, 0, 71, 73, 99, 97, 99,104,101, 0, 71, 73,109,101,116,104,111,100, 0, 71, 73,112,104,111,116,111,110, +115, 0, 71, 73,100,105,114,101, 99,116, 0, 89, 70, 95, 65, 65, 0, 89, 70,101,120,112,111,114,116,120,109,108, 0, 89, 70, 95, +110,111, 98,117,109,112, 0, 89, 70, 95, 99,108, 97,109,112,114,103, 98, 0,121,102,112, 97,100, 49, 0, 71, 73,100,101,112,116, +104, 0, 71, 73, 99, 97,117,115,100,101,112,116,104, 0, 71, 73,112,105,120,101,108,115,112,101,114,115, 97,109,112,108,101, 0, + 71, 73,112,104,111,116,111,110, 99,111,117,110,116, 0, 71, 73,109,105,120,112,104,111,116,111,110,115, 0, 71, 73,112,104,111, +116,111,110,114, 97,100,105,117,115, 0, 89, 70, 95,110,117,109,112,114,111, 99,115, 0, 89, 70, 95,114, 97,121,100,101,112,116, +104, 0, 89, 70, 95, 65, 65,112, 97,115,115,101,115, 0, 89, 70, 95, 65, 65,115, 97,109,112,108,101,115, 0, 71, 73,115,104, 97, +100,111,119,113,117, 97,108,105,116,121, 0, 71, 73,114,101,102,105,110,101,109,101,110,116, 0, 71, 73,112,111,119,101,114, 0, + 71, 73,105,110,100,105,114,112,111,119,101,114, 0, 89, 70, 95,103, 97,109,109, 97, 0, 89, 70, 95,101,120,112,111,115,117,114, +101, 0, 89, 70, 95,114, 97,121, 98,105, 97,115, 0, 89, 70, 95, 65, 65,112,105,120,101,108,115,105,122,101, 0, 89, 70, 95, 65, + 65,116,104,114,101,115,104,111,108,100, 0, 98, 97, 99,107, 98,117,102, 91, 49, 54, 48, 93, 0,112,105, 99, 91, 49, 54, 48, 93, + 0,102,116,121,112,101, 91, 49, 54, 48, 93, 0, 99,111,108, 91, 51, 93, 0,102,114, 97,109,101, 0,110, 97,109,101, 91, 54, 52, + 93, 0, 99,111,114,110,101,114,116,121,112,101, 0,101,100,105,116, 98,117,116,102,108, 97,103, 0,100,101,103,114, 0,115,116, +101,112, 0,116,117,114,110, 0,101,120,116,114, 95,111,102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,115,101,103,109, +101,110,116,115, 0,114,105,110,103,115, 0,118,101,114,116,105, 99,101,115, 0, 42, 99, 97,109,101,114, 97, 0, 42,119,111,114, +108,100, 0, 42,115,101,116, 0, 98, 97,115,101, 0, 42, 98, 97,115, 97, 99,116, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116, +119, 99,101,110,116, 91, 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0,101,100,105,116, 98, +117,116,115,105,122,101, 0,115,101,108,101, 99,116,109,111,100,101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 0,112, +114,111,112, 95,109,111,100,101, 0, 42,101,100, 0, 42,114, 97,100,105,111, 0,102,114, 97,109,105,110,103, 0, 42,116,111,111, +108,115,101,116,116,105,110,103,115, 0, 97,117,100,105,111, 0,109, 97,114,107,101,114,115, 0, 42,116,104,101, 68, 97,103, 0, +100, 97,103,105,115,118, 97,108,105,100, 0,100, 97,103,102,108, 97,103,115, 0,100,105,114,116,121, 0,122,111,111,109, 0, 98, +108,101,110,100, 0,120,105,109, 0,121,105,109, 0, 42,114,101, 99,116, 0,115,112, 97, 99,101,116,121,112,101, 0, 98,108,111, + 99,107,115, 99, 97,108,101, 0, 42, 97,114,101, 97, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0,118,105, +101,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97, +116, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,119,105,110,109, 97,116, 49, 91, 52, 93, + 91, 52, 93, 0,118,105,101,119,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,112, +101,114,115,112, 0,118,105,101,119, 0, 42, 98,103,112,105, 99, 0, 42,108,111, 99, 97,108,118,100, 0, 42,114,105, 0,108,111, + 99, 97,108,118,105,101,119, 0,108, 97,121, 97, 99,116, 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,110,100, 0, + 99, 97,109,122,111,111,109, 0,103,114,105,100, 0,103,114,105,100,118,105,101,119, 0,112,105,120,115,105,122,101, 0,110,101, + 97,114, 0,102, 97,114, 0, 99, 97,109,100,120, 0, 99, 97,109,100,121, 0,103,114,105,100,108,105,110,101,115, 0,118,105,101, +119, 98,117,116, 0,103,114,105,100,102,108, 97,103, 0,109,111,100,101,115,101,108,101, 99,116, 0,109,101,110,117,110,114, 0, +116,101,120,110,114, 0,116,119,116,121,112,101, 0,116,119,109,111,100,101, 0,116,119,102,108, 97,103, 0,116,119,100,114, 97, +119,102,108, 97,103, 0,116,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,108,105,112, 91, 52, 93, 91, 52, 93, 0, 42, 99,108, +105,112, 98, 98, 0, 97,102,116,101,114,100,114, 97,119, 0,122, 98,117,102, 0,120,114, 97,121, 0,118,101,114,116, 0,104,111, +114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, 0,109,105,110,122,111,111,109, 0,109, 97,120, +122,111,111,109, 0,115, 99,114,111,108,108, 0,107,101,101,112,116,111,116, 0,107,101,101,112, 97,115,112,101, 99,116, 0,107, +101,101,112,122,111,111,109, 0,111,108,100,119,105,110,120, 0,111,108,100,119,105,110,121, 0,114,111,119, 98,117,116, 0,118, + 50,100, 0, 42,101,100,105,116,105,112,111, 0,105,112,111,107,101,121, 0, 97, 99,116,110, 97,109,101, 91, 51, 50, 93, 0, 99, +111,110,115,116,110, 97,109,101, 91, 51, 50, 93, 0,116,111,116,105,112,111, 0,112,105,110, 0, 98,117,116,111,102,115, 0, 99, +104, 97,110,110,101,108, 0,108,111, 99,107, 0,109,101,100,105, 97,110, 91, 51, 93, 0, 99,117,114,115,101,110,115, 0, 99,117, +114, 97, 99,116, 0, 97,108,105,103,110, 0,116, 97, 98,111, 0,109, 97,105,110, 98, 0,109, 97,105,110, 98,111, 0, 42,108,111, + 99,107,112,111,105,110, 0,116,101,120,102,114,111,109, 0,115,104,111,119,103,114,111,117,112, 0,109,111,100,101,108,116,121, +112,101, 0,115, 99,114,105,112,116, 98,108,111, 99,107, 0,114,101, 95, 97,108,105,103,110, 0,111,108,100,107,101,121,112,114, +101,115,115, 0,116, 97, 98, 91, 55, 93, 0, 42,102,105,108,101,108,105,115,116, 0,116,111,116,102,105,108,101, 0,116,105,116, +108,101, 91, 50, 52, 93, 0,100,105,114, 91, 49, 54, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,111,102,115, 0,115,111,114, +116, 0,109, 97,120,110, 97,109,101,108,101,110, 0, 99,111,108,108,117,109,115, 0, 42,108,105, 98,102,105,108,101,100, 97,116, + 97, 0,114,101,116,118, 97,108, 0,109,101,110,117, 0, 97, 99,116, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 41, 40, + 41, 0, 42,109,101,110,117,112, 0,111,111,112,115, 0,118,105,115,105,102,108, 97,103, 0,116,114,101,101, 0, 42,116,114,101, +101,115,116,111,114,101, 0,111,117,116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,100,101,112,115, + 95,102,108, 97,103,115, 0, 42,105,109, 97,103,101, 0, 42, 99,117,109, 97,112, 0,105,109, 97,110,114, 0, 99,117,114,116,105, +108,101, 0, 42,116,101,120,116, 0,116,111,112, 0,118,105,101,119,108,105,110,101,115, 0,102,111,110,116, 95,105,100, 0,108, +104,101,105,103,104,116, 0,108,101,102,116, 0,115,104,111,119,108,105,110,101,110,114,115, 0,116, 97, 98,110,117,109, 98,101, +114, 0, 99,117,114,114,116, 97, 98, 95,115,101,116, 0,115,104,111,119,115,121,110,116, 97,120, 0,117,110,117,115,101,100, 95, +112, 97,100,100, 0,112,105,120, 95,112,101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114,111,108,108, 0,116,120,116, 98, + 97,114, 0, 42,115, 99,114,105,112,116, 0,114,101,100,114, 97,119,115, 0, 42,105,100, 0, 97,115,112,101, 99,116, 0, 42, 99, +117,114,102,111,110,116, 0, 42,101,100,105,116,116,114,101,101, 0,116,114,101,101,116,121,112,101, 0,116,105,116,108,101, 91, + 50, 56, 93, 0,102, 97,115,101, 0,115,117, 98,102, 97,115,101, 0,109,111,117,115,101, 95,109,111,118,101, 95,114,101,100,114, + 97,119, 0,105,109, 97,102, 97,115,101, 0,109,120, 0,109,121, 0,100,105,114,115,108,105, 0,100,105,114,115,108,105, 95,108, +105,110,101,115, 0,100,105,114,115,108,105, 95,115,120, 0,100,105,114,115,108,105, 95,101,121, 0,100,105,114,115,108,105, 95, +101,120, 0,100,105,114,115,108,105, 95,104, 0,105,109, 97,115,108,105, 0,102,105,108,101,115,101,108,109,101,110,117,105,116, +101,109, 0,105,109, 97,115,108,105, 95,115,120, 0,105,109, 97,115,108,105, 95,101,121, 0,105,109, 97,115,108,105, 95,101,120, + 0,105,109, 97,115,108,105, 95,104, 0,100,115,115,120, 0,100,115,115,121, 0,100,115,101,120, 0,100,115,101,121, 0,100,101, +115,120, 0,100,101,115,121, 0,100,101,101,120, 0,100,101,101,121, 0,102,115,115,120, 0,102,115,115,121, 0,102,115,101,120, + 0,102,115,101,121, 0,100,115,100,104, 0,102,115,100,104, 0,102,101,115,120, 0,102,101,115,121, 0,102,101,101,120, 0,102, +101,101,121, 0,105,110,102,115,120, 0,105,110,102,115,121, 0,105,110,102,101,120, 0,105,110,102,101,121, 0,100,110,115,120, + 0,100,110,115,121, 0,100,110,119, 0,100,110,104, 0,102,110,115,120, 0,102,110,115,121, 0,102,110,119, 0,102,110,104, 0, +102,111,108,101, 91, 49, 50, 56, 93, 0,100,111,114, 91, 49, 50, 56, 93, 0,102,105,108,101, 91, 49, 50, 56, 93, 0,100,105,114, + 91, 49, 50, 56, 93, 0, 42,102,105,114,115,116,100,105,114, 0, 42,102,105,114,115,116,102,105,108,101, 0,116,111,112,100,105, +114, 0,116,111,116, 97,108,100,105,114,115, 0,104,105,108,105,116,101, 0,116,111,112,102,105,108,101, 0,116,111,116, 97,108, +102,105,108,101,115, 0,105,109, 97,103,101, 95,115,108,105,100,101,114, 0,115,108,105,100,101,114, 95,104,101,105,103,104,116, + 0,115,108,105,100,101,114, 95,115,112, 97, 99,101, 0,116,111,112,105,109, 97, 0,116,111,116, 97,108,105,109, 97, 0, 99,117, +114,105,109, 97,120, 0, 99,117,114,105,109, 97,121, 0, 42,102,105,114,115,116, 95,115,101,108, 95,105,109, 97, 0, 42,104,105, +108,105,116,101, 95,105,109, 97, 0,116,111,116, 97,108, 95,115,101,108,101, 99,116,101,100, 0,105,109, 97, 95,114,101,100,114, + 97,119, 0, 42, 99,109, 97,112, 0, 42, 97,114,103, 49, 0,111,117,116,108,105,110,101, 91, 52, 93, 0,110,101,117,116,114, 97, +108, 91, 52, 93, 0, 97, 99,116,105,111,110, 91, 52, 93, 0,115,101,116,116,105,110,103, 91, 52, 93, 0,115,101,116,116,105,110, +103, 49, 91, 52, 93, 0,115,101,116,116,105,110,103, 50, 91, 52, 93, 0,110,117,109, 91, 52, 93, 0,116,101,120,116,102,105,101, +108,100, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 95,104,105, 91, 52, 93, 0,112,111,112,117,112, 91, 52, 93, 0,116, +101,120,116, 91, 52, 93, 0,116,101,120,116, 95,104,105, 91, 52, 93, 0,109,101,110,117, 95, 98, 97, 99,107, 91, 52, 93, 0,109, +101,110,117, 95,105,116,101,109, 91, 52, 93, 0,109,101,110,117, 95,104,105,108,105,116,101, 91, 52, 93, 0,109,101,110,117, 95, +116,101,120,116, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0, 98,117,116, 95,100,114, 97,119, +116,121,112,101, 0,112, 97,100, 49, 91, 51, 93, 0, 98, 97, 99,107, 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,112, + 97,110,101,108, 91, 52, 93, 0,115,104, 97,100,101, 49, 91, 52, 93, 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105, +116,101, 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,119,105,114,101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0, +108, 97,109,112, 91, 52, 93, 0, 97, 99,116,105,118,101, 91, 52, 93, 0,116,114, 97,110,115,102,111,114,109, 91, 52, 93, 0,118, +101,114,116,101,120, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 91, 52, + 93, 0,101,100,103,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 95,115,101, 97,109, 91, 52, 93, 0,101,100, +103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0,102, 97, 99,101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101, 99, +116, 91, 52, 93, 0,102, 97, 99,101, 95,100,111,116, 91, 52, 93, 0,110,111,114,109, 97,108, 91, 52, 93, 0, 98,111,110,101, 95, +115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101, 95,112,111,115,101, 91, 52, 93, 0,115,116,114,105,112, 91, 52, 93, 0,115, +116,114,105,112, 95,115,101,108,101, 99,116, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,105,122,101, 0,102, 97, 99,101,100, +111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, 93, 0,115,121,110,116, 97,120,108, 91, 52, 93, 0,115,121,110,116, 97, +120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, 0,115,121,110,116, 97,120,118, 91, 52, 93, 0,115,121,110,116, + 97,120, 99, 91, 52, 93, 0,116,117,105, 0,116, 98,117,116,115, 0,116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, + 0,116,105,110,102,111, 0,116,115,110,100, 0,116, 97, 99,116, 0,116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0, +116,105,109, 97,115,101,108, 0,116,101,120,116, 0,116,111,111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0,115, +112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,109,101, 0,116,101,109,112,100,105,114, 91, + 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48, 93, 0,114,101,110,100,101,114,100,105,114, 91, 49, 54, 48, 93, + 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,116,101,120,100,105,114, 91, 49, 54, 48, 93, 0,112, +108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,121,116,104,111,110,100,105,114, 91, 49, 54, 48, 93, 0,115,111, +117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,112,111,114,116,100,105,114, 91, 49, 54, 48, 93, 0,118,101,114, +115,105,111,110,115, 0,118,114,109,108,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103,115, 0,119,104,101,101,108,108,105, +110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103, 0,108, 97,110,103,117, 97,103,101, 0,117,115,101,114,112,114,101, +102, 0,118,105,101,119,122,111,111,109, 0, 99,111,110,115,111,108,101, 95, 98,117,102,102,101,114, 0, 99,111,110,115,111,108, +101, 95,111,117,116, 0,109,105,120, 98,117,102,115,105,122,101, 0,102,111,110,116,115,105,122,101, 0,101,110, 99,111,100,105, +110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 49, 0,109,101,110,117, +116,104,114,101,115,104,111,108,100, 50, 0,102,111,110,116,110, 97,109,101, 91, 50, 53, 54, 93, 0,116,104,101,109,101,115, 0, +117,110,100,111,115,116,101,112,115, 0, 99,117,114,115,115,105,122,101, 0,116, 98, 95,108,101,102,116,109,111,117,115,101, 0, +116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,103,104,116, 91, 51, 93, 0,116,119, 95,104,111,116,115,112,111, +116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,105,122,101, 0,116,119, 95,115,105,122,101, 0, +116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,108,108,101, 99,116,114, 97,116,101, 0,111, 98, 99,101,110,116, +101,114, 95,100,105, 97, 0,118,101,114,116, 98, 97,115,101, 0,101,100,103,101, 98, 97,115,101, 0, 97,114,101, 97, 98, 97,115, +101, 0, 42,115, 99,101,110,101, 0,101,110,100,120, 0,101,110,100,121, 0,115,105,122,101,120, 0,115,105,122,101,121, 0,115, + 99,101,110,101,110,114, 0,115, 99,114,101,101,110,110,114, 0,102,117,108,108, 0,109, 97,105,110,119,105,110, 0,119,105,110, + 97,107,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0,118,101, 99, 0, 42,118, 49, 0, 42,118, 50, + 0,112, 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,101, 91, 54, 52, 93, 0,111,102,115,120, 0, +111,102,115,121, 0, 99,111,110,116,114,111,108, 0,111,108,100, 95,111,102,115,120, 0,111,108,100, 95,111,102,115,121, 0,115, +111,114,116, 99,111,117,110,116,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0, 42,118, 51, 0, 42,118, 52, 0, 42,102,117, +108,108, 0,119,105,110,109, 97,116, 91, 52, 93, 91, 52, 93, 0,104,101, 97,100,114, 99,116, 0,119,105,110,114, 99,116, 0,104, +101, 97,100,119,105,110, 0,119,105,110, 0,104,101, 97,100,101,114,116,121,112,101, 0, 98,117,116,115,112, 97, 99,101,116,121, +112,101, 0,119,105,110,120, 0,119,105,110,121, 0,104,101, 97,100, 95,115,119, 97,112, 0,104,101, 97,100, 95,101,113,117, 97, +108, 0,119,105,110, 95,115,119, 97,112, 0,119,105,110, 95,101,113,117, 97,108, 0,104,101, 97,100, 98,117,116,108,101,110, 0, +104,101, 97,100, 98,117,116,111,102,115, 0, 99,117,114,115,111,114, 0,115,112, 97, 99,101,100, 97,116, 97, 0,117,105, 98,108, +111, 99,107,115, 0,112, 97,110,101,108,115, 0, 42, 99,117,114,115, 99,114,101,101,110, 0, 42, 99,117,114,115, 99,101,110,101, + 0,100,105,115,112,108, 97,121,109,111,100,101, 0,102,105,108,101,102,108, 97,103,115, 0,103,108,111, 98, 97,108,102, 0,110, + 97,109,101, 91, 56, 48, 93, 0, 42,115,101, 49, 0, 42,115,101, 50, 0, 42,115,101, 51, 0,110,114, 0,100,111,110,101, 0, 42, +115,116,114,105,112,100, 97,116, 97, 0,111,114,120, 0,111,114,121, 0, 42,110,101,119,115,101,113, 0,115,116, 97,114,116,111, +102,115, 0,101,110,100,111,102,115, 0,115,116, 97,114,116,115,116,105,108,108, 0,101,110,100,115,116,105,108,108, 0,109, 97, + 99,104,105,110,101, 0,115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115,112, 0,109,117,108, 0,104, 97,110,100, +115,105,122,101, 0, 42,115,116,114,105,112, 0, 42, 99,117,114,101,108,101,109, 0,102, 97, 99,102, 48, 0,102, 97, 99,102, 49, + 0, 42,115,101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, 97,115,101, 0, 42,115,111,117,110, +100, 0,108,101,118,101,108, 0,112, 97,110, 0, 99,117,114,112,111,115, 0,115,116,114,111, 98,101, 0, 42,101,102,102,101, 99, +116,100, 97,116, 97, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42,115,101,113, 98, 97,115,101, +112, 0,109,101,116, 97,115,116, 97, 99,107, 0,101,100,103,101, 87,105,100,116,104, 0, 97,110,103,108,101, 0,102,111,114,119, + 97,114,100, 0,119,105,112,101,116,121,112,101, 0,102, 77,105,110,105, 0,102, 67,108, 97,109,112, 0,102, 66,111,111,115,116, + 0,100, 68,105,115,116, 0,100, 81,117, 97,108,105,116,121, 0, 98, 78,111, 67,111,109,112, 0, 98,117,116,116,121,112,101, 0, +117,115,101,114,106,105,116, 0,115,116, 97, 0,101,110,100, 0,116,111,116,112, 97,114,116, 0,110,111,114,109,102, 97, 99, 0, +111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,116,101,120,102, 97, 99, 0,114, 97,110,100,108,105,102,101, 0,102,111, +114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,101, 0,100,101,102,118,101, 99, 91, 51, 93, 0,109,117,108,116, 91, 52, + 93, 0,108,105,102,101, 91, 52, 93, 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, 52, 93, 0,116,101,120,109, 97,112, + 0, 99,117,114,109,117,108,116, 0,115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97,116, 0,116,105,109,101,116,101,120, + 0,115,112,101,101,100,116,101,120, 0,102,108, 97,103, 50, 0,102,108, 97,103, 50,110,101,103, 0,118,101,114,116,103,114,111, +117,112, 95,118, 0,118,103,114,111,117,112,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114,111,117,112,110, 97,109,101, 95,118, + 91, 51, 50, 93, 0, 42,107,101,121,115, 0,109,105,110,102, 97, 99, 0,117,115,101,100, 0,117,115,101,100,101,108,101,109, 0, +100,120, 0,100,121, 0,108,105,110,107, 0,111,116,121,112,101, 0,100, 97,116, 97, 0,111,108,100, 0, 42,112,111,105,110, 0, + 42,111,108,100,112,111,105,110, 0,114,101,115,101,116,100,105,115,116, 0,108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107, +101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0,116, 97,114,103,101,116, 78, 97,109,101, 91, 51, 50, 93, 0,116,111,103, +103,108,101, 78, 97,109,101, 91, 51, 50, 93, 0,118, 97,108,117,101, 91, 51, 50, 93, 0,109, 97,120,118, 97,108,117,101, 91, 51, + 50, 93, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 51, 50, 93, 0,100, 97,109,112,116,105,109,101,114, 0,100,101, +108, 97,121, 0,112,114,111,112,110, 97,109,101, 91, 51, 50, 93, 0,109, 97,116,110, 97,109,101, 91, 51, 50, 93, 0, 97,120,105, +115,102,108, 97,103, 0, 42,102,114,111,109, 79, 98,106,101, 99,116, 0,115,117, 98,106,101, 99,116, 91, 51, 50, 93, 0, 98,111, +100,121, 91, 51, 50, 93, 0,112,117,108,115,101, 0,102,114,101,113, 0,116,111,116,108,105,110,107,115, 0, 42, 42,108,105,110, +107,115, 0,105,110,118,101,114,116, 0,102,114,101,113, 50, 0, 97,120,105,115,102, 0, 98,117,116,116,111,110, 0, 98,117,116, +116,111,110,102, 0,104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105,115,105,111,110, 0,115,116,114, 91, 49, 50, 56, 93, + 0, 42,109,121,110,101,119, 0,105,110,112,117,116,115, 0,116,111,116,115,108,105,110,107,115, 0, 42, 42,115,108,105,110,107, +115, 0,118, 97,108, 0,118, 97,108,111, 0,112, 97,100, 53, 0,116,105,109,101, 0, 42, 97, 99,116, 0, 98,108,101,110,100,105, +110, 0,112,114,105,111,114,105,116,121, 0,115,116,114,105,100,101,108,101,110,103,116,104, 0,115,116,114,105,100,101, 97,120, +105,115, 0,114,101,115,101,114,118,101,100, 51, 0,115,110,100,110,114, 0,109, 97,107,101, 99,111,112,121, 0, 99,111,112,121, +109, 97,100,101, 0,112, 97,100, 91, 49, 93, 0,116,114, 97, 99,107, 0,118,111,108,117,109,101, 0, 42,109,101, 0,108,105,110, + 86,101,108,111, 99,105,116,121, 91, 51, 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,102,111,114, 99,101,108,111, 99, 91, 51, + 93, 0,102,111,114, 99,101,114,111,116, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, + 97,110,103,117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,100,100,101,100,108,105,110,101, 97,114,118,101, +108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,111,116,104,101,114,112, 97,100, 91, 52, 93, 0, 98,117,116,115,116, 97, 0, 98, +117,116,101,110,100, 0,109,105,110, 0,102, 97, 99, 0,118,105,115,105,102, 97, 99, 0,115,108,111,119, 0,109,105,110,108,111, + 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,110,114,111,116, 91, 51, 93, 0,109, 97,120,114,111,116, 91, + 51, 93, 0,100,105,115,116,114,105, 98,117,116,105,111,110, 0,105,110,116, 95, 97,114,103, 95, 49, 0,105,110,116, 95, 97,114, +103, 95, 50, 0,102,108,111, 97,116, 95, 97,114,103, 95, 49, 0,102,108,111, 97,116, 95, 97,114,103, 95, 50, 0,116,111, 80,114, +111,112, 78, 97,109,101, 91, 51, 50, 93, 0, 42,116,111, 79, 98,106,101, 99,116, 0, 98,111,100,121, 84,121,112,101, 0,102,105, +108,101,110, 97,109,101, 91, 54, 52, 93, 0,108,111, 97,100, 97,110,105,110, 97,109,101, 91, 54, 52, 93, 0,103,111, 0, 97, 99, + 99,101,108,108,101,114, 97,116,105,111,110, 0,109, 97,120,115,112,101,101,100, 0,109, 97,120,114,111,116,115,112,101,101,100, + 0,109, 97,120,116,105,108,116,115,112,101,101,100, 0,114,111,116,100, 97,109,112, 0,116,105,108,116,100, 97,109,112, 0,115, +112,101,101,100,100, 97,109,112, 0, 42,115, 97,109,112,108,101, 0, 42,115,116,114,101, 97,109, 0, 42,110,101,119,112, 97, 99, +107,101,100,102,105,108,101, 0, 42,115,110,100, 95,115,111,117,110,100, 0,112, 97,110,110,105,110,103, 0, 97,116,116,101,110, +117, 97,116,105,111,110, 0,112,105,116, 99,104, 0,109,105,110, 95,103, 97,105,110, 0,109, 97,120, 95,103, 97,105,110, 0,100, +105,115,116, 97,110, 99,101, 0,115,116,114,101, 97,109,108,101,110, 0,108,111,111,112,115,116, 97,114,116, 0,108,111,111,112, +101,110,100, 0, 99,104, 97,110,110,101,108,115, 0,104,105,103,104,112,114,105,111, 0,112, 97,100, 91, 49, 48, 93, 0,103, 97, +105,110, 0,100,111,112,112,108,101,114,102, 97, 99,116,111,114, 0,100,111,112,112,108,101,114,118,101,108,111, 99,105,116,121, + 0,110,117,109,115,111,117,110,100,115, 98,108,101,110,100,101,114, 0,110,117,109,115,111,117,110,100,115,103, 97,109,101,101, +110,103,105,110,101, 0, 42,108, 97,109,112,114,101,110, 0,103,111, 98,106,101, 99,116, 0, 99,104,105,108,100, 98, 97,115,101, + 0,114,111,108,108, 0,104,101, 97,100, 91, 51, 93, 0,116, 97,105,108, 91, 51, 93, 0, 98,111,110,101, 95,109, 97,116, 91, 51, + 93, 91, 51, 93, 0, 97,114,109, 95,104,101, 97,100, 91, 51, 93, 0, 97,114,109, 95,116, 97,105,108, 91, 51, 93, 0, 97,114,109, + 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,120,119,105,100,116,104, 0,122,119,105,100,116,104, 0,101, 97,115,101, 49, 0,101, + 97,115,101, 50, 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,100, 95,116, 97,105,108, 0,108, 97,121,101,114, 0, 98,111,110, +101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,105,122, +101, 0, 99,111,110,115,116,102,108, 97,103, 0,105,107,102,108, 97,103, 0, 42, 98,111,110,101, 0, 42, 99,104,105,108,100, 0, +105,107,116,114,101,101, 0, 42, 98, 95, 98,111,110,101, 95,109, 97,116,115, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91, + 52, 93, 0,112,111,115,101, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112, +111,115,101, 95,116, 97,105,108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120, + 91, 51, 93, 0,115,116,105,102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, 42, 99,117,115,116, +111,109, 0, 99,104, 97,110, 98, 97,115,101, 0,115,116,114,105,100,101, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97, 99,116, +110,114, 0,116,105,109,101,115,108,105,100,101, 0,110, 97,109,101, 91, 51, 48, 93, 0,101,110,102,111,114, 99,101, 0, 42,116, + 97,114, 0,105,116,101,114, 97,116,105,111,110,115, 0,114,111,111,116, 98,111,110,101, 0,115,117, 98,116, 97,114,103,101,116, + 91, 51, 50, 93, 0,111,114,105,101,110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0, +109,105,110,109, 97,120,102,108, 97,103, 0,115,116,105, 99,107,121, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, + 0,108,111, 99, 97,108, 0,108,111, 99,107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,111,102,102,115,101, +116, 91, 51, 93, 0,122,109, 97,120, 0,118,111,108,109,111,100,101, 0,112,108, 97,110,101, 0,111,114,103,108,101,110,103,116, +104, 0, 98,117,108,103,101, 0,115,116,114,105,100,101, 95, 97,120,105,115, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116, +101,110,100, 0, 97, 99,116,111,102,102,115, 0,112, 97,100,102, 0,115,116,114,105,100,101,108,101,110, 0,114,101,112,101, 97, +116, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100,101, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,104, 97,115, +105,110,112,117,116, 0,100, 97,116, 97,116,121,112,101, 0,110,115, 0,108,105,109,105,116, 0,115,116, 97, 99,107, 95,105,110, +100,101,120, 0,105,110,116,101,114,110, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 95,101,120,116, 0,108,111, 99,120, 0, +108,111, 99,121, 0,111,119,110, 95,105,110,100,101,120, 0,116,111, 95,105,110,100,101,120, 0, 42,116,111,115,111, 99,107, 0, + 42,108,105,110,107, 0, 42,110,101,119, 0,108, 97,115,116,121, 0,111,117,116,112,117,116,115, 0, 42,115,116,111,114, 97,103, +101, 0, 42, 98,108,111, 99,107, 0,109,105,110,105,119,105,100,116,104, 0, 99,117,115,116,111,109, 49, 0, 99,117,115,116,111, +109, 50, 0,116,111,116,114, 0, 98,117,116,114, 0,112,114,118,114, 0, 42,112,114,101,118,105,101,119, 0, 42,116,121,112,101, +105,110,102,111, 0, 42,102,114,111,109,110,111,100,101, 0, 42,116,111,110,111,100,101, 0, 42,102,114,111,109,115,111, 99,107, + 0,110,111,100,101,115, 0,108,105,110,107,115, 0, 42,115,116, 97, 99,107, 0, 42,115,116, 97, 99,107, 49, 0,105,110,105,116, + 0, 99,117,114, 95,105,110,100,101,120, 0, 42, 42, 97,108,108,116,121,112,101,115, 0, 42,111,119,110,116,121,112,101, 0,115, +104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, 97,120,116, 97, 98,108,101, 0, 42, 99,117,114,118,101, 0, 42, +116, 97, 98,108,101, 0, 99,117,114,114, 0, 99,108,105,112,114, 0, 99,109, 91, 52, 93, 0, 98,108, 97, 99,107, 91, 51, 93, 0, +119,104,105,116,101, 91, 51, 93, 0, 98,119,109,117,108, 91, 51, 93, 0, 0, 0, 84, 89, 80, 69, 0, 0, 0,230, 99,104, 97,114, + 0,117, 99,104, 97,114, 0,115,104,111,114,116, 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111, +110,103, 0,102,108,111, 97,116, 0,100,111,117, 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,115,116, 66, 97, +115,101, 0,118,101, 99, 50,115, 0,118,101, 99, 50,105, 0,118,101, 99, 50,102, 0,118,101, 99, 50,100, 0,118,101, 99, 51,105, + 0,118,101, 99, 51,102, 0,118,101, 99, 51,100, 0,118,101, 99, 52,105, 0,118,101, 99, 52,102, 0,118,101, 99, 52,100, 0,114, + 99,116,105, 0,114, 99,116,102, 0, 73, 68, 0, 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, 73,112,111, + 0, 75,101,121, 66,108,111, 99,107, 0, 75,101,121, 0, 83, 99,114,105,112,116, 76,105,110,107, 0, 84,101,120,116, 76,105,110, +101, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101, 0, 67, 97,109,101,114, 97, 0, 73,109, 97,103,101, 0, 97, +110,105,109, 0, 73,109, 66,117,102, 0, 77, 84,101,120, 0, 79, 98,106,101, 99,116, 0, 84,101,120, 0, 80,108,117,103,105,110, + 84,101,120, 0, 67, 66, 68, 97,116, 97, 0, 67,111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,112, 0, 84,101,120, 77, + 97,112,112,105,110,103, 0, 76, 97,109,112, 0, 87, 97,118,101, 0, 77, 97,116,101,114,105, 97,108, 0, 98, 78,111,100,101, 84, +114,101,101, 0, 71,114,111,117,112, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,108, +101,109, 0, 66,111,117,110,100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 66,101,122, 84,114,105,112,108,101, 0, 66, + 80,111,105,110,116, 0, 78,117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0, 84,101,120,116, 66,111,120, 0, 67,117,114,118, +101, 0, 80, 97,116,104, 0, 73,112,111, 68,114,105,118,101,114, 0, 73,112,111, 67,117,114,118,101, 0, 84, 70, 97, 99,101, 0, + 77,101,115,104, 0, 77, 70, 97, 99,101, 0, 77, 86,101,114,116, 0, 77, 69,100,103,101, 0, 77, 68,101,102,111,114,109, 86,101, +114,116, 0, 77, 67,111,108, 0, 77, 83,116,105, 99,107,121, 0, 79, 99, 73,110,102,111, 0, 77, 68,101,102,111,114,109, 87,101, +105,103,104,116, 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98,115,117,114,102, 77,111,100,105,102,105,101, +114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,117,114,118,101, 77, +111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105, +114,114,111,114, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101, +114, 68, 97,116, 97, 0, 87, 97,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77, +111,100,105,102,105,101,114, 68, 97,116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102, +116, 98,111,100,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,111,111,108,101, 97,110, 77,111,100,105,102,105,101, +114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 76, 66,117,102, 0, + 98, 65, 99,116,105,111,110, 0, 98, 80,111,115,101, 0, 80, 97,114,116, 68,101,102,108,101, 99,116, 0, 83,111,102,116, 66,111, +100,121, 0, 70,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 68,101,114,105,118,101,100, 77,101,115,104, 0, + 79, 98, 72,111,111,107, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,121, 83,112, +114,105,110,103, 0, 87,111,114,108,100, 0, 82, 97,100,105,111, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97, +116, 97, 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, + 82,101,110,100,101,114, 68, 97,116, 97, 0, 71, 97,109,101, 70,114, 97,109,105,110,103, 0, 84,105,109,101, 77, 97,114,107,101, +114, 0, 84,111,111,108, 83,101,116,116,105,110,103,115, 0, 83, 99,101,110,101, 0, 68, 97,103, 70,111,114,101,115,116, 0, 66, + 71,112,105, 99, 0, 86,105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107, 0, 83, 99,114, 65,114,101, 97, 0, 82,101, +110,100,101,114, 73,110,102,111, 0, 86,105,101,119, 50, 68, 0, 83,112, 97, 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73, +112,111, 0, 83,112, 97, 99,101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,101,113, 0, 83,112, 97, 99,101, 70,105,108,101, 0, +100,105,114,101,110,116,114,121, 0, 66,108,101,110,100, 72, 97,110,100,108,101, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84, +114,101,101, 83,116,111,114,101, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 67,117,114,118,101, 77, 97,112,112,105,110,103, + 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,120,116, 0, 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, + 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 0, 83,112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, 99,101, + 73,109, 97, 83,101,108, 0, 73,109, 97, 68,105,114, 0, 79,110,101, 83,101,108,101, 99,116, 97, 98,108,101, 73,109, 97, 0, 84, +104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 98, 84,104,101,109,101, 0, 83,111,108,105,100, 76,105, +103,104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,101,110, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,114, 69, +100,103,101, 0, 80, 97,110,101,108, 0, 70,105,108,101, 71,108,111, 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109, 0, 83, +116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,101,113,117,101,110, 99,101, 0, 98, 83,111,117,110,100, 0, 77, +101,116, 97, 83,116, 97, 99,107, 0, 69,100,105,116,105,110,103, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119, 86, 97, +114,115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114,116,105, + 99,108,101, 0, 87, 97,118,101, 69,102,102, 0, 84,114,101,101, 83,116,111,114,101, 69,108,101,109, 0, 79,111,112,115, 0, 98, + 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97,114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,101, 83,101,110,115,111, +114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111,114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,110,115,111,114, 0, 98, + 80,114,111,112,101,114,116,121, 83,101,110,115,111,114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,111,114, 0, + 98, 82, 97,100, 97,114, 83,101,110,115,111,114, 0, 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82, 97,121, 83, +101,110,115,111,114, 0, 98, 77,101,115,115, 97,103,101, 83,101,110,115,111,114, 0, 98, 83,101,110,115,111,114, 0, 98, 67,111, +110,116,114,111,108,108,101,114, 0, 98, 74,111,121,115,116,105, 99,107, 83,101,110,115,111,114, 0, 98, 69,120,112,114,101,115, +115,105,111,110, 67,111,110,116, 0, 98, 80,121,116,104,111,110, 67,111,110,116, 0, 98, 65, 99,116,117, 97,116,111,114, 0, 98, + 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 65, 99,116,105,111,110, 65, 99,116,117, 97,116,111, +114, 0, 98, 83,111,117,110,100, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 68, 65, 99,116,117, 97,116,111,114, 0, 98, 69,100, +105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83, 99,101,110,101, 65, 99,116,117, 97,116,111,114, 0, + 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111, +114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 97,109,101,114, 97, 65, 99,116,117, 97,116,111,114, 0, 98, + 67,111,110,115,116,114, 97,105,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 71,114,111,117,112, 65, 99,116,117, 97,116,111, +114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, 97,116,111,114, 0, 98, 77,101,115,115, 97,103,101, 65, 99,116,117, 97,116, +111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97,116,111,114, 0, 98, 86,105,115,105, 98,105,108,105,116,121, 65, 99,116,117, + 97,116,111,114, 0, 70,114,101,101, 67, 97,109,101,114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98, 83,111,117,110,100, 76,105, +115,116,101,110,101,114, 0, 83,112, 97, 99,101, 83,111,117,110,100, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111, +110,101, 0, 98, 65,114,109, 97,116,117,114,101, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 65, 99,116,105,111, +110, 67,104, 97,110,110,101,108, 0, 83,112, 97, 99,101, 65, 99,116,105,111,110, 0, 98, 67,111,110,115,116,114, 97,105,110,116, + 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111, +110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97, 99,107, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, + 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110, +115,116,114, 97,105,110,116, 0, 98, 77,105,110, 77, 97,120, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111, +110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, + 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 68,105,115,116, 97,110, 99,101, + 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,105,111,110, 67,111,110,115,116,114, 97, +105,110,116, 0, 98, 83,116,114,101,116, 99,104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, + 83,116,114,105,112, 0, 98, 78,111,100,101, 83,116, 97, 99,107, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 0, 98, 78,111, +100,101, 76,105,110,107, 0, 98, 78,111,100,101, 0,117,105, 66,108,111, 99,107, 0, 98, 78,111,100,101, 80,114,101,118,105,101, +119, 0, 98, 78,111,100,101, 84,121,112,101, 0, 67,117,114,118,101, 77, 97,112, 80,111,105,110,116, 0, 67,117,114,118,101, 77, + 97,112, 0, 0, 84, 76, 69, 78, 0, 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, 8, 0, 8, + 0, 4, 0, 8, 0, 8, 0, 16, 0, 12, 0, 12, 0, 24, 0, 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 48, 2, 32, 0, 0, 0, 80, + 0,104, 0,116, 0, 16, 0, 24, 0,100, 0, 20, 0,116, 1, 48, 0, 0, 0, 0, 0, 88, 2,220, 0,228, 1, 80, 0, 24, 1,136, + 0,128, 0,132, 0,252, 0, 52, 1,164, 0, 96, 0, 56, 1, 64, 0, 0, 0,108, 0, 96, 0,132, 0, 56, 0, 28, 0, 56, 0, 8, + 0, 16, 1, 44, 0, 0, 0,140, 0, 84, 0, 60, 0,188, 0, 20, 0, 20, 0, 12, 0, 12, 0, 4, 0, 8, 0, 24, 0, 8, 0, 52, + 0, 68, 0, 88, 0, 88, 0, 68, 0, 60, 0, 60, 0, 92, 0, 64, 0,180, 0, 52, 0, 64, 0,108, 0, 40, 0, 12, 0, 56, 0, 24, + 0, 44, 0, 92, 1, 84, 0, 0, 0,208, 0, 16, 0, 0, 0, 0, 1, 32, 0, 40, 0, 28, 0,176, 0,144, 0, 16, 3, 16, 0, 16, + 0, 80, 0, 28, 3,244, 0, 0, 0, 36, 2,192, 0, 36, 0,204, 0, 0, 0,120, 0, 36, 1, 40, 0,204, 0,164, 1, 84, 0, 0, + 0, 0, 0,196, 0, 12, 0,188, 0,176, 0,164, 0,120, 0, 32, 0, 0, 0,148, 0,176, 2,224, 0, 0, 0, 0, 0, 72, 0,136, + 8,104, 0, 56, 7,168, 0,116, 0, 20, 0, 24, 0,164, 0, 24, 0,104, 0,188, 1,160, 0,172, 1, 32, 0, 16, 0, 28, 0, 12, + 0, 24, 0, 16, 0, 24, 1, 48, 0, 0, 0, 56, 0, 12, 0, 44, 0, 64, 0, 48, 0, 8, 0, 44, 0, 72, 0,104, 0, 72, 0, 44, + 0, 40, 0,108, 0, 68, 0, 76, 0, 80, 0, 64, 0,128, 0, 4, 0, 60, 0, 12, 0, 60, 0, 20, 0, 16, 0, 64, 0, 16, 0, 76, + 0,120, 0, 48, 0, 28, 0, 56, 0, 52, 0, 56, 0,108, 0,136, 0, 4, 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 0, 19, 0, 26, 0, 20, 0, 0, 0, 21, 0, 0, 0, 22, 0, 4, 0, 23, 0, 4, 0, 24, 0, 27, 0, 6, + 0, 24, 0, 18, 0, 11, 0, 25, 0, 23, 0, 26, 0, 2, 0, 27, 0, 2, 0, 28, 0, 4, 0, 24, 0, 28, 0, 13, 0, 28, 0, 0, + 0, 28, 0, 1, 0, 7, 0, 29, 0, 7, 0, 30, 0, 2, 0, 31, 0, 2, 0, 32, 0, 4, 0, 33, 0, 9, 0, 34, 0, 7, 0, 35, + 0, 0, 0, 36, 0, 0, 0, 37, 0, 7, 0, 38, 0, 7, 0, 39, 0, 29, 0, 12, 0, 24, 0, 18, 0, 28, 0, 40, 0, 0, 0, 41, + 0, 4, 0, 42, 0, 7, 0, 30, 0, 11, 0, 43, 0, 27, 0, 44, 0, 24, 0, 45, 0, 2, 0, 31, 0, 2, 0, 46, 0, 2, 0, 47, + 0, 2, 0, 16, 0, 30, 0, 5, 0, 24, 0, 48, 0, 2, 0, 49, 0, 2, 0, 50, 0, 2, 0, 51, 0, 4, 0, 24, 0, 31, 0, 6, + 0, 31, 0, 0, 0, 31, 0, 1, 0, 0, 0, 52, 0, 0, 0, 53, 0, 4, 0, 54, 0, 4, 0, 55, 0, 32, 0, 13, 0, 24, 0, 18, + 0, 0, 0, 56, 0, 4, 0, 57, 0, 4, 0, 58, 0, 11, 0, 59, 0, 31, 0, 60, 0, 31, 0, 61, 0, 4, 0, 62, 0, 4, 0, 63, + 0, 0, 0, 64, 0, 4, 0, 65, 0, 4, 0, 66, 0, 9, 0, 67, 0, 33, 0, 5, 0, 4, 0, 68, 0, 4, 0, 69, 0, 4, 0, 57, + 0, 4, 0, 24, 0, 9, 0, 34, 0, 34, 0, 17, 0, 24, 0, 18, 0, 2, 0, 31, 0, 2, 0, 16, 0, 7, 0, 70, 0, 7, 0, 71, + 0, 7, 0, 72, 0, 7, 0, 73, 0, 7, 0, 74, 0, 7, 0, 75, 0, 7, 0, 76, 0, 7, 0, 77, 0, 7, 0, 78, 0, 2, 0, 79, + 0, 2, 0, 80, 0, 7, 0, 81, 0, 27, 0, 44, 0, 30, 0, 82, 0, 35, 0, 23, 0, 24, 0, 18, 0, 0, 0, 83, 0, 36, 0, 84, + 0, 37, 0, 85, 0, 37, 0, 86, 0, 2, 0, 87, 0, 2, 0, 16, 0, 2, 0, 88, 0, 2, 0, 24, 0, 2, 0, 89, 0, 2, 0, 90, + 0, 2, 0, 91, 0, 2, 0, 92, 0, 2, 0, 93, 0, 2, 0, 94, 0, 4, 0, 95, 0, 4, 0, 96, 0, 33, 0, 97, 0, 7, 0, 98, + 0, 4, 0, 99, 0, 2, 0,100, 0, 2, 0,101, 0, 4, 0,102, 0, 38, 0, 24, 0, 2, 0,103, 0, 2, 0,104, 0, 2, 0,105, + 0, 2, 0,106, 0, 39, 0,107, 0, 40, 0,108, 0, 0, 0,109, 0, 0, 0,110, 0, 0, 0,111, 0, 0, 0,112, 0, 7, 0,113, + 0, 7, 0,114, 0, 2, 0,115, 0, 2, 0,116, 0, 7, 0,117, 0, 7, 0,118, 0, 7, 0,119, 0, 7, 0,120, 0, 7, 0,121, + 0, 7, 0,122, 0, 7, 0,123, 0, 7, 0,124, 0, 7, 0,125, 0, 7, 0,126, 0, 41, 0, 14, 0, 0, 0, 83, 0, 9, 0,127, + 0, 0, 0,128, 0, 0, 0,129, 0, 4, 0,130, 0, 4, 0,131, 0, 9, 0,132, 0, 7, 0,133, 0, 7, 0,134, 0, 7, 0,135, + 0, 4, 0,136, 0, 9, 0,137, 0, 4, 0,138, 0, 4, 0, 24, 0, 42, 0, 6, 0, 7, 0,117, 0, 7, 0,118, 0, 7, 0,119, + 0, 7, 0,139, 0, 7, 0, 29, 0, 4, 0, 26, 0, 43, 0, 5, 0, 2, 0, 16, 0, 2, 0, 23, 0, 2, 0, 26, 0, 2, 0,140, + 0, 42, 0,141, 0, 44, 0, 16, 0, 39, 0,107, 0, 35, 0,142, 0, 35, 0,143, 0, 7, 0,144, 0, 2, 0, 31, 0, 2, 0,145, + 0, 7, 0, 72, 0, 7, 0, 73, 0, 4, 0,146, 0, 2, 0,147, 0, 2, 0,148, 0, 2, 0, 87, 0, 2, 0, 88, 0, 2, 0,149, + 0, 2, 0,150, 0, 4, 0, 71, 0, 40, 0, 52, 0, 24, 0, 18, 0, 7, 0,151, 0, 7, 0,152, 0, 7, 0,153, 0, 7, 0,154, + 0, 7, 0,155, 0, 7, 0,156, 0, 7, 0,157, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0, 7, 0,161, 0, 7, 0,162, + 0, 7, 0,163, 0, 7, 0,164, 0, 7, 0,165, 0, 7, 0,166, 0, 7, 0,167, 0, 7, 0,168, 0, 7, 0,169, 0, 7, 0,170, + 0, 2, 0,171, 0, 2, 0,172, 0, 2, 0,173, 0, 2, 0,174, 0, 2, 0,175, 0, 2, 0,176, 0, 2, 0,177, 0, 2, 0, 16, + 0, 2, 0, 31, 0, 2, 0,145, 0, 7, 0,178, 0, 7, 0,179, 0, 7, 0,180, 0, 7, 0,181, 0, 2, 0,182, 0, 2, 0,183, + 0, 2, 0,184, 0, 2, 0, 54, 0, 7, 0,185, 0, 7, 0,186, 0, 2, 0,187, 0, 2, 0,188, 0, 2, 0,189, 0, 2, 0,190, + 0, 7, 0,123, 0, 27, 0, 44, 0, 35, 0,142, 0, 41, 0,191, 0, 43, 0,192, 0, 44, 0,193, 0, 2, 0,194, 0, 45, 0, 8, + 0, 7, 0,195, 0, 7, 0,196, 0, 7, 0,114, 0, 4, 0, 16, 0, 7, 0,197, 0, 7, 0,198, 0, 7, 0,199, 0, 39, 0,200, + 0, 46, 0, 50, 0, 24, 0, 18, 0, 2, 0, 31, 0, 2, 0,201, 0, 2, 0,116, 0, 2, 0,202, 0, 7, 0,117, 0, 7, 0,118, + 0, 7, 0,119, 0, 7, 0,120, 0, 7, 0,203, 0, 7, 0,204, 0, 7, 0,205, 0, 7, 0,206, 0, 7, 0,207, 0, 7, 0,208, + 0, 7, 0,209, 0, 2, 0,210, 0, 2, 0,211, 0, 7, 0, 72, 0, 7, 0, 73, 0, 7, 0,212, 0, 7, 0,213, 0, 7, 0,214, + 0, 2, 0,215, 0, 2, 0,216, 0, 2, 0,217, 0, 2, 0,218, 0, 2, 0,219, 0, 2, 0, 24, 0, 7, 0,220, 0, 7, 0,221, + 0, 7, 0,222, 0, 2, 0,223, 0, 2, 0,224, 0, 4, 0,225, 0, 4, 0,226, 0, 2, 0,227, 0, 2, 0,228, 0, 2, 0,229, + 0, 2, 0,230, 0, 7, 0,231, 0, 7, 0,232, 0, 7, 0,233, 0, 7, 0,234, 0, 7, 0,235, 0, 2, 0,236, 0, 2, 0,237, + 0, 38, 0,238, 0, 27, 0, 44, 0, 30, 0, 82, 0, 47, 0, 2, 0, 24, 0, 18, 0, 27, 0, 44, 0, 48, 0, 97, 0, 24, 0, 18, + 0, 2, 0,116, 0, 2, 0,239, 0, 7, 0,117, 0, 7, 0,118, 0, 7, 0,119, 0, 7, 0,240, 0, 7, 0,241, 0, 7, 0,242, + 0, 7, 0,243, 0, 7, 0,244, 0, 7, 0,245, 0, 7, 0,246, 0, 7, 0,247, 0, 7, 0,248, 0, 7, 0,249, 0, 7, 0,250, + 0, 7, 0,251, 0, 7, 0,252, 0, 7, 0,253, 0, 7, 0,254, 0, 7, 0,255, 0, 7, 1, 0, 0, 7, 1, 1, 0, 7, 1, 2, + 0, 7, 1, 3, 0, 7, 1, 4, 0, 7, 1, 5, 0, 7, 1, 6, 0, 7, 1, 7, 0, 7, 1, 8, 0, 2, 1, 9, 0, 2, 1, 10, + 0, 2, 1, 11, 0, 0, 1, 12, 0, 0, 1, 13, 0, 4, 0,201, 0, 4, 1, 14, 0, 2, 1, 15, 0, 2, 1, 16, 0, 2, 1, 17, + 0, 2, 1, 18, 0, 7, 1, 19, 0, 7, 1, 20, 0, 7, 1, 21, 0, 7, 1, 22, 0, 7, 1, 23, 0, 7, 1, 24, 0, 7, 1, 25, + 0, 7, 1, 26, 0, 0, 1, 27, 0, 0, 0,223, 0, 0, 1, 28, 0, 0, 1, 29, 0, 2, 1, 30, 0, 2, 1, 31, 0, 2, 1, 32, + 0, 2, 1, 33, 0, 2, 1, 34, 0, 2, 1, 35, 0, 7, 1, 36, 0, 7, 1, 37, 0, 7, 1, 38, 0, 7, 1, 39, 0, 7, 1, 40, + 0, 2, 0,103, 0, 2, 0,104, 0, 43, 1, 41, 0, 43, 1, 42, 0, 0, 1, 43, 0, 0, 1, 44, 0, 0, 1, 45, 0, 0, 1, 46, + 0, 2, 1, 47, 0, 2, 1, 48, 0, 7, 1, 49, 0, 7, 1, 50, 0, 38, 0,238, 0, 49, 1, 51, 0, 27, 0, 44, 0, 50, 1, 52, + 0, 7, 1, 53, 0, 7, 1, 54, 0, 7, 1, 55, 0, 7, 1, 56, 0, 7, 1, 57, 0, 2, 1, 58, 0, 2, 1, 59, 0, 7, 1, 60, + 0, 7, 1, 61, 0, 7, 1, 62, 0, 7, 1, 63, 0, 7, 1, 64, 0, 4, 1, 65, 0, 4, 1, 66, 0, 4, 1, 67, 0, 30, 0, 82, + 0, 51, 0, 6, 0, 24, 0, 18, 0, 0, 1, 68, 0, 7, 1, 69, 0, 7, 0, 24, 0, 52, 0, 34, 0, 33, 0, 97, 0, 53, 0, 26, + 0, 53, 0, 0, 0, 53, 0, 1, 0, 54, 1, 70, 0, 4, 1, 71, 0, 4, 1, 72, 0, 4, 1, 73, 0, 4, 1, 74, 0, 4, 1, 75, + 0, 4, 1, 76, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 1, 77, 0, 2, 1, 78, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, + 0, 7, 1, 79, 0, 7, 1, 80, 0, 7, 1, 81, 0, 7, 1, 82, 0, 7, 1, 83, 0, 7, 1, 84, 0, 7, 1, 85, 0, 7, 0, 54, + 0, 7, 1, 86, 0, 7, 1, 87, 0, 55, 0, 15, 0, 24, 0, 18, 0, 54, 1, 70, 0, 11, 1, 88, 0, 11, 1, 89, 0, 27, 0, 44, + 0, 48, 1, 90, 0, 2, 0, 16, 0, 2, 1, 91, 0, 4, 0,115, 0, 7, 0,195, 0, 7, 0,114, 0, 7, 0,196, 0, 7, 1, 92, + 0, 7, 1, 93, 0, 7, 1, 94, 0, 56, 0, 10, 0, 7, 1, 95, 0, 7, 1, 96, 0, 7, 1, 97, 0, 7, 0, 24, 0, 2, 1, 98, + 0, 2, 1, 99, 0, 0, 1,100, 0, 0, 1,101, 0, 0, 1,102, 0, 0, 1,103, 0, 57, 0, 5, 0, 7, 1,104, 0, 7, 1, 96, + 0, 7, 1, 97, 0, 2, 1,100, 0, 2, 1,103, 0, 58, 0, 20, 0, 58, 0, 0, 0, 58, 0, 1, 0, 2, 0, 31, 0, 2, 1,105, + 0, 2, 1,103, 0, 2, 0, 16, 0, 2, 1,106, 0, 2, 1,107, 0, 2, 1,108, 0, 2, 1,109, 0, 2, 1,110, 0, 2, 1,111, + 0, 2, 1,112, 0, 2, 1,113, 0, 7, 1,114, 0, 7, 1,115, 0, 57, 1,116, 0, 56, 1,117, 0, 4, 1,118, 0, 4, 0, 24, + 0, 59, 0, 5, 0, 2, 1,119, 0, 2, 1,105, 0, 0, 0, 16, 0, 0, 0, 24, 0, 2, 1, 59, 0, 60, 0, 4, 0, 7, 0, 4, + 0, 7, 0, 5, 0, 7, 0, 7, 0, 7, 1,120, 0, 61, 0, 54, 0, 24, 0, 18, 0, 54, 1, 70, 0, 11, 1,121, 0, 11, 1, 89, + 0, 39, 1,122, 0, 39, 1,123, 0, 39, 1,124, 0, 27, 0, 44, 0, 62, 1,125, 0, 29, 1,126, 0, 48, 1, 90, 0, 11, 1,127, + 0, 7, 0,195, 0, 7, 0,114, 0, 7, 0,196, 0, 4, 0,115, 0, 2, 1,128, 0, 2, 1, 91, 0, 2, 0, 16, 0, 2, 1,129, + 0, 7, 1,130, 0, 7, 1,131, 0, 7, 1,132, 0, 2, 1,108, 0, 2, 1,109, 0, 2, 0, 54, 0, 2, 0, 59, 0, 2, 0, 29, + 0, 2, 1,133, 0, 7, 1,134, 0, 7, 1,135, 0, 7, 1,136, 0, 7, 1,137, 0, 7, 1,138, 0, 7, 1,139, 0, 7, 1,140, + 0, 7, 1,141, 0, 7, 1,142, 0, 7, 1,143, 0, 0, 1,144, 0, 0, 1,145, 0, 51, 1,146, 0, 51, 1,147, 0, 51, 1,148, + 0, 51, 1,149, 0, 4, 1,150, 0, 4, 1,151, 0, 4, 1,152, 0, 4, 0, 24, 0, 60, 1,153, 0, 4, 1,154, 0, 4, 1,155, + 0, 59, 1,156, 0, 59, 1,157, 0, 63, 0, 6, 0, 39, 0,200, 0, 2, 0, 27, 0, 2, 0, 32, 0, 2, 0, 31, 0, 2, 0, 16, + 0, 0, 1,158, 0, 64, 0, 19, 0, 64, 0, 0, 0, 64, 0, 1, 0, 57, 1,116, 0, 56, 1,117, 0, 23, 1,159, 0, 23, 1,160, + 0, 2, 0, 27, 0, 2, 0, 32, 0, 2, 1,161, 0, 2, 1,162, 0, 2, 1,163, 0, 2, 1,164, 0, 2, 0, 16, 0, 2, 1,165, + 0, 7, 0, 10, 0, 7, 0, 11, 0, 4, 1,166, 0, 7, 0, 30, 0, 63, 1,167, 0, 65, 0, 8, 0, 9, 1,168, 0, 7, 1,169, + 0, 4, 1,170, 0, 0, 0, 16, 0, 0, 1,171, 0, 2, 0,201, 0, 2, 1,172, 0, 2, 1,173, 0, 66, 0, 32, 0, 24, 0, 18, + 0, 54, 1, 70, 0, 11, 1,174, 0, 27, 0, 44, 0, 29, 1,126, 0, 48, 1, 90, 0, 67, 1,175, 0, 65, 1,176, 0, 9, 1,177, + 0, 68, 1,178, 0, 69, 1,179, 0, 70, 1,180, 0, 71, 1,181, 0, 72, 1,182, 0, 66, 1,183, 0, 73, 1,184, 0, 9, 1,185, + 0, 4, 1,162, 0, 4, 1,186, 0, 4, 1,187, 0, 4, 0,115, 0, 7, 0,195, 0, 7, 0,114, 0, 7, 0,196, 0, 7, 1,188, + 0, 7, 0, 24, 0, 2, 1,189, 0, 2, 0, 16, 0, 2, 1,190, 0, 2, 1,191, 0, 2, 1, 91, 0, 2, 1,192, 0, 67, 0, 8, + 0, 4, 1,193, 0, 4, 1,194, 0, 4, 1,195, 0, 4, 1,196, 0, 0, 0, 24, 0, 0, 1,105, 0, 0, 1,197, 0, 0, 0, 16, + 0, 69, 0, 5, 0, 4, 1,193, 0, 4, 1,194, 0, 0, 1,198, 0, 0, 0, 24, 0, 2, 0, 16, 0, 74, 0, 2, 0, 4, 1,199, + 0, 7, 1, 97, 0, 70, 0, 3, 0, 74, 1,200, 0, 4, 1,201, 0, 4, 0, 16, 0, 68, 0, 4, 0, 7, 1,202, 0, 2, 1,203, + 0, 0, 0, 16, 0, 0, 1,105, 0, 71, 0, 4, 0, 0, 0,139, 0, 0, 0,117, 0, 0, 0,118, 0, 0, 0,119, 0, 72, 0, 1, + 0, 7, 1,204, 0, 75, 0, 6, 0, 75, 0, 0, 0, 75, 0, 1, 0, 4, 0, 31, 0, 4, 0,201, 0, 0, 0, 36, 0, 0, 1,205, + 0, 76, 0, 7, 0, 75, 1,206, 0, 2, 1,207, 0, 2, 1,208, 0, 2, 1,209, 0, 2, 0, 57, 0, 9, 1,210, 0, 9, 1,211, + 0, 77, 0, 3, 0, 75, 1,206, 0, 39, 0,107, 0, 0, 0, 36, 0, 78, 0, 3, 0, 75, 1,206, 0, 39, 0,107, 0, 0, 0, 36, + 0, 79, 0, 5, 0, 75, 1,206, 0, 7, 1,212, 0, 7, 1,213, 0, 4, 1,214, 0, 4, 1,215, 0, 80, 0, 4, 0, 75, 1,206, + 0, 2, 1,216, 0, 2, 0, 16, 0, 7, 1,217, 0, 81, 0, 3, 0, 75, 1,206, 0, 7, 1,218, 0, 4, 1,219, 0, 82, 0, 12, + 0, 75, 1,206, 0, 2, 0, 16, 0, 2, 0, 24, 0, 7, 1,220, 0, 7, 1,221, 0, 7, 1,222, 0, 7, 1,130, 0, 7, 1,223, + 0, 7, 1,224, 0, 7, 1,225, 0, 7, 1,226, 0, 7, 1,227, 0, 83, 0, 5, 0, 75, 1,206, 0, 2, 1,228, 0, 2, 0, 71, + 0, 4, 1, 59, 0, 39, 0,107, 0, 84, 0, 9, 0, 75, 1,206, 0, 39, 0,107, 0, 7, 1,229, 0, 7, 1,230, 0, 7, 1,231, + 0, 4, 1,232, 0, 4, 1,233, 0, 7, 1,234, 0, 0, 0, 36, 0, 85, 0, 1, 0, 75, 1,206, 0, 86, 0, 4, 0, 75, 1,206, + 0, 39, 0,107, 0, 4, 1,235, 0, 4, 0, 24, 0, 87, 0, 23, 0, 24, 0, 18, 0, 2, 1,106, 0, 2, 1,107, 0, 2, 1,236, + 0, 2, 0, 16, 0, 2, 1,237, 0, 2, 1,238, 0, 2, 1,239, 0, 2, 1, 59, 0, 0, 1,240, 0, 0, 1,241, 0, 0, 1,242, + 0, 0, 0, 31, 0, 4, 0, 24, 0, 7, 1,243, 0, 7, 1,244, 0, 7, 1,245, 0, 7, 1,246, 0, 7, 1,247, 0, 7, 1,248, + 0, 57, 1,249, 0, 27, 0, 44, 0, 29, 1,126, 0, 88, 0, 3, 0, 88, 0, 0, 0, 88, 0, 1, 0, 0, 0, 36, 0, 54, 0, 1, + 0, 7, 1,250, 0, 73, 0, 2, 0, 7, 1,251, 0, 7, 0,114, 0, 89, 0, 4, 0, 2, 0, 23, 0, 2, 1,252, 0, 4, 0, 24, + 0, 39, 1,253, 0, 39, 0, 93, 0, 24, 0, 18, 0, 2, 0, 31, 0, 2, 1,254, 0, 4, 1,255, 0, 4, 2, 0, 0, 4, 2, 1, + 0, 0, 2, 2, 0, 9, 2, 3, 0, 39, 2, 4, 0, 39, 2, 5, 0, 27, 0, 44, 0, 62, 1,125, 0, 54, 1, 70, 0, 90, 2, 6, + 0, 91, 2, 7, 0, 9, 0, 34, 0, 11, 2, 8, 0, 11, 1,174, 0, 11, 2, 9, 0, 11, 1, 89, 0, 11, 2, 10, 0, 11, 2, 11, + 0, 48, 1, 90, 0, 7, 0,195, 0, 7, 2, 12, 0, 7, 2, 13, 0, 7, 0,114, 0, 7, 2, 14, 0, 7, 0,196, 0, 7, 2, 15, + 0, 7, 1, 79, 0, 7, 2, 16, 0, 7, 2, 17, 0, 7, 1,229, 0, 7, 0,144, 0, 4, 0,239, 0, 2, 0, 16, 0, 2, 2, 18, + 0, 2, 2, 19, 0, 2, 2, 20, 0, 2, 2, 21, 0, 2, 2, 22, 0, 2, 2, 23, 0, 2, 2, 24, 0, 2, 2, 25, 0, 2, 2, 26, + 0, 2, 2, 27, 0, 2, 2, 28, 0, 2, 2, 29, 0, 2, 2, 30, 0, 2, 2, 31, 0, 2, 2, 32, 0, 7, 2, 33, 0, 7, 2, 34, + 0, 7, 2, 35, 0, 7, 2, 36, 0, 7, 2, 37, 0, 7, 2, 38, 0, 7, 2, 39, 0, 7, 2, 40, 0, 7, 2, 41, 0, 0, 2, 42, + 0, 0, 2, 43, 0, 0, 1, 91, 0, 0, 2, 44, 0, 30, 0, 82, 0, 11, 2, 45, 0, 11, 2, 46, 0, 11, 2, 47, 0, 11, 2, 48, + 0, 9, 1,185, 0, 7, 2, 49, 0, 2, 2, 50, 0, 2, 2, 51, 0, 7, 1,170, 0, 4, 2, 52, 0, 4, 2, 53, 0, 2, 2, 54, + 0, 2, 0,149, 0, 7, 2, 55, 0, 11, 2, 56, 0, 11, 2, 57, 0, 11, 2, 58, 0, 92, 2, 59, 0, 93, 2, 60, 0, 50, 2, 61, + 0, 2, 2, 62, 0, 0, 2, 63, 0, 0, 2, 64, 0, 7, 1,189, 0, 94, 2, 65, 0, 95, 2, 66, 0, 95, 2, 67, 0, 96, 0, 14, + 0, 96, 0, 0, 0, 96, 0, 1, 0, 39, 2, 4, 0, 7, 1,229, 0, 7, 0,197, 0, 7, 1,230, 0, 7, 1,231, 0, 0, 0, 36, + 0, 4, 1,232, 0, 4, 1,233, 0, 4, 2, 68, 0, 2, 0, 31, 0, 2, 2, 69, 0, 7, 1,234, 0, 92, 0, 13, 0, 2, 2, 70, + 0, 2, 2, 71, 0, 2, 0, 16, 0, 2, 0, 24, 0, 7, 2, 72, 0, 7, 2, 73, 0, 7, 2, 74, 0, 7, 2, 75, 0, 7, 2, 76, + 0, 7, 2, 77, 0, 7, 2, 78, 0, 7, 2, 79, 0, 7, 2, 80, 0, 97, 0, 1, 0, 7, 1,104, 0, 93, 0, 26, 0, 4, 2, 81, + 0, 4, 2, 82, 0, 98, 2, 83, 0, 99, 2, 84, 0, 7, 2, 34, 0, 7, 2, 85, 0, 7, 2, 86, 0, 7, 2, 87, 0, 7, 2, 88, + 0, 7, 2, 89, 0, 7, 2, 90, 0, 7, 2, 91, 0, 7, 2, 92, 0, 7, 2, 93, 0, 7, 2, 94, 0, 2, 2, 95, 0, 2, 0, 71, + 0, 7, 2, 96, 0, 7, 2, 97, 0, 2, 0,189, 0, 2, 2, 98, 0, 2, 2, 99, 0, 2, 1, 59, 0, 97, 2,100, 0, 4, 2,101, + 0, 4, 0, 46, 0, 94, 0, 26, 0, 2, 0, 31, 0, 2, 2,102, 0, 2, 2,103, 0, 2, 2,104, 0, 7, 2,105, 0, 2, 2,106, + 0, 2, 2,107, 0, 7, 2,108, 0, 2, 2,109, 0, 2, 2,110, 0, 7, 2,111, 0, 7, 2,112, 0, 7, 2,113, 0, 7, 2,114, + 0, 7, 2,115, 0, 7, 2,116, 0, 4, 2,117, 0, 7, 2,118, 0, 7, 2,119, 0, 7, 2,120, 0, 66, 2,121, 0, 66, 2,122, + 0, 66, 2,123, 0, 0, 2,124, 0, 7, 2,125, 0, 7, 2,126, 0,100, 0, 56, 0, 24, 0, 18, 0, 2, 0,116, 0, 2, 0,202, + 0, 2, 0,223, 0, 2, 2,127, 0, 7, 2,128, 0, 7, 2,129, 0, 7, 2,130, 0, 7, 2,131, 0, 7, 2,132, 0, 7, 2,133, + 0, 7, 2,134, 0, 7, 2,135, 0, 7, 0,246, 0, 7, 0,248, 0, 7, 0,247, 0, 7, 2,136, 0, 4, 2,137, 0, 7, 2,138, + 0, 7, 2,139, 0, 7, 2,140, 0, 7, 2,141, 0, 7, 2,142, 0, 7, 2,143, 0, 7, 2,144, 0, 2, 2,145, 0, 2, 0,201, + 0, 4, 2,146, 0, 7, 2,147, 0, 7, 2,148, 0, 7, 2,149, 0, 7, 2,150, 0, 7, 2,151, 0, 7, 2,152, 0, 7, 2,153, + 0, 7, 2,154, 0, 7, 2,155, 0, 7, 2,156, 0, 7, 2,157, 0, 7, 2,158, 0, 2, 2,159, 0, 2, 2,160, 0, 2, 2,161, + 0, 2, 2,162, 0, 7, 2,163, 0, 7, 2,164, 0, 7, 2,165, 0, 7, 2,166, 0, 2, 2,167, 0, 2, 2,168, 0, 2, 2,169, + 0, 2, 2,170, 0, 7, 2,171, 0, 27, 0, 44, 0, 38, 0,238, 0, 30, 0, 82, 0,101, 0, 16, 0, 2, 2,172, 0, 2, 2,173, + 0, 2, 2,174, 0, 2, 0, 16, 0, 2, 2,175, 0, 2, 2,176, 0, 2, 2,177, 0, 2, 2,178, 0, 2, 2,179, 0, 2, 2,180, + 0, 2, 2,181, 0, 2, 2,182, 0, 4, 2,183, 0, 7, 2,184, 0, 7, 2,185, 0, 7, 2,186, 0,102, 0, 8, 0,102, 0, 0, + 0,102, 0, 1, 0, 4, 0,239, 0, 4, 2,187, 0, 4, 0, 16, 0, 2, 2,188, 0, 2, 2,189, 0, 39, 0,107, 0,103, 0, 13, + 0, 9, 2,190, 0, 9, 2,191, 0, 4, 2,192, 0, 4, 2,193, 0, 4, 2,194, 0, 4, 2,195, 0, 4, 2,196, 0, 4, 2,197, + 0, 4, 2,198, 0, 4, 2,199, 0, 4, 2,200, 0, 4, 0, 24, 0, 0, 2,201, 0,104, 0, 5, 0, 9, 2,202, 0, 9, 2,203, + 0, 4, 2,204, 0, 4, 1, 59, 0, 0, 2,205, 0,105, 0, 4, 0, 4, 2,206, 0, 7, 2,207, 0, 2, 0, 16, 0, 2, 2,208, + 0,106, 0, 98, 0,103, 2,209, 0,104, 2,210, 0, 2, 2,211, 0, 2, 0,189, 0, 2, 2, 98, 0, 2, 2,212, 0, 2, 2,213, + 0, 2, 0, 16, 0, 7, 2, 34, 0, 7, 2,214, 0, 7, 2,215, 0, 7, 2,216, 0, 7, 2,217, 0, 7, 2,218, 0, 2, 2,219, + 0, 2, 2,220, 0, 2, 2,221, 0, 2, 2,222, 0, 2, 0,148, 0, 2, 2,223, 0, 2, 2,224, 0, 2, 2,225, 0, 2, 2,226, + 0, 2, 2,227, 0, 2, 2,228, 0, 2, 0, 68, 0, 2, 2,229, 0, 2, 2,230, 0, 2, 2,231, 0, 2, 2,232, 0, 2, 2,233, + 0, 2, 2,234, 0, 2, 2,235, 0, 2, 2,236, 0, 2, 2,237, 0, 2, 2,238, 0, 2, 2,239, 0, 2, 2,240, 0, 2, 2,241, + 0, 2, 2,242, 0, 4, 0,201, 0, 2, 2,243, 0, 2, 2,244, 0, 2, 2,245, 0, 2, 2,246, 0, 2, 2,247, 0, 2, 2,248, + 0, 2, 2,249, 0, 2, 2,250, 0, 2, 2,251, 0, 23, 2,252, 0, 23, 2,253, 0, 7, 2,186, 0, 7, 2,254, 0, 7, 2,255, + 0, 7, 3, 0, 0, 7, 3, 1, 0, 7, 3, 2, 0, 7, 3, 3, 0, 7, 3, 4, 0, 7, 3, 5, 0, 7, 3, 6, 0, 7, 3, 7, + 0, 7, 3, 8, 0, 7, 3, 9, 0, 7, 3, 10, 0, 2, 3, 11, 0, 2, 3, 12, 0, 2, 3, 13, 0, 2, 3, 14, 0, 2, 3, 15, + 0, 2, 3, 16, 0, 2, 3, 17, 0, 2, 3, 18, 0, 2, 3, 19, 0, 2, 3, 20, 0, 4, 3, 21, 0, 4, 3, 22, 0, 4, 3, 23, + 0, 4, 3, 24, 0, 4, 3, 25, 0, 7, 3, 26, 0, 4, 3, 27, 0, 4, 3, 28, 0, 4, 3, 29, 0, 4, 3, 30, 0, 7, 3, 31, + 0, 7, 3, 32, 0, 7, 3, 33, 0, 7, 3, 34, 0, 7, 3, 35, 0, 7, 3, 36, 0, 7, 3, 37, 0, 7, 3, 38, 0, 7, 3, 39, + 0, 0, 3, 40, 0, 0, 3, 41, 0, 0, 3, 42, 0,107, 0, 5, 0, 7, 3, 43, 0, 0, 0, 31, 0, 0, 0, 71, 0, 0, 1, 59, + 0, 0, 1, 48, 0,108, 0, 5, 0,108, 0, 0, 0,108, 0, 1, 0, 4, 3, 44, 0, 0, 3, 45, 0, 4, 0, 16, 0,109, 0, 13, + 0, 2, 3, 46, 0, 2, 3, 47, 0, 2, 3, 48, 0, 2, 3, 49, 0, 2, 3, 50, 0, 2, 0, 71, 0, 7, 3, 51, 0, 7, 3, 52, + 0, 2, 3, 53, 0, 2, 3, 54, 0, 2, 3, 55, 0, 0, 1, 59, 0, 0, 1, 48, 0,110, 0, 32, 0, 24, 0, 18, 0, 39, 3, 56, + 0,100, 3, 57, 0,110, 3, 58, 0, 35, 0,142, 0, 11, 3, 59, 0,102, 3, 60, 0, 7, 3, 61, 0, 7, 3, 62, 0, 7, 3, 63, + 0, 7, 3, 64, 0, 4, 0,239, 0, 7, 3, 65, 0, 2, 3, 66, 0, 2, 3, 67, 0, 2, 3, 68, 0, 2, 1, 29, 0, 49, 1, 51, + 0, 9, 3, 69, 0,101, 3, 70, 0, 9, 1,185, 0,107, 3, 71, 0,109, 3, 72, 0,106, 0,117, 0,105, 3, 73, 0, 30, 0, 82, + 0, 11, 3, 74, 0,111, 3, 75, 0, 2, 3, 76, 0, 2, 3, 77, 0, 2, 3, 78, 0, 2, 0,149, 0,112, 0, 10, 0, 35, 0,142, + 0, 40, 0,108, 0, 7, 1,141, 0, 7, 1,142, 0, 7, 0, 68, 0, 7, 3, 79, 0, 7, 3, 80, 0, 2, 3, 81, 0, 2, 3, 82, + 0, 4, 3, 83, 0,113, 0, 56, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0, 2, 3, 87, + 0, 7, 3, 88, 0, 7, 3, 89, 0, 7, 3, 90, 0, 7, 3, 91, 0, 7, 3, 92, 0, 7, 3, 93, 0, 7, 3, 94, 0, 7, 0,204, + 0, 2, 3, 95, 0, 2, 3, 96, 0, 39, 3, 56, 0,112, 3, 97, 0,113, 3, 98, 0,116, 3, 99, 0, 2, 2,174, 0, 2, 3,100, + 0, 4, 0,239, 0, 4, 3,101, 0, 2, 3,102, 0, 2, 3,103, 0, 2, 3,104, 0, 2, 0, 16, 0, 7, 0, 74, 0, 7, 3,105, + 0, 7, 3,106, 0, 7, 3,107, 0, 7, 3,108, 0, 7, 3,109, 0, 7, 3,110, 0, 7, 3,111, 0, 7, 0,113, 0, 7, 3, 61, + 0, 2, 3,112, 0, 2, 3,113, 0, 2, 3,114, 0, 2, 3,115, 0, 2, 3,116, 0, 2, 3,117, 0, 2, 3,118, 0, 2, 3,119, + 0, 2, 3,120, 0, 2, 3,121, 0, 7, 3,122, 0, 7, 3,123, 0, 54, 3,124, 0, 11, 3,125, 0, 2, 3,126, 0, 2, 1,171, + 0, 2, 3,127, 0, 2, 1, 59, 0,117, 0, 16, 0, 23, 0, 23, 0, 23, 0, 26, 0, 22, 3,128, 0, 22, 3,129, 0, 22, 3,130, + 0, 7, 3,131, 0, 7, 3,132, 0, 7, 3,133, 0, 7, 3,134, 0, 2, 3,135, 0, 2, 3,136, 0, 2, 3,137, 0, 2, 3,138, + 0, 2, 3,139, 0, 2, 3,140, 0, 4, 0, 16, 0,114, 0, 6, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, + 0,115, 3, 86, 0, 2, 3, 87, 0,118, 0, 6, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, + 0, 2, 3, 87, 0,119, 0, 26, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0, 2, 3, 87, + 0, 4, 3,141, 0, 4, 1, 59, 0,117, 3,142, 0, 9, 3,143, 0, 11, 3,144, 0, 27, 0, 44, 0, 24, 0, 45, 0, 0, 3,145, + 0, 0, 3,146, 0, 2, 3,147, 0, 2, 3,148, 0, 2, 3,149, 0, 2, 3,150, 0, 2, 0, 28, 0, 2, 0, 27, 0, 2, 3,116, + 0, 2, 3,151, 0, 4, 0, 16, 0, 7, 3,152, 0, 23, 0, 23, 0,120, 0, 29, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, + 0, 7, 3, 85, 0,115, 3, 86, 0,116, 3, 99, 0, 2, 3, 87, 0, 2, 3,153, 0, 2, 3,154, 0, 2, 3,155, 0, 2, 3,156, + 0,117, 3,142, 0, 2, 3,157, 0, 2, 3,116, 0, 2, 3,148, 0, 2, 3,158, 0, 9, 3,159, 0, 2, 3,117, 0, 0, 3,160, + 0, 0, 3,161, 0, 2, 3,162, 0, 2, 3,163, 0, 2, 2, 26, 0, 2, 3,164, 0, 2, 3,165, 0, 0, 1, 29, 0, 0, 0, 24, + 0, 0, 0,223, 0, 0, 3,166, 0,121, 0, 10, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, + 0, 2, 3, 87, 0,117, 3,142, 0, 2, 3,157, 0, 2, 3, 79, 0, 4, 1, 59, 0,122, 0, 24, 0,114, 0, 0, 0,114, 0, 1, + 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0, 2, 3, 87, 0,123, 3,167, 0, 4, 3,168, 0, 0, 3,169, 0, 0, 3,170, + 0, 0, 3,171, 0, 2, 0, 31, 0, 2, 3,172, 0, 2, 0, 16, 0, 2, 3,173, 0, 2, 3,174, 0, 2, 3,175, 0,124, 3,176, + 0, 2, 3,177, 0, 2, 0,140, 0, 2, 3,178, 0, 2, 3,179, 0, 9, 3,180, 0, 2, 3,181, 0,125, 0, 19, 0,114, 0, 0, + 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0, 2, 3, 87, 0,117, 3,142, 0, 11, 3,182, 0, 2, 3,148, + 0, 2, 3,183, 0, 2, 0, 16, 0, 2, 1,165, 0, 9, 3,159, 0, 11, 3,184, 0,126, 3,185, 0, 2, 0, 31, 0, 2, 3,186, + 0, 2, 3,187, 0, 2, 3,188, 0,127, 0, 18, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, + 0, 2, 3, 87, 0,117, 3,142, 0, 35, 3,189, 0,128, 3,190, 0, 7, 3, 79, 0, 2, 0,201, 0, 2, 3,116, 0, 2, 3,191, + 0, 2, 3,192, 0, 7, 1,141, 0, 7, 1,142, 0, 2, 0, 16, 0, 2, 3,151, 0,129, 0, 10, 0,114, 0, 0, 0,114, 0, 1, + 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0, 2, 3, 87, 0, 2, 3,116, 0, 2, 3,151, 0, 4, 0, 24, 0,117, 3,142, + 0,130, 0, 22, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0, 2, 3, 87, 0, 32, 3,193, + 0, 4, 3,194, 0, 4, 3,195, 0, 2, 0, 57, 0, 2, 3,116, 0, 4, 3,196, 0, 4, 3,197, 0, 4, 3,198, 0, 4, 3,199, + 0, 4, 3,200, 0, 4, 3,201, 0, 4, 3,202, 0, 4, 3,203, 0, 7, 3,204, 0, 22, 3,205, 0, 22, 3,206, 0,131, 0, 9, + 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0,132, 3,207, 0, 4, 1, 59, 0, 2, 0, 57, + 0, 2, 3,116, 0,133, 0, 8, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0,117, 3,142, + 0, 4, 0, 16, 0, 4, 3,208, 0,134, 0, 16, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, + 0,117, 3,142, 0, 24, 3,209, 0, 24, 0, 45, 0, 2, 0, 16, 0, 2, 3,116, 0, 7, 3,210, 0, 9, 3,211, 0, 49, 1, 51, + 0, 49, 3,212, 0, 4, 3,213, 0, 4, 0, 24, 0,135, 0, 81, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, + 0,115, 3, 86, 0, 0, 3,214, 0, 4, 3,215, 0, 2, 0,201, 0, 2, 3,216, 0, 2, 3,217, 0, 2, 3,218, 0, 2, 3,219, + 0, 2, 3,220, 0, 2, 3,221, 0, 2, 3,222, 0, 2, 3,223, 0, 2, 3,224, 0, 2, 3,225, 0, 2, 3,226, 0, 2, 3,227, + 0, 2, 3,228, 0, 2, 3,229, 0, 2, 3,230, 0, 2, 3,231, 0, 2, 3,232, 0, 2, 3,233, 0, 2, 3,234, 0, 2, 3,235, + 0, 2, 3,236, 0, 2, 3,237, 0, 2, 3,238, 0, 2, 3,239, 0, 2, 3,240, 0, 2, 3,241, 0, 2, 3,242, 0, 2, 3,243, + 0, 2, 3,244, 0, 2, 3,245, 0, 2, 3,246, 0, 2, 3,247, 0, 2, 3,248, 0, 2, 3,249, 0, 2, 3,250, 0, 2, 3,251, + 0, 2, 3,252, 0, 2, 3,253, 0, 2, 3,254, 0, 2, 3,255, 0, 2, 4, 0, 0, 2, 4, 1, 0, 2, 4, 2, 0, 2, 4, 3, + 0, 2, 4, 4, 0, 2, 4, 5, 0, 2, 4, 6, 0, 0, 4, 7, 0, 0, 4, 8, 0, 0, 4, 9, 0, 0, 4, 10, 0,136, 4, 11, + 0,136, 4, 12, 0, 4, 4, 13, 0, 4, 4, 14, 0, 4, 4, 15, 0, 4, 4, 16, 0, 4, 4, 17, 0, 7, 4, 18, 0, 7, 4, 19, + 0, 7, 4, 20, 0, 2, 4, 21, 0, 2, 4, 22, 0, 2, 4, 23, 0, 2, 4, 24, 0,137, 4, 25, 0,137, 4, 26, 0, 2, 4, 27, + 0, 2, 4, 28, 0, 4, 1, 59, 0, 37, 4, 29, 0, 9, 3,180, 0, 9, 4, 30, 0,138, 0, 19, 0, 0, 4, 31, 0, 0, 4, 32, + 0, 0, 4, 33, 0, 0, 4, 34, 0, 0, 4, 35, 0, 0, 4, 36, 0, 0, 4, 37, 0, 0, 4, 38, 0, 0, 4, 39, 0, 0, 4, 40, + 0, 0, 4, 41, 0, 0, 4, 42, 0, 0, 4, 43, 0, 0, 4, 44, 0, 0, 4, 45, 0, 0, 4, 46, 0, 0, 4, 47, 0, 0, 4, 48, + 0, 0, 4, 49, 0,139, 0, 36, 0, 0, 4, 50, 0, 0, 4, 41, 0, 0, 4, 42, 0, 0, 4, 51, 0, 0, 4, 52, 0, 0, 4, 53, + 0, 0, 4, 54, 0, 0, 4, 55, 0, 0, 4, 56, 0, 0, 4, 57, 0, 0, 4, 58, 0, 0, 4, 59, 0, 0, 4, 60, 0, 0, 4, 61, + 0, 0, 4, 62, 0, 0, 4, 63, 0, 0, 4, 64, 0, 0, 4, 65, 0, 0, 4, 66, 0, 0, 4, 67, 0, 0, 4, 68, 0, 0, 4, 69, + 0, 0, 4, 70, 0, 0, 4, 71, 0, 0, 4, 72, 0, 0, 4, 73, 0, 0, 4, 74, 0, 0, 4, 75, 0, 0, 4, 76, 0, 0, 4, 77, + 0, 0, 4, 78, 0, 0, 4, 79, 0, 0, 4, 80, 0, 0, 4, 81, 0, 0, 4, 82, 0, 0, 4, 83, 0,140, 0, 19, 0,140, 0, 0, + 0,140, 0, 1, 0, 0, 0, 36, 0,138, 4, 84, 0,139, 4, 85, 0,139, 4, 86, 0,139, 4, 87, 0,139, 4, 88, 0,139, 4, 89, + 0,139, 4, 90, 0,139, 4, 91, 0,139, 4, 92, 0,139, 4, 93, 0,139, 4, 94, 0,139, 4, 95, 0,139, 4, 96, 0,139, 4, 97, + 0,139, 4, 98, 0,139, 4, 99, 0,141, 0, 5, 0, 4, 0, 16, 0, 4, 0, 24, 0, 7, 1,170, 0, 7, 4,100, 0, 7, 1,104, + 0,142, 0, 45, 0, 4, 0, 16, 0, 4, 4,101, 0, 4, 4,102, 0, 0, 4,103, 0, 0, 4,104, 0, 0, 4,105, 0, 0, 4,106, + 0, 0, 4,107, 0, 0, 4,108, 0, 0, 4,109, 0, 0, 4,110, 0, 0, 4,111, 0, 2, 4,112, 0, 2, 4,113, 0, 4, 4,114, + 0, 4, 4,115, 0, 4, 4,116, 0, 4, 4,117, 0, 2, 4,118, 0, 2, 4,119, 0, 2, 4,120, 0, 2, 4,121, 0, 4, 4,122, + 0, 4, 4,123, 0, 2, 4,124, 0, 2, 4,125, 0, 2, 4,126, 0, 2, 4,127, 0, 0, 4,128, 0, 11, 4,129, 0, 2, 4,130, + 0, 2, 4,131, 0, 2, 4,132, 0, 2, 4,133, 0,141, 4,134, 0, 2, 4,135, 0, 2, 4,136, 0, 2, 4,137, 0, 2, 4,138, + 0, 4, 4,139, 0, 4, 4,140, 0, 2, 4,141, 0, 2, 0, 71, 0, 2, 1, 59, 0, 2, 1, 48, 0,143, 0, 18, 0, 24, 0, 18, + 0, 11, 4,142, 0, 11, 4,143, 0, 11, 4,144, 0,110, 4,145, 0, 2, 1,220, 0, 2, 4,146, 0, 2, 1,221, 0, 2, 4,147, + 0, 2, 4,148, 0, 2, 4,149, 0, 2, 4,150, 0, 2, 4,151, 0, 2, 4,152, 0, 2, 0, 24, 0, 2, 4,153, 0, 2, 4,154, + 0, 2, 4,155, 0,144, 0, 5, 0,144, 0, 0, 0,144, 0, 1, 0,144, 4,156, 0, 12, 4,157, 0, 4, 0, 16, 0,145, 0, 7, + 0,145, 0, 0, 0,145, 0, 1, 0,144, 4,158, 0,144, 4,159, 0, 2, 2,253, 0, 2, 0, 16, 0, 4, 0, 24, 0,146, 0, 16, + 0,146, 0, 0, 0,146, 0, 1, 0, 0, 4,160, 0, 0, 4,161, 0, 2, 4,162, 0, 2, 4,163, 0, 2, 4,148, 0, 2, 4,149, + 0, 2, 0, 16, 0, 2, 2, 69, 0, 2, 4,164, 0, 2, 0, 24, 0, 2, 4,165, 0, 2, 4,166, 0, 4, 4,167, 0,146, 4,168, + 0,115, 0, 30, 0,115, 0, 0, 0,115, 0, 1, 0,144, 4,158, 0,144, 4,159, 0,144, 4,169, 0,144, 4,170, 0,143, 4,171, + 0, 7, 4,172, 0, 22, 1,160, 0, 22, 4,173, 0, 22, 4,174, 0, 2, 4,175, 0, 2, 4,176, 0, 2, 4,177, 0, 0, 3, 84, + 0, 0, 4,178, 0, 2, 4,179, 0, 2, 4,180, 0, 0, 4,181, 0, 0, 4,182, 0, 0, 4,183, 0, 0, 4,184, 0, 2, 4,185, + 0, 2, 4,186, 0, 2, 4,187, 0, 2, 0, 16, 0, 30, 0, 82, 0, 11, 4,188, 0, 11, 4,189, 0, 11, 4,190, 0,147, 0, 7, + 0, 9, 4,191, 0, 9, 4,192, 0, 2, 4,193, 0, 2, 2,236, 0, 4, 4,194, 0, 4, 4,195, 0, 4, 0, 24, 0,148, 0, 8, + 0, 0, 4,196, 0, 37, 0, 85, 0,148, 4,197, 0,148, 4,198, 0,148, 4,199, 0, 2, 0, 87, 0, 2, 4,200, 0, 4, 0, 24, + 0,149, 0, 11, 0,149, 0, 0, 0,149, 0, 1, 0, 2, 1,165, 0, 2, 0, 54, 0, 2, 0, 15, 0, 2, 4,201, 0,148, 4,202, + 0, 0, 3,170, 0, 2, 4,203, 0, 2, 4,204, 0, 4, 0, 24, 0,150, 0, 10, 0, 0, 1, 68, 0, 9, 0,127, 0, 0, 0,128, + 0, 4, 0,131, 0, 4, 0,138, 0, 9, 0,132, 0, 7, 0,134, 0, 7, 0,135, 0, 9, 0,136, 0, 9, 0,137, 0,151, 0, 38, + 0,151, 0, 0, 0,151, 0, 1, 0,151, 4,205, 0, 9, 0, 13, 0, 0, 0, 14, 0, 2, 0, 16, 0, 2, 0, 31, 0, 4, 0, 54, + 0, 4, 1,212, 0, 4, 4,206, 0, 4, 4,207, 0, 4, 4,208, 0, 4, 4,209, 0, 4, 4,210, 0, 4, 0,148, 0, 4, 4,211, + 0, 4, 4,212, 0, 7, 4,213, 0, 7, 4,214, 0, 4, 0,189, 0,149, 4,215, 0,148, 4,216, 0, 27, 0, 44, 0,110, 4,145, + 0, 36, 0, 84, 0, 7, 4,217, 0, 7, 4,218, 0,150, 0,191, 0,151, 4,219, 0,151, 4,220, 0,151, 4,221, 0, 11, 4,222, + 0,152, 4,223, 0, 7, 4,224, 0, 7, 4,225, 0, 4, 4,226, 0, 7, 4,227, 0, 9, 4,228, 0,153, 0, 4, 0,153, 0, 0, + 0,153, 0, 1, 0, 11, 4,229, 0,151, 4,230, 0,154, 0, 6, 0, 11, 4,231, 0, 11, 4,222, 0, 11, 4,232, 0, 2, 0, 16, + 0, 2, 1,165, 0, 4, 0, 24, 0,155, 0, 4, 0, 7, 4,233, 0, 7, 4,234, 0, 2, 4,235, 0, 2, 4,236, 0,156, 0, 6, + 0, 7, 4,237, 0, 7, 4,238, 0, 7, 4,239, 0, 7, 4,240, 0, 4, 4,241, 0, 4, 4,242, 0,157, 0, 6, 0,157, 0, 0, + 0,157, 0, 1, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 4,243, 0, 2, 1,165, 0,158, 0, 8, 0,158, 0, 0, 0,158, 0, 1, + 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 4,243, 0, 2, 1,165, 0, 7, 0, 54, 0, 7, 0,189, 0,159, 0, 43, 0,159, 0, 0, + 0,159, 0, 1, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 4,243, 0, 2, 0,145, 0, 2, 2, 95, 0, 2, 4,244, 0, 7, 4,245, + 0, 7, 4,246, 0, 7, 1,227, 0, 4, 4,247, 0, 4, 0, 46, 0, 4, 1,215, 0, 7, 4,248, 0, 7, 4,249, 0, 7, 4,250, + 0, 7, 4,251, 0, 7, 4,252, 0, 7, 4,253, 0, 7, 1,225, 0, 7, 0,186, 0, 7, 4,254, 0, 7, 4,255, 0, 7, 5, 0, + 0, 7, 5, 1, 0, 2, 5, 2, 0, 2, 5, 3, 0, 2, 5, 4, 0, 2, 5, 5, 0, 2, 5, 6, 0, 2, 5, 7, 0, 2, 5, 8, + 0, 2, 5, 9, 0, 2, 5, 10, 0, 2, 5, 11, 0, 2, 1, 89, 0, 2, 5, 12, 0, 0, 5, 13, 0, 0, 5, 14, 0, 7, 0,144, + 0,160, 5, 15, 0, 50, 1, 52, 0,161, 0, 16, 0,161, 0, 0, 0,161, 0, 1, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 4,243, + 0, 2, 0,145, 0, 7, 1,220, 0, 7, 1,221, 0, 7, 1,222, 0, 7, 1,130, 0, 7, 1,223, 0, 7, 1,224, 0, 7, 5, 16, + 0, 7, 1,225, 0, 7, 1,226, 0, 7, 1,227, 0,162, 0, 5, 0, 2, 0, 31, 0, 2, 4,200, 0, 2, 0, 16, 0, 2, 5, 17, + 0, 24, 3,209, 0,126, 0, 3, 0, 4, 0, 33, 0, 4, 5, 18, 0,162, 0, 34, 0,163, 0, 12, 0,163, 0, 0, 0,163, 0, 1, + 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 2, 42, 0, 2, 1,103, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 5, 19, 0, 7, 5, 20, + 0, 24, 3,209, 0, 11, 5, 21, 0,164, 0, 11, 0,164, 0, 0, 0,164, 0, 1, 0, 0, 0, 36, 0, 2, 0, 31, 0, 2, 5, 22, + 0, 4, 5, 23, 0, 4, 5, 24, 0, 2, 0, 16, 0, 2, 0, 24, 0, 9, 5, 25, 0, 9, 5, 26, 0,165, 0, 5, 0, 0, 0, 36, + 0, 7, 0,204, 0, 7, 5, 27, 0, 4, 5, 28, 0, 4, 0, 24, 0,166, 0, 4, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 0, 71, + 0, 2, 1, 59, 0,167, 0, 4, 0, 0, 0, 36, 0, 48, 5, 29, 0, 7, 0,204, 0, 7, 0, 24, 0,168, 0, 6, 0, 2, 5, 30, + 0, 2, 5, 31, 0, 2, 0, 31, 0, 2, 5, 32, 0, 0, 5, 33, 0, 0, 5, 34, 0,169, 0, 5, 0, 4, 0, 31, 0, 4, 0, 24, + 0, 0, 0, 36, 0, 0, 5, 35, 0, 0, 5, 36, 0,170, 0, 6, 0, 0, 0, 36, 0, 0, 5, 37, 0, 2, 5, 38, 0, 2, 1,225, + 0, 2, 0,201, 0, 2, 1, 59, 0,171, 0, 5, 0, 0, 0, 36, 0, 7, 4,234, 0, 7, 2,140, 0, 2, 0, 16, 0, 2, 1,216, + 0,172, 0, 3, 0, 0, 0, 36, 0, 4, 1,215, 0, 4, 5, 39, 0,173, 0, 7, 0, 0, 0, 36, 0, 7, 2,140, 0, 0, 5, 40, + 0, 0, 5, 41, 0, 2, 0,201, 0, 2, 0, 71, 0, 4, 5, 42, 0,174, 0, 3, 0, 39, 5, 43, 0, 0, 5, 44, 0, 0, 5, 45, + 0,175, 0, 17, 0,175, 0, 0, 0,175, 0, 1, 0, 2, 0, 31, 0, 2, 5, 22, 0, 2, 0, 16, 0, 2, 5, 46, 0, 2, 5, 47, + 0, 2, 5, 48, 0, 2, 0, 71, 0, 2, 1, 59, 0, 0, 0, 36, 0, 9, 0, 34, 0,176, 5, 49, 0, 39, 0,200, 0, 2, 5, 50, + 0, 2, 5, 51, 0, 4, 0, 24, 0,177, 0, 10, 0, 0, 0, 36, 0, 2, 0, 31, 0, 2, 0, 24, 0, 4, 1,216, 0, 4, 5, 52, + 0, 4, 5, 53, 0, 4, 5, 54, 0, 4, 5, 55, 0, 4, 5, 56, 0, 4, 5, 57, 0,178, 0, 1, 0, 0, 5, 58, 0,179, 0, 1, + 0, 32, 3,193, 0,176, 0, 18, 0,176, 0, 0, 0,176, 0, 1, 0,176, 5, 59, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 5, 60, + 0, 2, 5, 48, 0, 2, 5, 22, 0, 2, 5, 61, 0, 2, 1, 59, 0, 2, 1, 48, 0, 0, 0, 36, 0, 9, 0, 34, 0,180, 5, 49, + 0,175, 5, 62, 0, 2, 5, 63, 0, 2, 5, 64, 0, 4, 5, 65, 0,181, 0, 3, 0, 4, 5, 66, 0, 4, 0, 24, 0, 39, 0,200, + 0,182, 0, 13, 0, 90, 5, 67, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 4,245, 0, 2, 4,246, 0, 0, 0, 36, 0, 2, 5, 68, + 0, 2, 5, 69, 0, 7, 5, 70, 0, 2, 5, 71, 0, 2, 0,101, 0, 2, 0,102, 0, 2, 5, 72, 0,183, 0, 9, 0, 2, 0, 16, + 0, 2, 5, 73, 0, 2, 4,245, 0, 2, 4,246, 0,152, 4,223, 0, 2, 0, 31, 0, 2, 5, 74, 0, 2, 5, 75, 0, 2, 5, 76, + 0,184, 0, 7, 0, 2, 0, 16, 0, 2, 5, 73, 0, 2, 4,245, 0, 2, 4,246, 0, 2, 0, 31, 0, 2, 5, 77, 0, 7, 5, 78, + 0,185, 0, 9, 0, 4, 5, 66, 0, 2, 0, 31, 0, 2, 0, 16, 0, 39, 0,200, 0, 66, 5, 79, 0, 0, 0, 36, 0, 7, 5, 80, + 0, 2, 5, 81, 0, 2, 0, 24, 0,186, 0, 5, 0, 2, 0, 31, 0, 2, 0, 16, 0, 4, 0, 24, 0,110, 4,145, 0, 39, 3, 56, + 0,187, 0, 5, 0, 4, 0, 16, 0, 4, 0, 31, 0, 0, 0, 36, 0, 0, 5, 35, 0, 39, 0,200, 0,188, 0, 12, 0, 4, 0, 16, + 0, 4, 0, 31, 0, 7, 5, 82, 0, 7, 5, 83, 0, 7, 0,195, 0, 7, 0,196, 0, 7, 2, 12, 0, 7, 2, 15, 0, 7, 5, 84, + 0, 7, 5, 85, 0, 7, 5, 86, 0, 0, 5, 87, 0,189, 0, 9, 0, 2, 0, 16, 0, 2, 0, 31, 0, 2, 4,245, 0, 2, 4,246, + 0, 0, 0, 36, 0, 2, 0, 71, 0, 2, 0, 26, 0, 2, 5, 88, 0, 2, 5, 89, 0,190, 0, 8, 0, 39, 0,200, 0, 7, 1,222, + 0, 7, 5, 90, 0, 7, 1,252, 0, 7, 5, 91, 0, 2, 0, 16, 0, 2, 1,216, 0, 7, 5, 92, 0,191, 0, 7, 0, 2, 0, 16, + 0, 2, 1,225, 0, 7, 5, 93, 0, 7, 5, 94, 0, 7, 5, 95, 0, 7, 5, 96, 0, 7, 5, 97, 0,192, 0, 10, 0, 2, 0, 16, + 0, 2, 0, 31, 0, 2, 4,245, 0, 2, 4,246, 0, 0, 0, 36, 0, 2, 0, 71, 0, 2, 0, 26, 0, 2, 5, 88, 0, 2, 5, 89, + 0, 50, 1, 52, 0,193, 0, 7, 0, 4, 1,215, 0, 4, 5, 98, 0, 4, 5, 99, 0, 4, 5,100, 0, 7, 5,101, 0, 7, 5,102, + 0, 0, 5, 40, 0,194, 0, 7, 0, 0, 5,103, 0, 39, 5,104, 0, 0, 5, 44, 0, 2, 5,105, 0, 2, 0, 71, 0, 4, 1, 59, + 0, 0, 5, 45, 0,195, 0, 6, 0, 2, 0, 16, 0, 2, 0, 31, 0, 2, 4,245, 0, 2, 4,246, 0, 0, 5,106, 0, 0, 5,107, + 0,196, 0, 1, 0, 4, 0, 16, 0,180, 0, 10, 0,180, 0, 0, 0,180, 0, 1, 0,180, 5, 59, 0, 2, 0, 31, 0, 2, 0, 16, + 0, 2, 5, 22, 0, 2, 5,108, 0, 0, 0, 36, 0, 9, 0, 34, 0, 39, 0,200, 0,197, 0, 10, 0, 7, 2, 35, 0, 7, 5,109, + 0, 7, 5,110, 0, 7, 5,111, 0, 7, 5,112, 0, 4, 0, 16, 0, 7, 5,113, 0, 7, 5,114, 0, 7, 5,115, 0, 7, 0, 24, + 0,152, 0, 22, 0, 24, 0, 18, 0, 0, 0, 83, 0,198, 5,116, 0, 9, 5,117, 0, 33, 0, 97, 0, 33, 5,118, 0, 9, 5,119, + 0, 27, 0, 44, 0, 7, 5, 78, 0, 7, 5,120, 0, 7, 5,121, 0, 7, 5,122, 0, 7, 5,123, 0, 7, 5,124, 0, 7, 5,125, + 0, 4, 0, 57, 0, 4, 5,126, 0, 4, 5,127, 0, 4, 5,128, 0, 0, 5,129, 0, 0, 5,130, 0, 0, 5,131, 0,199, 0, 6, + 0, 24, 0, 18, 0, 7, 5,132, 0, 7, 5,133, 0, 7, 5,134, 0, 2, 5,135, 0, 2, 5,136, 0,200, 0, 14, 0,114, 0, 0, + 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0,117, 3,142, 0,152, 4,223, 0, 2, 0,201, 0, 2, 5, 73, + 0, 2, 1,141, 0, 2, 1,142, 0, 2, 0, 16, 0, 2, 3,151, 0, 4, 1, 59, 0,201, 0, 6, 0,201, 0, 0, 0,201, 0, 1, + 0, 39, 0,200, 0, 9, 5,137, 0, 4, 0,149, 0, 4, 0, 24, 0, 50, 0, 2, 0, 24, 0, 18, 0, 11, 5,138, 0,202, 0, 25, + 0,202, 0, 0, 0,202, 0, 1, 0,202, 2, 4, 0, 11, 5,139, 0, 0, 0, 36, 0, 7, 5,140, 0, 7, 5,141, 0, 7, 5,142, + 0, 7, 5,143, 0, 4, 0, 16, 0, 7, 5,144, 0, 7, 5,145, 0, 7, 5,146, 0, 7, 0,204, 0, 7, 1, 97, 0, 7, 5,147, + 0, 7, 1,213, 0, 7, 5,148, 0, 7, 5,149, 0, 7, 5,150, 0, 7, 5,151, 0, 7, 5,152, 0, 7, 0,114, 0, 2, 5,153, + 0, 2, 3, 53, 0,203, 0, 9, 0, 24, 0, 18, 0, 11, 5,154, 0, 11, 5,155, 0, 4, 0, 16, 0, 4, 2,174, 0, 2, 1,228, + 0, 2, 5,153, 0, 2, 5,156, 0, 2, 5,157, 0,204, 0, 30, 0,204, 0, 0, 0,204, 0, 1, 0, 11, 2, 56, 0, 0, 0, 36, + 0, 2, 0, 16, 0, 2, 5,158, 0, 2, 5,159, 0, 2, 1,128, 0, 2, 2, 24, 0, 2, 0, 24, 0, 2, 0, 71, 0, 2, 1, 59, + 0,202, 5,160, 0,204, 2, 4, 0,204, 5,161, 0, 11, 5,162, 0, 9, 5,163, 0, 7, 0,195, 0, 7, 0,114, 0, 7, 1, 79, + 0, 7, 5,164, 0, 7, 5,165, 0, 7, 5,166, 0, 7, 5,167, 0, 7, 5,168, 0, 7, 5,169, 0, 7, 5,170, 0, 7, 5,171, + 0, 7, 1,125, 0, 39, 5,172, 0, 91, 0, 3, 0, 11, 5,173, 0, 4, 0, 16, 0, 7, 5,174, 0,205, 0, 7, 0,205, 0, 0, + 0,205, 0, 1, 0, 27, 0, 44, 0, 11, 2, 8, 0, 4, 0, 16, 0, 0, 0, 36, 0, 4, 0,101, 0, 90, 0, 2, 0, 24, 0, 18, + 0, 11, 5,173, 0,206, 0, 14, 0,114, 0, 0, 0,114, 0, 1, 0, 4, 3, 84, 0, 7, 3, 85, 0,115, 3, 86, 0, 2, 3, 87, + 0,117, 3,142, 0, 90, 2, 6, 0, 4, 0, 16, 0, 2, 3,148, 0, 2, 5,175, 0, 2, 3,151, 0, 2, 0, 24, 0, 7, 5,176, + 0,207, 0, 5, 0,207, 0, 0, 0,207, 0, 1, 0, 27, 0, 44, 0, 2, 0, 16, 0, 0, 5,177, 0,208, 0, 8, 0,208, 0, 0, + 0,208, 0, 1, 0, 9, 0, 34, 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 0,101, 0, 0, 5,177, 0, 7, 5,178, 0,209, 0, 11, + 0, 39, 5,179, 0, 7, 1,217, 0, 2, 5,180, 0, 2, 0, 16, 0, 4, 5,181, 0, 4, 0, 24, 0, 0, 5,182, 0, 7, 1, 97, + 0, 7, 5,183, 0, 7, 5,184, 0, 7, 1, 59, 0,210, 0, 4, 0, 39, 5,179, 0, 4, 0,101, 0, 4, 0,102, 0, 0, 5,182, + 0,211, 0, 4, 0, 39, 5,179, 0, 4, 0, 16, 0, 4, 0,101, 0, 0, 5,182, 0,212, 0, 4, 0, 39, 5,179, 0, 4, 0, 16, + 0, 4, 0,101, 0, 0, 5,182, 0,213, 0, 7, 0, 39, 5,179, 0, 4, 5,185, 0, 7, 0,188, 0, 2, 5,186, 0, 2, 5,187, + 0, 7, 5,188, 0, 0, 5,182, 0,214, 0, 9, 0, 39, 5,179, 0, 2, 0, 31, 0, 2, 5,189, 0, 2, 1,212, 0, 2, 4,246, + 0, 7, 5, 90, 0, 7, 1,252, 0, 90, 5, 67, 0, 0, 5,182, 0,215, 0, 4, 0, 39, 5,179, 0, 4, 2, 21, 0, 4, 5,190, + 0, 0, 5,182, 0,216, 0, 5, 0, 39, 5,179, 0, 7, 0,188, 0, 4, 5,191, 0, 4, 2, 21, 0, 4, 2, 22, 0,217, 0, 6, + 0, 39, 5,179, 0, 0, 5,182, 0, 7, 0, 71, 0, 7, 1, 59, 0, 7, 5,125, 0, 7, 5,192, 0,218, 0, 6, 0, 7, 0, 8, + 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 3, 6, 0, 7, 5,193, 0,219, 0, 6, 0, 39, 5,179, 0, 4, 5,194, + 0, 4, 5,195, 0, 7, 5,196, 0, 7, 5,197, 0, 0, 5,182, 0,220, 0, 20, 0,220, 0, 0, 0,220, 0, 1, 0, 2, 0, 16, + 0, 2, 0,201, 0, 2, 5,198, 0, 2, 0, 24, 0, 27, 0, 44, 0, 90, 5, 67, 0, 39, 0,107, 0, 7, 1,212, 0, 7, 4,246, + 0, 7, 5,199, 0, 7, 5,200, 0, 7, 5,201, 0, 7, 5,202, 0, 7, 5,203, 0, 7, 5,204, 0, 7, 5, 68, 0, 7, 5,205, + 0, 0, 5,206, 0,221, 0, 7, 0, 7, 1,104, 0, 7, 5, 90, 0, 7, 1,252, 0, 9, 0, 34, 0, 2, 5,207, 0, 2, 5,208, + 0, 4, 0, 71, 0,222, 0, 17, 0,222, 0, 0, 0,222, 0, 1, 0, 0, 0, 36, 0,221, 5,209, 0, 2, 0, 31, 0, 2, 0, 16, + 0, 2, 5,210, 0, 2, 5,211, 0, 2, 5,212, 0, 2, 5,213, 0, 4, 0, 71, 0, 7, 5,214, 0, 7, 5,215, 0, 4, 5,216, + 0, 4, 5,217, 0,222, 5,218, 0,223, 5,219, 0,224, 0, 29, 0,224, 0, 0, 0,224, 0, 1, 0,224, 5,220, 0, 0, 0, 36, + 0, 2, 0, 31, 0, 2, 0, 16, 0, 2, 4,201, 0, 2, 4,224, 0, 2, 5,221, 0, 2, 3,116, 0, 2, 5,211, 0, 2, 0, 24, + 0, 11, 5, 60, 0, 11, 5,222, 0, 24, 3,209, 0, 9, 5,223, 0,225, 5,224, 0, 7, 5,214, 0, 7, 5,215, 0, 7, 1,130, + 0, 7, 5,225, 0, 2, 5,226, 0, 2, 5,227, 0, 4, 0, 71, 0, 23, 5,228, 0, 23, 5,229, 0, 23, 5,230, 0,226, 5,231, + 0,227, 5,232, 0,223, 0, 6, 0,223, 0, 0, 0,223, 0, 1, 0,224, 5,233, 0,224, 5,234, 0,222, 5,235, 0,222, 5,218, + 0, 49, 0, 11, 0, 24, 0, 18, 0, 11, 5,236, 0, 11, 5,237, 0,221, 5,238, 0,221, 5,239, 0, 4, 0, 31, 0, 4, 5,240, + 0, 4, 5,241, 0, 4, 0, 24, 0,227, 5,242, 0,227, 5,243, 0,228, 0, 4, 0, 7, 0, 4, 0, 7, 0, 5, 0, 2, 0, 16, + 0, 2, 5,244, 0,229, 0, 7, 0, 2, 2, 81, 0, 2, 0, 16, 0, 7, 2,140, 0, 7, 5,245, 0, 7, 5,246, 0,228, 5,247, + 0,228, 5,248, 0,128, 0, 9, 0, 4, 0, 16, 0, 4, 0, 26, 0, 23, 5,249, 0, 23, 5,250, 0,229, 5,251, 0, 7, 5,252, + 0, 7, 5,253, 0, 7, 5,254, 0, 7, 5,202, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index a632eb6661e..043128673aa 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -46,14 +46,12 @@ #include #endif #include "MEM_guardedalloc.h" + #include "BLI_arithb.h" +#include "BLI_blenlib.h" #include "MTC_matrixops.h" -#include "render.h" -#include "mydevice.h" - -#include "DNA_group_types.h" #include "DNA_texture_types.h" #include "DNA_world_types.h" #include "DNA_camera_types.h" @@ -63,12 +61,15 @@ #include "DNA_object_types.h" #include "DNA_lamp_types.h" #include "DNA_space_types.h" +#include "DNA_view3d_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "BKE_global.h" #include "BKE_image.h" #include "BKE_icons.h" +#include "BKE_library.h" +#include "BKE_main.h" #include "BKE_texture.h" #include "BKE_material.h" #include "BKE_node.h" @@ -81,6 +82,7 @@ #include "BSE_headerbuttons.h" #include "BSE_node.h" +#include "BSE_view.h" #include "BIF_gl.h" #include "BIF_screen.h" @@ -94,194 +96,30 @@ #include "PIL_time.h" -#include "RE_renderconverter.h" +#include "RE_pipeline.h" +#include "BLO_readfile.h" #include "blendef.h" /* CLAMP */ -#include "interface.h" /* ui_graphics_to_window() SOLVE! (ton) */ +#include "interface.h" /* ui_graphics_to_window(), SOLVE! (ton) */ +#include "mydevice.h" + #define PR_XMIN 10 #define PR_YMIN 5 #define PR_XMAX 200 #define PR_YMAX 195 -#define PR_FACY (PR_YMAX-PR_YMIN-4)/(PR_RECTY) - -static rctf prerect; -static float pr_facx, pr_facy; - - -/* implementation */ - -static short intersect(float *v1, float *v2, float *v3, float *rtlabda, float *ray1, float *ray2) -{ - float x0,x1,x2,t00,t01,t02,t10,t11,t12,t20,t21,t22; - float m0,m1,m2,deeldet,det1,det2,det3; - float rtu, rtv; - - t00= v3[0]-v1[0]; - t01= v3[1]-v1[1]; - t02= v3[2]-v1[2]; - t10= v3[0]-v2[0]; - t11= v3[1]-v2[1]; - t12= v3[2]-v2[2]; - t20= ray1[0]-ray2[0]; - t21= ray1[1]-ray2[1]; - t22= ray1[2]-ray2[2]; - - x0= t11*t22-t12*t21; - x1= t12*t20-t10*t22; - x2= t10*t21-t11*t20; - - deeldet= t00*x0+t01*x1+t02*x2; - if(deeldet!=0.0f) { - m0= ray1[0]-v3[0]; - m1= ray1[1]-v3[1]; - m2= ray1[2]-v3[2]; - det1= m0*x0+m1*x1+m2*x2; - rtu= det1/deeldet; - if(rtu<=0.0f) { - det2= t00*(m1*t22-m2*t21); - det2+= t01*(m2*t20-m0*t22); - det2+= t02*(m0*t21-m1*t20); - rtv= det2/deeldet; - if(rtv<=0.0f) { - if(rtu+rtv>= -1.0f) { - - det3= m0*(t12*t01-t11*t02); - det3+= m1*(t10*t02-t12*t00); - det3+= m2*(t11*t00-t10*t01); - *rtlabda= det3/deeldet; - - if(*rtlabda>=0.0f && *rtlabda<=1.0f) { - return 1; - } - } - } - } - } - return 0; -} - -static float rcubev[7][3]= { - {-0.002055, 6.627364, -3.369742}, - {-6.031684, -3.750204, -1.992980}, - {-6.049086, 3.817431, 1.969788}, - { 6.031685, 3.833064, 1.992979}, - { 6.049086, -3.734571, -1.969787}, - { 0.002054, -6.544502, 3.369744}, - {-0.015348, 1.023131, 7.332510} }; - -static int rcubi[3][4]= { - {3, 6, 5, 4}, - {1, 5, 6, 2}, - {3, 0, 2, 6} }; - - -static int ray_previewrender(int x, int y, float *vec, float *vn, short pr_rectx, short pr_recty) -{ - /* float scalef= 10.0/100.0; - not fixed any more because of different render sizes */ - float scalef= ( 64.0f / (float)pr_rectx ) * 0.25f; - float ray1[3], ray2[3]; - float minlabda, labda; - int totface= 3, hitface= -1; - int a; - - ray1[0]= ray2[0]= x*scalef; - ray1[1]= ray2[1]= y*scalef; - ray1[2]= -10.0f; - ray2[2]= 10.0f; - - minlabda= 1.0f; - for(a=0; a -1) { - - CalcNormFloat(rcubev[rcubi[hitface][2]], rcubev[rcubi[hitface][1]], rcubev[rcubi[hitface][0]], vn); - - vec[0]= (minlabda*(ray1[0]-ray2[0])+ray2[0])/4.1; - vec[1]= (minlabda*(ray1[1]-ray2[1])+ray2[1])/4.1; - vec[2]= (minlabda*(ray1[2]-ray2[2])+ray2[2])/4.1; - - return 1; - } - return 0; -} - -static unsigned int previewback(int type, int x, int y) -{ - unsigned int col; - char* pcol; - - /* checkerboard, for later - x+= PR_RECTX/2; - y+= PR_RECTX/2; - if( ((x/24) + (y/24)) & 1) return 0x40404040; - else return 0xa0a0a0a0; - */ - - if(type & MA_DARK) { - if(abs(x)>abs(y)) col= 0; - else col= 0x40404040; - } - else { - if(abs(x)>abs(y)) col= 0x40404040; - else col= 0xa0a0a0a0; - } - pcol = (char*) &col; - pcol[3] = 0; /* set alpha to zero - endianess!*/ - - return col; -} - -static float previewbackf(int type, int x, int y) -{ - float col; - - if(type & MA_DARK) { - if(abs(x)>abs(y)) col= 0.0f; - else col= 0.25f; - } - else { - if(abs(x)>abs(y)) col= 0.25f; - else col= 0.625f; - } - return col; -} -void set_previewrect(int win, int xmin, int ymin, int xmax, int ymax, short pr_rectx, short pr_recty) +void set_previewrect(RenderInfo *ri, int win) { - float pr_sizex, pr_sizey; + rctf viewplane; - prerect.xmin= xmin; - prerect.ymin= ymin; - prerect.xmax= xmax; - prerect.ymax= ymax; + BLI_init_rctf(&viewplane, PR_XMIN, PR_XMAX, PR_YMIN, PR_YMAX); - ui_graphics_to_window(win, &prerect.xmin, &prerect.ymin); - ui_graphics_to_window(win, &prerect.xmax, &prerect.ymax); + ui_graphics_to_window_rct(win, &viewplane, &ri->disprect); - pr_sizex= (prerect.xmax-prerect.xmin); - pr_sizey= (prerect.ymax-prerect.ymin); - - pr_facx= ( pr_sizex-1.0f)/pr_rectx; - pr_facy= ( pr_sizey-1.0f)/pr_recty; - /* correction for gla draw */ - prerect.xmin-= curarea->winrct.xmin; - prerect.ymin-= curarea->winrct.ymin; + BLI_translate_rcti(&ri->disprect, -curarea->winrct.xmin, -curarea->winrct.ymin); glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -290,8 +128,8 @@ void set_previewrect(int win, int xmin, int ymin, int xmax, int ymax, short pr_r glaDefine2DArea(&curarea->winrct); - glPixelZoom(pr_facx, pr_facy); - + ri->pr_rectx= (ri->disprect.xmax-ri->disprect.xmin); + ri->pr_recty= (ri->disprect.ymax-ri->disprect.ymin); } static void end_previewrect(void) @@ -301,31 +139,14 @@ static void end_previewrect(void) glMatrixMode(GL_MODELVIEW); glPopMatrix(); - glPixelZoom(1.0f, 1.0f); - // restore viewport / scissor which was set by glaDefine2DArea glViewport(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx, curarea->winy); glScissor(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx, curarea->winy); } -static void display_pr_scanline(unsigned int *rect, int recty, short pr_rectx) -{ - - /* we do steps of 4 scanlines. but draw 5, because of errors in some gfx cards (nvidia geforce, ati...) */ - if( (recty & 3)==3) { - - if(recty == 3) { - glaDrawPixelsSafe(prerect.xmin, prerect.ymin, pr_rectx, 4, GL_RGBA, GL_UNSIGNED_BYTE, rect); - } - else { - rect+= (recty-4)*pr_rectx; - glaDrawPixelsSafe(prerect.xmin, prerect.ymin + (((float)recty-4.0)*pr_facy), pr_rectx, 5, GL_RGBA, GL_UNSIGNED_BYTE, rect); - } - } -} - -static void draw_tex_crop(Tex *tex) +/* unused now */ +void draw_tex_crop(Tex *tex) { rcti rct; int ret= 0; @@ -391,1085 +212,191 @@ void BIF_preview_changed(short id_code) snode_tag_dirty(snode); } } - } -} - -static void previewdraw_render(struct RenderInfo* ri, ScrArea* area) -{ - int y; - - if (!ri) { - return; - } - - for (y=0; ypr_recty; y++) { - display_pr_scanline(ri->rect, y, ri->pr_rectx); - } -} - - -static void sky_preview_pixel(float lens, int x, int y, char *rect, short pr_rectx, short pr_recty) -{ - float view[3]; - - if(R.wrld.skytype & WO_SKYPAPER) { - view[0]= (2*x)/(float)pr_rectx; - view[1]= (2*y)/(float)pr_recty; - view[2]= 0.0f; - } - else { - view[0]= x; - view[1]= y; - view[2]= -lens*pr_rectx/32.0; - Normalise(view); - } - RE_sky_char(view, rect); - rect[3] = 0xFF; -} - - static void init_preview_world(World* wrld) - { - int a; - char *cp; - - if(wrld) { - R.wrld= *(wrld); - - cp= (char *)&R.wrld.fastcol; - - cp[0]= 255.0*R.wrld.horr; - cp[1]= 255.0*R.wrld.horg; - cp[2]= 255.0*R.wrld.horb; - cp[3]= 1; - - VECCOPY(R.grvec, R.viewmat[2]); - Normalise(R.grvec); - Mat3CpyMat4(R.imat, R.viewinv); - - for(a=0; atex) R.wrld.skytype |= WO_SKYTEX; - - while(R.wrld.aosamp*R.wrld.aosamp < R.osa) R.wrld.aosamp++; - } - else { - memset(&R.wrld, 0, sizeof(World)); - R.wrld.exp= 0.0; - R.wrld.range= 1.0; - } - - R.wrld.linfac= 1.0 + pow((2.0*R.wrld.exp + 0.5), -10); - R.wrld.logfac= log( (R.wrld.linfac-1.0)/R.wrld.linfac )/R.wrld.range; -} - - /* This function carefully copies over the struct members - from the struct Lamp to a new struct LampRen. - It only copies the struct members that are needed - in the lamp_preview_pixel function. - Replacement for the RE_add_render_lamp function in - the preview, because this only works for the - current selected lamp. - */ -static LampRen* create_preview_render_lamp(Lamp* la) -{ - LampRen *lar; - int c; - - lar= (LampRen *)MEM_callocN(sizeof(LampRen),"lampren"); - - MTC_Mat3One(lar->mat); - MTC_Mat3One(lar->imat); - - lar->type= la->type; - lar->mode= la->mode; - lar->energy= la->energy; - if(la->mode & LA_NEG) lar->energy= -lar->energy; - lar->r= lar->energy*la->r; - lar->g= lar->energy*la->g; - lar->b= lar->energy*la->b; - lar->k= la->k; - lar->dist= la->dist; - lar->ld1= la->att1; - lar->ld2= la->att2; - - /* exceptions: */ - lar->spottexfac= 1.0; - lar->spotsi= cos( M_PI/3.0 ); - lar->spotbl= (1.0-lar->spotsi)*la->spotblend; - - MTC_Mat3One(lar->imat); - - if(lar->type==LA_SPOT) { - if(lar->mode & LA_ONLYSHADOW) { - if((lar->mode & (LA_SHAD|LA_SHAD_RAY))==0) lar->mode -= LA_ONLYSHADOW; - } - } - memcpy(lar->mtex, la->mtex, MAX_MTEX*sizeof(void *)); - - for(c=0; cmtex[c] && la->mtex[c]->tex) { - lar->mode |= LA_TEXTURE; - - if(R.flag & R_RENDERING) { - if(R.osa) { - if(la->mtex[c]->tex->type==TEX_IMAGE) lar->mode |= LA_OSATEX; - } - } - } - } - - return lar; -} - -static void lamp_preview_pixel(ShadeInput *shi, LampRen *la, int x, int y, char *rect, short pr_rectx, short pr_recty) -{ - float inpr, i, t, dist, distkw, vec[3], lacol[3]; - int col; - - shi->co[0]= (float)x/(pr_rectx/4); - shi->co[1]= (float)y/(pr_rectx/4); - shi->co[2]= 0; - - vec[0]= 0.02f*x; - vec[1]= 0.02f*y; - vec[2]= 0.005f*pr_rectx; - VECCOPY(shi->view, vec); - dist= Normalise(shi->view); - - lacol[0]= la->r; - lacol[1]= la->g; - lacol[2]= la->b; - - if(la->mode & LA_TEXTURE) do_lamp_tex(la, vec, shi, lacol); - - if(la->type==LA_SUN || la->type==LA_HEMI) { - dist= 1.0f; - } - else { - - if(la->mode & LA_QUAD) { - - t= 1.0f; - if(la->ld1>0.0f) - t= la->dist/(la->dist+la->ld1*dist); - if(la->ld2>0.0f) { - distkw= la->dist*la->dist; - t= t*distkw/(t*distkw+la->ld2*dist*dist); + else if(sa->spacetype==SPACE_VIEW3D) { + View3D *vd= sa->spacedata.first; + /* if is has a renderinfo, we consider that reason for signalling */ + if (vd->ri) { + vd->ri->cury= 0; + addafterqueue(sa->win, RENDERPREVIEW, 1); } - dist= t; - } - else { - dist= (la->dist/(la->dist+dist)); } } - - /* yafray: preview shade as spot, sufficient */ - if ((la->type==LA_SPOT) || (la->type==LA_YF_PHOTON)) { - - - if(la->mode & LA_SQUARE) { - /* slightly smaller... */ - inpr= 1.7*cos(MAX2(fabs(shi->view[0]/shi->view[2]) , fabs(shi->view[1]/shi->view[2]) )); - } - else { - inpr= shi->view[2]; - } - - t= la->spotsi; - if(inprspotbl && la->spotbl!=0.0f) { - /* soft area */ - i= t/la->spotbl; - t= i*i; - i= t*i; - inpr*=(3.0*t-2.0*i); - } - } - dist*=inpr; - } - else if ELEM(la->type, LA_LOCAL, LA_AREA) dist*= shi->view[2]; - - col= 255.0*dist*lacol[0]; - if(col<=0) rect[0]= 0; else if(col>=255) rect[0]= 255; else rect[0]= col; - - col= 255.0*dist*lacol[1]; - if(col<=0) rect[1]= 0; else if(col>=255) rect[1]= 255; else rect[1]= col; - - col= 255.0*dist*lacol[2]; - if(col<=0) rect[2]= 0; else if(col>=255) rect[2]= 255; else rect[2]= col; - - rect[3] = 0xFF; } -static void init_previewhalo(HaloRen *har, Material *mat, short pr_rectx, short pr_recty) -{ - - har->type= 0; - if(mat->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA; - har->mat= mat; - har->hard= mat->har; - har->rad= pr_rectx/2.0; - har->radsq= pr_rectx*pr_rectx/4.0; - har->alfa= mat->alpha; - har->add= 255.0*mat->add; - har->r= mat->r; - har->g= mat->g; - har->b= mat->b; - har->xs= pr_rectx/2.0; - har->ys= pr_rectx/2.0; - har->zs= har->zd= 0; - har->seed= (mat->seed1 % 256); - - if( (mat->mode & MA_HALOTEX) && mat->mtex[0] ) har->tex= 1; else har->tex=0; +/* *************************** Preview for buttons *********************** */ - if(mat->mode & MA_STAR) har->starpoints= mat->starc; else har->starpoints= 0; - if(mat->mode & MA_HALO_LINES) har->linec= mat->linec; else har->linec= 0; - if(mat->mode & MA_HALO_RINGS) har->ringc= mat->ringc; else har->ringc= 0; - if(mat->mode & MA_HALO_FLARE) har->flarec= mat->flarec; else har->flarec= 0; - - if(har->flarec) { - har->xs-= pr_rectx/3; - har->ys+= pr_rectx/3; - - har->rad*= 0.3; - har->radsq= har->rad*har->rad; - - har->pixels= har->rad*har->rad*har->rad; - } -} +static Main *pr_main= NULL; -static void halo_preview_pixel(HaloRen *har, int startx, int endx, int y, char *rect, short pr_rectx) +void BIF_preview_init_dbase(void) { - float dist, xn, yn, xsq, ysq, colf[4]; - int x; - char front[4]; + BlendReadError bre; + BlendFileData *bfd; + extern int datatoc_preview_blend_size; + extern char datatoc_preview_blend[]; - if(har->flarec) yn= y-pr_rectx/3; - else yn= y; - ysq= yn*yn; - - for(x=startx; xflarec) xn= x+pr_rectx/3; - else xn= x; + G.fileflags |= G_FILE_NO_UI; + bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, &bre); + if (bfd) { + pr_main= bfd->main; - xsq= xn*xn; - dist= xsq+ysq; - - if(distradsq) { - RE_shadehalo(har, front, colf, 0, dist, xn, yn, har->flarec); - RE_addalphaAddfac(rect, front, har->add); - rect[3] = 0xFF; /* makes icon display all pixels */ - } - rect+= 4; + MEM_freeN(bfd); } + G.fileflags &= ~G_FILE_NO_UI; } -static void previewflare(RenderInfo *ri, HaloRen *har, short pr_rectx, short pr_recty, int pr_method) +void BIF_preview_free_dbase(void) { - float ycor; - unsigned int *rectot; - int afmx, afmy, rectx, recty, y; - - /* check for "Preview" block already in calling function BIF_previewrender! - elubie */ - - /* temps */ - ycor= R.ycor; - rectx= R.rectx; - recty= R.recty; - afmx= R.afmx; - afmy= R.afmy; - rectot= R.rectot; - - R.r.postmul= R.r.postgamma= R.r.postsat= 1.0f; - R.r.posthue= R.r.postadd= 0.0f; - R.ycor= 1.0f; - R.rectx= pr_rectx; - R.recty= pr_recty; - R.afmx= pr_rectx/2; - R.afmy= pr_recty/2; - R.rectot= ri->rect; - - waitcursor(1); - RE_renderflare(har); - waitcursor(0); - // not sure why, either waitcursor or renderflare screws up (disabled then) - //areawinset(curarea->win); - - /* draw can just be called this way, all settings are OK */ - if (pr_method==PR_DRAW_RENDER) { - for (y=0; yrect, y, pr_rectx); - } - } - - /* temps */ - R.ycor= ycor; - R.rectx= rectx; - R.recty= recty; - R.afmx= afmx; - R.afmy= afmy; - R.rectot= rectot; + if(pr_main) + free_main(pr_main); } -static void texture_preview_pixel(Tex *tex, int x, int y, char *rect, short pr_rectx, short pr_recty) +static Scene *preview_prepare_scene(RenderInfo *ri, ID *id, int pr_method) { - float i, v1, xsq, ysq, texvec[3]; - float tin=1.0f, tr, tg, tb, ta; - int rgbnor, tracol, skip=0; + Scene *sce; + Base *base; - if(tex->type==TEX_IMAGE) { - v1= 1.0f/pr_rectx; - - texvec[0]= 0.5+v1*x; - texvec[1]= 0.5+v1*y; - - /* no coordinate mapping, exception: repeat */ - if(tex->extend==TEX_REPEAT) { - if(tex->xrepeat>1) { - texvec[0] *= tex->xrepeat; - if(texvec[0]>1.0f) texvec[0] -= (int)(texvec[0]); - } - if(tex->yrepeat>1) { - texvec[1] *= tex->yrepeat; - if(texvec[1]>1.0f) texvec[1] -= (int)(texvec[1]); - } - } - else if(tex->extend==TEX_CHECKER) { - texvec[0]= 0.5+1.6*v1*x; - texvec[1]= 0.5+1.6*v1*y; - } - } - else if(tex->type==TEX_ENVMAP) { - if(tex->env) { - ysq= y*y; - xsq= x*x; - if(xsq+ysq < (pr_rectx/2)*(pr_recty/2)) { - texvec[2]= sqrt( (float)((pr_rectx/2)*(pr_recty/2)-xsq-ysq) ); - texvec[0]= -x; - texvec[1]= -y; - Normalise(texvec); - - i= 2.0*(texvec[2]); - texvec[0]= (i*texvec[0]); - texvec[1]= (i*texvec[1]); - texvec[2]= (-1.0f+i*texvec[2]); - + if(pr_main==NULL) return NULL; + + sce= pr_main->scene.first; + if(sce) { + if(GS(id->name)==ID_MA) { + Material *mat= (Material *)id; + + if(pr_method==PR_ICON_RENDER) { + sce->lay= 1<lay= 1<pr_type; + if(mat->nodetree) + ntreeInitPreview(mat->nodetree, ri->pr_rectx, ri->pr_recty); } - } - else { - skip= 1; - tr= tg= tb= ta= 0.0f; - } - } - else { - v1= 2.0/pr_rectx; - - texvec[0]= v1*x; - texvec[1]= v1*y; - texvec[2]= 0.0f; - } - - if(skip==0) rgbnor= multitex_ext(tex, texvec, &tin, &tr, &tg, &tb, &ta); - else rgbnor= 1; - - if(rgbnor & 1) { - - v1= 255.0*tr; - rect[0]= CLAMPIS(v1, 0, 255); - v1= 255.0*tg; - rect[1]= CLAMPIS(v1, 0, 255); - v1= 255.0*tb; - rect[2]= CLAMPIS(v1, 0, 255); - - if(ta!=1.0f) { - tracol= 64+100*(abs(x)>abs(y)); - tracol= (1.0f-ta)*tracol; - rect[0]= tracol+ (rect[0]*ta) ; - rect[1]= tracol+ (rect[1]*ta) ; - rect[2]= tracol+ (rect[2]*ta) ; - + for(base= sce->base.first; base; base= base->next) { + if(base->object->id.name[2]=='p') { + if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) + assign_material(base->object, mat, base->object->actcol); + } + } } - - rect[3] = 0xFF; - } - else { - rect[0]= 255.0*tin; - rect[1]= 255.0*tin; - rect[2]= 255.0*tin; - rect[3] = 0xFF; + return sce; } -} - -static float pr1_lamp[3]= {2.3, -2.4, -4.6}; /* note; is not used! */ -static float pr2_lamp[3]= {-8.8, -5.6, -1.5}; -static float pr1_col[3]= {0.8, 0.8, 0.8}; -static float pr2_col[3]= {0.5, 0.6, 0.7}; - -static void refraction_prv(int *x, int *y, float *n, float index) -{ - float dot, fac, view[3], len; - - index= 1.0f/index; - - view[0]= index*(float)*x; - view[1]= ((float)*y)/index; - view[2]= 20.0f; - len= Normalise(view); - dot= view[0]*n[0] + view[1]*n[1] + view[2]*n[2]; - - if(dot>0.0f) { - fac= 1.0f - (1.0f - dot*dot)*index*index; - if(fac<= 0.0f) return; - fac= -dot*index + sqrt(fac); - } - else { - index = 1.0f/index; - fac= 1.0f - (1.0f - dot*dot)*index*index; - if(fac<= 0.0f) return; - fac= -dot*index - sqrt(fac); - } - - *x= (int)(len*(index*view[0] + fac*n[0])); - *y= (int)(len*(index*view[1] + fac*n[1])); + return NULL; } -static void shade_lamp_loop_preview(ShadeInput *shi, ShadeResult *shr) +/* prevent pointer from being 'hanging' in preview dbase */ +static void preview_exit_scene(RenderInfo *ri, ID *id) { - extern float fresnel_fac(float *view, float *vn, float ior, float fac); - Material *mat= shi->mat; - float inp, is, inprspec=0; - float lv[3], *la, *vn, vnor[3]; - int a; - - if((mat->mode & MA_RAYMIRROR)==0) shi->ray_mirror= 0.0f; - memset(shr, 0, sizeof(ShadeResult)); - - do_material_tex(shi); - - shr->alpha= shi->alpha; - - if(mat->mode & (MA_ZTRA|MA_RAYTRANSP)) - if(mat->fresnel_tra!=0.0f) - shr->alpha*= fresnel_fac(shi->view, shi->vn, mat->fresnel_tra_i, mat->fresnel_tra); - - if(mat->mode & MA_SHLESS) { - shr->diff[0]= shi->r; - shr->diff[1]= shi->g; - shr->diff[2]= shi->b; - - } - else { - - if(mat->texco & TEXCO_REFL) { - inp= -2.0*(shi->vn[0]*shi->view[0]+shi->vn[1]*shi->view[1]+shi->vn[2]*shi->view[2]); - shi->ref[0]= (shi->view[0]+inp*shi->vn[0]); - shi->ref[1]= (shi->view[1]+inp*shi->vn[1]); - shi->ref[2]= (shi->view[2]+inp*shi->vn[2]); - /* normals in render are pointing different... rhm */ -// if(shi->pr_type==MA_SPHERE) -// shi->ref[1]= -shi->ref[1]; - } - - for(a=0; a<2; a++) { - - if((mat->pr_lamp & (1<co[0]-la[0]; - lv[1]= shi->co[1]-la[1]; - lv[2]= shi->co[2]-la[2]; - Normalise(lv); - - if(shi->spec>0.0f) { - /* specular shaders */ - float specfac; - - if(mat->mode & MA_TANGENT_V) vn= shi->tang; - else vn= shi->vn; - - if(mat->spec_shader==MA_SPEC_PHONG) - specfac= Phong_Spec(vn, lv, shi->view, shi->har, mat->mode & MA_TANGENT_V); - else if(mat->spec_shader==MA_SPEC_COOKTORR) - specfac= CookTorr_Spec(vn, lv, shi->view, shi->har, mat->mode & MA_TANGENT_V); - else if(mat->spec_shader==MA_SPEC_BLINN) - specfac= Blinn_Spec(vn, lv, shi->view, mat->refrac, (float)shi->har, mat->mode & MA_TANGENT_V); - else if(mat->spec_shader==MA_SPEC_WARDISO) - specfac= WardIso_Spec(vn, lv, shi->view, mat->rms, mat->mode & MA_TANGENT_V); - else - specfac= Toon_Spec(vn, lv, shi->view, mat->param[2], mat->param[3], mat->mode & MA_TANGENT_V); - - inprspec= specfac*shi->spec; - - if(mat->mode & MA_RAMP_SPEC) { - float spec[3]; - do_specular_ramp(shi, specfac, inprspec, spec); - shr->spec[0]+= inprspec*spec[0]; - shr->spec[1]+= inprspec*spec[1]; - shr->spec[2]+= inprspec*spec[2]; + Scene *sce; + Base *base; + + if(pr_main==NULL) return; + + sce= pr_main->scene.first; + if(sce) { + if(GS(id->name)==ID_MA) { + for(base= sce->base.first; base; base= base->next) { + if(base->object->id.name[2]=='p') { + if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) + assign_material(base->object, NULL, base->object->actcol); } - else { - shr->spec[0]+= inprspec*shi->specr; - shr->spec[1]+= inprspec*shi->specg; - shr->spec[2]+= inprspec*shi->specb; - } - } - - if(mat->mode & MA_TANGENT_V) { - float cross[3]; - Crossf(cross, lv, shi->tang); - Crossf(vnor, cross, shi->tang); - vnor[0]= -vnor[0];vnor[1]= -vnor[1];vnor[2]= -vnor[2]; - vn= vnor; } - else vn= shi->vn; - - is= vn[0]*lv[0]+vn[1]*lv[1]+vn[2]*lv[2]; - if(is<0.0f) is= 0.0f; - - /* diffuse shaders */ - if(mat->diff_shader==MA_DIFF_ORENNAYAR) is= OrenNayar_Diff(vn, lv, shi->view, mat->roughness); - else if(mat->diff_shader==MA_DIFF_TOON) is= Toon_Diff(vn, lv, shi->view, mat->param[0], mat->param[1]); - else if(mat->diff_shader==MA_DIFF_MINNAERT) is= Minnaert_Diff(is, vn, shi->view, mat->darkness); - else if(mat->diff_shader==MA_DIFF_FRESNEL) is= Fresnel_Diff(vn, lv, shi->view, mat->param[0], mat->param[1]); - // else Lambert - - inp= (shi->refl*is + shi->emit); - - if(a==0) la= pr1_col; - else la= pr2_col; - - add_to_diffuse(shr->diff, shi, is, inp*la[0], inp*la[1], inp*la[2]); - } - /* end lamp loop */ - - /* drawing checkerboard and sky */ - if(mat->mode & MA_RAYMIRROR) { - float col, div, y, z; - int fac; - - /* rotate a bit in x */ - y= shi->ref[1]; z= shi->ref[2]; - shi->ref[1]= 0.98*y - 0.17*z; - shi->ref[2]= 0.17*y + 0.98*z; - - /* scale */ - div= (0.85f*shi->ref[1]); - - shi->refcol[0]= shi->ray_mirror*fresnel_fac(shi->view, shi->vn, mat->fresnel_mir_i, mat->fresnel_mir); - /* not real 'alpha', but mirror overriding transparency */ - if(mat->mode & MA_RAYTRANSP) { - float fac= sqrt(shi->refcol[0]); - shr->alpha= shr->alpha*(1.0f-fac) + fac; - } - else shr->alpha= shr->alpha*(1.0f-shi->refcol[0]) + shi->refcol[0]; - - if(div<0.0f) { - /* minus 0.5 prevents too many small tiles in distance */ - fac= (int)(shi->ref[0]/(div-0.1f) ) + (int)(shi->ref[2]/(div-0.1f) ); - if(fac & 1) col= 0.8f; - else col= 0.3f; - - shi->refcol[1]= shi->refcol[0]*col; - shi->refcol[2]= shi->refcol[1]; - shi->refcol[3]= shi->refcol[2]; - } - else { - shi->refcol[1]= 0.0f; - shi->refcol[2]= shi->refcol[0]*0.3f*div; - shi->refcol[3]= shi->refcol[0]*0.8f*div; - } - } - else - shi->refcol[0]= 0.0f; - - shr->diff[0]+= shi->ambr; - shr->diff[1]+= shi->ambg; - shr->diff[2]+= shi->ambb; - - if(mat->mode & MA_RAMP_COL) ramp_diffuse_result(shr->diff, shi); - if(mat->mode & MA_RAMP_SPEC) ramp_spec_result(shr->spec, shr->spec+1, shr->spec+2, shi); - - /* refcol */ - if(shi->refcol[0]!=0.0f) { - shr->diff[0]= shi->mirr*shi->refcol[1] + (1.0f - shi->mirr*shi->refcol[0])*shr->diff[0]; - shr->diff[1]= shi->mirg*shi->refcol[2] + (1.0f - shi->mirg*shi->refcol[0])*shr->diff[1]; - shr->diff[2]= shi->mirb*shi->refcol[3] + (1.0f - shi->mirb*shi->refcol[0])*shr->diff[2]; - } - - /* ztra shade */ - if(shi->spectra!=0.0f) { - inp = MAX3(shr->spec[0], shr->spec[1], shr->spec[2]); - inp *= shi->spectra; - if(inp>1.0f) inp= 1.0f; - shr->alpha= (1.0f-inp)*shr->alpha+inp; } } } -static void shade_preview_pixel(ShadeInput *shi, float *vec, int x, int y, char *rect, short pr_rectx, short pr_recty) +static void previewrender_progress(RenderResult *rr, rcti *unused) { - Material *mat; - ShadeResult shr; - float v1; - float eul[3], tmat[3][3], imat[3][3], col[4]; - - mat= shi->mat; - - v1= 0.5/pr_rectx; - shi->view[0]= v1*x; - shi->view[1]= v1*y; - shi->view[2]= -1.0f; - Normalise(shi->view); + RenderLayer *rl; + RenderInfo *ri= G.buts->ri; + float ofsx, ofsy; - shi->xs= x + pr_rectx/2; - shi->ys= y + pr_recty/2; + rl= rr->layers.first; - shi->refcol[0]= shi->refcol[1]= shi->refcol[2]= shi->refcol[3]= 0.0f; - VECCOPY(shi->co, vec); + ofsx= ri->disprect.xmin + rr->tilerect.xmin; + ofsy= ri->disprect.ymin + rr->tilerect.ymin; - /* texture handling */ - if(mat->texco) { - - VECCOPY(shi->lo, vec); - - if(mat->pr_type==MA_CUBE) { - - eul[0]= (297)*M_PI/180.0; - eul[1]= 0.0; - eul[2]= (45)*M_PI/180.0; - EulToMat3(eul, tmat); - - MTC_Mat3MulVecfl(tmat, shi->lo); - MTC_Mat3MulVecfl(tmat, shi->vn); - /* hack for cubemap, why!!! */ - SWAP(float, shi->vn[0], shi->vn[1]); - } - /* textures otherwise upside down */ - if(mat->pr_type==MA_CUBE || mat->pr_type==MA_SPHERE) - shi->lo[2]= -shi->lo[2]; - - if(mat->texco & TEXCO_GLOB) { - VECCOPY(shi->gl, shi->lo); - } - if(mat->texco & TEXCO_WINDOW) { - VECCOPY(shi->winco, shi->lo); - } - if(mat->texco & TEXCO_STICKY) { - VECCOPY(shi->sticky, shi->lo); - } - if(mat->texco & TEXCO_UV) { - VECCOPY(shi->uv, shi->lo); - } - if(mat->texco & TEXCO_STRAND) { - shi->strand= shi->lo[0]; - } - if(mat->texco & TEXCO_OBJECT) { - /* nothing */ - } - if(mat->texco & (TEXCO_NORM)) { - //shi->orn[0]= shi->vn[0]; - //shi->orn[1]= shi->vn[1]; - //shi->orn[2]= shi->vn[2]; - } - - /* Clear displase vec for preview */ - shi->displace[0]= shi->displace[1]= shi->displace[2]= 0.0; - - if(mat->pr_type==MA_CUBE) { - /* rotate normal back for normals texture */ - SWAP(float, shi->vn[0], shi->vn[1]); - MTC_Mat3Inv(imat, tmat); - MTC_Mat3MulVecfl(imat, shi->vn); - } - - } - - if(mat->mapto & MAP_DISPLACE) { /* Quick hack of fake displacement preview */ -// shi->vn[0]-=2.0*shi->displace[2]; -// shi->vn[1]-=2.0*shi->displace[0]; -// shi->vn[2]+=2.0*shi->displace[1]; -// Normalise(shi->vn); - } - - VECCOPY(shi->vno, shi->vn); - if(mat->nodetree && mat->use_nodes) { - ntreeShaderExecTree(mat->nodetree, shi, &shr); - } - else { - /* copy all relevant material vars, note, keep this synced with render_types.h */ - memcpy(&shi->r, &mat->r, 23*sizeof(float)); - shi->har= mat->har; - - shade_lamp_loop_preview(shi, &shr); - } - - shi->mat= mat; /* restore, shade input is re-used! */ - - /* after shading and composit layers */ - if(shr.spec[0]<0.0f) shr.spec[0]= 0.0f; - if(shr.spec[1]<0.0f) shr.spec[1]= 0.0f; - if(shr.spec[2]<0.0f) shr.spec[2]= 0.0f; - - if(shr.diff[0]<0.0f) shr.diff[0]= 0.0f; - if(shr.diff[1]<0.0f) shr.diff[1]= 0.0f; - if(shr.diff[2]<0.0f) shr.diff[2]= 0.0f; - - VECADD(col, shr.diff, shr.spec); - col[3]= shr.alpha; - - /* handle backdrop now */ - - if(col[3]!=1.0f) { - float back, backm; - - /* distorts x and y */ - if(mat->mode & MA_RAYTRANSP) { - refraction_prv(&x, &y, shi->vn, shi->ang); - } - - back= previewbackf(mat->pr_back, x, y); - backm= (1.0f-shr.alpha)*back; - - if((mat->mode & MA_RAYTRANSP) && mat->filter!=0.0) { - float fr= 1.0f+ mat->filter*(shr.diff[0]-1.0f); - col[0]= fr*backm+ (col[3]*col[0]); - fr= 1.0f+ mat->filter*(shr.diff[1]-1.0f); - col[1]= fr*backm+ (col[3]*col[1]); - fr= 1.0f+ mat->filter*(shr.diff[2]-1.0f); - col[2]= fr*backm+ (col[3]*col[2]); - } - else { - col[0]= backm + (col[3]*col[0]); - col[1]= backm + (col[3]*col[1]); - col[2]= backm + (col[3]*col[2]); - } - } - - if(col[0]<=0.0f) rect[0]= 0; else if(col[0]>=1.0f) rect[0]= 255; else rect[0]= (char)(255.0f*col[0]); - if(col[1]<=0.0f) rect[1]= 0; else if(col[1]>=1.0f) rect[1]= 255; else rect[1]= (char)(255.0f*col[1]); - if(col[2]<=0.0f) rect[2]= 0; else if(col[2]>=1.0f) rect[2]= 255; else rect[2]= (char)(255.0f*col[2]); - if(col[3]<=0.0f) rect[3]= 0; else if(col[3]>=1.0f) rect[3]= 255; else rect[3]= (char)(255.0f*col[3]); + glDrawBuffer(GL_FRONT); + glaDrawPixelsSafe(ofsx, ofsy, rr->rectx, rr->recty, rr->rectx, GL_RGBA, GL_FLOAT, rl->rectf); + glFlush(); + glDrawBuffer(GL_BACK); } -static void preview_init_render_textures(MTex **mtex) -{ - int x; - - for(x=0; xtex) { - init_render_texture(mtex[x]->tex); - - if(mtex[x]->tex->env && mtex[x]->tex->env->object) - MTC_Mat4One(mtex[x]->tex->env->object->imat); - - } - if(mtex[x]->object) MTC_Mat4One(mtex[x]->object->imat); - if(mtex[x]->object) MTC_Mat4One(mtex[x]->object->imat); - } - } - -} -/* main previewrender loop */ +/* called by interface_icons.c, or by BIF_previewrender_buts or by nodes... */ void BIF_previewrender(struct ID *id, struct RenderInfo *ri, struct ScrArea *area, int pr_method) { - static double lasttime= 0; - Material *mat= NULL; - Tex *tex= NULL; - Lamp *la= NULL; - World *wrld= NULL; - LampRen *lar= NULL; - Image *ima; - HaloRen har; - Object *ob; - ShadeInput shi; - float lens = 0.0, vec[3]; - int x, y, starty, startx, endy, endx, radsq, xsq, ysq, last = 0; - unsigned int *rect; - - if(ri->cury>=ri->pr_rectx) return; + Render *re; + RenderStats *rstats; + Scene *sce; + char name [32]; - ob= ((G.scene->basact)? (G.scene->basact)->object: 0); - - switch(GS(id->name)) - { - case ID_MA: - mat = (Material*)id; break; - case ID_TE: - tex = (Tex*)id; break; - case ID_LA: - la = (Lamp*)id; break; - case ID_WO: - wrld = (World*)id; break; - default: - return; - } + if(ri->cury>=ri->pr_recty) return; - har.flarec= 0; /* below is a test for postrender flare */ - - /* no event escape for icon render */ + if(ri->rect==NULL) { + ri->rect= MEM_callocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "butsrect"); + } + + /* check for return with a new event */ if(pr_method!=PR_ICON_RENDER && qtest()) { - addafterqueue(curarea->win, RENDERPREVIEW, 1); + if(area) + addafterqueue(area->win, RENDERPREVIEW, 1); return; } - - MTC_Mat4One(R.viewmat); - MTC_Mat4One(R.viewinv); - shi.osatex= 0; + /* get the stuff from the builtin preview dbase */ + sce= preview_prepare_scene(ri, id, pr_method); + if(sce==NULL) return; - if(mat) { - - /* rendervars */ - init_render_world(); - init_render_material(mat); /* does nodes too */ - - /* also clears imats */ - preview_init_render_textures(mat->mtex); - - /* do the textures for nodes */ - if(mat->nodetree && mat->use_nodes) { - bNode *node; - for(node=mat->nodetree->nodes.first; node; node= node->next) { - if(node->id && GS(node->id->name)==ID_MA) { - Material *ma= (Material *)node->id; - preview_init_render_textures(ma->mtex); - } - } - /* signal to node editor to store previews or not */ - if(pr_method==PR_ICON_RENDER) { - shi.do_preview= 0; - } - else { - ntreeInitPreview(mat->nodetree, ri->pr_rectx, ri->pr_recty); - shi.do_preview= 1; - } - } - shi.vlr= NULL; - shi.mat= mat; - shi.pr_type= mat->pr_type; - - if(mat->mode & MA_HALO) init_previewhalo(&har, mat, ri->pr_rectx, ri->pr_recty); - - set_node_shader_lamp_loop(shade_lamp_loop_preview); + /* just create new render always now */ + sprintf(name, "ButsPreview %d", area?area->win:0); + re= RE_NewRender(name); + + /* handle cases */ + if(pr_method==PR_DRAW_RENDER) { + RE_display_draw_cb(re, previewrender_progress); + RE_test_break_cb(re, qtest); + sce->r.scemode |= R_NODE_PREVIEW; } - else if(tex) { - - ima= tex->ima; - if(ima) last= ima->lastframe; - init_render_texture(tex); - free_unused_animimages(); - if(tex->ima) { - if(tex->ima!=ima) allqueue(REDRAWBUTSSHADING, 0); - else if(last!=ima->lastframe) allqueue(REDRAWBUTSSHADING, 0); - } - if(tex->env && tex->env->object) - MTC_Mat4Invert(tex->env->object->imat, tex->env->object->obmat); + else if(pr_method==PR_DO_RENDER) { + RE_test_break_cb(re, qtest); + sce->r.scemode |= R_NODE_PREVIEW; } - else if(la) { - - init_render_world(); - preview_init_render_textures(la->mtex); - - /* lar= ((GroupObject *)R.lights.first)->lampren; - RE_add_render_lamp(ob, 0); */ /* 0=no shadbuf or tables */ - - /* elubie: not nice, but ob contains current object, not usable if you - need to render lamp that's not active object :( */ - lar = create_preview_render_lamp(la); - - /* exceptions: */ - lar->spottexfac= 1.0f; - lar->spotsi= cos( M_PI/3.0f ); - lar->spotbl= (1.0f-lar->spotsi)*la->spotblend; - - MTC_Mat3One(lar->imat); - } - else if(wrld) { - - lens= 35.0; - if(G.scene->camera) { - lens= ( (Camera *)G.scene->camera->data)->lens; - - /* needed for init_render_world */ - MTC_Mat4CpyMat4(R.viewinv, G.scene->camera->obmat); - MTC_Mat4Ortho(R.viewinv); - MTC_Mat4Invert(R.viewmat, R.viewinv); - } - init_preview_world(wrld); - preview_init_render_textures(wrld->mtex); + else { /* PR_ICON_RENDER */ + sce->r.scemode &= ~R_NODE_PREVIEW; } - if(ri->rect==NULL) { - ri->rect= MEM_callocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "butsrect"); - } - - starty= -ri->pr_recty/2; - endy= starty+ri->pr_recty; - starty+= ri->cury; - - startx= -ri->pr_rectx/2; - endx= startx+ri->pr_rectx; + /* entire cycle for render engine */ + RE_InitState(re, &sce->r, ri->pr_rectx, ri->pr_recty, NULL); + RE_SetCamera(re, sce->camera); + RE_Database_FromScene(re, sce, 1); + RE_TileProcessor(re); // actual render engine + RE_Database_Free(re); - radsq= (ri->pr_rectx/2)*(ri->pr_recty/2); - - if(mat) { - pr1_lamp[0]= -2.3; pr1_lamp[1]= 2.4; pr1_lamp[2]= 4.6; - pr2_lamp[0]= 8.8; pr2_lamp[1]= 5.6; pr2_lamp[2]= 1.5; - + /* handle results */ + if(pr_method==PR_ICON_RENDER) { + RE_ResultGet32(re, ri->rect); } - - if (pr_method==PR_DRAW_RENDER) - glDrawBuffer(GL_FRONT); - - /* here it starts! */ - for(y=starty; yrect + ri->pr_rectx*ri->cury; - - if(mat) { - - if(mat->mode & MA_HALO) { - for(x=startx; xpr_back, x, y); - } - - if(har.flarec) { - if(y==endy-2) previewflare(ri, &har, ri->pr_rectx, ri->pr_recty, pr_method); - } - else { - halo_preview_pixel(&har, startx, endx, y, (char *) (rect-ri->pr_rectx), ri->pr_rectx); - } - } - else { - ysq= y*y; - for(x=startx; xpr_type==MA_SPHERE) { - - if(xsq+ysq <= radsq) { - shi.vn[0]= -x; - shi.vn[1]= -y; - shi.vn[2]= -sqrt( (float)(radsq-xsq-ysq) ); - Normalise(shi.vn); - - vec[0]= shi.vn[0]; - vec[1]= shi.vn[1]; - vec[2]= -shi.vn[2]; - - if(mat->mode & MA_TANGENT_V) { - float tmp[3]; - tmp[0]=tmp[2]= 0.0f; - tmp[1]= 1.0f; - Crossf(shi.tang, tmp, shi.vn); - Normalise(shi.tang); - } - - shade_preview_pixel(&shi, vec, x, y, (char *)rect, ri->pr_rectx, ri->pr_recty); - } - else { - rect[0]= previewback(mat->pr_back, x, y); - - if(pr_method!=PR_ICON_RENDER && mat->nodetree && mat->use_nodes) - ntreeClearPixelTree(mat->nodetree, x+ri->pr_rectx/2, y+ri->pr_recty/2); - } - } - else if(mat->pr_type==MA_CUBE) { - if( ray_previewrender(x, y, vec, shi.vn, ri->pr_rectx, ri->pr_recty) ) { - - shade_preview_pixel(&shi, vec, x, y, (char *)rect, ri->pr_rectx, ri->pr_recty); - } - else { - rect[0]= previewback(mat->pr_back, x, y); - - if(pr_method!=PR_ICON_RENDER && mat->nodetree && mat->use_nodes) - ntreeClearPixelTree(mat->nodetree, x+ri->pr_rectx/2, y+ri->pr_recty/2); - } - } - else { - vec[0]= x*(2.0f/ri->pr_rectx); - vec[1]= y*(2.0f/ri->pr_recty); - vec[2]= 0.0; - - shi.vn[0]= shi.vn[1]= 0.0f; - shi.vn[2]= -1.0f; - - shade_preview_pixel(&shi, vec, x, y, (char *)rect, ri->pr_rectx, ri->pr_recty); - } - } - } - } - else if(tex) { - for(x=startx; xpr_rectx, ri->pr_recty); - } - } - else if(la) { - for(x=startx; xpr_rectx, ri->pr_recty); - } - } - else { - for(x=startx; xpr_rectx, ri->pr_recty); - } + else { + rstats= RE_GetStats(re); + if(rstats->totpart==rstats->partsdone && rstats->partsdone) { + ri->cury= ri->pr_recty; + RE_ResultGet32(re, ri->rect); + if(GS(id->name)==ID_MA && ((Material *)id)->use_nodes) + allqueue(REDRAWNODE, 0); } - - if (pr_method!=PR_ICON_RENDER) { - if(ywin, RENDERPREVIEW, 1); - break; - } - } - display_pr_scanline(ri->rect, ri->cury, ri->pr_rectx); - - /* flush opengl for cards with frontbuffer slowness */ - if(ri->cury==ri->pr_recty-1 || (PIL_check_seconds_timer() - lasttime > 0.05)) { - lasttime= PIL_check_seconds_timer(); - glFlush(); + else { + if(pr_method==PR_DRAW_RENDER && qtest()) { + addafterqueue(area->win, RENDERPREVIEW, 1); } } - ri->cury++; - } - - if (pr_method==PR_DRAW_RENDER) { - if(ri->cury>=ri->pr_recty && tex) - draw_tex_crop((Tex*)id); - - glDrawBuffer(GL_BACK); - /* draw again for clean swapbufers */ - previewdraw_render(ri, area); - } - - if(lar) { - MEM_freeN(lar); - /* - MEM_freeN(R.lights.first); - R.lights.first= R.lights.last= NULL; - */ - } - - if(mat) { - end_render_material(mat); - - if(mat->nodetree && mat->use_nodes) - if(ri->cury>=ri->pr_recty) - allqueue(REDRAWNODE, 0); } + preview_exit_scene(ri, id); + RE_FreeRender(re); } + +/* afterqueue call */ void BIF_previewrender_buts(SpaceButs *sbuts) { uiBlock *block; @@ -1512,7 +439,7 @@ void BIF_previewrender_buts(SpaceButs *sbuts) if (idshow) { BKE_icon_changed(BKE_icon_getid(idshow)); uiPanelPush(block); - set_previewrect(sbuts->area->win, PR_XMIN, PR_YMIN, PR_XMAX, PR_YMAX, sbuts->ri->pr_rectx, sbuts->ri->pr_recty); // uses UImat + set_previewrect(sbuts->ri, sbuts->area->win); // uses UImat BIF_previewrender(idshow, sbuts->ri, sbuts->area, PR_DRAW_RENDER); uiPanelPop(block); end_previewrect(); @@ -1528,10 +455,11 @@ void BIF_previewrender_buts(SpaceButs *sbuts) } } + /* is panel callback, supposed to be called with correct panel offset matrix */ -void BIF_previewdraw(void) +void BIF_previewdraw(ScrArea *sa, uiBlock *block) { - SpaceButs *sbuts= curarea->spacedata.first; + SpaceButs *sbuts= sa->spacedata.first; short id_code= 0; if(sbuts->lockpoin) { @@ -1543,18 +471,302 @@ void BIF_previewdraw(void) sbuts->ri= MEM_callocN(sizeof(RenderInfo), "butsrenderinfo"); sbuts->ri->cury = 0; sbuts->ri->rect = NULL; - sbuts->ri->pr_rectx = PREVIEW_RENDERSIZE; - sbuts->ri->pr_recty = PREVIEW_RENDERSIZE; } if (sbuts->ri->rect==NULL) BIF_preview_changed(id_code); else { - set_previewrect(sbuts->area->win, PR_XMIN, PR_YMIN, PR_XMAX, PR_YMAX, sbuts->ri->pr_rectx, sbuts->ri->pr_recty); - previewdraw_render(sbuts->ri, sbuts->area); + RenderInfo *ri= sbuts->ri; + int oldx= ri->pr_rectx, oldy= ri->pr_recty; + + /* we now do scalable previews! */ + set_previewrect(ri, sa->win); + if(oldx==ri->pr_rectx && oldy==ri->pr_recty) + glaDrawPixelsSafe(ri->disprect.xmin, ri->disprect.ymin, ri->pr_rectx, ri->pr_recty, ri->pr_rectx, GL_RGBA, GL_UNSIGNED_BYTE, ri->rect); + else { + MEM_freeN(ri->rect); + ri->rect= NULL; + sbuts->ri->cury= 0; + } end_previewrect(); } if(sbuts->ri->cury==0) BIF_preview_changed(id_code); } +/* *************************** Preview for 3d window *********************** */ +static void view3d_previewrender_stats(RenderStats *rs) +{ + printf("rendered %.3f\n", rs->lastframetime); +} + +static void view3d_previewrender_progress(RenderResult *rr, rcti *unused) +{ + RenderLayer *rl; + int ofsx, ofsy; + + rl= rr->layers.first; + + /* this case is when we render envmaps... */ + if(rr->rectx>G.vd->ri->pr_rectx || rr->recty>G.vd->ri->pr_recty) + return; + + ofsx= G.vd->ri->disprect.xmin + rr->tilerect.xmin; + ofsy= G.vd->ri->disprect.ymin + rr->tilerect.ymin; + + glDrawBuffer(GL_FRONT); + glaDefine2DArea(&curarea->winrct); + glaDrawPixelsSafe(ofsx, ofsy, rr->rectx, rr->recty, rr->rectx, GL_RGBA, GL_FLOAT, rl->rectf); + glFlush(); + glDrawBuffer(GL_BACK); + +} + +void BIF_view3d_previewrender_signal(ScrArea *sa, short signal) +{ + View3D *v3d= sa->spacedata.first; + + /* this can be called from other window... solve! */ + if(sa->spacetype!=SPACE_VIEW3D) + v3d= G.vd; + + if(v3d && v3d->ri) { + RenderInfo *ri= v3d->ri; + ri->status &= ~signal; + ri->cury= 0; + if(ri->re && (signal & PR_DBASE)) + RE_Database_Free(ri->re); + + addafterqueue(sa->win, RENDERPREVIEW, 1); + } +} + +void BIF_view3d_previewrender_free(ScrArea *sa) +{ + View3D *v3d= sa->spacedata.first; + + if(v3d->ri) { + RenderInfo *ri= v3d->ri; + if(ri->re) { +// printf("free render\n"); + RE_Database_Free(ri->re); + RE_FreeRender(ri->re); + ri->re= NULL; + } + ri->status= 0; + ri->cury= 0; + } +} + +/* returns 1 if OK, do not call while in panel space! */ +static int view3d_previewrender_get_rects(ScrArea *sa, rctf *viewplane, RenderInfo *ri, float *clipsta, float *clipend, int *ortho) +{ + int rectx, recty; + uiBlock *block; + + block= uiFindOpenPanelBlockName(&curarea->uiblocks, "Preview"); + if(block==NULL) return 0; + + /* calculate preview rect size */ + BLI_init_rctf(viewplane, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f); + uiPanelPush(block); + ui_graphics_to_window_rct(sa->win, viewplane, &ri->disprect); + uiPanelPop(block); + + /* correction for gla draw */ + BLI_translate_rcti(&ri->disprect, -sa->winrct.xmin, -sa->winrct.ymin); + + *ortho= get_view3d_viewplane(sa->winx, sa->winy, viewplane, clipsta, clipend); + + rectx= ri->disprect.xmax - ri->disprect.xmin; + recty= ri->disprect.ymax - ri->disprect.ymin; + + if(rectx<4 || recty<4) return 0; + + if(ri->rect && (rectx!=ri->pr_rectx || recty!=ri->pr_recty)) { + MEM_freeN(ri->rect); + ri->rect= NULL; + } + ri->pr_rectx= rectx; + ri->pr_recty= recty; + + return 1; +} + +/* called before a panel gets moved/scaled, makes sure we can see through */ +void BIF_view3d_previewrender_clear(ScrArea *sa) +{ + View3D *v3d= sa->spacedata.first; + + if(v3d->ri) { + RenderInfo *ri= v3d->ri; + ri->cury= 0; + if(ri->rect) + MEM_freeN(ri->rect); + ri->rect= NULL; + } +} + +/* afterqueue call */ +void BIF_view3d_previewrender(ScrArea *sa) +{ + View3D *v3d= sa->spacedata.first; + Render *re; + RenderInfo *ri; /* preview struct! */ + RenderStats *rstats; + RenderData rdata; + rctf viewplane; + float clipsta, clipend; + int orth; + + /* first get the render info right */ + if (!v3d->ri) + ri= v3d->ri= MEM_callocN(sizeof(RenderInfo), "butsrenderinfo"); + ri= v3d->ri; + + if(0==view3d_previewrender_get_rects(sa, &viewplane, ri, &clipsta, &clipend, &orth)) + return; + + /* render is finished, so return */ + if(ri->cury>=ri->pr_rectx) return; + + /* or return with a new event */ + if(qtest()) { + addafterqueue(curarea->win, RENDERPREVIEW, 1); + return; + } + + /* ok, are we rendering all over? */ + if(ri->re==NULL) { + char name[32]; + + ri->status= 0; + + sprintf(name, "View3dPreview %d", sa->win); + re= ri->re= RE_NewRender(name); + RE_display_draw_cb(re, view3d_previewrender_progress); + RE_stats_draw_cb(re, view3d_previewrender_stats); + RE_test_break_cb(re, qtest); + + /* no osa, blur, seq, for preview render */ + rdata= G.scene->r; + rdata.mode &= ~(R_OSA|R_MBLUR|R_DOSEQ); + + RE_InitState(re, &rdata, sa->winx, sa->winy, &ri->disprect); + + if(orth) + RE_SetOrtho(re, &viewplane, clipsta, clipend); + else + RE_SetWindow(re, &viewplane, clipsta, clipend); + + /* until here are no escapes */ + ri->status |= PR_DISPRECT; + } + + re= ri->re; + + PIL_sleep_ms(100); /* wait 0.1 second if theres really no event... */ + if(qtest()==0) { + + /* check status */ + if((ri->status & PR_DISPRECT)==0) { + RE_SetDispRect(ri->re, &ri->disprect); + if(orth) + RE_SetOrtho(ri->re, &viewplane, clipsta, clipend); + else + RE_SetWindow(ri->re, &viewplane, clipsta, clipend); + ri->status |= PR_DISPRECT; + } + if((ri->status & PR_DBASE)==0) { + unsigned int lay= G.scene->lay; + + RE_SetView(re, G.vd->viewmat); + + /* allow localview render for objects with lights in normal layers */ + if(v3d->lay & 0xFF000000) + G.scene->lay |= v3d->lay; + else G.scene->lay= v3d->lay; + + RE_Database_FromScene(re, G.scene, 0); // 0= dont use camera view + G.scene->lay= lay; + + rstats= RE_GetStats(re); + if(rstats->convertdone) + ri->status |= PR_DBASE|PR_PROJECTED|PR_ROTATED; + } + if((ri->status & PR_PROJECTED)==0) { + if(ri->status & PR_DBASE) { + if(orth) + RE_SetOrtho(ri->re, &viewplane, clipsta, clipend); + else + RE_SetWindow(ri->re, &viewplane, clipsta, clipend); + RE_DataBase_ApplyWindow(re); + ri->status |= PR_PROJECTED; + } + } + + /* OK, can we enter render code? */ + if(ri->status==(PR_DISPRECT|PR_DBASE|PR_PROJECTED|PR_ROTATED)) { + RE_TileProcessor(ri->re); + + if(ri->rect==NULL) + ri->rect= MEM_callocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "preview view3d rect"); + + RE_ResultGet32(ri->re, ri->rect); + } + + rstats= RE_GetStats(ri->re); + if(rstats->totpart==rstats->partsdone && rstats->partsdone) { + ri->cury= 12000; /* arbitrary... */ + addqueue(sa->win, REDRAW, 1); + } + else { + addafterqueue(curarea->win, RENDERPREVIEW, 1); + ri->cury= 0; + } + } + else { + addafterqueue(curarea->win, RENDERPREVIEW, 1); + ri->cury= 0; + } +} + +/* in panel space! */ +static void view3d_previewdraw_rect(ScrArea *sa, uiBlock *block, RenderInfo *ri) +{ + rctf dispf; + + if(ri->rect==NULL) + return; + + BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f); + ui_graphics_to_window_rct(sa->win, &dispf, &ri->disprect); + + /* correction for gla draw */ + BLI_translate_rcti(&ri->disprect, -curarea->winrct.xmin, -curarea->winrct.ymin); + + /* when panel scale changed, free rect */ + if(ri->disprect.xmax-ri->disprect.xmin != ri->pr_rectx || + ri->disprect.ymax-ri->disprect.ymin != ri->pr_recty) { + MEM_freeN(ri->rect); + ri->rect= NULL; + } + else { + glaDefine2DArea(&sa->winrct); + glaDrawPixelsSafe(ri->disprect.xmin, ri->disprect.ymin, ri->pr_rectx, ri->pr_recty, ri->pr_rectx, GL_RGBA, GL_UNSIGNED_BYTE, ri->rect); + } +} + +/* is panel callback, supposed to be called with correct panel offset matrix */ +void BIF_view3d_previewdraw(struct ScrArea *sa, struct uiBlock *block) +{ + View3D *v3d= sa->spacedata.first; + + if (v3d->ri==NULL || v3d->ri->rect==NULL) + addafterqueue(sa->win, RENDERPREVIEW, 1); + else { + view3d_previewdraw_rect(sa, block, v3d->ri); + if(v3d->ri->cury==0) + addafterqueue(sa->win, RENDERPREVIEW, 1); + } +} diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c index 51ff8ea3219..5f10ce38a6e 100644 --- a/source/blender/src/renderwin.c +++ b/source/blender/src/renderwin.c @@ -63,11 +63,13 @@ #include "DNA_view3d_types.h" #include "DNA_screen_types.h" +#include "DNA_scene_types.h" #include "DNA_vec_types.h" #include "BKE_global.h" #include "BKE_scene.h" #include "BKE_utildefines.h" +#include "BKE_writeavi.h" /* movie handle */ #include "BIF_gl.h" #include "BIF_glutil.h" @@ -75,10 +77,10 @@ #include "BIF_screen.h" #include "BIF_space.h" #include "BIF_mywindow.h" -#include "BIF_previewrender.h" #include "BIF_renderwin.h" #include "BIF_resources.h" #include "BIF_toets.h" +#include "BIF_writeimage.h" #include "BDR_editobject.h" #include "BPY_extern.h" /* for BPY_do_all_scripts */ @@ -88,10 +90,11 @@ #include "BSE_filesel.h" #include "BSE_headerbuttons.h" +#include "RE_pipeline.h" + #include "blendef.h" #include "mydevice.h" #include "winlay.h" -#include "render.h" /* ------------ renderwin struct, to prevent too much global vars --------- */ /* ------------ only used for display in a 2nd window --------- */ @@ -123,6 +126,7 @@ typedef struct { Window *win; + int rectx, recty; /* size of image */ float zoom, zoomofs[2]; int active; @@ -172,7 +176,7 @@ static void renderwin_reshape(RenderWin *rw) ; } -static void renderwin_get_disprect(RenderWin *rw, float disprect_r[2][2]) +static void renderwin_get_fullrect(RenderWin *rw, float fullrect_r[2][2]) { float display_w, display_h; float cent_x, cent_y; @@ -181,15 +185,15 @@ static void renderwin_get_disprect(RenderWin *rw, float disprect_r[2][2]) window_get_size(rw->win, &w, &h); h-= RW_HEADERY; - display_w= R.rectx*rw->zoom; - display_h= R.recty*rw->zoom; - cent_x= (rw->zoomofs[0] + R.rectx/2)*rw->zoom; - cent_y= (rw->zoomofs[1] + R.recty/2)*rw->zoom; + display_w= rw->rectx*rw->zoom; + display_h= rw->recty*rw->zoom; + cent_x= (rw->zoomofs[0] + rw->rectx/2)*rw->zoom; + cent_y= (rw->zoomofs[1] + rw->recty/2)*rw->zoom; - disprect_r[0][0]= w/2 - cent_x; - disprect_r[0][1]= h/2 - cent_y; - disprect_r[1][0]= disprect_r[0][0] + display_w; - disprect_r[1][1]= disprect_r[0][1] + display_h; + fullrect_r[0][0]= w/2 - cent_x; + fullrect_r[0][1]= h/2 - cent_y; + fullrect_r[1][0]= fullrect_r[0][0] + display_w; + fullrect_r[1][1]= fullrect_r[0][1] + display_h; } /** @@ -198,14 +202,14 @@ static void renderwin_get_disprect(RenderWin *rw, float disprect_r[2][2]) */ static int renderwin_win_to_image_co(RenderWin *rw, int winco[2], int imgco_r[2]) { - float disprect[2][2]; + float fullrect[2][2]; - renderwin_get_disprect(rw, disprect); + renderwin_get_fullrect(rw, fullrect); - imgco_r[0]= (int) ((winco[0]-disprect[0][0])/rw->zoom); - imgco_r[1]= (int) ((winco[1]-disprect[0][1])/rw->zoom); + imgco_r[0]= (int) ((winco[0]-fullrect[0][0])/rw->zoom); + imgco_r[1]= (int) ((winco[1]-fullrect[0][1])/rw->zoom); - return (imgco_r[0]>=0 && imgco_r[1]>=0 && imgco_r[0]=0 && imgco_r[1]>=0 && imgco_r[0]rectx && imgco_r[1]recty); } /** @@ -233,29 +237,17 @@ static void renderwin_set_infotext(RenderWin *rw, char *info_text) static void renderwin_reset_view(RenderWin *rw) { - int w, h, rectx, recty; + int w, h; if (rw->info_text) renderwin_set_infotext(rw, NULL); /* now calculate a zoom for when image is larger than window */ window_get_size(rw->win, &w, &h); h-= RW_HEADERY; - - /* at this point the r.rectx/y values are not correct yet */ - rectx= (G.scene->r.size*G.scene->r.xsch)/100; - recty= (G.scene->r.size*G.scene->r.ysch)/100; - - /* crop option makes image smaller */ - if ((G.scene->r.mode & R_BORDER) && (G.scene->r.mode & R_MOVIECROP)) { - if(!(G.scene->r.scemode & R_OGL)) { - rectx= (int) (rectx*(G.scene->r.border.xmax-G.scene->r.border.xmin)); - recty= (int) (recty*(G.scene->r.border.ymax-G.scene->r.border.ymin)); - } - } - - if(rectx>w || recty>h) { - if(rectx-w > recty-h) rw->zoom= ((float)w)/((float)rectx); - else rw->zoom= ((float)h)/((float)recty); + + if(rw->rectx>w || rw->recty>h) { + if(rw->rectx-w > rw->recty-h) rw->zoom= ((float)w)/((float)rw->rectx); + else rw->zoom= ((float)h)/((float)rw->recty); } else rw->zoom= 1.0; @@ -295,87 +287,98 @@ static void renderwin_draw_render_info(RenderWin *rw) static void renderwin_draw(RenderWin *rw, int just_clear) { - float disprect[2][2]; - int set_back_mainwindow; - rcti rect; - - /* since renderwin uses callbacks (controlled by ghost) it can - mess up active window output with redraw events after a render. - this is patchy, still WIP */ - set_back_mainwindow = (winlay_get_active_window() != rw->win); - window_make_active(rw->win); - - rect.xmin= rect.ymin= 0; - window_get_size(rw->win, &rect.xmax, &rect.ymax); - rect.ymax-= RW_HEADERY; - - renderwin_get_disprect(rw, disprect); - - /* do this first, so window ends with correct scissor */ - renderwin_draw_render_info(rw); - - glEnable(GL_SCISSOR_TEST); - glaDefine2DArea(&rect); - - glClearColor(.1875, .1875, .1875, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - - if (just_clear || !R.rectot) { - glColor3ub(0, 0, 0); - glRectfv(disprect[0], disprect[1]); - } else { - glPixelZoom(rw->zoom, rw->zoom); - if(rw->flags & RW_FLAGS_ALPHA) { - /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); - glaDrawPixelsSafe(disprect[0][0], disprect[0][1], R.rectx, R.recty, GL_LUMINANCE, GL_UNSIGNED_INT, R.rectot); - glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); + RenderResult *rr= RE_GetResult(RE_GetRender("Render")); + + if(rr) { + RenderLayer *rl= rr->layers.first; + float fullrect[2][2]; + int set_back_mainwindow; + rcti rect; + + /* since renderwin uses callbacks (controlled by ghost) it can + mess up active window output with redraw events after a render. + this is patchy, still WIP */ + set_back_mainwindow = (winlay_get_active_window() != rw->win); + window_make_active(rw->win); + + rect.xmin= rect.ymin= 0; + window_get_size(rw->win, &rect.xmax, &rect.ymax); + rect.ymax-= RW_HEADERY; + + renderwin_get_fullrect(rw, fullrect); + + /* do this first, so window ends with correct scissor */ + renderwin_draw_render_info(rw); + + glEnable(GL_SCISSOR_TEST); + glaDefine2DArea(&rect); + + glClearColor(.1875, .1875, .1875, 1.0); + glClear(GL_COLOR_BUFFER_BIT); + + if (just_clear) { + glColor3ub(0, 0, 0); + glRectfv(fullrect[0], fullrect[1]); + } else { + glPixelZoom(rw->zoom, rw->zoom); + if(rw->flags & RW_FLAGS_ALPHA) { + /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ +// glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); +// glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rr->rectx, rr->recty, GL_LUMINANCE, GL_UNSIGNED_INT, R.rectot); +// glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); + } + else { + if(rr->rect32) + glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rr->rectx, rr->recty, rr->rectx, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32); + else if(rl->rectf) + glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rr->rectx, rr->recty, rr->rectx, GL_RGBA, GL_FLOAT, rl->rectf); + } + glPixelZoom(1.0, 1.0); } - else { - glaDrawPixelsSafe(disprect[0][0], disprect[0][1], R.rectx, R.recty, GL_RGBA, GL_UNSIGNED_BYTE, R.rectot); + + /* info text is overlayed on bottom */ + if (rw->info_text) { + float w; + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + w=186.0*strlen(rw->info_text)/30; + glColor4f(.5,.5,.5,.25); + glRectf(0.0,0.0,w,30.0); + glDisable(GL_BLEND); + glColor3ub(255, 255, 255); + glRasterPos2i(10, 10); + BMF_DrawString(G.font, rw->info_text); } - glPixelZoom(1.0, 1.0); - } - - /* info text is overlayed on bottom */ - if (rw->info_text) { - float w; - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - w=186.0*strlen(rw->info_text)/30; - glColor4f(.5,.5,.5,.25); - glRectf(0.0,0.0,w,30.0); - glDisable(GL_BLEND); - glColor3ub(255, 255, 255); - glRasterPos2i(10, 10); - BMF_DrawString(G.font, rw->info_text); + + window_swap_buffers(rw->win); + + if (set_back_mainwindow) mainwindow_make_active(); } - - window_swap_buffers(rw->win); - - if (set_back_mainwindow) mainwindow_make_active(); } /* ------ interactivity calls for RenderWin ------------- */ static void renderwin_mouse_moved(RenderWin *rw) { + RenderResult *rr= RE_GetResult(RE_GetRender("Render")); + RenderLayer *rl= (rr?rr->layers.first:NULL); + if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) { - int imgco[2], ofs; + int imgco[2], ofs=0; char buf[128]; - char *pxl; +// char *pxl; - if (R.rectot && renderwin_win_to_image_co(rw, rw->lmouse, imgco)) { - pxl= (char*) &R.rectot[R.rectx*imgco[1] + imgco[0]]; + if (rl && renderwin_win_to_image_co(rw, rw->lmouse, imgco)) { +// pxl= (char*) &R.rectot[R.rectx*imgco[1] + imgco[0]]; - ofs= sprintf(buf, "R: %d G: %d B: %d A: %d", pxl[0], pxl[1], pxl[2], pxl[3]); +// ofs= sprintf(buf, "R: %d G: %d B: %d A: %d", pxl[0], pxl[1], pxl[2], pxl[3]); - if (R.rectftot) { - float *pxlf= R.rectftot + 4*(R.rectx*imgco[1] + imgco[0]); + if (rl->rectf) { + float *pxlf= rl->rectf + 4*(rr->rectx*imgco[1] + imgco[0]); ofs+= sprintf(buf+ofs, " | R: %.3f G: %.3f B: %.3f A: %.3f ", pxlf[0], pxlf[1], pxlf[2], pxlf[3]); } - if (R.rectzf) { - float *pxlz= &R.rectzf[R.rectx*imgco[1] + imgco[0]]; + if (rl->rectz) { + float *pxlz= &rl->rectz[rr->rectx*imgco[1] + imgco[0]]; sprintf(buf+ofs, "| Z: %.3f", *pxlz ); } @@ -392,8 +395,8 @@ static void renderwin_mouse_moved(RenderWin *rw) rw->zoomofs[0]= rw->pan_ofs_start[0] - delta_x/rw->zoom; rw->zoomofs[1]= rw->pan_ofs_start[1] - delta_y/rw->zoom; - rw->zoomofs[0]= CLAMPIS(rw->zoomofs[0], -R.rectx/2, R.rectx/2); - rw->zoomofs[1]= CLAMPIS(rw->zoomofs[1], -R.recty/2, R.recty/2); + rw->zoomofs[0]= CLAMPIS(rw->zoomofs[0], -rr->rectx/2, rr->rectx/2); + rw->zoomofs[1]= CLAMPIS(rw->zoomofs[1], -rr->recty/2, rr->recty/2); renderwin_queue_redraw(rw); } @@ -405,8 +408,8 @@ static void renderwin_mouse_moved(RenderWin *rw) h-= RW_HEADERY; renderwin_win_to_ndc(rw, rw->lmouse, ndc); - rw->zoomofs[0]= -0.5*ndc[0]*(w-R.rectx*rw->zoom)/rw->zoom; - rw->zoomofs[1]= -0.5*ndc[1]*(h-R.recty*rw->zoom)/rw->zoom; + rw->zoomofs[0]= -0.5*ndc[0]*(w-rr->rectx*rw->zoom)/rw->zoom; + rw->zoomofs[1]= -0.5*ndc[1]*(h-rr->recty*rw->zoom)/rw->zoom; renderwin_queue_redraw(rw); } @@ -444,7 +447,7 @@ static void renderwin_handler(Window *win, void *user_data, short evt, short val RenderWin *rw= user_data; // added this for safety, while render it's just creating bezerk results - if(R.flag & R_RENDERING) { + if(G.rendering) { if(evt==ESCKEY && val) rw->flags|= RW_FLAGS_ESCAPE; return; @@ -494,7 +497,7 @@ static void renderwin_handler(Window *win, void *user_data, short evt, short val renderwin_queue_redraw(render_win); } else if (evt==JKEY) { - if(R.flag==0) BIF_swap_render_rects(); +// if(R.flag==0) BIF_swap_render_rects(); } else if (evt==ZKEY) { if (rw->flags&RW_FLAGS_OLDZOOM) { @@ -527,20 +530,20 @@ static void renderwin_handler(Window *win, void *user_data, short evt, short val renderwin_reset_view(rw); } else if (evt==F3KEY) { - if(R.flag==0) { - mainwindow_raise(); - mainwindow_make_active(); - rw->active= 0; - areawinset(find_biggest_area()->win); - BIF_save_rendered_image(); - } +// if(R.flag==0) { +// mainwindow_raise(); +// mainwindow_make_active(); +// rw->active= 0; +// areawinset(find_biggest_area()->win); +// BIF_save_rendered_image_fs(); +// } } else if (evt==F11KEY) { BIF_toggle_render_display(); } else if (evt==F12KEY) { /* if it's rendering, this flag is set */ - if(R.flag==0) BIF_do_render(0); +// if(R.flag==0) BIF_do_render(0); } } } @@ -565,7 +568,7 @@ static char *renderwin_get_title(int doswap) } /* opens window and allocs struct */ -static void open_renderwin(int winpos[2], int winsize[2]) +static void open_renderwin(int winpos[2], int winsize[2], int imagesize[2]) { extern void mywindow_build_and_set_renderwin( int orx, int ory, int sizex, int sizey); // mywindow.c Window *win; @@ -575,7 +578,9 @@ static void open_renderwin(int winpos[2], int winsize[2]) win= window_open(title, winpos[0], winpos[1], winsize[0], winsize[1]+RW_HEADERY, 0); render_win= renderwin_alloc(win); - + render_win->rectx= imagesize[0]; + render_win->recty= imagesize[1]; + /* Ghost calls handler */ window_set_handler(win, renderwin_handler, render_win); @@ -595,26 +600,15 @@ static void open_renderwin(int winpos[2], int winsize[2]) /* -------------- callbacks for render loop: Window (RenderWin) ----------------------- */ /* calculations for window size and position */ -void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[2]) +void calc_renderwin_rectangle(int rectx, int recty, int posmask, int renderpos_r[2], int rendersize_r[2]) { int scr_w, scr_h, x, y, div= 0; float ndc_x= 0.0, ndc_y= 0.0; winlay_get_screensize(&scr_w, &scr_h); - rendersize_r[0]= (G.scene->r.size*G.scene->r.xsch)/100; - rendersize_r[1]= (G.scene->r.size*G.scene->r.ysch)/100; - - /* crop option makes image smaller */ - if ((G.scene->r.mode & R_BORDER) && (G.scene->r.mode & R_MOVIECROP)) { - rendersize_r[0]*= (G.scene->r.border.xmax-G.scene->r.border.xmin); - rendersize_r[1]*= (G.scene->r.border.ymax-G.scene->r.border.ymin); - } - - if(G.scene->r.mode & R_PANORAMA) { - rendersize_r[0]*= G.scene->r.xparts; - rendersize_r[1]*= G.scene->r.yparts; - } + rendersize_r[0]= rectx; + rendersize_r[1]= recty; rendersize_r[0]= CLAMPIS(rendersize_r[0], 0, scr_w); rendersize_r[1]= CLAMPIS(rendersize_r[1], 0, scr_h-RW_HEADERY); @@ -645,15 +639,18 @@ void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[ } /* init renderwin, alloc/open/resize */ -static void renderwin_init_display_cb(void) +static void renderwin_init_display_cb(RenderResult *rr) { if (G.afbreek == 0) { - int rendersize[2], renderpos[2]; + int rendersize[2], renderpos[2], imagesize[2]; - calc_renderwin_rectangle(G.winpos, renderpos, rendersize); + calc_renderwin_rectangle(rr->rectx, rr->recty, G.winpos, renderpos, rendersize); + + imagesize[0]= rr->rectx; + imagesize[1]= rr->recty; if (!render_win) { - open_renderwin(renderpos, rendersize); + open_renderwin(renderpos, rendersize, imagesize); renderwin_reset_view(render_win); // incl. autozoom for large images } else { int win_x, win_y; @@ -676,7 +673,7 @@ static void renderwin_init_display_cb(void) */ if(rendersize[0]!= win_w || rendersize[1]!= win_h) { BIF_close_render_display(); - open_renderwin(renderpos, rendersize); + open_renderwin(renderpos, rendersize, imagesize); } else { window_raise(render_win->win); @@ -698,14 +695,16 @@ static void renderwin_init_display_cb(void) } /* make sure we are in normal draw again */ render_win->flags &= ~RW_FLAGS_ALPHA; + + glFinish(); } } /* callback for redraw render win */ -static void renderwin_clear_display_cb(short ignore) +static void renderwin_clear_display_cb(RenderResult *rr) { if (render_win) { - window_make_active(render_win->win); + window_make_active(render_win->win); renderwin_draw(render_win, 1); } } @@ -719,27 +718,39 @@ static void renderwin_clear_display_cb(short ignore) * Note: blocked queue handling while rendering to prevent that (ton) */ -/* in render window; display a couple of scanlines of rendered image (see callback below) */ -static void renderwin_progress(RenderWin *rw, int start_y, int nlines, int rect_w, int rect_h, unsigned char *rect) +/* can get as well the full picture, as the parts while rendering */ +static void renderwin_progress(RenderWin *rw, RenderResult *rr, rcti *unused) { - float disprect[2][2]; + RenderLayer *rl; rcti win_rct; - + float *rectf, fullrect[2][2]; + + /* renderwindow cruft */ win_rct.xmin= win_rct.ymin= 0; window_get_size(rw->win, &win_rct.xmax, &win_rct.ymax); win_rct.ymax-= RW_HEADERY; + renderwin_get_fullrect(rw, fullrect); + + /* find current float rect for display */ + rl= rr->layers.first; + rectf= rl->rectf; - renderwin_get_disprect(rw, disprect); + /* when rendering more pixels than needed, we crop away cruft */ + if(rr->crop) + rectf+= 4*(rr->crop*rr->rectx + rr->crop); - /* for efficiency & speed; not drawing in Blender UI while rendering */ - //window_make_active(rw->win); + /* tilerect defines drawing offset from (0,0) */ + /* however, tilerect (xmin, ymin) is first pixel */ + fullrect[0][0] += (rr->tilerect.xmin+rr->crop)*rw->zoom; + fullrect[0][1] += (rr->tilerect.ymin+rr->crop)*rw->zoom; glEnable(GL_SCISSOR_TEST); glaDefine2DArea(&win_rct); glDrawBuffer(GL_FRONT); glPixelZoom(rw->zoom, rw->zoom); - glaDrawPixelsSafe(disprect[0][0], disprect[0][1] + start_y*rw->zoom, rect_w, nlines, GL_RGBA, GL_UNSIGNED_BYTE, &rect[start_y*rect_w*4]); + glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rr->rectx-2*rr->crop, rr->recty-2*rr->crop, rr->rectx, + GL_RGBA, GL_FLOAT, rectf); glPixelZoom(1.0, 1.0); glFlush(); glDrawBuffer(GL_BACK); @@ -747,177 +758,44 @@ static void renderwin_progress(RenderWin *rw, int start_y, int nlines, int rect_ /* in render window; display a couple of scanlines of rendered image */ -static void renderwin_progress_display_cb(int y1, int y2, int w, int h, unsigned int *rect) +static void renderwin_progress_display_cb(RenderResult *rr, rcti *rect) { if (render_win) { - renderwin_progress(render_win, y1, y2-y1+1, w, h, (unsigned char*) rect); - } -} - - -/* -------------- callbacks for render loop: in View3D ----------------------- */ - - -static View3D *render_view3d = NULL; - -/* init Render view callback */ -static void renderview_init_display_cb(void) -{ - ScrArea *sa; - - /* Choose the first view with a persp camera, - * if one doesn't exist we will get the first - * View3D window. - */ - render_view3d= NULL; - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if (sa->win && sa->spacetype==SPACE_VIEW3D) { - View3D *vd= sa->spacedata.first; - - if (vd->persp==2 && vd->camera==G.scene->camera) { - render_view3d= vd; - break; - } else if (!render_view3d) { - render_view3d= vd; - } - } - } -} - - -/* in 3d view; display a couple of scanlines of rendered image */ -static void renderview_progress_display_cb(int y1, int y2, int w, int h, unsigned int *rect) -{ - if (render_view3d) { - View3D *v3d= render_view3d; - int nlines= y2-y1+1; - float sx, sy, facx, facy; - rcti win_rct, vb; - - calc_viewborder(v3d, &vb); - - /* if border render */ - if(G.scene->r.mode & R_BORDER) { - - /* but, if image is full (at end of border render, without crop) we don't */ - if(R.rectx != (G.scene->r.size*G.scene->r.xsch)/100 || - R.recty != (G.scene->r.size*G.scene->r.ysch)/100 ) { - - facx= (float) (vb.xmax-vb.xmin); - facy= (float) (vb.ymax-vb.ymin); - - vb.xmax= vb.xmin + facx*G.scene->r.border.xmax; - vb.ymax= vb.ymin + facy*G.scene->r.border.ymax; - vb.xmin+= facx*G.scene->r.border.xmin; - vb.ymin+= facy*G.scene->r.border.ymin; - } - } - - facx= (float) (vb.xmax-vb.xmin)/R.rectx; - facy= (float) (vb.ymax-vb.ymin)/R.recty; - - bwin_get_rect(v3d->area->win, &win_rct); - - glaDefine2DArea(&win_rct); - - glDrawBuffer(GL_FRONT); - - sx= vb.xmin; - sy= vb.ymin + facy*y1; - - glPixelZoom(facx, facy); - glaDrawPixelsSafe(sx, sy, w, nlines, GL_RGBA, GL_UNSIGNED_BYTE, rect+w*y1); - glPixelZoom(1.0, 1.0); - - glFlush(); - glDrawBuffer(GL_BACK); - v3d->flag |= V3D_DISPIMAGE; - v3d->area->win_swap= WIN_FRONT_OK; - - } -} - -/* in 3d view; display stats of rendered image */ -static void renderview_draw_render_info(char *str) -{ - if (render_view3d) { - View3D *v3d= render_view3d; - rcti vb, win_rct; - - calc_viewborder(v3d, &vb); - - bwin_get_rect(v3d->area->win, &win_rct); - glaDefine2DArea(&win_rct); - - glDrawBuffer(GL_FRONT); - - /* clear header rect */ - BIF_ThemeColor(TH_HEADER); - glRecti(vb.xmin, vb.ymax, vb.xmax, vb.ymax+RW_HEADERY); - - if(str) { - BIF_ThemeColor(TH_TEXT); - glRasterPos2i(vb.xmin+12, vb.ymax+5); - BMF_DrawString(G.fonts, str); - } - - glFlush(); - glDrawBuffer(GL_BACK); - - v3d->area->win_swap= WIN_FRONT_OK; - + renderwin_progress(render_win, rr, rect); } } - /* -------------- callbacks for render loop: interactivity ----------------------- */ /* callback for print info in top header of renderwin */ -/* time is only not zero on last call, we then don't update the other stats */ -static void printrenderinfo_cb(double time, int sample) +static void printrenderinfo_cb(RenderStats *rs) { + extern char info_time_str[32]; // header_info.c extern int mem_in_use; - static int totvert=0, totvlak=0, tothalo=0, totlamp=0; - static float megs_used_memory=0.0; + static float megs_used_memory; char str[300], *spos= str; - if(time==0.0) { + if(render_win) { megs_used_memory= mem_in_use/(1024.0*1024.0); - totvert= R.totvert; - totvlak= R.totvlak; - totlamp= R.totlamp; - tothalo= R.tothalo; - } - - if(tothalo) - spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d Ha:%d La:%d Mem:%.2fM", (G.scene->r.cfra), totvert, totvlak, tothalo, totlamp, megs_used_memory); - else - spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d La:%d Mem:%.2fM", (G.scene->r.cfra), totvert, totvlak, totlamp, megs_used_memory); - - if(time==0.0) { - if (R.r.mode & R_FIELDS) { - spos+= sprintf(spos, "Field %c ", (R.flag&R_SEC_FIELD)?'B':'A'); - } - if (sample!=-1) { - spos+= sprintf(spos, "Sample: %d ", sample); - } - } - else { - extern char info_time_str[32]; // header_info.c - timestr(time, info_time_str); + + if(rs->tothalo) + spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d Ha:%d La:%d Mem:%.2fM", (G.scene->r.cfra), rs->totvert, rs->totface, rs->tothalo, rs->totlamp, megs_used_memory); + else + spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d La:%d Mem:%.2fM", (G.scene->r.cfra), rs->totvert, rs->totface, rs->totlamp, megs_used_memory); + + BLI_timestr(rs->lastframetime, info_time_str); spos+= sprintf(spos, " Time:%s ", info_time_str); + + if(render_win) { + if(render_win->render_text) MEM_freeN(render_win->render_text); + render_win->render_text= BLI_strdup(str); + glDrawBuffer(GL_FRONT); + renderwin_draw_render_info(render_win); + glFlush(); + glDrawBuffer(GL_BACK); + } } - - if(render_win) { - if(render_win->render_text) MEM_freeN(render_win->render_text); - render_win->render_text= BLI_strdup(str); - glDrawBuffer(GL_FRONT); - renderwin_draw_render_info(render_win); - glFlush(); - glDrawBuffer(GL_BACK); - } - else renderview_draw_render_info(str); } /* -------------- callback system to allow ESC from rendering ----------------------- */ @@ -1021,98 +899,61 @@ static void end_test_break_callback() /* - initialize displays - - both opengl render as blender render - set callbacks - cleanup */ -static void do_render(View3D *ogl_render_view3d, int anim, int force_dispwin) +static void do_render(int anim) { + Render *re= RE_NewRender("Render"); /* we set this flag to prevent renderwindow queue to execute another render */ - R.flag= R_RENDERING; + G.rendering= 1; G.afbreek= 0; - if (G.displaymode == R_DISPLAYWIN || force_dispwin) { - RE_set_initrenderdisplay_callback(NULL); - RE_set_clearrenderdisplay_callback(renderwin_clear_display_cb); - RE_set_renderdisplay_callback(renderwin_progress_display_cb); - - renderwin_init_display_cb(); - } - else { - BIF_close_render_display(); - RE_set_initrenderdisplay_callback(renderview_init_display_cb); - RE_set_clearrenderdisplay_callback(NULL); - RE_set_renderdisplay_callback(renderview_progress_display_cb); - } - + /* set callbacks */ + RE_display_init_cb(re, renderwin_init_display_cb); + RE_display_draw_cb(re, renderwin_progress_display_cb); + RE_display_clear_cb(re, renderwin_clear_display_cb); init_test_break_callback(); - RE_set_test_break_callback(test_break); - - RE_set_timecursor_callback(set_timecursor); - RE_set_printrenderinfo_callback(printrenderinfo_cb); + RE_test_break_cb(re, test_break); + RE_timecursor_cb(re, set_timecursor); + RE_stats_draw_cb(re, printrenderinfo_cb); - if (render_win) { - window_set_cursor(render_win->win, CURSOR_WAIT); - // when opening new window... not cross platform identical behaviour, so - // for now call it each time - // if(ogl_render_view3d) init_gl_stuff(); - } + if(render_win) window_set_cursor(render_win->win, CURSOR_WAIT); waitcursor(1); - if(G.obedit && !(G.scene->r.scemode & R_OGL)) { + if(G.obedit) exit_editmode(0); /* 0 = no free data */ - } - if(anim) { - RE_animrender(ogl_render_view3d); - } - else { - RE_initrender(ogl_render_view3d); - } + if(anim) + RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); + else + RE_BlenderFrame(re, G.scene, G.scene->r.cfra); - if (render_win) window_set_cursor(render_win->win, CURSOR_STD); + if(render_win) window_set_cursor(render_win->win, CURSOR_STD); free_filesel_spec(G.scene->r.pic); G.afbreek= 0; end_test_break_callback(); - /* in dispiew it will destroy the image otherwise - window_make_active() raises window at osx and sends redraws */ - if(G.displaymode==R_DISPLAYWIN) { - mainwindow_make_active(); + mainwindow_make_active(); - /* after an envmap creation... */ - if(R.flag & R_REDRAW_PRV) { - BIF_preview_changed(ID_TE); - } - allqueue(REDRAWBUTSSCENE, 0); // visualize fbuf for example - } + /* after an envmap creation... */ +// if(R.flag & R_REDRAW_PRV) { +// BIF_preview_changed(ID_TE); +// } + allqueue(REDRAWBUTSSCENE, 0); // visualize fbuf for example - R.flag= 0; // before scene update! + // before scene update! + G.rendering= 0; scene_update_for_newframe(G.scene, G.scene->lay); // no redraw needed, this restores to view as we left it waitcursor(0); // waitcursor checks rendering R.flag... } -/* finds area with a 'dispview' set */ -static ScrArea *find_dispimage_v3d(void) -{ - ScrArea *sa; - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if (sa->spacetype==SPACE_VIEW3D) { - View3D *vd= sa->spacedata.first; - if (vd->flag & V3D_DISPIMAGE) - return sa; - } - } - - return NULL; -} /* used for swapping with spare buffer, when images are different size */ static void scalefastrect(unsigned int *recto, unsigned int *rectn, int oldx, int oldy, int newx, int newy) @@ -1171,42 +1012,84 @@ void BIF_do_render(int anim) G.scene->lay |= G.vd->lay; else G.scene->lay= G.vd->lay; - do_render(NULL, anim, 0); + do_render(anim); G.scene->lay= lay; } - else do_render(NULL, anim, 0); + else do_render(anim); if (slink_flag) G.f |= G_DOSCRIPTLINKS; if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_POSTRENDER); } /* set up display, render the current area view in an image */ -void BIF_do_ogl_render(View3D *ogl_render_view3d, int anim) +/* the RE_Render is only used to make sure we got the picture in the result */ +void BIF_do_ogl_render(View3D *v3d, int anim) { - G.scene->r.scemode |= R_OGL; - do_render(ogl_render_view3d, anim, 1); - G.scene->r.scemode &= ~R_OGL; + Render *re= RE_NewRender("Render"); + RenderResult *rr; + int winx, winy; + + G.afbreek= 0; + init_test_break_callback(); + + winx= (G.scene->r.size*G.scene->r.xsch)/100; + winy= (G.scene->r.size*G.scene->r.ysch)/100; + + RE_InitState(re, &G.scene->r, winx, winy, NULL); + + /* for now, result is defaulting to floats still... */ + rr= RE_GetResult(re); + if(rr->rect32==NULL) + rr->rect32= MEM_mallocN(sizeof(int)*winx*winy, "32 bits rects"); + + /* open window */ + renderwin_init_display_cb(rr); + init_gl_stuff(); + + waitcursor(1); + + if(anim) { + bMovieHandle *mh= BKE_get_movie_handle(G.scene->r.imtype); + + mh->start_movie(&G.scene->r, winx, winy); + + for(CFRA= SFRA; CFRArect32); + window_swap_buffers(render_win->win); + + mh->append_movie(CFRA, rr->rect32, winx, winy); + if(test_break()) break; + } + mh->end_movie(); + } + else { + drawview3d_render(v3d, winx, winy); + glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32); + window_swap_buffers(render_win->win); + } + + mainwindow_make_active(); + + if(anim) + scene_update_for_newframe(G.scene, G.scene->lay); // no redraw needed, this restores to view as we left it + + end_test_break_callback(); + waitcursor(0); } void BIF_redraw_render_rect(void) { - /* redraw */ - if (G.displaymode == R_DISPLAYWIN) { - // don't open render_win if rendering has been - // canceled or the render_win has been actively closed - if (render_win) { - renderwin_queue_redraw(render_win); - } - } else { - renderview_init_display_cb(); - renderview_progress_display_cb(0, R.recty-1, R.rectx, R.recty, R.rectot); + if (render_win) { + renderwin_queue_redraw(render_win); } } void BIF_swap_render_rects(void) { +#if 0 unsigned int *temp; if(R.rectspare==0) { @@ -1229,26 +1112,24 @@ void BIF_swap_render_rects(void) R.rectot= R.rectspare; R.rectspare= temp; - if (G.displaymode == R_DISPLAYWIN) { - if (render_win) { - char *tmp= render_win->render_text_spare; - render_win->render_text_spare= render_win->render_text; - render_win->render_text= tmp; - - window_set_title(render_win->win, renderwin_get_title(1)); - - } + if (render_win) { + char *tmp= render_win->render_text_spare; + render_win->render_text_spare= render_win->render_text; + render_win->render_text= tmp; + + window_set_title(render_win->win, renderwin_get_title(1)); + } /* redraw */ BIF_redraw_render_rect(); +#endif } /* called from usiblender.c too, to free and close renderwin */ void BIF_close_render_display(void) { if (render_win) { - if (render_win->info_text) MEM_freeN(render_win->info_text); if (render_win->render_text) MEM_freeN(render_win->render_text); if (render_win->render_text_spare) MEM_freeN(render_win->render_text_spare); @@ -1264,10 +1145,8 @@ void BIF_close_render_display(void) /* typical with F11 key, show image or hide/close */ void BIF_toggle_render_display(void) { - ScrArea *sa= find_dispimage_v3d(); - if(R.rectot==NULL); // do nothing - else if (render_win && G.displaymode==R_DISPLAYWIN) { + if (render_win) { if(render_win->active) { mainwindow_raise(); mainwindow_make_active(); @@ -1279,21 +1158,9 @@ void BIF_toggle_render_display(void) render_win->active= 1; } } - else if (sa && G.displaymode==R_DISPLAYVIEW) { - View3D *vd= sa->spacedata.first; - vd->flag &= ~V3D_DISPIMAGE; - scrarea_queue_winredraw(sa); - } else { - if (G.displaymode == R_DISPLAYWIN) { - renderwin_init_display_cb(); - } else { - if (render_win) { - BIF_close_render_display(); - } - renderview_init_display_cb(); - renderview_progress_display_cb(0, R.recty-1, R.rectx, R.recty, R.rectot); - } + RenderResult *rr= RE_GetResult(RE_GetRender("Render")); + if(rr) renderwin_init_display_cb(rr); } } diff --git a/source/blender/src/screendump.c b/source/blender/src/screendump.c index 557a6f101a5..fc17d0a5759 100644 --- a/source/blender/src/screendump.c +++ b/source/blender/src/screendump.c @@ -55,6 +55,7 @@ #include "BIF_screen.h" #include "BIF_toets.h" #include "BIF_interface.h" +#include "BIF_writeimage.h" #include "BSE_filesel.h" diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index dc6c10f9b17..699d442080f 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -82,7 +82,6 @@ #include "mydevice.h" #include "blendef.h" -#include "render.h" // RE_make_existing_file() void audio_fill(void *mixdown, Uint8 *sstream, int len); @@ -106,7 +105,7 @@ static void makewavstring (char *string) strcpy(string, G.scene->r.pic); BLI_convertstringcode(string, G.sce, G.scene->r.cfra); - RE_make_existing_file(string); + BLI_make_existing_file(string); if (BLI_strcasecmp(string + strlen(string) - 4, ".wav")) { sprintf(txt, "%04d_%04d.wav", (G.scene->r.sfra) , (G.scene->r.efra) ); diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 3191ec1095b..cc39294231f 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -44,6 +44,7 @@ #include "IMB_imbuf.h" #include "DNA_ipo_types.h" +#include "DNA_scene_types.h" #include "DNA_sequence_types.h" #include "DNA_view3d_types.h" @@ -65,8 +66,9 @@ #include "BSE_sequence.h" +#include "RE_pipeline.h" // talks to entire render API + #include "blendef.h" -#include "render.h" // talks to entire render API, and igamtab Sequence *seq_arr[MAXSEQ+1]; int seqrectx, seqrecty; @@ -618,15 +620,47 @@ void do_cross_effect(float facf0, float facf1, int x, int y, unsigned int *rect1 } } +/* copied code from initrender.c */ +static unsigned short *gamtab, *igamtab1; + +static void gamtabs(float gamma) +{ + float val, igamma= 1.0f/gamma; + int a; + + gamtab= MEM_mallocN(65536*sizeof(short), "initGaus2"); + igamtab1= MEM_mallocN(256*sizeof(short), "initGaus2"); + + /* gamtab: in short, out short */ + for(a=0; a<65536; a++) { + val= a; + val/= 65535.0; + + if(gamma==2.0) val= sqrt(val); + else if(gamma!=1.0) val= pow(val, igamma); + + gamtab[a]= (65535.99*val); + } + /* inverse gamtab1 : in byte, out short */ + for(a=1; a<=256; a++) { + if(gamma==2.0) igamtab1[a-1]= a*a-1; + else if(gamma==1.0) igamtab1[a-1]= 256*a-1; + else { + val= a/256.0; + igamtab1[a-1]= (65535.0*pow(val, gamma)) -1 ; + } + } + +} + void do_gammacross_effect(float facf0, float facf1, int x, int y, unsigned int *rect1, unsigned int *rect2, unsigned int *out) { - extern void init_filt_mask(void); // initrender.c, bad level call... int fac1, fac2, col; int xo; char *rt1, *rt2, *rt; - init_filt_mask(); // nasty call to render code... but it uses gamtabs here - + gamtabs(2.0f); + xo= x; rt1= (char *)rect1; rt2= (char *)rect2; @@ -669,8 +703,10 @@ void do_gammacross_effect(float facf0, float facf1, int x, int y, unsigned int * rt1+= 4; rt2+= 4; rt+= 4; } - } + + MEM_freeN(gamtab); + MEM_freeN(igamtab1); } void do_add_effect(float facf0, float facf1, int x, int y, unsigned int *rect1, unsigned int *rect2, unsigned int *out) @@ -1810,9 +1846,6 @@ void do_build_seqar_cfra(ListBase *seqbase, Sequence ***seqar, int cfra) { Sequence *seq; StripElem *se; - Scene *oldsce; - unsigned int *rectot; - int oldx, oldy, oldcfra, doseq; char name[FILE_MAXDIR+FILE_MAXFILE]; if(seqar==NULL) return; @@ -1951,8 +1984,13 @@ void do_build_seqar_cfra(ListBase *seqbase, Sequence ***seqar, int cfra) } } else if(seq->type==SEQ_SCENE && se->ibuf==0 && seq->scene) { // scene can be NULL after deletions + printf("Sorry, sequence scene is not yet back...\n"); +#if 0 View3D *vd; - int redisplay= (!G.background && !(R.flag & R_RENDERING)); + Scene *oldsce; + unsigned int *rectot; + int oldcfra, doseq; + int redisplay= (!G.background && !(G.rendering)); oldsce= G.scene; if(seq->scene!=G.scene) set_scene_bg(seq->scene); /* set_scene does full dep updates */ @@ -1968,57 +2006,57 @@ void do_build_seqar_cfra(ListBase *seqbase, Sequence ***seqar, int cfra) waitcursor(1); - rectot= R.rectot; R.rectot= NULL; - oldx= R.rectx; oldy= R.recty; +// rectot= R.rectot; R.rectot= NULL; +// oldx= R.rectx; oldy= R.recty; /* needed because current 3D window cannot define the layers, like in a background render */ vd= G.vd; G.vd= NULL; - RE_initrender(NULL); +// RE_initrender(NULL); if (redisplay) { mainwindow_make_active(); - if(R.r.mode & R_FIELDS) update_for_newframe_muted(); - R.flag= 0; +// if(R.r.mode & R_FIELDS) update_for_newframe_muted(); +// R.flag= 0; free_filesel_spec(G.scene->r.pic); } - se->ibuf= IMB_allocImBuf(R.rectx, R.recty, 32, IB_rect, 0); - if(R.rectot) memcpy(se->ibuf->rect, R.rectot, 4*R.rectx*R.recty); - if(R.rectz) { - se->ibuf->zbuf= (int *)R.rectz; +// se->ibuf= IMB_allocImBuf(R.rectx, R.recty, 32, IB_rect, 0); +// if(R.rectot) memcpy(se->ibuf->rect, R.rectot, 4*R.rectx*R.recty); +// if(R.rectz) { +// se->ibuf->zbuf= (int *)R.rectz; /* make sure ibuf frees it */ - se->ibuf->mall |= IB_zbuf; - R.rectz= NULL; - } +// se->ibuf->mall |= IB_zbuf; +// R.rectz= NULL; +// } /* and restore */ G.vd= vd; if((G.f & G_PLAYANIM)==0) waitcursor(0); CFRA= oldcfra; - if(R.rectot) MEM_freeN(R.rectot); - R.rectot= rectot; - R.rectx=oldx; R.recty=oldy; +// if(R.rectot) MEM_freeN(R.rectot); +// R.rectot= rectot; +// R.rectx=oldx; R.recty=oldy; G.scene->r.scemode |= doseq; if(seq->scene!=oldsce) set_scene_bg(oldsce); /* set_scene does full dep updates */ /* restore!! */ - R.rectx= seqrectx; - R.recty= seqrecty; +// R.rectx= seqrectx; +// R.recty= seqrecty; /* added because this flag is checked for * movie writing when rendering an anim. * very convoluted. fix. -zr */ - R.r.imtype= G.scene->r.imtype; +// R.r.imtype= G.scene->r.imtype; +#endif } - /* size test */ if(se->ibuf) { if(se->ibuf->x != seqrectx || se->ibuf->y != seqrecty ) { - if (G.scene->r.mode & R_FIELDS) { + if (0) { //G.scene->r.mode & R_FIELDS) { if (seqrecty > 288) IMB_scalefieldImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); else { @@ -2046,7 +2084,7 @@ void do_build_seqar_cfra(ListBase *seqbase, Sequence ***seqar, int cfra) } } -ImBuf *give_ibuf_seq(int cfra) +ImBuf *give_ibuf_seq(int rectx, int recty, int cfra) { Sequence **tseqar, **seqar; Sequence *seq, *seqfirst=0;/* , *effirst=0; */ @@ -2066,12 +2104,10 @@ ImBuf *give_ibuf_seq(int cfra) if(totseq==0) return 0; - seqrectx= (G.scene->r.size*G.scene->r.xsch)/100; - if(G.scene->r.mode & R_PANORAMA) seqrectx*= G.scene->r.xparts; - seqrecty= (G.scene->r.size*G.scene->r.ysch)/100; - + seqrectx= rectx; /* bad bad global! */ + seqrecty= recty; - /* tseqar is neede because in do_build_... the pointer changes */ + /* tseqar is needed because in do_build_... the pointer changes */ seqar= tseqar= MEM_callocN(sizeof(void *)*totseq, "seqar"); /* this call loads and makes the ibufs */ @@ -2232,19 +2268,17 @@ void free_imbuf_seq() END_SEQ } -void do_render_seq() +/* bad levell call... renderer makes a 32 bits rect to put result in */ +void do_render_seq(RenderResult *rr) { -/* static ImBuf *lastibuf=0; */ ImBuf *ibuf; - /* copy image into R.rectot */ - G.f |= G_PLAYANIM; /* waitcursor patch */ - ibuf= give_ibuf_seq(CFRA); - if(ibuf) { - - memcpy(R.rectot, ibuf->rect, 4*R.rectx*R.recty); + ibuf= give_ibuf_seq(rr->rectx, rr->recty, CFRA); + if(ibuf && rr->rect32) { + printf("copied\n"); + memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty); /* if (ibuf->zbuf) { */ /* if (R.rectz) freeN(R.rectz); */ diff --git a/source/blender/src/space.c b/source/blender/src/space.c index f2ef4cbd566..06a27a38868 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -215,6 +215,11 @@ void toggle_blockhandler(ScrArea *sa, short eventcode, short val) for(a=0; ablockhandler[a]==eventcode ) { sl->blockhandler[a]= 0; + + /* specific free calls */ + if(eventcode==VIEW3D_HANDLER_PREVIEW) + BIF_view3d_previewrender_free(sa); + addnew= 0; } } @@ -512,7 +517,7 @@ void start_game(void) static void changeview3dspace(ScrArea *sa, void *spacedata) { - setwinmatrixview3d(0); /* 0= no pick rect */ + setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */ } /* Callable from editmode and faceselect mode from the @@ -921,10 +926,14 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) switch(event) { + /* Afterqueue events */ case BACKBUFDRAW: backdrawview3d(1); break; - + case RENDERPREVIEW: + BIF_view3d_previewrender(sa); + break; + /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above, * based on user preference USER_LMOUSESELECT */ @@ -1588,7 +1597,9 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) else if(G.qual==LR_ALTKEY) clear_parent(); else if((G.qual==0)) { - start_game(); + toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0); + doredraw= 1; + //start_game(); } break; case RKEY: @@ -4619,11 +4630,11 @@ void newspace(ScrArea *sa, int type) } } -void freespacelist(ListBase *lb) +void freespacelist(ScrArea *sa) { SpaceLink *sl; - for (sl= lb->first; sl; sl= sl->next) { + for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_FILE) { SpaceFile *sfile= (SpaceFile*) sl; if(sfile->libfiledata) @@ -4655,6 +4666,11 @@ void freespacelist(ListBase *lb) if(vd->localvd) MEM_freeN(vd->localvd); if(vd->clipbb) MEM_freeN(vd->clipbb); if(G.vd==vd) G.vd= NULL; + if(vd->ri) { + BIF_view3d_previewrender_free(sa); + if (vd->ri->rect) MEM_freeN(vd->ri->rect); + MEM_freeN(vd->ri); + } } else if(sl->spacetype==SPACE_OOPS) { free_oopspace((SpaceOops *)sl); @@ -4687,7 +4703,7 @@ void freespacelist(ListBase *lb) } } - BLI_freelistN(lb); + BLI_freelistN(&sa->spacedata); } void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2) diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 8eba2c0acd8..0770c05cff5 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -53,6 +53,7 @@ #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "DNA_scene_types.h" #include "DNA_space_types.h" #include "DNA_view3d_types.h" #include "DNA_userdef_types.h" @@ -76,12 +77,14 @@ #include "BIF_interface.h" #include "BKE_object.h" #include "BIF_poseobject.h" +#include "BIF_previewrender.h" #include "BIF_renderwin.h" #include "BIF_screen.h" #include "BIF_space.h" #include "BIF_toets.h" #include "BIF_toolbox.h" #include "BIF_usiblender.h" +#include "BIF_writeimage.h" #include "BDR_vpaint.h" #include "BDR_editobject.h" @@ -96,7 +99,6 @@ #include "BSE_seqaudio.h" #include "blendef.h" -#include "render.h" // darn schrijfplaatje() (ton) #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" @@ -105,161 +107,6 @@ #include "BIF_poseobject.h" -/* only used in toets.c and initrender.c */ -/* this function doesn't really belong here */ -/* ripped from render module */ -void schrijfplaatje(char *name); - - -static void write_imag(char *name) -{ - /* from file select */ - char str[256]; - - /* addImageExtension() checks for if extension was already set */ - if(G.scene->r.scemode & R_EXTENSION) - if(strlen(name)r.cfra); - - if(saveover(str)) { - if(BLI_testextensie(str,".blend")) { - error("Wrong filename"); - return; - } - waitcursor(1); /* from screen.c */ - schrijfplaatje(str); - strcpy(G.ima, name); - waitcursor(0); - } -} - - -/* From matrix.h: it's really a [4][4]! */ -/* originally in initrender... maybe add fileControl thingy? */ - -/* should be called write_image(char *name) :-) */ -void schrijfplaatje(char *name) -{ - struct ImBuf *ibuf=0; - unsigned int *temprect=0; - char str[FILE_MAXDIR+FILE_MAXFILE]; - - /* has RGBA been set? If so: use alpha channel for color zero */ - IMB_alpha_to_col0(FALSE); - - if(R.r.planes == 32) { - /* everything with less than 50 % alpha -> col 0 */ - if(R.r.alphamode == R_ALPHAKEY) IMB_alpha_to_col0(2); - /* only when 0 alpha -> col 0 */ - else IMB_alpha_to_col0(1); - } - - /* Seems to me this is also superfluous.... */ - if (R.r.imtype==R_FTYPE) { - strcpy(str, R.r.ftype); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); - - ibuf = IMB_loadiffname(str, IB_test); - if(ibuf) { - ibuf->x = R.rectx; - ibuf->y = R.recty; - } - else { - error("Can't find filetype"); - G.afbreek= 1; - return; - } - /* setdither(2); */ - } - - if(ibuf == 0) { - ibuf= IMB_allocImBuf(R.rectx, R.recty, (char) R.r.planes, 0, 0); - } - - if(ibuf) { - ibuf->rect= (unsigned int *) R.rectot; - ibuf->rect_float = R.rectftot; - - if(R.r.planes == 8) IMB_cspace(ibuf, rgb_to_bw); - - if(R.r.imtype== R_IRIS) { - ibuf->ftype= IMAGIC; - } - else if(R.r.imtype==R_IRIZ) { - ibuf->ftype= IMAGIC; - if (ibuf->zbuf == 0) { - if (R.rectz) - ibuf->zbuf = (int *)R.rectz; - else printf("no zbuf\n"); - } - } - else if(R.r.imtype==R_RADHDR) { - ibuf->ftype= RADHDR; - } - else if(R.r.imtype==R_PNG) { - ibuf->ftype= PNG; - } - else if(R.r.imtype==R_BMP) { - ibuf->ftype= BMP; - } - else if((G.have_libtiff) && (R.r.imtype==R_TIFF)) { - ibuf->ftype= TIF; - } -#ifdef WITH_OPENEXR - else if(R.r.imtype==R_OPENEXR) { - /* ibuf stores bitmasks for types */ - ibuf->ftype= OPENEXR; - if(R.r.subimtype & R_OPENEXR_HALF) - ibuf->ftype |= OPENEXR_HALF; - - ibuf->ftype |= (R.r.quality & OPENEXR_COMPRESS); - - if(R.rectzf && (R.r.subimtype & R_OPENEXR_ZBUF)) - ibuf->zbuf_float = R.rectzf; - } -#endif - else if((R.r.imtype==R_TARGA) || (R.r.imtype==R_PNG)) { - ibuf->ftype= TGA; - } - else if(R.r.imtype==R_RAWTGA) { - ibuf->ftype= RAWTGA; - } - else if(R.r.imtype==R_HAMX) { - /* make copy */ - temprect= MEM_dupallocN(R.rectot); - ibuf->ftype= AN_hamx; - } - else if(ELEM5(R.r.imtype, R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90)) { - if(R.r.quality < 10) R.r.quality= 90; - - if(R.r.mode & R_FIELDS) ibuf->ftype= JPG_VID|R.r.quality; - else ibuf->ftype= JPG|R.r.quality; - } - - RE_make_existing_file(name); - - if(IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)==0) { - perror(name); - G.afbreek= 1; - } - - IMB_freeImBuf(ibuf); - - if (R.r.imtype==R_HAMX) { - MEM_freeN(R.rectot); - R.rectot= temprect; - } - } - else { - G.afbreek= 1; - } -} - - - /* ------------------------------------------------------------------------- */ static int is_an_active_object(void *ob) { @@ -277,6 +124,7 @@ void persptoetsen(unsigned short event) static Object *oldcamera=0; float phi, si, q1[4], vec[3]; static int perspo=1; + int preview3d_event= 1; if(event==PADENTER) { if (G.qual == LR_SHIFTKEY) { @@ -323,15 +171,15 @@ void persptoetsen(unsigned short event) else if(event==PADMINUS) { /* this min and max is also in viewmove() */ if(G.vd->persp==2) { - G.vd->camzoom-= 10; - if(G.vd->camzoom<-30) G.vd->camzoom= -30; - } + G.vd->camzoom-= 10; + if(G.vd->camzoom<-30) G.vd->camzoom= -30; + } else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f; } else if(event==PADPLUSKEY) { if(G.vd->persp==2) { - G.vd->camzoom+= 10; - if(G.vd->camzoom>300) G.vd->camzoom= 300; + G.vd->camzoom+= 10; + if(G.vd->camzoom>300) G.vd->camzoom= 300; } else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f; } @@ -383,12 +231,14 @@ void persptoetsen(unsigned short event) G.vd->camzoom= MAX2(-30, G.vd->camzoom-5); } else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f; + if(G.vd->persp!=1) preview3d_event= 0; } else if(event==PADPLUSKEY) { if(G.vd->persp==2) { G.vd->camzoom= MIN2(300, G.vd->camzoom+5); } else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f; + if(G.vd->persp!=1) preview3d_event= 0; } else if(event==PAD5) { if(G.vd->persp==1) G.vd->persp=0; @@ -471,6 +321,12 @@ void persptoetsen(unsigned short event) if(G.vd->persp<2) perspo= G.vd->persp; } + + if(preview3d_event) + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); + else + BIF_view3d_previewrender_signal(curarea, PR_PROJECTED); + scrarea_queue_redraw(curarea); } @@ -490,67 +346,6 @@ int untitled(char * name) return(FALSE); } -int save_image_filesel_str(char *str) -{ - switch(G.scene->r.imtype) { - case R_RADHDR: - strcpy(str, "Save Radiance HDR"); return 1; - case R_PNG: - strcpy(str, "Save PNG"); return 1; - case R_BMP: - strcpy(str, "Save BMP"); return 1; - case R_TIFF: - if (G.have_libtiff) { - strcpy(str, "Save TIFF"); return 1; - } -#ifdef WITH_OPENEXR - case R_OPENEXR: - strcpy(str, "Save OpenEXR"); return 1; -#endif - case R_TARGA: - strcpy(str, "Save Targa"); return 1; - case R_RAWTGA: - strcpy(str, "Save Raw Targa"); return 1; - case R_IRIS: - strcpy(str, "Save IRIS"); return 1; - case R_IRIZ: - strcpy(str, "Save IRIS"); return 1; - case R_HAMX: - strcpy(str, "Save HAMX"); return 1; - case R_FTYPE: - strcpy(str, "Save Ftype"); return 1; - case R_JPEG90: - strcpy(str, "Save JPEG"); return 1; - default: - strcpy(str, "Save Image"); return 0; - } -} - -void BIF_save_rendered_image(void) -{ - if(!R.rectot) { - error("No image rendered"); - } else { - char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2]; - - if(G.ima[0]==0) { - strcpy(dir, G.sce); - BLI_splitdirstring(dir, str); - strcpy(G.ima, dir); - } - - R.r.imtype= G.scene->r.imtype; - R.r.subimtype= G.scene->r.subimtype; - R.r.quality= G.scene->r.quality; - R.r.planes= G.scene->r.planes; - - if (!save_image_filesel_str(str)) { - error("Select an image type in DisplayButtons(F10)"); - } else { - activate_fileselect(FILE_SPECIAL, str, G.ima, write_imag); - } - } -} int blenderqread(unsigned short event, short val) { @@ -608,7 +403,7 @@ int blenderqread(unsigned short event, short val) break; case F3KEY: if(G.qual==0) { - BIF_save_rendered_image(); + BIF_save_rendered_image_fs(); return 0; } else if(G.qual & LR_CTRLKEY) { @@ -889,10 +684,10 @@ int blenderqread(unsigned short event, short val) break; case JKEY: if(textediting==0 && textspace==0) { - if(R.rectot && G.qual==0) { +// if(R.rectot && G.qual==0) { BIF_swap_render_rects(); return 0; - } +// } } break; diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index bc111938538..876177e0f7b 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -113,7 +113,6 @@ #include "mydevice.h" #include "blendef.h" -#include "render.h" // R.flag static int tbx1, tbx2, tby1, tby2, tbfontyofs, tbmain=0; static int tbmemx=TBOXX/2, tbmemy=(TBOXEL-0.5)*TBOXH, tboldwin, addmode= 0; @@ -1102,7 +1101,7 @@ void error(char *fmt, ...) sprintf(nfmt, "%s", fmt); va_start(ap, fmt); - if (G.background || !G.curscreen || (R.flag & R_RENDERING)) { + if (G.background || !G.curscreen || (G.rendering)) { vprintf(nfmt, ap); printf("\n"); } else { diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index e0b21a6475e..7e085389b8c 100755 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -2478,5 +2478,8 @@ void createTransData(TransInfo *t) if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp>1) { t->flag |= T_CAMERA; } + + /* temporal...? */ + G.scene->recalc |= SCE_PRV_CHANGED; /* test for 3d preview */ } diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c index 6b16a3b0497..e354fa0ff7b 100644 --- a/source/blender/src/transform_manipulator.c +++ b/source/blender/src/transform_manipulator.c @@ -1488,7 +1488,7 @@ static int manipulator_selectbuf(ScrArea *sa, float hotspot) /* get rid of overlay button matrix */ persp(PERSP_VIEW); - setwinmatrixview3d(&rect); + setwinmatrixview3d(sa->winx, sa->winy, &rect); Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); glSelectBuffer( 64, buffer); @@ -1510,7 +1510,7 @@ static int manipulator_selectbuf(ScrArea *sa, float hotspot) hits= glRenderMode(GL_RENDER); G.f &= ~G_PICKSEL; - setwinmatrixview3d(0); + setwinmatrixview3d(sa->winx, sa->winy, NULL); Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); persp(PERSP_WIN); diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 90a8c8cc78c..a834f790141 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -62,6 +62,7 @@ #include "DNA_space_types.h" #include "DNA_userdef_types.h" #include "DNA_sound_types.h" +#include "DNA_scene_types.h" #include "BKE_blender.h" #include "BKE_curve.h" @@ -88,6 +89,7 @@ #include "BIF_editmode_undo.h" #include "BIF_editsound.h" #include "BIF_poseobject.h" +#include "BIF_previewrender.h" #include "BIF_renderwin.h" #include "BIF_resources.h" #include "BIF_screen.h" @@ -114,8 +116,9 @@ #include "blendef.h" +#include "RE_pipeline.h" /* RE_ free stuff */ + #include "radio.h" -#include "render.h" /* RE_ free stuff */ #include "datatoc.h" #include "SYS_System.h" @@ -679,7 +682,9 @@ void BIF_init(void) sound_init_listener(); init_node_butfuncs(); + BIF_preview_init_dbase(); BIF_read_homefile(); + init_gl_stuff(); /* drawview.c, after homefile */ readBlog(); strcpy(G.lib, G.sce); @@ -736,7 +741,7 @@ void exit_usiblender(void) free_languagemenu(); #endif - RE_free_render_data(); + RE_FreeAllRender(); free_txt_data(); @@ -772,7 +777,8 @@ void exit_usiblender(void) BKE_reset_undo(); BLI_freelistN(&U.themes); - + BIF_preview_free_dbase(); + if(totblock!=0) { printf("Error Totblock: %d\n",totblock); MEM_printmemlist(); diff --git a/source/blender/src/view.c b/source/blender/src/view.c index d62fc90ee05..b2999c65d2b 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -70,6 +70,7 @@ #include "BIF_gl.h" #include "BIF_space.h" #include "BIF_mywindow.h" +#include "BIF_previewrender.h" #include "BIF_screen.h" #include "BIF_toolbox.h" @@ -83,9 +84,6 @@ #include "mydevice.h" #include "blendef.h" -/* Modules used */ -#include "render.h" /* R. stuff for ogl view render */ - #define TRACKBALLSIZE (1.1) #define BL_NEAR_CLIP 0.001 @@ -536,6 +534,7 @@ void viewmove(int mode) int firsttime=1; short mvalball[2], mval[2], mvalo[2]; short use_sel = 0; + short preview3d_event= 1; /* sometimes this routine is called from headerbuttons */ areawinset(curarea->win); @@ -701,6 +700,7 @@ void viewmove(int mode) G.vd->camdy += (mvalo[1]-mval[1])/(max); CLAMP(G.vd->camdx, -1.0f, 1.0f); CLAMP(G.vd->camdy, -1.0f, 1.0f); + preview3d_event= 0; } else { window_to_3d(dvec, mval[0]-mvalo[0], mval[1]-mvalo[1]); @@ -737,6 +737,8 @@ void viewmove(int mode) mval[1]= mvalo[1]; /* preserve first value */ mval[0]= mvalo[0]; + + if(G.vd->persp==0 || G.vd->persp==2) preview3d_event= 0; } mvalo[0]= mval[0]; @@ -760,26 +762,29 @@ void viewmove(int mode) /* this in the end, otherwise get_mbut does not work on a PC... */ if( !(get_mbut() & (L_MOUSE|M_MOUSE))) break; } -} -short v3d_windowmode=0; + if(preview3d_event) + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); + else + BIF_view3d_previewrender_signal(curarea, PR_PROJECTED); + +} -/* important to not set windows active in here, can be renderwin for example */ -void setwinmatrixview3d(rctf *rect) /* rect: for picking */ +int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend) { - Camera *cam=0; - float near, far, winx = 0.0, winy = 0.0; + Camera *cam=NULL; float lens, fac, x1, y1, x2, y2; - short orth; + float winx= (float)winxi, winy= (float)winyi; + int orth= 0; lens= G.vd->lens; - near= G.vd->near; - far= G.vd->far; + *clipsta= G.vd->near; + *clipend= G.vd->far; if(G.vd->persp==2) { - near= G.vd->near; - far= G.vd->far; + *clipsta= G.vd->near; + *clipend= G.vd->far; if(G.vd->camera) { if(G.vd->camera->type==OB_LAMP ) { Lamp *la; @@ -790,27 +795,18 @@ void setwinmatrixview3d(rctf *rect) /* rect: for picking */ x1= saacos(fac); lens= 16.0*fac/sin(x1); - near= la->clipsta; - far= la->clipend; + *clipsta= la->clipsta; + *clipend= la->clipend; } else if(G.vd->camera->type==OB_CAMERA) { cam= G.vd->camera->data; lens= cam->lens; - near= cam->clipsta; - far= cam->clipend; + *clipsta= cam->clipsta; + *clipend= cam->clipend; } } } - if(v3d_windowmode) { // hackish - winx= R.rectx; - winy= R.recty; - } - else { - winx= curarea->winx; - winy= curarea->winy; - } - if(G.vd->persp==0) { if(winx>winy) x1= -G.vd->dist; else x1= -winx*G.vd->dist/winy; @@ -820,8 +816,8 @@ void setwinmatrixview3d(rctf *rect) /* rect: for picking */ else y1= -G.vd->dist; y2= -y1; - far*= 0.5; // otherwise too extreme low zbuffer quality - near= -far; + *clipend *= 0.5; // otherwise too extreme low zbuffer quality + *clipsta= - *clipend; orth= 1; } else { @@ -851,9 +847,9 @@ void setwinmatrixview3d(rctf *rect) /* rect: for picking */ if(winx>winy) dfac= 64.0/(fac*winx*lens); else dfac= 64.0/(fac*winy*lens); - x1= - near*winx*dfac; + x1= - *clipsta * winx*dfac; x2= -x1; - y1= - near*winy*dfac; + y1= - *clipsta * winy*dfac; y2= -y1; orth= 0; } @@ -867,40 +863,54 @@ void setwinmatrixview3d(rctf *rect) /* rect: for picking */ y2+= dy; } } + + viewplane->xmin= x1; + viewplane->ymin= y1; + viewplane->xmax= x2; + viewplane->ymax= y2; + + return orth; +} +/* important to not set windows active in here, can be renderwin for example */ +void setwinmatrixview3d(int winx, int winy, rctf *rect) /* rect: for picking */ +{ + rctf viewplane; + float clipsta, clipend, x1, y1, x2, y2; + int orth; + + orth= get_view3d_viewplane(winx, winy, &viewplane, &clipsta, &clipend); +// printf("%d %d %f %f %f %f %f %f\n", winx, winy, viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, clipsta, clipend); + x1= viewplane.xmin; + y1= viewplane.ymin; + x2= viewplane.xmax; + y2= viewplane.ymax; + if(rect) { /* picking */ - rect->xmin/= winx; + rect->xmin/= (float)curarea->winx; rect->xmin= x1+rect->xmin*(x2-x1); - rect->ymin/= winy; + rect->ymin/= (float)curarea->winy; rect->ymin= y1+rect->ymin*(y2-y1); - rect->xmax/= winx; + rect->xmax/= (float)curarea->winx; rect->xmax= x1+rect->xmax*(x2-x1); - rect->ymax/= winy; + rect->ymax/= (float)curarea->winy; rect->ymax= y1+rect->ymax*(y2-y1); - - if(orth) myortho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -far, far); - else mywindow(rect->xmin, rect->xmax, rect->ymin, rect->ymax, near, far); - + + if(orth) myortho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend); + else mywindow(rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend); + } else { - if(v3d_windowmode) { - if(orth) i_ortho(x1, x2, y1, y2, near, far, R.winmat); - else i_window(x1, x2, y1, y2, near, far, R.winmat); - } - else { - if(orth) myortho(x1, x2, y1, y2, near, far); - else mywindow(x1, x2, y1, y2, near, far); - } + if(orth) myortho(x1, x2, y1, y2, clipsta, clipend); + else mywindow(x1, x2, y1, y2, clipsta, clipend); } - if(v3d_windowmode==0) { - glMatrixMode(GL_PROJECTION); - mygetmatrix(curarea->winmat); - glMatrixMode(GL_MODELVIEW); - } + /* not sure what this was for? (ton) */ + glMatrixMode(GL_PROJECTION); + mygetmatrix(curarea->winmat); + glMatrixMode(GL_MODELVIEW); } - void obmat_to_viewmat(Object *ob) { float bmat[4][4]; @@ -987,7 +997,7 @@ short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1 } /* get rid of overlay button matrix */ persp(PERSP_VIEW); - setwinmatrixview3d(&rect); + setwinmatrixview3d(curarea->winx, curarea->winy, &rect); Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat); if(G.vd->drawtype > OB_WIRE) { @@ -1051,7 +1061,7 @@ short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1 if(hits<0) error("Too many objects in select buffer"); G.f &= ~G_PICKSEL; - setwinmatrixview3d(0); + setwinmatrixview3d(curarea->winx, curarea->winy, NULL); Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat); if(G.vd->drawtype > OB_WIRE) { @@ -1206,6 +1216,7 @@ void initlocalview() G.vd->localview= 0; } + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); } void centreview() /* like a localview without local! */ @@ -1288,6 +1299,7 @@ void centreview() /* like a localview without local! */ G.vd->cursor[2]= -G.vd->ofs[2]; scrarea_queue_winredraw(curarea); + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); } @@ -1349,7 +1361,7 @@ void endlocalview(ScrArea *sa) countall(); allqueue(REDRAWVIEW3D, 0); /* because of select */ allqueue(REDRAWOOPS, 0); /* because of select */ - + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); } } @@ -1404,6 +1416,8 @@ void view3d_home(int centre) scrarea_queue_winredraw(curarea); } + BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); + } diff --git a/source/blender/src/writeavicodec.c b/source/blender/src/writeavicodec.c index 8e9ee8932aa..ace6ac8bf25 100644 --- a/source/blender/src/writeavicodec.c +++ b/source/blender/src/writeavicodec.c @@ -55,9 +55,6 @@ #include "BLI_blenlib.h" #include "DNA_userdef_types.h" -#include "render_types.h" -#include "render.h" // lotsof R. stuff - #include "BKE_global.h" #include "BKE_scene.h" #include "BKE_writeavi.h" @@ -646,6 +643,7 @@ static int open_avi_codec_file(char * name) void end_avi_codec(void) { +#if 0 free_opts_data(); if (psUncompressed) { @@ -667,11 +665,13 @@ void end_avi_codec(void) AVIFileExit(); avifileinitdone--; } +#endif } void start_avi_codec(void) { +#if 0 HRESULT hr; BITMAPINFOHEADER bmi; char name[2048]; @@ -731,11 +731,13 @@ void start_avi_codec(void) BLI_move(bakname, name); } } +#endif } void append_avi_codec(int frame) { +#if 0 HRESULT hr; BITMAPINFOHEADER bmi; RGBTRIPLE *buffer, *to; @@ -777,11 +779,13 @@ void append_avi_codec(int frame) printf ("added frame %3d (frame %3d in avi): ", frame, frame-sframe); } } +#endif } int get_avicodec_settings(void) { +#if 0 int ret_val = 0; AVICOMPRESSOPTIONS *aopts[1] = {&opts}; AviCodecData *acd = G.scene->r.avicodecdata; @@ -824,6 +828,7 @@ int get_avicodec_settings(void) } return(ret_val); +#endif } #endif // _WIN32 diff --git a/source/blender/src/writeimage.c b/source/blender/src/writeimage.c index 4f1224eabff..1e89c8e8bba 100644 --- a/source/blender/src/writeimage.c +++ b/source/blender/src/writeimage.c @@ -30,77 +30,35 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ +#include + +#include "MEM_guardedalloc.h" + #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" // ImBuf{} +#include "BLI_blenlib.h" + #include "DNA_scene_types.h" +#include "DNA_space_types.h" #include "DNA_texture_types.h" // EnvMap{} #include "DNA_image_types.h" // Image{} #include "BKE_global.h" // struct G +#include "BKE_image.h" #include "BKE_utildefines.h" // ELEM +#include "BIF_screen.h" // waitcursor +#include "BIF_toolbox.h" #include "BIF_writeimage.h" -#include "render.h" // RE_make_existing_file, R. stuff - -int BIF_write_ibuf(ImBuf *ibuf, char *name) -{ - int ok; - - /* to be used for e.g. envmap, not rendered images */ - - if(G.scene->r.imtype== R_IRIS) ibuf->ftype= IMAGIC; - else if ((G.scene->r.imtype==R_RADHDR)) { - ibuf->ftype= RADHDR; - } - else if ((G.scene->r.imtype==R_PNG)) { - ibuf->ftype= PNG; - } - else if ((G.scene->r.imtype==R_BMP)) { - ibuf->ftype= BMP; - } - else if ((G.have_libtiff) && (G.scene->r.imtype==R_TIFF)) { - ibuf->ftype= TIF; - } -#ifdef WITH_OPENEXR - else if (G.scene->r.imtype==R_OPENEXR) { - ibuf->ftype= OPENEXR; - if(G.scene->r.subimtype & R_OPENEXR_HALF) - ibuf->ftype |= OPENEXR_HALF; - ibuf->ftype |= (G.scene->r.quality & OPENEXR_COMPRESS); - } -#endif - else if ((G.scene->r.imtype==R_TARGA) || (G.scene->r.imtype==R_PNG)) { - // fall back to Targa if PNG writing is not supported - ibuf->ftype= TGA; - } - else if(G.scene->r.imtype==R_RAWTGA) { - ibuf->ftype= RAWTGA; - } - else if(G.scene->r.imtype==R_HAMX) { - ibuf->ftype= AN_hamx; - } - else if ELEM(G.scene->r.imtype, R_JPEG90, R_MOVIE) { - if(G.scene->r.quality < 10) G.scene->r.quality= 90; - - ibuf->ftype= JPG|G.scene->r.quality; - } - else ibuf->ftype= TGA; - - RE_make_existing_file(name); - - ok = IMB_saveiff(ibuf, name, IB_rect); - if (ok == 0) { - perror(name); - } - - return(ok); -} +#include "BSE_filesel.h" +#include "RE_pipeline.h" /* ------------------------------------------------------------------------- */ + void BIF_save_envmap(EnvMap *env, char *str) { ImBuf *ibuf; @@ -120,6 +78,116 @@ void BIF_save_envmap(EnvMap *env, char *str) IMB_rectcpy(ibuf, env->cube[4]->ibuf, dx, dx, 0, 0, dx, dx); IMB_rectcpy(ibuf, env->cube[5]->ibuf, 2*dx, dx, 0, 0, dx, dx); - BIF_write_ibuf(ibuf, str); + BKE_write_ibuf(ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality); IMB_freeImBuf(ibuf); } + + +/* callback for fileselect to save rendered image, renderresult was checked to exist */ +static void save_rendered_image_cb(char *name) +{ + char str[FILE_MAXDIR+FILE_MAXFILE]; + + if(BLI_testextensie(str,".blend")) { + error("Wrong filename"); + return; + } + + /* BKE_add_image_extension() checks for if extension was already set */ + if(G.scene->r.scemode & R_EXTENSION) + if(strlen(name)r.imtype); + + strcpy(str, name); + BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + + if(saveover(str)) { + RenderResult *rr= RE_GetResult(RE_GetRender("Render")); + RenderLayer *rl= rr->layers.first; + ImBuf *ibuf; + + waitcursor(1); /* from screen.c */ + + ibuf= IMB_allocImBuf(rr->rectx, rr->recty, G.scene->r.planes, 0, 0); + ibuf->rect= rr->rect32; + ibuf->rect_float= rl->rectf; + ibuf->zbuf_float= rl->rectz; + + BKE_write_ibuf(ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality); + IMB_freeImBuf(ibuf); /* imbuf knows rects are not part of ibuf */ + + strcpy(G.ima, name); + + waitcursor(0); + } +} + +void save_image_filesel_str(char *str) +{ + switch(G.scene->r.imtype) { + case R_RADHDR: + strcpy(str, "Save Radiance HDR"); + break; + case R_PNG: + strcpy(str, "Save PNG"); + break; + case R_BMP: + strcpy(str, "Save BMP"); + break; + case R_TIFF: + if (G.have_libtiff) + strcpy(str, "Save TIFF"); + break; +#ifdef WITH_OPENEXR + case R_OPENEXR: + strcpy(str, "Save OpenEXR"); + break; +#endif + case R_RAWTGA: + strcpy(str, "Save Raw Targa"); + break; + case R_IRIS: + strcpy(str, "Save IRIS"); + break; + case R_IRIZ: + strcpy(str, "Save IRIS"); + break; + case R_HAMX: + strcpy(str, "Save HAMX"); + break; + case R_JPEG90: + case R_MOVIE: + case R_AVICODEC: + case R_AVIRAW: + case R_AVIJPEG: + strcpy(str, "Save JPEG"); + break; + + case R_TARGA: /* default targa */ + default: + strcpy(str, "Save Targa"); + break; + } +} + +/* calls fileselect */ +void BIF_save_rendered_image_fs(void) +{ + RenderResult *rr= RE_GetResult(RE_GetRender("Render")); + + if(!rr) { + error("No image rendered"); + } else { + char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2]; + + if(G.ima[0]==0) { + strcpy(dir, G.sce); + BLI_splitdirstring(dir, str); + strcpy(G.ima, dir); + } + + save_image_filesel_str(str); + activate_fileselect(FILE_SPECIAL, str, G.ima, save_rendered_image_cb); + } +} + diff --git a/source/blender/src/writemovie.c b/source/blender/src/writemovie.c index 2c80200f904..3491f4f0f60 100644 --- a/source/blender/src/writemovie.c +++ b/source/blender/src/writemovie.c @@ -102,7 +102,7 @@ static void make_movie_name(char *string) BLI_convertstringcode(string, G.sce, G.scene->r.cfra); len= strlen(string); - RE_make_existing_file(string); + BLI_make_existing_file(string); if (BLI_strcasecmp(string + len - 3, ".mv")) { sprintf(txt, "%04d_%04d.mv", sfra, efra); diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index 79e83704ee9..d9124c902c2 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -291,7 +291,7 @@ void yafrayFileRender_t::displayImage() // read data directly into buffer, picture is upside down for (unsigned short y=0;ynext, i++) { + LampRen* lamp = (LampRen *)go->lampren; + ostr.str(""); - LampRen* lamp = R.la[i]; if (lamp->type==LA_AREA) { writeAreaLamp(lamp, i, iview); continue; } diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index fc587bab2e0..26de34dd488 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -190,14 +190,14 @@ bool yafrayPluginRender_t::initExport() } // all buffers allocated in initrender.c - unsigned int *bpt=R.rectot, count=R.rectx*R.recty; - while (--count) bpt[count] = 0xff800000; - cout << "Image initialized" << endl; +// unsigned int *bpt=R.rectot, count=R.rectx*R.recty; +// while (--count) bpt[count] = 0xff800000; +// cout << "Image initialized" << endl; - int *zbuf=R.rectz; - count = R.rectx*R.recty; - while (--count) zbuf[count] = 0x7fffffff; - cout << "Zbuffer initialized" << endl; +// int *zbuf=R.rectz; +// count = R.rectx*R.recty; +// while (--count) zbuf[count] = 0x7fffffff; +// cout << "Zbuffer initialized" << endl; // no need to fill ftot @@ -275,7 +275,7 @@ void yafrayPluginRender_t::displayImage() // maybe it is best to just do a read here, for now the yafray output is always a raw tga anyway // rectot already freed in initrender - R.rectot = (unsigned int *)MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); +// R.rectot = (unsigned int *)MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot"); FILE* fp = fopen(imgout.c_str(), "rb"); if (fp==NULL) { @@ -294,7 +294,7 @@ void yafrayPluginRender_t::displayImage() // read data directly into buffer, picture is upside down for (unsigned short y=0;ynext, i++) { + LampRen* lamp = (LampRen *)go->lampren; + yafray::paramMap_t params; string type=""; - LampRen* lamp = R.la[i]; if (lamp->type==LA_AREA) { writeAreaLamp(lamp, i, iview); continue; } @@ -1905,13 +1909,11 @@ bool yafrayPluginRender_t::writeWorld() return true; } -#include "RE_callbacks.h" - bool blenderYafrayOutput_t::putPixel(int x, int y, const yafray::color_t &c, yafray::CFLOAT alpha, yafray::PFLOAT depth) { unsigned int px = ((R.recty-1)-y)*R.rectx; - unsigned char* bpt = (unsigned char*)R.rectot + (px<<2); + unsigned char* bpt = NULL; //(unsigned char*)R.rectot + (px<<2); int x4 = x<<2; int temp = (int)(c.R*255.f+0.5f); if (temp>255) temp=255; @@ -1927,29 +1929,29 @@ bool blenderYafrayOutput_t::putPixel(int x, int y, const yafray::color_t &c, bpt[x4+3] = temp; // float buffer - if ((R.r.mode & R_FBUF) && R.rectftot) { - float* fpt = R.rectftot + (px<<2); - fpt[x4] = c.R; - fpt[x4+1] = c.G; - fpt[x4+2] = c.B; - fpt[x4+3] = alpha; - } +// if ((R.r.mode & R_FBUF) && R.rectftot) { +// float* fpt = R.rectftot + (px<<2); +// fpt[x4] = c.R; +// fpt[x4+1] = c.G; +// fpt[x4+2] = c.B; +// fpt[x4+3] = alpha; +// } // depth values - int* zbuf = R.rectz + px; - depth -= R.near; - float mz = R.far - R.near; - if (depth<0) depth=0; else if (depth>mz) depth=mz; - if (mz!=0.f) mz = 2147483647.f/mz; - zbuf[x] = (int)(depth*mz); +// int* zbuf = R.rectz + px; +// depth -= R.clipsta; +// float mz = R.clipend - R.clipsta; +// if (depth<0) depth=0; else if (depth>mz) depth=mz; +// if (mz!=0.f) mz = 2147483647.f/mz; +// zbuf[x] = (int)(depth*mz); out++; if (out==4096) { - RE_local_render_display(0, R.recty-1, R.rectx, R.recty, R.rectot); + R.display_draw(R.result, NULL); out = 0; } - if (RE_local_test_break()) return false; + if (R.test_break()) return false; return true; } diff --git a/source/blender/yafray/intern/yafray_Render.h b/source/blender/yafray/intern/yafray_Render.h index e1a63e90bb7..a50954d2ed4 100644 --- a/source/blender/yafray/intern/yafray_Render.h +++ b/source/blender/yafray/intern/yafray_Render.h @@ -9,6 +9,7 @@ extern "C" { #include "IMB_imbuf_types.h" #include "DNA_camera_types.h" +#include "DNA_group_types.h" #include "DNA_image_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" @@ -22,8 +23,10 @@ extern "C" { #include "BKE_global.h" #include "BKE_image.h" -#include "render.h" +#include "render_types.h" +extern struct Render R; /* only to get it compile for now */ + /* useful matrix & vector operations */ #include "MTC_matrixops.h" #include "MTC_vectorops.h" diff --git a/source/creator/SConscript b/source/creator/SConscript index 11e2c835be3..412bb82e854 100644 --- a/source/creator/SConscript +++ b/source/creator/SConscript @@ -12,7 +12,6 @@ creator_env.Append (CPPPATH = ['#/intern/guardedalloc', '../blender/include', '../blender/blenloader', '../blender/imbuf', - '../blender/renderconverter', '../blender/render/extern/include', '../blender/python', '../blender/makesdna', diff --git a/source/creator/creator.c b/source/creator/creator.c index 141b55f4acb..3a47fbaa5e9 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -43,6 +43,7 @@ #include "GEN_messaging.h" #include "DNA_ID.h" +#include "DNA_scene_types.h" #include "BLI_blenlib.h" @@ -51,6 +52,7 @@ #include "BKE_font.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_material.h" #include "BKE_packedFile.h" #include "BKE_scene.h" @@ -72,13 +74,12 @@ #include "IMB_imbuf.h" // for quicktime_init -#include "RE_renderconverter.h" - #include "BPY_extern.h" +#include "RE_pipeline.h" + #include "playanim_ext.h" #include "mydevice.h" -#include "render.h" #include "nla.h" #include "datatoc.h" @@ -350,8 +351,8 @@ int main(int argc, char **argv) /* background render uses this font too */ BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size); - /* init struct R, Osa, defmaterial, filters */ - RE_init_render_data(); + + init_def_material(); if(G.background==0) { for(a=1; ar.sfra) = atoi(argv[a]); - (G.scene->r.efra) = (G.scene->r.sfra); - RE_animrender(NULL); + Render *re= RE_NewRender("Render"); + RE_BlenderAnim(re, G.scene, atoi(argv[a]), atoi(argv[a])); } break; case 'a': if (G.scene) { - RE_animrender(NULL); + Render *re= RE_NewRender("Render"); + RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); } break; case 'S': @@ -577,8 +578,8 @@ int main(int argc, char **argv) } } - if(G.background) - { + if(G.background) { + /* actually incorrect, but works for now (ton) */ exit_usiblender(); } @@ -615,7 +616,4 @@ void setCallbacks(void) BLI_setErrorCallBack(error_cb); /* */ BLI_setInterruptCallBack(blender_test_break); - /* render module: execution flow, timers, cursors and display. */ - RE_set_getrenderdata_callback(RE_rotateBlenderScene); - RE_set_freerenderdata_callback(RE_freeRotateBlenderScene); } diff --git a/source/nan_compile.mk b/source/nan_compile.mk index 8386a6d9ea7..5bee16b5dfd 100644 --- a/source/nan_compile.mk +++ b/source/nan_compile.mk @@ -82,8 +82,8 @@ ifeq ($(OS),darwin) CCC = g++ CFLAGS += -pipe -fPIC -ffast-math -mcpu=7450 -mtune=7450 CCFLAGS += -pipe -fPIC - REL_CFLAGS += -O2 - REL_CCFLAGS += -O2 +# REL_CFLAGS += -O2 +# REL_CCFLAGS += -O2 CPPFLAGS += -D_THREAD_SAFE NAN_DEPEND = true OPENGL_HEADERS = /System/Library/Frameworks/OpenGL.framework -- cgit v1.2.3